/* ===========================================================================
   Nesteye demo dashboard - styles.
   Matches the nesteye.ai marketing site: forest/sage/coral on cream, Playfair
   Display serif headings over JetBrains Mono body, editorial uppercase eyebrows,
   soft white cards. Not a generic admin theme.
   =========================================================================== */

:root {
  --bg: #FAF7F2;
  --bg-tint: #F3EEE4;
  --surface: #FFFFFF;
  --surface-alt: #F6F2EA;
  --text: #24302A;
  --text-soft: #4A5A4E;
  --text-muted: #8A968B;
  --forest: #1B4332;
  --forest-2: #2C5A44;
  --forest-dark: #0D2818;
  --sage: #6B8F71;
  --sage-soft: #E8F0E7;
  --coral: #E85D4C;
  --coral-soft: #FBE7E2;
  --stone: #E8E4DC;
  --green-tint: #E8F5E9;
  --success: #2E6B3E;
  --success-bg: #E8F5E9;
  --warning: #C68A2E;
  --warning-bg: #F6EDD8;
  --danger: #C4402F;
  --danger-bg: #FBE7E2;
  --border: #E7E2D6;
  --border-forest: rgba(27, 67, 50, 0.10);
  --shadow: 0 1px 2px rgba(27,67,50,0.04), 0 8px 24px rgba(27,67,50,0.05);
  --shadow-lg: 0 12px 40px rgba(27,67,50,0.14);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.serif { font-family: 'Playfair Display', Georgia, serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Editorial eyebrow used across sections (matches site overlines) */
.eyebrow {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3em; color: rgba(27, 67, 50, 0.55);
}

/* ---- App shell -------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 258px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border-forest);
  display: flex; flex-direction: column; padding: 24px 18px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-height: 54px; }
.sidebar-brand img { height: 48px; width: auto; }
.sidebar-farm { margin: 18px 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--border-forest); }
.sidebar-farm .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.24em; color: var(--text-muted); }
.sidebar-farm strong { display: block; font-family: 'Playfair Display', serif; font-weight: 600; font-size: 19px; color: var(--forest); margin-top: 5px; letter-spacing: 0.1px; }
.sidebar-farm .loc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 10px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-soft); cursor: pointer; border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-item:hover { background: var(--sage-soft); transform: translateX(2px); }
.nav-item.active { background: var(--forest); color: #fff; }
.nav-item .ic { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-spacer { flex: 1; }
.sidebar-user { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 13px; background: var(--surface-alt); border: 1px solid var(--border-forest); }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--forest-2), var(--forest)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.user-meta { overflow: hidden; }
.user-meta .name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .email { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main */
.main { flex: 1; min-width: 0; padding: 30px 34px 66px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.topbar h1 { font-family: 'Playfair Display', serif; font-size: 38px; font-weight: 600; letter-spacing: -0.3px; color: var(--forest); line-height: 1.1; }
.topbar .subtitle { font-size: 13px; color: var(--text-soft); margin-top: 7px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em; padding: 12px 18px; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); }
.btn-ghost { background: var(--surface); color: var(--forest); border-color: var(--border-forest); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn .ic { width: 15px; height: 15px; }

.badge-demo {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--coral);
  background: var(--coral-soft); border: 1px solid rgba(232,93,76,0.25); padding: 5px 11px; border-radius: 999px;
}
.badge-demo .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); animation: pulse 2s infinite; }

.back-link { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s; }
.back-link:hover { color: var(--forest); }
.back-link .ic { width: 14px; height: 14px; }

/* ---- Cards ------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: minmax(300px, 384px) 1fr; gap: 22px; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3em; color: rgba(27,67,50,0.55); font-weight: 700; margin-bottom: 18px; }

/* Weight-first dashboard */
.weight-hero { margin-bottom: 24px; padding: 28px 30px; }
.weight-hero-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.weight-hero-subline { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.weight-hero-main { margin-bottom: 22px; }
.weight-hero-number {
  font-size: clamp(42px, 6vw, 58px); font-weight: 600; line-height: 1.05;
  color: var(--forest); font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.weight-hero-label {
  display: block; margin-top: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted);
}
.weight-hero-grid {
  display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px;
}
.weight-stat {
  background: var(--surface-alt); border: 1px solid var(--border-forest);
  border-radius: 12px; padding: 12px 14px; min-width: 0;
}
.weight-stat em {
  display: block; font-style: normal; font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 5px;
}
.weight-stat b { font-size: 15px; color: var(--forest); font-variant-numeric: tabular-nums; }
.weight-stat b .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.hero-today {
  font-size: 14px; color: var(--forest); font-weight: 600; margin-top: 8px; line-height: 1.45;
}
.accuracy-chip {
  display: inline-flex; margin-top: 10px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--forest);
  background: var(--sage-soft); border: 1px solid rgba(107,143,113,0.22);
  border-radius: 999px; padding: 5px 10px;
}
.weight-hero-lbs {
  display: block; margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--text-soft);
}

