:root {
  color-scheme: light;
  --paper: #fbf7eb;
  --surface: #fffdf7;
  --surface-soft: #f4ecdc;
  --ink: #17211e;
  --muted: #5f6b66;
  --evergreen: #0f4a3d;
  --evergreen-dark: #0a332d;
  --moon: #1e5476;
  --amber: #b37a26;
  --amber-soft: #ead3a2;
  --line: #d9cfbd;
  --line-strong: #b9aa90;
  --shadow: 0 22px 60px rgba(27, 38, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(179, 122, 38, 0.14), transparent 34rem),
    linear-gradient(180deg, #f7f0df 0%, var(--paper) 46%, #f8f4eb 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  border-radius: 6px;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(30, 84, 118, 0.3);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 52px;
}

.hero {
  margin-bottom: 20px;
}

.topline {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.topline a {
  color: var(--evergreen-dark);
  font-weight: 750;
  text-decoration: none;
}

.topline a:hover {
  color: var(--moon);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--moon);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 920px;
  margin: 0;
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-text {
  max-width: 900px;
  margin: 18px 0 0;
  color: #26352f;
  font-size: 1.06rem;
}

.trust-note {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(27, 38, 31, 0.08);
}

.trust-note strong {
  color: var(--evergreen-dark);
}

.trust-note span,
.field-help,
.status-line,
.action-bar p,
.favorites-list,
.result-count {
  color: var(--muted);
}

.tool-panel {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.control-panel {
  display: grid;
  gap: 10px;
  padding: 22px;
  background: linear-gradient(180deg, #fffdf7 0%, #f4ecdc 100%);
  border-right: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.section-title span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: #e6d3a8;
  color: var(--evergreen-dark);
  border-radius: 50%;
  font-weight: 850;
}

.section-title h2 {
  margin: 0;
  color: var(--evergreen-dark);
  font-size: 0.88rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.control-panel label,
.tone-field legend {
  color: #222c29;
  font-size: 0.88rem;
  font-weight: 760;
}

.control-panel label span {
  color: var(--muted);
  font-weight: 520;
}

select,
input[type="text"] {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.field-help {
  margin: -2px 0 4px;
  font-size: 0.8rem;
}

.tone-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
}

.tone-field legend {
  width: 100%;
  margin-bottom: 2px;
}

.tone-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--evergreen-dark);
}

.primary-action,
.secondary-action,
.action-bar button {
  min-height: 44px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 820;
}

.primary-action {
  margin-top: 8px;
  background: var(--evergreen);
  color: #fff;
}

.primary-action:hover {
  background: var(--evergreen-dark);
}

.secondary-action,
.action-bar button {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--evergreen-dark);
}

.secondary-action:hover,
.action-bar button:hover {
  border-color: var(--evergreen);
  background: #f8f2e6;
}

.results-panel {
  min-width: 0;
  padding: 24px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.result-count,
.status-line {
  margin: 0;
}

.name-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 380px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.name-card {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 14px;
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.name-card.saved {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(179, 122, 38, 0.24);
}

.name-card h3 {
  margin: 0;
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.18;
}

.name-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.save-button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--amber);
  border-radius: 50%;
  font-weight: 850;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 7px;
  background: #edf4ef;
  color: var(--evergreen-dark);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 760;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.action-bar p {
  flex: 1 1 220px;
  margin: 0;
  font-size: 0.9rem;
}

.favorites-strip,
.faq-section {
  margin-top: 18px;
  padding: 20px;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.favorites-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.favorite-pill {
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--evergreen-dark);
  font-weight: 740;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.guide-grid article {
  padding: 20px;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guide-grid h2 {
  margin: 0 0 10px;
  color: var(--evergreen-dark);
  font-size: 1.18rem;
}

.guide-grid h3 {
  margin: 0 0 4px;
  color: var(--moon);
  font-size: 0.98rem;
}

.guide-grid p,
.guide-grid li,
.faq-item p {
  color: #33423d;
}

.guide-grid ol,
.guide-grid ul {
  margin: 0;
  padding-left: 20px;
}

.example-list {
  display: grid;
  gap: 12px;
}

.example-list > div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.example-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.checklist {
  display: grid;
  gap: 8px;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-item button {
  width: 100%;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--evergreen-dark);
  font-weight: 830;
  text-align: left;
}

.faq-item p {
  margin: 0 0 14px;
  max-width: 900px;
}

@media (max-width: 980px) {
  .hero-grid,
  .tool-panel,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .name-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 24px, 1400px);
    padding-top: 14px;
  }

  .topline {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  h1 {
    font-size: 3rem;
  }

  .hero-grid {
    gap: 16px;
  }

  .control-panel,
  .results-panel,
  .guide-grid article,
  .favorites-strip,
  .faq-section {
    padding: 16px;
  }

  .results-header,
  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .name-list {
    grid-template-columns: 1fr;
  }

  .tone-field label {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}
