:root {
  --page: #f3f0e8;
  --panel: #fffdf6;
  --panel-soft: #f4ecdd;
  --panel-border: #d9cda9;
  --text: #2d261c;
  --muted: #675d4d;
  --accent: #23543a;
  --accent-soft: #dfebdf;
  --shadow: 0 14px 34px rgba(47, 40, 28, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

a { color: var(--accent); }

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.breadcrumb {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.hero,
.tool-area,
.information,
.related {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

h1, h2, h3 { margin-top: 0; line-height: 1.16; letter-spacing: 0; }
h1 { margin-bottom: 10px; font-size: 3rem; }
h2 { margin-bottom: 12px; font-size: 1.38rem; }
h3 { margin-bottom: 6px; font-size: 1.02rem; }
.lead { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.08rem; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.tab {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.tab.selected {
  background: var(--accent);
  color: #fffdf6;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
}

.search-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label { font-weight: 700; }

input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #cdbb97;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--text);
  font: inherit;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(35, 84, 58, 0.23);
  outline-offset: 2px;
}

.hint,
.source-note,
.result-heading p,
.information p {
  margin: 0;
  color: var(--muted);
}

.length-group span { display: block; margin-bottom: 5px; }
.length-group small { color: var(--muted); font-weight: 400; }

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.primary-button { margin-top: 4px; background: var(--accent); color: #fffdf6; }
.secondary-button { background: #fffdf6; color: var(--accent); }
.source-note { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--panel-border); font-size: 0.93rem; }

.results-panel {
  min-height: 360px;
  padding-left: 22px;
  border-left: 1px solid var(--panel-border);
}

.result-heading { margin-bottom: 14px; }
.result-heading h2 { margin-bottom: 4px; }

.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.results li {
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: var(--panel-soft);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.results li strong { color: var(--accent); }

.information {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 28px;
}

.faq {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.faq article {
  padding-left: 12px;
  border-left: 2px solid var(--panel-border);
}

.related nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related a {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 820px) {
  .page-shell { width: min(100% - 18px, 1120px); padding: 14px 0 28px; }
  .hero, .tool-area, .information, .related { padding: 16px; }
  h1 { font-size: 2.1rem; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace, .information, .faq { grid-template-columns: 1fr; }
  .results-panel { min-height: 240px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--panel-border); }
  .results { grid-template-columns: 1fr; }
}