.value-ribbon {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 24px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--sage-soft), #fff);
  border: 1px solid var(--border-forest);
}
.value-ribbon-tag {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--coral); margin-bottom: 6px;
}
.value-ribbon-copy p { font-size: 13px; color: var(--text); line-height: 1.5; max-width: 52rem; }
.value-ribbon-dismiss {
  border: none; background: transparent; color: var(--text-muted); font-size: 22px;
  line-height: 1; cursor: pointer; padding: 0 4px; flex-shrink: 0;
}
.value-ribbon-dismiss:hover { color: var(--forest); }

.flock-economics { margin-bottom: 24px; padding: 22px 24px; }
.flock-economics-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px;
}
.flock-stat {
  background: var(--surface-alt); border: 1px solid var(--border-forest);
  border-radius: 12px; padding: 14px 16px;
}
.flock-stat em {
  display: block; font-style: normal; font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 6px;
}
.flock-stat b { font-size: 22px; color: var(--forest); font-variant-numeric: tabular-nums; }
.flock-stat span { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.flock-economics-note { font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }

.trust-strip {
  margin-bottom: 24px; padding: 20px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-forest); box-shadow: var(--shadow);
}
.trust-quote {
  font-family: 'Playfair Display', Georgia, serif; font-size: 18px; font-style: italic;
  color: var(--forest); line-height: 1.45; margin-bottom: 14px;
}
.trust-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 11px; color: var(--text-soft); }
.trust-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 5px 10px; border-radius: 999px; background: var(--green-tint); color: var(--forest);
  border: 1px solid rgba(27,67,50,0.1);
}
.trust-badge-soft { background: var(--surface-alt); color: var(--text-soft); }

.proof-block { margin-bottom: 24px; padding: 22px 24px; }
.proof-footnote {
  margin-top: 12px; font-size: 12px; color: var(--text-soft); line-height: 1.5;
}

.tool-wide { grid-column: 1 / -1; margin-bottom: 22px; }
.roi-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.roi-result { flex-direction: column; align-items: flex-start; gap: 8px; }
.roi-framing { font-size: 12px; color: var(--text-soft); line-height: 1.5; margin: 0; }

.dashboard-chart { margin-bottom: 24px; }
.weight-house-list { margin-bottom: 24px; }
.weight-list-table table { min-width: 560px; }
.weight-house-row { cursor: pointer; }
.weight-house-row:focus-visible { outline: 2px solid rgba(27,67,50,0.25); outline-offset: -2px; }
.weight-col strong { font-size: 14px; color: var(--forest); }
.piling-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral); margin-left: 8px; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(232,93,76,0.18); animation: pulse 1.4s infinite;
}
.weight-house-cards { display: none; }
.weight-house-card {
  background: var(--surface); border: 1px solid var(--border-forest); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow); cursor: pointer;
}
.weight-house-card:focus-visible { outline: 2px solid rgba(27,67,50,0.25); }
.weight-house-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.weight-house-card-top strong { color: var(--forest); font-size: 14px; }
.weight-house-card-fields {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.weight-house-card-fields div { min-width: 0; }
.weight-house-card-fields dt {
  font-size: 8.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 2px;
}
.weight-house-card-fields dd { font-size: 13px; color: var(--forest); font-variant-numeric: tabular-nums; }

.chart-confidence-footnote {
  margin-top: 12px; font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--border-forest); padding-top: 10px;
}
.mini-hero { border: 1px solid var(--border-forest); background: var(--surface-alt); }
.mini-hero .val { font-size: 28px; }
.inbox-show-all { margin-top: 12px; width: 100%; justify-content: center; }

/* Farmer daily dashboard */
.snapshot-strip {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px;
  margin-bottom: 16px;
}
.snapshot-item {
  background: var(--surface); border: 1px solid var(--border-forest); border-left: 4px solid var(--sage);
  border-radius: 10px; box-shadow: var(--shadow); padding: 13px 15px;
  min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.snapshot-label {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted);
}
.snapshot-item strong { font-size: 18px; color: var(--forest); font-variant-numeric: tabular-nums; }
.snapshot-bad { border-left-color: var(--coral); }
.snapshot-watch { border-left-color: var(--warning); }
.snapshot-good { border-left-color: var(--success); }

.house-health { margin-bottom: 18px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.section-head .card-title { margin-bottom: 0; }
.section-head span { font-size: 11px; color: var(--text-muted); }
.house-card-grid { display: grid; grid-template-columns: repeat(6, minmax(118px, 1fr)); gap: 10px; }
.house-card {
  appearance: none; text-align: left; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-forest); border-left: 4px solid var(--sage);
  border-radius: 10px; box-shadow: var(--shadow); padding: 13px; cursor: pointer;
  min-height: 138px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
}
.house-card:hover { transform: translateY(-1px); border-color: rgba(27,67,50,0.22); }
.house-card.selected { background: #fff; box-shadow: var(--shadow-lg); outline: 2px solid rgba(27,67,50,0.12); }
.house-card.severity-critical { border-left-color: var(--coral); }
.house-card.severity-watch { border-left-color: var(--warning); }
.house-card.severity-stable { border-left-color: var(--success); }
.house-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.house-card-top strong { font-size: 13px; color: var(--forest); }
.severity-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 6px; border-radius: 999px; background: var(--green-tint); color: var(--success);
}
.severity-critical .severity-badge { background: var(--danger-bg); color: var(--danger); }
.severity-watch .severity-badge { background: var(--warning-bg); color: var(--warning); }
.house-status { font-size: 11px; color: var(--text-soft); line-height: 1.35; min-height: 30px; }
.house-card-metrics { display: grid; gap: 7px; margin-top: auto; }
.house-card-metrics span {
  display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border-forest);
  padding-top: 7px; min-width: 0;
}
.house-card-metrics em {
  font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
}
.house-card-metrics b { font-size: 11px; color: var(--forest); text-align: right; overflow-wrap: anywhere; }
.neg { color: var(--coral) !important; }
.pos { color: var(--success) !important; }

