/* ═══════════════════════════════════════════════════════════════════════════
   Naked Heart (was Naked Console, FarmBox Console) — dark studio skin
   A near-black ground, graphite cards and one orange accent for what you press
   and where you are. Green, amber, red and blue carry state and nothing else.
   The token names are still Naked Farm UI v1's, so every page restyles from
   this block and a skin can still replace it.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 0.9375rem;
  --text-lg: 1.125rem; --text-xl: 1.5rem; --text-2xl: 1.75rem;
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --radius-sm: 0.5rem; --radius-md: 0.625rem; --radius-lg: 1rem; --radius-xl: 1.25rem;
  --radius-full: 9999px;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --rail: 248px;

  --bg: #0b0b0d;
  --bg-grad: radial-gradient(1100px 480px at 85% -12%, rgba(217,119,87,0.07), transparent 62%),
             linear-gradient(180deg, #0d0d10 0%, #0a0a0c 100%);
  --rail-bg: #0f0f12;
  --surface: #161619; --surface-2: #1b1b1f; --surface-offset: #202025;
  --field-bg: #111114;
  --border: rgba(255,255,255,0.07); --border-strong: rgba(255,255,255,0.14);
  --divider: rgba(255,255,255,0.06);
  --text: #f4f4f5; --text-muted: #a1a1aa; --text-faint: #6b6b74; --text-inverse: #ffffff;
  --primary: #d97757; --primary-hover: #e38c6f;
  --accent: #d97757; --accent-soft: rgba(217,119,87,0.14); --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #e08a6c 0%, #cc6a49 100%);
  --coral: #f43f5e; --coral-soft: rgba(244,63,94,0.14); --lavender-soft: rgba(96,165,250,0.13);
  --ink: #232328; --ink-text: #fafafa; --ink-muted: rgba(250,250,250,0.6);
  --info: #7fb0ff; --info-bg: rgba(59,130,246,0.16);
  --success: #34d399; --success-bg: rgba(52,211,153,0.13);
  --error: #fb7185; --error-bg: rgba(244,63,94,0.14);
  --warning: #fbbf24; --warning-bg: rgba(251,191,36,0.13);
  --fam-ag-bg: rgba(52,211,153,0.12); --fam-ag-fg: #34d399;
  --fam-mt-bg: rgba(96,165,250,0.13); --fam-mt-fg: #7fb0ff;
  --fam-of-bg: rgba(251,191,36,0.12); --fam-of-fg: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 10px 28px rgba(0,0,0,0.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.6);
  --shadow-accent: 0 6px 18px rgba(217,119,87,0.32);
  --hover: rgba(255,255,255,0.04); --row-hover: rgba(255,255,255,0.025);
  --chip: rgba(255,255,255,0.06); --track: rgba(255,255,255,0.06); --track-soft: rgba(255,255,255,0.03);
  --closed-bg: #131316; --topbar-bg: rgba(11,11,13,0.72); --scrollbar: #2b2b31;
  --ring-admin: #d4d4d8;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scrollbar-color: var(--scrollbar) transparent; }
body {
  margin: 0; min-height: calc(100dvh / var(--zoom, 1)); font-family: var(--font-body);
  font-size: var(--text-base); line-height: 1.55; color: var(--text);
  background: var(--bg); background-image: var(--bg-grad);
  background-attachment: fixed;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(217,119,87,0.35); }

/* ── shell ───────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: calc(100dvh / var(--zoom, 1)); }

.rail {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-5) var(--space-3) var(--space-4);
  border-right: 1px solid var(--border);
  background: var(--rail-bg);
  position: sticky; top: 0; height: calc(100dvh / var(--zoom, 1)); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); margin-bottom: var(--space-5); }
.brand .mark {
  width: 36px; height: 36px; flex: 0 0 auto; display: block;
  filter: drop-shadow(0 4px 10px rgba(217,119,87,0.28));
}
.brand .mark svg { width: 36px; height: 36px; display: block; }
.brand b { display: block; font-size: var(--text-sm); font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; }
.brand small { display: block; color: var(--text-faint); font-size: var(--text-xs); }

.rail-group { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
  margin: var(--space-5) var(--space-3) var(--space-2); }
.brand + .rail-group { margin-top: 0; }
.rail a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px 10px; border-radius: var(--radius-md);
  color: var(--text-muted); text-decoration: none; font-size: var(--text-sm);
  font-weight: 500; transition: background var(--transition), color var(--transition);
}
.rail a svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-faint);
  transition: color var(--transition); }
.rail a:hover { background: var(--hover); color: var(--text); }
.rail a:hover svg { color: var(--text-muted); }
.rail a[aria-current="page"] { background: var(--surface-offset); color: var(--text);
  font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.rail a[aria-current="page"] svg { color: var(--accent); }
.rail a[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.rail a .later { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); }
.rail-foot { margin-top: auto; padding: var(--space-4) var(--space-2) 0;
  border-top: 1px solid var(--divider); font-size: var(--text-xs); color: var(--text-faint); }
.me { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.me-text { min-width: 0; flex: 1; }
.me-text b { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { display: block; font-size: 11px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-8);
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar .field { flex-direction: row; align-items: center; gap: var(--space-3); }
.topbar .field > label { color: var(--text-faint); font-weight: 600; }
.topbar .field select { padding-block: 7px; }
.page { padding: var(--space-6) var(--space-8) var(--space-10); }
.page-head { display: flex; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-head h1 { font-size: var(--text-2xl); font-weight: 650; letter-spacing: -0.02em; }
.page-head p { margin: var(--space-1) 0 0; color: var(--text-faint); max-width: 68ch; font-size: var(--text-sm); }
.page-head .spacer { flex: 1; }

/* ── controls ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 38px; padding: 0 var(--space-4); border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: var(--text-sm); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-offset); border-color: var(--border-strong); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--text-inverse); border-color: transparent;
  box-shadow: var(--shadow-accent); }
.btn-primary:hover { background: var(--primary-hover); border-color: transparent; }
.btn-accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(217,119,87,0.35); }
.btn-accent:hover { background: rgba(217,119,87,0.22); border-color: rgba(217,119,87,0.5); }
.btn-danger { background: var(--coral-soft); color: var(--error); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-icon { width: 32px; min-height: 32px; padding: 0; border-radius: 9px; flex: 0 0 auto; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--field-bg); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field select option { background: var(--surface); color: var(--text); }
.field input::placeholder { color: var(--text-faint); }
.field input:hover, .field select:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus { border-color: rgba(217,119,87,0.6); outline: none;
  box-shadow: 0 0 0 3px rgba(217,119,87,0.15); }
.field .hint { font-size: var(--text-xs); color: var(--text-faint); }
.field.bad input { border-color: var(--coral); background: var(--coral-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); }
.card-pad { padding: var(--space-5); }

/* ── people table ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table-wrap table, table.people { width: 100%; border-collapse: collapse; min-width: 780px; }
.table-wrap th, table.people th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-wrap td, table.people td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider);
  vertical-align: middle; font-size: var(--text-sm); }
.table-wrap tr:last-child td, table.people tr:last-child td { border-bottom: none; }
.table-wrap tr.off td, table.people tr.off td { opacity: 0.5; }
.table-wrap tbody tr:hover, table.people tbody tr:hover { background: var(--row-hover); }
th.right, td.right { text-align: right; }
.who { display: flex; align-items: center; gap: var(--space-3); }
.who b { font-weight: 600; }
.who small { display: block; color: var(--text-faint); font-size: var(--text-xs); }
.acts { display: flex; gap: 6px; justify-content: flex-end; }

/* faces: a photo when there is one, initials underneath while it loads or
   when there is no signal. The ring says the role. */
