:root {
  /* Palette — every colour reference in this file derives from these six. */
  --color-pale-slate:  #CACFD6;   /* lightest — page background */
  --color-azure-mist:  #D6E5E3;   /* tinted surface */
  --color-pearl-aqua:  #9FD8CB;   /* mid teal — primary buttons, accents */
  --color-deep-teal:   #517664;   /* nav, links, headings, borders on focus */
  --color-dark-khaki:  #2D3319;   /* footer */
  --color-charcoal:    #36454F;   /* primary text */
  --color-white:       #ffffff;

  /* Semantic mappings */
  --bg:              var(--color-pale-slate);
  --surface:         var(--color-white);
  --surface-tint:    var(--color-azure-mist);
  --text:            var(--color-charcoal);
  --text-muted:      var(--color-deep-teal);
  --text-faint:      rgba(54, 69, 79, 0.6);   /* charcoal at 60 % */
  --border:          var(--color-pale-slate);
  --border-strong:   var(--color-pale-slate);
  --accent:          var(--color-deep-teal);
  --accent-soft:     var(--color-azure-mist);
  --accent-text:     var(--color-deep-teal);
  --accent-pearl:    var(--color-pearl-aqua);

  --nav-bg:          var(--color-deep-teal);
  --nav-text:        var(--color-white);
  --nav-active:      var(--color-pearl-aqua);

  --footer-bg:       var(--color-dark-khaki);
  --footer-text:     var(--color-azure-mist);

  /* Semantic warning amber — kept for the "Possible — check notes" badge
     where colour meaning needs to remain unambiguous. */
  --warn-amber-bg:   #F0C97A;
  --warn-amber-text: #7A5400;

  /* Error / failure — for "won't survive", copy-failed and similar states. */
  --error-bg:        #f0d6d6;
  --error-text:      #6b3030;
  --error-border:    #d6a8a8;

  /* Legacy aliases kept so older rules still resolve cleanly. */
  --warn:      var(--warn-amber-text);
  --warn-soft: var(--warn-amber-bg);

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --max-width: 720px;

  /* dark mode — to be revisited */
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 720px) {
  body { font-size: 17px; }
}

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

@media (min-width: 720px) {
  .app { padding: 48px 32px 96px; }
}

/* Persistent site nav */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  background: var(--nav-bg);
  color: var(--nav-text);
}

@media (min-width: 720px) {
  .site-nav { padding: 18px 32px; }
}

.site-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--nav-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}

.site-name:hover { color: var(--nav-active); }

.site-tagline {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--nav-active);
  margin-top: 1px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.nav-links a:hover { color: var(--nav-active); }

.nav-links a.nav-active {
  color: var(--nav-text);
  border-bottom-color: var(--nav-active);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--nav-active);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Persistent zones strip (below nav, above main) */

.zones-strip {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--color-dark-khaki);
  font-size: 0.81rem;            /* ~13 px */
  color: var(--footer-text);
}

.zones-strip-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  justify-content: space-between;
}

@media (min-width: 720px) {
  .zones-strip-inner { padding: 8px 32px; }
}

.zones-strip-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  min-width: 0;
}

.zones-strip-label {
  color: var(--footer-text);
  text-transform: none;
  letter-spacing: normal;
}

.zones-strip-values {
  color: var(--color-white);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.zones-strip-link {
  color: var(--nav-active);
  text-decoration: none;
  border-bottom: 1px solid rgba(159, 216, 203, 0.5);
  padding-bottom: 1px;
  white-space: nowrap;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.zones-strip-link:hover {
  color: var(--color-white);
  border-bottom-color: var(--color-white);
}

.zones-strip-link:focus-visible {
  outline: 2px solid var(--nav-active);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Per-view headers (used by quiz and crosscheck views) */

.view-header {
  margin-bottom: 32px;
}

.view-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

@media (min-width: 720px) {
  .view-header h1 { font-size: 1.75rem; }
}

.subtitle {
  color: var(--text-muted);
  margin: 0;
  max-width: 56ch;
}

/* Home view */

.home-intro {
  margin-bottom: 36px;
}

.home-intro h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

@media (min-width: 720px) {
  .home-intro h1 { font-size: 1.9rem; }
}

.home-intro p {
  color: var(--text-muted);
  margin: 0;
  max-width: 60ch;
}

.home-subhead {
  font-size: 1.05rem;
  line-height: 1.5;
}

.home-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 40px;
}

@media (min-width: 600px) {
  .home-cards { grid-template-columns: 1fr 1fr; }
}

.home-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, transform 0.06s ease;
}

.home-card:hover {
  background: var(--surface-tint);
  border-color: var(--accent);
}

.home-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home-card:active { transform: translateY(1px); }

.home-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.home-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  flex: 1;
}