.farmer-focus-grid {
  display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px; margin-bottom: 22px; align-items: stretch;
}
.chart-card { padding: 22px; }
.chart-card .chart { height: 218px; }
.action-panel {
  background: var(--surface); border: 1px solid var(--border-forest); border-left: 5px solid var(--sage);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
  display: grid; grid-template-columns: minmax(280px, 1fr) 280px; gap: 20px;
}
.action-panel.severity-critical { border-left-color: var(--coral); }
.action-panel.severity-watch { border-left-color: var(--warning); }
.action-panel.severity-stable { border-left-color: var(--success); }
.action-main { min-width: 0; }
.action-house {
  display: inline-flex; margin-bottom: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted);
}
.action-panel h2 {
  font-family: 'Playfair Display', serif; font-size: 31px; line-height: 1.08;
  color: var(--forest); margin-bottom: 10px; font-weight: 600;
}
.action-reason { font-size: 13px; color: var(--text-soft); line-height: 1.6; max-width: 680px; }
.action-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(95px, 1fr)); gap: 8px;
  margin: 16px 0;
}
.action-metrics span {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 10px;
  padding: 10px; min-width: 0;
}
.action-metrics em {
  display: block; font-style: normal; font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px;
}
.action-metrics b { font-size: 13px; color: var(--forest); overflow-wrap: anywhere; }
.next-step {
  display: flex; gap: 10px; align-items: flex-start; background: var(--green-tint);
  border: 1px solid rgba(27,67,50,0.10); border-radius: 11px; padding: 12px 13px;
  color: var(--forest); font-size: 12.5px; line-height: 1.45;
}
.severity-critical .next-step { background: var(--coral-soft); color: var(--danger); border-color: rgba(232,93,76,0.25); }
.severity-watch .next-step { background: var(--warning-bg); color: var(--text); border-color: rgba(198,138,46,0.18); }
.next-step .ic { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.action-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.camera-card {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 12px;
  padding: 12px;
}
.camera-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.camera-head span {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--text-muted);
}
.camera-head strong { font-size: 11px; color: var(--forest); }
.heatmap {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
  aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: #EEF3EA;
}
.heat-grid { border: 1px solid rgba(27,67,50,0.07); background: rgba(255,255,255,0.42); }
.heat-blob {
  position: absolute; border-radius: 50%; filter: blur(3px); opacity: 0.55; pointer-events: none;
}
.heat-main { width: 34%; height: 42%; right: 22%; top: 26%; background: var(--coral); }
.heat-soft { width: 28%; height: 32%; right: 45%; bottom: 18%; background: var(--warning); }
.heatmap.is-warm .heat-main { width: 22%; height: 26%; opacity: 0.35; background: var(--warning); }
.heatmap.is-warm .heat-soft { opacity: 0; }
.heatmap.is-clear .heat-blob { opacity: 0; }

.intervention-timeline {
  list-style: none; background: var(--surface-alt); border: 1px solid var(--border-forest);
  border-radius: 12px; padding: 12px; display: grid; gap: 10px;
}
.intervention-timeline li { display: flex; align-items: flex-start; gap: 9px; }
.intervention-timeline li > span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--sage); margin-top: 5px; flex-shrink: 0;
}
.intervention-timeline li.due > span { background: var(--coral); animation: pulse 1.4s infinite; }
.intervention-timeline b { display: block; font-size: 12px; color: var(--forest); }
.intervention-timeline em { display: block; font-style: normal; font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }
.simple-checks {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 12px;
  padding: 12px; display: grid; gap: 9px;
}
.simple-checks span { font-size: 11.5px; color: var(--text-soft); line-height: 1.4; }
.simple-checks b { display: block; color: var(--forest); margin-bottom: 2px; }

.mobile-barn-list { display: none; }

/* Decluttered farmer view */
.snapshot-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 0;
  background: var(--surface); border: 1px solid var(--border-forest); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 14px;
}
.snapshot-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--forest); margin-right: 14px;
}
.snapshot-item {
  min-height: 0; border: none; border-left: 0; border-right: 1px solid var(--border-forest);
  box-shadow: none; background: transparent; border-radius: 0; padding: 0 14px;
  display: flex; flex-direction: column; gap: 1px;
}
.snapshot-item:last-child { border-right: none; }
.snapshot-label { font-size: 8.5px; letter-spacing: 0.12em; }
.snapshot-item strong { font-size: 14px; line-height: 1.25; }

