/*
 * FarmAssist Agent. Mobile-first: designed for a phone held in one hand, then widened.
 * Warm cream page, white cards, deep green actions, and a charcoal assistant panel.
 */
:root {
  --bg: #f6f3ea;
  --surface: #ffffff;
  --surface-2: #faf8f2;
  --border: #e5e0d2;
  --text: #1d2620;
  --muted: #5c675f;
  --green: #1f6b3a;
  --green-hover: #185a30;
  --green-dark: #17532d;
  --green-soft: #e5efe3;
  --ok-bg: #e3f1e5;
  --ok-text: #1b5a31;
  --warn-bg: #fff1d6;
  --warn-text: #7a4a00;
  --danger-bg: #fde8e5;
  --danger-text: #a12a1d;
  --info-bg: #eaf1f8;
  --info-text: #1e3f5c;
  /* The assistant panel stays dark in both themes. */
  --ink: #1c211e;
  --ink-2: #262c28;
  --ink-3: #333a35;
  --on-ink: #eef2ee;
  --on-ink-muted: #a6b1a9;
  --mint: #8fd3a0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 38, 32, 0.05), 0 4px 14px rgba(29, 38, 32, 0.05);
  --nav-height: 64px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Tamil', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121512;
    --surface: #1b1f1c;
    --surface-2: #171a18;
    --border: #2d342f;
    --text: #e8ece8;
    --muted: #a3ada5;
    --green: #6fbf7d;
    --green-hover: #84cc91;
    --green-dark: #8fd39b;
    --green-soft: #1e3324;
    --ok-bg: #1e3324;
    --ok-text: #9edcaa;
    --warn-bg: #3a2e12;
    --warn-text: #f3d48f;
    --danger-bg: #3b1d1a;
    --danger-text: #ffb4ab;
    --info-bg: #1b2633;
    --info-text: #b9d3ee;
    --ink: #0e110f;
    --ink-2: #1a1f1b;
    --ink-3: #2a312c;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.45rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 6px; }
p:last-child { margin-bottom: 0; }
a { color: var(--green-dark); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.big { font-size: 1.9rem; font-weight: 700; margin: 0 0 2px; letter-spacing: -0.01em; }
.lines { white-space: pre-line; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- Controls */
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: var(--radius-sm); min-height: 44px; padding: 0 16px; background: none; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; font-weight: 600;
}
button.primary:hover:not(:disabled) { background: var(--green-hover); }
@media (prefers-color-scheme: dark) { button.primary, .btn { color: #0d1a10; } }
button.secondary { background: var(--green-soft); color: var(--green-dark); font-weight: 600; width: 100%; }
button.link, a.link { background: none; color: var(--green-dark); min-height: 36px; padding: 0 4px; font-weight: 600; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; }
button.link:hover, a.link:hover { text-decoration: underline; }
button.wide { width: 100%; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; min-height: 42px; padding: 0 14px;
}
.btn-outline:hover { border-color: var(--green); }
.btn-outline .ico { width: 18px; height: 18px; color: var(--green-dark); }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* ---------------------------------------------------------------- Status */
.loading { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: var(--muted); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--green); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#app > .loading { padding: 24px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.notice-error { background: var(--danger-bg); color: var(--danger-text); }
.notice-error button.link { color: inherit; text-decoration: underline; }
.notice-info { background: var(--info-bg); color: var(--info-text); }
.notice-empty { color: var(--muted); padding: 8px 0; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; white-space: nowrap; line-height: 1.3; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.empty { text-align: center; padding: 18px 8px; color: var(--text); }
.empty-icon { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green-dark); margin-bottom: 8px; }
.verified { margin-top: 10px; color: var(--ok-text); }

/* ---------------------------------------------------------------- Brand */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--green); color: #fff; flex: none; }
.brand-mark .ico { width: 22px; height: 22px; }
.brand-name { font-weight: 750; font-size: 1.05rem; white-space: nowrap; }
.brand-name span { color: var(--green); font-weight: 650; }
.brand-big { flex-direction: column; gap: 10px; }
.brand-big .brand-mark { width: 56px; height: 56px; border-radius: 16px; }
.brand-big .brand-mark .ico { width: 32px; height: 32px; }
.brand-big .brand-name { font-size: 1.2rem; }

/* ---------------------------------------------------------------- Sign-in */
.signin-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 32px 24px; text-align: center;
}
.signin-card h1 { margin-top: 22px; }
.tagline { color: var(--muted); margin: 6px 0 22px; }
.signin { display: grid; gap: 16px; text-align: left; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.with-action { position: relative; }
.with-action input { padding-right: 76px; }
.reveal { position: absolute; right: 4px; top: 2px; bottom: 2px; min-height: 0; padding: 0 12px; color: var(--green-dark); font-weight: 600; font-size: 0.9rem; }
.signin button.primary { min-height: 50px; font-size: 1.05rem; }
.signin-foot { margin-top: 18px; }

/* ---------------------------------------------------------------- Shell */
.topbar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.account { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-weight: 700;
}
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); padding: 0 10px; font-weight: 600; font-size: 0.9rem; }
.ghost-btn:hover { color: var(--text); background: var(--surface-2); }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(var(--nav-height) + 24px + env(safe-area-inset-bottom)); }

/* Phone: bottom tabs */
.app-narrow .account .label { display: none; }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 600; min-width: 0; }
.tabs a .ico { width: 22px; height: 22px; }
.tabs a.active { color: var(--green-dark); }
.tabs a.active::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.tabs a:focus-visible { outline-offset: -3px; }

/* Phone, Ask tab: the assistant fills the screen between the header and the tabs. */
.app-narrow.on-chat { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.app-narrow.on-chat .content { flex: 1; min-height: 0; padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom)); max-width: none; display: flex; flex-direction: column; }
.app-narrow.on-chat .content > .notice { margin: 8px; }
.app-narrow.on-chat .assistant { flex: 1; min-height: 0; }

