/* ==========================================================================
   Mid West Regional Drought Resilience Planning — Design System
   Built by Aristos AI · Every pixel matters, every interaction delights.
   
   Brand: Mid West Development Commission — Regional Drought Resilience Planning
   Aligned with the Future Drought Fund / Department of Agriculture, Fisheries
   and Forestry visual language:
   Primary: #374A3F (deep forest green — the program signature)
   Accent:  #0D5257 (deep teal — water, evidence, clarity)
   Warm:    #E09600 (gold — community, warmth, sun)
   Earth:   #7B3628 (earth brown — landscape, drought country)
   
   Fonts: Open Sans (headings + body — gov.au-aligned readability)
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  /* Program brand colors (FDF / agriculture.gov.au aligned) */
  --brand-forest: #374A3F;
  --brand-forest-2: #43544A;
  --brand-forest-3: #50645A;
  --brand-forest-rgb: 55, 74, 63;
  --brand-teal: #0D5257;
  --brand-teal-2: #10666C;
  --brand-teal-rgb: 13, 82, 87;
  --brand-gold: #E09600;
  --brand-gold-2: #F5B84C;
  --brand-gold-rgb: 224, 150, 0;
  --brand-earth: #7B3628;
  --brand-cream: #F7FAF8;
  --brand-sand: #E2E9E5;

  /* Aristos co-brand (subtle, attribution only) */
  --aristos-jacarta: #2D2769;
  --aristos-lavender: #9889C0;

  /* Surface system */
  --bg: #F6F8F6;
  --bg-2: #EFF3F0;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-elevated: #ffffff;
  --subtle: #F8FAF8;
  --overlay: rgba(13, 82, 87, 0.04);

  /* Borders */
  --border: #DDE4DF;
  --border-light: #EBF0EC;
  --border-strong: #C8D2CB;
  --border-focus: var(--brand-teal);

  /* Text */
  --ink: #16211C;
  --text-1: #24312B;
  --text-2: #5B6B62;
  --text-3: #8A988F;
  --text-inverse: #ffffff;
  --text-on-forest: #F2F7F3;
  --text-on-forest-2: rgba(242, 247, 243, 0.72);

  /* Semantic */
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* Subject area colors — RDRP theme aligned */
  --subject-water: #006A94;
  --subject-water-bg: #EAF4F8;
  --subject-agri: #4E7B3A;
  --subject-agri-bg: #F0F5EA;
  --subject-comm: #7B3628;
  --subject-comm-bg: #F7EFEA;
  --subject-env: #1B5C3E;
  --subject-env-bg: #E9F2EC;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;
  --r-circle: 50%;

  /* Shadows — grounded, earthy, not cold grey */
  --sh-xs: 0 1px 2px rgba(22, 33, 28, 0.04);
  --sh-sm: 0 1px 3px rgba(22, 33, 28, 0.06), 0 1px 2px rgba(22, 33, 28, 0.04);
  --sh-md: 0 4px 12px rgba(22, 33, 28, 0.06), 0 2px 4px rgba(22, 33, 28, 0.04);
  --sh-lg: 0 12px 32px rgba(22, 33, 28, 0.08), 0 4px 8px rgba(22, 33, 28, 0.04);
  --sh-xl: 0 24px 56px rgba(22, 33, 28, 0.10), 0 8px 16px rgba(22, 33, 28, 0.06);
  --sh-focus: 0 0 0 3px rgba(13, 82, 87, 0.18);
  --sh-forest: 0 8px 24px rgba(22, 33, 28, 0.16);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur: 0.25s;
  --dur-slow: 0.4s;

  /* Layout */
  --nav-w: 264px;
  --nav-w-collapsed: 72px;
  --topbar-h: 64px;
  --content-max: 1280px;
  --gap: 24px;
  --gap-sm: 16px;
  --gap-xs: 8px;

  /* Type scale */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;
  --fs-6xl: 3.75rem;

  /* Fonts */
  --font-head: "Open Sans", "Inter", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-teal); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--brand-forest); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ---- Accessibility ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--brand-teal); outline-offset: 2px; border-radius: var(--r-xs); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; color: var(--brand-forest); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-4xl); font-weight: 800; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }
p { line-height: 1.65; color: var(--text-2); }
strong { color: var(--text-1); font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--subtle); padding: 2px 6px; border-radius: var(--r-xs); color: var(--brand-forest); }

/* ---- App shell ---- */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "nav topbar" "nav main";
  min-height: 100vh;
}