.changed-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.changed-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--forest); margin-right: 2px;
}
.change-pill {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-forest);
  border-radius: 999px; background: var(--surface); color: var(--text-soft);
  padding: 6px 10px; font-size: 10.5px; box-shadow: var(--shadow);
}
.change-pill b { color: var(--forest); }
.change-bad { background: var(--coral-soft); color: var(--danger); border-color: rgba(232,93,76,0.22); }
.change-bad b { color: var(--danger); }
.change-watch { background: var(--warning-bg); color: var(--text); border-color: rgba(198,138,46,0.18); }
.change-good { background: var(--green-tint); color: var(--success); border-color: rgba(46,107,62,0.14); }
.change-good b { color: var(--success); }

.house-health { margin-bottom: 14px; }
.house-card-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.house-card {
  flex: 1 1 148px; min-height: 72px; padding: 10px 11px; gap: 5px;
  border-radius: 10px; box-shadow: none; justify-content: center;
}
.house-card.selected { box-shadow: 0 8px 20px rgba(27,67,50,0.10); }
.house-card-top { align-items: flex-start; }
.house-card-top strong { font-size: 12.5px; }
.severity-badge { font-size: 8px; padding: 2px 6px; }
.house-status { min-height: 0; font-size: 10.5px; }
.house-next-action {
  width: fit-content; background: var(--surface-alt); border: 1px solid var(--border-forest);
  border-radius: 999px; padding: 3px 7px; color: var(--forest);
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.severity-critical .house-next-action { background: var(--coral-soft); color: var(--danger); border-color: rgba(232,93,76,0.22); }
.severity-watch .house-next-action { background: var(--warning-bg); color: var(--warning); border-color: rgba(198,138,46,0.18); }
.house-card-metrics { display: none; }

.action-panel {
  margin-bottom: 14px; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px;
  padding: 20px; min-height: 0;
}
.action-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.action-kicker .card-title { margin-bottom: 0; }
.action-panel h2 { font-size: 29px; margin-bottom: 8px; }
.action-reason { max-width: 560px; }
.next-step { margin-top: 14px; }
.action-actions { margin-top: 14px; display: flex; gap: 9px; flex-wrap: wrap; }
.signal-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px;
}
.signal-list span {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 9px;
  padding: 8px; min-width: 0;
}
.signal-list em {
  display: block; font-style: normal; font-size: 8px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 2px;
}
.signal-list b { font-size: 11.5px; color: var(--forest); overflow-wrap: anywhere; }
.mini-evidence {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 10px;
  overflow: hidden;
}
.mini-evidence summary {
  list-style: none; cursor: pointer; padding: 10px 11px;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-soft);
}
.mini-evidence summary::-webkit-details-marker { display: none; }
.mini-evidence summary::after { content: '+'; float: right; color: var(--forest); font-size: 14px; line-height: 1; }
.mini-evidence[open] summary { border-bottom: 1px solid var(--border-forest); }
.mini-evidence[open] summary::after { content: '-'; }
.camera-card { padding: 9px; border-radius: 10px; }
.mini-evidence .camera-card { border: 0; border-radius: 0; background: transparent; }
.camera-head { margin-bottom: 6px; }
.heatmap { aspect-ratio: 16 / 8; }
.intervention-timeline { padding: 9px; gap: 7px; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.intervention-timeline b { font-size: 11px; }
.intervention-timeline em { font-size: 9.5px; }
.simple-checks { padding: 9px; border-radius: 10px; gap: 7px; }

.foldout-card {
  background: var(--surface); border: 1px solid var(--border-forest); border-radius: 10px;
  box-shadow: var(--shadow); margin-top: 12px; overflow: hidden;
}
.foldout-card summary {
  cursor: pointer; list-style: none; padding: 16px 20px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(27,67,50,0.65);
}
.foldout-card summary::-webkit-details-marker { display: none; }
.foldout-card summary::after { content: '+'; float: right; color: var(--forest); font-size: 15px; line-height: 1; }
.foldout-card[open] summary { border-bottom: 1px solid var(--border-forest); }
.foldout-card[open] summary::after { content: '-'; }
.chart-card-inner { padding: 20px; }
.chart-card-inner .chart { height: 220px; }
.dashboard-readings .table-head { display: none; }

.walk-drawer-shell { position: fixed; inset: 0; z-index: 72; pointer-events: auto; }
.walk-drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 28, 20, 0.28); }
.walk-panel {
  position: absolute; top: 0; right: 0; width: min(520px, 100%); height: 100%;
  background: var(--surface); border-left: 1px solid var(--border-forest);
  box-shadow: var(--shadow-lg); padding: 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.walk-progress {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 12px;
  padding: 10px; display: grid; gap: 8px;
}
.walk-progress span {
  color: var(--text-soft); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.walk-progress div { height: 8px; background: #fff; border: 1px solid var(--border-forest); border-radius: 999px; overflow: hidden; }
.walk-progress b { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--forest)); }
.walk-list { display: grid; gap: 9px; }
.walk-item {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-left: 4px solid var(--sage);
  border-radius: 12px; padding: 12px;
}
.walk-item.severity-critical { border-left-color: var(--coral); }
.walk-item.severity-watch { border-left-color: var(--warning); }
.walk-item.is-checked { opacity: 0.72; }
.walk-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.walk-item-head strong { color: var(--forest); font-size: 13px; }
.walk-item p { color: var(--text-soft); font-size: 12px; line-height: 1.45; }
.walk-item-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.walk-item-buttons .btn { padding: 7px 11px; font-size: 9.5px; letter-spacing: 0.1em; }
.walk-check.is-checked { background: var(--green-tint); border-color: rgba(46,107,62,0.18); color: var(--success); }

.proof-foldout .proof-grid {
  display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px;
  padding: 0 16px 16px;
}
.proof-grid span {
  background: var(--surface-alt); border: 1px solid var(--border-forest);
  border-radius: 10px; padding: 12px;
}
.proof-grid em {
  display: block; font-style: normal; font-size: 8.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 4px;
}
.proof-grid b { color: var(--forest); font-size: 15px; line-height: 1.25; }

/* Farm status card */
.status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.status-big { font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 600; font-style: italic; display: flex; align-items: center; gap: 14px; letter-spacing: -0.2px; }
.status-ring-wrap { position: relative; width: 12px; height: 12px; }
.status-ring { position: absolute; inset: 0; border-radius: 50%; background: currentColor; }
.status-ring-wrap::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0.22; animation: ring 2.2s ease-out infinite; }
.status-AtRisk { color: var(--coral); }
.status-Healthy, .status-OnTrack { color: var(--success); }
.status-Critical { color: var(--danger); }
.confidence-pill { display: inline-flex; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 5px 11px; border-radius: 999px; background: var(--green-tint); color: var(--forest); }