/* Wide screen: assistant on the left, the page on the right. */
.app-wide { display: grid; grid-template-columns: clamp(320px, 32vw, 420px) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: var(--on-ink); }
.side-brand { padding: 16px 18px 6px; }
.side .brand-name span { color: var(--mint); }
.side .assistant { flex: 1; min-height: 0; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.app-wide .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: 12px 24px; }
.app-wide .content { padding: 24px; }
.topnav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; white-space: nowrap; flex: none; min-height: 42px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; }
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a.active { background: var(--green-soft); color: var(--green-dark); }
.topnav .ico { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- Pages */
.view { display: grid; gap: 16px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.page-head p { margin: 2px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-actions .btn { padding: 0 16px; min-height: 42px; }
.page-actions .btn .ico { width: 18px; height: 18px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { flex: 1; min-width: 0; }
.card-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--green-soft); color: var(--green-dark); flex: none; }
.card-icon .ico { width: 18px; height: 18px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: border-color 0.15s;
}
.stat:hover { border-color: var(--green); }
.stat-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); flex: none; }
.stat-icon .ico { width: 17px; height: 17px; }
.stat-value { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat-value.skeleton { color: var(--border); }
.stat-sub { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-danger { border-color: color-mix(in srgb, var(--danger-text) 45%, var(--border)); }
.stat-danger .stat-sub { color: var(--danger-text); font-weight: 650; }
.stat-danger .stat-icon { background: var(--danger-bg); color: var(--danger-text); }
.stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  .stats > .stat:last-child:nth-child(odd) { grid-column: auto; }
}

.dash-grid { display: grid; gap: 16px; align-items: start; }
.dash-col { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 768px) and (max-width: 1023px), (min-width: 1240px) {
  .dash-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

.breakdown, .plain, .entries, .actions, .rows { list-style: none; margin: 8px 0 0; padding: 0; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.breakdown li strong { white-space: nowrap; }
.plain li { padding: 4px 0; }
.plain li::before { content: '•'; color: var(--green); margin-right: 8px; }
.milk-line { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); margin: 0; }
.rows { margin: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; padding-top: 2px; }
.row-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); flex: none; }
.row-icon .ico { width: 17px; height: 17px; }
.row.overdue .row-icon { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.row-main { flex: 1; display: grid; min-width: 0; }
.row-main strong { overflow-wrap: anywhere; }

.filter-card { display: grid; gap: 10px; padding: 12px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 2px 0; border-top: 1px solid var(--border); color: var(--muted); }
.total-line:empty { display: none; }
.total-line strong { font-size: 1.4rem; color: var(--text); }

.entries { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0; overflow: hidden; }
.card .entries { box-shadow: none; margin-top: 10px; }
.entries li:empty { display: none; }
.entries > li > .loading { padding: 12px 16px; }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.entry:first-child { border-top: 0; }
.entry > div { display: grid; min-width: 0; flex: 1; }
.entry .muted { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .amount { font-weight: 700; white-space: nowrap; }
.entry .harvest { font-size: 0.88rem; color: var(--ok-text); }
.entry .badge { flex: none; }
@media (max-width: 420px) {
  .entry.crop { flex-wrap: wrap; }
  .entry.crop .badge { margin-left: 0; }
}

/* ---------------------------------------------------------------- Assistant (always dark) */
.assistant { display: flex; flex-direction: column; background: var(--ink); color: var(--on-ink); min-height: 0; }
.assistant-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ink-3); }
.assistant-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.assistant-title > div { display: grid; min-width: 0; }
.assistant-title strong { font-size: 1rem; }
.assistant-title span:not(.assistant-mark):not(.ico) { color: var(--on-ink-muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink-3); color: var(--mint); flex: none; }
.assistant-mark .ico { width: 19px; height: 19px; }
.side .assistant-mark { display: none; }
.assistant button.ghost { color: var(--on-ink); border: 1px solid var(--ink-3); min-height: 38px; padding: 0 12px; font-size: 0.88rem; font-weight: 600; flex: none; }
.assistant button.ghost:hover { background: var(--ink-2); }
.assistant :focus-visible { outline-color: var(--mint); }