.card-arrow {
  margin-top: 6px;
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
}

.home-card-disabled {
  background: var(--color-pale-slate);
  border-color: var(--color-pale-slate);
  cursor: not-allowed;
  box-shadow: none;
  color: rgba(54, 69, 79, 0.5);
}

.home-card-disabled h2 { color: rgba(54, 69, 79, 0.5); }
.home-card-disabled p { color: rgba(54, 69, 79, 0.5); }

.card-pill {
  align-self: flex-start;
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 12px;
  margin-bottom: 4px;
}

.home-footer {
  margin-top: 36px;
  padding: 20px 24px;
  background: var(--footer-bg);
  color: var(--footer-text);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  max-width: none;
}

.home-footer p {
  margin: 0;
  color: var(--footer-text);
}

.home-footer p + p { margin-top: 8px; }

.home-footer a {
  color: var(--nav-active);
  text-decoration: underline;
  text-decoration-color: rgba(159, 216, 203, 0.5);
  text-underline-offset: 2px;
}
.home-footer a:hover {
  color: var(--color-white);
  text-decoration-color: var(--color-white);
}

/* Saved-profile card (home view) */

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 16px 17px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-pearl);
  border-radius: var(--radius-lg);
  color: var(--text);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.profile-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.zone-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.zone-summary li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dotted var(--border);
}

.zone-summary li:last-child { border-bottom: none; }

.zone-row-name {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.zone-row-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.saved-date {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.profile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 4px;
}

.profile-action {
  color: var(--accent-text);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.12s ease;
}

.profile-action:hover { border-bottom-color: var(--accent); }

.profile-action-primary {
  color: var(--accent);
  font-weight: 600;
}

.profile-clear {
  margin-top: 4px;
  text-align: right;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-button:hover { color: var(--text-muted); }

.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.link-danger { color: var(--error-text); }
.link-danger:hover { opacity: 0.85; }

.clear-confirm {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Save profile panel on results */

.profile-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}

.profile-save-text { flex: 1 1 240px; min-width: 0; }

.profile-save-text h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent-text);
}

.profile-save-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent-text);
  line-height: 1.5;
}

.profile-save .btn { white-space: nowrap; }

/* Crosscheck view — needs-quiz CTA and meta line */

.needs-quiz {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.needs-quiz p {
  margin: 0 0 16px;
  color: var(--accent-text);
}

.needs-quiz .btn {
  display: inline-block;
  text-decoration: none;
}

.crosscheck-meta {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.muted-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}

.muted-link:hover { color: var(--accent); }

/* Quiz */

.quiz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .quiz { padding: 36px 40px 32px; }
}

.progress {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.15s ease;
}

.dot-done { background: var(--accent); }