.stat-list { display: flex; flex-direction: column; margin-top: 12px; }
.stat-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--border-forest); }
.stat-row:last-child { border-bottom: none; }
.stat-ic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: var(--sage-soft); border: 1px solid rgba(107,143,113,0.22); display: flex; align-items: center; justify-content: center; color: var(--forest); }
.stat-ic .ic { width: 16px; height: 16px; }
.stat-label { flex: 1; font-size: 13px; color: var(--text-soft); }
.stat-value { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; color: var(--forest); }
.stat-value.neg { color: var(--coral); }
.stat-value.pos { color: var(--success); }

/* Chart card */
.chart-legend { display: flex; gap: 20px; margin-bottom: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-soft); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend-measured { background: var(--forest); }
.legend-expected { background: var(--sage); }

.chart-wrap { position: relative; padding-left: 46px; padding-top: 16px; }
.chart-yaxis { position: absolute; left: 0; top: 16px; bottom: 30px; width: 42px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-ytick { font-size: 9.5px; color: var(--text-muted); text-align: right; transform: translateY(-50%); }
.chart-grid { position: absolute; left: 46px; right: 0; top: 16px; bottom: 30px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-gridline { border-top: 1px dashed var(--border); height: 0; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 14px; height: 252px; }
.chart-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.bar { width: 42%; max-width: 26px; border-radius: 4px 4px 0 0; position: relative; height: 0; transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-measured { background: var(--forest); }
.bar-expected { background: var(--sage); }
.bar:hover { filter: brightness(1.08); }
.bar-val { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--text-muted); white-space: nowrap; opacity: 0; transition: opacity 0.4s 0.6s; }
.chart.animate .bar-val { opacity: 1; }
.chart-xlabel { font-size: 11px; color: var(--text-soft); margin-top: 10px; font-weight: 700; }

/* ---- Table ------------------------------------------------------------ */
.table-card { background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-head { padding: 22px 24px 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 940px; }
thead th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 700; padding: 14px 16px; white-space: nowrap; border-bottom: 1px solid var(--border-forest); background: var(--surface-alt); }
tbody td { padding: 15px 16px; font-size: 13px; border-bottom: 1px solid var(--border-forest); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-alt); }
.barn-name { font-weight: 700; color: var(--forest); }
.num { font-variant-numeric: tabular-nums; }
.diff { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.diff.neg { color: var(--coral); }
.diff.pos { color: var(--success); }
.diff .ic { width: 13px; height: 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-ontrack { background: var(--green-tint); color: var(--success); }
.pill-ontrack .dot { background: var(--success); }
.pill-behind1 { background: var(--warning-bg); color: var(--warning); }
.pill-behind1 .dot { background: var(--warning); }
.pill-behind2, .pill-piling { background: var(--coral-soft); color: var(--danger); }
.pill-behind2 .dot, .pill-piling .dot { background: var(--coral); }
.pill-piling .dot { animation: pulse 1.4s infinite; }

.link-action { color: var(--forest); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; border-bottom: 1px solid rgba(27,67,50,0.25); padding-bottom: 1px; }
.link-action:hover { color: var(--coral); border-color: var(--coral); }

/* ---- Historical view -------------------------------------------------- */
.selector { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-forest); background: var(--surface); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); cursor: pointer; transition: all 0.15s; }
.chip:hover { border-color: var(--sage); color: var(--forest); }
.chip.active { background: var(--forest); border-color: var(--forest); color: #fff; }

.line-card { padding: 24px; }
.line-legend { display: flex; gap: 20px; margin: 4px 0 12px; }
.linechart { width: 100%; height: 288px; }
.linechart .grid { stroke: var(--border); stroke-dasharray: 4 4; }
.linechart .axis-label { fill: var(--text-muted); font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.linechart .area-actual { fill: rgba(27,67,50,0.08); }
.path-expected { fill: none; stroke: var(--sage); stroke-width: 2.5; stroke-dasharray: 5 4; }
.path-actual { fill: none; stroke: var(--forest); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dot-actual { fill: var(--forest); }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; margin-bottom: 22px; }
.mini { background: var(--surface); border: 1px solid var(--border-forest); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.mini .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-muted); }
.mini .val { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; color: var(--forest); }
.mini .sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- More Tools view -------------------------------------------------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.tool { background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.tool-head { display: flex; align-items: center; gap: 13px; margin-bottom: 4px; }
.tool-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--forest); color: #fff; display: flex; align-items: center; justify-content: center; }
.tool-ic .ic { width: 20px; height: 20px; }
.tool h3 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; color: var(--forest); }
.tool p.desc { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 18px; line-height: 1.6; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 10px; padding: 12px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--sage); }
.tool-result { margin-top: 16px; padding: 15px 17px; border-radius: 12px; background: var(--green-tint); border: 1px solid rgba(27,67,50,0.08); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tool-result .r-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-soft); }
.tool-result .r-val { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; color: var(--forest); }