/* Alexa-style simulator: the orb shows what the mic is doing. Colour is never the only signal: the status text says it too. */
.sim { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--ink-3); }
.orb {
  --ring: #3a4a52; --core: #12171a; --glow: transparent;
  position: relative; grid-row: span 2; width: 84px; height: 84px; min-height: 0; padding: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #1b2226, var(--core) 70%);
  border: 5px solid var(--ring); box-shadow: 0 0 0 0 var(--glow), inset 0 0 18px rgba(0, 0, 0, 0.6);
  color: var(--on-ink-muted); display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.orb .orb-core .ico { width: 28px; height: 28px; }
.orb:disabled { cursor: default; opacity: 0.6; }
.orb[data-state='ready'] { --ring: #1f6f8b; color: #7fd1ea; animation: breathe 3s ease-in-out infinite; }
.orb[data-state='listening'] { --ring: #34c4f0; --glow: rgba(52, 196, 240, 0.45); color: #fff; animation: listen 1.1s ease-in-out infinite; }
.orb[data-state='processing'] { --ring: #34c4f0; border-color: #1f6f8b #34c4f0 #1f6f8b #34c4f0; color: #7fd1ea; animation: spin 1s linear infinite; opacity: 1; }
.orb[data-state='processing'] .orb-core { animation: spin 1s linear infinite reverse; }
.orb[data-state='speaking'] { --ring: var(--mint); --glow: rgba(143, 211, 160, 0.4); color: var(--mint); animation: listen 1.6s ease-in-out infinite; }
.orb[data-state='error'] { --ring: #c0584a; color: #ffb4ab; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 196, 240, 0.0), inset 0 0 18px rgba(0, 0, 0, 0.6); } 50% { box-shadow: 0 0 14px 2px rgba(52, 196, 240, 0.25), inset 0 0 18px rgba(0, 0, 0, 0.6); } }
@keyframes listen { 0%, 100% { box-shadow: 0 0 0 0 var(--glow), inset 0 0 18px rgba(0, 0, 0, 0.6); } 50% { box-shadow: 0 0 0 10px transparent, 0 0 24px 6px var(--glow), inset 0 0 18px rgba(0, 0, 0, 0.6); } }
.sim-text { min-width: 0; }
.sim-kicker { margin: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); }
.sim-status { margin: 2px 0 0; font-size: 1.1rem; font-weight: 700; }
.sim-hint { margin: 2px 0 0; font-size: 0.88rem; color: var(--on-ink-muted); overflow-wrap: anywhere; }
.sim-hint.heard { color: var(--on-ink); font-style: italic; }
.sim-controls { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.sim-controls select { min-height: 36px; padding: 4px 10px; width: auto; background: var(--ink-2); border-color: var(--ink-3); color: var(--on-ink); font-size: 0.86rem; }
.sim-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--ink-3); color: var(--on-ink); font-size: 0.84rem; font-weight: 600; }
.sim-toggle[aria-pressed='false'] { color: var(--on-ink-muted); }
.sim-toggle .ico { width: 16px; height: 16px; }
@media (min-width: 1024px) {
  .side .sim { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 18px 16px 14px; }
  .side .orb { grid-row: auto; width: 120px; height: 120px; border-width: 6px; }
  .side .orb .orb-core .ico { width: 36px; height: 36px; }
  .side .sim-controls { grid-column: 1; justify-content: center; }
}
@media (max-width: 380px) {
  .orb { width: 68px; height: 68px; }
  .sim-controls { grid-column: 1 / -1; }
}

.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 16px; scrollbar-color: var(--ink-3) transparent; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.bubble p { margin: 0; }
.bubble p + p { margin-top: 6px; }
.bubble-me { align-self: flex-end; background: #2f7d4a; color: #fff; border-bottom-right-radius: 6px; }
.bubble-bot { align-self: flex-start; background: var(--ink-2); border: 1px solid var(--ink-3); border-bottom-left-radius: 6px; }
.bubble .actions li { font-size: 0.85rem; color: var(--on-ink-muted); margin-top: 6px; }
.bubble .actions li.ok { color: var(--mint); }
.bubble .actions li.failed { color: #ffb4ab; }
.bubble .mode { font-size: 0.78rem; color: var(--on-ink-muted); margin-top: 6px; font-style: italic; }
.bubble .spoken { font-size: 0.75rem; opacity: 0.8; margin-left: 6px; }
.bubble img.photo { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; }
.bubble.urgent { border: 2px solid #ff8a7a; background: #3a1f1c; }
.bubble.urgent .badge { margin-bottom: 6px; }
.bubble .notice { padding: 0; background: none; }
.bubble .notice-error { color: #ffb4ab; }
.bubble .notice-info { color: var(--on-ink); }
.bubble .notice button.link { color: var(--mint); }
.typing { display: flex; align-items: center; gap: 10px; color: var(--on-ink-muted); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; text-align: left;
  background: transparent; color: var(--on-ink); border: 1px solid var(--ink-3); min-height: 40px; border-radius: 999px; font-size: 0.88rem; padding: 6px 14px;
}
.chip:hover:not(:disabled) { background: var(--ink-3); border-color: var(--on-ink-muted); }
.chip-fill { border-style: dashed; color: var(--on-ink-muted); }
.chip .ico { width: 16px; height: 16px; color: var(--mint); }

.confirm { display: flex; gap: 8px; margin-top: 10px; }
.confirm button { flex: 1; }
.assistant button.primary { background: var(--mint); color: #0d1a10; }
.assistant button.secondary { background: var(--ink-3); color: var(--on-ink); }

.composer-wrap { padding: 10px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--ink-3); }
.app-narrow .composer-wrap { padding-bottom: 10px; }
.composer { display: flex; align-items: center; gap: 6px; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 16px; padding: 5px; }
.composer:focus-within { border-color: var(--mint); }
.composer input[type='text'] { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--on-ink); min-height: 44px; padding: 8px 6px; }
.composer input[type='text']::placeholder { color: var(--on-ink-muted); }
.composer input[type='text']:focus-visible { outline: none; }
.composer .tool { width: 44px; padding: 0; border-radius: 12px; color: var(--on-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.composer .tool:hover:not(:disabled) { background: var(--ink-3); }
.composer .send { width: 44px; padding: 0; border-radius: 12px; background: var(--mint); color: #0d1a10; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hidden-file { display: none; }
.composer-hint { color: var(--on-ink-muted); font-size: 0.8rem; margin: 6px 4px 0; }

@media (prefers-reduced-motion: reduce) {
  .orb, .orb .orb-core, .dots i, .spin { animation: none !important; }
}

/* Shown only by the local development server */
.dev-banner { background: #fff3cd; color: #5c4400; padding: 8px 16px; font-size: 0.85rem; text-align: center; border-bottom: 1px solid #e6d28a; }
@media (prefers-color-scheme: dark) { .dev-banner { background: #3a3110; color: #f3dd8f; border-color: #5c4d18; } }

/* Once the conversation starts, the orb shrinks into a header row (like a voice assistant mid-conversation). */
.sim.compact { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; padding: 10px 16px; }
.sim.compact .orb { grid-row: auto; width: 52px; height: 52px; border-width: 4px; }
.sim.compact .orb .orb-core .ico { width: 20px; height: 20px; }
.sim.compact .sim-status { font-size: 1rem; }
.sim.compact .sim-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-hint.err { color: #ffb4ab; }
.sim.compact .sim-hint:not(.err) { display: none; }
@media (min-width: 1024px) {
  .side .sim.compact { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; padding: 10px 16px; }
  .side .sim.compact .orb { width: 56px; height: 56px; border-width: 4px; }
  .side .sim.compact .orb .orb-core .ico { width: 22px; height: 22px; }
}
.composer-wrap .sim-controls { grid-column: auto; margin-top: 8px; justify-content: flex-start; }

/* The round mic beside Send */
.composer .talk {
  width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #3fd0f5, #1f8fd6); color: #fff; box-shadow: 0 4px 14px rgba(31, 143, 214, 0.35);
}
/* The mic beside Send: blue to talk; red with a stop square while listening (the orb above does the glowing). */
.composer .talk[data-state='listening'] { background: #e5484d; box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.25); }
.composer .talk[data-state='speaking'] { background: linear-gradient(145deg, #3fd0f5, #1f8fd6); }
.composer .talk[data-state='error'] { background: #8a2f26; box-shadow: none; }

/* Status line: the words heard replace it while listening */
.sim-status.heard { font-style: italic; font-weight: 600; }
.sim-hint:empty { display: none; }

/* "Try saying" examples until the conversation starts */
.try { display: grid; gap: 8px; margin-top: auto; }
.try-title { margin: 0 0 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); }
.try-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--ink-2); border: 1px solid var(--ink-3); color: var(--on-ink); border-radius: 12px; padding: 10px 14px; min-height: 46px; font-size: 0.95rem;
}
.try-item:hover { background: var(--ink-3); }
.try-item.fill { color: var(--on-ink-muted); border-style: dashed; }
.try-item .ico { width: 16px; height: 16px; color: var(--mint); }
.hands-free[aria-pressed='true'] { color: var(--mint); border-color: rgba(143, 211, 160, 0.45); }
.composer-wrap .sim-controls .hands-free { margin-left: auto; }
.composer .send { background: transparent; color: var(--on-ink-muted); }
.composer .send:hover:not(:disabled) { color: var(--on-ink); background: var(--ink-3); }

/* MCP tool calls above a reply */
.tool-calls { align-self: stretch; display: grid; gap: 6px; max-width: 100%; }
.tool-calls-title { margin: 4px 0 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); }
.tool-call { border: 1px solid var(--ink-3); border-radius: 10px; background: var(--ink); min-width: 0; }
.tool-call summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; min-height: 40px; font-size: 0.86rem; }
.tool-call summary::-webkit-details-marker { display: none; }
.tool-call summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; border-radius: 10px; }
.tc-mark { color: var(--mint); font-weight: 700; flex: none; }
.tool-call.failed .tc-mark { color: #ffb4ab; }
.tc-name { color: #5fd3f3; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.82rem; flex: none; }
.tc-text { flex: 1; min-width: 0; color: var(--on-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-ms { flex: none; color: var(--on-ink-muted); font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; }
.tc-chevron { flex: none; display: inline-flex; color: var(--on-ink-muted); transition: transform 0.15s; }
.tc-chevron .ico { width: 16px; height: 16px; }
.tool-call[open] .tc-chevron { transform: rotate(90deg); }
.tc-body { padding: 0 12px 10px 30px; font-size: 0.84rem; color: var(--on-ink); overflow-wrap: anywhere; }
.tc-body p { margin: 4px 0 0; }
.tc-label { color: var(--on-ink-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px !important; }
.tc-body pre { margin: 4px 0 0; padding: 8px; border-radius: 8px; background: var(--ink-2); font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
@media (max-width: 420px) { .tc-text { display: none; } .tool-call summary .tc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; } }

/* Sign-up and email code */
.field-hint { margin: 0; font-size: 0.82rem; color: var(--muted); }
.switch { margin: 16px 0 0; font-size: 0.92rem; color: var(--muted); }
.switch button.link { font-size: 0.92rem; padding: 0 2px; min-height: 32px; }
.code-input { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }

/* Voice log (?voicedebug=1) */
.voice-debug { margin-top: 8px; display: grid; gap: 6px; }
.voice-log { margin: 0; max-height: 150px; overflow: auto; padding: 8px; border-radius: 8px; background: var(--ink-2); color: var(--on-ink-muted); font: 0.72rem/1.4 ui-monospace, Consolas, monospace; white-space: pre-wrap; }

/* =====================================================================================================
   Premium pass (2026-10-21): fixed-height app (only content scrolls), refined scrollbars, softer depth.
   ===================================================================================================== */
:root {
  --bg: #f4f1e9;
  --bg-2: #efe9dc;
  --hairline: rgba(42, 52, 40, 0.09);
  --shadow: 0 1px 1px rgba(25, 35, 25, 0.03), 0 2px 6px rgba(25, 35, 25, 0.04), 0 12px 28px -12px rgba(25, 35, 25, 0.12);
  --shadow-hover: 0 1px 2px rgba(25, 35, 25, 0.04), 0 6px 14px rgba(25, 35, 25, 0.06), 0 22px 40px -16px rgba(25, 35, 25, 0.2);
  --radius: 18px;
  --scroll-thumb: rgba(48, 60, 46, 0.22);
  --scroll-thumb-hover: rgba(48, 60, 46, 0.42);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101311;
    --bg-2: #0c0f0d;
    --hairline: rgba(255, 255, 255, 0.07);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 40px -16px rgba(0, 0, 0, 0.75);
    --scroll-thumb: rgba(255, 255, 255, 0.16);
    --scroll-thumb-hover: rgba(255, 255, 255, 0.32);
  }
}

/* ---- The window never scrolls; the app fills the screen and its panels scroll inside it ---- */
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(214, 196, 150, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(120, 160, 110, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.app { height: 100vh; height: 100dvh; overflow: hidden; }

.app-wide { min-height: 0; grid-template-rows: minmax(0, 1fr); }
.side { position: relative; height: 100%; }
.main-col { height: 100%; min-height: 0; overflow: hidden; }
.app-wide .topbar { position: relative; flex: none; }
.app-wide .content {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  max-width: none; margin: 0;
  /* Centre the page in a 1180px column while the scrollbar sits at the window edge. */
  padding: 28px max(28px, calc((100% - 1180px) / 2)) 40px;
}

.app-narrow { display: flex; flex-direction: column; }
.app-narrow .topbar { position: relative; flex: none; }
.app-narrow .dev-banner { flex: none; }
.app-narrow .content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }
.app-narrow .tabs { position: relative; flex: none; }
.app-narrow.on-chat .content { padding-bottom: 0; overflow: hidden; }

/* ---- Scrollbars: thin, rounded, quiet until hovered ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box; min-height: 40px;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.assistant ::-webkit-scrollbar-thumb, .side ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); background-clip: padding-box; }
.assistant ::-webkit-scrollbar-thumb:hover, .side ::-webkit-scrollbar-thumb:hover { background: rgba(143, 211, 160, 0.45); background-clip: padding-box; }
/* Chromium uses the styles above only when no standard scrollbar-color is set; Firefox gets the standard ones. */
.chat-log, .topnav { scrollbar-color: auto; }
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
  .assistant *, .side * { scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
}

/* ---- Top bar: glass with a hairline ---- */
.topbar {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.app-wide .topbar { background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 14px 28px; }
.topnav { gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--hairline); }
.topnav a { min-height: 38px; padding: 0 16px; font-weight: 600; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
.topnav a.active { background: var(--surface); color: var(--green-dark); box-shadow: 0 1px 2px rgba(25, 35, 25, 0.08), 0 4px 12px -6px rgba(25, 35, 25, 0.2); }
.avatar { background: linear-gradient(145deg, #e9f2e6, #d7e8d3); box-shadow: inset 0 0 0 1px rgba(31, 107, 58, 0.15); }

/* ---- Type ---- */
h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-weight: 650; letter-spacing: -0.005em; }
.big { font-weight: 750; letter-spacing: -0.025em; }

/* ---- Cards ---- */
.card, .stat, .entries {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 94%, var(--bg)));
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.card { padding: 20px 22px; border-radius: var(--radius); }
.card-head { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.card-icon, .stat-icon, .row-icon, .empty-icon {
  background: linear-gradient(145deg, #eef5ec, #dcebd8);
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px rgba(31, 107, 58, 0.12), 0 2px 6px -2px rgba(31, 107, 58, 0.25);
  border: 0;
}
.row.overdue .row-icon, .stat-danger .stat-icon { background: linear-gradient(145deg, #fdeeea, #f8d9d2); color: var(--danger-text); }
@media (prefers-color-scheme: dark) {
  .card-icon, .stat-icon, .row-icon, .empty-icon { background: linear-gradient(145deg, #1f3324, #172a1c); box-shadow: inset 0 0 0 1px rgba(143, 211, 160, 0.15); }
  .row.overdue .row-icon, .stat-danger .stat-icon { background: linear-gradient(145deg, #3b1d1a, #2d1513); }
  .avatar { background: linear-gradient(145deg, #1f3324, #172a1c); }
}

/* Summary tiles: quiet label, confident number, a soft lift on hover */
.stats { gap: 16px; }
.stat {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--radius);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
}
.stat::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, #1f6b3a, #6fbf7d 60%, rgba(184, 138, 46, 0.7));
  opacity: 0; transition: opacity 0.25s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--green) 30%, var(--hairline)); }
.stat:hover::after { opacity: 1; }
.stat-top { font-size: 0.74rem; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; }
.stat-value { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; }
.stat-sub { font-size: 0.8rem; }
.stat-danger { border-color: rgba(161, 42, 29, 0.25); }
.stat-danger::after { background: linear-gradient(90deg, #a12a1d, #e07a5f); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .stat, .stat:hover { transition: none; transform: none; } }

/* Lists and rows */
.breakdown li, .milk-line, .row, .entry { border-top-color: var(--hairline); }
.breakdown li { padding: 10px 0; }
.entry { transition: background-color 0.15s; }
.entry:hover { background: color-mix(in srgb, var(--green-soft) 45%, transparent); }
.badge { padding: 4px 11px; }
.badge-neutral { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); border-color: var(--hairline); }
.filter-card select { background: var(--surface); }

/* Buttons */
.btn-outline { border-color: var(--hairline); background: var(--surface); box-shadow: 0 1px 2px rgba(25, 35, 25, 0.05); border-radius: 12px; transition: border-color 0.2s, box-shadow 0.2s; }
.btn-outline:hover { border-color: color-mix(in srgb, var(--green) 40%, var(--hairline)); box-shadow: 0 4px 14px -6px rgba(25, 35, 25, 0.25); }
button.primary, .btn {
  background: linear-gradient(180deg, #23793f, #1b6233);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 16px -8px rgba(31, 107, 58, 0.7);
  border-radius: 12px;
}
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #268445, #1d6a37); }
.assistant button.primary { background: var(--mint); box-shadow: none; }

/* ---- Assistant panel: depth instead of flat black ---- */
.side, .app-narrow .assistant {
  background:
    radial-gradient(500px 300px at 50% -10%, rgba(52, 196, 240, 0.08), transparent 70%),
    linear-gradient(180deg, #1a201c, #141815);
}
.side { border-right: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 8px 0 30px -20px rgba(0, 0, 0, 0.5); }
.side .assistant { background: transparent; }
.assistant-head, .sim, .composer-wrap { border-color: rgba(255, 255, 255, 0.06); }
.bubble-bot { background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, 0.07); box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.6); }
.bubble-me { background: linear-gradient(160deg, #2f8a52, #23703f); box-shadow: 0 8px 20px -12px rgba(31, 107, 58, 0.9); }
.composer { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); border-radius: 18px; }
.try-item, .tool-call, .sim-toggle, .sim-controls select { background: rgba(255, 255, 255, 0.035); border-color: rgba(255, 255, 255, 0.08); }
.try-item:hover { background: rgba(255, 255, 255, 0.07); }
.tool-call { border-radius: 12px; }

/* Bottom tabs on phones: glass bar */
.tabs { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--hairline); }

/* =====================================================================================================
   Reference design (2026-10-21): scenic left region with a floating glass assistant drawer, ivory
   dashboard, pastel metric tiles, soft layered shadows. Built on the existing markup and classes.
   ===================================================================================================== */
:root {
  --paper: #f7f4ea;
  --forest: #063d2d;
  --emerald: #20c866;
  --emerald-deep: #12a552;
  --navy: #13213a;
  --slate: #5d6878;
  --card: #ffffff;
  --line: rgba(19, 33, 58, 0.08);
  --lift: 0 1px 2px rgba(19, 33, 58, 0.05), 0 8px 24px -10px rgba(19, 33, 58, 0.16);
  --lift-hover: 0 2px 4px rgba(19, 33, 58, 0.06), 0 18px 36px -14px rgba(19, 33, 58, 0.26);
  --tile-green: #f2faf4; --tile-green-ink: #138a46;
  --tile-blue: #eef5ff; --tile-blue-ink: #2f78d0;
  --tile-amber: #fff5ea; --tile-amber-ink: #d4772a;
  --tile-mint: #eef8ef; --tile-mint-ink: #2f8f3c;
  --tile-rose: #fff1f1; --tile-rose-ink: #d63c3c;
  --scenic: url("/images/farm-background.webp");
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101412;
    --navy: #e8ece8;
    --slate: #a3ada5;
    --card: #1a1f1c;
    --line: rgba(255, 255, 255, 0.08);
    --lift: 0 10px 30px -14px rgba(0, 0, 0, 0.7);
    --lift-hover: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
    --tile-green: #17241b; --tile-green-ink: #6fd08f;
    --tile-blue: #151f2c; --tile-blue-ink: #7fb3f0;
    --tile-amber: #2a2016; --tile-amber-ink: #f0a868;
    --tile-mint: #16231a; --tile-mint-ink: #7fcf8a;
    --tile-rose: #2c1818; --tile-rose-ink: #ff8f8f;
  }
}
body { background: var(--paper); color: var(--navy); font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Noto Sans', sans-serif; }

/* ---- Desktop grid: scenic region (~25%) + dashboard ---- */
.app-wide { grid-template-columns: clamp(340px, 25vw, 460px) minmax(0, 1fr); background: var(--paper); }
.app-wide.drawer-closed { grid-template-columns: minmax(0, 1fr); }
.scenic {
  position: relative; height: 100%; min-height: 0; padding: 22px 22px 22px;
  background: var(--scenic) center / cover no-repeat, #2f6a2c;
  display: flex; flex-direction: column;
}
.scenic::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 40, 28, 0.18), rgba(6, 40, 28, 0.38)); pointer-events: none; }

/* The floating glass drawer */
.drawer {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  border-radius: 26px; overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 52, 38, 0.86), rgba(4, 40, 30, 0.9));
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #eef6f0;
}
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; flex: none; }
.drawer-logo {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  color: var(--emerald); background: radial-gradient(circle at 50% 50%, rgba(32, 200, 102, 0.12), transparent 70%);
  box-shadow: inset 0 0 0 3px var(--emerald), 0 0 18px rgba(32, 200, 102, 0.35);
}
.drawer-logo .ico { width: 22px; height: 22px; }
.drawer-brand { flex: 1; display: grid; min-width: 0; }
.drawer-brand strong { font-size: 1.1rem; font-weight: 750; color: #fff; letter-spacing: -0.01em; }
.drawer-brand strong span { color: var(--emerald); }
.drawer-brand > span { font-size: 0.8rem; color: rgba(238, 246, 240, 0.7); }
.drawer-toggle { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 10px; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); display: inline-flex; align-items: center; justify-content: center; }
.drawer-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.drawer-toggle .ico { width: 18px; height: 18px; }
.drawer-open {
  position: fixed; left: 22px; bottom: 22px; z-index: 5; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px 0 8px; min-height: 52px; border-radius: 999px; color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #0b5a40, #063d2d); box-shadow: 0 14px 30px -12px rgba(6, 61, 45, 0.8);
}
.drawer-open .ico { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--emerald); color: #04301f; }

/* The assistant inside the drawer is transparent: the drawer is the surface */
.drawer .assistant, .scenic .assistant { background: transparent; flex: 1; min-height: 0; }
.drawer .assistant-head { display: none; }

/* ---- Ask card ---- */
.ask-card, .drawer .ask-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  margin: 4px 14px 10px; padding: 18px 16px 14px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.6);
  grid-template-columns: none;
}
.ask-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ask-title { margin: 0; font-size: 1.15rem; font-weight: 750; color: #fff; text-align: left; }
.ask-new { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; font-size: 0.78rem; font-weight: 650; color: rgba(238, 246, 240, 0.8); border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.ask-new .ico { width: 14px; height: 14px; }
.ask-desc { margin: 0 0 6px; width: 100%; text-align: left; font-size: 0.86rem; color: rgba(238, 246, 240, 0.72); }
.orb-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 4px; }
.orb-waves { color: var(--emerald); opacity: 0.85; display: inline-flex; }
.orb-waves .ico { width: 34px; height: 34px; }
.ask-card .orb, .drawer .orb {
  width: 112px; height: 112px; border: 0; color: #fff;
  background: radial-gradient(circle at 50% 40%, #0d4a36, #052a1f 70%);
  box-shadow: 0 0 0 5px var(--emerald), 0 0 0 10px rgba(32, 200, 102, 0.18), 0 0 36px 8px rgba(32, 200, 102, 0.35), inset 0 0 22px rgba(0, 0, 0, 0.55);
  animation: none;
}
.ask-card .orb .orb-core .ico { width: 40px; height: 40px; }
.ask-card .orb[data-state='listening'] { box-shadow: 0 0 0 5px #5ff09a, 0 0 0 12px rgba(95, 240, 154, 0.25), 0 0 50px 14px rgba(32, 200, 102, 0.55), inset 0 0 22px rgba(0, 0, 0, 0.5); animation: orb-pulse 1.1s ease-in-out infinite; }
.ask-card .orb[data-state='speaking'] { animation: orb-pulse 1.6s ease-in-out infinite; }
.ask-card .orb[data-state='processing'] { animation: none; opacity: 0.85; }
.ask-card .orb[data-state='error'] { box-shadow: 0 0 0 5px #e5484d, 0 0 26px rgba(229, 72, 77, 0.4), inset 0 0 22px rgba(0, 0, 0, 0.55); }
@keyframes orb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .ask-card .orb { animation: none !important; } }
.ask-card .sim-text { width: 100%; text-align: center; }
.ask-card .sim-kicker { display: none; }
.ask-card .sim-status { font-size: 0.95rem; font-weight: 650; color: #fff; }
.ask-card .sim-status.heard { color: #c9f5d9; }
.alexa-mark { display: inline-flex; color: var(--emerald); margin-top: 2px; }
.alexa-mark svg { width: 92px; height: 26px; }
.alexa-mark text { font-family: inherit; }

/* After the conversation starts, the card folds into a header row */
.ask-card.compact { flex-direction: row; text-align: left; gap: 12px; padding: 10px 14px; margin-bottom: 8px; }
.ask-card.compact .ask-head, .ask-card.compact .ask-desc, .ask-card.compact .orb-waves, .ask-card.compact .alexa-mark { display: none; }
.ask-card.compact .orb-wrap { margin: 0; }
.ask-card.compact .orb { width: 48px; height: 48px; box-shadow: 0 0 0 3px var(--emerald), 0 0 16px rgba(32, 200, 102, 0.35), inset 0 0 12px rgba(0, 0, 0, 0.5); }
.ask-card.compact .orb .orb-core .ico { width: 20px; height: 20px; }
.ask-card.compact .sim-text { text-align: left; }
.ask-card.compact .sim-kicker { display: block; }

/* ---- Try saying ---- */
.drawer .chat-log, .assistant .chat-log { padding: 6px 14px 12px; }
.try { gap: 8px; margin-top: 0; }
.try-title { display: flex; align-items: center; gap: 8px; color: rgba(238, 246, 240, 0.85); margin: 2px 0 2px; }
.try-title .ico { width: 18px; height: 18px; color: var(--emerald); }
.try-item {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 10px 8px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09); color: #eef6f0;
  box-shadow: 0 6px 16px -12px rgba(0, 0, 0, 0.7); transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.try-item:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(32, 200, 102, 0.4); transform: translateX(2px); }
.try-item.fill { border-style: solid; color: rgba(238, 246, 240, 0.85); }
.try-item.more { display: none; }
.try.show-more .try-item.more { display: flex; }
.try-icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: rgba(32, 200, 102, 0.14); color: var(--emerald); }
.try-icon .ico { width: 16px; height: 16px; }
.try-text { flex: 1; min-width: 0; font-size: 0.9rem; }
.try-chevron { color: rgba(238, 246, 240, 0.5); display: inline-flex; }
.try-chevron .ico { width: 16px; height: 16px; }
.try-more { align-self: center; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; color: var(--emerald); font-weight: 650; font-size: 0.88rem; }
.try-more .ico { width: 16px; height: 16px; transition: transform 0.2s; }
.try.show-more .try-more .ico { transform: rotate(180deg); }

/* ---- Composer: keyboard icon, text, mic ---- */
.composer-wrap { padding: 10px 14px 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.composer { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px; padding: 5px 5px 5px 12px; box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.7); }
.composer-icon { display: inline-flex; color: rgba(238, 246, 240, 0.6); flex: none; }
.composer-icon .ico { width: 20px; height: 20px; }
.composer .send { display: none; width: 36px; height: 36px; min-height: 0; border-radius: 10px; }
.composer.has-text .send { display: inline-flex; }
.composer .talk {
  width: 48px; height: 48px;
  background: radial-gradient(circle at 50% 35%, #3ee083, #13a552);
  box-shadow: 0 0 0 4px rgba(32, 200, 102, 0.18), 0 10px 22px -8px rgba(32, 200, 102, 0.8);
}
.composer .talk[data-state='listening'] { background: #e5484d; box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.25); }
.sim-controls { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: nowrap; }
.sim-toggle { border-radius: 12px; min-height: 38px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: #eef6f0; }
.sim-toggle[aria-pressed='true'] .ico { color: var(--emerald); }
.lang-box { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 4px 0 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: #eef6f0; }
.lang-box .ico { width: 16px; height: 16px; opacity: 0.8; }
.lang-box select, .sim-controls .lang-box select { background: transparent; border: 0; color: inherit; min-height: 34px; padding: 0 4px; }
.lang-box select option { color: #13213a; }
.settings-menu { position: relative; margin-left: auto; }
.settings-menu summary { list-style: none; width: 40px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: #eef6f0; }
.settings-menu summary::-webkit-details-marker { display: none; }
.settings-menu summary .ico { width: 18px; height: 18px; }
.settings-menu .menu, .account-menu .menu {
  position: absolute; z-index: 20; display: grid; gap: 6px; min-width: 230px; padding: 8px; border-radius: 16px;
}
.settings-menu .menu { right: 0; bottom: calc(100% + 8px); background: #0b3a2b; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.7); }
.settings-menu .menu .sim-toggle { width: 100%; justify-content: flex-start; }
.composer-hint { color: rgba(238, 246, 240, 0.55); }

/* ---- Main column ---- */
.app-wide .topbar { background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 20px 28px 6px; }
.topnav { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px; box-shadow: var(--lift); }
.topnav a { color: var(--navy); border-radius: 12px; min-height: 40px; padding: 0 16px; gap: 8px; }
.topnav a .ico { width: 18px; height: 18px; }
.topnav a.active { background: #e3f4e8; color: var(--forest); box-shadow: none; }
@media (prefers-color-scheme: dark) { .topnav a.active { background: #1f3324; color: #b8ecc8; } }
.account-menu { position: relative; margin-left: auto; }
.account-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; color: var(--navy); font-weight: 650; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.account-menu summary .ico { width: 16px; height: 16px; color: var(--slate); }
.account-menu .avatar { width: 38px; height: 38px; }
.account-menu .menu { right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); box-shadow: var(--lift-hover); }
.account-menu .menu-user { margin: 0; padding: 6px 10px; font-size: 0.82rem; color: var(--slate); overflow-wrap: anywhere; }
.account-menu .menu button { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-start; width: 100%; color: var(--navy); font-weight: 600; }
.account-menu .menu button:hover { background: var(--paper); }

.app-wide .content { padding: 16px max(28px, calc((100% - 1240px) / 2)) 32px; }
.page-head h2 { font-size: 1.9rem; font-weight: 800; color: var(--navy); letter-spacing: -0.025em; }
.page-head p { color: var(--slate); font-size: 0.98rem; }
.page-actions { align-items: center; gap: 14px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--slate); font-weight: 550; font-size: 0.95rem; }
.date-chip .ico { width: 18px; height: 18px; }
.btn-outline { background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-height: 44px; padding: 0 18px; box-shadow: var(--lift); color: var(--forest); }
@media (prefers-color-scheme: dark) { .btn-outline { color: #b8ecc8; } }

/* ---- Metric tiles ---- */
.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1280px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { border-radius: 20px; padding: 18px; min-height: 128px; border: 1px solid var(--line); box-shadow: var(--lift); position: relative; overflow: hidden; }
.stat::after { display: none; }
.stat:hover { box-shadow: var(--lift-hover); transform: translateY(-2px); }
.stat-accent-green { background: linear-gradient(160deg, var(--card), var(--tile-green)); --ink-accent: var(--tile-green-ink); }
.stat-accent-blue { background: linear-gradient(160deg, var(--tile-blue), var(--card) 120%); --ink-accent: var(--tile-blue-ink); }
.stat-accent-amber { background: linear-gradient(160deg, var(--tile-amber), var(--card) 120%); --ink-accent: var(--tile-amber-ink); }
.stat-accent-mint { background: linear-gradient(160deg, var(--tile-mint), var(--card) 120%); --ink-accent: var(--tile-mint-ink); }
.stat-accent-rose { background: linear-gradient(160deg, var(--tile-rose), var(--card) 120%); --ink-accent: var(--tile-rose-ink); }
.stat .stat-icon { width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--ink-accent) 14%, var(--card)); color: var(--ink-accent); box-shadow: none; }
.stat .stat-icon .ico { width: 20px; height: 20px; }
.stat-top { gap: 10px; color: var(--navy); font-size: 0.74rem; letter-spacing: 0.06em; }
.stat-label { flex: 1; }
.stat-chevron { color: var(--slate); display: inline-flex; }
.stat-chevron .ico { width: 16px; height: 16px; }
.stat-value { font-size: 1.85rem; font-weight: 800; color: var(--navy); margin-top: 10px; }
.stat-sub { color: var(--slate); font-size: 0.82rem; position: relative; z-index: 1; }
.stat-art { position: absolute; right: 10px; bottom: 6px; color: var(--ink-accent); opacity: 0.2; pointer-events: none; }
.stat-art .ico { width: 54px; height: 54px; }
.stat-danger .stat-sub { color: var(--tile-rose-ink); font-weight: 700; }
.stat-danger { border-color: color-mix(in srgb, var(--tile-rose-ink) 25%, var(--line)); }

/* ---- Panels ---- */
.dash-grid { gap: 18px; }
.dash-col { gap: 18px; }
@media (min-width: 1240px) { .dash-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px; box-shadow: var(--lift); }
.card-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; gap: 12px; }
.card-head h3 { font-size: 1.12rem; font-weight: 750; color: var(--navy); }
.card-icon { width: 40px; height: 40px; border-radius: 12px; background: #e6f5ea; color: var(--emerald-deep); box-shadow: none; }
.card-icon .ico { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { .card-icon { background: #1f3324; color: #6fd08f; } }
.card-head .link { color: var(--emerald-deep); gap: 4px; font-weight: 650; text-decoration: none; }
.card-head .link .ico { width: 16px; height: 16px; }
@media (prefers-color-scheme: dark) { .card-head .link { color: #6fd08f; } }
.icon-rows li { align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.row-lead { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); }
.mini-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--paper) 70%, var(--card)); color: var(--slate); border: 1px solid var(--line); }
.mini-icon .ico { width: 18px; height: 18px; }
.icon-rows strong { color: var(--navy); font-weight: 750; }
.row { padding: 12px 0; }
.row-icon { width: 38px; height: 38px; border-radius: 12px; border: 0; background: #fde8e8; color: #d63c3c; box-shadow: none; }
.row-icon.ok { background: #e6f5ea; color: var(--emerald-deep); }
.row-icon .ico { width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) { .row-icon { background: #3b1d1a; color: #ff9b9b; } .row-icon.ok { background: #1f3324; color: #6fd08f; } }
.badge-danger { background: #fde8e8; color: #c62f2f; }
.verified-strip { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #e9f6ec; color: #1b6b3a; font-size: 0.9rem; font-weight: 550; }
.verified-strip .ico { width: 20px; height: 20px; color: var(--emerald-deep); }
@media (prefers-color-scheme: dark) { .verified-strip { background: #17241b; color: #9edcaa; } }
.card .big { font-size: 2rem; font-weight: 800; color: var(--navy); }
.card .lines { color: var(--slate); line-height: 1.6; }

/* ---- Phone: the Ask tab gets the same scene ---- */
.app-narrow .assistant { background: var(--scenic) center / cover no-repeat, #063d2d; position: relative; }
.app-narrow .assistant::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 40, 30, 0.82), rgba(4, 40, 30, 0.92)); pointer-events: none; }
.app-narrow .assistant > * { position: relative; }

/* Reference design: fit tweaks */
.sim-controls { gap: 6px; }
.sim-controls .sim-toggle, .lang-box { font-size: 0.8rem; white-space: nowrap; padding: 0 10px; }
.sim-controls .sim-toggle .ico { width: 16px; height: 16px; }
.stat-top { font-size: 0.7rem; letter-spacing: 0.04em; }
.stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stat-top { gap: 8px; font-size: 0.66rem; letter-spacing: 0.02em; }
.stat .stat-icon { width: 32px; height: 32px; border-radius: 10px; }
.stat .stat-icon .ico { width: 17px; height: 17px; }
.stat-chevron .ico { width: 14px; height: 14px; }
.stat-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }

/* Drawer background: the farm photo with a light green wash (as supplied) */
.scenic {
  background-image: linear-gradient(rgba(3, 43, 30, 0.18), rgba(3, 43, 30, 0.35)), var(--scenic);
  background-size: cover;
  background-position: 30% center;
  background-repeat: no-repeat;
  background-color: #2f6a2c;
}
.scenic::before { content: none; }
.drawer { background: linear-gradient(180deg, rgba(6, 52, 38, 0.78), rgba(4, 40, 30, 0.86)); }

/* The farm photo is the background of the whole app; the dashboard sits on a light veil over it. */
.app {
  background: linear-gradient(rgba(3, 43, 30, 0.14), rgba(3, 43, 30, 0.3)), var(--scenic) 30% center / cover no-repeat, #2f6a2c;
}
.scenic, .app-wide .scenic { background: transparent; }
.app-wide .main-col {
  background: linear-gradient(180deg, rgba(247, 244, 234, 0.7), rgba(247, 244, 234, 0.84));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}
.app-narrow .content { background: linear-gradient(180deg, rgba(247, 244, 234, 0.8), rgba(247, 244, 234, 0.9)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.app-narrow.on-chat .content { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.app-narrow .assistant { background: transparent; }
.app-narrow .assistant::before { background: linear-gradient(180deg, rgba(4, 40, 30, 0.72), rgba(4, 40, 30, 0.86)); }
.page-head h2, .page-head p, .date-chip { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
@media (prefers-color-scheme: dark) {
  .app-wide .main-col { background: linear-gradient(180deg, rgba(14, 18, 16, 0.78), rgba(14, 18, 16, 0.9)); border-left-color: rgba(255, 255, 255, 0.06); }
  .app-narrow .content { background: linear-gradient(180deg, rgba(14, 18, 16, 0.82), rgba(14, 18, 16, 0.92)); }
  .page-head h2, .page-head p, .date-chip { text-shadow: none; }
}

/* =====================================================================================================
   Reference v2 (2026-10-21): the photo shows across the whole window; dashboard panels are frosted
   glass on top of it, the drawer floats lower down, and the mic is its own circle beside the input.
   ===================================================================================================== */
.app { background: var(--scenic) 50% 55% / cover no-repeat, #6c9a5b; }
.app-wide .main-col { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-left: 0; }

/* Drawer: lower on the page, leaves visible above it */
.scenic { padding: 86px 18px 22px 20px; }
.drawer { background: linear-gradient(180deg, rgba(10, 58, 38, 0.74), rgba(6, 44, 30, 0.82)); border-radius: 24px; }
.drawer-head { padding: 16px 16px 10px; }
.drawer-logo { box-shadow: none; background: transparent; width: 40px; height: 40px; }
.drawer-logo .ico { width: 34px; height: 34px; color: var(--emerald); filter: drop-shadow(0 0 6px rgba(32, 200, 102, 0.45)); }
.ask-card, .drawer .ask-card { margin: 2px 12px 8px; background: rgba(0, 0, 0, 0.18); border-color: rgba(255, 255, 255, 0.08); }
.ask-head { justify-content: flex-start; }

/* Composer: input box and a separate round mic */
.composer { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 10px; align-items: center; }
.composer:focus-within { border: 0; }
.input-box {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; min-height: 54px;
  border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.input-box:focus-within { border-color: var(--mint); }
.input-box input[type='text'] { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--on-ink); min-height: 44px; padding: 6px 2px; }
.input-box input[type='text']::placeholder { color: rgba(238, 246, 240, 0.6); }
.input-box input[type='text']:focus-visible { outline: none; }
.composer .talk { width: 54px; height: 54px; flex: none; }
.composer .talk .ico { width: 24px; height: 24px; }

/* Main area directly on the photo */
.app-wide .topbar { padding: 22px 28px 4px; }
.topnav { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-color: rgba(255, 255, 255, 0.7); box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.35); }
.account-menu summary { color: #13213a; }
.account-menu .avatar { background: rgba(227, 244, 232, 0.95); }
.page-head h2, .page-head p, .date-chip, .account-name { text-shadow: 0 1px 8px rgba(255, 255, 255, 0.85), 0 0 2px rgba(255, 255, 255, 0.9); }
.page-head h2 { color: #0f1b2e; }
.page-head p, .date-chip { color: #24324a; }
.greeting { display: inline-flex; align-items: center; gap: 8px; }
.greeting-leaf { display: inline-flex; color: var(--emerald); }
.greeting-leaf .ico { width: 24px; height: 24px; }
.btn-outline { background: rgba(255, 255, 255, 0.92); border-color: rgba(255, 255, 255, 0.8); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.35); }

/* Frosted glass panels and tiles */
.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(1.25); -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px -18px rgba(0, 0, 0, 0.35);
}
.stat {
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 16px 36px -18px rgba(0, 0, 0, 0.35);
}
.stat-accent-green { background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(236, 248, 239, 0.86)); }
.stat-accent-blue { background: linear-gradient(160deg, rgba(234, 243, 255, 0.92), rgba(255, 255, 255, 0.84)); }
.stat-accent-amber { background: linear-gradient(160deg, rgba(255, 243, 230, 0.92), rgba(255, 255, 255, 0.84)); }
.stat-accent-mint { background: linear-gradient(160deg, rgba(236, 248, 238, 0.92), rgba(255, 255, 255, 0.84)); }
.stat-accent-rose { background: linear-gradient(160deg, rgba(255, 236, 236, 0.94), rgba(255, 244, 244, 0.86)); }
.icon-rows li, .row { border-top-color: rgba(19, 33, 58, 0.08); }
.verified-strip { background: rgba(225, 244, 230, 0.9); }
.dev-banner { background: rgba(255, 243, 205, 0.92); }

@media (prefers-color-scheme: dark) {
  .card { background: rgba(20, 26, 22, 0.78); border-color: rgba(255, 255, 255, 0.08); }
  .stat-accent-green, .stat-accent-blue, .stat-accent-amber, .stat-accent-mint, .stat-accent-rose { background: rgba(22, 28, 24, 0.8); border-color: rgba(255, 255, 255, 0.08); }
  .topnav { background: rgba(20, 26, 22, 0.86); border-color: rgba(255, 255, 255, 0.1); }
  .btn-outline { background: rgba(20, 26, 22, 0.86); border-color: rgba(255, 255, 255, 0.1); }
  .page-head h2 { color: #fff; }
  .page-head p, .date-chip, .account-menu summary { color: #e8ece8; }
  .page-head h2, .page-head p, .date-chip, .account-name { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); }
}
@media (min-width: 1180px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Compact dashboard (2026-10-21): fit Home on one screen on a laptop; smaller metric tiles */
.app-wide .topbar { padding: 14px 24px 2px; }
.topnav a { min-height: 36px; }
.app-wide .content { padding: 10px max(24px, calc((100% - 1240px) / 2)) 18px; }
.view { gap: 12px; }
.page-head h2 { font-size: 1.55rem; }
.page-head p { font-size: 0.9rem; margin-top: 0; }
.btn-outline { min-height: 38px; padding: 0 14px; }
.stats { gap: 12px; }
.stat { min-height: 0; padding: 12px 14px; border-radius: 16px; gap: 2px; }
.stat-top { font-size: 0.64rem; }
.stat .stat-icon { width: 28px; height: 28px; border-radius: 9px; }
.stat .stat-icon .ico { width: 15px; height: 15px; }
.stat-value { font-size: 1.4rem; margin-top: 6px; }
.stat-sub { font-size: 0.76rem; }
.stat-art .ico { width: 40px; height: 40px; }
.dash-grid, .dash-col { gap: 12px; }
.card { padding: 14px 18px; border-radius: 18px; }
.card-head { margin-bottom: 8px; }
.card-head h3 { font-size: 1rem; }
.card-icon { width: 32px; height: 32px; border-radius: 10px; }
.card-icon .ico { width: 17px; height: 17px; }
.icon-rows li { padding: 7px 0; }
.mini-icon { width: 28px; height: 28px; border-radius: 8px; }
.mini-icon .ico { width: 15px; height: 15px; }
.row { padding: 7px 0; }
.row-icon { width: 30px; height: 30px; border-radius: 9px; }
.row-icon .ico { width: 15px; height: 15px; }
.card .big { font-size: 1.6rem; }
.card .lines { font-size: 0.9rem; line-height: 1.5; margin-bottom: 0; }
.verified-strip { margin-top: 8px; padding: 8px 12px; font-size: 0.84rem; }
.card .muted.small { margin-bottom: 2px; }
.stat { padding: 10px 12px; }
.stat-value { font-size: 1.3rem; margin-top: 4px; }
.app-wide .content { padding-bottom: 12px; }
.voice-pick { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); color: #eef6f0; font-size: 0.82rem; }
.voice-pick span { display: inline-flex; align-items: center; gap: 6px; }
.voice-pick .ico { width: 16px; height: 16px; }
.voice-pick select { min-height: 36px; padding: 4px 8px; background: rgba(0, 0, 0, 0.25); color: #eef6f0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; font-size: 0.82rem; }
.voice-pick select option { color: #13213a; }

/* Farm records: herd list with profiles, per-day tables, demo notices (2026-10-21) */
.scroll-list { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.entries > li > .entry-button { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.entry-button:hover, .entry-button:focus-visible { background: var(--surface-2); }
.entry-button > div { flex: 1; min-width: 0; display: grid; }
.table-wrap { overflow-x: auto; margin-top: 10px; max-width: 100%; }
.grid-table { border-collapse: collapse; width: 100%; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.grid-table th, .grid-table td { padding: 6px 8px; border-top: 1px solid var(--border); text-align: right; white-space: nowrap; }
.grid-table thead th { color: var(--muted); font-weight: 600; border-top: 0; }
.grid-table th[scope='row'], .grid-table thead th:first-child { text-align: left; font-weight: 600; }
.demo-notes { margin-top: 10px; display: grid; gap: 2px; }
.demo-notes p { margin: 0; }
.small.strong { font-weight: 650; margin: 12px 0 0; }
.block { display: block; }
.month-row > span { min-width: 0; }
.profile-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; padding: 20px; box-shadow: var(--shadow); }
.profile-dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .facts { grid-template-columns: minmax(0, 1fr); } .facts dd { margin-bottom: 6px; } }
@media (max-width: 420px) { .entry-button .badge { display: none; } }

/* Home like the reference (2026-10-21): taller metric tiles with a big corner picture, cards in a 2 × 2 grid */
@media (min-width: 1180px) {
  .stat { min-height: 132px; padding: 14px 16px 12px; border-radius: 18px; gap: 0; }
  .stat-top { font-size: 0.7rem; gap: 10px; }
  .stat .stat-icon { width: 38px; height: 38px; border-radius: 12px; }
  .stat .stat-icon .ico { width: 21px; height: 21px; }
  .stat-value { font-size: 1.8rem; margin-top: 12px; }
  .stat-sub { font-size: 0.82rem; margin-top: 2px; max-width: calc(100% - 52px); }
  .stat-art { right: 12px; bottom: 10px; opacity: 0.22; }
  .stat-art .ico { width: 64px; height: 64px; }
}
@media (min-width: 1180px) and (max-height: 800px) {
  .stat { min-height: 112px; }
  .stat-value { font-size: 1.55rem; margin-top: 8px; }
  .stat-art .ico { width: 52px; height: 52px; }
}
@media (min-width: 1240px) {
  .home-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
  .home-grid > .card { height: 100%; }
}
.more-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; font-size: 0.84rem; }
.more-link .ico { width: 14px; height: 14px; }
.home-grid .row .row-main > strong { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-grid .row .row-main > .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1240px) and (max-width: 1500px) { .home-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
@media (min-width: 1240px) and (max-height: 800px) { .home-grid .row .row-main > strong { -webkit-line-clamp: 1; line-clamp: 1; } }