/* ---- Sidebar navigation ---- */
.nav {
  grid-area: nav;
  background: linear-gradient(180deg, var(--brand-forest) 0%, var(--brand-forest-2) 100%);
  color: var(--text-on-forest);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 82, 87, 0.45) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb {
  background: rgba(13, 82, 87, 0.5);
  border-radius: 3px;
  border: none;
}
.nav::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 82, 87, 0.8);
}
.nav::-webkit-scrollbar-corner { background: transparent; }
.nav-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.nav-brand .brand-text {
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-on-forest);
  line-height: 1.35;
}
.nav-section { padding: 16px 12px; }
.nav-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(242, 247, 243, 0.4);
  padding: 8px 12px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-on-forest-2);
  font-size: var(--fs-base);
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-on-forest);
}
.nav-link.active {
  background: rgba(13, 82, 87, 0.16);
  color: #fff;
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--brand-teal);
  border-radius: 0 3px 3px 0;
}
.nav-link .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-label-wrap { display: flex; flex-direction: column; gap: 1px; }
.nav-label-wrap .nav-label { font-size: var(--fs-sm); }
.nav-label-wrap .nav-desc {
  font-size: 10px;
  color: rgba(242, 247, 243, 0.35);
  font-weight: 400;
  line-height: 1.2;
}
.nav-link:hover .nav-desc { color: rgba(242, 247, 243, 0.5); }
.nav-link.active .nav-desc { color: rgba(242, 247, 243, 0.5); }

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.crumb-link {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}
.crumb-link:hover { color: var(--brand-teal); text-decoration: underline; }
.crumb-current {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.crumb-sep { color: var(--text-3); opacity: 0.55; flex-shrink: 0; }

/* ---- User menu as link ---- */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.user-menu:hover { border-color: var(--brand-teal); box-shadow: var(--sh-sm); }
.user-menu .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm); color: #fff;
}
.nav-label-wrap { display: flex; flex-direction: column; gap: 1px; }
.nav-label-wrap .nav-label { font-size: var(--fs-sm); }
.nav-label-wrap .nav-desc {
  font-size: 10px;
  color: rgba(242, 247, 243, 0.35);
  font-weight: 400;
  line-height: 1.2;
}
.nav-link:hover .nav-desc { color: rgba(242, 247, 243, 0.5); }
.nav-link.active .nav-desc { color: rgba(242, 247, 243, 0.5); }

/* ---- User menu as link ---- */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.user-menu:hover { border-color: var(--brand-teal); box-shadow: var(--sh-sm); }
.user-menu .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm); color: #fff;
}
.nav-link .nav-badge {
  margin-left: auto;
  background: var(--brand-teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  line-height: 1.4;
}
.nav-footer {
  margin-top: auto;
  padding: 14px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-footer-sovereign {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(224, 150, 0, 0.7);
  letter-spacing: 0.03em;
}
.sovereign-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-gold);
  box-shadow: 0 0 6px rgba(224, 150, 0, 0.5);
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}
.nav-footer-copy {
  font-size: 10px;
  color: rgba(242, 247, 243, 0.25);
}
.nav-footer-built {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: rgba(242, 247, 243, 0.25);
}
.nav-footer-built img {
  height: 12px;
  opacity: 0.4;
  filter: brightness(0) invert(1);
  transition: opacity var(--dur-fast) var(--ease);
}
.nav-footer-built:hover img { opacity: 0.7; }

/* ---- Topbar ---- */
.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--sh-xs);
}
.topbar-lead {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-title {
  font-family: var(--font-head);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-forest);
  line-height: 1.25;
}
.topbar-sub {
  font-size: var(--fs-sm);
  color: var(--text-3);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62ch;
}
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  width: 320px;
  transition: all var(--dur-fast) var(--ease);
}
.topbar-search:focus-within {
  border-color: var(--brand-teal);
  box-shadow: var(--sh-focus);
  background: var(--surface);
}
.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: var(--fs-sm);
  color: var(--text-1);
}
.topbar-search input::placeholder { color: var(--text-3); }

/* ---- User menu ---- */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.user-menu:hover { background: var(--subtle); }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-circle);
  background: linear-gradient(135deg, var(--brand-forest), var(--brand-teal));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }
.user-role { font-size: var(--fs-xs); color: var(--text-3); }

/* ---- Main content ---- */
.main {
  grid-area: main;
  padding: 32px;
  overflow-y: auto;
}
.main-inner { max-width: var(--content-max); margin: 0 auto; }

/* ---- Page header ---- */
.page-head { margin-bottom: 32px; }
.page-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-teal);
  margin-bottom: 12px;
}
.page-head .eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--brand-teal);
  border-radius: 2px;
}
.page-head h1 {
  font-size: var(--fs-4xl);
  font-weight: 800;
  margin-bottom: 8px;
}
.page-head .lead {
  font-size: var(--fs-lg);
  color: var(--text-2);
  max-width: 68ch;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-lg);
    border-color: var(--border-strong);
  }
}
.card-ic {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
}
.card h3 { font-size: var(--fs-lg); margin-bottom: 8px; }
.card p { font-size: var(--fs-sm); }

/* ---- Grid ---- */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--brand-forest);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-forest-3);
  color: #fff;
  box-shadow: var(--sh-forest);
}
.btn-accent {
  background: var(--brand-teal);
  color: #fff;
}
.btn-accent:hover {
  background: var(--brand-teal-2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 82, 87, 0.3);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-1);
}
.btn-outline:hover {
  background: var(--subtle);
  border-color: var(--brand-teal);
  color: var(--brand-forest);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--subtle); color: var(--text-1); }