.rec-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; }
.rec-item { padding: 12px; border-radius: 11px; background: var(--surface-alt); border: 1px solid var(--border-forest); }
.rec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rec-priority { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 8px; border-radius: 999px; }
.rec-high { background: var(--danger-bg); color: var(--danger); }
.rec-med { background: var(--warning-bg); color: var(--warning); }
.rec-low { background: var(--green-tint); color: var(--success); }
.rec-house { font-size: 11px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.rec-action { font-size: 12.5px; color: var(--text); line-height: 1.55; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-forest); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t-lbl { font-size: 13px; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--stone); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s; }
.switch.on { background: var(--forest); }
.switch.on::after { transform: translateX(18px); }

/* ---- AI Agents view --------------------------------------------------- */
.copilot-card { background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.copilot-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.copilot-head h3 { font-family: 'Playfair Display', serif; font-size: 24px; color: var(--forest); }
.copilot-head p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.copilot-head .agent-status { margin-left: auto; }
.copilot-thinking { font-size: 13px; color: var(--text-soft); background: var(--surface-alt); border: 1px dashed var(--border-forest); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.copilot-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.copilot-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text); padding: 10px; border-radius: 10px; background: var(--surface-alt); border: 1px solid var(--border-forest); }
.copilot-item em { color: var(--text-muted); font-style: normal; text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; }
.piling-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border-radius: 11px; background: var(--coral-soft); border: 1px solid rgba(232,93,76,0.25); }
.piling-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--danger); white-space: nowrap; }
.piling-chip .ic { width: 14px; height: 14px; }
.piling-msg { font-size: 12px; color: var(--text-soft); }

.agents-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.agent-card { background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.agent-head { display: flex; align-items: center; gap: 10px; }
.agent-head h3 { font-family: 'Playfair Display', serif; font-size: 19px; color: var(--forest); }
.agent-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.agent-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--forest); background: var(--sage-soft); border: 1px solid rgba(107,143,113,0.2); border-radius: 999px; padding: 5px 9px; margin-left: auto; }

.confidence-wrap { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 8px; font-size: 11px; color: var(--text-soft); }
.confidence-bar { height: 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border-forest); overflow: hidden; }
.confidence-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--forest)); }
.confidence-wrap strong { font-size: 12px; color: var(--forest); }

.finding-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.finding { border: 1px solid var(--border-forest); border-radius: 10px; background: var(--surface-alt); padding: 10px; }
.finding.is-done { opacity: 0.7; }
.finding.is-done .finding-action { text-decoration: line-through; }
.finding-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.finding-house { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--text-soft); }
.finding-action { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.impact-tag { margin-top: 5px; font-size: 11px; color: var(--text-soft); }
.finding-actions { margin-top: 8px; display: flex; gap: 7px; flex-wrap: wrap; }
.finding-actions .btn { padding: 7px 11px; font-size: 9.5px; letter-spacing: 0.12em; }
.agent-primary { width: 100%; justify-content: center; }

.activity-log { border-top: 1px solid var(--border-forest); padding-top: 10px; }
.activity-log p { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 6px; }
.agent-log-list { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-soft); }

