/* Final Sunny theme authority. Loaded after the functional application styles. */
:root {
  --paper:#FAF7F1; --surface:#FFFFFF; --surface-2:#F4F0E8; --surface-3:#EBE5D9;
  --line:#E7E0D3; --line-strong:#D6CCB8; --ink:#241F17; --ink-2:#5B5346; --ink-3:#726957;
  --brand:#1E4D2B; --brand-strong:#16351E; --brand-tint:#E7F0E7; --brand-tint-2:#D6E6D6;
  --accent:#9A5B00; --status-go:#277338; --status-go-bg:#E6F2E9;
  --status-soon:#1C6B9C; --status-soon-bg:#E4EFF6; --status-done:#6B6156; --status-done-bg:#EEE9E0;
  --status-stop:#BC322B; --status-stop-bg:#F9E8E7;
  --ui-canvas:var(--paper); --ui-surface:var(--surface); --ui-surface-muted:var(--surface-2);
  --ui-text:var(--ink); --ui-text-muted:var(--ink-2); --ui-primary:var(--brand); --ui-accent:var(--accent);
  --ui-border:var(--line-strong); --ui-danger:var(--status-stop); --ui-warning:var(--accent);
  --ui-focus:#2D75A7; --ui-radius-sm:8px; --ui-radius-md:12px; --ui-target:2.75rem;
  --forest-950:var(--brand-strong); --forest-900:var(--brand-strong); --forest-800:var(--brand);
  --forest-700:var(--brand); --forest-600:#356444; --leaf-500:#9DCE72; --leaf-100:var(--brand-tint);
  --cream-50:var(--paper); --cream-100:var(--surface-2); --cream-200:var(--line);
  --ink-900:var(--ink); --ink-700:var(--ink-2); --ink-500:var(--ink-3);
  --amber-600:var(--accent); --amber-100:#FFF0D4; --red-700:var(--status-stop); --red-100:var(--status-stop-bg);
  --blue-700:var(--status-soon); --blue-100:var(--status-soon-bg);
  --ink-on-brand:#F4F7F1; --ink-on-brand-2:#B4BFB2; --accent-tint:#FBF0DA;
  --st-go:var(--status-go); --st-go-bg:var(--status-go-bg); --st-soon:var(--status-soon); --st-soon-bg:var(--status-soon-bg);
  --st-done:var(--status-done); --st-done-bg:var(--status-done-bg); --st-stop:var(--status-stop); --st-stop-bg:var(--status-stop-bg);
  --fs-11:.6875rem; --fs-12:.75rem; --fs-13:.8125rem; --fs-14:.875rem; --fs-16:1rem; --fs-18:1.125rem; --fs-22:1.375rem; --fs-28:1.75rem;
  --fw-r:400; --fw-m:500; --fw-sb:600; --fw-b:700; --lh-display:1.2; --lh-title:1.3; --lh-body:1.5; --lh-table:1.45;
  --ls-display:-.02em; --ls-title:-.01em; --ls-caps:.06em; --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  --font-mono:ui-monospace,"Cascadia Mono","SFMono-Regular",Menlo,Consolas,monospace;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px; --s10:40px; --s12:48px;
  --r-xs:5px; --r-sm:8px; --r-md:12px; --r-lg:14px; --r-input:10px; --r-pill:999px;
  --sh-1:0 1px 2px rgba(36,31,23,.04); --sh-2:0 1px 2px rgba(36,31,23,.05),0 4px 12px -4px rgba(36,31,23,.10);
  --sh-3:0 2px 4px rgba(36,31,23,.05),0 12px 28px -8px rgba(36,31,23,.16);
  --ring:0 0 0 2px var(--surface),0 0 0 4px var(--brand); --ring-error:0 0 0 2px var(--surface),0 0 0 4px var(--st-stop);
  --ring-inverse:0 0 0 2px var(--brand-strong),0 0 0 4px rgba(255,255,255,.7);
  --dur-fast:120ms; --dur:180ms; --dur-slow:280ms; --ease:cubic-bezier(.2,.6,.2,1);
  --z-nav:100; --z-sticky:200; --z-dropdown:300; --z-popover:400; --z-toast:500; --z-modal:600; --scrim:rgba(36,31,23,.32);
  --ctl:32px; --row:40px; --box:18px; --chip-h:26px; --tap-field:44px; --fs-base:var(--fs-14); --fs-title:var(--fs-18); --fs-colhead:var(--fs-11); --gutter:var(--s4);
  --shadow-sm:0 1px 2px rgb(36 31 23 / 4%),0 7px 20px rgb(36 31 23 / 7%);
  --shadow-lg:0 24px 70px rgb(22 53 30 / 20%); --radius:16px; --radius-sm:10px;
  color:var(--ink); background:var(--paper); font-family:var(--font);
}

[data-density="worker"],.is-worker,.is-landing { --ctl:48px; --row:56px; --box:22px; --chip-h:32px; --tap-field:60px; --fs-base:var(--fs-16); --fs-title:var(--fs-22); --fs-colhead:var(--fs-12); --gutter:var(--s5); }

/* Enterprise palette, dormant until [data-theme="enterprise"] is set on <html>.
   Only color, radius, and shadow tint differ from Sunny Farm above -- no
   layout, spacing, or component structure changes. Nothing in this app sets
   the attribute yet, so this block has no effect on default rendering. */
[data-theme="enterprise"] {
  --status-go:#0F7A3D; --status-go-bg:#E4F4EA;
  --status-soon:#0A6E93; --status-soon-bg:#E0F1F9;
  --status-done:#5A6472; --status-done-bg:#EBEEF3;
  --status-stop:#C5342E; --status-stop-bg:#FBE8E7;
  --st-go:var(--status-go); --st-go-bg:var(--status-go-bg); --st-soon:var(--status-soon); --st-soon-bg:var(--status-soon-bg);
  --st-done:var(--status-done); --st-done-bg:var(--status-done-bg); --st-stop:var(--status-stop); --st-stop-bg:var(--status-stop-bg);
  --brand:#3F5296; --brand-strong:#2A3560; --accent:#B5138C;
  --forest-950:var(--brand-strong); --forest-900:var(--brand-strong); --forest-800:var(--brand); --forest-700:var(--brand);
  --red-700:var(--status-stop); --red-100:var(--status-stop-bg); --blue-700:var(--status-soon); --blue-100:var(--status-soon-bg);
  --amber-600:var(--accent);
  --r-xs:4px; --r-sm:6px; --r-md:10px; --r-lg:12px; --r-input:8px;
  --sh-1:0 1px 2px rgba(20,26,45,.06); --sh-2:0 1px 2px rgba(20,26,45,.07),0 4px 12px -4px rgba(20,26,45,.14);
  --sh-3:0 2px 4px rgba(20,26,45,.07),0 12px 28px -8px rgba(20,26,45,.22);
  --shadow-sm:0 1px 2px rgb(20 26 45 / 6%),0 7px 20px rgb(20 26 45 / 9%);
  --shadow-lg:0 24px 70px rgb(20 26 45 / 24%);
  --ring:0 0 0 2px var(--surface),0 0 0 4px var(--brand); --ring-error:0 0 0 2px var(--surface),0 0 0 4px var(--st-stop);
  --ring-inverse:0 0 0 2px var(--brand-strong),0 0 0 4px rgba(255,255,255,.7);
}

html,body { background:var(--paper); color:var(--ink); }
body { background-image:none; }
.app-shell { display:block; min-height:100vh; }
.workspace { min-width:0; }
.sidebar,.topbar,.prealpha-note { display:none !important; }

/* The hero surface is --mobile-surface (white) at every width, so its
   foregrounds have to come from the same token set as the title beneath
   them. These were left at the old dark-green-bar whites: the eyebrow
   rendered white-on-white and was invisible at >=720px. */
.manager-hero .brand strong { color:var(--mobile-text); font-size:16px; }
.manager-hero .brand span { color:var(--mobile-muted); font-size:11px; }
.manager-hero .page-heading p,.operations-context p { margin:0 0 3px; color:var(--mobile-muted); font-size:10px; font-weight:750; letter-spacing:.1em; text-transform:uppercase; }
.manager-hero .button,.manager-hero .language-toggle,.manager-hero .sync-status { min-height:40px; color:var(--mobile-text); border:1px solid var(--mobile-line); background:var(--mobile-surface-2); box-shadow:none; }
.manager-hero .button:hover,.manager-hero .language-toggle:hover,.manager-hero .sync-status:hover { background:rgb(255 255 255 / 15%); }
.manager-hero .button-primary { color:var(--mobile-green-on); border-color:var(--mobile-green); background:var(--mobile-green); }
.manager-hero .global-search input { color:var(--ink); }