.avatar { width: 36px; height: 36px; border-radius: var(--radius-full); flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden; position: relative;
  font-weight: 700; font-size: var(--text-xs); letter-spacing: 0.02em;
  background: var(--surface-offset); color: var(--text-muted);
  box-shadow: 0 0 0 2px var(--surface); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* the silhouette of a person with no picture: head and shoulders in the role's colour */
.avatar .face { width: 100%; height: 100%; display: block; opacity: .85; }
.avatar .face svg { width: 100%; height: 100%; display: block; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.crop { border-radius: 10px; overflow: hidden; }
.avatar.crop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.crop.lg { width: 72px; height: 72px; font-size: 22px; border-radius: 14px; }
.cropdb-name { display: inline-flex; align-items: center; gap: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: var(--text-sm); }
.avatar.r-farm_admin { background: var(--surface-offset); color: var(--text); }
.avatar.r-farm_manager { background: var(--accent-soft); color: var(--accent); }
.avatar.r-farm_assistant { background: var(--success-bg); color: var(--success); }
.avatar.has-photo.r-farm_admin { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ring-admin); }
.avatar.has-photo.r-farm_manager { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
.avatar.has-photo.r-farm_assistant { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--success); }
.avatars { display: flex; align-items: center; }
/* nobody's picture: the silhouette in the person's own colour (0.7.226), whatever the role */
.avatar.no-photo { background: color-mix(in srgb, hsl(var(--ph, 220) var(--ps, 60%) var(--pl, 48%)) 24%, var(--surface));
  color: hsl(var(--ph, 220) var(--ps, 60%) var(--pl, 48%)); }
.avatar.no-photo .face { opacity: 1; }
.avatars .avatar + .avatar { margin-left: -8px; }
.avatars .avatar.more { background: var(--surface-offset); color: var(--text-muted); font-size: 10px; }
.assignees { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.assignees small { color: var(--text-muted); font-size: var(--text-xs);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600;
  background: var(--chip); color: var(--text-muted); white-space: nowrap; }
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.warn { background: var(--warning-bg); color: var(--warning); }
.pill.bad { background: var(--error-bg); color: var(--error); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.trap-check { justify-self: start; align-self: flex-start; max-width: 100%; white-space: normal; cursor: help; }
.tm-hfig.excluded img { opacity: 0.45; }

/* connected / offline, top right (app.js) */
.pill.net { border: 0; font-family: inherit; cursor: pointer; }
.pill.net:disabled { cursor: default; opacity: 1; }
.pill.net svg { width: 14px; height: 14px; flex: none; }
.pill.net.is-online svg { color: var(--success); }
.pill.net.is-connecting svg { color: var(--accent); animation: netPulse 1s ease-in-out infinite alternate; }
/* the fill runs for CONNECT_GAP (api.js, 1500 ms) per attempt */
.net-bar { width: 56px; height: 5px; border-radius: var(--radius-full);
  background: var(--track); overflow: hidden; }
.net-bar i { display: block; width: 0; height: 100%; border-radius: inherit;
  background: var(--accent); transition: width 1500ms linear; }
@keyframes netPulse { from { opacity: 1; } to { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .pill.net.is-connecting svg { animation: none; }
  .net-bar i { transition: none; }
}
.offline-bar {
  padding: var(--space-2) var(--space-8);
  background: var(--warning-bg); color: var(--warning);
  font-size: var(--text-sm); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
/* update: a button, then a progress bar, between Connected and the gear (update.js) */
.upd { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.upd-btn { background: var(--accent); color: #fff; border-color: transparent; gap: 6px; }
.upd-btn:hover { background: var(--primary-hover); }
.upd-btn svg { width: 14px; height: 14px; }
.upd-bar { width: 120px; height: 6px; flex: none; border-radius: var(--radius-full);
  background: var(--chip); overflow: hidden; }
.upd-bar i { display: block; width: 0; height: 100%; border-radius: inherit;
  background: var(--accent); transition: width 280ms ease-out; }
.upd small { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .upd-bar i { transition: none; } }
@media (max-width: 900px) { .upd small { display: none; } .upd-bar { width: 72px; } }
@media (max-width: 600px) {
  .upd-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pill.net span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .offline-bar { padding-inline: var(--space-4); }
}
.chip.fam-Agriculture { background: var(--fam-ag-bg); color: var(--fam-ag-fg); border-color: transparent; }
.chip.fam-Maintenance { background: var(--fam-mt-bg); color: var(--fam-mt-fg); border-color: transparent; }
.chip.fam-Office { background: var(--fam-of-bg); color: var(--fam-of-fg); border-color: transparent; }

/* ── responsibility picker ───────────────────────────────────────────────── */
.resp { display: flex; flex-direction: column; gap: var(--space-4); }
.resp-fam { border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-2); overflow: hidden; }
.resp-fam > header { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.resp-fam > header b { font-size: var(--text-sm); }
.resp-fam > header .count { margin-left: auto; font-size: var(--text-xs); color: var(--text-faint); }
.resp-cats { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--field-bg); font-size: var(--text-xs); font-weight: 600;
  color: var(--text-muted); cursor: pointer; }
.toggle:hover { border-color: var(--border-strong); color: var(--text); }
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); }
.toggle.all[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ── drawer ──────────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
  z-index: 40; animation: fade var(--transition); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 41; display: flex; flex-direction: column;
  animation: slide var(--transition);
}
.drawer > header { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border); }
.drawer > header h2 { font-size: var(--text-lg); font-weight: 650; }
.drawer > header .spacer { flex: 1; }
.drawer .body { flex: 1; overflow-y: auto; padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-5); }
.drawer > footer { display: flex; gap: var(--space-2); justify-content: flex-end;
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border);
  background: var(--surface-2); }
@keyframes fade { from { opacity: 0 } }
@keyframes slide { from { transform: translateX(14px); opacity: 0 } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

.sec-title { font-size: var(--text-sm); font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.note { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: var(--text-sm); }
.note.warn { background: var(--warning-bg); border-color: rgba(251,191,36,0.2); color: var(--warning); }
.note.bad { background: var(--error-bg); border-color: rgba(244,63,94,0.22); color: var(--error); }
.hint { font-size: var(--text-xs); color: var(--text-faint); }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace; font-size: var(--text-xs);
  letter-spacing: 0.02em; color: var(--text-muted); }

/* ── sign in ─────────────────────────────────────────────────────────────── */
.signin { min-height: calc(100dvh / var(--zoom, 1)); display: grid; place-items: center; padding: var(--space-6); }
.signin .card { width: min(400px, 100%); box-shadow: var(--shadow-lg); }
.signin .brand { justify-content: center; }

/* ── misc ────────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: var(--space-10) var(--space-6); color: var(--text-faint); }
.empty h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); color: var(--text); }
.toast { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%);
  z-index: 60; padding: var(--space-3) var(--space-5); border-radius: var(--radius-full);
  background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); font-size: var(--text-sm); font-weight: 600; }
.toast.bad { background: #be123c; color: #fff; }
.toast.ok { background: #047857; color: #fff; }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: sp 700ms linear infinite; }
@keyframes sp { to { transform: rotate(360deg) } }

/* the folded menu: icons only, the page name as the link's tooltip. The
   arrow beside the logo folds it; a narrow window starts folded (app.js). */
.shell { transition: grid-template-columns 220ms cubic-bezier(0.16, 1, 0.3, 1); }
.rail-toggle { margin-left: auto; width: 26px; height: 26px; padding: 0; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-faint);
  transition: color var(--transition), background var(--transition), border-color var(--transition); }
.rail-toggle:hover { color: var(--text); background: var(--surface-offset); border-color: var(--border-strong); }
.rail-toggle svg { width: 15px; height: 15px; stroke-width: 2; transition: transform var(--transition); }

.shell.collapsed { --rail: 68px; }
.shell.collapsed .rail { padding-inline: var(--space-2); align-items: center; scrollbar-width: none; }
.shell.collapsed .brand { flex-direction: column; gap: var(--space-3); padding: 0; margin-bottom: var(--space-4); }
.shell.collapsed .brand > span:not(.mark) { display: none; }
.shell.collapsed .rail-toggle { margin-left: 0; }
.shell.collapsed .rail-toggle svg { transform: rotate(180deg); }
.shell.collapsed .rail .rail-group { width: 24px; height: 1px; margin: var(--space-3) auto;
  background: var(--divider); font-size: 0; overflow: hidden; }
.shell.collapsed .rail a { font-size: 0; gap: 0; justify-content: center;
  width: 44px; height: 40px; padding: 0; flex: 0 0 auto; }
.shell.collapsed .rail-foot { padding-inline: 0; align-self: stretch; }
.shell.collapsed .me { flex-direction: column; gap: var(--space-2); }
.shell.collapsed .me-text, .shell.collapsed .rail-version { display: none; }

@media (max-width: 900px) {
  .page, .topbar { padding-left: var(--space-4); padding-right: var(--space-4); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ── the 2D plot: one tile per growing position ──────────────────────────── */
.plot { display: grid; gap: 6px; padding: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.plot-tile {
  display: flex; flex-direction: column; gap: 1px; align-items: flex-start;
  padding: var(--space-2) var(--space-3); min-height: 74px; text-align: left;
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface-2); color: var(--text);
  font: inherit; cursor: pointer; overflow: hidden;
  transition: transform var(--transition), background var(--transition);
}
.plot-tile:hover { transform: translateY(-1px); background: var(--surface-offset); }
.plot-tile.fam-ag { background: var(--fam-ag-bg); border-left-color: var(--fam-ag-fg); }
.plot-tile.fam-mt { background: var(--fam-mt-bg); border-left-color: var(--fam-mt-fg); }
.plot-tile.fam-of { background: var(--fam-of-bg); border-left-color: var(--fam-of-fg); }
.plot-tile.is-empty { background: transparent; border-style: dashed;
  border-left-style: solid; border-left-color: var(--text-faint); }
/* a proposal is not a fact yet: show it as an outline, not a fill */
.plot-tile.is-proposed { background: var(--surface); border-style: dashed; }
.plot-code { font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.plot-crop { font-size: var(--text-sm); font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.plot-when { font-size: var(--text-xs); color: var(--text-muted); }

/* ── dashboard (§7.1) ─────────────────────────────────────────────────────
   Tiles first, because the page is scanned rather than read: the number is
   the biggest thing in each one, and the tinted icon says whether to act.
   The sentence under the number says it again, so colour is never the only
   signal. */
.row > .spacer { flex: 1; }
.row > .hint, .card-pad > .hint { font-size: var(--text-xs); color: var(--text-faint); }

/* Cape Town Market, week by week (prices.js) */
.mk-intro { padding: 0 var(--space-5) var(--space-3); margin-top: calc(-1 * var(--space-2)); max-width: 95ch; }
.mk-up { color: var(--success); font-variant-numeric: tabular-nums; }
.mk-down { color: var(--error); font-variant-numeric: tabular-nums; }
.mk-spark { display: block; overflow: visible; }
.mk-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mk-spark circle { fill: var(--accent); }

/* the weather tile, two tiles wide at the end of the tiles (weather.js): now and its wind ·
   today and tomorrow · where, when and the links. One wide when the grid has one column. */
.tile.wx-tile { grid-column: span 2; display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px 16px; }
.tile.wx-tile.is-note { display: flex; }
.tile.wx-tile .tile-icon { background: var(--info-bg); color: var(--info); }
.wx-now { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.wx-wind { display: flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.wx-arrow { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: none; color: var(--accent); }
.wx-arrow svg { width: 13px; height: 13px; stroke-width: 2.4; }
.wx-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.wx-day { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-2); font-size: var(--text-xs); color: var(--text-muted);
  font-variant-numeric: tabular-nums; min-width: 0; }
.wx-day-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); }
.wx-day-top svg { width: 18px; height: 18px; color: var(--info); }
.wx-day b { color: var(--text); font-weight: 600; }
.wx-rain { color: var(--info); white-space: nowrap; }
.wx-dw { display: flex; align-items: center; gap: 3px; color: var(--text); white-space: nowrap; }
.wx-dw small { color: var(--text-faint); font-size: 10px; }
.wx-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-3);
  padding-top: 10px; border-top: 1px solid var(--divider); font-size: var(--text-xs); color: var(--text-faint); }
.wx-place { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  font: inherit; font-size: var(--text-xs); font-weight: 600; color: var(--text); cursor: pointer; }
.wx-place:hover span { text-decoration: underline; }
.wx-place svg { width: 12px; height: 12px; color: var(--text-faint); }
.wx-when.is-old { color: var(--warning); }
.wx-links { display: inline-flex; flex-wrap: wrap; gap: 4px var(--space-3); margin-left: auto; }
.wx-links a { display: inline-flex; align-items: center; gap: 3px; font-size: var(--text-xs);
  font-weight: 600; color: var(--accent); text-decoration: none; }
.wx-links a:hover span { text-decoration: underline; }
.wx-links svg { width: 11px; height: 11px; }
.row > .wx-links { margin-left: 0; }
.wx-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
/* the town search, on the tile and on Farm setup */
.wx-picker { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.wx-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.wx-form .field { flex: 1; min-width: 170px; max-width: 360px; }
.wx-results { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.wx-results small { margin-left: 6px; font-weight: 400; color: var(--text-faint); }
@container (max-width: 520px) {
  .tile.wx-tile { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
}

.tiles { container-type: inline-size; display: grid; gap: var(--space-3); margin-bottom: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { display: flex; align-items: flex-start; gap: 14px;
  padding: 18px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface);
  color: var(--text); text-decoration: none; min-width: 0;
  transition: transform var(--transition), border-color var(--transition), background var(--transition); }
.tile.cam-tile { grid-column: span 2; position: relative; padding: 0; overflow: hidden; background: #000;
  min-height: 140px; border-color: var(--border); }
.cam-screen { position: absolute; inset: 0; }
.cam-screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.cam-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; }
.cam-name { flex: 1; color: #fff; font-size: var(--text-xs); font-weight: 600; }
.cam-btn { pointer-events: auto; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.35); color: #fff;
  border-radius: 999px; padding: 2px 10px; font-size: var(--text-xs); text-decoration: none; cursor: pointer; }
.cam-btn[hidden] { display: none; }
@container (max-width: 520px) { .tile.cam-tile { grid-column: auto; aspect-ratio: 32 / 9; min-height: 0; } }
a.tile:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--surface-2); }
a.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); }
.tile-icon svg { width: 20px; height: 20px; }
.tile.ok .tile-icon   { background: var(--success-bg); color: var(--success); }
.tile.warn .tile-icon { background: var(--warning-bg); color: var(--warning); }
.tile.bad .tile-icon  { background: var(--error-bg); color: var(--error); }
.tile.info .tile-icon { background: var(--info-bg); color: var(--info); }
.tile-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tile-value { font-size: var(--text-2xl); font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile.bad .tile-value { color: var(--error); }
.tile-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.tile-sub { font-size: var(--text-xs); color: var(--text-faint); }
.tile-list { list-style: none; margin: var(--space-2) 0 0; padding: var(--space-2) 0 0;
  border-top: 1px solid var(--divider); display: flex; flex-direction: column; gap: 1px; }
.tile-list li { font-size: var(--text-xs); color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-list li.more { color: var(--text-faint); font-style: italic; }
.tile-fams { display: flex; gap: var(--space-3); margin-top: var(--space-2);
  flex-wrap: wrap; }
.fam-dot { display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); color: var(--text-muted);
  font-variant-numeric: tabular-nums; }
.fam-dot i { width: 8px; height: 8px; border-radius: 2px;
  background: var(--text-faint); }
.fam-dot.fam-ag i { background: var(--fam-ag-fg); }
.fam-dot.fam-mt i { background: var(--fam-mt-fg); }
.fam-dot.fam-of i { background: var(--fam-of-fg); }

/* the week: seven columns, each as tall as its own contents */
.week-strip { display: grid; gap: 1px; background: var(--divider);
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--divider);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.day { background: var(--surface); padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.day.closed { background: var(--closed-bg); }
.day.today { box-shadow: inset 0 2px 0 var(--accent);
  background: linear-gradient(180deg, rgba(217,119,87,0.07), transparent 60%), var(--surface); }
.day-head { display: flex; align-items: baseline; gap: var(--space-2); }
.day-name { font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted); }
.day.today .day-name { color: var(--accent); }
.day-count { font-size: var(--text-xs); color: var(--text-faint);
  font-variant-numeric: tabular-nums; margin-left: auto; }
.ev { display: flex; flex-direction: column; padding: var(--space-2);
  border-radius: var(--radius-sm); font-size: var(--text-xs); min-width: 0; }
/* a crop name wraps rather than being cut off: in a seventh of the width
   "Arugula — Rocket" and "Arugula — Astro" would both read as "Arugula…" */
.ev b { font-weight: 600; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; }
.ev span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.ev.harvest { background: var(--fam-ag-bg); color: var(--fam-ag-fg); }
.ev.harvest span { color: var(--fam-ag-fg); opacity: .75; }
.ev.transplant { background: var(--lavender-soft); color: var(--info); }
.ev.transplant span { color: var(--info); opacity: .75; }
.ev.none { color: var(--text-faint); font-style: italic; padding: 0; }
.ev.more { color: var(--text-muted); text-decoration: none; padding: 2px 0;
  font-weight: 600; }
.ev.more:hover { color: var(--text); text-decoration: underline; }

/* how full each bay is */
.bar-list { padding: var(--space-3) var(--space-5) var(--space-5); display: flex;
  flex-direction: column; gap: var(--space-4); }
.bar-row { display: grid; grid-template-columns: 130px 1fr 64px;
  gap: var(--space-4); align-items: center; }
.bar-name { font-size: var(--text-sm); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 8px; border-radius: var(--radius-full);
  background: var(--track); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-grad);
  border-radius: var(--radius-full); }
/* a proposal is not a plant: hatched, not filled */
.bar-proposed { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-full);
  background: repeating-linear-gradient(45deg, var(--text-muted) 0 2px,
              transparent 2px 5px); opacity: .45; }
.bar-num { font-size: var(--text-xs); color: var(--text-muted); text-align: right;
  font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: 90px 1fr 56px; }
}

/* ── the update card ──────────────────────────────────────────────────────
   Bottom right, out of the way of the rail and of anything being read. */
.update-card { position: fixed; right: var(--space-5); bottom: var(--space-5);
  z-index: 60; display: flex; align-items: center; gap: var(--space-3);
  max-width: min(460px, calc(100vw - 2 * var(--space-5)));
  padding: var(--space-3) var(--space-4);
  background: var(--ink); color: var(--ink-text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: fbPop 240ms cubic-bezier(0.16, 1, 0.3, 1); }
.update-mark { color: var(--accent); font-size: 1.1rem; }
.update-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.update-text b { font-size: var(--text-sm); font-weight: 700; }
.update-text span { font-size: var(--text-xs); color: var(--ink-muted); }
.update-card .btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.update-card .btn-primary:hover { background: var(--primary-hover); }
.update-card .btn-ghost { color: var(--ink-muted); }
.update-card .btn-ghost:hover { color: var(--ink-text); background: rgba(255,255,255,0.08); }
.update-done { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 60;
  padding: var(--space-2) var(--space-4); background: var(--ink); color: var(--ink-text);
  border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 600;
  box-shadow: var(--shadow-lg); animation: fbPop 240ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fbPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .update-card, .update-done { animation: none; } }
.rail-version { margin-top: var(--space-3); font-size: 10px; letter-spacing: .06em;
  color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ── the library and register screens ─────────────────────────────────────
   Filters as chips, facts as label/value pairs in a drawer, a checklist as a
   numbered list. Nothing here is a card: they are all one table. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer;
  transition: background var(--transition), color var(--transition); }
span.chip { cursor: default; }
.chip:hover { background: var(--surface-offset); color: var(--text); }
.chip.on { background: var(--primary); color: var(--text-inverse); border-color: transparent; }

.tag { display: inline-block; padding: 2px var(--space-2); border-radius: 6px;
  font-size: 11px; font-weight: 600; background: var(--chip);
  color: var(--text-muted); }
.tag.fam-ag { background: var(--fam-ag-bg); color: var(--fam-ag-fg); }
.tag.fam-mt { background: var(--fam-mt-bg); color: var(--fam-mt-fg); }
.tag.fam-of { background: var(--fam-of-bg); color: var(--fam-of-fg); }
/* sub-families: one hue each (subFamilyTag in ui.js), readable in both themes */
.tag.sub, .chip.sub { background: hsl(var(--h) 70% 50% / 0.16); color: hsl(var(--h) 75% 72%);
  border-color: transparent; }
:root[data-theme="light"] .tag.sub, :root[data-theme="light"] .chip.sub {
  background: hsl(var(--h) 70% 45% / 0.13); color: hsl(var(--h) 65% 30%); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3); margin-bottom: var(--space-5); }
.fact { display: flex; flex-direction: column; gap: 1px; }
.fact-k { font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; }
.fact-v { font-size: var(--text-sm); font-weight: 600; }

.steps { margin: 0 0 var(--space-5); padding-left: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3); }
.steps li b { font-weight: 600; }
.step-meta { font-size: var(--text-xs); color: var(--text-faint); margin-top: 2px; }

/* maintenance: a machine and the routines under it */
.asset-list { display: flex; flex-direction: column; }
.asset { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.asset:last-child { border-bottom: none; }
.asset-head { display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-2); flex-wrap: wrap; }
.asset-head .spacer { flex: 1; }
.rule { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-2) 0 var(--space-2) var(--space-4);
  border-left: 2px solid var(--border); margin-left: var(--space-2);
  font-size: var(--text-sm); }
.rule .spacer { flex: 1; }
.rule.overdue { border-left-color: var(--error); }
.rule.off { opacity: .5; }
.rule-name { font-weight: 600; }

/* small state colours, shared by the tables */
.up { color: var(--success); font-weight: 600; }
.down { color: var(--error); font-weight: 600; }
.now { font-weight: 700; }
.warn-row td { background: var(--warning-bg); }

/* the network table's occupancy bar */
.mini-wrap { display: flex; align-items: center; gap: var(--space-2);
  justify-content: flex-end; font-variant-numeric: tabular-nums; }
.mini-bar { width: 56px; height: 6px; border-radius: var(--radius-full);
  background: var(--track); overflow: hidden; }
.mini-bar > div { height: 100%; background: var(--accent-grad); border-radius: var(--radius-full); }

textarea { width: 100%; font: inherit; padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--field-bg); color: var(--text); resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── the crop calendar (dashboard) ────────────────────────────────────────
   One card, three windows. Harvest green, transplant blue, sowing amber, the
   same three everywhere the card draws them, with a legend at its foot. */
.cal-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-4) var(--space-5); }
.cal-head .spacer { flex: 1; }
.cal-head .hint { margin-top: 2px; }
.cal-controls { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.cal-controls .field select { padding-block: 5px; min-width: 230px; font-size: var(--text-sm); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-full);
  background: var(--field-bg); border: 1px solid var(--border); }
.seg-btn { border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
  font: inherit; font-size: var(--text-xs); font-weight: 600; padding: 5px 13px;
  border-radius: var(--radius-full); transition: background var(--transition), color var(--transition); }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.cal-body { border-top: 1px solid var(--divider); }
.cal-body > .week-strip { border-top: 0; border-radius: 0; }
.cal-loading { padding: var(--space-8); }
.cal-note { margin: var(--space-4); }
.cal-legend { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-3) var(--space-5); border-top: 1px solid var(--divider);
  font-size: var(--text-xs); color: var(--text-faint); }
.cal-legend .spacer { flex: 1; }
.cal-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 2px; }
.cal-legend .harvest i { background: var(--fam-ag-fg); }
.cal-legend .transplant i { background: var(--info); }
.cal-legend .sow i { background: var(--warning); }
.ev.sow { background: var(--warning-bg); color: var(--warning); }
.ev.sow span { color: var(--warning); opacity: .75; }

.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--divider); }
.mg-dow { background: var(--surface); padding: var(--space-2) var(--space-3);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); }
.mg-day { background: var(--surface); border: 0; min-height: 96px; min-width: 0;
  padding: var(--space-2); display: flex; flex-direction: column; align-items: flex-start;
  gap: 3px; text-align: left; color: var(--text); font: inherit; cursor: pointer;
  transition: background var(--transition); }
.mg-day:hover { background: var(--surface-2); }
.mg-day.closed { background: var(--closed-bg); }
.mg-day.closed:hover { background: var(--surface-2); }
.mg-day.out { opacity: .38; }
.mg-day.today { box-shadow: inset 0 2px 0 var(--accent);
  background: linear-gradient(180deg, rgba(217,119,87,0.07), transparent 70%), var(--surface); }
.mg-num { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.mg-day.today .mg-num { color: var(--accent); }
.mc { display: block; max-width: 100%; padding: 1px 6px; border-radius: 5px;
  font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mc.harvest { background: var(--fam-ag-bg); color: var(--fam-ag-fg); }
.mc.transplant { background: var(--info-bg); color: var(--info); }
.mc.sow { background: var(--warning-bg); color: var(--warning); }

.year-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-3); }
.yc-month { display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  padding: var(--space-2) 4px; border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--text); font: inherit; cursor: pointer; min-width: 0;
  transition: background var(--transition); }