.btn-sm { padding: 6px 14px; font-size: var(--fs-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--fs-md); }

/* ---- Badges & pills ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-burgundy { background: rgba(22, 33, 28, 0.08); color: var(--brand-forest); }
.badge-orange { background: rgba(13, 82, 87, 0.1); color: var(--brand-teal); }
.badge-warm { background: rgba(224, 150, 0, 0.12); color: #8F6A00; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Subject area badges */
.badge-water { background: var(--subject-water-bg); color: var(--subject-water); }
.badge-agri { background: var(--subject-agri-bg); color: var(--subject-agri); }
.badge-comm { background: var(--subject-comm-bg); color: var(--subject-comm); }
.badge-env { background: var(--subject-env-bg); color: var(--subject-env); }

/* ---- Callouts ---- */
.callout {
  border-radius: var(--r-lg);
  padding: 20px 24px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-gold);
  background: var(--subtle);
}
.callout h4 { color: var(--brand-forest); margin-bottom: 8px; }
.callout p { font-size: var(--fs-sm); }
.callout-info { border-left-color: var(--info); background: var(--info-bg); }
.callout-success { border-left-color: var(--success); background: var(--success-bg); }
.callout-warn { border-left-color: var(--warning); background: var(--warning-bg); }
.callout-danger { border-left-color: var(--danger); background: var(--danger-bg); }

/* ---- Tables ---- */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th {
  background: var(--brand-forest);
  color: #fff;
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 14px 16px; border-top: 1px solid var(--border-light); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--subtle); }
tbody tr:hover { background: rgba(13, 82, 87, 0.04); }