.dot-active {
  background: var(--accent-pearl);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.question-number {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 8px;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

@media (min-width: 720px) {
  .question-text { font-size: 1.4rem; }
}

.question-help {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.options {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.option {
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.06s ease;
}

.option:hover {
  border-color: var(--accent);
  background: var(--surface-tint);
}

.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option:active { transform: translateY(1px); }

.option-selected {
  border-color: var(--accent);
  background: var(--accent-pearl);
  color: var(--text);
}

.quiz-controls {
  display: flex;
  justify-content: flex-start;
}

.btn {
  font: inherit;
  background: var(--accent-pearl);
  color: var(--text);
  border: 1px solid var(--accent-pearl);
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  background: var(--accent);
  color: var(--color-white);
  border-color: var(--accent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--surface-tint);
  color: var(--accent);
  border-color: var(--accent);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-success {
  background: var(--accent);
  color: var(--color-white);
  border-color: var(--accent);
}

.btn-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: var(--error-border);
}

/* Results */

.results h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

@media (min-width: 720px) {
  .results h2 { font-size: 1.4rem; }
}

.results-intro {
  color: var(--text-muted);
  margin: 0 0 28px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (min-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-na { background: var(--bg); }

.card-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-system {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.card-zone-prefix {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-zone {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.1;
}

.card-zone-na {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
}

.card-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-direction {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.arrow {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.card-direction-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent-text);
}

.card-interpretation {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Caveats */

.caveats {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.caveats h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.caveats-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.95rem;
}

.caveats-list li + li { margin-top: 10px; }

.results-controls {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

/* Reverse lookup */

.reverse-lookup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.reverse-lookup h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.reverse-intro {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.reverse-intro code,
.reverse-error code {
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

.reverse-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reverse-form input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.reverse-form input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.reverse-output {
  margin-top: 20px;
}

.reverse-error {
  padding: 14px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  color: var(--error-text);
}

.reverse-error p { margin: 0 0 6px; }
.reverse-error p:last-child { margin-bottom: 0; }

.reverse-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rating-meaning {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-left: 3px solid var(--border-strong);
  padding-left: 12px;
}

/* Verdict badge */

.verdict {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.verdict-label {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.verdict-sub {
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.verdict-yes {
  background: var(--accent-pearl);
  border-color: var(--accent);
  color: var(--text);
}

.verdict-likely {
  background: var(--surface-tint);
  border-color: var(--accent);
  color: var(--text);
}

.verdict-marginal {
  background: var(--color-pale-slate);
  border-color: var(--text-faint);
  color: var(--text);
}

.verdict-no {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

/* Check rows */

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.check-icon {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

.check-pass .check-icon { color: var(--accent); }
.check-marginal .check-icon { color: var(--warn-amber-text); }
.check-fail .check-icon { color: var(--error-text); }

.check-label {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.check-detail {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.limit-note {
  margin: 0;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--accent-text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* References view — editorial layout, no cards */

.ref-content {
  max-width: 64ch;
}

.ref-content > h2 {
  font-size: 1.125rem;     /* 18 px at 16 px base */
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.ref-content > h2:first-child { margin-top: 0; }

.ref-system {
  margin-bottom: 22px;
}

.ref-system h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ref-system p {
  margin: 0 0 4px;
  color: var(--text);
}

.ref-link {
  margin-top: 4px;
  font-size: 0.88rem;
}

.ref-link a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(81, 118, 100, 0.4);
  text-underline-offset: 2px;
  transition: color 0.12s ease, text-decoration-color 0.12s ease;
}

.ref-link a:hover {
  color: var(--accent-pearl);
  text-decoration-color: var(--accent-pearl);
}

.ref-link a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.ref-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ref-links li p:first-child {
  margin: 0 0 2px;
  color: var(--text);
}

.ref-footnote {
  margin: 44px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: rgba(54, 69, 79, 0.7);
  font-size: 0.875rem;     /* 14 px */
  line-height: 1.65;
}

/* Plants view */

.plants-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: sticky;
  top: 8px;
  z-index: 5;
  box-shadow: var(--shadow);
}

.plants-search {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.plants-search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.plants-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.plants-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}

.cat-pill {
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-transform: lowercase;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.cat-pill:hover {
  border-color: var(--accent);
  background: var(--surface-tint);
}

.cat-pill-active {
  background: var(--accent);
  color: var(--color-white);
  border-color: var(--accent);
}

.cat-pill-active:hover {
  background: var(--accent);
  color: var(--color-white);
}

.cat-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.plants-compat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.plants-compat-toggle input[type="checkbox"] {
  margin: 0;
  accent-color: var(--accent);
}

.plants-count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.plants-no-profile {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.plants-no-profile a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(81, 118, 100, 0.4);
  text-underline-offset: 2px;
}

.plants-no-profile a:hover { text-decoration-color: var(--accent); }

.plants-empty {
  margin: 32px 0;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.plants-empty .link-button { margin-left: 8px; }

/* Plant grid */

.plants-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .plants-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .plants-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.plant-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, transform 0.06s ease;
}

.plant-card:hover { border-color: var(--accent); }

.plant-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.plant-card:active { transform: translateY(1px); }

.plant-card-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.plant-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.plant-card-names { min-width: 0; flex: 1; }

.plant-card-common {
  margin: 0;
  font-size: 0.94rem;     /* 15 px */
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.plant-card-botanical {
  margin: 2px 0 0;
  font-size: 0.81rem;     /* 13 px */
  color: var(--text-muted);
  font-style: italic;
}

.plant-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.plant-card-cat {
  font-size: 0.7rem;
  padding: 2px 7px;
  background: var(--surface-tint);
  color: var(--text-muted);
  border-radius: 999px;
  text-transform: lowercase;
}

.plant-card-cat-more {
  background: transparent;
  color: var(--text-faint);
}

.plant-card-usda {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Compatibility badges */

.compat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-great    { background: var(--accent-pearl);    color: var(--accent);          border: 1px solid var(--accent); }
.badge-possible { background: var(--warn-amber-bg);   color: var(--warn-amber-text); border: 1px solid var(--warn-amber-text); }
.badge-marginal { background: var(--color-pale-slate); color: var(--text);            border: 1px solid var(--color-pale-slate); }
.badge-unlikely { background: var(--surface);         color: rgba(54, 69, 79, 0.6);   border: 1px solid var(--border); }

/* Plant detail panel — full-width row inside the grid */

.plant-detail {
  grid-column: 1 / -1;
  position: relative;
  padding: 22px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plant-detail-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.plant-detail-close:hover {
  color: var(--text);
  background: var(--bg);
}

.plant-detail-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.plant-detail-botanical {
  margin: -8px 0 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.plant-detail-zones {
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}

.plant-detail-zones th,
.plant-detail-zones td {
  padding: 4px 12px 4px 0;
  text-align: left;
  vertical-align: baseline;
}

.plant-detail-zones th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.plant-detail-zones td {
  color: var(--accent-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plant-detail-checks {
  margin: 0;
}

.plant-detail-no-profile {
  margin: 0;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--accent-text);
}

.plant-detail-no-profile a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}

.plant-detail-description {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.plant-detail-notes {
  margin: 0;
  padding-left: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.plant-detail-notes li + li { margin-top: 6px; }

.plant-detail-actions {
  margin-top: 4px;
}

/* AdSense ad units — AdSense itself controls the unit's internal sizing
   (responsive auto, leaderboard on desktop, mobile banner on small screens),
   so the wrapper just enforces width, centring, and a min-height to reserve
   space while the ad loads. */

.ad-unit {
  width: 100%;
  overflow: hidden;
  text-align: center;
}

.ad-unit--results {
  margin: 1.5rem 0;
  min-height: 100px;
}

.ad-unit--footer {
  margin-bottom: 1.5rem;
  min-height: 90px;
  border-top: 1px solid var(--color-pale-slate);
  padding-top: 1.5rem;
}

/* Site-wide footer — sits below main content, contains the footer ad
   and a small links row. Uses the dark-khaki palette block. */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 28px 20px;
  margin-top: 32px;
}

@media (min-width: 720px) {
  .site-footer { padding: 32px; }
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer-meta {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--footer-text);
  opacity: 0.85;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.85rem;
  color: var(--footer-text);
}

.site-footer-links a {
  color: var(--nav-active);
  text-decoration: underline;
  text-decoration-color: rgba(159, 216, 203, 0.5);
  text-underline-offset: 2px;
}

.site-footer-links a:hover {
  color: var(--color-white);
  text-decoration-color: var(--color-white);
}

[hidden] { display: none !important; }