.yc-month:hover { background: var(--surface-2); }
.yc-kg { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.yc-track { height: 150px; display: flex; align-items: flex-end; justify-content: center;
  background: var(--track-soft); border-radius: 8px; overflow: hidden; }
.yc-bar { width: 58%; background: linear-gradient(180deg, #6ee7b7 0%, var(--fam-ag-fg) 100%);
  border-radius: 6px 6px 0 0; }
.yc-name { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-align: center; }
.yc-month.now .yc-name { color: var(--accent); }
.yc-month.now .yc-track { box-shadow: inset 0 0 0 1px rgba(217,119,87,0.35); }
.yc-sub { display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-height: 30px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.yc-sub .t { color: var(--info); }
.yc-sub .s { color: var(--warning); }

@media (max-width: 900px) {
  .cal-controls .field select { min-width: 0; }
  .year-chart { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mg-day { min-height: 68px; }
  .mc { font-size: 10px; padding-inline: 4px; }
}

/* ── light: the same console in daylight ──────────────────────────────────
   White cards on a pale grey ground, the orange a shade deeper so it holds up
   on white, and the state colours darkened for contrast. Chosen in Settings;
   index.html sets data-theme before the first paint. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f3f5;
  --bg-grad: radial-gradient(1100px 480px at 85% -12%, rgba(217,119,87,0.06), transparent 62%),
             linear-gradient(180deg, #f6f6f8 0%, #efeff2 100%);
  --rail-bg: #ffffff;
  --surface: #ffffff; --surface-2: #f8f8fa; --surface-offset: #efeff3;
  --field-bg: #f6f6f8;
  --border: rgba(17,17,20,0.09); --border-strong: rgba(17,17,20,0.18);
  --divider: rgba(17,17,20,0.07);
  --text: #16161a; --text-muted: #5b5b66; --text-faint: #8a8a95; --text-inverse: #ffffff;
  --primary: #d97757; --primary-hover: #c4633f;
  --accent: #d97757; --accent-soft: rgba(217,119,87,0.12); --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #e08a6c 0%, #cc6a49 100%);
  --coral: #e11d48; --coral-soft: rgba(225,29,72,0.10); --lavender-soft: rgba(37,99,235,0.10);
  --info: #2563eb; --info-bg: rgba(37,99,235,0.10);
  --success: #047857; --success-bg: rgba(5,150,105,0.11);
  --error: #e11d48; --error-bg: rgba(225,29,72,0.09);
  --warning: #b45309; --warning-bg: rgba(217,119,6,0.13);
  --fam-ag-bg: rgba(5,150,105,0.10); --fam-ag-fg: #047857;
  --fam-mt-bg: rgba(37,99,235,0.10); --fam-mt-fg: #1d4ed8;
  --fam-of-bg: rgba(217,119,6,0.12); --fam-of-fg: #b45309;
  --shadow-sm: 0 1px 2px rgba(17,17,20,0.06);
  --shadow-md: 0 10px 28px rgba(17,17,20,0.08);
  --shadow-lg: 0 24px 60px rgba(17,17,20,0.16);
  --shadow-accent: 0 6px 16px rgba(217,119,87,0.24);
  --hover: rgba(17,17,20,0.045); --row-hover: rgba(17,17,20,0.025);
  --chip: rgba(17,17,20,0.06); --track: rgba(17,17,20,0.07); --track-soft: rgba(17,17,20,0.035);
  --closed-bg: #f7f7f9; --topbar-bg: rgba(243,243,245,0.82); --scrollbar: #cfcfd6;
  --ring-admin: #3f3f46;
}
:root[data-theme="light"] .yc-bar { background: linear-gradient(180deg, #34d399 0%, #059669 100%); }
:root[data-theme="light"] .card, :root[data-theme="light"] .tile { box-shadow: var(--shadow-sm); }

/* ── settings (the gear) ──────────────────────────────────────────────────
   Grouped lists, one setting per row: what it is on the left, its control on
   the right. The Notion syncs are cards, because each has a preview to show. */
.topbar-gear svg { width: 18px; height: 18px; }
.drawer.settings { width: min(600px, 100vw); }
.drawer.settings .body { gap: var(--space-6); }
.set-sec { display: flex; flex-direction: column; gap: var(--space-2); }
.set-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); padding-left: 2px; }
.set-list { display: flex; flex-direction: column; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface-2); overflow: hidden; }
.set-list > :not([hidden]) ~ :not([hidden]) { border-top: 1px solid var(--divider); }
.set-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); }
.set-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 1px; }
.set-text b { font-size: var(--text-sm); font-weight: 600; }
.set-text small { font-size: var(--text-xs); color: var(--text-faint); line-height: 1.45; }
.set-row .field select { min-width: 170px; padding-block: 6px; font-size: var(--text-sm); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.seg-btn svg { width: 14px; height: 14px; }
.switch { position: relative; width: 40px; height: 22px; flex: 0 0 auto; padding: 0;
  border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--track);
  cursor: pointer; transition: background var(--transition); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-muted);
  transition: transform var(--transition), background var(--transition); }
.switch[aria-checked="true"] { background: var(--accent); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: #fff; }
.set-list > .note { margin: var(--space-3) var(--space-4); border: 0; }
.sync-card { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.sync-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.sync-icon { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: grid;
  place-items: center; background: var(--accent-soft); color: var(--accent); }
.sync-icon svg { width: 18px; height: 18px; }
.sync-acts { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.sync-acts .spacer { flex: 1; }
.sync-out { display: flex; flex-direction: column; gap: var(--space-2); }
.sync-sum { font-size: var(--text-sm); color: var(--text); }
.sync-lines { margin: 0; padding: var(--space-2) var(--space-3); list-style: none;
  border-radius: var(--radius-md); background: var(--field-bg); border: 1px solid var(--border);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: 11.5px;
  color: var(--text-muted); display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow: auto; }
.sync-lines li.more { font-style: italic; color: var(--text-faint); }
.pw-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-2);
  align-items: center; padding: var(--space-3) var(--space-4); }
.btn-danger svg { width: 14px; height: 14px; }
@media (max-width: 600px) {
  .pw-form { grid-template-columns: 1fr; }
  .set-row .field select { min-width: 0; }
}

/* People › the picture in the Add/Edit form (0.9.1) */
.avatar.photo-preview { width: 64px; height: 64px; font-size: var(--text-base); margin-right: var(--space-2); }
.photo-steps { margin: var(--space-2) 0 0; padding-left: 1.4em; }
.photo-steps li { margin: 2px 0; }
/* Settings › Version log (0.7.33) */
.rel-row .set-text { gap: 3px; }
.rel-v { display: inline-block; min-width: 3.6em; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.rel-v.current { color: var(--accent); }
.rel-meta { font-size: 11px !important; }
/* version number, top right (0.7.34) */
.top-version { font-size: var(--text-xs); color: var(--text-faint); font-variant-numeric: tabular-nums;
  white-space: nowrap; }
@media (max-width: 600px) { .top-version { display: none; } }

/* Zoom (top bar − 100% +): the whole console is scaled with CSS zoom, remembered
   as fbc_zoom and applied before the first paint. Full-height areas divide by it
   so they still fit the window. */
html { zoom: var(--zoom, 1); }
.zoom { display: inline-flex; align-items: center; border: 1px solid var(--border);
  border-radius: var(--radius-full); overflow: hidden; }
.zoom button { background: none; border: 0; color: var(--text-muted); cursor: pointer;
  font: inherit; font-size: var(--text-sm); padding: 3px 9px; line-height: 1.2; }
.zoom button:hover:not(:disabled) { background: var(--surface-offset); color: var(--text); }
.zoom button:disabled { opacity: 0.35; cursor: default; }
.zoom .zoom-level { min-width: 46px; font-variant-numeric: tabular-nums; font-size: var(--text-xs);
  border-inline: 1px solid var(--border); }
@media (max-width: 600px) { .zoom .zoom-level { display: none; } }

.phase-links { margin: 0 0 var(--space-3) 28px; display: flex; flex-direction: column; gap: 4px; }
.phase-link { flex-wrap: nowrap; font-size: var(--text-xs); }
.phase-link-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-link.add select { font-size: var(--text-xs); padding-block: 4px; max-width: 320px; }
.hint.warn, span.warn { color: var(--warning, #e0a020); }

/* Crop database: families, rows that open to the cycle (0.7.58) */
.cropdb { display: flex; flex-direction: column; gap: 6px; }
.cropdb-fam { display: flex; align-items: center; gap: 8px; margin: var(--space-4) 0 var(--space-1); font-size: var(--text-sm); }
.cropdb-fam i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cropdb-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); }
.cropdb-row > summary { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); cursor: pointer; list-style: none; }
.cropdb-row > summary::-webkit-details-marker { display: none; }
.cropdb-row > summary > span:first-child { flex: 1; min-width: 0; }
.cropdb-right { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); white-space: nowrap; }
.cropdb-row[open] > summary { border-bottom: 1px solid var(--divider); }
.cropdb-body { padding: var(--space-3) var(--space-4) var(--space-4); }
.cropdb-tools { margin-bottom: var(--space-3); }
.cropdb-phase { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-4); padding: var(--space-2) 0; border-top: 1px dashed var(--divider); font-size: var(--text-sm); }
.cropdb-procs { display: flex; flex-direction: column; gap: 4px; }
.cropdb-proc a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--text-faint); }
.cropdb-proc a:hover { color: var(--accent); }
.cropdb-proc-edit { flex-wrap: nowrap; font-size: var(--text-xs); }
.cropdb-proc-edit select { flex: 1; min-width: 0; font-size: var(--text-xs); padding-block: 4px; }
.cropdb-positions { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.cropdb-pos { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); cursor: pointer; }
@media (max-width: 700px) { .cropdb-phase { grid-template-columns: 1fr; } .cropdb-right .pill { display: none; } }