.modal { position: fixed; inset: 0; background: rgba(15, 28, 20, 0.35); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal-card { width: min(940px, 100%); max-height: 88vh; overflow: hidden; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-forest); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border-forest); }
.modal-head h3 { font-family: 'Playfair Display', serif; color: var(--forest); font-size: 23px; }
.modal-report { overflow: auto; padding: 16px 18px 2px; font-size: 12px; color: var(--text); line-height: 1.55; }
.modal-report h3 { font-family: 'Playfair Display', serif; color: var(--forest); font-size: 22px; margin-bottom: 5px; }
.modal-report h4 { margin: 14px 0 6px; color: var(--forest); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.modal-report table { min-width: 100%; margin-bottom: 10px; }
.modal-actions { padding: 12px 18px 16px; border-top: 1px solid var(--border-forest); display: flex; justify-content: flex-end; }

.assistant-hero {
  background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
  display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; align-items: center; gap: 18px;
}
.assistant-hero-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.assistant-hero-main h3 {
  font-family: 'Playfair Display', serif; color: var(--forest); font-size: 24px; line-height: 1.1;
}
.assistant-hero-main p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.assistant-hero-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.assistant-hero-stats span {
  min-width: 92px; background: var(--surface-alt); border: 1px solid var(--border-forest);
  border-radius: 10px; padding: 9px 11px;
}
.assistant-hero-stats em {
  display: block; font-style: normal; font-size: 8.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 2px;
}
.assistant-hero-stats b { color: var(--forest); font-size: 14px; font-variant-numeric: tabular-nums; }

.assistant-inbox,
.assistant-overview {
  background: var(--surface); border: 1px solid var(--border-forest); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.assistant-row-list { display: grid; gap: 8px; }
.assistant-row {
  width: 100%; appearance: none; border: 1px solid var(--border-forest); background: var(--surface-alt);
  color: var(--text); border-radius: 10px; padding: 11px 12px; cursor: pointer;
  display: grid; grid-template-columns: auto minmax(0, 1fr) 112px auto; align-items: center; gap: 10px;
  text-align: left; transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.assistant-row:hover { background: #fff; border-color: rgba(27,67,50,0.22); transform: translateY(-1px); }
.assistant-row-main { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.assistant-row-main b { color: var(--forest); font-size: 12px; flex-shrink: 0; }
.assistant-row-main em {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-style: normal; font-size: 12px; color: var(--text); line-height: 1.4;
}
.assistant-source {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted);
  white-space: nowrap;
}
.assistant-details {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--forest); background: #fff; border: 1px solid var(--border-forest);
  border-radius: 999px; padding: 5px 8px; white-space: nowrap;
}

.assistant-agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.assistant-agent-card {
  appearance: none; border: 1px solid var(--border-forest); background: var(--surface-alt);
  color: var(--text); border-radius: 10px; padding: 12px; cursor: pointer;
  min-height: 120px; display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: 1fr auto;
  gap: 10px; text-align: left; transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.assistant-agent-card:hover { background: #fff; border-color: rgba(27,67,50,0.22); transform: translateY(-1px); }
.assistant-agent-card .tool-ic { grid-row: span 2; }
.assistant-agent-copy b {
  display: block; font-family: 'Playfair Display', serif; color: var(--forest); font-size: 18px; line-height: 1.15;
}
.assistant-agent-copy em {
  display: block; font-style: normal; color: var(--text-muted); font-size: 11px; line-height: 1.45;
  margin-top: 4px;
}
.assistant-agent-meta {
  grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--border-forest); padding-top: 8px;
}
.assistant-agent-meta strong { color: var(--forest); font-size: 13px; }
.assistant-agent-meta small { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }

.assistant-drawer-shell { position: fixed; inset: 0; z-index: 70; pointer-events: auto; }
.assistant-drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 28, 20, 0.28); }
.assistant-drawer-card {
  position: absolute; top: 0; right: 0; width: min(480px, 100%); height: 100%;
  background: var(--surface); border-left: 1px solid var(--border-forest); box-shadow: var(--shadow-lg);
  padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.drawer-head { display: flex; align-items: center; gap: 12px; }
.drawer-head .card-title { margin-bottom: 2px; }
.drawer-head h3 { font-family: 'Playfair Display', serif; color: var(--forest); font-size: 27px; line-height: 1.1; }
.drawer-close {
  margin-left: auto; border: 1px solid var(--border-forest); background: var(--surface-alt); color: var(--forest);
  border-radius: 999px; padding: 7px 10px; cursor: pointer; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.drawer-confidence { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 8px; font-size: 11px; color: var(--text-soft); }
.drawer-primary-action {
  background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 12px; padding: 13px;
}
.drawer-primary-action.is-done { opacity: 0.7; }
.drawer-primary-action.is-done h4 { text-decoration: line-through; }
.drawer-primary-action h4 { margin: 9px 0 7px; color: var(--forest); font-size: 15px; line-height: 1.45; }
.drawer-primary-action p { color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.drawer-section .card-title { margin-bottom: 8px; }
.drawer-finding-list { display: grid; gap: 7px; }
.drawer-finding {
  appearance: none; border: 1px solid var(--border-forest); background: var(--surface-alt); color: var(--text);
  border-radius: 10px; padding: 10px; cursor: pointer; display: flex; align-items: flex-start; gap: 8px;
  text-align: left;
}
.drawer-finding.active { background: #fff; border-color: rgba(27,67,50,0.24); box-shadow: var(--shadow); }
.drawer-finding b { display: block; color: var(--forest); font-size: 11px; margin-bottom: 3px; }
.drawer-finding em { display: block; font-style: normal; color: var(--text-soft); font-size: 11px; line-height: 1.4; }

.hidden { display: none !important; }

/* ---- Toast ------------------------------------------------------------ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--forest); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Animations ------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ring { 0% { transform: scale(1); opacity: 0.4; } 100% { transform: scale(2.6); opacity: 0; } }

.animate-in { animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stagger > * { animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.14s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.26s; }
.stagger > *:nth-child(6) { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .bar { height: auto; }
}

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 1180px) {
  .snapshot-strip { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .house-card-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .farmer-focus-grid { grid-template-columns: 1fr; }
  .action-panel { grid-template-columns: 1fr 280px; }
}

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--border-forest); }
  .sidebar-farm { margin: 0; padding: 0; border: none; }
  .sidebar-farm .lbl, .sidebar-farm .loc { display: none; }
  .nav { flex-direction: row; gap: 4px; margin-left: auto; }
  .nav-item { padding: 9px 11px; }
  .nav-item .label { display: none; }
  .sidebar-spacer, .sidebar-user { display: none; }
  .main { padding: 22px 16px 50px; }
  .cards { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 30px; }
  .weight-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .piling-banner { align-items: flex-start; flex-direction: column; }
  .house-card-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .action-panel { grid-template-columns: 1fr; }
  .action-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .action-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .proof-foldout .proof-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .assistant-hero { grid-template-columns: 1fr; align-items: stretch; }
  .assistant-hero-stats { justify-content: flex-start; }
  .assistant-hero .btn { justify-content: center; }
  .assistant-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .assistant-source { display: none; }
}

@media (max-width: 640px) {
  .weight-hero { padding: 20px 18px; }
  .weight-hero-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .weight-hero-number { font-size: 40px; }
  .weight-list-table { display: none; }
  .weight-house-cards { display: grid; gap: 10px; }
  .snapshot-strip { grid-template-columns: 1fr; }
  .changed-strip { align-items: stretch; flex-direction: column; }
  .changed-title { margin-bottom: 2px; }
  .change-pill { width: 100%; justify-content: flex-start; border-radius: 10px; }
  .trust-strip { padding: 16px; }
  .trust-meta { flex-direction: column; align-items: flex-start; }
  .flock-economics-grid { grid-template-columns: 1fr; }
  .roi-fields { grid-template-columns: 1fr; }
  .value-ribbon { flex-direction: column; }
  .house-card-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .action-panel { padding: 18px; }
  .action-panel h2 { font-size: 27px; }
  .action-side { display: flex; }
  .chart-legend { flex-direction: column; gap: 8px; }
  .dashboard-readings .table-scroll { display: none; }
  .dashboard-readings .mobile-barn-list { display: grid; gap: 10px; padding: 0 14px 16px; }
  .walk-panel {
    top: auto; bottom: 0; width: 100%; height: min(88vh, 760px); border-left: none;
    border-top: 1px solid var(--border-forest); border-radius: 16px 16px 0 0;
  }
  .walk-item-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .proof-foldout .proof-grid { grid-template-columns: 1fr; }
  .mobile-barn {
    background: var(--surface-alt); border: 1px solid var(--border-forest); border-radius: 10px;
    padding: 12px;
  }
  .mobile-barn > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
  .mobile-barn strong { color: var(--forest); font-size: 13px; }
  .mobile-barn span { color: var(--text-muted); font-size: 11px; text-align: right; }
  .mobile-barn dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12px; }
  .mobile-barn dt { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 9px; }
  .mobile-barn dd { text-align: right; color: var(--forest); font-weight: 700; }
  .assistant-inbox, .assistant-overview { padding: 14px; }
  .assistant-hero { padding: 15px; }
  .assistant-hero-main { align-items: flex-start; }
  .assistant-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .assistant-hero-stats span { min-width: 0; padding: 8px; }
  .assistant-row { grid-template-columns: 1fr auto; gap: 8px; }
  .assistant-row .rec-priority { grid-row: 1; grid-column: 1; width: fit-content; }
  .assistant-row-main { grid-column: 1 / -1; }
  .assistant-details { grid-row: 1; grid-column: 2; }
  .assistant-agent-grid { grid-template-columns: 1fr; }
  .assistant-drawer-card {
    top: auto; bottom: 0; width: 100%; height: min(88vh, 760px); border-left: none;
    border-top: 1px solid var(--border-forest); border-radius: 16px 16px 0 0;
  }
  .drawer-head h3 { font-size: 24px; }
  .drawer-confidence { grid-template-columns: 68px 1fr auto; }
}
