:root {
  --paper: #f7f6f2;
  --surface: #fffdf9;
  --ink: #222e27;
  --muted: #515e55;
  --green: #295441;
  --green-dark: #183327;
  --red: #944633;
  --danger: #8f362b;
  --gold: #795831;
  --accent: var(--red);
  --line: #e4dfd5;
  --field-border: #899387;
  --wash: #f0f1ea;
  --terracotta-wash: #f6ece3;
  --shadow: 0 10px 30px #3932240b;
  --glass-border: var(--line);
  --glass-shadow: var(--shadow);
}

body { background: var(--paper); }
::selection { background: var(--green-dark); color: #fffdf9; }

.nav {
  top: 8px;
  margin-top: 12px;
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.nav-inner {
  min-height: 65px;
  padding: 8px clamp(12px, 2vw, 24px);
  border: 1px solid #e4e0d7;
  border-radius: 22px;
  background: #fffefa;
  box-shadow: 0 8px 25px #342d2311;
}
.brand:hover { color: var(--green-dark); }
.brand-icon { box-shadow: 0 4px 10px #28332929; }
.brand-text strong { color: var(--green-dark); letter-spacing: .035em; }
.nav-item, .site-nav-toggle { border-radius: 999px; }
.nav-item:hover { color: var(--green-dark); background: var(--wash); }
.nav-item[aria-current="page"] { color: #853d2e; background: var(--terracotta-wash); }
.account-link, .site-nav-toggle { border-color: #d0cec4; }

.page-title {
  color: var(--green-dark);
  font-size: clamp(32px, 4.25vw, 49px);
  letter-spacing: .025em;
}
.page-desc { margin-block: 9px 24px; }
.account-page {
  max-width: 780px;
  margin-inline: auto;
}
.account-page > .page-title { margin-bottom: 24px; }
.account-page > .card { padding: clamp(17px, 3vw, 32px); }
.account-page .card h2 { font-size: clamp(19px, 2.5vw, 23px); }

.auth-layout {
  border-color: #e8e5da;
  background: var(--green-dark);
  box-shadow: 0 18px 45px #2e281e21;
}
.auth-panel {
  border-color: #fffffb;
  background: #fffdf7;
  box-shadow: 0 17px 36px #20261d34;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.auth-visual figcaption {
  background: #25372d;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.auth-team { color: var(--muted); }
.auth-team strong { color: #843f30; background: var(--terracotta-wash); }
.auth-form .auth-primary {
  border-radius: 999px;
  background: var(--green-dark);
  box-shadow: none;
}
.auth-form .auth-primary:hover { background: #295541; }
.auth-alert { border-color: #c7d2c1; background: var(--wash); }
.recovery-slip { background: var(--wash); }

.card, .stat-card, .herb-card, .article-grid .article-item,
.preview-bar, .workbench-metric, .workbench-menu {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.dashboard .card, .stat-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.card, .stat-card, .herb-card, .article-grid .article-item { border-radius: 19px; }
.stat-card { border-inline-start: 1px solid var(--line); }
.stat-card:nth-child(n) { border-inline-start-color: var(--line); }
.stat-card .num { letter-spacing: -.035em; }
.article-grid .article-item:hover, .herb-card:hover {
  border-color: #b9bcaf;
  box-shadow: 0 12px 28px #2b392519;
}
.article-cover, .herb-picture, .article-detail-cover, .herb-detail-photo,
.article-cover-preview, .admin-article-thumbnail {
  background: #efeee9;
}
.herb-card-body, .article-card-copy { padding: 17px 18px 19px; }
.article-item:hover .a-title, .herb-card:hover .name { color: var(--red); }

.btn {
  border-radius: 999px;
  background: var(--green-dark);
  box-shadow: none;
}
.btn:hover { background: #295541; }
.btn.ghost, .site-nav-toggle {
  border-color: #c2c8bc;
  color: var(--green-dark);
  background: var(--surface);
}
.btn.ghost:hover, .site-nav-toggle:hover { background: var(--wash); }
.tab:not(.active) { background: var(--surface); }
.tab:hover, .tab.active { border-color: #d0bcaa; color: #773b2a; background: var(--terracotta-wash); }
.tag { border-radius: 999px; background: var(--wash); color: #355443; }
.tag.gold { background: #f3ebdd; color: #704f28; }
.tag.red { background: #f6e7e1; color: #8b3e2d; }
.tree-counties button { background: var(--surface); }
.tree-counties button:hover { border-color: #b4bdaf; background: var(--wash); }
.data th { background: #eeeee7; }
.data tr:hover td { background: #f6f4ee; }

input:where(:not([type="checkbox"], [type="radio"])), select, textarea,
.auth-form .form-item > input {
  border: 1px solid var(--field-border);
  border-radius: 9px;
  background: #fdfcf8;
}
input::placeholder, textarea::placeholder { color: #59665d; }
input:where(:not([type="checkbox"], [type="radio"])):focus, select:focus, textarea:focus {
  border-color: var(--green);
  background: white;
}

.workbench-heading {
  border-color: transparent;
  background: var(--green-dark);
  color: #fffdf4;
  box-shadow: none;
}
.workbench-heading p { color: #e4eae2; }
.workbench-role { border-color: #f4f7e04d; background: #274434; color: #fcf7ed; }
.workbench-metric--pending { border-inline-start: 3px solid var(--red); }
.workbench-metric:hover { border-color: #b5c0b5; background: #f7f7ef; }
.workbench-tab:hover, .preview-links a:hover { background: var(--wash); }
.workbench-tab[aria-pressed="true"] { color: #803e2e; border-color: #e3d3c3; background: var(--terracotta-wash); }
.preview-links a[aria-current="page"] { background: var(--green-dark); }

.chat-assistant {
  border-color: #e5dbcd;
  background: #f4efe5;
  box-shadow: var(--shadow);
}
.chat-panel .chat-box { background: #f6f5ef; }
.msg.user .bubble { background: #e9eee6; color: #213a2b; }

.modal-mask { background: #20272099; }
.modal {
  border: 1px solid #e5e0d4;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 23px 70px #1c241c43;
}
.modal .close { border-radius: 999px; background: #f1f0e9; }
.modal .close:hover { background: var(--terracotta-wash); }
.yau-footer { background: #eeede6; border-top: 1px solid #e3ded2; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media not (prefers-reduced-transparency: reduce) {
    .nav-inner {
      border-color: #ffffffbf;
      background: #fffefaeb;
      -webkit-backdrop-filter: blur(17px) saturate(120%);
      backdrop-filter: blur(17px) saturate(120%);
    }
  }
}
@media (max-width: 640px) {
  .nav { top: 6px; margin-top: 7px; }
  .nav-inner { min-height: 60px; padding-inline: 9px; border-radius: 16px; }
  .brand { gap: 8px; }
  .brand-icon { width: 37px; height: 37px; }
  .card, .stat-card { border-radius: 15px; }
}