/* Weekly plan: the positions under a grouped task (0.7.59) */
.week-positions { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* Crop database: counts, Crops | Procedures, the review-page look (0.7.60) */
.cropdb-kpi { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-faint); font-size: var(--text-sm); margin: 0 0 var(--space-3); }
.cropdb-kpi b { color: var(--text); }
.cropdb-tabs { margin-bottom: var(--space-2); }
.cropdb-fam b { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.cropdb-fam i { border-radius: 3px; }
.cropdb-proc a { color: var(--success, #4fc39b); border-bottom: 0; font-weight: 500; }
.cropdb-proc a:hover { text-decoration: underline; color: var(--success, #4fc39b); }
.cropdb-proc .mono { font-size: 12px; }
.cropdb-step { padding: 8px 0; border-top: 1px dashed var(--divider); font-size: var(--text-sm); }
.cropdb-step:first-child { border-top: 0; }
.cropdb-step-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.cropdb-step-type { font-family: var(--font-mono, monospace); font-size: 11px; background: var(--surface-offset); padding: 1px 6px; border-radius: 4px; margin-left: 6px; color: var(--text-muted); }

.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--success, #4fc39b); font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.cropdb-proc .linkish { color: var(--success, #4fc39b); }

/* IPM — sticky traps (0.7.64) */
.ipm-tiles { margin-bottom: var(--space-4); }
.tile.is-bad .tile-value { color: var(--danger, #ff6b6b); }
.tile.is-warn .tile-value { color: var(--warning, #e0a020); }
.ipm-code { display: inline-block; font-family: var(--font-mono, monospace); font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: #f4d24a; color: #2b2400; }
.ipm-code.blue { background: #3b82f6; color: #fff; }
.ipm-over { color: var(--danger, #ff6b6b); }
.ipm-watch { color: var(--warning, #e0a020); }
.ipm-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
.ipm-photo { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-lg, 12px); background: #000; margin-bottom: var(--space-3); }
.ipm-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.ipm-spark circle { fill: var(--accent); }
.ipm-rule { stroke: var(--danger, #ff6b6b); stroke-width: 1; stroke-dasharray: 2 3; }
.ipm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); }
.ipm-fig { margin: 0; cursor: zoom-in; }
.ipm-fig img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.ipm-fig figcaption { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }

/* IPM: the AI's species list (0.7.65) */
.ipm-bar-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.ipm-bar { height: 8px; border-radius: 4px; background: var(--accent, #d97757); opacity: .85; }
.ipm-bar.good { background: var(--success, #3dbf7a); }
.ipm-ai-notes { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--text); }
.ipm-narrow table { min-width: 0; }

/* Tasks — the board (0.7.67) */
/* the people column (0.7.81): always on the left of the board */
.tk-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.tk-people { position: sticky; top: var(--space-3); display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-lg); padding: var(--space-3); }
.tk-people-head { display: flex; flex-direction: column; gap: 6px; }
.tk-people-sub { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-top: 4px; }
.tk-guide { font-size: var(--text-sm); color: var(--accent); }
.tk-person { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; }
.tk-person:hover { background: var(--surface-2, rgba(255,255,255,.04)); }
.tk-person.pickable { border-color: var(--divider); }
.tk-person.chosen { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tk-person-txt { min-width: 0; flex: 1; }
.tk-person-name { font-weight: 600; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-person-hours { font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tk-person-hours.over { color: var(--danger, #e5484d); font-weight: 700; }
.tk-person-hours.off { color: var(--text-faint); }
.tk-person-bar { height: 4px; border-radius: 2px; background: var(--divider); margin-top: 4px; overflow: hidden; }
.tk-person-fill { height: 100%; background: var(--accent); }
.tk-person-fill.over { background: var(--danger, #e5484d); }
.tk.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.tk.mine { outline: 2px solid var(--accent); outline-offset: 1px; }
.tk.other { opacity: .38; }
.tk.other:hover { opacity: .8; }
.tk.dragging { opacity: .4; }
.tk-band.over, .tk-mc.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.tk[draggable="true"] { cursor: grab; }
/* drag and drop between the people and the board (0.7.225) */
.tk-person[draggable="true"] { cursor: grab; }
.tk-person.dragging { opacity: .4; }
.tk-person.over, .tk-person-none.over { border-color: var(--accent); border-style: dashed; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tk-person.drop-before { box-shadow: 0 -2px 0 0 var(--accent); }
.tk-person.drop-after { box-shadow: 0 2px 0 0 var(--accent); }
.tk-person-none { border: 1px dashed var(--divider); color: var(--text-muted); cursor: default; margin-top: 2px; }
.tk-person-none .tk-nobody { flex: none; }
.tk.tk-take, .tk.tk-take:hover, tr.tk-take { outline: 2px dashed var(--accent); outline-offset: 1px; }
@media (max-width: 1100px) { .tk-layout { grid-template-columns: 1fr; } .tk-people { position: static; } }

.tk-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.tk-search { flex: 1 1 240px; min-width: 180px; }
.tk-filter { max-width: 170px; }
.tk-filter.on { border-color: var(--accent); color: var(--accent); }
.tk-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.tk-label { font-weight: 700; min-width: 170px; text-align: center; }
.tk-cal { display: grid; grid-template-columns: repeat(7, minmax(168px, 1fr)); gap: 1px; background: var(--divider);
  border: 1px solid var(--divider); border-radius: var(--radius-lg); overflow: auto; }
.tk-col { background: var(--surface); min-width: 0; padding: var(--space-2); display: flex; flex-direction: column; gap: 6px; min-height: 260px; }
.tk-col.today { box-shadow: inset 0 2px 0 var(--accent); }
.tk-col-head { font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted);
  padding: 2px 4px 6px; display: flex; justify-content: space-between; }
.tk-col.today .tk-col-head { color: var(--accent); }
.tk-count { color: var(--text-faint); }
/* the time worked (0.7.163): on a task's right, and a day's line in its head */
.tk-time { flex: none; font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-text .tk-time { display: block; font-size: 10px; line-height: 1.3; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.tk-time.ok { color: var(--success, #2e7d32); }
.tk-time.over, .tk-time.late { color: var(--danger, #e5484d); }
.tk-time.run { color: var(--accent); }
.tk-worked { display: block; width: 100%; font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.tk-none { color: var(--text-faint); font-size: var(--text-xs); padding: 4px; }
.tk { display: flex; align-items: center; gap: 6px; padding: 5px 4px 5px 8px; border-radius: 8px; cursor: pointer; min-width: 0;
  background: hsl(var(--h) 70% 50% / 0.16); color: var(--text); border-left: 3px solid hsl(var(--h) 65% 55%); font-size: var(--text-sm); }
:root[data-theme="light"] .tk { background: hsl(var(--h) 70% 45% / 0.14); }
.tk:hover, .tk:focus-visible { background: hsl(var(--h) 70% 50% / 0.28); outline: none; }
.tk.done { opacity: .55; }
.tk.done .tk-title { text-decoration: line-through; }
.tk-ic { display: inline-flex; color: hsl(var(--h) 75% 65%); flex: none; }
.tk-ic svg { width: 14px; height: 14px; }
:root[data-theme="light"] .tk-ic { color: hsl(var(--h) 65% 35%); }
.tk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; line-height: 1.25; word-break: break-word; }
.tk-sub { font-size: var(--text-xs); color: var(--text-muted); }
/* the daily scouting folded into one card (0.7.180): its zones under the title, its window's zone rows */
.tk-hub { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-hub-list { display: grid; gap: 4px; }
.tk-hub-row { display: grid; grid-template-columns: auto minmax(70px, auto) minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; text-align: left; width: 100%;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.tk-hub-row:hover { border-color: var(--accent); }
.tk-hub-row .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-prio { font-size: 10px; flex: none; color: var(--text-muted); }
.tk-prio.high, .tk-prio.critical { color: var(--error); }
.tk-who { display: flex; align-items: center; flex: none; }
.tk-who .avatar.sm { width: 20px; height: 20px; font-size: 8px; }
/* who, on the chip's left (0.7.181): the face, the status on it, the dashed ? for nobody */
.tk-lead { position: relative; flex: none; width: 22px; height: 22px; display: inline-grid; place-items: center; }
.tk-lead .avatar.sm { width: 22px; height: 22px; font-size: 8px; }
.tk-lead .tk-nobody { width: 20px; height: 20px; }
.tk-lead .tk-lead-badge { position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; font-size: 7px; border-width: 1.5px; box-shadow: 0 0 0 1.5px var(--surface); }
.tk-lead-more, .tk-lead-q { position: absolute; top: -5px; font-size: 8px; font-weight: 800; line-height: 1.35; padding: 0 2px; border-radius: 6px;
  background: var(--surface); color: var(--text-muted); box-shadow: 0 0 0 1px var(--divider); }
.tk-lead-more { right: -7px; }
.tk-lead-q { left: -6px; color: var(--warn, #d9a500); }
.tk-who .avatar + .avatar { margin-left: -6px; }
.tk-nobody { width: 20px; height: 20px; border-radius: 50%; border: 1px dashed var(--text-faint); color: var(--text-faint); font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center; }
.tk-done { color: var(--success); font-weight: 700; font-size: 12px; }
.tk-more { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0 3px; font-size: 15px; line-height: 1; flex: none; opacity: 0; width: 0; padding: 0; overflow: hidden; }
.tk:hover .tk-more, .tk:focus-within .tk-more, .tk.big .tk-more { opacity: 1; width: auto; padding: 0 3px; }
.tk-more:hover { color: var(--text); }
.tk.big { padding: 8px 6px 8px 10px; }
.tk.big .tk-title { -webkit-line-clamp: 3; }
.tk-day { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
/* morning · afternoon · anytime (0079): bands across the week, one line between AM and PM */
.tk-cal.tk-bands { grid-template-rows: auto minmax(160px, auto) minmax(160px, auto); }
.tk-cal.tk-bands .tk-cell { background: var(--surface); }
.tk-band { background: var(--surface); min-width: 0; padding: var(--space-2); display: flex; flex-direction: column; gap: 6px; }
.tk-band.today { box-shadow: inset 2px 0 0 var(--accent); }
.tk-band.pm { border-top: 2px solid var(--accent); }
.tk-band.any { border-top: 1px dashed var(--text-faint); }
.tk-band-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.tk-band.pm .tk-band-label { color: var(--accent); }
.tk-day .tk-band { padding: var(--space-2) 0; }
.tk-day .tk-band.pm { border-top: 2px solid var(--accent); margin-top: var(--space-2); }
.tk-month { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 1px; background: var(--divider);
  border: 1px solid var(--divider); border-radius: var(--radius-lg); overflow: auto; }
.tk-mh { background: var(--surface-offset); padding: 6px; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 600; }
.tk-mc { background: var(--surface); min-height: 100px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-mc.out { opacity: .45; }
.tk-mc.today { box-shadow: inset 0 2px 0 var(--accent); }
.tk-mc .tk { padding: 2px 4px 2px 6px; font-size: 11px; gap: 4px; }
.tk-mc .tk-who, .tk-mc .tk-more, .tk-mc .tk-prio { display: none; }
.tk-mc .tk-lead, .tk-mc .tk-lead .avatar.sm, .tk-mc .tk-lead .tk-nobody { width: 16px; height: 16px; font-size: 7px; }
.tk-mn { font-size: var(--text-xs); color: var(--text-muted); padding: 0 2px; border: 0; background: transparent; cursor: pointer; text-align: left; font-family: inherit; }
.tk-mc.today .tk-mn { color: var(--accent); font-weight: 700; }
.tk-morelink { font-size: 11px; color: var(--accent); background: transparent; border: 0; cursor: pointer; text-align: left; padding: 0 4px; font-family: inherit; }
tr.off { opacity: .6; }

/* the sections' tabs, under the top bar (0.7.70) */
.sec-tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-4) var(--space-8) 0; }
.sec-tabs[hidden] { display: none; }
.sec-tabs a { padding: 7px 14px; border-radius: var(--radius-full); color: var(--text-muted); text-decoration: none;
  font-size: var(--text-sm); font-weight: 600; border: 1px solid transparent; }
.sec-tabs a:hover { color: var(--text); background: var(--hover); }
.sec-tabs a[aria-current="page"] { background: var(--surface-offset); color: var(--text); border-color: var(--border); }
.sec-tabs + .page { padding-top: var(--space-4); }
@media (max-width: 900px) { .sec-tabs { padding-left: var(--space-4); padding-right: var(--space-4); } }

/* a holiday on the Tasks board (0094): its name under the date, the day hatched */
.tk-hol { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--warning); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-band.holiday, .tk-mc.holiday {
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, var(--warning-bg) 7px 9px); }

/* ── Pest & diseases: the day by zone (0096) ─────────────────────────────── */
.sc-zone { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-3); }
.sc-zone > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); }
.sc-zone > summary::-webkit-details-marker { display: none; }
.sc-zone > summary::before { content: '›'; color: var(--text-muted); font-weight: 700; transition: transform var(--transition); width: 10px; }
.sc-zone[open] > summary::before { transform: rotate(90deg); }
.sc-zone-title { display: flex; align-items: center; gap: var(--space-2); }
.sc-crops { display: inline-flex; align-items: center; }
.sc-crops .avatar + .avatar { margin-left: -8px; }
.sc-zone-facts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.sc-body { padding: 0 var(--space-4) var(--space-4); border-top: 1px solid var(--border); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-3); padding-top: var(--space-3); }
.sc-fig { margin: 0; cursor: zoom-in; }
.sc-fig img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: #000; }
.sc-fig figcaption { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; display: grid; gap: 3px; }
.sc-fig figcaption b { color: var(--text); }
.sc-answers { margin-top: var(--space-3); display: grid; gap: 4px; }
.sc-answer { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); }
.vw-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.vw-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-offset); color: var(--text); border: 1px solid var(--border); }
.vw-tag.pest { background: rgba(251,191,36,0.14); color: var(--warning); }
.vw-tag.disease { background: var(--error-bg); color: var(--error); }
.vw-tag.disorder { background: var(--info-bg); color: var(--info); }
.vw-tag.beneficial { background: var(--success-bg); color: var(--success); }
.vw-tag.ai { border-style: dashed; }
.vw-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 0 0 2px; }

/* ── the photo viewer (0096) ─────────────────────────────────────────────── */
.viewer { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 1fr 360px; background: #000; color: var(--text); }
.vw-stage { display: grid; grid-template-columns: 1fr; min-width: 0; min-height: 0; }
.viewer.cmp .vw-stage { grid-template-columns: 1fr 1fr; }
.vw-pane { position: relative; overflow: hidden; touch-action: none; cursor: grab; border-right: 1px solid #222; }
.vw-pane:active { cursor: grabbing; }
.vw-pane img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.vw-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: var(--text-xs); color: #eee;
  background: linear-gradient(transparent, rgba(0,0,0,0.7)); pointer-events: none; }
.vw-state { color: #aaa; }
.vw-panel { background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-4); }
.vw-head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: var(--space-2); }
.vw-head h2 { font-size: var(--text-lg); font-weight: 650; grid-column: 1; }
.vw-head .hint { grid-column: 1; }
.vw-head .btn { grid-column: 2; grid-row: 1 / span 2; }
.vw-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vw-zoom { min-width: 48px; text-align: center; font-family: var(--font-mono, monospace); font-size: var(--text-xs); color: var(--text-muted); }
.vw-ai-line { font-size: var(--text-sm); padding: 4px 0; border-bottom: 1px solid var(--border); }
.vw-ai-notes { font-size: var(--text-sm); color: var(--text-muted); margin: 6px 0 0; }
/* 0195: the chat about the photo, in the viewer's panel */
.vw-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.vw-msg { flex: none; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border); font-size: var(--text-sm); }
.vw-msg.user { align-self: flex-end; max-width: 92%; background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: transparent; }
.vw-msg.assistant { align-self: stretch; }
.vw-msg-who { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 2px; }
.vw-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.vw-card { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px dashed var(--accent); display: grid; gap: 4px; }
.vw-card.done { border-style: solid; border-color: var(--success, var(--border)); }
.vw-card.dismissed { border-color: var(--border); opacity: .7; }
.vw-card .row { gap: 6px; margin-top: 2px; }
.vw-ask-row { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; }
.vw-ask { flex: 1; min-width: 0; resize: vertical; font: inherit; font-size: var(--text-sm); padding: 6px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: inherit; }
.vw-cmp { margin-top: var(--space-2); display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; }
.vw-cmp-day { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }
.vw-cmp-row { display: flex; align-items: center; gap: var(--space-2); background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; color: var(--text); cursor: pointer; text-align: left; font: inherit; font-size: var(--text-sm); }
.vw-cmp-row:hover { border-color: var(--border-strong); }
.vw-cmp-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; }
  .vw-panel { border-left: 0; border-top: 1px solid var(--border); }
}

/* ── Pest & diseases: cases (0097) ─────────────────────────────────────────── */
.drawer.case-drawer { width: min(980px, 100vw); }
.case-chart-wrap { overflow-x: auto; }
.case-chart { width: 100%; min-width: 620px; height: auto; display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.case-chart .cc-grid { stroke: var(--border); stroke-width: 1; }
.case-chart .cc-axis { stroke: var(--border-strong); stroke-width: 1; }
.case-chart .cc-label { font-size: 10px; fill: var(--text-muted); }
.case-chart .cc-sev { fill: none; stroke: var(--error); stroke-width: 2; }
.case-chart .cc-sev-dot { fill: var(--error); stroke: var(--surface); stroke-width: 1.5; }
.case-chart .cc-trap { fill: none; stroke-width: 1.6; }
.case-chart circle.cc-trap { stroke: none; }
.case-chart .cc-trap.t0 { stroke: var(--warning); fill: var(--warning); }
.case-chart polyline.cc-trap.t0, .case-chart polyline.cc-trap.t1, .case-chart polyline.cc-trap.t2, .case-chart polyline.cc-trap.t3 { fill: none; }
.case-chart .cc-trap.t1 { stroke: var(--info); fill: var(--info); }
.case-chart .cc-trap.t2 { stroke: var(--success); fill: var(--success); }
.case-chart .cc-trap.t3 { stroke: var(--accent); fill: var(--accent); }
.case-chart text.cc-trap { stroke: none !important; font-weight: 600; }
.case-chart .cc-reset { font-size: 11px; fill: var(--text-muted); }
.case-chart .cc-app { stroke: var(--success); stroke-width: 1.5; stroke-dasharray: 4 3; }
.case-chart .cc-app.done { stroke-dasharray: none; }
.case-chart .cc-withhold { fill: var(--warning-bg); }
.case-chart .cc-open { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.case-chart .cc-today { stroke: var(--accent); stroke-width: 1; }
.case-prog { display: grid; gap: 4px; }
.vw-case { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--border); }
.vw-case .linkish { flex: 1; text-align: left; }
.sc-zone-facts .pill { cursor: default; }
.sc-zone-facts button.pill { cursor: pointer; border: 0; font: inherit; }

/* ── Pest & diseases: the overview (0098) ──────────────────────────────────── */
.pd-chart { width: 100%; min-width: 560px; height: auto; display: block; }
.pd-chart .pd-bar { fill: var(--info); opacity: .75; }
.pd-chart .pd-bar.now { fill: var(--accent); opacity: 1; }
.pd-zones { display: grid; gap: 2px; padding: 0 var(--space-4) var(--space-4); }
.pd-zone { display: grid; grid-template-columns: 120px 110px 170px 1fr; gap: var(--space-3); align-items: baseline; font-size: var(--text-sm);
  padding: 4px 0; border-top: 1px solid var(--border); }
.pd-rate { font-family: var(--font-mono, monospace); }
.pd-change.up { color: var(--error); } .pd-change.down { color: var(--success); }
.pd-cat { display: flex; align-items: baseline; gap: var(--space-3); margin: var(--space-6) 0 var(--space-3); }
.pd-cat h3 { font-size: var(--text-lg); font-weight: 650; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.pd-crop { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4);
  display: grid; gap: var(--space-3); cursor: pointer; align-content: start; }
.pd-crop:hover { border-color: var(--border-strong); }
.pd-crop.warn { border-left: 4px solid var(--warning); }
.pd-crop.bad { border-left: 4px solid var(--error); }
.pd-crop-head { display: flex; gap: var(--space-3); align-items: center; }
.pd-crop-head .avatar.lg { width: 56px; height: 56px; }
.pd-wait { font-size: var(--text-sm); font-weight: 600; color: var(--warning); }
.pd-last { display: flex; gap: var(--space-2); align-items: center; cursor: zoom-in; }
.pd-last img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
button.vw-tag { cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
.pd-case-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; text-align: left; width: 100%;
  background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; color: var(--text); cursor: pointer; font: inherit; }
.pd-case-row:hover { border-color: var(--border-strong); }
.tk-hold { font-size: 12px; margin-left: 2px; flex: none; }
@media (max-width: 700px) { .pd-zone { grid-template-columns: 1fr 1fr; } }

/* ── Pest & diseases: one page (0.7.101) ──────────────────────────────────── */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.none { display: none; }
.dot.red { background: var(--error); box-shadow: 0 0 0 2px var(--error-bg); }
.dot.orange { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-bg); }
.dot.green { background: var(--success); box-shadow: 0 0 0 2px var(--success-bg); }
.rail a { position: relative; }
.rail-dot { position: absolute; top: 8px; left: 26px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); }
.rail-dot.red { background: var(--error); } .rail-dot.orange { background: var(--warning); } .rail-dot.green { background: var(--success); }
.pd-dash { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3) var(--space-4); align-items: center; margin-bottom: var(--space-3); }
.pd-tiles { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pd-tile { display: flex; flex-direction: column; min-width: 104px; padding: 8px 12px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); }
.pd-tile b { font-size: var(--text-xl); line-height: 1.1; }
.pd-tile span { font-size: var(--text-xs); color: var(--text-muted); }
.pd-tile.bad b { color: var(--error); } .pd-tile.warn b { color: var(--warning); }
/* 0194: a tile that opens a list, and the list of photos where the AI found something */
.pd-tile-btn { cursor: pointer; }
.pd-tile-btn:hover, .pd-tile-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pd-found { display: flex; align-items: center; gap: var(--space-2); padding: 8px 0; border-bottom: 1px solid var(--border); }
.pd-found img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex: none; background: var(--border); }
.pd-found-text { flex: 1; min-width: 0; }
.pd-found-sum { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.pd-pressure { display: grid; grid-template-columns: auto auto; gap: 0 8px; align-items: baseline; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.pd-pressure b { font-size: var(--text-lg); }
.pd-pressure .pd-spark { grid-column: 1 / -1; width: 220px; height: 40px; }
.pd-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.pd-spark circle { fill: var(--accent); }
.pd-wait-note { grid-column: 1 / -1; }
.pd-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--space-3); }
.pd-strip-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-right: 4px; }
.pd-case { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.pd-case:hover { border-color: var(--border-strong); }
.pd-case.closed { opacity: .7; }
.pd-case.small { padding: 2px 8px; font-size: var(--text-xs); }
.pd-crops { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-4); }
.pd-cropchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.pd-cropchip:first-child { padding-left: 10px; }
.pd-cropchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.pd-days { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.pd-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.pd-day > summary, .pd-zone-band > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pd-day > summary::-webkit-details-marker, .pd-zone-band > summary::-webkit-details-marker { display: none; }
.pd-day > summary { padding: var(--space-3) var(--space-4); }
.pd-day > summary::before, .pd-zone-band > summary::before { content: '›'; color: var(--text-muted); font-weight: 700; width: 10px; transition: transform var(--transition); }
.pd-day[open] > summary::before, .pd-zone-band[open] > summary::before { transform: rotate(90deg); }
.pd-day-facts { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.pd-day-body { padding: 0 var(--space-3) var(--space-3); display: grid; gap: var(--space-2); }
.pd-zone-band { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.pd-zone-band > summary { padding: var(--space-2) var(--space-3); }
.pd-zone-title { display: inline-flex; align-items: center; gap: var(--space-2); }
.pd-zone-body { padding: 0 var(--space-3) var(--space-3); display: grid; gap: var(--space-3); }
.pd-traps { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-2); }
.pd-trap { display: grid; gap: 4px; padding: 6px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; text-align: left; cursor: zoom-in; }
.pd-trap.red { border-color: var(--error); } .pd-trap.orange { border-color: var(--warning); }
.pd-trap img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.pd-trap-head { display: flex; align-items: center; gap: 6px; }
.pd-trap-head b { margin-left: auto; font-size: var(--text-lg); }
.pd-tcurve { width: 100%; height: 30px; }
.pd-tcurve polyline { fill: none; stroke: var(--info); stroke-width: 1.6; }
.sc-fig.red img { outline: 2px solid var(--error); } .sc-fig.orange img { outline: 2px solid var(--warning); } .sc-fig.green img { outline: 2px solid var(--success); }
.pd-fig-title { display: flex; align-items: center; gap: 6px; }
.sc-fig figcaption .pd-fig-title b { color: var(--text-muted); font-weight: 600; }
.sc-fig figcaption .pd-fig-title.extra b { color: var(--accent); }
.pd-people { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--text-xs); }
.pd-who { color: var(--text-muted); white-space: nowrap; }
.pd-who.extra { color: var(--accent); font-weight: 600; }
@media (max-width: 900px) { .pd-dash { grid-template-columns: 1fr; } }

/* ── the status of a task at a glance (0.7.103) ─────────────────────────────── */
.tk-state { flex: none; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 900; line-height: 1; border: 2px solid var(--text-faint); color: transparent; }
.tk-state.done { background: var(--success); border-color: var(--success); color: #fff; }
.tk-state.skipped { background: var(--error); border-color: var(--error); color: #fff; }
.tk.skipped .tk-title { text-decoration: line-through; text-decoration-color: var(--error); }
.tk-list-time { display: inline-flex; align-items: center; gap: 6px; }

/* ── seedlings from an external nursery on the calendar (0.7.104) ─────────── */
.cal-legend .seedlings i { background: var(--info, #3b82f6); }
.ev.seedlings { background: var(--info-bg, rgba(59,130,246,.14)); color: var(--info, #3b82f6); }
.ev.seedlings span { color: var(--info, #3b82f6); opacity: .75; }

/* ── reading: the words and a bar that moves (0.7.105) ──────────────────────── */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--space-10, 48px) var(--space-4); color: var(--text-muted); font-size: var(--text-sm); text-align: center; }
.loading-bar { position: relative; width: min(260px, 70%); height: 6px; border-radius: var(--radius-full);
  background: var(--chip); overflow: hidden; }
.loading-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent);
  transition: width 300ms ease-out; }
.loading-bar.busy i, .upd-bar.busy i { position: absolute; left: 0; top: 0; width: 35%;
  animation: fbc-reading 1.1s ease-in-out infinite; transition: none; }
.upd-bar { position: relative; }
.upd-bar.busy { background: color-mix(in srgb, var(--accent) 35%, var(--chip)); }
@keyframes fbc-reading { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) {
  .loading-bar.busy i, .upd-bar.busy i { animation: none; width: 100%; opacity: .45; }
}

/* ── a task picked for "Assign manually" shows at once (0.7.110) ──────────────
   .tk:hover sets outline: none further up, and wins over .tk.picked at the same
   specificity — the pick only appeared once the pointer left the chip. */
.tk.picked, .tk.picked:hover, .tk.picked:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
  background: color-mix(in srgb, var(--accent) 24%, hsl(var(--h) 70% 50% / 0.16));
}
.tk.mine:hover, .tk.mine:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* a name coming off a task in Assign manually (0.7.111) */
.tk.dropping, .tk.dropping:hover, .tk.dropping:focus-visible {
  outline: 2px dashed var(--danger, #e5484d); outline-offset: 1px;
  background: color-mix(in srgb, var(--danger, #e5484d) 14%, hsl(var(--h) 70% 50% / 0.10));
}
.tk.dropping .avatar { opacity: .35; filter: grayscale(1); }

/* ── plain inputs styled like the form fields (0.7.112: class "input" was never defined) ── */
.input, input.input, select.input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--field-bg); color: var(--text); font: inherit;
}
.input:focus { border-color: rgba(217,119,87,0.6); outline: none; box-shadow: 0 0 0 3px rgba(217,119,87,0.15); }
.input:disabled { opacity: .6; }
/* a crop past its harvest end, still in the position */
.plot-tile.is-over { outline: 2px dashed var(--warning); outline-offset: -2px; }
.plot-tile.is-over .plot-when { color: var(--warning); font-weight: 600; }

/* ── the crop planner timeline (0.7.113) ───────────────────────────────────── */
.tl-head { align-items: flex-start; }
.tl-nav { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-3); }
.tl-range { margin-left: var(--space-2); }
.tl-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); min-height: 32px; }
.tl-palette { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3);
  padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.tl-palette > input { width: 190px; flex: none; }
.tl-crops { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tl-crop { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 10px 3px 3px; border-radius: var(--radius-full);
  background: var(--chip); font-size: var(--text-xs); cursor: grab; user-select: none; white-space: nowrap; }
.tl-crop:active { cursor: grabbing; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; flex: none; }
.tl-board { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.tl-inner { position: relative; min-width: 100%; }
.tl-scale, .tl-zone, .tl-row { display: flex; }
.tl-label { position: sticky; left: 0; z-index: 3; flex: none; width: 176px; padding: 0 10px; display: flex; align-items: center; gap: 4px;
  background: var(--surface); border-right: 1px solid var(--border); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; }
.tl-scale { height: 34px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 4; background: var(--surface); }
.tl-scale-label { color: var(--text-muted); }
.tl-track { position: relative; flex: 1; min-height: 32px; }
.tl-scale-track { overflow: hidden; }
.tl-month { position: absolute; top: 2px; font-size: 11px; font-weight: 700; color: var(--text); padding-left: 3px; border-left: 1px solid var(--border-strong); white-space: nowrap; }
.tl-tick { position: absolute; bottom: 2px; font-size: 9px; color: var(--text-faint); padding-left: 2px; border-left: 1px solid var(--divider); }
.tl-tick.mon { border-left-color: var(--border); }
.tl-closed { position: absolute; top: 18px; bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 3px, var(--divider) 3px 4px); opacity: .7; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); opacity: .7; z-index: 2; pointer-events: none; }
.tl-zone { height: 34px; background: var(--surface-offset, var(--chip)); border-top: 1px solid var(--border); }
.tl-zone .tl-label { background: var(--surface-offset, var(--chip)); font-size: var(--text-sm); }
/* the zone's controls stay beside its name while the board scrolls sideways */
.tl-zone-track { flex: none; display: flex; align-items: center; gap: var(--space-2); position: sticky; left: 176px; padding-left: var(--space-2); z-index: 2; }
.tl-row { border-top: 1px solid var(--divider); }
.tl-row:hover .tl-track { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tl-row.no-fit .tl-track { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(229,72,77,.08) 6px 12px); }
.tl-row.no-fit .tl-label { opacity: .5; }
.tl-bar { position: absolute; top: 4px; height: 24px; border-radius: 6px; cursor: pointer; overflow: visible; z-index: 1;
  background: hsl(var(--h) 55% 45% / .38); border: 1px solid hsl(var(--h) 55% 50% / .8); }
.tl-bar.movable { cursor: grab; }
.tl-bar.dragging { opacity: .35; }
.tl-part { position: absolute; top: 0; bottom: 0; }
.tl-part.harvest { background: hsl(var(--h) 60% 45% / .85); }
.tl-part.clean { background: var(--text-faint); opacity: .35; }
.tl-bar:first-child .tl-part.harvest, .tl-bar .tl-part.clean { border-radius: 0 5px 5px 0; }
.tl-nursery { position: absolute; top: 7px; height: 10px; border-radius: 3px 0 0 3px; pointer-events: auto;
  background: repeating-linear-gradient(135deg, hsl(var(--h) 55% 50% / .55) 0 3px, transparent 3px 6px); }
.tl-nursery.ext { background: none; border-bottom: 2px dotted hsl(var(--h) 55% 55%); }
/* the name stays in view when the bar began before the window (sticky against the board's scroll) */
.tl-bar-label { position: sticky; left: 180px; z-index: 1; display: inline-flex; max-width: 100%; align-items: center; gap: 4px; height: 100%; padding: 0 6px 0 2px;
  font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; color: var(--text); pointer-events: none; }
.tl-bar.is-proposed { background: hsl(var(--h) 55% 45% / .14); border-style: dashed; }
.tl-bar.is-proposed .tl-part.harvest { opacity: .45; }
.tl-bar.is-harvested { opacity: .45; }
.tl-bar.is-over { outline: 2px dashed var(--warning); outline-offset: 1px; }
.tl-bar.is-sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.tl-bar.bad { outline: 2px solid var(--danger, #e5484d); }
.tl-handle { position: absolute; right: -3px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.tl-bar:hover .tl-handle { background: color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 0 5px 5px 0; }
.tl-tip { position: absolute; left: 100%; top: -22px; white-space: nowrap; font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--ink, #111); color: #fff; z-index: 5; }
.tl-ghost { position: absolute; top: 3px; height: 26px; border-radius: 6px; border: 2px dashed var(--accent); z-index: 4;
  background: color-mix(in srgb, var(--accent) 16%, transparent); font-size: 11px; font-weight: 600; padding: 0 6px;
  display: flex; align-items: center; white-space: nowrap; overflow: visible; pointer-events: none; color: var(--text); }
.tl-ghost.bad { border-color: var(--danger, #e5484d); background: rgba(229,72,77,.14); }
body.tl-dragging { cursor: grabbing; user-select: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tl-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; --h: 140; }
.lg-nursery { background: repeating-linear-gradient(135deg, hsl(var(--h) 55% 50% / .55) 0 3px, transparent 3px 6px); }
.lg-grow { background: hsl(var(--h) 55% 45% / .38); border: 1px solid hsl(var(--h) 55% 50% / .8); }
.lg-harvest { background: hsl(var(--h) 60% 45% / .85); }
.lg-clean { background: var(--text-faint); opacity: .5; }
.lg-proposed { border: 1px dashed hsl(var(--h) 55% 50%); }
.lg-over { outline: 2px dashed var(--warning); }
.lg-closed { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--border-strong) 3px 4px); }

/* the per-week strip above the rows (0.7.114) */
.tl-sum { height: 34px; background: var(--surface); }
.tl-sum .tl-label { color: var(--text-muted); }
.tl-wk { position: absolute; top: 3px; bottom: 3px; }
.tl-wk-part { position: absolute; left: 0; right: 0; border-radius: 2px 2px 0 0; }
.tl-wk-part.kg { background: color-mix(in srgb, var(--success, #2e7d32) 70%, transparent); }
.tl-wk-part.kg-p { background: color-mix(in srgb, var(--success, #2e7d32) 28%, transparent); }
.tl-wk-part.sow { background: color-mix(in srgb, #8bc34a 70%, transparent); }
.tl-wk-part.sow-p { background: color-mix(in srgb, #8bc34a 28%, transparent); }
.tl-wk-part.ext { background: color-mix(in srgb, #3b82f6 60%, transparent); }
.tl-wk-part.ext-p { background: repeating-linear-gradient(135deg, color-mix(in srgb, #3b82f6 45%, transparent) 0 3px, transparent 3px 5px); }
.tl-plants { height: 28px; }
.tl-plants.total { height: 30px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.tl-plants .tl-label .hint { font-weight: 600; }
.tl-wk-n { position: absolute; left: 2px; top: -1px; font-size: 9px; font-weight: 700; color: var(--text); text-shadow: 0 0 2px var(--surface); }

/* ── orders (0.7.115) ───────────────────────────────────────────────────────── */
.ord-list { display: grid; gap: var(--space-3); }
.ord-customer { font-size: var(--text-base, 15px); }
.ord-line { display: grid; grid-template-columns: auto minmax(160px, 1.3fr) minmax(160px, 1fr) auto auto; gap: var(--space-3);
  align-items: center; padding: var(--space-2) 0; border-top: 1px solid var(--divider); margin-top: var(--space-2); }
.ord-line.off { opacity: .5; }
.ord-line .ord-why { grid-column: 2 / -1; margin: 0; }
.ord-cover { display: grid; gap: 3px; }
.ord-bar { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.ord-bar i { display: block; height: 100%; background: var(--success, #2e7d32); }
.ord-bar.short i { background: var(--warning); }
.ord-answer { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.ord-verdict { padding: 10px 12px; border-radius: var(--radius-md); font-size: var(--text-sm); }
.ord-verdict.yes { background: color-mix(in srgb, var(--success, #2e7d32) 18%, transparent); }
.ord-verdict.tight { background: color-mix(in srgb, var(--warning) 20%, transparent); }
.ord-verdict.no { background: rgba(229,72,77,.16); }
.ord-plan { font-size: var(--text-xs); }
.ord-alt { flex-wrap: wrap; gap: var(--space-2); }
/* 0.7.162: a second global .grid2 here overrode the narrow-screen rule for every form; the orders only need theirs on small screens */
@media (max-width: 700px) { .ord-line { grid-template-columns: auto 1fr; } }
/* the timeline: an order's batch and a rotation warning */
.tl-flag { font-size: 10px; color: var(--accent); flex: none; }
.tl-flag.warn { color: var(--warning); font-weight: 900; }
.tl-bar.has-order { box-shadow: inset 3px 0 0 var(--accent); }

/* how many positions a zone has (0.7.116) */
.tl-split { display: inline-flex; align-items: center; gap: 6px; }
.tl-split select { padding: 3px 6px; font-size: var(--text-xs); }

/* ── the timeline window (0.7.118): top scroll bar, pinned head, kg per zone ── */
.tl-hscroll { overflow-x: auto; overflow-y: hidden; height: 14px; margin-bottom: 4px; border-radius: 7px; background: var(--chip); }
.tl-hscroll > div { height: 1px; }
.tl-board { max-height: calc(100dvh / var(--zoom, 1) - 250px); min-height: 360px; overflow: auto; overscroll-behavior: contain; }
.tl-sticky { position: sticky; top: 0; z-index: 6; background: var(--surface); box-shadow: 0 2px 0 var(--border); }
.tl-sticky .tl-scale { position: static; }
.tl-kg.total { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.tl-kg .tl-label .hint { font-weight: 600; }
.tl-row.tl-kg { border-top: 1px solid var(--divider); }
.tl-wk-part { left: 0; right: auto; }
.tl-wk-part.fc { background: color-mix(in srgb, var(--success, #2e7d32) 70%, transparent); }
.tl-wk-part.fc-p { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--success, #2e7d32) 45%, transparent) 0 3px, transparent 3px 5px); }
.tl-wk-part.real { background: #f59e0b; }
.lg-fc { background: color-mix(in srgb, var(--success, #2e7d32) 70%, transparent); }
.lg-fcp { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--success, #2e7d32) 45%, transparent) 0 3px, transparent 3px 5px); }
.lg-real { background: #f59e0b; }

/* the planner's explanation behind ⓘ (0.7.119) */
.tl-info { font-size: 16px; line-height: 1; padding: 4px 8px; }
.tl-help { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.tl-board { max-height: calc(100dvh / var(--zoom, 1) - 200px); }

/* the planner's top bar, one frame for both views (0.7.120): the switch and ⓘ never move */
.planner-top { flex-wrap: nowrap; }
.planner-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-height: 32px; }
.planner-switch, .planner-top > .tl-info { flex: none; }

/* ── clearing a zone (0.7.121); the steady meter (used by the steady window) ── */
.tl-clear { color: var(--danger, #e5484d); }
.tl-steady-meter { height: 5px; border-radius: 3px; background: var(--chip); overflow: hidden; margin-top: 4px; }
.tl-steady-meter i { display: block; height: 100%; background: var(--success, #2e7d32); }
.tl-clear-list { margin: 0 0 var(--space-3); padding-left: 1.2em; }

/* ── the assistant (0.7.122): a side panel that pushes the page, folds away ─── */
.topbar-ai { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
body.ai-open .main { margin-right: min(420px, 90vw); }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 90vw); z-index: 60; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0,0,0,.25); }
.ai-head { display: flex; align-items: center; gap: var(--space-2); padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ai-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-hello { color: var(--text-muted); font-size: var(--text-sm); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ai-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: var(--text-sm); line-height: 1.45; word-wrap: break-word; }
.ai-msg.user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); white-space: pre-wrap; }
.ai-msg.bot { align-self: flex-start; background: var(--chip); }
.ai-msg.error { align-self: stretch; background: rgba(229,72,77,.14); color: var(--text); }
.ai-md p { margin: 0 0 6px; } .ai-md p:last-child { margin-bottom: 0; }
.ai-md ul, .ai-md ol { margin: 4px 0 6px 18px; padding: 0; }
.ai-md code { font-size: 12px; background: rgba(127,127,127,.18); padding: 0 4px; border-radius: 4px; }
.ai-files { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.ai-card { align-self: stretch; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border)); border-radius: 10px; padding: 10px 12px;
  display: grid; gap: 6px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.ai-card.done { border-color: color-mix(in srgb, var(--success, #2e7d32) 60%, var(--border)); background: color-mix(in srgb, var(--success, #2e7d32) 8%, var(--surface)); }
.ai-card.dismissed { opacity: .55; }
.ai-card-sum { font-size: var(--text-sm); font-weight: 600; }
.ai-card-det summary { font-size: var(--text-xs); color: var(--text-muted); cursor: pointer; }
.ai-card-det pre { font-size: 11px; max-height: 180px; overflow: auto; background: var(--chip); padding: 6px; border-radius: 6px; margin: 4px 0 0; }
.ai-card-state { font-size: var(--text-xs); color: var(--text-muted); }
.ai-card-state.ok { color: var(--success, #2e7d32); } .ai-card-state.bad { color: var(--danger, #e5484d); }
.ai-busy { display: grid; gap: 6px; padding: 0 14px 10px; }
.ai-foot { border-top: 1px solid var(--border); padding: 10px 14px; display: grid; gap: 8px; }
.ai-input { width: 100%; resize: vertical; min-height: 64px; }
.ai-attached { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ai-file { font-size: 11px; background: var(--chip); border-radius: 10px; padding: 2px 8px; cursor: pointer; }
@media (max-width: 900px) { body.ai-open .main { margin-right: 0; } }

.tl-steady-legend { gap: var(--space-3); font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.tl-steady-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ── a steady harvest over several zones (0.7.135): choosing, the group, the window ── */
.tl-steady-banner { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: 8px 12px; margin-bottom: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--g, var(--accent)) 55%, var(--border)); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--g, var(--accent)) 8%, var(--surface)); font-size: var(--text-sm); }
.tl-zone .tl-label.pickable { cursor: pointer; }
.tl-zone .tl-label input[type=checkbox] { margin: 0 6px 0 0; accent-color: var(--accent); flex: none; }
/* each steady group wears its own colour, --g (0.7.140) */
.tl-row.steady .tl-track { background: color-mix(in srgb, var(--g, var(--accent)) 5%, transparent); }
.tl-row.steady .tl-label { background: color-mix(in srgb, var(--g, var(--accent)) 6%, var(--surface)); box-shadow: inset 3px 0 0 var(--g, var(--accent)); }
.tl-zone.steady, .tl-zone.steady .tl-label { background: color-mix(in srgb, var(--g, var(--accent)) 12%, var(--surface-offset, var(--chip))); }
.tl-zone.steady .tl-label { box-shadow: inset 3px 0 0 var(--g, var(--accent)); }
.tl-zone.picked, .tl-zone.picked .tl-label { background: color-mix(in srgb, var(--accent) 22%, var(--surface-offset, var(--chip))); }
.tl-group { border-top: 2px solid color-mix(in srgb, var(--g, var(--accent)) 60%, var(--border)); }
.tl-group, .tl-group .tl-label { background: color-mix(in srgb, var(--g, var(--accent)) 18%, var(--surface-offset, var(--chip))); }
.tl-group .tl-label { box-shadow: inset 3px 0 0 var(--g, var(--accent)); }
.tl-group-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; flex: none; vertical-align: -1px; }
.tl-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tl-zone .tl-label input[type=checkbox]:disabled { opacity: .45; }
.tl-group-sum { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }
.tl-others .tl-label { color: var(--text-muted); font-weight: 600; }
.tl-steady-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--g, var(--accent)) 22%, var(--surface)); }
.tl-chip-x { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 50%; }
.tl-chip-x:hover { background: var(--hover); color: var(--text); }
.st-zones { display: grid; gap: 6px; }
.st-zone { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(140px, 1.2fr) minmax(150px, 1.2fr); gap: var(--space-2); align-items: center; }
.st-zone-head { font-size: var(--text-xs); }
.st-series { display: grid; gap: 10px; margin-bottom: 8px; }
.st-line { display: grid; grid-template-columns: minmax(120px, auto) 1fr 90px; gap: 10px; align-items: center; }
.st-name { display: flex; align-items: center; gap: 6px; }
.st-facts { display: flex; flex-direction: column; font-size: var(--text-xs); }
.st-chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; margin-top: 10px; padding: 4px; border-radius: var(--radius-md); background: var(--chip); }
.st-col { flex: 1; min-width: 3px; height: 100%; display: flex; flex-direction: column-reverse; }
.st-col span { display: block; width: 100%; }
.st-col span:last-child { border-radius: 2px 2px 0 0; }
.st-col.ramp { opacity: .4; }
.st-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
@media (max-width: 700px) { .st-zone, .st-line { grid-template-columns: 1fr; } }
.st-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ── sister units on the combined board (0.7.139) ───────────────────────────── */
.tk-unit { flex: none; font-size: 9px; font-weight: 800; letter-spacing: .04em; line-height: 1; padding: 3px 4px; border-radius: 4px;
  color: #fff; background: var(--u); }
.tk-unit.big { font-size: 11px; padding: 3px 6px; }
.tk.has-unit { border-left: 4px solid var(--u); }   /* the unit is the left edge's colour (0.7.181); the legend names it */
.unit-legend { display: inline-flex; gap: 10px; align-items: center; font-size: var(--text-xs); color: var(--text-muted); }
.unit-legend .tk-unit { margin-right: 4px; }

/* ── Office › Sell: the basket planner (0.7.141) ── */
.bk-clients { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--text-sm); }
.bk-clients input { width: 96px; font-size: var(--text-lg); font-weight: 700; text-align: right; }
.bk-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.bk-range { margin: 0 6px; }
.bk-toggle { gap: 6px; font-size: var(--text-sm); color: var(--text-muted); cursor: pointer; }
.bk-units { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bk-unit { display: inline-flex; align-items: center; gap: 6px; opacity: .55; }
.bk-unit.on { opacity: 1; }
.bk-unit-mark { color: #fff; font-size: 10px; font-weight: 800; border-radius: 5px; padding: 1px 5px; }
.bk-tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.bk-card { padding-bottom: var(--space-3); }
.bk-scroll { overflow-x: auto; padding-bottom: 6px; }
.bk-chart { display: flex; align-items: stretch; gap: 6px; min-height: 320px; }
.bk-col { flex: 0 0 58px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px 2px;
  border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.bk-col:hover, .bk-col:focus-visible { border-color: var(--border); background: var(--hover); outline: none; }
.bk-col.today { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.bk-col.empty { opacity: .55; }
.bk-top { display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-height: 34px; }
.bk-top b { font-size: 12px; white-space: nowrap; }
.bk-avg { font-size: 11px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.bk-stack { position: relative; flex: 1; min-height: 220px; display: flex; flex-direction: column-reverse; align-items: stretch;
  border-bottom: 1px solid var(--border); }
.bk-seg { display: block; width: 70%; margin: 0 auto; min-height: 1px; }
.bk-seg:first-child { border-radius: 0; }
.bk-seg:last-of-type { border-radius: 4px 4px 0 0; }
.bk-seg.prop { opacity: .45; background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255,255,255,.35) 4px 6px); }
.bk-col.realized .bk-seg { outline: 1px solid rgba(0,0,0,.15); }
.bk-fc-line { position: absolute; left: 6%; right: 6%; border-top: 2px dashed var(--text-muted); z-index: 1; pointer-events: none; }
.bk-foot { display: flex; flex-direction: column; align-items: center; font-size: 11px; line-height: 1.2; }
.bk-foot span:first-child { font-weight: 700; }
.bk-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: var(--space-3); }
.bk-leg { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); }
.bk-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bk-key { margin-top: 6px; }
.bk-basket { display: grid; gap: 8px; margin-bottom: var(--space-3); }
.bk-brow { display: grid; grid-template-columns: 44px minmax(120px, 1.4fr) 80px 90px minmax(80px, 1fr); gap: 10px; align-items: center; }
.bk-bhead { font-size: var(--text-xs); }
.bk-share { display: flex; align-items: center; gap: 6px; }
.bk-share i { display: block; height: 8px; border-radius: 4px; min-width: 2px; }
@media (max-width: 640px) { .bk-brow { grid-template-columns: 40px 1fr 70px 80px; } .bk-brow > :last-child { display: none; } }

/* ── Connections: FarmNet, sensors and cameras (0.7.142) ── */
table.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.table th { text-align: left; font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
table.table td { padding: 8px 10px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.table td.warn { color: var(--warning); font-weight: 700; }
.card:has(> table.table) { overflow-x: auto; }
.cx-empty { max-width: 720px; display: flex; flex-direction: column; gap: 8px; }
.cx-empty ol { margin: 0 0 6px 18px; padding: 0; display: grid; gap: 6px; color: var(--text-muted); font-size: var(--text-sm); }
.cx-empty .btn { align-self: flex-start; }
.cx-alarms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-3); }
.cx-alarm { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--error-bg); color: var(--error); font-size: var(--text-sm); text-decoration: none; }
.cx-alarm svg { width: 15px; height: 15px; }
.cx-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.cx-zone h3 { margin: 0 0 8px; font-size: var(--text-base); }
.cx-kind { margin-bottom: 8px; }
.cx-kind-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.cx-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-val { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 4px; align-items: baseline;
  padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-offset, var(--chip)); color: var(--text);
  cursor: pointer; font: inherit; text-align: left; min-width: 88px; }
.cx-val .cx-v { font-size: var(--text-lg); font-weight: 750; }
.cx-val .cx-u { font-size: 11px; color: var(--text-muted); }
.cx-val .cx-l { grid-column: 1 / -1; font-size: 11px; color: var(--text-muted); }
.cx-val.watch { border-color: var(--warning); background: var(--warning-bg); }
.cx-val.alarm { border-color: var(--error); background: var(--error-bg); }
.cx-val.alarm .cx-v { color: var(--error); }
.cx-chart-card { margin-bottom: var(--space-3); }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cx-chart-title { font-weight: 700; margin-bottom: 4px; }
.cx-svg { width: 100%; height: auto; display: block; }
.cx-svg .cx-line { fill: none; stroke-width: 2; }
.cx-svg .cx-grid { stroke: var(--divider); stroke-width: 1; }
.cx-svg .cx-axis { fill: var(--text-muted); font-size: 11px; }
.cx-svg .cx-band { fill: var(--success, #2e7d32); opacity: .09; }
.cx-svg .cx-alarm-line { stroke: var(--error); stroke-dasharray: 6 5; stroke-width: 1.2; }
.cx-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--text-sm); margin-top: 6px; }
.cx-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.hm-areas { display: grid; gap: 8px; margin: 8px 0; }
.hm-area { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 10px; align-items: center; font-size: var(--text-sm); }
.hm-bars { display: grid; gap: 3px; }
.hm-bars i { display: block; height: 8px; border-radius: 4px; min-width: 2px; }
.hm-bars i.seen { background: hsl(205 70% 55%); }
.hm-bars i.plan { background: var(--text-faint, #888); opacity: .5; }
.hm-grid { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.card:has(> table.hm-grid) { overflow-x: auto; }   /* 13+ hour columns: the card scrolls, not the page */
.hm-grid th { color: var(--text-muted); font-weight: 600; padding: 0 4px; text-align: center; }
.hm-grid th.hm-row { text-align: right; white-space: nowrap; }
.hm-grid td { width: 28px; height: 22px; border-radius: 4px; background: hsl(205 75% 50% / calc(0.06 + var(--a, 0) * 0.9)); }
.cx-page .card + .card, .card.cx-follow { margin-top: var(--space-3); }
.cx-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cx-growth { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-3); }
.cx-g { display: flex; flex-direction: column; gap: 8px; }
.cx-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
.cx-facts > div { display: flex; flex-direction: column; font-size: var(--text-sm); }
.cx-shift { font-weight: 700; font-size: var(--text-sm); padding: 4px 10px; border-radius: 8px; align-self: flex-start; }
.cx-shift.late { background: var(--warning-bg); color: var(--warning); }
.cx-shift.early { background: var(--info-bg); color: var(--info); }
.cx-shift.same { background: var(--success-bg); color: var(--success); }
.cx-spark-box { display: flex; align-items: center; gap: 8px; }
.cx-spark { width: 160px; height: 32px; }
.cx-spark path { fill: none; stroke: var(--success, #2e7d32); stroke-width: 2; }
.cx-api p { max-width: 80ch; }
.cx-code { background: var(--surface-offset, var(--chip)); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; }
.cx-key { font-size: 14px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.cx-codes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
@media (max-width: 640px) { .hm-area { grid-template-columns: 1fr; } .cx-facts { grid-template-columns: repeat(2, 1fr); } }

/* ── Office › Customers and deliveries (0.7.143) ── */
.cu-tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cu-bar { gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.cu-bar input { max-width: 280px; }
.cu-chips { display: flex; flex-wrap: wrap; gap: 6px; }
table.table tr.off td { opacity: .5; }
.ord-deliveries { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 44px; }
.ord-dchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: var(--radius-full);
  background: var(--success-bg); color: var(--success); font-size: var(--text-xs); font-weight: 600; }

/* ── purchase orders (0.7.144) ── */
.po-list { display: grid; gap: var(--space-3); }
.po .table-wrap table { min-width: 560px; }
.po > .row { gap: var(--space-2); flex-wrap: wrap; }
.po-text { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; width: 100%; }
.seed-batches { margin-top: var(--space-2); }
.seed-batches > summary { cursor: pointer; font-weight: 600; padding: var(--space-2) 0; }
.seed-batches .table-wrap table { min-width: 640px; }
.seed-head { margin: var(--space-4) 0 0; font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; }

/* ── Dashboard › Yield (0.7.145) ── */
.yd-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.yd-chart { display: flex; align-items: flex-end; gap: 4px; height: 220px; overflow-x: auto; padding-top: 8px; }
.yd-col { flex: 1 0 26px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.yd-col.ahead { opacity: .55; }
.yd-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--border); }
.yd-bars i.plan { display: block; width: 42%; border: 1.5px solid var(--text-muted); border-bottom: 0; border-radius: 3px 3px 0 0; box-sizing: border-box; }
.yd-stack { width: 42%; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.yd-stack i { display: block; width: 100%; }
.yd-stack i.harv { background: var(--success, #2e7d32); border-radius: 3px 3px 0 0; }
.yd-stack i.waste { background: var(--error); }
.yd-lbl { font-size: 10px; color: var(--text-muted); white-space: nowrap; margin-top: 3px; }
.yd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--space-3); margin: var(--space-3) 0; }
.yd-name { display: flex; align-items: center; gap: 8px; }
.yd-bar { display: inline-block; width: 80px; height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.yd-bar i { display: block; height: 100%; background: var(--success, #2e7d32); }
.yd-bar.short i { background: var(--warning); }
@media (max-width: 640px) { .yd-grid { grid-template-columns: 1fr; } }

/* ── Tasks › Hours (0.7.146) ── */
.hr-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.hr-table tr.hr-row { cursor: pointer; }
.hr-table tr.hr-row:hover td { background: var(--row-hover, var(--hover)); }
.hr-who { display: flex; align-items: center; gap: 10px; }
.hr-on { color: var(--success) !important; }
.hr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.hr-day { display: flex; flex-direction: column; font-size: var(--text-sm); padding: 6px 8px; border-radius: 8px; background: var(--surface-offset, var(--chip)); }

/* ── Office › Money (0.7.147) ── */
.mo-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mo-chart { display: flex; align-items: stretch; gap: 10px; height: 240px; overflow-x: auto; padding-top: 8px; }
.mo-col { flex: 1 0 56px; display: flex; flex-direction: column; align-items: center; }
.mo-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.mo-bars i.rev { display: block; width: 36%; background: var(--success, #2e7d32); border-radius: 3px 3px 0 0; }
.mo-cost { width: 36%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.mo-cost i { display: block; width: 100%; }
.mo-cost i.dir { background: hsl(28 80% 55%); }
.mo-cost i.ind { background: var(--text-faint, #888); opacity: .7; border-radius: 3px 3px 0 0; }
.mo-lbl { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.mo-net { font-size: 11px; font-weight: 700; }
.mo-net.neg { color: var(--error); }

/* ── Grow › Forecast review (0.7.148) ── */
.fc-zone { margin-bottom: var(--space-3); display: grid; gap: 6px; }
.fc-row { display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 1fr) minmax(300px, 1.6fr) auto; gap: 8px 14px; align-items: center;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--divider); }
.fc-row.due { border-left: 3px solid var(--warning); }
.fc-who { display: flex; align-items: center; gap: 10px; }
.fc-plan { display: flex; flex-direction: column; font-size: var(--text-sm); }
.fc-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-f { display: flex; flex-direction: column; gap: 2px; }
.fc-f .input { width: 110px; padding: 4px 8px; }
.fc-f select.input { width: 130px; }
.fc-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fc-last { grid-column: 1 / -1; }
@media (max-width: 900px) { .fc-row { grid-template-columns: 1fr; } .fc-acts { justify-content: flex-start; } }

/* ── Grow › Field validation (0.7.149) ── */
.va-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--space-3); }
.va-card { display: flex; flex-direction: column; gap: 8px; }
.va-card > .row { gap: 10px; }
.va-change { display: flex; align-items: baseline; gap: 10px; font-size: var(--text-lg); }
.va-from { color: var(--text-muted); text-decoration: line-through; }
.va-arrow { color: var(--text-muted); }
.va-acts { gap: 6px; }
.va-acts .input { flex: 1; min-width: 120px; }

/* ── crop editor: targets and materials (0.7.150) ── */
.ce-targets, .ce-bom { display: grid; gap: 6px; margin-bottom: var(--space-3); }
.ce-trow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--divider); border-radius: 10px; }
.ce-trow select { width: 130px; }
.ce-range { display: inline-flex; align-items: center; gap: 3px; }
.ce-range input { width: 62px; padding: 3px 6px; }
.ce-brow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.resp-pick { display: inline-flex; align-items: center; gap: 4px; margin: 0 10px 6px 0; }
.resp-prio-sel { width: auto; min-width: 44px; padding: 2px 4px; font-size: var(--text-xs); height: auto; }
.resp-prio { font-weight: 800; opacity: .85; }
/* Tasks › Team (0.7.222): the people by job, numbered responsibilities, the place in the job */
.team-gaps { margin-bottom: var(--space-4); }
.team-table td { vertical-align: middle; }
.team-table tr.team-job td { background: var(--surface-offset); padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--border); }
.team-jobline { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.team-jobline b { font-size: var(--text-sm); }
.team-jobline .spacer { flex: 1; }
.team-jobhas { max-width: 70ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-place { white-space: nowrap; }
.team-placeno { font-weight: 700; }
.team-sel { width: auto; min-width: 86px; padding: 4px 8px; height: auto; font-size: var(--text-sm); }
.team-chips { max-width: 560px; gap: 6px; }
.team-chip { display: inline-flex; align-items: center; gap: 6px; }
.team-chip[role="button"] { cursor: pointer; }
.team-chip[role="button"]:hover, .team-chip[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.team-chip .team-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: color-mix(in srgb, currentColor 16%, transparent); font-size: 11px; font-weight: 800; line-height: 1; }
.team-chip.pinned .team-n { background: var(--accent); color: var(--accent-ink); }
.team-plus { cursor: pointer; border-style: dashed; background: transparent; font-weight: 700; }
.team-week { white-space: nowrap; font-size: var(--text-sm); }
.team-week .yd-bar { width: 64px; }
.team-over { color: var(--warning); font-weight: 600; }
.team-then { font-size: var(--text-xs); color: var(--accent); font-weight: 600; margin-top: 2px; }
.team-plan, .team-hours { margin-top: var(--space-4); }
.team-hours > summary { cursor: pointer; }
.team-hours-in { margin-top: var(--space-4); }
.team-more { margin-top: var(--space-3); gap: var(--space-2); flex-wrap: wrap; }
.team-danger { color: var(--danger, #c0392b); }
.team-hint { margin: var(--space-2) 0 var(--space-3); }
.team-sec { margin-top: var(--space-4); margin-bottom: var(--space-2); }
.team-order { display: grid; gap: 4px; margin-bottom: var(--space-3); }
.team-orow { display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.team-orow:hover { border-color: var(--border-strong); }
.team-orow[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.team-on { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 12px; background: var(--chip); font-weight: 800; font-size: var(--text-sm); flex: none; }
.team-oname b { display: block; font-weight: 600; }
.team-oname small { color: var(--text-faint); font-size: var(--text-xs); }
.team-ask { margin-top: var(--space-3); }
.team-opts { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.team-opt { display: flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; }
.team-opt input { margin-top: 3px; flex: none; width: auto; }
.team-line b { color: var(--accent); }
.team-ba { font-size: var(--text-sm); line-height: 1.7; }
.team-block { margin-bottom: var(--space-3); }
.team-key { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2); }
.team-keyhead { display: flex; align-items: center; gap: var(--space-3); margin-bottom: 4px; }
.team-keyhead .spacer { flex: 1; }
.team-seg { margin-top: 6px; }
.ce-trk { display: grid; gap: 8px; }
.ce-trow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ce-trk-on { display: inline-flex; gap: 6px; align-items: center; min-width: 130px; cursor: pointer; }
.ce-trk-rest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.ce-trk-rest[hidden] { display: none; }
.ce-trk-rest input { flex: 1; min-width: 200px; }
.ce-trk-rest .btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.ce-brow select:first-child { min-width: 220px; flex: 1; }
.ce-brow input { width: 90px; }
.ce-targets > .btn, .ce-bom > .btn { justify-self: start; }

/* ── Sell: the direct-selling app link (0.7.151) ── */
.bk-shop { margin-top: var(--space-3); display: flex; flex-direction: column; gap: 8px; }
.bk-shop .row { gap: 8px; }

/* ── Dashboard: To decide (0.7.152) ── */
.dc-strip:empty { display: none; }
.dc-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 var(--space-3); }
.dc-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-right: 4px; }
.dc-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: var(--radius-full); text-decoration: none;
  background: var(--surface-offset, var(--chip)); color: var(--text); border: 1px solid var(--border); font-size: var(--text-sm); }
.dc-item:hover { border-color: var(--accent); }
.dc-item b { font-size: var(--text-base); }
.dc-item.warn { background: var(--warning-bg); border-color: transparent; }
.dc-item.bad { background: var(--error-bg); color: var(--error); border-color: transparent; }

/* ── Scouting in sections (0.7.153): where a photo was, its sizes, the day's finish ── */
.sc-where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: var(--text-xs); }
.sc-where .mono { font-family: ui-monospace, monospace; font-weight: 700; }
/* the robot's tab (0.7.183) */
.rb-fig { cursor: pointer; }
.rb-fig.rb-off { opacity: .5; }
.rb-nophoto { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 1px dashed var(--border); color: var(--text-faint); font-size: var(--text-xs); }
.rb-photo { width: 100%; border-radius: 8px; display: block; background: #000; margin-bottom: var(--space-3); }
.rb-facts { display: grid; gap: 6px; margin-bottom: var(--space-3); }
.rb-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-2); align-items: baseline; }
.rb-sizes { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 4px; }
.rb-sizes li { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-2); }
.rb-status { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.rb-acts { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.sc-ai-line { margin-top: 4px; font-size: var(--text-xs); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-outcome { margin-bottom: var(--space-3); font-weight: 600; }
.note.ok { background: var(--success-bg); border-color: transparent; color: var(--success); }

/* ── Procedures › Edit: the scouting's sections (0.7.154) ── */
.sc-sections { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.sc-sec-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2, var(--surface)); }
@media (max-width: 700px) { .sc-sec-row { grid-template-columns: 1fr; } }

/* ── Pest & diseases › Traps: the trap map (0.7.155) ── */
.tm-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 0 var(--space-3); font-size: var(--text-xs); color: var(--text-muted); }
.tm-key { display: inline-flex; align-items: center; gap: 6px; }
.tm-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.tm-sw.green, .tm-cell.green { background: color-mix(in srgb, var(--success) 30%, var(--surface)); }
.tm-sw.orange, .tm-cell.orange { background: color-mix(in srgb, #f0a020 38%, var(--surface)); }
.tm-sw.red, .tm-cell.red { background: color-mix(in srgb, var(--error) 42%, var(--surface)); }
.tm-sw.none, .tm-cell.none { background: var(--surface-2, var(--surface-offset)); }
.tm-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--space-3); }
@media (max-width: 700px) { .tm-maps { grid-template-columns: 1fr; } }
.tm-unit .row { gap: 10px; align-items: center; margin-bottom: 8px; }
.tm-body { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: stretch; }
.tm-side { display: flex; flex-direction: column; justify-content: space-around; font-size: 11px; color: var(--text-muted); font-family: ui-monospace, monospace; }
.tm-wrap { position: relative; }
.tm-grid { position: relative; display: grid; gap: 3px; width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 3px; background: var(--surface); }
.tm-cell { position: relative; border: 0; border-radius: 6px; cursor: pointer; font: inherit; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 30px; padding: 2px; }
.tm-cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.tm-cell b { font-size: var(--text-base); line-height: 1; }
.tm-cell .tm-trend { position: absolute; top: 3px; right: 6px; font-size: 12px; font-weight: 800; }
.tm-cell .tm-n { font-size: 10px; color: var(--text-muted); }
.tm-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; border: 2px solid var(--bg, #000);
  background: var(--text-muted); cursor: pointer; padding: 0; z-index: 2; }
.tm-dot.green { background: var(--success); } .tm-dot.orange { background: #f0a020; } .tm-dot.red { background: var(--error); }
.tm-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin: 4px 0 0 28px; }
.tm-spot { margin-bottom: var(--space-3); }
.tm-spot .row { gap: 8px; align-items: center; flex-wrap: wrap; }
.tm-trend-word { font-size: var(--text-xs); color: var(--text-muted); }
.tm-spot-body { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-3); margin: var(--space-3) 0; }
.tm-photo { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2, var(--surface)); padding: 0; cursor: zoom-in; min-height: 100px; overflow: hidden; }
.tm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm-ai { font-size: var(--text-sm); padding: 6px 8px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px; }
.tm-note { font-size: var(--text-sm); color: var(--text-muted); font-style: italic; }
.tm-bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 64px; padding-bottom: 14px; }
.tm-bars.mini { height: 30px; padding-bottom: 0; gap: 2px; width: 110px; }
.tm-bars.mini .tm-wk { display: none; }
.tm-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.tm-bar i { width: 100%; border-radius: 3px 3px 0 0; display: block; background: var(--text-muted); }
.tm-bar i.green { background: var(--success); } .tm-bar i.orange { background: #f0a020; } .tm-bar i.red { background: var(--error); }
.tm-bar i.none { background: var(--border); }
.tm-wk { position: absolute; bottom: -14px; font-size: 10px; color: var(--accent); }
.tm-over { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--error); pointer-events: none; }
.tm-hist { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.tm-hfig { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; background: var(--surface);
  font: inherit; font-size: 11px; color: var(--text); cursor: zoom-in; text-align: left; }
.tm-hfig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.tm-trend-cell { font-weight: 800; text-align: center; }
.tm-nophoto { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; font-size: 11px; color: var(--text-muted); background: var(--surface-2, var(--surface-offset)); border-radius: 4px; }
.tm-fam { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-side.yellow { box-shadow: inset 3px 0 0 #e7c21a; } .tm-side.blue { box-shadow: inset 3px 0 0 #2f7de1; }

/* ── one site, two units (0.7.158): the unit selector and the Both view ── */
.unit-bar { display: inline-flex; gap: 4px; padding: 3px; margin: 0 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); flex-wrap: wrap; }
.unit-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-muted); font: inherit;
  font-size: var(--text-sm); font-weight: 600; padding: 6px 14px; border-radius: var(--radius-full); cursor: pointer; }
.unit-btn[aria-pressed="true"] { background: var(--surface-offset, var(--chip)); color: var(--text); }
.unit-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.unit-block { border-left: 4px solid var(--u, var(--border)); padding-left: var(--space-3); margin-bottom: var(--space-5); }
.unit-head { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-2); font-size: var(--text-base); }
.unit-badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--u, #888); border-radius: 6px; padding: 2px 7px; }
/* in Both the tab already names the page and the heading the unit: no repeated title */
.unit-inner .page-head h1 { display: none; }
.sc-verdicts { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 var(--space-3); }
/* Pest & diseases: one report per zone (0.7.166) */
.pd-zones { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--space-4); }
.pd-zonechip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.pd-zonechip .dot.none { display: none; }
.pd-zonechip.on { background: var(--accent-soft); border-color: var(--accent); }
.pd-zone-head { font-weight: 700; margin: 0 0 var(--space-2); }
.pd-zone-crops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--space-3); }
.pd-zone-crop { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); }

/* ── the zone's report (0.7.174): the AI's opinion, plant health first, Traps and Growth behind tiles ── */
.pd-ai { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); border-left: 3px solid var(--accent); }
.pd-ai-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pd-ai-head .spacer { flex: 1; }
.pd-ai-line { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pd-ai-line b { flex: 1 1 320px; font-size: var(--text-base); line-height: 1.4; }
.pd-ai-points, .pd-ai-next { margin: 0; padding-left: 1.25rem; display: grid; gap: 6px; font-size: var(--text-sm); }
.pd-ai-points .hint { font-size: var(--text-xs); margin-top: 2px; }
.pd-ai-missing summary { cursor: pointer; font-size: var(--text-sm); color: var(--text-muted); }
.pd-ai-missing ul { margin: 6px 0 0; padding-left: 1.25rem; font-size: var(--text-sm); color: var(--text-muted); }
.pd-ai-foot { font-size: var(--text-xs); }
.pd-sec { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.pd-sec > summary { padding: var(--space-2) var(--space-3); cursor: pointer; display: flex; gap: var(--space-2); align-items: baseline; }
.pd-sec-body { padding: 0 var(--space-3) var(--space-3); }
.pd-hlabel { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px; }
.pd-curve { width: 100%; height: auto; display: block; overflow: visible; }
.pd-curve .pd-axis { stroke: var(--border-strong, var(--border)); stroke-width: 1; }
.pd-curve .pd-th { stroke-dasharray: 4 3; stroke-width: 1; }
.pd-curve .pd-th.watch { stroke: var(--warning); } .pd-curve .pd-th.over { stroke: var(--error); }
.pd-curve .pd-th-t, .pd-curve .pd-ax-t { font-size: 8px; fill: var(--text-muted); }
.pd-hcase { display: grid; grid-template-columns: auto minmax(90px, 160px) 1fr; gap: 6px; align-items: center; margin-top: 6px; font-size: var(--text-sm); }
.pd-sevstrip { width: 100%; height: 14px; overflow: visible; }
.tm-unit.tm-mini { padding: var(--space-2); }
.tm-unit.tm-mini .tm-cell { min-height: 22px; }
.tm-unit.tm-mini .tm-cell b { font-size: var(--text-sm); }
.tm-unit.tm-mini .tm-cell .tm-n { display: none; }
.pd-tp { display: grid; gap: var(--space-2); }
.pd-hist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--space-2); }

/* the zone's plant health (0.7.175): photos on two thirds, the insect curve and the trap map on the last third */
.pd-hgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: var(--space-4); padding: 0 var(--space-3) var(--space-3); align-items: start; }
@media (max-width: 900px) { .pd-hgrid { grid-template-columns: 1fr; } }
.pd-hphotos { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); padding-top: 0; }
.pd-hnone { padding: var(--space-3) 0; }
.pd-hright { display: grid; gap: var(--space-3); }
.pd-hright > * { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); background: var(--surface-2); }
.pd-zc-head { display: grid; gap: 4px; margin-bottom: 4px; }
.pd-zc-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-zc-big b { font-size: 1.75rem; line-height: 1; }
.pd-zc-big.ok b { color: var(--success); } .pd-zc-big.warn b { color: var(--warning); } .pd-zc-big.bad b { color: var(--error); }
.pd-curve { width: 100%; height: auto; max-height: 190px; display: block; }
.pd-curve .pd-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.pd-curve .pd-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.pd-curve .pd-pt { stroke: var(--surface); stroke-width: 1; fill: var(--accent); }
.pd-curve .pd-pt.warn { fill: var(--warning); } .pd-curve .pd-pt.bad { fill: var(--error); } .pd-curve .pd-pt.ok { fill: var(--success); }
.pd-curve .pd-th-t, .pd-curve .pd-ax-t { font-size: 9px; }
.pd-hmap .tm-unit.tm-mini { border: 0; background: none; padding: 0; box-shadow: none; }
.pd-growth > summary .dot { align-self: center; }

.pd-hmap-facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: var(--text-sm); }
/* the line under Plant health (0.7.176): Growth under the photos, Traps under the map */
.pd-hbottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }   /* Growth, then Traps, full width (0.7.177) */
.pd-hbottom > .pd-sec > summary { flex-wrap: wrap; }
.pd-trapsec .pd-traps { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
/* the AI's opinion on a zone of the latest day, in one line that opens (0.7.176) */
.pd-ai.compact { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-md); background: var(--surface); margin: 0; }
.pd-ai.compact > summary { list-style: none; cursor: pointer; padding: var(--space-2) var(--space-3); display: flex; align-items: center; gap: var(--space-2); flex-wrap: nowrap; }
.pd-ai.compact > summary::-webkit-details-marker { display: none; }
.pd-ai.compact > summary .pd-ai-headline { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.pd-ai.compact[open] > summary .pd-ai-headline { white-space: normal; }
.pd-ai.compact > summary .spacer { flex: 0 0 0; }
.pd-ai.compact > summary .btn { flex: none; }
.pd-ai.compact .pd-ai-body { padding: 0 var(--space-3) var(--space-3); display: grid; gap: var(--space-2); }
.pd-ai .pd-ai-body { display: grid; gap: var(--space-2); }
/* a long line never widens the report (0.7.176): the day and zone bodies are one shrinkable column */
.pd-days, .pd-day-body, .pd-zone-body { min-width: 0; }
.pd-days, .pd-zone-body { grid-template-columns: minmax(0, 1fr); }
.pd-day-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.pd-ai { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.pd-ai.compact { display: block; }
.pd-ai-head > b { white-space: nowrap; flex: none; }

/* ── Feedback (0.7.186, migration 0189): what people on the phone say should change ── */
.fbk-note { margin-bottom: var(--space-4); }
.fbk-chips { margin-bottom: var(--space-4); align-items: center; }
.fbk-sep { width: 1px; height: 18px; background: var(--divider); margin: 0 var(--space-1); }
.fbk-what { max-width: 60ch; }
.fbk-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: 4px; }
.drawer.fbk-drawer { width: min(640px, 100vw); }
.fbk-facts { display: grid; gap: 6px; margin-bottom: var(--space-4); }
.fbk-facts > div { display: grid; grid-template-columns: 104px 1fr; gap: var(--space-2); align-items: baseline; }
.fbk-sec { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.fbk-sec textarea { width: 100%; }
.fbk-summary { margin: 0; font-weight: 600; }
.fbk-points { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.fbk-change { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--accent-soft); font-size: var(--text-sm); }
.fbk-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-muted); }
.fbk-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
.fbk-m.audio, .fbk-m.video { grid-column: 1 / -1; }
.fbk-m audio { width: 100%; }
.fbk-m video { width: 100%; max-height: 360px; border-radius: 8px; background: #000; }
.fbk-m img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: #000; }
.fbk-ai { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.fbk-status { display: flex; gap: var(--space-2); align-items: center; }
.fbk-acts { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* the sump in the scouting report, growth under the photos, a photo's ✕ (0.7.187, 0190) */
.pd-sump.sp-click { cursor: pointer; }
.pd-sump.sp-click:hover, .pd-sump.sp-click:focus-visible { border-color: var(--accent); outline: none; }
.sp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.sp-head .pd-hlabel { margin: 0; }
.sp-head .spacer { flex: 1; }
.sp-temp { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.sp-temp b { font-size: 1.05rem; }
.sp-temp.ok b, .sp-temp.ok .sp-arrow { color: var(--success); } .sp-temp.warn b, .sp-temp.warn .sp-arrow { color: var(--warning); } .sp-temp.bad b, .sp-temp.bad .sp-arrow { color: var(--error); }
.sp-arrow { font-size: var(--text-xs); }
.sp-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 0; }
.sp-row + .sp-row { border-top: 1px solid var(--border); }
.sp-row .sp-fig { flex-wrap: wrap; row-gap: 0; }
.sp-row .sp-fig .sp-name { flex-basis: 100%; }
.sp-row .sp-fig b { font-size: 1.25rem; }
.sp-fig { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.sp-fig .sp-name { font-size: var(--text-xs); color: var(--text-muted); min-width: 34px; }
.sp-fig b { font-size: 1.05rem; line-height: 1.1; }
.sp-fig.big b { font-size: 1.6rem; }
.sp-fig.big { flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.sp-fig.big .spacer { flex: 1; }
.sp-fig.ok b { color: var(--success); } .sp-fig.warn b { color: var(--warning); } .sp-fig.bad b { color: var(--error); }
.sp-curve { width: 100%; height: auto; display: block; overflow: visible; }
.sp-curve.big { height: auto; max-height: 200px; }
.sp-curve .sp-band { fill: color-mix(in srgb, var(--success) 13%, transparent); }
.sp-curve .sp-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sp-curve .sp-pt { fill: var(--accent); stroke: var(--surface); stroke-width: 0.6; }
.sp-curve .sp-pt.ok { fill: var(--success); } .sp-curve .sp-pt.warn { fill: var(--warning); } .sp-curve .sp-pt.bad { fill: var(--error); }
.sp-curve .pd-axis { stroke: var(--border-strong, var(--border)); stroke-width: 1; }
.sp-curve .pd-ax-t { font-size: 8px; fill: var(--text-muted); }
.sp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: var(--text-xs); }
.drawer.sump-drawer { width: min(760px, 100vw); }
.sp-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: var(--space-3); }
.sp-bar .spacer { flex: 1; }
.sp-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); background: var(--surface-2); margin-bottom: var(--space-3); }
.sp-none { margin-bottom: var(--space-3); }
.sp-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.sp-table th { text-align: left; font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.sp-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.sp-table td.num { font-variant-numeric: tabular-nums; }
.sp-table td.warn { color: var(--warning); font-weight: 600; } .sp-table td.bad { color: var(--error); font-weight: 700; }
.sp-form { display: grid; grid-template-columns: minmax(170px, 2fr) repeat(3, minmax(70px, 1fr)); gap: var(--space-2); flex: 1; }
.sp-form input { width: 100%; }
.sump-drawer > footer { align-items: flex-end; gap: var(--space-3); }

.pd-growth { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.pd-growth-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.pd-growth-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.pd-gbox { max-width: 460px; }
.pd-hright > .pd-gcurve:empty { display: none; }
/* the insects a day in one line on top of the trap map (0.7.190) */
.pd-hmap .pd-hcurve { margin: 0 0 var(--space-2); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.pd-ins { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 150px); gap: var(--space-3); align-items: center; cursor: pointer; border-radius: var(--radius-md); }
.pd-ins:hover .pd-hlabel, .pd-ins:focus-visible .pd-hlabel { color: var(--accent); }
.pd-ins:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pd-ins-fig { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.pd-ins-fig .pd-hlabel { margin: 0; flex-basis: 100%; }
.pd-ins-big b { font-size: 1.5rem; line-height: 1; }
.pd-ins-big.ok b { color: var(--success); } .pd-ins-big.warn b { color: var(--warning); } .pd-ins-big.bad b { color: var(--error); }
.pd-ins-svg { max-height: 44px; }
.pd-gsvg { max-height: 170px; }
.pd-gline { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.pd-gpt { stroke: var(--surface); stroke-width: 1; }
.pd-g0 { stroke: var(--accent); } .pd-gpt.pd-g0, .pd-gsw.pd-g0 { fill: var(--accent); background: var(--accent); }
.pd-g1 { stroke: var(--success); } .pd-gpt.pd-g1, .pd-gsw.pd-g1 { fill: var(--success); background: var(--success); }
.pd-g2 { stroke: var(--warning); } .pd-gpt.pd-g2, .pd-gsw.pd-g2 { fill: var(--warning); background: var(--warning); }
.pd-g3 { stroke: var(--text-muted); } .pd-gpt.pd-g3, .pd-gsw.pd-g3 { fill: var(--text-muted); background: var(--text-muted); }
.pd-gpt { stroke: var(--surface) !important; }
.pd-glegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--text-sm); margin-top: 4px; }
.pd-gitem { display: inline-flex; align-items: baseline; gap: 5px; }
.pd-gsw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; align-self: center; }

.sc-fig, .pd-trap { position: relative; }
.pd-x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; line-height: 1; cursor: pointer; color: #fff; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0.75; transition: opacity 0.12s, background 0.12s; z-index: 1; }
.pd-trap .pd-x { top: 9px; right: 9px; }
.pd-x:hover, .pd-x:focus-visible { opacity: 1; background: var(--error); outline: none; }
.pd-removed { display: grid; gap: var(--space-2); }
.pd-removed-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
  padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.pd-removed-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: #000; display: block; }
/* unfiled photos (0.7.223, 0217) — a development-phase window */
.drawer.uf-drawer { width: min(860px, 100vw); }
.uf-h { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-md, 1rem); }
.uf-all { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-md); }
.uf-row { grid-template-columns: 96px minmax(0, 1fr); }
.uf-row img { width: 96px; height: 96px; }
.uf-row.uf-off { opacity: 0.55; }
.uf-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.uf-acts select, .uf-acts input[type=date], .uf-all select { min-height: 30px; }
.uf-wait { color: var(--warning, #c98a1a); }

/* what the AI costs (0.7.192, 0191) */
.ac-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.ac-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.ac-tile .pd-hlabel { margin: 0; }
.ac-tile b { font-size: 1.4rem; line-height: 1.2; }
.ac-bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.ac-bar { flex: 1; min-width: 2px; max-width: 28px; height: 100%; display: flex; align-items: flex-end; }
.ac-bar span { display: block; width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; }
.ac-bar:hover span { background: var(--text); }
.ac-h { margin-top: var(--space-4); }
.ac-foot { margin-top: var(--space-4); }
.sp-table td.num { text-align: right; } .sp-table th:not(:first-child) { text-align: right; }
.set-row.ac-line { border-top: 1px dashed var(--border); }
.set-row.ac-fn { padding-left: var(--space-8, 32px); border-top: 0; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.set-row.ac-fn .set-text b { font-weight: 500; }

/* ── IPM programs (0.7.199, migration 0197): the treatments block of a zone's report, the apply window, the library ── */
.tr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* "updating…" on a day's line while the database is asked (0.7.201) */
.pd-upd { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--text-faint); }
.pd-upd[hidden] { display: none; }
.pd-upd .spin { width: 11px; height: 11px; }
/* a picture whose phone copy has not landed yet (0.7.201) */
img.pd-wait { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-offset) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: pdWait 1.2s linear infinite; min-height: 60px; }
@keyframes pdWait { to { background-position: -200% 0; } }
/* the right column's folds (0.7.200): one line with the KPI, the rest inside */
.pd-fold > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.pd-fold > summary::-webkit-details-marker { display: none; }
.pd-fold > summary::before { content: '▸'; color: var(--text-faint); font-size: 0.75rem; width: 10px; }
.pd-fold[open] > summary::before { content: '▾'; }
.pd-fold[open] > summary { margin-bottom: 6px; }
.pd-fold > summary .pd-hlabel { margin: 0; }
.pd-fold > summary:hover .pd-hlabel { color: var(--accent); }
.tr-kpi { font-weight: 800; font-size: var(--text-sm); padding: 1px 8px; border-radius: var(--radius-full); background: var(--surface-offset); }
.tr-kpi.ok { color: var(--success); background: var(--success-bg); }
.tr-kpi.run, .tr-kpi.warn { color: var(--warning); background: var(--warning-bg); }
.tr-kpi.bad { color: var(--error); background: var(--error-bg); }
.pd-fold-body { display: grid; gap: var(--space-2); }
.tr-head .pd-hlabel { margin: 0; }
.tr-head .spacer, .tr-prog-top .spacer { flex: 1; }
.tr-flag { font-size: var(--text-xs); color: var(--text-faint); }
.tr-flag.on { color: var(--accent); font-weight: 700; }
.tr-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.tr-dow { font-size: 0.625rem; color: var(--text-faint); text-align: center; }
.tr-day { position: relative; min-height: 30px; border-radius: 5px; background: var(--surface); border: 1px solid transparent; padding: 1px 2px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.tr-day.past { opacity: 0.72; }
.tr-day.hold { background: repeating-linear-gradient(135deg, var(--warning-bg) 0 4px, transparent 4px 8px), var(--surface); }
.tr-day.today { border-color: var(--accent); opacity: 1; }
.tr-day.sel { border-color: var(--border-strong); border-style: dashed; }
.tr-num { font-size: 0.5625rem; line-height: 1.1; color: var(--text-faint); white-space: nowrap; }
.tr-marks { display: flex; flex-wrap: wrap; gap: 1px; }
.tr-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; font-size: 0.5625rem; font-weight: 800; line-height: 1; flex: none;
  border: 1.5px solid hsl(var(--h) 70% 55%); color: hsl(var(--h) 75% 68%); background: transparent; }
.tr-mark.done { background: hsl(var(--h) 70% 50%); color: #fff; }
.tr-mark.skipped { border-style: dotted; opacity: 0.55; text-decoration: line-through; }
.tr-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; align-items: center; }
.tr-lg { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); }
.tr-note { margin-top: 6px; padding: 6px 10px; font-size: var(--text-xs); }
.tr-prog { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--divider); }
.tr-prog.off { opacity: 0.6; }
.tr-prog-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--text-sm); }
.drawer.tr-drawer { width: min(860px, 100vw); }
.tr-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); align-items: start; }
.tr-choice { display: grid; gap: 6px; margin-bottom: var(--space-4); max-height: 300px; overflow-y: auto; }
.tr-tpl { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; display: grid; gap: 3px; }
.tr-tpl:hover { border-color: var(--border-strong); }
.tr-tpl.on { border-color: var(--accent); background: var(--accent-soft); }
.tr-tpl-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-tpl-sum { font-size: var(--text-xs); color: var(--text-muted); }
.tr-tables { display: grid; gap: 6px; margin-bottom: var(--space-4); }
.tr-sys { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tr-sysname { font: inherit; font-size: var(--text-xs); font-weight: 700; color: var(--text-muted); background: none; border: 0; cursor: pointer; min-width: 84px; text-align: left; padding: 0; }
.tr-sysname:hover { color: var(--accent); }
.tr-table { font: inherit; font-size: var(--text-xs); cursor: pointer; padding: 3px 9px; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: transparent; color: var(--text-muted); }
.tr-table.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 700; }
.tr-tables-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-preview { display: grid; gap: var(--space-3); }
.tr-preview.stale { opacity: 0.55; }
.tr-filters { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-3); align-items: end; }
.tr-filter { display: grid; gap: 4px; }
.tr-filter select, .tr-filter input { min-height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--field-bg); color: var(--text); padding: 0 10px; font: inherit; font-size: var(--text-sm); }
.tr-count { margin-bottom: 6px; }
.tr-facts { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 6px 14px; margin: 0 0 var(--space-4); font-size: var(--text-sm); }
.tr-facts dt { color: var(--text-muted); font-size: var(--text-xs); padding-top: 2px; }
.tr-facts dd { margin: 0; overflow-wrap: anywhere; }
.tr-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: var(--space-4); font-size: var(--text-sm); }
.tr-links a { color: var(--accent); }

/* a photo or a count added by an extra scouting (0204) */
.pill.pd-extra { background: transparent; border: 1px dashed currentColor; color: var(--text-muted, #9a9aa3); }