/* ---- Subject tiles ---- */
.subject-tile {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
.subject-tile:hover { transform: translateY(-4px); box-shadow: var(--sh-xl); }
.subject-tile::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.subject-tile:hover::after { transform: scaleX(1); }
.subject-tile-water { background: linear-gradient(135deg, var(--subject-water-bg), #D3EBF3); }
.subject-tile-water::after { background: var(--subject-water); }
.subject-tile-water h3 { color: var(--subject-water); }
.subject-tile-agri { background: linear-gradient(135deg, var(--subject-agri-bg), #E2EFD8); }
.subject-tile-agri::after { background: var(--subject-agri); }
.subject-tile-agri h3 { color: var(--subject-agri); }
.subject-tile-comm { background: linear-gradient(135deg, var(--subject-comm-bg), #EFE0D8); }
.subject-tile-comm::after { background: var(--subject-comm); }
.subject-tile-comm h3 { color: var(--subject-comm); }
.subject-tile-env { background: linear-gradient(135deg, var(--subject-env-bg), #DCEAE1); }
.subject-tile-env::after { background: var(--subject-env); }
.subject-tile-env h3 { color: var(--subject-env); }
.subject-tile .tile-count {
  font-family: var(--font-head);
  font-size: var(--fs-5xl);
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  margin-top: auto;
}
.subject-tile .tile-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 500;
}

/* ---- Stat cards ---- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-head);
  font-size: var(--fs-4xl);
  font-weight: 800;
  color: var(--brand-forest);
  line-height: 1;
}
.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 500;
}
.stat-trend {
  font-size: var(--fs-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ---- Resource card ---- */
.resource-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: all var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resource-card:hover {
  border-color: var(--brand-teal);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.resource-card .res-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.resource-card h4 { font-size: var(--fs-md); color: var(--text-1); margin: 0; }
.resource-card .res-excerpt { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.resource-card .res-source { font-size: var(--fs-xs); color: var(--text-3); }

/* ---- Chat ---- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 64px);
  max-height: 720px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 80%;
}
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-circle);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
}
.chat-msg.user .chat-msg-avatar { background: var(--brand-teal); color: #fff; }
.chat-msg.ai .chat-msg-avatar { background: var(--brand-forest); color: #fff; }
.chat-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  box-shadow: var(--sh-xs);
}
.chat-msg.user .chat-msg-bubble { background: var(--brand-forest); color: #fff; border-color: var(--brand-forest); }
.chat-msg.ai .chat-msg-bubble { background: var(--surface); }
.chat-msg-bubble .source-cards {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg-bubble .source-card {
  font-size: var(--fs-xs);
  padding: 8px 12px;
  background: var(--subtle);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--brand-gold);
}
.chat-input-bar {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: var(--fs-sm);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.chat-input:focus { border-color: var(--brand-teal); box-shadow: var(--sh-focus); }
.chat-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 24px 12px;
}
.chat-suggestion {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  background: var(--surface);
}
.chat-suggestion:hover { border-color: var(--brand-teal); color: var(--brand-forest); background: rgba(13, 82, 87, 0.04); }

/* ---- Listen button ---- */
.btn-listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(224, 150, 0, 0.1);
  color: #8F6A00;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  border: 1px solid transparent;
}
.btn-listen:hover { background: rgba(224, 150, 0, 0.18); border-color: var(--brand-gold); }
.btn-listen.playing { background: var(--brand-gold); color: #fff; }

/* ---- Demo banner ---- */
.demo-banner {
  background: linear-gradient(90deg, var(--warning-bg), #fef3c7);
  border-bottom: 1px solid var(--warning-border);
  padding: 8px 24px;
  font-size: var(--fs-xs);
  color: #92400e;
  text-align: center;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.demo-banner strong { color: #78350f; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-1);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand-teal);
  box-shadow: var(--sh-focus);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: 4px; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty-state .empty-ic {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: var(--r-circle);
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* ---- Loading ---- */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--r-circle);
  background: var(--brand-teal);
  animation: bounce-dot 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce-dot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .nav { display: none; }
  .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); }
  .topbar-search { width: 200px; }
}
@media (max-width: 640px) {
  .main { padding: 20px 16px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .topbar { padding: 10px 16px; }
  .page-head h1 { font-size: var(--fs-3xl); }
  .user-info { display: none; }
}

/* ---- Print ---- */
@media print {
  .nav, .topbar, .demo-banner { display: none; }
  .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .main { padding: 0; }
  .card, .tbl-wrap { box-shadow: none; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ==========================================================================
   HERO — Full-bleed landscape with glassmorphic content
   The hero is a full-bleed editorial landscape (Mid West farmland)
   with content floating over the left side. The image conveys place
   and purpose; the content carries the message.
   ========================================================================== */

.hero {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
  margin-bottom: 32px;
  min-height: 520px;
  background: linear-gradient(135deg, var(--brand-forest) 0%, var(--brand-forest-2) 50%, var(--brand-forest-3) 100%);
  box-shadow: var(--sh-xl);
  display: flex;
  align-items: stretch;
}

/* Full-bleed background image */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/assets/img/hero-landscape.jpg");
  background-size: cover;
  background-position: center 40%;
  filter: saturate(0.95) contrast(1.05);
  z-index: 0;
}
/* Dark gradient overlay for text contrast */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(24, 37, 31, 0.92) 0%, rgba(31, 46, 39, 0.78) 38%, rgba(31, 46, 39, 0.35) 65%, rgba(31, 46, 39, 0.15) 100%),
    linear-gradient(to top, rgba(24, 37, 31, 0.55) 0%, transparent 50%);
  z-index: 1;
}

/* ---- Content ---- */
.hero-copy {
  position: relative;
  z-index: 3;
  padding: 56px 48px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 640px;
}
.hero-copy::before { display: none; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(13, 82, 87, 0.18);
  border: 1px solid rgba(13, 82, 87, 0.3);
  border-radius: var(--r-pill);
  color: var(--brand-gold-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
  align-self: flex-start;
}
.hero-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gold);
  box-shadow: 0 0 12px var(--brand-gold);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.hero-headline {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 8px;
}
.hero-headline .accent {
  color: var(--brand-gold-2);
  display: block;
}

.hero-sub {
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 500;
  color: rgba(242, 247, 243, 0.7);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.hero-lead {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: rgba(242, 247, 243, 0.85);
  max-width: 52ch;
  margin-bottom: 32px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-cta-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ---- Trust strip ---- */
.hero-trust {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: rgba(242, 247, 243, 0.7);
  letter-spacing: 0.02em;
}
.hero-trust-item svg {
  color: var(--brand-gold);
  flex-shrink: 0;
}

/* ---- Decorative glow ---- */
.hero-glow {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.hero-glow-1 {
  top: -80px;
  right: 30%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(13, 82, 87, 0.12) 0%, transparent 65%);
}
.hero-glow-2 {
  bottom: -100px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(224, 150, 0, 0.08) 0%, transparent 65%);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero {
    min-height: 480px;
  }
  .hero::after {
    background:
      linear-gradient(180deg, rgba(24, 37, 31, 0.85) 0%, rgba(31, 46, 39, 0.7) 50%, rgba(31, 46, 39, 0.6) 100%);
  }
  .hero-copy {
    padding: 40px 32px;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 460px;
    border-radius: var(--r-lg);
  }
  .hero::before { background-position: center 50%; }
  .hero::after {
    background:
      linear-gradient(180deg, rgba(24, 37, 31, 0.9) 0%, rgba(31, 46, 39, 0.75) 40%, rgba(31, 46, 39, 0.6) 100%);
  }
  .hero-copy {
    padding: 32px 24px;
  }
  .hero-headline { font-size: clamp(2rem, 8vw, 2.5rem); }
  .hero-lead { font-size: var(--fs-sm); }
  .hero-cta-row .btn { flex: 1; }
}

/* ==========================================================================
   CHAT — Conversational AI interface
   ========================================================================== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  max-height: 70vh;
  background: var(--brand-cream);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: chat-msg-in 0.3s ease-out;
}
@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.chat-msg.ai .chat-msg-avatar {
  background: linear-gradient(135deg, var(--brand-forest), var(--brand-teal));
  color: #fff;
}
.chat-msg.user .chat-msg-avatar {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-earth));
  color: #fff;
}

.chat-msg-bubble {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--sh-sm);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-1);
}
.chat-msg.user .chat-msg-bubble {
  background: var(--brand-forest);
  color: #fff;
}
.chat-msg-bubble p { margin-bottom: 8px; }
.chat-msg-bubble p:last-child { margin-bottom: 0; }
.chat-msg-bubble strong { color: var(--brand-teal); font-weight: 700; }
.chat-msg.user .chat-msg-bubble strong { color: var(--brand-gold-2); }

/* Source cards in chat responses */
.source-cards {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.source-card {
  display: block;
  padding: 8px 12px;
  background: rgba(13, 82, 87, 0.06);
  border: 1px solid rgba(13, 82, 87, 0.15);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.15s ease;
}
.source-card:hover {
  background: rgba(13, 82, 87, 0.12);
  border-color: rgba(13, 82, 87, 0.3);
  color: var(--brand-forest);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Suggestion chips */
.chat-suggestions {
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-suggestion {
  padding: 6px 14px;
  background: var(--brand-cream);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-suggestion:hover {
  background: rgba(13, 82, 87, 0.08);
  border-color: var(--brand-teal);
  color: var(--brand-forest);
}

/* Input bar */
.chat-input-bar {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  font-size: var(--fs-sm);
  font-family: inherit;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s ease;
}
.chat-input:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(13, 82, 87, 0.1);
}

@media (max-width: 640px) {
  .chat-container { height: 500px; }
  .chat-msg { max-width: 90%; }
  .chat-messages { padding: 16px; }
  .chat-suggestions { padding: 10px 16px; }
  .chat-input-bar { padding: 12px 16px; }
}

/* ==========================================================================
   TABLES — data tables for admin views
   ========================================================================== */

.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.tbl thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: var(--brand-cream);
}
.tbl tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--brand-cream); }

/* ---- Form elements ---- */
.form-select {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: var(--fs-sm);
  font-family: inherit;
  background: var(--surface);
  color: var(--text-1);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b5d50' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.form-select:focus { border-color: var(--brand-teal); box-shadow: 0 0 0 3px rgba(236,70,0,0.1); }
.form-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 4px;
}

/* ---- Badges ---- */
.badge-danger { background: rgba(220,38,38,0.1); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.1); color: #2563eb; }
.badge-orange { background: rgba(236,70,0,0.1); color: var(--brand-teal); }

/* ---- User avatar ---- */
.user-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-3);
}
.empty-ic {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: var(--fs-xl);
  color: var(--text-2);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* ---- Callouts ---- */
.callout-info {
  background: rgba(59,130,246,0.06);
  border-left: 4px solid #2563eb;
}
.callout-danger {
  background: rgba(220,38,38,0.06);
  border-left: 4px solid var(--danger);
}
.callout-success {
  background: rgba(5,150,105,0.06);
  border-left: 4px solid var(--success);
}

/* ==========================================================================
   UX OVERHAUL — World-class components for non-technical users
   ========================================================================== */

/* ---- Page head with guidance ---- */
.page-head {
  margin-bottom: 32px;
}
.page-head .eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-teal);
  margin-bottom: 8px;
}
.page-head h1 {
  font-family: var(--font-head);
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin-bottom: 8px;
}
.page-head .lead {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text-2);
  max-width: 64ch;
}

/* ---- Intro / guidance panel ---- */
.intro-panel {
  background: linear-gradient(135deg, var(--brand-cream) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.intro-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--brand-teal), var(--brand-gold));
}
.intro-panel h3 {
  font-family: var(--font-head);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.intro-panel p {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text-2);
  max-width: 60ch;
}
.intro-panel .intro-steps {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.intro-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}
.intro-step:hover {
  border-color: var(--brand-teal);
  box-shadow: var(--sh-sm);
  color: var(--text-1);
  transform: translateY(-1px);
}
.intro-step .step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-forest);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
  flex-shrink: 0;
}

/* ---- Getting started guide ---- */
.getting-started {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.gs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gs-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.gs-card:hover {
  border-color: var(--brand-teal);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.gs-card:hover::after { transform: scaleX(1); }
.gs-card .gs-num {
  font-family: var(--font-head);
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--brand-cream);
  line-height: 1;
  margin-bottom: 12px;
  position: absolute;
  top: 16px; right: 20px;
}
.gs-card .gs-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
}
.gs-card h4 {
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}
.gs-card p {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}
.gs-card .gs-link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-teal);
  display: flex;
  align-items: center;
  gap: 4px;
}
.gs-card:hover .gs-link { gap: 8px; }

/* ---- Help banner (for pages that need context) ---- */
.help-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(236,70,0,0.04), rgba(247,149,32,0.04));
  border: 1px solid rgba(236,70,0,0.12);
  border-radius: var(--r-lg);
  margin-bottom: 24px;
}
.help-banner .help-ic {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: rgba(236,70,0,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--brand-teal);
}
.help-banner h4 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.help-banner p {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.6;
}