.manager-shell-nav { width:min(1120px,100%); margin:14px auto 0; display:flex; align-items:center; gap:8px; overflow-x:auto; scrollbar-width:none; }
.manager-shell-nav::-webkit-scrollbar { display:none; }
.manager-shell-nav .nav-item { flex:1 0 max-content; width:auto; min-height:44px; padding:0 22px; display:inline-flex; justify-content:center; gap:7px; color:rgb(255 255 255 / 65%); border:1px solid rgb(255 255 255 / 17%); border-radius:999px; background:rgb(255 255 255 / 7%); box-shadow:none; font-size:13px; font-weight:700; text-align:center; white-space:nowrap; }
.manager-shell-nav .nav-item:hover { color:#fff; background:rgb(255 255 255 / 14%); }
.manager-shell-nav .nav-item.is-active { color:var(--brand-strong); border-color:var(--paper); background:var(--paper); box-shadow:none; }
.manager-shell-nav .nav-badge { min-width:20px; padding:2px 6px; color:var(--brand-strong); background:#fff; }
.manager-shell-nav .nav-item.is-active .nav-badge { color:#fff; background:var(--brand-strong); }

#main-content,.operations-shell { width:min(1120px,calc(100% - 40px)); margin:0 auto; padding:34px 0 56px; }
.view-stack { gap:22px; }
.section-heading { align-items:end; gap:18px; }
.section-heading h2 { color:var(--ink); font-size:clamp(24px,3vw,36px); letter-spacing:-.035em; }
.section-heading p,.panel-header p { color:var(--ink-3); }
.eyebrow { color:var(--ink-3); font-size:10px; letter-spacing:.09em; }

.panel,.kpi,.review-item,.filter-strip,.map-board,.official-map-panel,.location-card,.empty-state { border-color:var(--line); border-radius:14px; background:var(--surface); box-shadow:0 1px 2px rgb(36 31 23 / 4%),0 8px 26px rgb(36 31 23 / 5%); }
.panel-header { min-height:72px; padding:18px 20px; border-color:var(--line); background:var(--surface); }
.panel-header h2,.panel-header h3 { color:var(--ink); }
.panel-body { padding:20px; }
.kpi-grid { gap:14px; }
.kpi { min-height:145px; padding:20px; }
.kpi span,.kpi small { color:var(--ink-3); }
.kpi strong { color:var(--ink); font-size:clamp(28px,3vw,40px); }

.button,.icon-button { min-height:44px; border-radius:10px; font-weight:700; }
.button { padding:9px 15px; font-size:12px; }
.button-primary { color:#fff; background:var(--brand); box-shadow:none; }
.button-primary:hover { background:var(--brand-strong); }
.button-secondary { color:var(--ink); border:1px solid var(--line-strong); background:var(--surface); }
.button-ghost { color:var(--brand); background:transparent; }
.button-danger { color:#fff; background:var(--status-stop); }
.button-small { min-height:36px; padding:7px 11px; }
input,select,textarea,.portal-login input,.portal-login select,.portal-form-grid input,.portal-form-grid select,.portal-form-grid textarea,.admin-stack input { color:var(--ink); border-color:var(--line-strong); border-radius:9px; background:var(--surface); }
label { color:var(--ink-2); }
.data-table th,.role-permission-matrix th { color:var(--ink-3); background:var(--surface-2); }
.data-table th,.data-table td { padding:13px 15px; border-color:var(--line); }
.data-table tbody tr:hover { background:#FCFAF5; }
.badge { border-radius:999px; }
.badge-green,.worker-status { color:var(--status-go); background:var(--status-go-bg); }
.badge-blue { color:var(--status-soon); background:var(--status-soon-bg); }
.badge-red { color:var(--status-stop); background:var(--status-stop-bg); }
.badge-gray { color:var(--status-done); background:var(--status-done-bg); }

.farm-os-portal { color:var(--ink); background:var(--paper); }
.operations-hero { position:relative; }
.operations-shell { max-width:none; }
.operations-shell>header { display:none; }
.farm-os-portal.is-embedded-operations { position:static; inset:auto; z-index:auto; min-height:0; overflow:visible; background:transparent; }
.farm-os-portal.is-embedded-operations>.operations-hero { display:none; }
.farm-os-portal.is-embedded-operations .operations-shell { width:min(1120px,calc(100% - 40px)); margin:0 auto; padding:34px 0 56px; }
.operations-subnav,.operations-shell>nav.operations-subnav { width:100%; margin:0 0 22px; padding:5px; display:flex; gap:3px; overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.operations-subnav button,.operations-shell>nav.operations-subnav button { flex:0 0 auto; min-height:36px; padding:7px 12px; color:var(--ink-3); border:0; border-radius:8px; background:transparent; font-size:11px; font-weight:750; }
.operations-subnav button.is-active,.operations-shell>nav.operations-subnav button.is-active { color:var(--brand-strong); border:0; background:var(--surface); box-shadow:0 1px 4px rgb(36 31 23 / 8%); }

.task-board-stack { gap:18px; }
.task-breadcrumb { display:flex; gap:10px; align-items:center; color:var(--brand); font-size:12px; }
.task-breadcrumb b { color:var(--line-strong); }
.task-breadcrumb strong { color:var(--ink-2); }
.manager-attention { grid-template-columns:minmax(150px,1.2fr) repeat(4,minmax(120px,1fr)); gap:0; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:0 1px 2px rgb(36 31 23 / 4%); }
.manager-attention>header { padding:15px 18px; display:flex; align-items:center; gap:9px; color:var(--ink-3); background:var(--surface-2); text-transform:uppercase; letter-spacing:.06em; }
.manager-attention>header span { min-width:23px; height:23px; padding:0 6px; display:grid; place-items:center; color:#fff; border-radius:999px; background:var(--accent); font-size:11px; }
.manager-attention button { min-height:62px; padding:12px 15px; display:flex; align-items:center; gap:9px; border:0; border-left:1px solid var(--line); border-radius:0; background:var(--surface); }
.manager-attention button:hover { background:#FCFAF5; }
.manager-attention button strong { min-width:24px; height:24px; display:grid; place-items:center; color:var(--brand); border-radius:999px; background:var(--brand-tint); font-size:12px; }
.manager-attention button span { color:var(--ink-2); font-size:11px; font-weight:700; }
.task-projection-controls { padding:0; align-items:center; border:0; background:transparent; }
.task-projection-controls>div { order:3; margin-left:auto; padding:4px; border:1px solid var(--line); border-radius:999px; background:var(--surface-2); }
.task-projection-controls button { min-height:34px; padding:0 14px; color:var(--ink-2); border:0; border-radius:999px; background:transparent; }
.task-projection-controls button.is-active { color:var(--brand-strong); background:var(--surface); box-shadow:0 1px 3px rgb(36 31 23 / 8%); }
.task-projection-controls label { display:inline-flex; align-items:center; gap:7px; color:var(--ink-3); font-size:10px; font-weight:750; }
.task-projection-controls select,.task-projection-controls input { min-height:38px; border:1px solid var(--line-strong); border-radius:9px; background:var(--surface); }
.task-search-field { min-width:250px; }
.task-search-field input { width:100%; }
.assignment-drawer { border-color:var(--line); border-radius:12px; box-shadow:none; }
.assignment-drawer>summary { min-height:54px; padding:12px 16px; background:var(--surface); }
.assignment-drawer>summary strong { color:var(--brand); }
.task-board-heading h2 { color:var(--ink); font-size:24px; }
.task-board-heading p { color:var(--ink-3); }
.task-board-column { padding:9px; border-color:var(--line); border-radius:12px; background:var(--surface-2); }
.task-board-card { border-color:var(--line); border-left-color:var(--brand); border-radius:10px; box-shadow:none; }
.task-list-projection { gap:0; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.task-projection-row { min-height:62px; padding:10px 16px; grid-template-columns:24px 132px minmax(0,1fr) auto; gap:12px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:var(--surface); }
.task-projection-row:last-child { border-bottom:0; }
.task-projection-row time { color:var(--ink-3); font-size:11px; }
.task-projection-row strong { color:var(--ink); font-size:13px; }
.task-projection-row span { color:var(--ink-3); font-size:10px; }
.task-projection-row>.badge { padding:7px 11px; color:var(--status-soon); background:var(--status-soon-bg); }
.task-day-projection>section { padding:0; overflow:hidden; border-color:var(--line); border-radius:14px; }
.task-day-projection>section>header { padding:12px 16px; color:var(--ink-2); background:var(--surface-2); }

.task-ring-cell { width:20px; display:grid; place-items:center; }
.task-status-ring { display:block; overflow:visible; color:var(--st-soon); }
.task-status-ring.is-go { color:var(--st-go); }
.task-status-ring.is-soon { color:var(--st-soon); }
.task-status-ring.is-done { color:var(--st-done); }
.task-status-ring.is-stop { color:var(--st-stop); }
.status-lozenge { min-height:24px; padding:3px 9px; display:inline-flex; align-items:center; gap:6px; justify-self:end; color:var(--ink-2)!important; border-radius:var(--r-pill); background:var(--surface-2); font-size:var(--fs-11)!important; font-weight:var(--fw-sb); white-space:nowrap; }
.status-lozenge i { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:currentColor; }
.status-lozenge.is-go { color:var(--st-go)!important; background:var(--st-go-bg); }
.status-lozenge.is-soon { color:var(--st-soon)!important; background:var(--st-soon-bg); }
.status-lozenge.is-done { color:var(--st-done)!important; background:var(--st-done-bg); }
.status-lozenge.is-stop { color:var(--st-stop)!important; background:var(--st-stop-bg); }
.task-filter-summary { min-height:32px; margin-top:-8px; display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--ink-3); font-size:var(--fs-11); }
.task-filter-summary>[data-task-filter-chips] { display:flex; flex-wrap:wrap; gap:6px; }
.task-filter-chip { min-height:26px; padding:3px 5px 3px 9px; display:inline-flex; align-items:center; gap:5px; color:var(--accent); border:1px solid #E9D7B7; border-radius:var(--r-pill); background:var(--accent-tint); font-size:var(--fs-11); font-weight:var(--fw-sb); }
.task-filter-chip button { width:20px; height:20px; padding:0; display:grid; place-items:center; color:inherit; border:0; border-radius:50%; background:transparent; cursor:pointer; }
.task-filter-chip button:hover { background:rgb(154 91 0 / 10%); }
.task-board-stack[data-current-task-view="list"] .task-board-heading,.task-board-stack[data-current-task-view="day"] .task-board-heading { display:none; }

.team-plan-view { gap:8px; }
.team-plan-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.team-plan-toolbar .button { min-height:36px; padding-inline:11px; font-size:var(--fs-11); }
.team-plan-add { gap:6px; }
.team-plan-add b { font-size:18px; line-height:1; }
.team-plan-zoom { margin:0; }
.team-plan-zoom button { min-height:32px; padding-inline:10px; font-size:var(--fs-11); }
.team-plan-area { min-height:36px; padding:0 9px; display:inline-flex; align-items:center; color:var(--ink-3); border:1px solid var(--line-strong); border-radius:var(--r-input); background:var(--surface); font-size:var(--fs-11); font-weight:var(--fw-sb); }
.team-plan-area select { min-height:34px; padding:0 22px 0 0; border:0; background:transparent; font-weight:var(--fw-sb); }
.team-plan-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.team-plan-kpis article { min-height:68px; padding:10px 14px; display:grid; align-content:center; gap:1px; overflow:hidden; border:0; border-radius:var(--r-sm); background:var(--st-soon); }
.team-plan-kpis article.is-forecast { background:var(--st-go); }
.team-plan-kpis article.is-warning { background:var(--st-done); }
.team-plan-kpis article.is-warning.has-warning { background:var(--st-stop); }
.team-plan-kpis span { color:#fff; opacity:.86; font-size:10px; font-weight:var(--fw-b); letter-spacing:var(--ls-caps); text-transform:uppercase; }
.team-plan-kpis strong,.team-plan-kpis .has-warning strong { color:#fff; font-size:var(--fs-28); line-height:1; }
.team-plan-kpis strong small { margin-left:3px; color:inherit; font-size:10px; font-weight:var(--fw-b); text-transform:uppercase; }
.team-plan-legend { min-height:28px; display:flex; align-items:center; flex-wrap:wrap; gap:5px; color:var(--ink-2); font-size:10px; font-weight:var(--fw-sb); }
.team-plan-legend>span { min-height:24px; padding:3px 7px; display:inline-flex; align-items:center; gap:5px; border-radius:var(--r-pill); background:var(--surface-2); white-space:nowrap; }
.team-plan-legend .status-geometry { width:10px; height:10px; border-width:0; box-shadow:none; }
.status-geometry { width:16px; height:16px; display:inline-block; border:2px solid var(--st-soon); border-radius:50%; }
.status-geometry.is-growing { border-color:var(--st-go); background:conic-gradient(var(--st-go) 0 50%,transparent 50%); }
.status-geometry.is-closed { border-color:var(--st-done); background:var(--st-done); box-shadow:inset 0 0 0 3px var(--paper); }
.status-geometry.is-failed { position:relative; border-color:var(--st-stop); background:var(--st-stop); }
.status-geometry.is-failed::after { content:"!"; position:absolute; inset:-3px 0 0; color:#fff; font-size:10px; font-style:normal; font-weight:800; text-align:center; }

/* Type-to-filter combobox: a text input plus a filtered popover list layered
   over a visually-hidden (not display:none, so it stays part of the form and
   native validation) <select>, which remains the single source of truth for
   the field's value. See enhanceSelectAsCombobox() in app.mjs. */
.cbx { position:relative; }
.cbx select.cbx-native { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.cbx-input { width:100%; min-height:var(--ctl); padding:0 var(--s3); border:1px solid var(--line-strong); border-radius:var(--r-input); background:var(--surface); color:var(--ink); font:inherit; }
.cbx-input:focus { outline:none; box-shadow:var(--ring); border-color:var(--brand); }
.cbx-list { position:absolute; z-index:var(--z-dropdown); left:0; right:0; top:calc(100% + 4px); max-height:240px; margin:0; padding:4px; overflow-y:auto; list-style:none; border:1px solid var(--line-strong); border-radius:var(--r-md); background:var(--surface); box-shadow:var(--sh-2); }
.cbx-list li { padding:8px 10px; border-radius:var(--r-sm); font-size:var(--fs-13); cursor:pointer; }
.cbx-list li.is-active,.cbx-list li:hover { background:var(--brand-tint); }
.cbx-list li.is-current { font-weight:var(--fw-sb); }
.cbx-list li.cbx-empty { color:var(--ink-3); cursor:default; }
.cbx-list li.cbx-empty:hover { background:none; }

.team-planning-board { overflow:hidden; border-radius:var(--r-md); box-shadow:none; }
.team-planning-board .daily-timeline-header { min-height:36px; background:var(--surface-2); }
/* Lane pitch and bar height are one token pair so the row box, the track and
   every bar stay in step. Was 46/44 with a heavy 2px outline, which made a
   four-lane block taller than the screen and read as a wall of colour. */
.team-planning-board { --plan-lane:30px; --plan-bar:26px; }
@media (pointer:coarse) { .team-planning-board { --plan-lane:32px; --plan-bar:28px; } }
.team-planning-board .daily-timeline-row { position:relative; min-height:calc(var(--plan-lanes) * var(--plan-lane) + 10px); isolation:isolate; }
/* The column is an index, not a record: just the block id and a dot when that
   block has something wrong. Area, name and the alert list moved to the popup,
   which is what bought back the width on both a phone and a laptop. */
.team-planning-board .daily-slot-label { z-index:30; width:64px; padding:6px 4px; flex-direction:row; align-items:center; justify-content:center; gap:4px; background:var(--surface); box-shadow:none; isolation:isolate; line-height:1.2; cursor:pointer; }
.team-planning-board .daily-slot-label strong { color:var(--ink); font-size:var(--fs-12); }
.team-planning-board .daily-slot-label:hover { background:var(--surface-2); }
.team-planning-board .daily-slot-label .slot-alert-dot { flex:0 0 auto; width:6px; height:6px; border-radius:50%; background:var(--st-stop); }
.team-planning-board .daily-row-track { z-index:1; min-height:calc(var(--plan-lanes) * var(--plan-lane) + 10px); overflow:clip; contain:paint; isolation:isolate; }
.team-planning-board .daily-drop-cell { background:var(--surface); border-color:var(--line); }
.team-planning-board .daily-drop-cell.is-week-start { border-left:1px solid var(--line-strong); }
.team-planning-board .daily-drop-cell.is-today { background:var(--brand-tint); }
/* The cells remain full-size click targets at every scale. Only the visual
   guides change: days in detail, weeks in month view, months in season view. */
.team-planning-board [data-timeline-zoom="month"] .daily-drop-cell { border-inline-color:transparent; }
.team-planning-board [data-timeline-zoom="month"] .daily-drop-cell.is-week-start { border-left-color:var(--line-strong); }
.team-planning-board [data-timeline-zoom="year"] .daily-drop-cell { border-inline-color:transparent; }
.team-planning-board [data-timeline-zoom="year"] .daily-drop-cell.is-week-start { border-left-color:transparent; }
.team-planning-board [data-timeline-zoom="year"] .daily-drop-cell.is-month-start { border-left-color:var(--line-strong); }
.team-planning-board [data-timeline-zoom="three_year"] .daily-drop-cell { border-color:transparent; }
.team-planning-board [data-timeline-zoom="three_year"] .daily-drop-cell.is-year-start { border-left:2px solid var(--line-strong); }
.team-planning-board [data-timeline-zoom="three_year"] .timeline-year-gridline { border-left-color:var(--line-strong); }
/* Avoid Chromium outline trails while the scroll surface is panned. Pointer
   hover stays visually neutral; keyboard focus gets one contained underline. */
.team-planning-board .daily-drop-cell:hover,
.team-planning-board .daily-drop-cell.is-drag-over { position:static; z-index:auto; outline:0; box-shadow:none; background:var(--surface); }
.team-planning-board .daily-drop-cell:focus-visible { position:relative; z-index:2; outline:0; box-shadow:inset 0 -3px var(--brand); background:var(--brand-tint); }
.team-planning-board .daily-drop-cell.is-today,
.team-planning-board .daily-drop-cell.is-today:hover { background:var(--brand-tint); }
.team-planning-board .daily-timeline-scroll.is-panning .daily-drop-cell { position:static; z-index:auto; outline:0; box-shadow:none; }
/* Crop identity moves to a single saturated left edge; the rest of the bar is a
   quiet tint with a hairline border, so the grid underneath stays legible. */
/* min-height overrides the global 44px button floor. These bars span weeks, so
   the target stays easy to hit horizontally; on coarse pointers the lane pitch
   grows again below rather than relying on width alone. */
.team-planning-board .daily-cycle-bar { top:calc(5px + var(--lane) * var(--plan-lane)); height:var(--plan-bar); min-height:var(--plan-bar); padding:0 9px; display:flex; align-items:center; gap:6px; color:var(--ink); border:1px solid hsl(var(--crop-hue) 48% 40%); border-left:3px solid hsl(var(--crop-hue) 58% 28%); border-radius:var(--r-xs); background:hsl(var(--crop-hue) 52% 90%); box-shadow:none; }
.team-planning-board .daily-cycle-bar:hover { border-color:hsl(var(--crop-hue) 55% 30%); border-left-color:hsl(var(--crop-hue) 62% 22%); background:hsl(var(--crop-hue) 55% 82%); }
.team-planning-board .daily-cycle-bar strong,.team-planning-board .daily-cycle-bar small { min-width:0; max-width:100%; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.team-planning-board .daily-cycle-bar strong { flex:0 1 auto; font-size:var(--fs-11); font-weight:var(--fw-sb); }
.team-planning-board .daily-cycle-bar small { flex:1 2 auto; color:var(--ink-3); font-size:9px; }
/* cycleProblemMarker() is a stub that returns "", so the marker element never
   renders and the padding reserved for it was dead space. A red hairline round
   the bar carries the same signal without competing with the quiet fill. */
.team-planning-board .daily-cycle-bar.has-problem { box-shadow:inset 0 0 0 1px var(--st-stop); }
.team-planning-board .daily-cycle-bar.is-compact small { display:none; }
.team-planning-board .daily-cycle-bar.is-tiny { padding-inline:7px; }
.team-planning-board .daily-cycle-bar.is-tiny small { display:none; }
.team-planning-board .daily-cycle-bar.is-tiny strong { width:100%; font-size:10px; }
.team-planning-board .daily-cycle-bar.is-micro { justify-content:center; padding:0; }
.team-planning-board .daily-cycle-bar.is-micro strong,.team-planning-board .daily-cycle-bar.is-micro small { display:none; }
.team-planning-board .daily-cycle-bar.is-clipped-left { border-top-left-radius:2px; border-bottom-left-radius:2px; }
.team-planning-board .daily-cycle-bar.is-clipped-right { border-top-right-radius:2px; border-bottom-right-radius:2px; }
/* Phase never re-saturates the bar; it would undo the quiet treatment above.
   Border-colour is set per side so the left identity edge keeps its weight. */
.team-planning-board .daily-cycle-bar.phase-growing,.team-planning-board .daily-cycle-bar.phase-harvest,.team-planning-board .daily-cycle-bar.phase-flagged,.team-planning-board .daily-cycle-bar.phase-scheduled,.team-planning-board .daily-cycle-bar.phase-elapsed,.team-planning-board .daily-cycle-bar.phase-review,.team-planning-board .daily-cycle-bar.phase-resting { color:var(--ink); border-block-color:hsl(var(--crop-hue) 48% 40%); border-right-color:hsl(var(--crop-hue) 48% 40%); border-left-color:hsl(var(--crop-hue) 40% 58%); background:hsl(var(--crop-hue) 52% 90%); }
/* A thin status accent on top of the quiet crop-hue treatment above: the left
   edge still carries crop identity by default, but a bar with a live phase
   swaps that one edge to the reserved status hue so status reads at a glance
   without re-saturating the bar (see the comment above this block). */
.team-planning-board .daily-cycle-bar.phase-growing,.team-planning-board .daily-cycle-bar.phase-harvest { border-left-color:var(--st-go); }
.team-planning-board .daily-cycle-bar.phase-flagged { border-left-color:var(--st-stop); }
.team-planning-board .daily-cycle-bar.phase-scheduled,.team-planning-board .daily-cycle-bar.phase-elapsed,.team-planning-board .daily-cycle-bar.phase-review { border-left-color:var(--st-soon); }
.team-planning-board .daily-cycle-bar.phase-resting { border-left-color:var(--st-done); }
.team-planning-board .daily-cycle-bar.phase-closed { border-left-color:var(--st-done); background:var(--surface-2); }
.team-planning-board .daily-cycle-bar.phase-failed { border-left-color:var(--st-stop); background:var(--st-stop-bg); }
.team-planning-board .daily-cycle-bar.is-archived { opacity:.58; border-style:dashed; }
.team-planning-board .daily-cycle-bar:hover,.team-planning-board .daily-cycle-bar:focus-visible { z-index:6; }
/* Zoomed out a bar is a reading mark, not a control: no label, a slim rounded
   line, and a shorter lane so far more of the farm fits on one screen. Day zoom
   keeps the labelled bar above, which is also the only scale that edits. */
.team-planning-board [data-timeline-zoom="week"],
.team-planning-board [data-timeline-zoom="month"],
.team-planning-board [data-timeline-zoom="year"],
.team-planning-board [data-timeline-zoom="three_year"] { --plan-lane:14px; --plan-bar:9px; }
.team-planning-board [data-timeline-zoom="week"] .daily-cycle-bar,
.team-planning-board [data-timeline-zoom="month"] .daily-cycle-bar,
.team-planning-board [data-timeline-zoom="year"] .daily-cycle-bar,
.team-planning-board [data-timeline-zoom="three_year"] .daily-cycle-bar { padding:0; border-radius:var(--r-pill); }
.team-planning-board [data-timeline-zoom="week"] .daily-cycle-bar>strong,
.team-planning-board [data-timeline-zoom="month"] .daily-cycle-bar>strong,
.team-planning-board [data-timeline-zoom="year"] .daily-cycle-bar>strong,
.team-planning-board [data-timeline-zoom="three_year"] .daily-cycle-bar>strong { display:none; }
/* On a 9px line a 1px inset ring covers nearly the whole bar and reads as solid
   red, which is the loudness we just removed. A pale wash carries the same
   signal at this scale; the ring returns at day zoom where the bar is tall. */
.team-planning-board [data-timeline-zoom="week"] .daily-cycle-bar.has-problem,
.team-planning-board [data-timeline-zoom="month"] .daily-cycle-bar.has-problem,
.team-planning-board [data-timeline-zoom="year"] .daily-cycle-bar.has-problem,
.team-planning-board [data-timeline-zoom="three_year"] .daily-cycle-bar.has-problem { box-shadow:none; border-color:var(--st-stop); background:var(--st-stop-bg); }
.team-planning-board .daily-stage-bar,.team-planning-board .daily-cycle-actions { display:none; }
/* The harvest window is the tail of the same cycle, not a separate row, so it
   sits inside the bar's own band and is drawn as a hatch over it. It shares the
   bar's coordinate system already, so it only needs the same lane and hue. */
.team-planning-board .daily-harvest-band {
  top:calc(5px + var(--lane) * var(--plan-lane)); bottom:auto; height:var(--plan-bar);
  border-radius:var(--r-xs); background-color:hsl(var(--crop-hue) 50% 80%);
  background-image:repeating-linear-gradient(135deg, hsl(var(--crop-hue) 60% 30%) 0 2.5px, transparent 2.5px 5.5px);
  box-shadow:inset 0 0 0 1px hsl(var(--crop-hue) 55% 34%); z-index:6;
}
.team-planning-board .daily-harvest-band.is-unstable { background-color:var(--st-stop-bg); background-image:repeating-linear-gradient(135deg, var(--st-stop) 0 2.5px, transparent 2.5px 5.5px); box-shadow:inset 0 0 0 1px var(--st-stop); opacity:1; }
.team-plan-footnote { display:flex; justify-content:space-between; align-items:center; color:var(--ink-3); font-size:var(--fs-11); }

/* Detail for a block or a crop bar, positioned by positionMapHoverCard. Fixed,
   and deliberately not named .map-hover-card — that class is display:none
   !important globally in styles.css. */
.plan-detail-pop {
  position:fixed; z-index:var(--z-popover); width:min(268px,calc(100vw - 24px)); padding:11px 13px;
  color:var(--ink); border:1px solid var(--line-strong); border-radius:var(--r-md);
  background:var(--surface); box-shadow:var(--sh-3); font-size:var(--fs-12);
}
.plan-detail-pop[hidden] { display:none; }
/* Shared quiet back control for panels that are not full dialogs. The popup
   previously had no dismiss at all — the only way out was tapping the exact
   same bar again. Sits over the panel's top-right so it never displaces the
   content it belongs to. */
.panel-back {
  position:absolute; top:6px; right:6px; width:30px; min-width:30px; height:30px; min-height:30px; padding:0;
  display:grid; place-items:center; color:var(--ink-3); border:0; border-radius:9px; background:transparent;
  font-size:22px; line-height:1; cursor:pointer;
}
.panel-back::before { content:"‹"; }
.panel-back:hover { color:var(--ink); background:var(--surface-2); }
.plan-detail-pop { position:fixed; }
.plan-detail-pop .panel-back { position:absolute; }
.plan-detail-pop header { padding-right:30px; }
.plan-detail-pop header { margin-bottom:7px; padding-bottom:6px; display:grid; gap:1px; border-bottom:1px solid var(--line); }
.plan-detail-pop header strong { color:var(--ink); font-size:var(--fs-13); }
.plan-detail-pop header span { color:var(--ink-3); font-size:var(--fs-11); }
.plan-detail-pop ul { margin:0; padding:0; display:grid; gap:4px; list-style:none; }
.plan-detail-pop li { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.plan-detail-pop li span { color:var(--ink-3); font-size:var(--fs-11); }
.plan-detail-pop li b { color:var(--ink); font-size:var(--fs-11); font-weight:var(--fw-sb); text-align:right; }
.plan-detail-pop .plan-detail-alert { margin:7px 0 0; padding-top:6px; border-top:1px solid var(--line); color:var(--st-stop); font-size:var(--fs-11); }

.is-landing .portal-login { min-height:100vh; padding:0; background:var(--paper); }
.portal-entry-shell { width:100%; min-height:100vh; display:block; align-content:normal; }
.portal-entry-header { min-height:56px; padding:8px 20px; color:var(--ink-on-brand); background:var(--brand-strong); }
.portal-entry-header .portal-brand { gap:10px; }
.portal-entry-header .portal-brand>span { width:38px; height:38px; border-radius:10px; color:var(--brand-strong); background:#BBDD9D; box-shadow:none; font-size:12px; }
.portal-entry-header .portal-brand strong { color:var(--ink-on-brand); font-size:15px; }
.portal-entry-header .portal-brand small { margin-top:1px; color:var(--ink-on-brand-2); font-size:10px; }
.portal-language { min-height:38px; padding:3px 9px 3px 4px; gap:7px; color:var(--ink-on-brand); border-color:rgb(255 255 255 / 20%); border-radius:var(--r-pill); background:rgb(255 255 255 / 8%); box-shadow:none; }
.portal-language>span { width:30px; height:30px; color:var(--brand-strong); border-radius:var(--r-pill); background:var(--surface); }
.portal-language>strong { font-size:var(--fs-12); }
.portal-language:hover { color:#fff; border-color:rgb(255 255 255 / 36%); background:rgb(255 255 255 / 14%); }
.portal-login-card,.portal-landing-card { width:min(460px,calc(100% - 32px)); margin:32px auto 0; padding:24px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface); box-shadow:var(--sh-2); }
.portal-landing-card.is-authenticating { width:min(460px,calc(100% - 32px)); margin-inline:auto; }
.portal-entry-copy { max-width:none; }
.portal-entry-copy .eyebrow { margin:0 0 8px; color:var(--accent); font-size:var(--fs-11); }
.portal-entry-copy h1 { margin:0; color:var(--ink); font-size:var(--fs-22); line-height:var(--lh-title); letter-spacing:var(--ls-title); }
.portal-entry-copy>p:last-child { margin:7px 0 0; color:var(--ink-3); font-size:var(--fs-13); line-height:var(--lh-body); }
.portal-brand>span,.portal-choice-grid span { color:#fff; background:var(--brand); }
.portal-brand small,.portal-login-card>p,.portal-choice-grid small,.portal-auth-panel form p { color:var(--ink-3); }
.portal-choice-grid { margin-top:20px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.portal-choice-grid>button { min-height:92px; padding:12px; display:grid; grid-template-columns:30px 1fr; grid-template-rows:auto auto; align-content:center; column-gap:10px; row-gap:2px; border-color:var(--line); border-radius:var(--r-md); color:var(--ink); background:var(--surface); }
.portal-choice-grid>button:last-child:nth-child(odd) { grid-column:1/-1; }
.portal-choice-grid>button::after { content:none; }
.portal-choice-grid>button>span { width:30px; height:30px; grid-row:1/-1; border-radius:9px; font-size:var(--fs-11); }
.portal-choice-grid strong { margin:0; align-self:end; font-size:var(--fs-13); }
.portal-choice-grid small { align-self:start; overflow:hidden; font-size:var(--fs-11); line-height:1.35; }
.portal-choice-grid>button:hover { border-color:var(--brand); background:var(--brand-tint); box-shadow:none; transform:none; }
.portal-auth-panel { width:100%; }
.portal-auth-panel form { margin-top:10px; padding:0; gap:10px; border:0; background:transparent; }
.portal-auth-panel form h2 { margin:0; color:var(--ink); font-size:var(--fs-22); }
.portal-auth-panel form p { margin:0 0 4px; }
.portal-back { margin-bottom:8px; color:var(--brand); }
.portal-pin-input { position:absolute!important; width:1px!important; height:1px!important; min-height:1px!important; padding:0!important; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
/* Shrink to the four dots and centre with auto margins, so the focus ring hugs
   them. As a full-width block the ring drew a card-wide rectangle, and its 6px
   offset overlapped the keypad below. The bottom margin clears the 3px ring at
   its 6px offset. */
.portal-pin-dots { width:fit-content; min-height:26px; margin:0 auto 14px; padding:0 6px; display:flex; justify-content:center; align-items:center; gap:14px; }
.portal-pin-dots i { width:11px; height:11px; border:2px solid var(--line-strong); border-radius:50%; background:var(--surface); }
.portal-pin-dots i.is-filled { border-color:var(--brand); background:var(--brand); }
.portal-auth-panel form.is-pin-submitting .portal-pin-dots { opacity:.55; }
.portal-auth-panel form.is-pin-error .portal-pin-dots { animation:pin-reject 320ms ease; }
@keyframes pin-reject { 25% { transform:translateX(-7px); } 50% { transform:translateX(6px); } 75% { transform:translateX(-3px); } }
.portal-auth-panel label:focus-within .portal-pin-dots { outline:3px solid var(--ui-focus); outline-offset:6px; border-radius:var(--r-sm); }
.portal-pin-pad { width:240px; margin:0 auto 4px; display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.portal-pin-pad button { min-height:48px; color:var(--ink); border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); box-shadow:var(--sh-1); font-size:var(--fs-18); font-weight:var(--fw-sb); cursor:pointer; }
.portal-pin-pad button:hover { border-color:var(--brand); background:var(--brand-tint); }
.portal-entry-footer { width:min(460px,calc(100% - 32px)); margin:16px auto 0; padding:0 4px; color:var(--ink-3); font-size:var(--fs-11); }
.portal-entry-footer span { color:var(--ink-2); }
.demo-access { padding:7px 9px; border-radius:var(--r-sm); color:var(--accent); background:var(--accent-tint); font-size:var(--fs-11); }
.worker-app { color:var(--ink); background:var(--paper); }
.worker-app-header { color:#fff; background:var(--brand-strong); }
.worker-report-form input,.worker-report-form select,.worker-report-form textarea { min-height:52px; border-color:var(--line-strong); }
.worker-checklist label,.worker-choice-row label { min-height:56px; border-color:var(--line); }
.dialog { color:var(--ink); border-radius:16px; background:var(--surface); box-shadow:var(--shadow-lg); }
.dialog::backdrop { background:rgb(22 53 30 / 62%); }
.dialog-header,.dialog-footer { border-color:var(--line); background:var(--surface); }

/* Existing plans use a compact, summary-first record instead of opening on a wall of fields. */
.team-plan-summary { display:grid; gap:16px; padding:20px; border:1px solid var(--line); border-radius:20px; background:var(--surface); box-shadow:0 14px 35px rgb(36 31 23 / 8%); }
.team-plan-summary-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; }
.team-plan-summary-head h3,.team-plan-summary-head p { margin:0; }
.team-plan-summary-head h3 { font-size:22px; line-height:1.2; }
.team-plan-summary-head>div:nth-child(2)>span { display:block; margin-top:4px; color:var(--ink-3); }
.team-plan-status-geometry { position:relative; width:46px; height:46px; border-radius:14px; background:var(--brand-tint); }
.team-plan-status-geometry i { position:absolute; inset:12px; border:2px solid var(--brand); border-radius:50%; }
.team-plan-status-geometry i:nth-child(2) { inset:17px; }
.team-plan-status-geometry i:nth-child(3) { inset:21px; background:var(--brand); }
.team-plan-summary-badges,.team-plan-summary-actions { display:flex; flex-wrap:wrap; gap:8px; }
.team-plan-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-block:1px solid var(--line); }
.team-plan-facts dl,.team-plan-forecast dl { margin:0; padding:14px; }
.team-plan-facts dl+dl { border-left:1px solid var(--line); }
.team-plan-facts dt,.team-plan-forecast dt,.team-plan-forecast span { color:var(--ink-3); font-size:11px; font-weight:var(--fw-b); letter-spacing:.04em; text-transform:uppercase; }
.team-plan-facts dd,.team-plan-forecast dd { margin:5px 0 0; color:var(--ink); font-weight:var(--fw-sb); }
.team-plan-forecast { display:grid; grid-template-columns:minmax(180px,1.2fr) 1fr 1fr; align-items:center; overflow:hidden; border-radius:14px; background:var(--paper-2); }
.team-plan-forecast>div { display:grid; gap:4px; padding:14px; }
.team-plan-forecast>div strong { font-size:24px; }
.cycle-form-layout.is-existing-cycle:not(.is-editing)>.cycle-form-card,.cycle-form-layout.is-existing-cycle:not(.is-editing)>.cycle-management-card,.cycle-form-layout.is-existing-cycle:not(.is-editing)>.checkbox-field { display:none; }
.cycle-form-layout.is-existing-cycle.is-editing .team-plan-summary { box-shadow:none; }
.cycle-form-layout.is-existing-cycle.is-editing .team-plan-summary-actions [data-action="show-cycle-editor"] { display:none; }
.dialog:has(.cycle-form-layout.is-existing-cycle:not(.is-editing)) .dialog-footer [type="submit"] { display:none; }
.team-area-registry { padding:0; overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--surface); }
.team-area-registry>header { display:flex; justify-content:space-between; align-items:end; gap:20px; padding:20px 22px; border-bottom:1px solid var(--line); }
.team-area-registry>header h2,.team-area-registry>header p { margin:0; }
.team-area-registry>header>span { color:var(--ink-3); font-size:13px; }
.team-area-registry .map-section { padding:0; }
.team-area-registry .map-section>h3 { margin:0; padding:10px 22px; color:var(--ink-3); border-bottom:1px solid var(--line); background:var(--paper-2); font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.team-area-list { display:grid; }
.team-area-accordion { border-bottom:1px solid var(--line); background:var(--surface); }
.team-area-accordion:last-child { border-bottom:0; }
.team-area-accordion>summary { min-height:66px; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:18px; padding:10px 22px; list-style:none; cursor:pointer; }
.team-area-accordion>summary::-webkit-details-marker { display:none; }
.team-area-accordion>summary::after { content:"+"; grid-column:3; width:28px; height:28px; display:grid; place-items:center; color:var(--brand); border:1px solid var(--line-strong); border-radius:50%; font-weight:var(--fw-b); }
.team-area-accordion[open]>summary::after { content:"−"; }
.team-area-accordion>summary>div { position:relative; min-width:0; display:grid; gap:3px; }
.team-area-accordion>summary>div:has(>.problem-marker),.team-area-plan-row>div:has(>.problem-marker) { padding-left:28px; }
.team-area-accordion>summary>div>.problem-marker,.team-area-plan-row>div>.problem-marker { left:0; top:50%; width:20px; height:20px; display:grid; place-items:center; transform:translateY(-50%); color:#fff; border:2px solid var(--surface); border-radius:50%; background:var(--st-stop); box-shadow:var(--sh-1); font-size:13px; line-height:1; }
.team-area-accordion>summary strong,.team-area-accordion>summary small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.team-area-accordion>summary small { color:var(--ink-3); }
.team-area-summary-pills { display:flex; flex-wrap:wrap; justify-content:end; gap:7px; }
.team-area-accordion-body { padding:0 22px 16px 42px; background:var(--paper); }
.team-area-plan-row { min-height:58px; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:14px; padding:9px 12px; border-bottom:1px solid var(--line); }
.team-area-plan-row>div { position:relative; min-width:0; display:grid; gap:2px; }
.team-area-plan-row small { color:var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.team-area-accordion-body footer { display:flex; justify-content:flex-end; gap:8px; padding-top:12px; }
.team-area-empty { min-height:66px; display:grid; align-content:center; gap:2px; color:var(--ink-3); }
.team-area-empty strong { color:var(--brand); }
.panel-accordion>summary { min-height:62px; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:16px; padding:15px 18px; list-style:none; cursor:pointer; }
.panel-accordion[open]>summary { border-bottom:1px solid var(--line); }
.panel-accordion>summary::-webkit-details-marker { display:none; }
.panel-accordion>summary::after { content:"+"; grid-column:3; width:28px; height:28px; display:grid; place-items:center; color:var(--brand); border:1px solid var(--line-strong); border-radius:50%; font-weight:var(--fw-b); }
.panel-accordion[open]>summary::after { content:"−"; }
.panel-accordion>summary>div { min-width:0; }
.panel-accordion>summary h3 { margin:0; font-size:15px; }
.panel-accordion>summary p { margin:3px 0 0; color:var(--ink-3); font-size:10px; }
.panel-summary-pills { display:flex; flex-wrap:wrap; justify-content:end; gap:7px; }
.panel-accordion-footer { display:flex; justify-content:flex-end; padding-top:14px; }

@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.001ms!important; transition-duration:.001ms!important; } }
@media (max-width:980px) {
  .manager-attention { grid-template-columns:repeat(4,1fr); }
  .manager-attention>header { grid-column:1/-1; }
  .manager-attention button:first-of-type { border-left:0; }
}
@media (max-width:720px) {
  .team-plan-summary-head { grid-template-columns:auto minmax(0,1fr); }
  .team-plan-summary-badges { grid-column:1/-1; }
  .team-plan-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .team-plan-facts dl:nth-child(3) { border-left:0; border-top:1px solid var(--line); }
  .team-plan-facts dl:nth-child(4) { border-top:1px solid var(--line); }
  .team-plan-forecast { grid-template-columns:1fr; }
  .team-area-registry>header { align-items:start; flex-direction:column; }
  .team-area-accordion>summary { grid-template-columns:minmax(0,1fr) auto; padding-inline:14px; }
  .team-area-accordion>summary::after { grid-column:2; grid-row:1; }
  .team-area-summary-pills { grid-column:1/-1; justify-content:start; }
  .panel-accordion>summary { grid-template-columns:minmax(0,1fr) auto; padding-inline:14px; }
  .panel-accordion>summary::after { grid-column:2; grid-row:1; }
  .panel-summary-pills { grid-column:1/-1; justify-content:start; }
  .team-area-accordion-body { padding:0 12px 14px; }
  .team-area-plan-row { grid-template-columns:minmax(0,1fr) auto; }
  .team-area-plan-row>.button { grid-column:1/-1; }
  .manager-shell-nav { margin-top:11px; gap:6px; }
  .manager-shell-nav .nav-item { flex:0 0 auto; min-height:44px; padding:0 18px; }
  #main-content,.operations-shell { width:calc(100% - 24px); padding:22px 0 42px; }
  .section-heading,.task-board-heading { align-items:stretch; flex-direction:column; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .kpi { min-height:120px; padding:16px; }
  .manager-attention { grid-template-columns:repeat(2,1fr); }
  .manager-attention>header { grid-column:1/-1; }
  .manager-attention button { border-top:1px solid var(--line); }
  .manager-attention button:nth-of-type(odd) { border-left:0; }
  .task-projection-controls { align-items:stretch; }
  .task-projection-controls>div { order:0; width:100%; margin:0; }
  .task-projection-controls>div button { flex:1; }
  .task-projection-controls label,.task-search-field { width:100%; min-width:0; }
  .task-projection-controls select,.task-projection-controls input { flex:1; width:100%; }
  .task-projection-row { grid-template-columns:1fr auto; padding:13px; }
  .task-projection-row time { grid-column:1/-1; }
  .dialog { width:calc(100% - 12px); max-height:calc(100dvh - 12px); }
  .farm-os-portal.is-embedded-operations .operations-shell { width:calc(100% - 24px); padding:22px 0 42px; }
  #main-content:has(.team-plan-view) { width:calc(100% - 16px); padding-top:10px; }
  .team-plan-view { gap:6px; }
  .team-plan-toolbar { display:grid; grid-template-columns:auto auto minmax(88px,1fr) auto auto; gap:5px; }
  .team-plan-toolbar>* { min-width:0; }
  .team-plan-add { order:1; width:36px; padding:0; justify-content:center; }
  .team-plan-add span { display:none; }
  .team-plan-today { order:2; }
  .team-plan-area { order:3; }
  .team-plan-area select { width:100%; }
  .team-plan-toolbar [data-action="toggle-plan-archive"] { order:4; }
  .team-plan-toolbar [data-action="add-slot"] { order:5; }
  .team-plan-toolbar .team-plan-zoom { order:6; grid-column:1/-1; display:grid; grid-template-columns:repeat(3,1fr); }
  .team-plan-toolbar .team-plan-zoom button { width:100%; min-height:30px; }
  .team-plan-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  .team-plan-kpis article,.team-plan-kpis article:first-child { min-height:56px; padding:7px 9px; border:0; }
  .team-plan-kpis span { font-size:8px; letter-spacing:.04em; }
  .team-plan-kpis strong,.team-plan-kpis .has-warning strong { font-size:22px; }
  .team-plan-kpis strong small { font-size:8px; }
  .team-plan-legend { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
  .team-plan-legend>span { min-width:0; justify-content:center; padding-inline:4px; }
  .team-planning-board .daily-timeline-header,.team-planning-board .daily-timeline-row { grid-template-columns:72px max-content; }
  .team-planning-board .daily-slot-label { width:52px; padding:5px 3px; gap:3px; }
  .team-planning-board .daily-slot-label strong { font-size:11px; }
  .team-plan-footnote { align-items:center; flex-direction:row; gap:6px; font-size:9px; }
  .team-plan-footnote .button { min-height:30px; margin-left:auto; padding:3px 8px; font-size:9px; }
}
@media (max-width:430px) {
  .kpi-grid { grid-template-columns:1fr; }
  .manager-attention { grid-template-columns:1fr; }
  .manager-attention>header { grid-column:1; }
  .manager-attention button { border-left:0; }
}

/* ------------------------------------------------------------------
   Integration fixes — layered after the ported team theme.
   1. Demo banner must stay above the fixed portal overlay.
   2. The injected session/logout control must not widen the page.
   ------------------------------------------------------------------ */

/* The portal overlay is position:fixed; inset:0; z-index:1000, so an in-flow
   banner was painted underneath it on the landing, login, and worker screens.
   Sticky keeps the banner in normal flow for the manager shell while letting
   it paint above the overlay everywhere else. */
.vercel-demo-banner {
  position:sticky; top:0; z-index:1200;
  text-align:center; text-wrap:balance;
}
body.has-demo-banner .farm-os-portal { padding-top:var(--demo-banner-offset,38px); }
body.has-demo-banner .farm-os-portal.is-embedded-operations { padding-top:0; }



/* Public preview is an intended mode, so it reads as informational (brand tint)
   rather than as the amber caution used for a dropped LAN connection. */
.repository-status.is-preview .status-dot,
.sync-status.is-preview .status-dot { background:var(--leaf-500); box-shadow:0 0 0 4px rgb(157 206 114 / 20%); animation:none; }
.manager-hero .sync-status.is-preview { border-color:var(--mobile-line); background:var(--mobile-surface-2); }

/* Interaction targets on the login surfaces. UI_STANDARD_V2 gates on a 44px
   minimum, and these two sat just under it. */
.portal-language { min-height:var(--ui-target); }
.skip-link { min-height:var(--ui-target); display:inline-flex; align-items:center; }

/* Claim the two-finger pinch for timeline zoom. Without this the browser takes
   it as a page zoom, so nothing reaches the gesture handlers. One-finger pan
   and scroll are still handled natively. */
.daily-timeline-scroll { touch-action:pan-x pan-y; }

/* Manager staff directory: the protected account register stays in
   Administration; this surface is deliberately limited to operational
   visibility and availability updates. */
.staff-directory-stack { display:grid; gap:16px; }
.staff-directory-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; }
.staff-directory-heading>div:first-child { max-width:680px; }
.staff-directory-heading h2 { margin:2px 0 6px; color:var(--ink); font-size:var(--fs-28); }
.staff-directory-heading p:last-child { margin:0; color:var(--ink-3); line-height:1.55; }
.staff-directory-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-block:1px solid var(--line); }
.staff-directory-kpis article { min-height:74px; padding:12px 20px; display:grid; align-content:center; gap:2px; border-right:1px solid var(--line); }
.staff-directory-kpis article:first-child { padding-left:0; }
.staff-directory-kpis article:last-child { border-right:0; }
.staff-directory-kpis strong { color:var(--ink); font-size:var(--fs-28); line-height:1; }
.staff-directory-kpis span { color:var(--ink-3); font-size:var(--fs-11); font-weight:var(--fw-sb); letter-spacing:var(--ls-caps); text-transform:uppercase; }
.staff-filter-bar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:8px; }
.staff-filter-bar label { min-width:170px; display:grid; gap:5px; color:var(--ink-3); font-size:var(--fs-11); font-weight:var(--fw-sb); }
.staff-filter-bar label:first-child { min-width:240px; flex:1 1 260px; }
.staff-filter-bar input,.staff-filter-bar select { min-height:40px; padding:0 11px; border:1px solid var(--line-strong); border-radius:var(--r-input); background:var(--surface); color:var(--ink); font:inherit; }
.staff-filter-bar input:focus,.staff-filter-bar select:focus { outline:none; border-color:var(--brand); box-shadow:var(--ring); }
.staff-result-count { margin-left:auto; padding-bottom:11px; color:var(--ink-3); font-size:var(--fs-11); font-weight:var(--fw-sb); text-transform:uppercase; }
.staff-directory-panel { overflow:hidden; box-shadow:none; }
.staff-table-wrap { width:100%; overflow:auto; }
.staff-directory-table { width:100%; min-width:1040px; border-collapse:collapse; }
.staff-directory-table th { padding:11px 12px; color:var(--ink-3); border-bottom:1px solid var(--line-strong); background:var(--surface-2); font-size:10px; font-weight:var(--fw-sb); letter-spacing:var(--ls-caps); text-align:left; text-transform:uppercase; white-space:nowrap; }
.staff-directory-table td { padding:12px; color:var(--ink-2); border-bottom:1px solid var(--line); font-size:var(--fs-12); vertical-align:middle; }
.staff-directory-table tbody tr:last-child td { border-bottom:0; }
.staff-directory-table tbody tr:hover { background:var(--brand-tint); }
.staff-directory-table td>small,.staff-name-cell small,.staff-assignment-cell small { margin-top:3px; display:block; color:var(--ink-3); font-size:10px; }
.staff-name-cell strong { color:var(--ink); font-size:var(--fs-13); }
.staff-assignment-cell>strong { min-width:25px; display:inline-grid; place-items:center; padding:2px 7px; border-radius:var(--r-pill); background:var(--surface-2); color:var(--ink); }
.staff-credential { display:inline-flex; padding:3px 8px; border-radius:var(--r-pill); background:var(--surface-2); color:var(--ink-3); font-size:10px; font-weight:var(--fw-sb); white-space:nowrap; }
.staff-credential.is-missing { color:var(--st-stop); background:var(--st-stop-bg); }
.staff-status { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:var(--r-pill); color:var(--ink-2); background:var(--surface-2); font-size:10px; font-weight:var(--fw-sb); white-space:nowrap; }
.staff-status i { width:7px; height:7px; border-radius:50%; background:var(--ink-3); }
.staff-status.is-available { color:var(--st-go); background:var(--st-go-bg); }
.staff-status.is-available i { background:var(--st-go); }
.staff-status.is-assigned { color:var(--brand); background:var(--brand-tint); }
.staff-status.is-assigned i { background:var(--brand); }
.staff-status.is-away { color:var(--st-soon); background:var(--st-soon-bg); }
.staff-status.is-away i { background:var(--st-soon); }
.staff-status.is-inactive { color:var(--st-stop); background:var(--st-stop-bg); }
.staff-status.is-inactive i { background:var(--st-stop); }
.staff-row-action { display:flex; align-items:center; gap:6px; }
.staff-row-action select { min-width:118px; min-height:34px; padding:0 26px 0 8px; border:1px solid var(--line-strong); border-radius:var(--r-input); background-color:var(--surface); font-size:10px; }

@media (max-width:760px) {
  .staff-directory-heading { align-items:stretch; flex-direction:column; }
  .staff-directory-heading .toolbar { width:100%; }
  .staff-directory-heading .toolbar .button { flex:1 1 auto; }
  .staff-directory-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .staff-directory-kpis article:nth-child(2) { border-right:0; }
  .staff-directory-kpis article:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .staff-directory-kpis article:nth-child(3) { padding-left:0; }
  .staff-filter-bar label,.staff-filter-bar label:first-child { min-width:100%; flex-basis:100%; }
  .staff-result-count { margin-left:0; }
}
.team-plan-gesture-hint { flex:1 1 auto; color:var(--ink-3); font-size:var(--fs-11); text-align:center; }
@media (max-width:720px) { .team-plan-gesture-hint { flex-basis:100%; text-align:left; } }

/* ==================================================================
   MANAGER HERO — single authoritative model.
   Replaces ten competing breakpoints (1320/1180/1100/1050/980/900/
   760/720/620/430) that had accumulated across two files with no
   priority order. Three tiers, one token block, one row at every
   width. Applies to both .manager-hero and .operations-hero.
   ================================================================== */

.manager-hero {
  --hero-pad-y:14px; --hero-pad-x:24px;
  --hero-mark:44px; --hero-title:24px; --hero-ctl:40px; --hero-gap:8px;
  position:relative; z-index:30; width:100%;
  /* The bar was dark green with white text. The mobile shell repaints it to
     --mobile-surface at every width, so the base state says so too rather than
     leaving a dark-bar default that only survives because a later rule wins. */
  padding:var(--hero-pad-y) var(--hero-pad-x); color:var(--mobile-text); background:var(--mobile-surface);
}
.manager-hero-row {
  width:min(1120px,100%); margin:0 auto; min-width:0;
  display:flex; align-items:center; gap:16px; flex-wrap:nowrap;
}

/* Identity ------------------------------------------------------- */
.manager-hero .brand { flex:0 0 auto; min-width:0; padding:0; border:0; gap:10px; }
.manager-hero .brand-mark {
  width:var(--hero-mark); height:var(--hero-mark); flex:0 0 auto;
  border-radius:12px; color:var(--brand-strong); background:#BBDD9D;
}
.manager-hero .brand > div { min-width:0; }

/* Page heading --------------------------------------------------- */
.manager-hero .page-heading,.operations-context { min-width:0; margin-right:auto; }
.manager-hero .page-heading h1,.operations-context h1 {
  margin:0; color:var(--mobile-text); font-size:var(--hero-title); letter-spacing:-.03em;
  overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}

/* Actions — never more than four, never wraps --------------------- */
.manager-hero .top-actions {
  flex:0 0 auto; margin-left:auto; min-width:0;
  display:flex; align-items:center; gap:var(--hero-gap); flex-wrap:nowrap;
}
.manager-hero .button,.manager-hero .language-toggle,.manager-hero .sync-status {
  min-height:var(--hero-ctl); color:var(--mobile-text);
  border:1px solid var(--mobile-line); background:var(--mobile-surface-2); box-shadow:none;
}
.manager-hero .button:hover,.manager-hero .sync-status:hover { background:var(--mobile-surface-2); }
.manager-hero .button-primary { color:var(--mobile-green-on); border-color:var(--mobile-green); background:var(--mobile-green); }
.manager-hero .top-actions > * { flex:0 0 auto; }

/* Search — the input stays in the DOM at every width. It used to be
   display:none below 1050px with no other route to search. */
.hero-search { position:relative; display:flex; align-items:center; min-width:0; }
.hero-search-toggle {
  width:var(--hero-ctl); height:var(--hero-ctl); min-height:var(--hero-ctl); padding:0;
  display:none; place-items:center; color:var(--mobile-text);
  border:1px solid var(--mobile-line); border-radius:10px; background:var(--mobile-surface-2);
}
.hero-search-toggle:hover { background:var(--mobile-surface-2); }
.hero-search-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; }
.manager-hero .global-search {
  width:clamp(180px,20vw,260px); height:var(--hero-ctl); padding:0 12px; gap:8px;
  display:flex; align-items:center; color:var(--mobile-text);
  border:1px solid var(--mobile-line); border-radius:10px; background:var(--mobile-surface); box-shadow:none;
}
.manager-hero .global-search svg { width:17px; height:17px; flex:0 0 auto; fill:none; stroke:var(--ink-3); stroke-width:1.9; stroke-linecap:round; }
.manager-hero .global-search input { min-height:auto; color:var(--ink); font-size:var(--fs-13); background:transparent; border:0; }

/* Status — a dot, not a 170px pill. It is information, not an action,
   and the full text lives in title/aria-label. */
.manager-hero .sync-status {
  width:var(--hero-ctl); min-width:var(--hero-ctl); height:var(--hero-ctl);
  padding:0; display:inline-flex; justify-content:center; align-items:center; border-radius:50%;
}
.manager-hero .sync-status .sync-status-text { display:none; }
.manager-hero .sync-status .status-dot { width:9px; height:9px; }

/* Account menu — holds language, backup and log out, so they have a
   stable home instead of vanishing at arbitrary widths. */
.hero-account { position:relative; flex:0 0 auto; }
.hero-account-button {
  min-height:var(--hero-ctl); height:var(--hero-ctl); padding:0 8px 0 5px; gap:5px;
  display:inline-flex; align-items:center; color:var(--mobile-text);
  border:1px solid var(--mobile-line); border-radius:999px; background:var(--mobile-surface-2);
}
.hero-account-button:hover,.hero-account-button[aria-expanded="true"] { background:var(--mobile-green-soft); }
.hero-account-initials {
  width:30px; height:30px; display:grid; place-items:center; border-radius:50%;
  color:var(--brand-strong); background:#BBDD9D;
  font-size:var(--fs-11); font-weight:var(--fw-b); letter-spacing:.02em;
}
.hero-account-caret { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; opacity:.8; }
.hero-account-menu {
  position:absolute; z-index:var(--z-dropdown); top:calc(100% + 8px); right:0;
  min-width:232px; padding:6px; display:grid; gap:2px;
  color:var(--ink); border:1px solid var(--line); border-radius:var(--r-md);
  background:var(--surface); box-shadow:var(--sh-3);
}
.hero-account-menu[hidden] { display:none; }
.hero-account-name {
  margin:0; padding:8px 10px 6px; color:var(--ink-3);
  font-size:var(--fs-11); font-weight:var(--fw-sb); letter-spacing:var(--ls-caps); text-transform:uppercase;
}
.hero-menu-row {
  min-height:var(--ui-target); padding:0 6px 0 10px;
  display:flex; align-items:center; justify-content:space-between; gap:10px; border-radius:var(--r-sm);
}
.hero-menu-label { color:var(--ink); font-size:var(--fs-13); font-weight:var(--fw-m); }
.hero-menu-row .language-toggle {
  min-width:52px; min-height:34px; padding:0 12px; color:var(--brand-strong);
  border:1px solid var(--line-strong); border-radius:var(--r-pill); background:var(--surface-2);
  font-size:var(--fs-11); font-weight:var(--fw-b); letter-spacing:.06em;
}
.hero-menu-row .language-toggle:hover { border-color:var(--brand); background:var(--brand-tint); }
.hero-account-menu .hero-menu-item,
.hero-account-menu [data-portal-logout] {
  width:100%; min-height:var(--ui-target); padding:0 10px;
  display:flex; align-items:center; justify-content:flex-start;
  color:var(--ink); border:0; border-radius:var(--r-sm); background:transparent; box-shadow:none;
  font-size:var(--fs-13); font-weight:var(--fw-m); text-align:left;
}
.hero-account-menu .hero-menu-item:hover,
.hero-account-menu [data-portal-logout]:hover { background:var(--surface-2); }
.hero-account-menu [data-portal-logout] { color:var(--st-stop); }
.hero-account-menu [data-portal-logout] .portal-session-name { display:none; }

/* Tier 1 — full (>=1024px): search open, wordmark visible ---------- */
@media (min-width:1024px) {
  .manager-hero .brand strong { color:var(--mobile-text); font-size:15px; }
  .manager-hero .brand span { color:var(--mobile-muted); font-size:11px; }
}

/* Tier 2 — medium (720-1023px): search collapses to an icon -------- */
@media (max-width:1023px) {
  .manager-hero .brand > div { display:none; }
  .hero-search-toggle { display:grid; }
  .manager-hero .global-search { display:none; }
  /* Anchored to the hero, not to the toggle: the toggle sits near the right
     edge, so a panel positioned against it ran off the left of the screen. */
  .hero-search { position:static; }
  .manager-hero.is-searching .global-search {
    position:absolute; z-index:var(--z-dropdown); top:calc(100% - 6px);
    right:var(--hero-pad-x); left:auto;
    width:min(340px,calc(100% - (var(--hero-pad-x) * 2)));
    display:flex; box-shadow:var(--sh-3);
  }
}

/* Tier 3 — compact (<720px): icon-only primary, 44px targets ------- */
@media (max-width:719px) {
  .manager-hero { --hero-pad-x:12px; --hero-mark:38px; --hero-title:19px; --hero-ctl:var(--ui-target); --hero-gap:6px; }
  .manager-hero-row { gap:10px; }
  .manager-hero .page-heading p,.operations-context p { display:none; }
  .manager-hero .top-actions > .button-primary {
    width:var(--ui-target); min-width:var(--ui-target); padding:0;
    justify-content:center; overflow:hidden; font-size:0;
  }
  .manager-hero .top-actions > .button-primary::after { content:"+"; font-size:26px; font-weight:400; line-height:1; }
  .hero-account-button { padding:0 6px 0 4px; }
  .hero-account-initials { width:30px; height:30px; }
  .hero-account-menu { width:min(280px,calc(100vw - 24px)); }
  .manager-hero.is-searching .global-search { left:var(--hero-pad-x); right:var(--hero-pad-x); width:auto; }
}

/* Weather — Today view. Rain probability is the number that drives irrigation,
   spray and harvest calls, so it gets its own emphasis rather than a footnote. */
.weather-card { padding:16px 18px; display:grid; gap:14px; }
.weather-card[hidden] { display:none; }
.weather-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.weather-card-head h3 { margin:2px 0 0; color:var(--ink); font-size:var(--fs-16); }
.weather-card-head small { color:var(--ink-3); font-size:var(--fs-11); white-space:nowrap; }
.weather-days { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.weather-day {
  padding:12px 10px; display:grid; justify-items:center; gap:4px; text-align:center;
  border:1px solid var(--line); border-radius:var(--r-md); background:var(--surface-2);
}
.weather-day.is-today { border-color:var(--brand-tint-2); background:var(--brand-tint); }
.weather-day-name { color:var(--ink-3); font-size:var(--fs-11); font-weight:var(--fw-sb); letter-spacing:var(--ls-caps); text-transform:uppercase; }
.weather-icon { width:30px; height:30px; fill:none; stroke:var(--brand); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.weather-day strong { color:var(--ink); font-size:var(--fs-18); font-weight:var(--fw-b); }
.weather-day strong small { color:var(--ink-3); font-size:var(--fs-12); font-weight:var(--fw-r); }
.weather-rain { color:var(--status-soon); font-size:var(--fs-12); font-weight:var(--fw-sb); }
.weather-rain.is-wet { color:#fff; padding:1px 8px; border-radius:var(--r-pill); background:var(--status-soon); }
.weather-wind,.weather-desc { color:var(--ink-3); font-size:var(--fs-11); }
@media (max-width:719px) {
  .weather-days { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .weather-card-head { flex-direction:column; gap:4px; }
}

/* ------------------------------------------------------------------
   Mobile operational product shell — implemented from the supplied
   farm-os-mobile-redesign artifact. Desktop analytical screens remain
   available; phones get role-first actions and flat operational rows.
   ------------------------------------------------------------------ */
.manager-mobile-today,.worker-mobile-nav,.worker-mobile-title,.worker-profile-badge,.mobile-profile-account { display:none; }

@media (min-width:0px) {
  body,.app-shell,.worker-app,.farm-os-portal.is-worker {
    color-scheme:light dark;
    --mobile-canvas:light-dark(#f8f7f1,#0d120e);
    --mobile-surface:light-dark(#fff,#121813);
    --mobile-surface-2:light-dark(#eef2eb,#1a221b);
    --mobile-text:light-dark(#1f281f,#edf3ec);
    --mobile-muted:light-dark(#667166,#a9b5a9);
    --mobile-line:light-dark(#dde2d8,#334035);
    --mobile-green:light-dark(#214f31,#b9dda8);
    --mobile-green-soft:light-dark(#e8f0e5,#263829);
    --mobile-green-on:light-dark(#fff,#172018);
    --mobile-warning:light-dark(#a14c23,#f2ae79);
    --mobile-warning-soft:light-dark(#fff0e6,#40291d);
    --mobile-danger:light-dark(#a13b34,#ffaaa2);
    --mobile-danger-soft:light-dark(#fbe9e6,#432421);
    --mobile-blue:light-dark(#2f6687,#9dcced);
    --mobile-blue-soft:light-dark(#e8eff4,#24333c);
  }

  /* Explicit appearance choice from the staff profile. Without data-theme the
     shell keeps `light dark` and follows the phone. The .worker-app override
     is needed because that element re-declares color-scheme for its own token
     block, so pinning only the portal root would be undone inside it. */
  .farm-os-portal.is-worker[data-theme="light"],
  .farm-os-portal.is-worker[data-theme="light"] .worker-app { color-scheme:light; }
  .farm-os-portal.is-worker[data-theme="dark"],
  .farm-os-portal.is-worker[data-theme="dark"] .worker-app { color-scheme:dark; }

  /* Only the worker shells paint the dark surfaces above. The manager shell
     keeps fixed light panels (white workspaces, warm paper canvas), so on a
     phone set to dark mode its text was resolving to the pale half of these
     pairs and disappearing into the white cards. Pin the manager shell to the
     light half; .worker-app and .farm-os-portal.is-worker re-declare
     color-scheme themselves and keep real dark mode. */
  body,.app-shell { color-scheme:light; }

  body:has(.manager-mobile-today),body:has(.worker-app) { background:var(--mobile-canvas); }
  body:has(.manager-mobile-today) .workspace { background:var(--mobile-canvas); }
  body:has(.manager-mobile-today) .app-shell { background:var(--mobile-canvas); }
  body:has(.manager-mobile-today) .workspace { min-height:calc(100dvh - 64px); }

  /* Shared manager top bar */
  .manager-hero {
    position:sticky; z-index:var(--z-sticky); top:0; min-height:64px; padding:10px 16px;
    color:var(--mobile-text); border-bottom:1px solid var(--mobile-line); background:var(--mobile-surface);
  }
  .manager-hero-row { width:100%; min-height:44px; display:flex; align-items:center; gap:10px; }
  /* .hero-search is deliberately NOT hidden here. Hiding it left the app with
     no reachable search at any width: the redesigned Plan view no longer
     renders .filter-strip / #planner-search, so the hero field was the only
     door to a filter that still works (see the search term assembled in
     renderPlan). What stays hidden is the wordmark and the hero's duplicate of
     the primary action, which the page command bar already carries. */
  .manager-hero .brand,.manager-hero .top-actions>.button-primary { display:none; }
  /* Collapsed to the 44px toggle; the field opens as a panel beneath the bar. */
  .manager-hero .hero-search { display:flex; }
  .manager-hero .page-heading,.operations-context { min-width:0; flex:1; }
  .manager-hero .page-heading h1,.operations-context h1 { overflow:hidden; color:var(--mobile-text); font-size:22px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
  .manager-hero .top-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
  .manager-hero .sync-status { width:18px; min-width:18px; min-height:18px; padding:0; border:0; background:transparent; font-size:0; }
  .manager-hero .sync-status .status-dot { width:8px; height:8px; }
  .manager-hero .hero-account-button { width:44px; min-width:44px; height:44px; padding:0; justify-content:center; border-color:var(--mobile-line); border-radius:50%; background:var(--mobile-surface-2); }
  .manager-hero .hero-account-initials { width:auto; height:auto; color:var(--mobile-green); background:transparent; font-size:14px; }
  .manager-hero .hero-account-caret { display:none; }
  .repository-status { display:none!important; }

  /* Operational destinations become the mobile page title; the sixth slot is
     the account/profile anchor, following familiar social-app navigation. */
  /* One bottom bar, two shells. The manager and staff navs had separately
     written, near-identical geometry that drifted (the staff bar had no
     safe-area height and a hardcoded z-index). Only the column count and the
     icon mechanism differ now; everything else is stated once. */
  .manager-shell-nav,.worker-mobile-nav {
    position:fixed; z-index:var(--z-nav); top:auto; right:0; bottom:0; left:0; width:100%; max-width:none; height:calc(72px + env(safe-area-inset-bottom)); min-height:72px;
    margin:0; padding:5px 6px max(5px,env(safe-area-inset-bottom)); display:grid; gap:0;
    overflow:visible; border-top:1px solid var(--mobile-line); background:var(--mobile-surface);
  }
  .manager-shell-nav { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .worker-mobile-nav { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .manager-shell-nav .nav-item,.worker-mobile-nav button {
    width:auto; min-width:0; min-height:62px; padding:4px 2px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    position:relative; z-index:1; color:var(--mobile-muted); border:0; border-radius:0; background:transparent; font-size:0; font-weight:500; white-space:normal; pointer-events:auto; touch-action:manipulation;
  }
  .manager-shell-nav .nav-item.is-active,.worker-mobile-nav button.is-active { color:var(--mobile-green); background:transparent; }
  .manager-shell-nav .nav-item>span:first-child:not(.nav-badge) { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  .manager-shell-nav .nav-item::before { color:currentColor; font-size:20px; font-weight:400; line-height:1; pointer-events:none; }
  .manager-shell-nav [data-view="overview"]::before,.manager-shell-nav [data-manager-view="overview"]::before { content:"⌂"; }
  .manager-shell-nav [data-open-operations="tasks"]::before,.manager-shell-nav [data-operations-tab="tasks"]::before { content:"☷"; }
  .manager-shell-nav [data-view="map"]::before,.manager-shell-nav [data-manager-view="map"]::before { content:"◇"; }
  .manager-shell-nav [data-view="plan"]::before,.manager-shell-nav [data-manager-view="plan"]::before { content:"▤"; }
  .manager-shell-nav [data-view="availability"]::before,.manager-shell-nav [data-manager-view="availability"]::before { content:"♧"; }
  .manager-shell-nav [data-view="more"]::before,.manager-shell-nav [data-operations-tab="seed-lots"]::before { content:"☰"; }
  .manager-shell-nav .nav-badge { position:absolute; margin:-28px 0 0 18px; }
  .manager-shell-nav [data-open-operations="staff"],.manager-shell-nav [data-operations-tab="staff"],
  .manager-shell-nav [data-open-operations="calendar"],.manager-shell-nav [data-operations-tab="calendar"],
  .manager-shell-nav>[data-view="more"] { display:none; }

  #main-content { width:100%; padding:0 16px calc(88px + env(safe-area-inset-bottom)); color:var(--mobile-text); }
  #view-root { width:100%; }
  .manager-desktop-overview { display:none!important; }
  .manager-mobile-today { display:block; max-width:520px; margin:0 auto; }
  .mobile-weather-strip {
    min-height:58px; margin:10px 0 4px; padding:10px 12px; display:flex; align-items:center; gap:10px;
    color:var(--mobile-blue); border-radius:12px; background:var(--mobile-blue-soft);
  }
  .mobile-weather-strip .mobile-row-svg { width:25px; height:25px; }
  .mobile-weather-strip span { min-width:0; display:grid; gap:2px; }
  .mobile-weather-strip strong { color:var(--mobile-text); font-size:14px; font-weight:600; }
  .mobile-weather-strip small { color:var(--mobile-blue); font-size:13px; }
  .mobile-operational-section { padding:20px 0 8px; }
  .mobile-operational-section+.mobile-operational-section { margin-top:8px; border-top:1px solid var(--mobile-line); }
  .mobile-operational-section>header { min-height:30px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .mobile-operational-section>header h2 { margin:0; color:var(--mobile-text); font-size:20px; font-weight:600; }
  .mobile-operational-section>header span { color:var(--mobile-muted); font-size:13px; }
  .mobile-operational-list { display:grid; }
  .mobile-operational-row {
    width:100%; min-height:72px; padding:9px 0; display:flex; align-items:center; gap:12px;
    color:var(--mobile-text); border:0; border-bottom:1px solid var(--mobile-line); border-radius:0; background:transparent; text-align:left;
  }
  .mobile-operational-row:last-child { border-bottom:0; }
  .mobile-row-icon { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; color:var(--mobile-green); border-radius:12px; background:var(--mobile-green-soft); }
  .mobile-row-icon.is-warning { color:var(--mobile-warning); background:var(--mobile-warning-soft); }
  .mobile-row-icon.is-danger { color:var(--mobile-danger); background:var(--mobile-danger-soft); }
  .mobile-row-svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
  .mobile-row-copy { min-width:0; flex:1; }
  .mobile-row-copy strong,.mobile-row-copy small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-row-copy strong { color:var(--mobile-text); font-size:16px; font-weight:600; }
  .mobile-row-copy small { margin-top:3px; color:var(--mobile-muted); font-size:13px; }
  .mobile-weather-strip small,.manager-mobile-today>.mobile-operational-section:last-child .mobile-row-copy small { display:none; }
  .mobile-row-value { color:var(--mobile-muted); font-size:13px; white-space:nowrap; }
  .mobile-chevron { color:var(--mobile-muted); font-size:28px; font-weight:300; }
  .mobile-clear-state { min-height:58px; display:flex; align-items:center; color:var(--mobile-muted); font-size:14px; }
  .mobile-progress-copy { margin:14px 0 8px; display:flex; justify-content:space-between; color:var(--mobile-text); font-size:14px; }
  .mobile-progress-copy strong { color:var(--mobile-muted); font-weight:500; }
  .mobile-progress-track { height:8px; overflow:hidden; border-radius:999px; background:var(--mobile-line); }
  .mobile-progress-track i { height:100%; display:block; border-radius:inherit; background:var(--mobile-green); }

  /* Worker role shell */
  .farm-os-portal.is-worker { background:var(--mobile-canvas); }
  .worker-app { width:100%; max-width:520px; min-height:100dvh; padding:0 16px calc(86px + env(safe-area-inset-bottom)); color:var(--mobile-text); background:var(--mobile-canvas); }
  .worker-app-header { position:sticky; z-index:var(--z-sticky); top:0; min-height:64px; margin-inline:-16px; padding:10px 16px; border-bottom:1px solid var(--mobile-line); color:var(--mobile-text); background:var(--mobile-surface); }
  .worker-mobile-title { min-width:0; margin:0; display:block; flex:1; overflow:hidden; font-size:22px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
  .worker-profile-badge { width:44px; height:44px; display:grid; place-items:center; color:var(--mobile-green); border:1px solid var(--mobile-line); border-radius:50%; background:var(--mobile-surface-2); font-size:14px; }
  /* Geometry is shared with .manager-shell-nav above; the staff bar keeps a
     real SVG in the icon slot where the manager draws a ::before glyph. */
  .worker-mobile-nav button span { font-size:22px; }
  #worker-content { padding-top:2px; }
  .worker-mobile-today,.worker-mobile-report { display:grid; }
  /* The worker shell used to restate every row rule under .worker-* names,
     drifting 1-4px per token (68 vs 72 row, 38 vs 42 icon, 15 vs 16 title).
     Both shells now emit the .mobile-* primitives above; only the additions
     that did not exist on the manager side live here. */
  .mobile-operational-row.is-recommended { margin-top:7px; padding:12px; border:1px solid var(--mobile-line); border-radius:14px; background:var(--mobile-surface); }
  /* Rows are buttons, so the portal's blanket `.worker-app button` 44px floor
     outranks the shared row rule. Restate it here, where the extra class wins,
     so a sparse row is 72px on both shells rather than 44px on this one. */
  .worker-app .mobile-operational-row { min-height:72px; }
  /* The two shells put different icon elements in the same box: the manager
     draws .mobile-row-svg, the staff portal reuses portalIcon(). Size them
     together so the box reads identically either way. */
  .mobile-row-icon .portal-icon { width:22px; height:22px; }
  .mobile-row-value.is-warning { color:var(--mobile-warning); font-weight:600; }
  .mobile-row-value.is-danger { color:var(--mobile-danger); font-weight:600; }
  /* Rows clamp their meta line to one ellipsised line; a reviewer's reason
     needs to actually be readable, so this one wraps to two. */
  .mobile-row-copy .mobile-row-note,.worker-report-list .mobile-row-note {
    display:-webkit-box; margin-top:4px; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2;
    font-size:12px; line-height:1.4; white-space:normal;
  }
  .mobile-row-note.is-warning { color:var(--mobile-warning); }
  .mobile-row-note.is-danger { color:var(--mobile-danger); }
  .mobile-operational-section.is-rework>header h2 { color:var(--mobile-danger); }
  /* The report list was a fixed-white card (styles.css) inside a shell that
     follows the device's dark mode, so its titles took the near-white
     --mobile-text and disappeared at 1.13:1 — the same failure shape as the
     manager's harvest names. Paint the card from the mobile tokens so the
     surface and the text move together. */
  .worker-report-list { border-color:var(--mobile-line); background:var(--mobile-surface); }
  .worker-report-list article { border-bottom-color:var(--mobile-line); }
  .worker-report-list strong { color:var(--mobile-text); }
  .worker-report-list small { color:var(--mobile-muted); }
  .worker-report-icon { color:var(--mobile-green); background:var(--mobile-green-soft); }
  .worker-review-state.is-pending { color:var(--mobile-warning); background:var(--mobile-warning-soft); }
  .worker-review-state.is-approved { color:var(--mobile-green); background:var(--mobile-green-soft); }
  .worker-review-state.is-rejected { color:var(--mobile-danger); background:var(--mobile-danger-soft); }
  .worker-mobile-report>header { padding:18px 0 8px; }
  .worker-mobile-report>header h2 { margin:0; color:var(--mobile-text); font-size:22px; }
  .worker-mobile-report>header p { margin:6px 0 0; color:var(--mobile-muted); font-size:13px; line-height:1.45; }
  .worker-issue-shortcuts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; padding:8px 0 16px; }
  .worker-issue-shortcuts button { min-height:52px; padding:8px; color:var(--mobile-text); border:1px solid var(--mobile-line); border-radius:12px; background:var(--mobile-surface); }
  /* An explicit track, because place-content:center left the column sized to
     its content: the children ask for min(280px,100%) but 100% resolved
     against a ~166px track, so the buttons came out half width. */
  .worker-mobile-profile { min-height:65dvh; display:grid; grid-template-columns:min(280px,100%); place-content:center; justify-items:center; gap:12px; }
  .worker-profile-large { width:72px; height:72px; display:grid; place-items:center; color:var(--mobile-green); border:1px solid var(--mobile-line); border-radius:50%; background:var(--mobile-surface); font-size:22px; }
  .worker-mobile-profile h2 { margin:0 0 8px; color:var(--mobile-text); }
  .worker-mobile-profile .button { width:min(280px,100%); min-height:50px; }
  /* Appearance picker. Segmented rather than a cycling toggle so all three
     choices are visible without tapping, matching .worker-severity-choice. */
  .worker-setting-row { width:min(280px,100%); display:grid; gap:7px; margin-bottom:4px; }
  .worker-setting-label { color:var(--mobile-muted); font-size:12px; font-weight:600; }
  .worker-setting-row>small { color:var(--mobile-muted); font-size:11px; line-height:1.4; }
  .worker-theme-choice { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .worker-theme-choice button {
    min-width:0; min-height:46px; padding:0 6px; display:grid; place-items:center;
    color:var(--mobile-muted); border:1px solid var(--mobile-line); border-radius:11px;
    background:var(--mobile-surface); font-size:13px; font-weight:600; touch-action:manipulation;
  }
  .worker-theme-choice button.is-active { color:var(--mobile-green-on); border-color:var(--mobile-green); background:var(--mobile-green); }

  /* Task and issue detail use the same flat mobile language. */
  .worker-dialog { width:100vw; max-width:none; max-height:100dvh; height:100dvh; margin:0; border-radius:0; color:var(--mobile-text); background:var(--mobile-canvas); }
  .worker-dialog .dialog-header { min-height:64px; padding:10px 16px; color:var(--mobile-text); border-color:var(--mobile-line); background:var(--mobile-surface); }
  .worker-dialog .dialog-header p { display:none; }
  .worker-dialog .dialog-header h2 { color:var(--mobile-text); font-size:20px; }
  /* The close control kept the fixed --ink-2 and sat at 2.38:1 on the dark header. */
  .worker-dialog .dialog-header .icon-button { color:var(--mobile-text); border-color:var(--mobile-line); background:var(--mobile-surface-2); }
  .worker-dialog .dialog-body { padding:12px 16px 32px; }
  .worker-dialog .task-brief { padding:12px 0; border:0; border-bottom:1px solid var(--mobile-line); border-radius:0; color:var(--mobile-text); background:transparent; }
  .worker-dialog .task-brief p { color:var(--mobile-muted); }
  /* The full report form (opened from a task) was still on the fixed light
     palette from styles.css while the shell follows the device's dark mode:
     pale cards under near-white text. These rules repaint the whole form
     surface from the mobile tokens so it moves with the shell. The quick
     report form was already converted; this is the rest of it. */
  .worker-dialog .worker-start-state,.worker-dialog .worker-submitted-state {
    padding:18px 0; color:var(--mobile-text); border:0; border-radius:0; background:transparent;
  }
  .worker-dialog .worker-start-state p,.worker-dialog .worker-submitted-state>p { color:var(--mobile-muted); }
  .worker-dialog .worker-start-state .button { width:100%; min-height:52px; margin-top:12px; }
  .worker-dialog .worker-report-form>header p,.worker-dialog .worker-form-section>p,
  .worker-dialog .worker-report-form footer span,.worker-dialog .worker-escalation small { color:var(--mobile-muted); }
  .worker-dialog .worker-form-section { border-color:var(--mobile-line); background:var(--mobile-surface); }
  .worker-dialog .worker-form-section h4 { color:var(--mobile-text); }
  /* .worker-report-form label is (0,1,1) in styles.css and outranks any
     single-class rule here, so match it selector-for-selector. */
  .worker-dialog .worker-report-form label { color:var(--mobile-muted); }
  .worker-dialog .worker-report-form input,.worker-dialog .worker-report-form select,.worker-dialog .worker-report-form textarea {
    color:var(--mobile-text); border-color:var(--mobile-line); background:var(--mobile-surface-2);
  }
  .worker-dialog .worker-locked-field { border-color:var(--mobile-line); background:var(--mobile-surface-2); }
  .worker-dialog .worker-locked-field strong { color:var(--mobile-text); }
  .worker-dialog .worker-locked-field span,.worker-dialog .worker-locked-field small { color:var(--mobile-muted); }
  .worker-dialog .worker-checklist label,.worker-dialog .worker-choice-row label {
    color:var(--mobile-text); border-color:var(--mobile-line); background:var(--mobile-surface);
  }
  .worker-dialog .worker-checklist span strong { color:var(--mobile-green); background:var(--mobile-green-soft); }
  .worker-dialog .worker-escalation { border-color:var(--mobile-warning); background:var(--mobile-warning-soft); }
  .worker-dialog .worker-escalation strong { color:var(--mobile-text); }
  .worker-dialog .worker-draft-state { color:var(--mobile-green); }
  .worker-dialog .worker-photo-status { color:var(--mobile-green); }
  .farm-os-portal .worker-dialog .worker-checklist label:has(input:checked) { border-color:var(--mobile-green); background:var(--mobile-green-soft); }
  .farm-os-portal .worker-dialog .worker-checklist label:has(input:checked) span { color:var(--mobile-green); }
  .farm-os-portal .worker-dialog .worker-choice-row label:has(input:checked) { border-color:var(--mobile-green); background:var(--mobile-green-soft); box-shadow:none; }
  .worker-quick-report-form { gap:18px; }
  .worker-quick-report-form>header { padding:4px 0 2px; }
  .worker-quick-report-form>header small { color:var(--mobile-green); font-size:11px; letter-spacing:.06em; text-transform:uppercase; }
  .worker-quick-report-form>header h3 { margin:4px 0 0; color:var(--mobile-text); font-size:26px; }
  .worker-quick-location { display:grid; }
  .worker-quick-location>label:nth-child(2) { display:none; }
  .worker-quick-location label,.worker-quick-notes { display:grid; gap:7px; color:var(--mobile-muted); font-size:12px; font-weight:600; }
  .worker-quick-location .worker-location-picker { margin:0; padding:0; border:0; background:transparent; }
  .worker-quick-location .worker-location-picker>span { display:none; }
  .worker-quick-location input,.worker-quick-location select,.worker-quick-notes textarea {
    width:100%; min-height:50px; padding:11px 13px; color:var(--mobile-text); border:1px solid var(--mobile-line); border-radius:12px; background:var(--mobile-surface); font:inherit;
  }
  .worker-quick-notes textarea { min-height:86px; resize:vertical; }
  .worker-severity-choice { margin:0; padding:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; border:0; }
  .worker-severity-choice legend { grid-column:1/-1; margin-bottom:2px; color:var(--mobile-muted); font-size:12px; font-weight:600; }
  .worker-severity-choice label { position:relative; min-width:0; }
  .worker-severity-choice input { position:absolute; opacity:0; }
  .worker-severity-choice span { min-height:46px; display:grid; place-items:center; color:var(--mobile-muted); border:1px solid var(--mobile-line); border-radius:11px; background:var(--mobile-surface); font-weight:600; }
  .worker-severity-choice input:checked+span { color:var(--mobile-green-on); border-color:var(--mobile-green); background:var(--mobile-green); }
  .worker-quick-photo { min-height:50px; padding:0 13px; display:flex!important; align-items:center; justify-content:space-between; color:var(--mobile-text)!important; border:1px solid var(--mobile-line); border-radius:12px; background:var(--mobile-surface); }
  .worker-quick-photo::after { content:"+"; color:var(--mobile-green); font-size:24px; }
  .worker-quick-photo input { position:absolute; width:1px!important; height:1px; min-height:0!important; opacity:0; }
  .worker-quick-engineer { min-height:58px; padding:10px 12px; display:flex!important; grid-template-columns:none!important; align-items:center; gap:10px; color:var(--mobile-text)!important; border:1px solid var(--mobile-line); border-radius:12px; background:var(--mobile-surface); }
  .worker-quick-engineer input { width:22px!important; min-height:22px!important; flex:0 0 22px; accent-color:var(--mobile-green); }
  .worker-quick-engineer span { display:grid; gap:2px; }
  .worker-quick-engineer small,.worker-quick-report-form .worker-draft-state { color:var(--mobile-muted); font-size:11px; }
  .worker-quick-report-form footer { position:sticky; bottom:-32px; margin:0 -16px -32px; padding:12px 16px max(12px,env(safe-area-inset-bottom)); border-top:1px solid var(--mobile-line); background:var(--mobile-surface); }
  .worker-quick-report-form footer .button { width:100%; min-height:52px; color:var(--mobile-green-on); border-color:var(--mobile-green); background:var(--mobile-green); }
}

@media (max-width:719px) {
  /* The active bottom tab names the screen on phones. Keep the H1 in the DOM
     for assistive technology without spending another 64px on a title bar. */
  #sidebar.manager-hero { position:static; min-height:0; padding:0; border:0; background:transparent; }
  #sidebar.manager-hero .manager-hero-row { width:1px; height:1px; min-height:0; margin:0; overflow:hidden; }
  #sidebar.manager-hero .page-heading { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  #sidebar.manager-hero .top-actions,#sidebar.manager-hero .brand { display:none; }

  .manager-shell-nav { grid-template-columns:repeat(6,minmax(0,1fr)); height:calc(72px + env(safe-area-inset-bottom)); }
  .manager-shell-nav>.nav-item>span:first-child:not(.nav-badge) {
    position:static; width:auto; height:auto; padding:0; overflow:visible; clip:auto; white-space:nowrap; border:0;
    color:currentColor; font-size:9px; font-weight:650; line-height:1;
  }
  .manager-shell-nav>.nav-item::after,.mobile-profile-nav::after {
    content:""; position:absolute; top:0; left:50%; width:30px; height:3px;
    border-radius:0 0 999px 999px; background:currentColor; opacity:0; transform:translateX(-50%);
  }
  .manager-shell-nav>.nav-item.is-active::after,.mobile-profile-nav[aria-expanded="true"]::after { opacity:1; }
  .manager-shell-nav .nav-badge { top:4px; right:12%; margin:0; border:2px solid var(--mobile-surface); }

  .mobile-profile-account { position:relative; width:100%; min-width:0; height:100%; display:block; justify-self:stretch; }
  .manager-shell-nav .mobile-profile-nav {
    position:relative; width:100%; min-width:0; min-height:62px; padding:4px 2px;
    display:flex; align-items:center; justify-content:center;
    color:var(--mobile-muted); border:0; border-radius:0; background:transparent;
  }
  .mobile-profile-nav::before { content:none; }
  .mobile-profile-nav[aria-expanded="true"] { color:var(--mobile-green); background:transparent; }
  .manager-shell-nav .mobile-profile-nav>.mobile-admin-nav-icon:first-child:not(.nav-badge) { position:static; width:24px; height:24px; padding:0; display:grid; place-items:center; overflow:visible; clip:auto; white-space:normal; color:currentColor; }
  .mobile-admin-nav-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
  .mobile-profile-status {
    position:absolute; top:15px; left:calc(50% + 6px); width:7px; height:7px;
    border:2px solid var(--mobile-surface); border-radius:50%; background:var(--mobile-green);
  }
  .mobile-profile-status.is-offline { background:var(--mobile-danger); }
  .mobile-profile-status.is-connecting { background:var(--mobile-warning); }
  .mobile-profile-status.is-preview { background:var(--mobile-green); }
  .mobile-profile-menu {
    position:fixed; z-index:1400; top:auto; right:8px; bottom:calc(78px + env(safe-area-inset-bottom));
    width:min(230px,calc(100vw - 16px)); max-height:calc(100dvh - 96px); padding:5px; gap:1px; overflow-y:auto;
    border-radius:15px; box-shadow:0 12px 32px rgb(9 24 15 / 22%);
  }
  .mobile-current-admin { min-height:50px; padding:6px 8px; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--mobile-line); }
  .manager-shell-nav .mobile-profile-menu .mobile-admin-avatar { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:50%; color:#fff; background:#214f31; font-size:11px; font-weight:850; }
  .mobile-profile-menu .mobile-current-admin .hero-account-name { min-width:0; display:block; overflow:hidden; color:var(--ink); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-profile-menu .hero-menu-row,
  .mobile-profile-menu .hero-menu-item,
  .mobile-profile-menu [data-portal-logout] { min-height:40px; padding-inline:10px; border-radius:10px; font-size:12px; }
  .mobile-management-group { margin:0; }
  .mobile-management-group>summary { list-style:none; }
  .mobile-management-group>summary::-webkit-details-marker { display:none; }
  .mobile-profile-menu .mobile-management-link { display:grid; grid-template-columns:24px minmax(0,1fr) auto; align-items:center; gap:8px; color:var(--ink); background:var(--mobile-green-soft); font-weight:800; text-align:left; cursor:pointer; }
  .mobile-management-link .mobile-management-icon { width:24px; height:24px; display:grid; place-items:center; color:var(--mobile-green); }
  .mobile-management-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .mobile-management-link b { font-size:20px; font-weight:500; }
  .mobile-management-group[open] .mobile-management-link b { transform:rotate(90deg); }
  .mobile-management-options { padding:2px 0 3px 32px; display:grid; gap:1px; }
  .mobile-profile-menu .mobile-management-options .hero-menu-item { min-height:36px; padding-inline:9px; display:flex; align-items:center; color:var(--ink); background:transparent; font-size:11px; text-align:left; }
  .mobile-profile-menu .mobile-management-options .hero-menu-item:hover { background:var(--mobile-green-soft); }
  .mobile-profile-menu .hero-menu-row .language-toggle { min-width:44px; min-height:30px; padding:0 9px; }

  /* Keep the embedded Work workspace on the same 8px phone frame as Today,
     Farm, Plan, and Harvest. This must outrank the older portal shell rule. */
  .farm-os-portal.is-two-control-work.is-embedded-operations .operations-shell { width:100%; height:100%; margin:0; padding:8px; }
  .farm-os-portal.is-two-control-work .task-list-projection { padding:4px 12px 78px; border:0; border-radius:0; background:transparent; }
  .farm-os-portal.is-management-workspace.is-embedded-operations .operations-shell { width:100%; height:100%; margin:0; padding:8px; }
  .farm-os-portal.is-management-workspace .management-page-tabs { margin:0; }
  .plan-workspace-heading .plan-view-options { flex:1 1 auto; }
  .plan-view-options button { min-height:32px; padding-inline:4px; font-size:10px; }
}

@media (min-width:720px) {
  .manager-hero { padding-inline:24px; }
  #main-content { width:min(1180px,calc(100% - 48px)); margin-inline:auto; padding:22px 0 104px; }
  .farm-os-portal.is-two-control-work.is-embedded-operations .operations-shell { width:min(1180px,calc(100% - 48px)); height:100%; margin:0 auto; padding:12px clamp(10px,2vw,24px); }
  .farm-os-portal.is-two-control-work .task-list-projection { padding:4px 12px 92px; border:0; border-radius:0; background:transparent; }
  .farm-os-portal.is-management-workspace.is-embedded-operations .operations-shell { width:min(1180px,calc(100% - 48px)); height:100%; margin:0 auto; padding:12px clamp(10px,2vw,24px); }
  .manager-mobile-today { width:100%; max-width:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:28px; }
  .manager-mobile-today>.mobile-weather-strip { grid-column:1/-1; }
  .manager-mobile-today>.mobile-operational-section:last-child { grid-column:1/-1; }
  .manager-shell-nav {
    right:auto; bottom:16px; left:50%; width:min(390px,calc(100% - 32px)); height:64px; min-height:64px;
    padding:4px 8px; transform:translateX(-50%); border:1px solid var(--mobile-line); border-radius:20px; box-shadow:0 16px 48px rgb(0 0 0 / 34%);
  }
  .manager-shell-nav .nav-item { min-height:54px; border-radius:14px; }
  .manager-shell-nav .nav-item.is-active { background:var(--mobile-green-soft); }
  .worker-app { max-width:760px; }
  /* height:auto releases the shared safe-area height so the floating pill
     sizes to its own 64px rather than the full-width bar's 72px. */
  .worker-mobile-nav { right:auto; bottom:16px; left:50%; width:min(330px,calc(100% - 32px)); height:auto; min-height:64px; padding:4px 8px; transform:translateX(-50%); border:1px solid var(--mobile-line); border-radius:20px; box-shadow:0 16px 48px rgb(0 0 0 / 34%); }
  .worker-mobile-nav button { min-height:54px; border-radius:14px; }
  .worker-mobile-nav button.is-active { background:var(--mobile-green-soft); }
}

@media (min-width:1024px) {
  .manager-mobile-today { grid-template-columns:1.15fr .8fr 1.05fr; }
  .manager-mobile-today>.mobile-operational-section:last-child { grid-column:auto; }
}
.hero-build-stamp { margin:4px 2px 0; padding-top:6px; border-top:1px solid var(--mobile-line); color:var(--mobile-muted); font-size:var(--fs-11); }
.hero-build-stamp[hidden] { display:none; }

/* The today column paints itself dark green and sets color:#fff, but the two
   child lines carry their own colours (.daily-date-head span is --ink-500), so
   the month label stayed warm grey on dark green at 1.80:1. Children have to
   follow the inverted surface; the secondary line keeps its hierarchy by
   stepping down in opacity rather than back to the light-surface ink. */
.daily-date-head.is-today strong { color:#fff; }
.daily-date-head.is-today span { color:rgb(255 255 255 / 85%); }

/* ------------------------------------------------------------------
   Desktop manager shell.

   Phone and tablet keep the touch-first bottom navigation above. A laptop is
   a different working surface: persistent destinations at the left, utility
   controls across the top, and enough horizontal room to compare related
   information without paging between mobile panes. The application still
   renders one set of buttons and handlers; only their placement changes.
   ------------------------------------------------------------------ */
@media (min-width:1024px) {
  :root {
    --desktop-manager-rail:232px; --desktop-manager-topbar:72px; --desktop-shell-top:0px;
    --desktop-rail-text:#fff; --desktop-rail-muted:rgb(255 255 255 / 70%);
    --desktop-rail-subtle:rgb(255 255 255 / 68%);
  }
  body.has-demo-banner { --desktop-shell-top:var(--demo-banner-offset,38px); }

  body:has(.manager-mobile-today),
  body:has(.manager-mobile-today) .app-shell,
  body:has(.manager-mobile-today) .workspace { background:#f4f6f1; }

  #sidebar.manager-hero {
    position:fixed; z-index:110; inset:var(--desktop-shell-top) auto 0 0;
    width:var(--desktop-manager-rail); min-height:0; padding:0;
    display:block; color:var(--desktop-rail-text); border:0; background:#173f2c;
    box-shadow:8px 0 30px rgb(16 48 31 / 10%);
  }
  #sidebar.manager-hero .manager-hero-row {
    position:fixed; z-index:111;
    top:var(--desktop-shell-top); right:0; left:var(--desktop-manager-rail);
    width:auto; height:var(--desktop-manager-topbar); min-height:var(--desktop-manager-topbar);
    margin:0; padding:0 24px; display:flex; align-items:center; gap:18px;
    border-bottom:1px solid #dce3da; background:#fff;
    box-shadow:0 5px 20px rgb(23 63 44 / 5%); backdrop-filter:none;
  }

  #sidebar.manager-hero .brand {
    position:fixed; z-index:112; top:calc(var(--desktop-shell-top) + 18px); left:18px;
    width:196px; min-width:0; height:44px; padding:0; display:flex; align-items:center; gap:10px;
    color:var(--desktop-rail-text); border:0; background:transparent;
  }
  #sidebar.manager-hero .brand-mark {
    width:40px; height:40px; flex:0 0 40px; border-radius:11px;
    color:#173f2c; background:#c5e1a9;
  }
  #sidebar.manager-hero .brand strong { color:var(--desktop-rail-text); font-size:14px; }
  #sidebar.manager-hero .brand span { color:var(--desktop-rail-subtle); font-size:10px; }

  #sidebar.manager-hero .page-heading { min-width:150px; flex:1 1 auto; margin:0; }
  #sidebar.manager-hero .page-heading p {
    margin:0 0 3px; color:#728078; font-size:9px; font-weight:800;
    letter-spacing:.1em; text-transform:uppercase;
  }
  #sidebar.manager-hero .page-heading h1 {
    color:#1d2c22; font-size:23px; font-weight:650; line-height:1.05;
  }
  #sidebar.manager-hero .top-actions { margin-left:auto; gap:9px; }
  #sidebar.manager-hero .hero-search { display:flex; }
  #sidebar.manager-hero .global-search { width:clamp(210px,24vw,340px); }
  #sidebar.manager-hero .sync-status { width:38px; min-width:38px; height:38px; }
  #sidebar.manager-hero .hero-account-button {
    width:auto; min-width:44px; height:42px; padding:0 7px 0 5px;
    border-radius:999px; background:#f1f4ef;
  }
  #sidebar.manager-hero .hero-account-caret { display:block; }

  #sidebar.manager-hero .manager-shell-nav {
    position:static; width:auto; height:auto; min-height:0; margin:82px 14px 0; padding:10px 0;
    display:flex; flex-direction:column; align-items:stretch; gap:5px;
    overflow:visible; transform:none; border:0; border-top:1px solid rgb(255 255 255 / 12%);
    border-radius:0; color:var(--desktop-rail-text); background:transparent; box-shadow:none;
  }
  #sidebar.manager-hero .manager-shell-nav>.nav-item {
    width:100%; min-height:48px; padding:0 12px; display:flex; flex-direction:row;
    align-items:center; justify-content:flex-start; gap:11px;
    color:var(--desktop-rail-muted); border:0; border-radius:11px;
    background:transparent; font-size:13px; font-weight:650; text-align:left;
  }
  #sidebar.manager-hero .manager-shell-nav>.nav-item:hover {
    color:var(--desktop-rail-text); background:rgb(255 255 255 / 9%);
  }
  #sidebar.manager-hero .manager-shell-nav>.nav-item.is-active {
    color:#173f2c; background:#f3f6ef; box-shadow:0 8px 22px rgb(4 24 12 / 16%);
  }
  #sidebar.manager-hero .manager-shell-nav>.nav-item::before {
    width:24px; flex:0 0 24px; font-size:20px; text-align:center;
  }
  #sidebar.manager-hero .manager-shell-nav>[data-open-operations="staff"] { margin-top:10px; }
  #sidebar.manager-hero .manager-shell-nav>[data-open-operations="staff"]::before { content:"\2659"; }
  #sidebar.manager-hero .manager-shell-nav>[data-open-operations="calendar"]::before { content:"\25A6"; }
  #sidebar.manager-hero .manager-shell-nav>[data-view="more"]::before { content:"\2630"; }
  #sidebar.manager-hero .manager-shell-nav>.nav-item>span:first-child:not(.nav-badge) {
    position:static; width:auto; height:auto; padding:0; overflow:visible; clip:auto;
    color:currentColor; font-size:13px; white-space:nowrap;
  }
  #sidebar.manager-hero .manager-shell-nav .nav-badge {
    position:static; min-width:21px; height:21px; margin-left:auto; padding:0 6px;
    display:grid; place-items:center; color:var(--desktop-rail-text); border:0; background:#b3483d;
  }
  #sidebar.manager-hero .manager-shell-nav>.mobile-profile-account { display:none; }

  .workspace {
    min-height:calc(100dvh - var(--desktop-shell-top)); margin-left:var(--desktop-manager-rail);
    padding-top:var(--desktop-manager-topbar); background:#f4f6f1;
  }
  #main-content {
    width:min(1480px,calc(100% - 40px)); margin-inline:auto; padding:20px 0 32px;
  }
  body.is-operational-view .workspace {
    height:calc(100dvh - var(--desktop-shell-top)); min-height:0;
    padding-top:var(--desktop-manager-topbar); overflow:hidden;
  }
  body.is-operational-view #main-content {
    width:100%; height:calc(100dvh - var(--desktop-shell-top) - var(--desktop-manager-topbar));
    min-height:420px; padding:16px 20px 20px;
  }
  .farm-os-portal.is-two-control-work.is-embedded-operations,
  .farm-os-portal.is-management-workspace.is-embedded-operations {
    height:calc(100dvh - var(--desktop-shell-top) - var(--desktop-manager-topbar));
  }
  .farm-os-portal.is-two-control-work.is-embedded-operations .operations-shell,
  .farm-os-portal.is-management-workspace.is-embedded-operations .operations-shell {
    width:100%; max-width:none; margin:0; padding:16px 20px 20px;
  }

  .operational-workspace { border-radius:16px; box-shadow:0 10px 34px rgb(27 62 42 / 7%); }
  .workspace-minimal-heading { min-height:60px; padding:9px 12px 9px 18px; }
  .workspace-heading-copy strong { font-size:26px; }

  /* Both Farm panes are simultaneously useful on a laptop: the list locates
     the area and the map supplies spatial context. Mobile retains the swipe
     carousel and pager defined above. */
  .farm-swipe-viewport {
    display:grid; grid-template-columns:minmax(286px,34%) minmax(0,1fr);
    overflow:hidden; scroll-snap-type:none; scroll-behavior:auto;
  }
  .farm-swipe-pane {
    width:auto; min-width:0; flex:none; scroll-snap-align:none; scroll-snap-stop:normal;
  }
  .farm-list-pane {
    padding:12px; overflow-y:auto; border-right:1px solid #dce4d9; background:#f5f7f2;
  }
  .farm-mobile-area-list { max-width:none; margin:0; }
  .farm-map-pane,.farm-map-pane .illustrated-map-panel,.farm-map-pane .illustrated-map-scroll { overflow:hidden; }
  .map-workspace .illustrated-farm-map {
    width:100%; min-width:0; max-width:100%; height:100%; min-height:0;
    object-fit:contain; user-select:none;
  }
  .farm-swipe-hint { display:none; }

  .plan-workspace-heading { padding-inline:14px; }
  .plan-view-options { width:min(420px,42%); }
  .plan-workspace-compact .daily-timeline-scroll { scrollbar-gutter:stable; }
}

@media (min-width:1280px) {
  .exception-stream,.harvest-stream {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start;
    gap:1px; background:#e3e8e1;
  }
  .exception-stream-row,.harvest-stream-row { border:0; background:#fff; }
  .exception-stream-row:hover,.harvest-stream-row:hover { background:#f7faf5; }
}