/* ---- Section divider ---- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 24px;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-divider span {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---- Stat card polish ---- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-value {
  font-family: var(--font-head);
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--brand-forest);
  line-height: 1;
}
.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-3);
  font-weight: 500;
}

/* ---- Subject tile polish ---- */
.subject-tile {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur) var(--ease);
  min-height: 200px;
}
.subject-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--brand-teal);
}
.tile-count {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--brand-forest);
}
.tile-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Resource card polish ---- */
.resource-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur) var(--ease);
  min-height: 200px;
}
.resource-card:hover {
  border-color: var(--brand-teal);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.res-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.resource-card h4 {
  font-family: var(--font-head);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
  line-height: 1.3;
}
.res-excerpt {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}
.res-source {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 500;
}

/* ---- Listen button polish ---- */
.btn-listen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(236,70,0,0.06);
  border: 1px solid rgba(236,70,0,0.15);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--brand-teal);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-decoration: none;
}
.btn-listen:hover {
  background: rgba(236,70,0,0.12);
  border-color: var(--brand-teal);
}
.btn-listen.playing {
  background: var(--brand-teal);
  color: #fff;
  animation: listen-pulse 1.5s ease-in-out infinite;
}
@keyframes listen-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236,70,0,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(236,70,0,0); }
}

/* ---- Badge polish ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-burgundy { background: rgba(31,46,39,0.08); color: var(--brand-forest); }
.badge-success { background: rgba(5,150,105,0.1); color: var(--success); }
.badge-water { background: var(--subject-water-bg); color: var(--subject-water); }
.badge-agri { background: var(--subject-agri-bg); color: var(--subject-agri); }
.badge-comm { background: var(--subject-comm-bg); color: var(--subject-comm); }
.badge-env { background: var(--subject-env-bg); color: var(--subject-env); }

/* ---- Card polish ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.card:hover { box-shadow: var(--sh-sm); }
.card h3, .card h4 { color: var(--text-1); }
.card-ic {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

/* ---- Responsive getting started ---- */
@media (max-width: 1024px) {
  .getting-started { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .getting-started { grid-template-columns: 1fr; }
  .page-head h1 { font-size: var(--fs-3xl); }
  .intro-panel { padding: 20px; }
  .help-banner { padding: 16px; }
}



/* ==========================================================================
   FOOTER — Compact, world-class government footer
   ========================================================================== */
.site-footer {
  background: linear-gradient(180deg, #2A362E 0%, #1D2620 100%);
  color: rgba(242, 247, 243, 0.5);
  border-top: 1px solid rgba(13, 82, 87, 0.2);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 32px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.8fr;
  gap: 40px;
  align-items: start;
}

/* ---- Brand column ---- */
.footer-logo {
  height: 32px;
  width: auto;
  margin-bottom: 14px;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}
.footer-tagline {
  font-family: var(--font-head);
  font-size: var(--fs-md);
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.footer-desc {
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: rgba(242, 247, 243, 0.4);
  margin-bottom: 16px;
  max-width: 34ch;
}
.footer-sovereign-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(224, 150, 0, 0.08);
  border: 1px solid rgba(224, 150, 0, 0.15);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-gold);
  letter-spacing: 0.03em;
}

/* ---- Link columns ---- */
.footer-col { display: flex; flex-direction: column; }
.footer-heading {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(224, 150, 0, 0.7);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  font-size: var(--fs-sm);
  color: rgba(242, 247, 243, 0.45);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.footer-links a:hover { color: var(--brand-teal); }

/* ---- Security grid (2-col compact) ---- */
.footer-security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.footer-security-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(242, 247, 243, 0.4);
  line-height: 1.4;
  transition: color var(--dur-fast) var(--ease);
}
.footer-security-item:hover { color: rgba(242, 247, 243, 0.7); }
.footer-security-item svg {
  color: rgba(224, 150, 0, 0.6);
  flex-shrink: 0;
}

/* ---- Bottom bar ---- */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 14px 32px;
}
.footer-bottom-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(242, 247, 243, 0.3);
  flex-wrap: wrap;
}
.footer-sep { color: rgba(255, 255, 255, 0.1); }
.footer-spacer { margin-left: auto; }
.footer-admin-link {
  color: rgba(242, 247, 243, 0.45);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.footer-admin-link:hover { color: var(--brand-teal); }
.footer-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-badge-dev {
  background: rgba(224, 150, 0, 0.1);
  color: var(--brand-gold);
  border: 1px solid rgba(224, 150, 0, 0.15);
}
.footer-badge-prod {
  background: rgba(5, 150, 105, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(5, 150, 105, 0.15);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; padding: 32px 24px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-security-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 20px; padding: 24px 16px 16px; }
  .footer-security-grid { grid-template-columns: 1fr; }
  .footer-bottom { padding: 12px 16px; }
  .footer-bottom-inner { justify-content: center; text-align: center; }
  .footer-spacer { margin-left: 0; }
}



/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-1);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s var(--ease-out);
  border-left: 4px solid var(--text-3);
}
.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}
.toast-success { border-left-color: var(--success); }
.toast-success .toast-ic { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-ic { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-ic { color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-info .toast-ic { color: var(--info); }
.toast-ic { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-3);
  border-radius: var(--r-xs);
  transition: all var(--dur-fast) var(--ease);
}
.toast-close:hover { background: var(--bg-2); color: var(--text-1); }
@media (max-width: 640px) {
  .toast-container { top: 10px; right: 10px; left: 10px; max-width: none; }
  .toast { transform: translateY(-100%); }
  .toast.toast-show { transform: translateY(0); }
}

/* ==========================================================================
   MOBILE BOTTOM NAV
   ========================================================================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) var(--ease);
  flex: 1;
  min-width: 0;
}
.mobile-nav-link.active { color: var(--brand-teal); }
.mobile-nav-link:active { color: var(--brand-forest); }
@media (max-width: 1024px) {
  .mobile-nav { display: flex; }
  .main { padding-bottom: 70px; }
}
@media (max-width: 640px) {
  .mobile-nav-link span { font-size: 9px; }
}

/* ==========================================================================
   MOBILE PIXEL-PERFECT SWEEP — All pages, all cards
   Targets inline grid/flex layouts that don't collapse on mobile
   ========================================================================== */

/* ---- Tablet (<=1024px) ---- */
@media (max-width: 1024px) {
  /* Two-column grids with fixed sidebars → stack */
  .grid[style*="grid-template-columns: 1fr 300px"],
  .grid[style*="grid-template-columns: 1fr 320px"],
  .grid[style*="grid-template-columns: 1fr 340px"],
  .grid[style*="grid-template-columns: 1fr 480px"],
  .grid[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Tools/admin 2-col grids → stack */
  .grid[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Horizontal card rows that overflow → wrap */
  .card[style*="display: flex; align-items: center; gap: 16px"] {
    flex-wrap: wrap;
  }
}

/* ---- Mobile (<=640px) ---- */
@media (max-width: 640px) {
  /* Page heads — tighter spacing */
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: var(--fs-2xl) !important; }
  .page-head .lead { font-size: var(--fs-sm); }

  /* All grids → single column */
  .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Cards — full width, tighter padding */
  .card { padding: 16px !important; border-radius: var(--r-md) !important; }
  .card .card-ic { width: 32px; height: 32px; margin-bottom: 8px; }

  /* Horizontal flex layouts → wrap or stack */
  [style*="display: flex; align-items: center; justify-content: space-between"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }
  [style*="display: flex; align-items: flex-start; justify-content: space-between"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }
  [style*="display: flex; gap: 16px"] {
    gap: 10px !important;
    flex-wrap: wrap;
  }
  [style*="display: flex; gap: 12px"] {
    gap: 8px !important;
    flex-wrap: wrap;
  }

  /* Quick-link cards on home → stack vertically */
  .card[style*="display: flex; align-items: center; gap: 16px; cursor: pointer"] {
    flex-direction: column;
    align-items: stretch !important;
    text-align: left !important;
    gap: 8px !important;
  }
  .card[style*="display: flex; align-items: center; gap: 16px; cursor: pointer"] > * {
    width: 100%;
  }

  /* Knowledge/Community search bars → full width */
  [style*="display: flex; gap: 16px; margin-bottom: 20px"] {
    flex-direction: column;
    gap: 10px !important;
  }
  [style*="flex: 1; min-width: 240px"],
  [style*="flex: 1; min-width: 280px"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Topic chips → wrap nicely */
  [style*="display: flex; gap: 8px; flex-wrap: wrap"] {
    gap: 6px !important;
  }

  /* Tables → horizontal scroll */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-wrap table { min-width: 500px; }

  /* Forms → full width inputs */
  input[type="text"], input[type="email"], input[type="search"],
  input[type="password"], input[type="number"], textarea, select {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Buttons → full width on mobile for primary actions */
  .btn { width: 100%; justify-content: center; }
  .btn-sm { width: auto; }
  .btn-row { flex-direction: column; gap: 8px; }
  .btn-row .btn { width: 100%; }

  /* Hero — already handled but tighten */
  .hero { min-height: 400px !important; border-radius: var(--r-lg) !important; }
  .hero-copy { padding: 24px 20px !important; }

  /* Community compose box → stack */
  [style*="display: flex; gap: 16px; margin-bottom: 20px; padding: 16px 20px"] {
    flex-direction: column;
    gap: 10px !important;
    padding: 14px !important;
  }

  /* Community post actions → wrap */
  [style*="display: flex; gap: 4px; padding-top: 12px"] {
    flex-wrap: wrap;
    gap: 6px !important;
  }

  /* Observations meta row → stack */
  [style*="display: flex; gap: 16px; font-size: var(--fs-sm)"] {
    flex-direction: column;
    gap: 6px !important;
  }

  /* Admin settings rows → stack */
  [style*="display: flex; justify-content: space-between; padding: 10px 0"] {
    flex-direction: column;
    gap: 6px !important;
    align-items: flex-start !important;
  }

  /* Admin settings forms → stack */
  [style*="display: flex; gap: 8px; align-items: center"] {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }
  [style*="display: flex; gap: 8px; align-items: center"] .btn {
    width: 100%;
  }

  /* Login container → full width */
  [style*="max-width: 480px; margin: 60px auto"] {
    margin: 20px auto !important;
    max-width: 100% !important;
  }

  /* Tools subscription gate → tighter */
  [style*="text-align: center; padding: 48px 32px; max-width: 560px"] {
    padding: 24px 16px !important;
  }
  [style*="max-width: 420px; margin-left: auto; margin-right: auto"] {
    max-width: 100% !important;
  }

  /* Tools tab bar → scrollable */
  [style*="display: flex; gap: 8px; margin-bottom: 24px; border-bottom"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
  }

  /* Article detail sidebar → stack above content */
  .grid[style*="grid-template-columns: 1fr 300px"] > *:last-child {
    order: -1;
  }

  /* Article author row → stack */
  [style*="display: flex; align-items: center; gap: 16px; padding: 16px 0"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* Article related → stack */
  [style*="display: flex; gap: 16px; align-items: flex-start"] {
    flex-direction: column;
    gap: 10px !important;
  }

  /* Audit log header → stack */
  [style*="display: flex; align-items: center; gap: 12px"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }

  /* Stats badges → wrap */
  [style*="display: flex; gap: 10px; margin-bottom: 16px"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }

  /* Help banners → tighter */
  .help-banner { padding: 14px !important; }
  .help-banner h4 { font-size: var(--fs-sm); }
  .help-banner p { font-size: var(--fs-xs); line-height: 1.5; }

  /* Intro panels → tighter */
  .intro-panel { padding: 16px !important; }

  /* Empty states → tighter */
  .empty-state { padding: 32px 16px !important; }
  .empty-state .empty-ic { width: 48px; height: 48px; font-size: 24px; }
  .empty-state h3 { font-size: var(--fs-lg); }
  .empty-state p { font-size: var(--fs-sm); }

  /* Getting started cards → tighter */
  .gs-card { padding: 16px !important; }
  .gs-card .gs-num { width: 28px; height: 28px; font-size: var(--fs-sm); }

  /* Subject area cards → tighter */
  [style*="display: flex; align-items: baseline; gap: 8px"] {
    flex-wrap: wrap;
    gap: 6px !important;
  }

  /* Topbar — hide search on small mobile, show compact */
  .topbar { padding: 10px 16px; }
  .topbar-search { display: none; }
  .topbar-title { font-size: var(--fs-md); }
  .topbar-sub { display: none; }
  .user-info { display: none; }

  /* Main content — tighter padding */
  .main { padding: 16px 12px 80px !important; }

  /* Breadcrumbs — smaller */
  .breadcrumbs { font-size: 10px; }

  /* Footer bottom — center */
  .footer-bottom-inner { justify-content: center; text-align: center; }
}

/* ---- Very small mobile (<=380px) ---- */
@media (max-width: 380px) {
  .page-head h1 { font-size: var(--fs-xl) !important; }
  .card { padding: 14px !important; }
  .hero-copy { padding: 20px 16px !important; }
  .hero-headline { font-size: 1.75rem !important; }
  .mobile-nav-link span { font-size: 8px; }
  .mobile-nav-link svg { width: 20px; height: 20px; }
}

/* ---- Touch targets: minimum 44px for accessibility ---- */
@media (pointer: coarse) {
  .btn, .chip, .nav-link, .mobile-nav-link, .ask-chip,
  .ask-action-btn, .ask-send-btn, .toast-close {
    min-height: 44px;
  }
}

/* ---- Landscape mobile ---- */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: 280px !important; }
  .page-head { margin-bottom: 12px; }
  .page-head .lead { display: none; }
}

/* ---- Program tag (FDF co-brand under sidebar logo) ---- */
.nav-program-tag {
  padding: 4px 10px;
  width: fit-content;
  border: 1px solid rgba(242, 247, 243, 0.22);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-gold-2);
  background: rgba(13, 82, 87, 0.35);
}

/* ---- Footer acknowledgement of Country ---- */
.footer-acknowledgement {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 32px 8px;
  border-top: 1px solid rgba(242, 247, 243, 0.14);
}
.footer-acknowledgement p {
  font-size: var(--fs-xs);
  line-height: 1.65;
  color: var(--text-on-forest-2);
  max-width: 72ch;
}
.footer-acknowledgement .footer-ack-program {
  margin-top: 8px;
  font-weight: 600;
  color: var(--brand-gold-2);
}

/* ---- Platform brand lockup (emblem + wordmark) ---- */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-emblem {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.brand-lockup-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.brand-region {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brand-gold-2);
  white-space: nowrap;
}

/* ---- Footer platform lockup ---- */
.footer-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  margin-bottom: 16px;
}
.footer-emblem {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.footer-lockup-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-region {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-gold-2);
}
.footer-name {
  font-family: var(--font-head);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--text-on-forest);
}

/* ---- Homepage action tiles (four ways to use the platform) ---- */
.action-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.action-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: var(--brand-teal);
}
.action-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-tile-title {
  font-family: var(--font-head);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}
.action-tile-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.55;
  flex-grow: 1;
}
.action-tile-link {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand-teal);
}
.action-tile:hover .action-tile-link { text-decoration: underline; }
