* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #0E1411; --bg2: #131B16;
  --card: rgba(255,255,255,0.055); --card-solid: #1A231D;
  --glass-border: rgba(255,255,255,0.09);
  --ink: #EDF2EA; --muted: #96A395; --line: rgba(255,255,255,0.08); --line-2: rgba(255,255,255,0.14);
  --acc: #A3E635; --acc2: #2DD4BF;
  --fruit: #E8804F; --nut: #C49A6C; --berry: #C77DDA; --cucurbit: #4CC9D4;
  --veg: #6FCF7C; --vine: #A78BFA; --hedge: #5FA97A; --herb: #A9C46C; --structure: #EDF2EA;
  --attn: #FF6B5E; --gold: #E5C05B; --ok: #6FCF7C;
  --paper: var(--card-solid);
  --grass: rgba(163,230,53,.25); --soil: rgba(255,255,255,.08);
  --r: 18px; --r-sm: 12px;
  --shadow: 0 10px 34px rgba(0,0,0,0.4);
  --tr: all .18s ease;
}
/* the root carries the page colour too: in the phone shells the WKWebView paints
   its own white behind the page, and rubber-band over-scroll exposes it as a
   white flash unless html itself is dark */
html { color-scheme: dark; background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
/* iOS WebKit paints button text in its own accent blue unless told otherwise;
   every button in this app styles itself from the page palette */
button, select { color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  appearance: none; -webkit-appearance: none;
  padding: 9px 12px; border: 1px solid var(--line-2);
  background-color: rgba(255,255,255,.05); color: var(--ink);
  border-radius: 10px; font: inherit; font-size: 13px;
  transition: border-color .15s ease, background-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: rgba(163,230,53,.55); background-color: rgba(255,255,255,.08);
}
select {
  cursor: pointer; padding-inline-end: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396A395' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
}
html.rtl select { background-position: left 10px center; }
select option { background: var(--card-solid); color: var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--acc); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  background: var(--bg); color: var(--ink); min-height: 100vh;
  background-image:
    radial-gradient(900px 500px at 8% -5%, rgba(163,230,53,0.09), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, rgba(45,212,191,0.07), transparent 55%),
    radial-gradient(700px 700px at 50% 110%, rgba(163,230,53,0.05), transparent 60%);
  background-attachment: fixed;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* header */
header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 28px; position: sticky; top: 0; z-index: 30;
  background: rgba(14,20,17,0.75); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--acc); }
.brand h1 { font-size: 21px; letter-spacing: 6px; font-weight: 800; color: var(--ink); line-height: 1; }
.head-right { display: flex; align-items: center; gap: 12px; }
.weather-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.wx { background: var(--card); border: 1px solid var(--glass-border); border-radius: 12px; padding: 5px 11px; text-align: center; min-width: 56px; backdrop-filter: blur(10px); }
.wx .d { font-size: 9.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); font-weight: 600; }
.wx .t { font-size: 14px; font-weight: 750; } .wx .t small { color: var(--muted); font-weight: 500; }
.wx .r { font-size: 10px; color: var(--acc2); font-weight: 600; }
.lang-btn { border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: 8px 14px; font-weight: 700; cursor: pointer; letter-spacing: 1px; border-radius: 999px; transition: var(--tr); }
.lang-btn:hover { background: var(--acc); color: #10160D; border-color: var(--acc); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; }


/* nav */
nav { display: flex; gap: 6px; padding: 14px 28px 4px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 9px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border-radius: 999px; transition: var(--tr); letter-spacing: .2px;
}
.tab svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--ink); background: var(--card); border-color: var(--glass-border); }
.tab.active { background: linear-gradient(135deg, var(--acc), #7BC93A); color: #10160D; font-weight: 800; box-shadow: 0 4px 18px rgba(163,230,53,.25); }
.side-brand { display: none; }

/* desktop: the nav is a left rail, everything else lives in the right column */
@media (min-width: 981px) {
  body { display: grid; grid-template-columns: 216px minmax(0, 1fr); grid-template-areas: "nav header" "nav main"; align-content: start; min-height: 100vh; }
  nav {
    grid-area: nav; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 3px;
    padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: rgba(14,20,17,0.6); border-inline-end: 1px solid var(--line);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; color: var(--acc); padding: 2px 10px 18px; }
  .side-brand span { color: var(--ink); font-weight: 800; font-size: 16px; letter-spacing: 5px; }
  .tab { border-radius: 12px; padding: 10px 12px; }
  header { grid-area: header; }
  header .brand { display: none; }
  main { grid-area: main; }
  .walk-ov { left: 216px; }
}
/* width:100% matters - as a grid item, `margin: 0 auto` alone makes main shrink to
   its content, which collapses to nothing when a view has no intrinsic width. */
main { padding: 18px 28px 70px; max-width: 1560px; margin: 0 auto; width: 100%; }
.view { display: none; } .view.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h2 { font-size: 18px; font-weight: 750; letter-spacing: -.2px; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 18px 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card h3 { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted); margin-bottom: 13px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 .n { color: var(--acc); font-size: 11px; letter-spacing: .4px; text-transform: none; font-weight: 650; }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 10px 0 20px; flex-wrap: wrap; }
.hero .season { font-size: 11px; text-transform: uppercase; letter-spacing: 2.2px; font-weight: 800; background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h2 { font-size: 32px; font-weight: 800; letter-spacing: -.8px; margin: 3px 0; }
.hero .date { color: var(--muted); font-size: 13.5px; }
.sun-strip { display: flex; align-items: flex-end; gap: 18px; background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 20px; font-size: 14px; font-weight: 700; backdrop-filter: blur(14px); }
.sun-strip i { display: block; font-style: normal; font-weight: 600; font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 2px; }
.sun-arc { width: 58px; height: 25px; border: 2.5px solid var(--gold); border-bottom: none; border-radius: 60px 60px 0 0; align-self: flex-end; opacity: .9; }

/* alerts */
.alert-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.alert { padding: 11px 16px; font-size: 13.5px; border-radius: var(--r-sm); border: 1px solid rgba(255,107,94,.3); background: rgba(255,107,94,.1); backdrop-filter: blur(10px); }
.alert.heat { border-color: rgba(229,192,91,.3); background: rgba(229,192,91,.1); }
.alert.rain, .alert.wind { border-color: rgba(76,201,212,.3); background: rgba(76,201,212,.1); }
.alert.hail { border-color: rgba(199,125,218,.35); background: rgba(199,125,218,.12); }

/* KPI row: the tiles share one row and wrap gracefully */
.kpi-row { grid-column: span 12; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }

/* disease pressure expansion */
.dp-day { margin-top: 12px; }
.dp-risk { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 14px; margin-top: 8px;
  background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); border-radius: var(--r-sm); }
.dp-risk .badge { margin-top: 2px; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-6 { grid-column: span 6; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }

/* KPI tiles */
.kpi {
  background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer; position: relative;
  backdrop-filter: blur(14px); transition: var(--tr);
}
.kpi:hover { transform: translateY(-2px); border-color: rgba(163,230,53,.45); }
.kpi.active { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 10px 34px rgba(163,230,53,.15); }
.kpi .kv { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--ink); line-height: 1.05; }
.kpi .kv small { font-size: 13px; color: var(--muted); margin-inline-start: 4px; font-weight: 600; letter-spacing: 0; }
.kpi .kl { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-top: 4px; font-weight: 750; }
.kpi .ks { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.4; }
.kpi-flex { display: flex; gap: 12px; align-items: center; }
.donut-mini { width: 52px; flex: none; }
.lvl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 4px; }
.chev { position: absolute; top: 14px; right: 16px; font-size: 9px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--acc); font-weight: 800; }
.spark { width: 100%; margin-top: 9px; height: 22px; }

/* expanded panel */
.exp-panel { position: relative; border-inline-start: none; outline: 1px solid rgba(163,230,53,.4); grid-column: 1 / -1; }
@media (min-width: 641px) { .kpi-row .exp-panel { order: 99; } }
.exp-panel h3 { color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: -.2px; font-weight: 750; }
.exp-close { position: absolute; top: 14px; right: 16px; margin-inline-start: 0; }
.exp-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.wday { display: grid; grid-template-columns: 48px 1fr 1fr 62px; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; border-top: 1px solid var(--line); }
.wday:first-of-type { border-top: none; }
.wday .wbar { height: 9px; }
.attn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.attn-grid .attn-item { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px; }

/* 3D snippet */
.snap3d { cursor: pointer; position: relative; transition: var(--tr); overflow: hidden; }
.snap3d:hover { transform: translateY(-2px); border-color: rgba(163,230,53,.45); }
.snap3d img, .snap3d .snap-svg { width: 100%; aspect-ratio: 16/9.5; object-fit: cover; display: block; border-radius: var(--r-sm); background: linear-gradient(160deg, #22302A, #182119); }

/* dashboard bits */
.attn-item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; transition: var(--tr); }
.attn-item:first-of-type { border-top: none; }
.attn-item:hover { background: rgba(255,255,255,.05); }
.attn-item img { width: 46px; height: 46px; object-fit: cover; flex: none; border-radius: 9px; }
.attn-item .nm { font-weight: 700; font-size: 13.5px; }
.attn-item .cd { color: var(--attn); font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.harv-item { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.harv-item:first-of-type { border-top: none; }
.harv-item b { min-width: 110px; } .harv-item span { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; text-align: center; background: rgba(255,255,255,.03); }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--acc); }
.stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-top: 3px; font-weight: 650; }
.mini-task { display: flex; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; align-items: flex-start; }
.mini-task:first-of-type { border-top: none; }
.dot-k { width: 8px; height: 8px; border-radius: 50%; background: var(--fruit); margin-top: 5px; flex: none; }
.health-row { display: flex; gap: 16px; align-items: center; }
.donut { width: 108px; flex: none; }
.donut-big { font: 800 20px -apple-system, sans-serif; fill: var(--ink); }
.donut-small { font: 500 8.5px -apple-system, sans-serif; fill: var(--muted); }
.health-legend { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.health-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; }
.wlbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.wlbl b { color: var(--ink); }
.wbar { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.wbar i { display: block; height: 100%; border-radius: 99px; }
.wmsg { font-size: 13px; margin-top: 10px; line-height: 1.5; }
.wmsg.suggest { color: var(--acc); border-inline-start: 3px solid var(--acc); padding-inline-start: 10px; }
.zone-photo { width: 100%; aspect-ratio: 16/7; object-fit: cover; border-radius: var(--r-sm); }
.pod .pod-img { width: 100%; aspect-ratio: 4/3.4; object-fit: cover; cursor: pointer; border-radius: var(--r-sm); transition: var(--tr); }
.pod .pod-img:hover { transform: scale(1.015); }
.feed-item { font-size: 12.5px; padding: 6px 0; border-top: 1px solid var(--line); }
.feed-item:first-of-type { border-top: none; }
.feed-item .fd { color: var(--muted); font-size: 11px; margin-inline-end: 6px; }
.foundation { margin-top: 14px; font-size: 12.5px; }
.fbar { height: 7px; background: rgba(255,255,255,.08); border-radius: 99px; margin: 7px 0; overflow: hidden; }
.fbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); border-radius: 99px; }

/* map */
.map-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { padding: 10px 16px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 13.5px; width: 230px; border-radius: 999px; transition: var(--tr); }
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(163,230,53,.15); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--card); color: var(--muted); padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; transition: var(--tr); }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.on { color: var(--ink); border-color: rgba(163,230,53,.6); background: rgba(163,230,53,.12); }
.ghost-btn { border: 1px solid var(--line-2); background: transparent; color: var(--muted); padding: 8px 15px; font-size: 12.5px; font-weight: 600; cursor: pointer; margin-inline-start: auto; border-radius: 999px; transition: var(--tr); }
.ghost-btn:hover { border-color: var(--acc); color: var(--acc); }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
#map-container { position: relative; background: var(--card-solid); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; cursor: grab; }
#map-container:active { cursor: grabbing; }
#map-container svg { display: block; width: 100%; height: auto; }
.canopy { cursor: pointer; }
.canopy.dim { opacity: 0.1 !important; pointer-events: none; }
.canopy .ring { fill: none; stroke: transparent; stroke-width: 0.16; transition: stroke .12s ease; }
@media (hover: hover) {
  .canopy:hover .ring { stroke: rgba(35,40,32,.55); }
  .canopy:hover { filter: brightness(1.08); }
}
.canopy.selected .ring { stroke: #2F5D3A; stroke-width: 0.26; }
#map-svg text { font-family: system-ui, -apple-system, sans-serif; paint-order: stroke; stroke: rgba(251,248,239,.85); stroke-width: 0.18; stroke-linejoin: round; }
.zone-poly { cursor: pointer; }
.zone-poly:hover { filter: brightness(0.96); }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tooltip { position: fixed; z-index: 40; background: rgba(14,20,17,.92); border: 1px solid var(--glass-border); color: var(--ink); font-size: 12.5px; padding: 8px 12px; pointer-events: none; max-width: 240px; border-radius: 10px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.tooltip .v { color: var(--muted); font-size: 11.5px; }

/* 3d */
.three-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
#three-container { position: relative; border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--shadow); height: 74vh; min-height: 440px; overflow: hidden; background: linear-gradient(160deg, #22302A, #182119); }
#three-container canvas { display: block; }
.three-hint { position: absolute; left: 14px; bottom: 12px; z-index: 5; font-size: 11.5px; color: rgba(237,242,234,.75); background: rgba(14,20,17,.55); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(8px); }
.three-hint.map-hint { top: 12px; bottom: auto; } /* the map runs taller than the screen - keep the hint where the eye lands */
.wx-badge { position: absolute; top: 14px; left: 14px; z-index: 6; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.wx-now { display: flex; align-items: center; gap: 8px; background: rgba(14,20,17,.6); border: 1px solid rgba(255,255,255,.14); padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(10px); font-size: 13.5px; }
.wx-now b { font-weight: 750; } .wx-now span { color: var(--acc2); font-weight: 700; }
.wx-live { font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; color: var(--acc); border: 1px solid rgba(163,230,53,.5); padding: 2px 7px; border-radius: 999px; }
.wx-chips { display: flex; gap: 5px; flex-wrap: wrap; max-width: 330px; }
.wx-chip { font-size: 10.5px; font-weight: 650; padding: 5px 10px; border-radius: 999px; cursor: pointer; background: rgba(14,20,17,.5); border: 1px solid rgba(255,255,255,.12); color: rgba(237,242,234,.72); backdrop-filter: blur(8px); transition: var(--tr); }
.wx-chip:hover { color: var(--ink); border-color: rgba(163,230,53,.5); }
.wx-chip.on { background: rgba(163,230,53,.18); border-color: rgba(163,230,53,.6); color: var(--acc); }

/* detail */
.detail { background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; max-height: 78vh; overflow-y: auto; backdrop-filter: blur(14px);
  align-self: start; /* a short card is a short card, never a full-height empty box */ }
/* nothing selected: give the whole width back to the map, the twin or the designer */
.three-wrap.no-detail, .map-wrap.no-detail { grid-template-columns: minmax(0, 1fr); }
.ds-wrap.no-detail { grid-template-columns: 250px minmax(0, 1fr); }
.no-detail > .detail, .no-detail > .ds-side { display: none; }
.detail-empty { color: var(--muted); font-size: 13px; }
.detail h2 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 2px; }
.detail .latin { font-style: italic; color: var(--muted); font-size: 13px; }
.detail .hero { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-top: 12px; cursor: zoom-in; border-radius: var(--r-sm); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 4px 10px; border: 1px solid var(--line-2); margin: 8px 5px 0 0; color: var(--muted); border-radius: 999px; background: rgba(255,255,255,.04); }
.badge.attention { color: var(--attn); border-color: rgba(255,107,94,.5); background: rgba(255,107,94,.08); }
.badge.ok { color: var(--ok); border-color: rgba(111,207,124,.5); background: rgba(111,207,124,.08); }
.detail dl { margin: 12px 0 4px; font-size: 13.5px; }
.detail dt { color: var(--muted); margin-top: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 750; }
.detail dd { margin: 2px 0 0; }
.cond { color: var(--attn); font-size: 13px; margin-top: 3px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: pointer; border-radius: 8px; transition: var(--tr); }
.thumbs img:hover { transform: scale(1.05); }
.care-list { margin-top: 6px; font-size: 13px; list-style: none; }
.care-list li { margin: 7px 0 0; padding-inline-start: 12px; border-inline-start: 2.5px solid rgba(163,230,53,.4); }
.care-month { color: var(--gold); font-size: 10.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.note-row { display: flex; gap: 7px; margin-top: 14px; }
.note-row input { flex: 1; }
.note-row input::placeholder { color: var(--muted); }
.note-row button { border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--ink); padding: 9px 14px; cursor: pointer; border-radius: 10px; font-weight: 650; transition: var(--tr); }
.note-row button:hover { background: var(--acc); color: #10160D; border-color: var(--acc); }
.obs { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; padding-inline-start: 10px; border-inline-start: 2px solid var(--line-2); }
.obs > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* always drawn, never hover-only: this is used on a phone out in the garden */
.obs .xdel { flex: none; padding: 0; line-height: 1.35; }
.file-btn { border: 1px solid var(--line-2); padding: 9px 12px; font-size: 12.5px; cursor: pointer; color: var(--muted); border-radius: 10px; transition: var(--tr); }
.file-btn:hover { border-color: var(--acc); color: var(--acc); }

/* inventory */
#inventory table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); font-size: 13.5px; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--glass-border); }
#inventory th, #inventory td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); }
#inventory th { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); background: rgba(255,255,255,.04); position: sticky; top: 64px; font-weight: 750; }
/* only the species rows open a plant; the unplaced rows must not offer a click */
#inventory tr[data-plant]:hover td { background: rgba(255,255,255,.05); cursor: pointer; }
.src { font-size: 12px; color: var(--muted); }
.st-attention { color: var(--attn); font-weight: 700; } .st-unverified { color: var(--gold); }

/* tasks */
.tasks-cols { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 820px; }
.tasks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tasks-head h2 { margin-bottom: 0; }
.tasks-cols h2 { margin-bottom: 12px; }
.task { display: flex; gap: 11px; align-items: flex-start; background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; font-size: 13.5px; transition: var(--tr); }
.task:hover { border-color: rgba(163,230,53,.35); }
.task input[type=checkbox] { margin-top: 2px; accent-color: var(--acc); width: 16px; height: 16px; }
.task.done { opacity: 0.4; text-decoration: line-through; }
.task .meta { color: var(--muted); font-size: 11px; margin-top: 3px; }

/* journal + planner */
.hform { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }

.hform button { border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--ink); padding: 9px 15px; cursor: pointer; font-size: 13px; font-weight: 650; border-radius: 10px; transition: var(--tr); }
.hform button:hover { background: var(--acc); color: #10160D; border-color: var(--acc); }
.hrow { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.hrow.slim { padding: 6px 0; font-size: 13px; }
.hrow .hkg { margin-inline-start: auto; font-weight: 800; color: var(--acc); white-space: nowrap; }
.hrow.is-low b { color: var(--attn); }
.lowb { font-size: 9.5px; font-weight: 800; color: var(--attn); border: 1px solid rgba(255,107,94,.5); padding: 2px 7px; border-radius: 999px; }
.xdel { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.xdel:hover { color: var(--attn); }
.qbtn { border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--ink); cursor: pointer; padding: 2px 10px; border-radius: 8px; transition: var(--tr); }
.qbtn:hover { border-color: var(--acc); color: var(--acc); }
.hchart { width: 100%; }
.hchart .hx { font: 500 7px -apple-system, sans-serif; fill: var(--muted); }
.hchart .hv { font: 800 6.5px -apple-system, sans-serif; fill: var(--fruit); }
.kgby { margin-top: 10px; font-size: 12.5px; }
.pest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pest-item { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px; font-size: 12.5px; }
.pest-item img { width: 64px; height: 64px; object-fit: cover; flex: none; border-radius: 8px; }
.frost-big { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; background: linear-gradient(90deg, var(--acc2), var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin: 8px 0 2px; }
.frost-big span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--muted); }
.moon-row { display: flex; gap: 14px; align-items: center; }
.moon { width: 54px; flex: none; }
.rot { width: 100%; border-collapse: collapse; font-size: 13px; }
.rot th { text-align: start; font-size: 10px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); padding: 4px 8px 4px 0; font-weight: 750; }
.rot td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); }
.tg-grid { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.tg-grid label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-weight: 700; }

.zf { width: 58px; padding: 3px 6px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--ink); font-size: 12px; border-radius: 7px; }

/* harvest timeline */
.tl { display: grid; grid-template-columns: 132px 1fr; gap: 6px 12px; align-items: center; }
.tl-name { font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: var(--tr); }
.tl-name:hover { color: var(--acc); }
.tl-cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.tl-cells i { height: 15px; background: rgba(255,255,255,.07); display: block; border-radius: 4px; }
.tl-cells i.wk0 { outline: 1.5px solid var(--acc); outline-offset: -1.5px; }
.tl-cells i.on.c-fruit { background: var(--fruit); } .tl-cells i.on.c-nut { background: var(--nut); }
.tl-cells i.on.c-berry { background: var(--berry); } .tl-cells i.on.c-cucurbit { background: var(--cucurbit); }
.tl-cells i.on.c-veg { background: var(--veg); } .tl-cells i.on.c-vine { background: var(--vine); }

/* action center sections */
.ac-sec { margin-bottom: 12px; }
.ac-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 800; padding: 6px 0 4px; }
.ac-label.now { color: var(--attn); } .ac-label.week { color: var(--fruit); } .ac-label.later { color: var(--muted); }
.ac-label span { color: var(--muted); font-weight: 500; }
.ac-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 13.5px; cursor: pointer; border-radius: 8px; transition: var(--tr); }
.ac-item.plain { cursor: default; }
.ac-item input { margin-top: 2px; accent-color: var(--acc); width: 15px; height: 15px; }
.ac-item:hover { background: rgba(255,255,255,.04); }

#lightbox { position: fixed; inset: 0; background: rgba(6,9,7,0.93); display: none; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; backdrop-filter: blur(6px); }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 14px; }

/* v1.0: ask, time panel, roles, walk mode, QR, yield */
.ask-row { display: flex; gap: 8px; margin: 0 0 14px; }
.ask-row input { flex: 1; max-width: 640px; padding: 12px 18px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 14px; border-radius: 999px; backdrop-filter: blur(10px); }
.ask-row input::placeholder { color: var(--muted); }
.ask-row input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(163,230,53,.15); }
.ask-row .ghost-btn { margin-inline-start: 0; border-color: rgba(163,230,53,.5); color: var(--acc); font-weight: 700; }
#ask-ans { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ask-card { background: var(--card); border: 1px solid rgba(163,230,53,.35); border-radius: var(--r-sm); padding: 12px 16px; max-width: 460px; font-size: 13.5px; backdrop-filter: blur(10px); }
.ask-card b { display: block; margin-bottom: 4px; }

.role-sel option { background: var(--card-solid); }
body.role-viewer :is(.hform, .note-row, .act-bar, .act-pane, .xdel, .qbtn, .file-btn, .tg-grid, #tg-save, #tg-test, .zf, input[data-actask], .task input, #quick-add, #qr-print) { display: none !important; }
.time-panel { position: absolute; top: 14px; right: 14px; z-index: 6; display: flex; flex-direction: column; gap: 6px; background: rgba(14,20,17,.62); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 14px; backdrop-filter: blur(10px); min-width: 250px; }
/* fold control: the panel collapses to its own header so the twin is never buried */
.tp-fold { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: none; border: 0; padding: 0 0 2px; margin: 0; cursor: pointer; color: var(--muted);
  font: inherit; text-transform: uppercase; letter-spacing: .9px; font-size: 9px; font-weight: 750; }
.tp-fold:hover { color: var(--acc); }
.tp-fold svg { flex: none; opacity: .85; }
.time-panel.collapsed { min-width: 0; padding: 9px 12px; gap: 0; }
.time-panel.collapsed .tp-body { display: none; }
.time-panel.collapsed .tp-fold { padding-bottom: 0; }
.tp-body { display: flex; flex-direction: column; gap: 6px; }
.tp-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: rgba(237,242,234,.85); }
.tp-row span { width: 46px; text-transform: uppercase; letter-spacing: .8px; font-size: 9px; font-weight: 750; color: var(--muted); }
.tp-row b { min-width: 62px; text-align: end; font-size: 11.5px; }
.tp-row input[type=range] { flex: 1; accent-color: var(--acc); height: 4px; }
.tp-row .ghost-btn { margin-inline-start: 0; width: 100%; padding: 6px 10px; font-size: 11px; }
.tp-row .ghost-btn.on-acc { border-color: var(--acc); color: var(--acc); background: rgba(163,230,53,.12); }
.sun-leg { display: flex; gap: 8px; flex-wrap: wrap; font-size: 9.5px; color: rgba(237,242,234,.8); align-items: center; }
.sun-leg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 3px; }
.yrow { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 8px; align-items: center; font-size: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.yrow:first-of-type { border-top: none; }
.yrow b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yrow .wbar { height: 9px; }
.walk-ov { position: fixed; inset: auto 12px 12px 12px; z-index: 45; }
.walk-card { background: rgba(14,20,17,.92); border: 1px solid rgba(163,230,53,.4); border-radius: var(--r); padding: 14px 16px; backdrop-filter: blur(14px); box-shadow: var(--shadow); max-width: 480px; margin: 0 auto; }
.walk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#qr-sheet { display: none; }
body.printing-tags #qr-sheet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4mm; background: #fff; color: #000; padding: 8mm; }
.qr-tag { display: flex; gap: 3mm; align-items: center; border: 1px dashed #999; padding: 3mm; break-inside: avoid; }
.qr-tag svg { width: 22mm; height: 22mm; flex: none; }
.qr-tag b { display: block; font-size: 11px; } .qr-tag span { display: block; font-size: 9px; color: #444; }
.qr-tag .qid { font-family: monospace; }
.qr-head { grid-column: 1 / -1; font: 700 12px sans-serif; padding-bottom: 2mm; }
@media print {
  body.printing-tags > *:not(#qr-sheet) { display: none !important; }
  body.printing-tags { background: #fff !important; }
  body.printing-tags #qr-sheet { display: grid !important; }
}

/* v1.1: advisor, crowding, plant doctor */
.ghost-btn.on-acc { border-color: var(--acc); color: var(--acc); background: rgba(163,230,53,.12); }
.adv-item { border-top: 1px solid var(--line); padding: 12px 0 10px; }
.adv-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.adv-h b { font-size: 15px; }
.adv-why { list-style: none; margin: 6px 0 8px; font-size: 12.5px; color: var(--muted); }
.adv-why li { padding-inline-start: 14px; position: relative; margin: 3px 0; line-height: 1.4; }
.adv-why li::before { content: '+'; position: absolute; left: 0; color: var(--acc); font-weight: 800; }
.adv-add { margin-inline-start: 0 !important; padding: 5px 12px; font-size: 11.5px; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sym-grid { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 10px; }
.sym { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; transition: var(--tr); user-select: none; }
.sym:hover { border-color: var(--ink); }
.sym.on { border-color: var(--acc); background: rgba(163,230,53,.12); color: var(--ink); }
.sym.hinted { box-shadow: inset 3px 0 0 var(--acc2); }
.sym input { accent-color: var(--acc); pointer-events: none; }
.doc-thumb { width: 130px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin: 4px 8px 4px 0; vertical-align: middle; }
.diag { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 9px; }
.diag.top { border-color: rgba(163,230,53,.45); background: rgba(163,230,53,.05); }
.diag-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diag-h b { font-size: 14.5px; }
.diag-score { margin-inline-start: auto; font-size: 11px; font-weight: 800; color: var(--acc); }
.diag-b { font-size: 12.5px; margin-top: 6px; }
.diag-b b { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); margin-top: 8px; }
.diag-b p { line-height: 1.5; margin-top: 2px; }
.diag-b .hform button { padding: 6px 12px; font-size: 12px; }
.crowd-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.crowd-row:first-of-type { border-top: none; }
.crowd-row .hkg { margin-inline-start: auto; white-space: nowrap; font-weight: 800; }

/* garden designer */
.ds-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

#ds-name { font-weight: 700; min-width: 180px; }
.ds-stats { font-size: 12.5px; color: var(--muted); }
.ds-stats b { color: var(--acc); }
.ds-cov { display: inline-flex; gap: 3px; align-items: center; font-size: 11px; color: var(--muted); }
.ds-cov i { width: 10px; height: 14px; border-radius: 3px; background: rgba(255,255,255,.08); display: inline-block; }
.ds-cov i.on { background: var(--acc); }
.ds-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr) 280px; gap: 14px; }
.ds-palette { display: flex; flex-direction: column; gap: 10px; max-height: 76vh; }
.ds-pal-list { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding-inline-end: 4px; }
.ds-pal { color: var(--ink); display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; text-align: start;
  background: var(--card); border: 1px solid var(--glass-border); border-radius: 12px; padding: 7px 10px;
  color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--tr); }
.ds-pal:hover { border-color: rgba(163,230,53,.5); }
.ds-pal.on { border-color: var(--acc); background: rgba(163,230,53,.12); }
.ds-pal svg { width: 34px; height: 34px; }
.ds-pal small { color: var(--muted); font-weight: 500; font-size: 10.5px; white-space: nowrap; }
.ds-3d-host { min-width: 0; position: relative; }
.ds-3d-host #three-container { height: 68vh; min-height: 420px; }
.ds-3d-host .three-hint, .ds-3d-host .time-panel { display: none; }
#ds-trash { display: none; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 6;
  align-items: center; gap: 9px; padding: 11px 18px; border-radius: 999px;
  background: rgba(14, 20, 17, .82); border: 1.5px dashed rgba(255, 255, 255, .35); color: var(--muted);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .82rem; letter-spacing: .02em; pointer-events: none; transition: border-color .15s, color .15s, background .15s; }
#ds-trash.show { display: flex; }
#ds-trash.hot { border-color: #FF6B5E; color: #FF8A7E; background: rgba(90, 28, 22, .78); }
.ds-item { cursor: grab; }
.ds-item.sel { cursor: grabbing; }
.ds-item.ds-removed { cursor: pointer; }
.ds-side { background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; backdrop-filter: blur(14px); align-self: start; }
.ds-side h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
@media (max-width: 980px) { .ds-wrap { grid-template-columns: 1fr; } .ds-palette { max-height: 200px; } .ds-pal-list { flex-direction: row; flex-wrap: wrap; } .ds-pal { grid-template-columns: 30px 1fr; } .ds-pal small { display: none; } }

/* connect screen (native first run / server offline) */
.connect-ov { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
/* photo timeline */
.ptl { margin-top: 12px; }
.ptl .hero { margin-top: 0; }
.ptl-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ptl-bar input[type=range] { flex: 1; accent-color: var(--acc); }
.ptl-strip { display: flex; gap: 5px; overflow-x: auto; margin-top: 8px; padding-bottom: 4px; }
.ptl-strip img { width: 52px; height: 40px; object-fit: cover; border-radius: 7px; cursor: pointer;
  opacity: .5; border: 1.5px solid transparent; transition: var(--tr); flex: none; }
.ptl-strip img:hover { opacity: .85; }
.ptl-strip img.on { opacity: 1; border-color: var(--acc); }

/* offline + toast */
.offline-badge { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: rgba(194,100,60,.92); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  padding: 6px 14px; border-radius: 999px; backdrop-filter: blur(8px);
  max-width: calc(100vw - 24px); text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 80;
  background: rgba(14,20,17,.94); border: 1px solid var(--glass-border); color: var(--ink);
  padding: 11px 18px; border-radius: 12px; font-size: 13px; max-width: 90vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; backdrop-filter: blur(12px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
/* compact tables in the care hub */
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.mini th { text-align: start; font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); font-weight: 750; padding: 4px 6px 4px 0; border-bottom: 1px solid var(--line); }
table.mini td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv-line { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.kv-line b { color: var(--ink); font-size: 17px; font-weight: 800; }
details summary { cursor: pointer; padding: 4px 0; }
details summary:hover { color: var(--ink); }

.qr-phone svg { width: 160px; height: 160px; background: #fff; padding: 8px; border-radius: 10px; display: block; }

/* ---- AR: camera + floating labels ---- */
.ar-ov { position: fixed; inset: 0; z-index: 60; background: #000; overflow: hidden; }
.ar-ov video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#ar-labels { position: absolute; inset: 0; }
.ar-label {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: rgba(14,20,17,.72); border: 1px solid rgba(255,255,255,.22); border-inline-start: 3px solid var(--acc);
  border-radius: 12px; padding: 8px 12px; white-space: nowrap; color: var(--ink); font-size: 13px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  will-change: transform; transition: opacity .2s;
}
.ar-label::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 22px; background: linear-gradient(rgba(255,255,255,.55), transparent); }
.ar-label b { font-weight: 750; }
.ar-label span { color: var(--muted); font-size: 11.5px; }
.ar-label.c-fruit { border-inline-start-color: var(--fruit); } .ar-label.c-nut { border-inline-start-color: var(--nut); }
.ar-label.c-berry { border-inline-start-color: var(--berry); } .ar-label.c-vine { border-inline-start-color: var(--vine); }
.ar-label.c-cucurbit { border-inline-start-color: var(--cucurbit); } .ar-label.c-hedge { border-inline-start-color: var(--hedge); }
.ar-label.c-herb { border-inline-start-color: var(--herb); }
.arb { font-size: 9.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .6px; padding: 2.5px 7px; border-radius: 999px; }
.arb.attn { background: rgba(255,107,94,.2); color: #FF8A7E; }
.arb.phi { background: rgba(194,100,60,.22); color: #E09A6F; }
.arb.risk { background: rgba(229,192,91,.18); color: var(--gold); }
.ar-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: linear-gradient(rgba(0,0,0,.55), transparent);
  color: var(--ink); font-size: 12.5px;
}
#ar-radar { position: absolute; left: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 118px; height: 118px;
  background: rgba(14,20,17,.55); border: 1px solid rgba(255,255,255,.18); border-radius: 50%; backdrop-filter: blur(8px); }
.arr-plot { fill: rgba(163,230,53,.1); stroke: rgba(163,230,53,.5); stroke-width: 1; }
.arr-dot { fill: rgba(255,255,255,.5); }
.arr-me { fill: var(--acc); }
.arr-cone { fill: rgba(163,230,53,.28); }
.ar-sheet {
  position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  background: rgba(14,20,17,.9); border: 1px solid var(--glass-border); border-radius: var(--r);
  padding: 16px 18px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

.connect-card { max-width: 420px; width: 100%; background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r); padding: 26px; backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 12px; }
.connect-card h2 { font-size: 22px; }
.connect-card input { padding: 12px 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.06); color: var(--ink); border-radius: 12px; font-size: 15px; }
.connect-card button { padding: 12px; border-radius: 12px; border: none; background: linear-gradient(135deg, var(--acc), #7BC93A); color: #10160D; font-weight: 800; font-size: 15px; cursor: pointer; }

@media (max-width: 980px) {
  header, nav, main { padding-inline-start: 14px; padding-inline-end: 14px; }
  .map-wrap, .tasks-cols, .three-wrap,
  .map-wrap.no-detail, .three-wrap.no-detail, .ds-wrap.no-detail { grid-template-columns: 1fr; }
  .detail { max-height: none; }
  .col-4, .col-6, .col-8 { grid-column: span 12; }
  .col-3 { grid-column: span 6; }
  .exp-cols, .doc-grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 24px; }
  #inventory th { top: 0; }
}

/* separate the two status counts when a species carries both */
#inventory .st-attention + .st-unverified::before { content: '·'; margin: 0 5px 0 1px; color: var(--muted); }

/* A five-column table cannot hold a variety list at 375px: it either pushed the page
   sideways - taking the header and tab bar with it - or broke words mid-letter. On a
   phone each species becomes a stacked block instead: name and count on the first line,
   then category, then varieties, then status. */
@media (max-width: 640px) {
  #inventory .inv-card:active { border-color: var(--acc); }
  #inventory .inv-seg button { font-size: 12.5px; }
  #inventory .cat-cell i { flex: none; }
}

/* phone-native chrome: bottom tab bar + safe areas (applies in the iOS/Android shells too) */
@media (max-width: 640px) {
  /* under 16px iOS zooms the page on focus - a webby jolt the app must never do */
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea { font-size: 16px; }
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  main { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
  header { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 6px; }
  header h1 { font-size: 17px; letter-spacing: 4px; }
  .brand svg.mark { width: 20px; height: 20px; }
  .wx-rail { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 0 4px; margin: 0 0 14px; }
  .wx-rail::-webkit-scrollbar { display: none; }
  .wx-rail .wx { flex: none; min-width: 64px; }
  /* chrome is furniture: it neither selects nor flashes grey under a finger */
  header, nav, .ms-panel { -webkit-user-select: none; user-select: none; }
  nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(14,20,17,0.9); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--line); border-bottom: none;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    display: flex; gap: 0;
  }
  /* ONE row: the four everyday destinations plus More; the rest live in the sheet */
  nav .tab { display: none; }
  nav .tab[data-tab="today"], nav .tab[data-tab="map"], #nav-cam,
  nav .tab[data-tab="inventory"], nav .tab[data-tab="care"] { display: flex; flex: 1 1 0; min-width: 0; }
  nav .tab[data-tab="today"] { order: 1; } nav .tab[data-tab="map"] { order: 2; }
  #nav-cam { order: 3; } nav .tab[data-tab="inventory"] { order: 4; } nav .tab[data-tab="care"] { order: 5; }
  .tab { flex-direction: column; gap: 3px; padding: 6px 2px 4px; font-size: 10px; font-weight: 600; text-align: center; border-radius: 12px; justify-content: center; }
  .tab svg { width: 22px; height: 22px; }
  /* active = tint, the platform convention - not a lit pill */
  .tab.active { background: none; box-shadow: none; color: var(--acc); font-weight: 700; }
  .tab:hover { background: none; border-color: transparent; }
  .tab:active { opacity: .55; }
  /* --navh is measured from the real tab bar at runtime and already includes the safe-area
     inset, because that inset lives in the bar's own bottom padding. The literals are the
     fallback for the two-row, ten-tab bar before the first measurement lands. */
  main { padding-bottom: calc(var(--navh, 76px) + 14px); }
  .walk-ov { bottom: calc(var(--navh, 76px) + 8px); }
  .kpi .kv { font-size: 28px; }
  .map-toolbar .ghost-btn { padding: 8px 12px; }
  .three-wrap #three-container { height: 64vh; min-height: 380px; }
  /* On a phone the controls cannot float over the scene - at this width they cover the whole
     garden. Pin them across the foot of the viewport as a compact, scrollable strip so the
     top half always shows the 3D. The container keeps its fixed height, so three.js sizing
     is untouched. */
  /* closed: one floating chip in the scene corner. Open: a bottom sheet, capped
     at 55% of the screen and scrollable, exactly like the app's other sheets. */
  .time-panel.collapsed { position: absolute; top: 10px; right: 10px; left: auto; bottom: auto;
    border-radius: 999px; padding: 8px 14px; min-width: 0; }
  .time-panel:not(.collapsed) {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 70;
    border-radius: 22px 22px 0 0; border-bottom: none;
    background: var(--card-solid, #1A231D);
    min-width: 0; max-height: 55%; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 48px rgba(0,0,0,.5);
  }
  .time-panel:not(.collapsed) .tp-fold { position: sticky; top: 0; background: inherit; padding: 4px 0 8px; z-index: 1; }
  .time-panel .tp-modes { display: flex; flex-wrap: wrap; }
  .time-panel .tp-modes .ghost-btn { width: auto; flex: 1 1 30%; }
  .time-panel .tp-info { max-width: none; }
  .three-wrap .three-hint { display: none; }
  /* touch targets: the sliders and buttons breathe a little more in the sheet */
  .time-panel:not(.collapsed) .tp-row { min-height: 38px; }
  .time-panel:not(.collapsed) input[type=range] { flex: 1; }
}

/* urgent engine tasks */
.task.urgent { border-inline-start: 3px solid var(--attn); padding-inline-start: 11px; }
.task.urgent .meta { color: var(--attn); }

/* onboarding wizard */
.wiz-ov { position: fixed; inset: 0; z-index: 90; background: rgba(6,10,8,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.wiz { width: 100%; max-width: 520px; background: var(--card-solid); border: 1px solid var(--glass-border);
  border-radius: var(--r); padding: 20px 22px 22px; box-shadow: var(--shadow); max-height: 88vh; overflow-y: auto; }
.wiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 1.2px; }
.wiz-head b { color: var(--ink); }
.wiz h2 { font-size: 20px; margin-bottom: 14px; }
.wiz-list { max-height: 210px; overflow-y: auto; margin-top: 12px; }

/* 3D mode panel: underground / water / 4D / overlays */
.tp-sep { height: 1px; background: rgba(255,255,255,.12); margin: 9px 0 8px; }
.tp-modes { flex-wrap: wrap; gap: 4px; }
.tp-modes .ghost-btn { margin: 0; padding: 5px 10px; font-size: 11px; }
.ov-btn { opacity: .85; }
.tp-info { margin-top: 8px; font-size: 11.5px; color: var(--muted); max-width: 300px; }
.tp-info .src { margin-top: 6px; line-height: 1.45; }
.tp-legend { display: flex; flex-direction: column; gap: 3px; }
.tp-legend span { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.tp-legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.tp-legend b { margin-inline-start: auto; color: var(--ink); }
.ov-scale { display: flex; justify-content: space-between; font-size: 10.5px; margin-top: 8px;
  padding: 5px 9px; border-radius: 7px; color: #10160D; font-weight: 700; }
.ov-light   { background: linear-gradient(90deg, #1b2a3a, #2f6f4f 45%, #E8D14A 78%, #FFF3B0); }
.ov-shelter { background: linear-gradient(90deg, #7A3B2E, #C2643C 40%, #8FBF6A 75%, #2E8B57); }
.ov-frost   { background: linear-gradient(90deg, #2F5D3A, #7FB3C8 55%, #9FD8EE 80%, #E6F6FF); }
.ov-heat    { background: linear-gradient(90deg, #2C4A63, #8FA86B 40%, #E8A34A 70%, #D1462F); }
.ov-wetness { background: linear-gradient(90deg, #C9A227, #A8B060 40%, #4C8FBF 75%, #1D4E7A); }
.ov-scale span:first-child { color: rgba(255,255,255,.92); }

/* plants known but not yet located */
.unplaced-row td { opacity: .82; }
.unplaced-row .badge { background: rgba(229,192,91,.16); color: var(--gold); }

/* ---------- annual programme ---------- */
.prog-head { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.prog-head select { flex: 1; min-width: 160px; }
.prog-act { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; margin-bottom: 8px;
  border-inline-start: 3px solid var(--acc); background: rgba(255,255,255,.04); border-radius: 0 10px 10px 0; }
.prog-act.kind-protect { border-inline-start-color: #E89A3C; }
.prog-act.kind-prune { border-inline-start-color: #6FA8DC; }
.prog-act.kind-sow { border-inline-start-color: #A3E635; }
.prog-act.kind-feed { border-inline-start-color: #B08968; }
.prog-act.kind-wash { border-inline-start-color: #E8E4D8; }
.prog-act.kind-water { border-inline-start-color: #2DD4BF; }
.prog-act.kind-harvest { border-inline-start-color: #D4A72C; }
.prog-act b { font-size: 14px; font-weight: 650; line-height: 1.35; }
.prog-act > span:not(.src) { font-size: 13px; line-height: 1.45; }
.prog-species { display: flex; flex-wrap: wrap; gap: 5px; }
.prog-species i { font-style: normal; font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: rgba(163,230,53,.12); color: var(--acc); }
.prog-month h4 { margin: 12px 0 6px; font-size: 13px; color: var(--acc); }
.prog-water { margin-bottom: 10px; }

.three-reset { position: absolute; bottom: 14px; right: 14px; z-index: 6;
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(14,20,17,.62); color: rgba(237,242,234,.9); font-size: 11.5px; font-weight: 650;
  backdrop-filter: blur(10px); cursor: pointer; }
.three-reset:hover { border-color: var(--acc); color: var(--acc); }

/* the Designer's irrigation palette */
.irr-pal { display: flex; flex-direction: column; gap: 4px; }
.irr-zone-h { display: flex; align-items: center; gap: 6px; margin: 10px 0 3px; font-size: 11px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--mut, #8a8f88); }
.irr-zone-h i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.irr-zone-h .irr-mini { margin-inline-start: auto; padding: 2px 8px; font-size: 11px; }
.irr-pal .ds-pal .irr-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; }
.irr-pal .irr-num { min-width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; font-style: normal; padding: 0 3px; }

/* the sowing window card */
.sow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.sow-item { background: var(--card2, rgba(255,255,255,.04)); border-radius: 10px; padding: 9px 11px; }
.sow-item b { display: block; margin-bottom: 4px; }
.sow-item small { color: var(--mut, #8a8f88); display: block; margin-top: 4px; }
.sow-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* the planting calendar bands */
.pgantt { margin: 12px 0; }
.pgantt .pg-head { display: block; margin-bottom: 6px; }
.pg-row, .pg-months { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; margin: 3px 0; }
.pg-row i { font-style: normal; font-size: 11px; color: var(--mut, #8a8f88); }
.pg-track { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.pg-track b { height: 12px; border-radius: 3px; background: rgba(127,127,127,.12); }
.pg-track b.pg-in { background: #7FB77E; }
.pg-track b.pg-out { background: #3F7D49; }
.pg-track b.pg-harv { background: #D98E32; }
.pg-lab span { font-size: 10px; text-align: center; color: var(--mut, #8a8f88); }
.pg-lab span.now { color: var(--acc, #7FCF6C); font-weight: 700; text-decoration: underline; }
.pgantt .src { display: block; margin-top: 5px; }

/* the verification walk bar */
#vw-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--card2, rgba(255,255,255,.05)); border: 1px solid rgba(232,161,60,.45);
  border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; }
#vw-bar img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
#vw-bar .vw-count { font-size: 11px; letter-spacing: .05em; color: var(--mut, #8a8f88); }
#vw-bar b { font-size: 15px; }
#vw-bar small { color: var(--mut, #8a8f88); }
#vw-bar em { font-style: normal; color: #E8A13C; font-size: 13px; }
#vw-bar .ghost-btn { margin: 0; padding: 5px 12px; }
.vw-pulse { animation: vwpulse 1.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes vwpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* during the verification walk the map wants room: the side panel holds the plant's
   own card, so the map takes the rest and stands tall enough to aim at a row */
.vw-live #map-container { min-height: 62vh; }
.vw-live #map-container svg { height: 62vh; }

/* ---- plant library ---- */
#library { max-width: 1000px; }
.lib-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.lib-toolbar .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
.lib-card { color: var(--ink); position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 8px 12px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; text-align: center; transition: var(--tr); }
.lib-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.lib-card svg { width: 46px; height: 46px; }
.lib-card b { font-size: 13.5px; line-height: 1.25; }
.lib-card small { color: var(--muted); font-size: 11px; }
.lib-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--fruit, #4A9152); }
.lib-hero { display: flex; align-items: center; gap: 16px; margin: 14px 0 6px; flex-wrap: wrap; }
.lib-hero-icon { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; padding: 10px; line-height: 0; }
.lib-hero-icon svg { width: 76px; height: 76px; }
.lib-hero h2 { margin: 0; }
.lib-hero-btns { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.lib-desc { max-width: 72ch; font-size: 14.5px; line-height: 1.55; margin: 10px 0 4px; }
.lib-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 4px; }
.lib-fact { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; }
.lib-fact small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; margin-bottom: 2px; }
.lib-fact b { font-size: 13.5px; }
.lib-fine { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.lib-tl { margin: 12px 0 4px; }
.lib-tl-row { display: grid; grid-template-columns: 120px repeat(12, 1fr); gap: 3px; align-items: center; margin-top: 3px; }
.lib-tl-row span { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-inline-end: 6px; }
.lib-tl-row i { height: 16px; border-radius: 4px; background: var(--line-2); opacity: .45; font-style: normal; }
.lib-tl-row.head i { background: none; opacity: 1; height: auto; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.lib-tl-row.head i.now { color: var(--attn); }
.lib-tl-row i.on { opacity: 1; }
.lib-tl-row i.ind { background: #D9A441; }
.lib-tl-row i.dir { background: #4A9152; }
.lib-tl-row i.tra { background: #22808A; }
.lib-tl-row i.har { background: #C05F38; }
.lib-note { background: var(--card); border-inline-start: 3px solid var(--fruit, #4A9152); border-radius: 8px; padding: 10px 13px; font-size: 13px; margin: 10px 0; max-width: 72ch; }
.lib-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.lib-var { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; font-size: 13px; }
.lib-var b { display: block; margin-bottom: 2px; }
.lib-var span { color: var(--muted); font-size: 12.5px; }
.lib-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
@media (max-width: 700px) { .lib-two { grid-template-columns: 1fr; } .lib-tl-row { grid-template-columns: 86px repeat(12, 1fr); } }
.chip.warn { border-color: rgba(214,69,69,.5); color: var(--ink); background: rgba(214,69,69,.08); }
.lib-link { padding: 3px 10px; font-size: 11.5px; margin-inline-start: 4px; }
.ds-pal { grid-template-columns: 36px 1fr auto auto; }
.ds-info { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-style: italic; font-weight: 700; font-family: Georgia, serif; cursor: pointer; transition: var(--tr); }
.ds-info:hover { color: var(--ink); border-color: var(--ink); }
.sow-item[data-libopen] { cursor: pointer; }
.sow-item[data-libopen]:hover b { text-decoration: underline; }

/* ---- right-to-left (Arabic) ----
   The box model is already written in logical properties, so only the handful of
   physically-anchored pieces need mirroring: absolute offsets, one-sided radii and
   the icon glyphs that point somewhere. */
html.rtl .exp-close { right: auto; left: 16px; }
html.rtl .prog-act { border-radius: 10px 0 0 10px; }
html.rtl .lib-dot { right: auto; left: 10px; }
html.rtl .ar-label { border-inline-start-width: 3px; }
html.rtl .back-arrow, html.rtl .dir-glyph { transform: scaleX(-1); }
html.rtl #ds-trash { right: auto; left: 12px; }
html.rtl .vw-bar .ghost-btn { margin-inline-start: 0; }
/* numbers, coordinates, dates and units stay left-to-right inside Arabic text */
html.rtl .src, html.rtl .kv, html.rtl .v, html.rtl code, html.rtl .latin { unicode-bidi: plaintext; }
html.rtl table.mini td, html.rtl #inventory td { unicode-bidi: plaintext; }
/* a value like "40 cm" or "16-30 °C" is a left-to-right run inside Arabic text;
   plaintext lets each element take its direction from its own first strong
   character, so numbers keep their units on the correct side */
html.rtl .lib-fact b, html.rtl .lib-fact small, html.rtl .badge, html.rtl .hkg,
html.rtl .care-month, html.rtl .lib-var b, html.rtl .stat .v, html.rtl .kpi .kv,
html.rtl .chip, html.rtl .sow-item small, html.rtl .tp-row b { unicode-bidi: plaintext; }

/* ---- language menu ---- */
/* a floating menu needs a SOLID surface: --card is a translucent overlay that only
   reads correctly when it sits directly on the page background */
.lang-menu { position: fixed; z-index: 60; min-width: 190px; padding: 6px; border-radius: 14px;
  background: var(--card-solid, #1A231D); border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 48px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4); }
.lang-menu-h { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 800;
  color: var(--muted); padding: 6px 10px 7px; }
.lang-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: start; transition: var(--tr); }
.lang-opt i { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; color: var(--muted); }
.lang-opt:hover { background: rgba(163,230,53,.14); color: var(--ink); }
.lang-opt:hover i { color: var(--ink); }
.lang-opt.on { background: rgba(163,230,53,.1); }
.lang-opt.on i { color: var(--acc, #A3E635); }

/* ---- More sheet: the tab bar overflow, raised as a bottom sheet ---- */
/* desktop keeps the full sidebar - More only exists on the phone bar */
@media (min-width: 641px) { #nav-more { display: none; } }
#nav-more.active { color: var(--acc); border-color: rgba(163,230,53,.45); }
#more-sheet { position: fixed; inset: 0; z-index: 80; }
.ms-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .22s ease; }
.ms-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card-solid, #1A231D);
  border: 1px solid var(--line-2); border-bottom: none; border-radius: 22px 22px 0 0;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(103%); transition: transform .26s cubic-bezier(.32,.72,.33,1);
  box-shadow: 0 -18px 48px rgba(0,0,0,.5); }
#more-sheet.open .ms-scrim { opacity: 1; }
#more-sheet.open .ms-panel { transform: none; }
.ms-grab { display: block; width: 40px; height: 4.5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; cursor: pointer; }
.ms-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 2px; }
.ms-item { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 2px 11px;
  background: none; border: 0; border-radius: 14px; color: var(--ink); font-size: 11px; font-weight: 600; cursor: pointer; }
.ms-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ms-item:active { background: rgba(255,255,255,.07); }
.ms-item.on { color: var(--acc); }
html.rtl .ms-panel { direction: rtl; }

/* ---- app feel: no grey tap flashes, gentle press states ---- */
* { -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  body { touch-action: manipulation; }
  .kpi:active, .lib-card:active, .chip:active, .ghost-btn:active, .sow-item:active { transform: scale(.97); opacity: .85; }
  .kpi, .lib-card, .chip, .ghost-btn, .sow-item { transition: transform .12s ease, opacity .12s ease; }
}

/* ---- centre camera button: the raised action in the middle of the bar ---- */
@media (min-width: 641px) { #nav-cam { display: none; } }
#nav-cam { padding-top: 0; padding-bottom: 0; }
.cam-fab { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  margin-top: -18px; border-radius: 50%; background: linear-gradient(135deg, var(--acc), #7BC93A);
  box-shadow: 0 6px 18px rgba(163,230,53,.35), 0 2px 6px rgba(0,0,0,.4); border: 3px solid var(--bg, #0E1411); }
.cam-fab svg { width: 24px; height: 24px; fill: none; stroke: #10160D; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#nav-cam:active .cam-fab { transform: scale(.93); }
#nav-cam.active .cam-fab { box-shadow: 0 6px 22px rgba(163,230,53,.55), 0 2px 6px rgba(0,0,0,.4); }

/* camera sheet options: full-width rows, icon + label */
.cam-opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 12px;
  background: none; border: 0; border-radius: 14px; color: var(--ink); font-size: 15px; font-weight: 650;
  cursor: pointer; text-align: start; }
.cam-opt svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--acc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cam-opt:active { background: rgba(255,255,255,.07); }
.cam-opt + .cam-opt { border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }

/* the doctor card pulses when the camera flow lands on it */
@keyframes cam-pulse { 0%, 100% { outline-color: transparent; } 40% { outline-color: rgba(163,230,53,.8); } }
.cam-pulse { outline: 2px solid transparent; outline-offset: 3px; border-radius: 14px; animation: cam-pulse 1.2s ease 2; }

/* ---- plant-card actions: one row of actions, composers on demand ---- */
.act-bar { display: flex; gap: 7px; margin-top: 16px; }
.act-tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px 9px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04);
  color: var(--muted); border-radius: 12px; font-size: 11px; font-weight: 650; line-height: 1.15;
  text-align: center; cursor: pointer; transition: var(--tr); }
.act-tab svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act-tab:hover { color: var(--ink); border-color: var(--ink); }
.act-tab.on { color: var(--acc); border-color: rgba(163,230,53,.55); background: rgba(163,230,53,.08); }
.act-pane { display: flex; gap: 7px; margin-top: 8px; align-items: center; }
/* display:flex on the class would otherwise defeat the hidden attribute */
.act-pane[hidden] { display: none; }
.act-pane input { flex: 1; min-width: 0; }
button.btn-acc { border: 0; background: linear-gradient(135deg, var(--acc), #7BC93A); color: #10160D;
  font-weight: 750; font-size: 13px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  transition: transform .12s ease, opacity .12s ease; }
button.btn-acc:hover { opacity: .9; }
button.btn-acc:active { transform: scale(.95); }
.file-btn.icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  padding: 0; border-radius: 999px; flex: none; }
.file-btn.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.file-btn.icon.has-file { border-color: var(--acc); color: var(--acc); background: rgba(163,230,53,.1); }

/* ---- task sections ---- */
.tk-chips { margin-bottom: 8px; }
.tk-section { margin-bottom: 14px; }
.tk-section .ac-label { display: flex; align-items: baseline; gap: 8px; }

/* ---- task list: segmented scope, one filter, priority sections ---- */
.tk-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.tk-head select { max-width: 210px; }
.seg { display: inline-flex; background: rgba(255,255,255,.06); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 7px 16px; border-radius: 9px;
  font-weight: 650; font-size: 13px; cursor: pointer; transition: var(--tr); }
.seg button b { font-weight: 750; color: var(--acc); }
.seg button.on { background: var(--card-solid); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.tk-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-tag { display: inline-flex; align-items: center; gap: 5px; }
.tk-tag i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tk-plant { border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--muted);
  padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; transition: var(--tr); }
.tk-plant:hover { color: var(--ink); border-color: var(--ink); }

/* ---- the app's one dropdown menu: every select opens this, never the OS popup ---- */
.dd-menu { position: fixed; z-index: 90; min-width: 180px; max-width: min(340px, calc(100vw - 12px));
  max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px; border-radius: 14px; background: var(--card-solid, #1A231D);
  border: 1px solid rgba(255,255,255,.22); box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35); }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: start; transition: var(--tr); }
.dd-opt svg { flex: none; color: var(--acc); }
.dd-opt:hover { background: rgba(163,230,53,.14); }
.dd-opt.on { background: rgba(163,230,53,.09); }
.dd-opt:active { background: rgba(163,230,53,.2); }

/* ---- library detail: structure, season, care-now, interactive watch-for ---- */
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.lib-season { border-color: transparent; color: #10160D; font-weight: 750; }
.lib-season.sow { background: var(--acc); }
.lib-season.har { background: #E8935C; }
.lib-season.off { background: rgba(255,255,255,.1); color: var(--muted); }
.lib-intro { max-width: 68ch; margin: 2px 0 8px; }
.lib-care { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.lib-care-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px;
  background: rgba(255,255,255,.04); border-inline-start: 3px solid var(--line-2); border-radius: 0 10px 10px 0; font-size: 13px; }
.lib-care-row .care-month { flex: none; min-width: 84px; }
.lib-care-row.now { border-inline-start-color: var(--acc); background: rgba(163,230,53,.07); }
.lib-nowchip { color: var(--acc); margin-inline-end: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.lib-dis { cursor: pointer; }
.dis-title { margin: 2px 4px 8px; }
.dis-text { font-size: 13.5px; line-height: 1.5; margin: 2px 4px 10px; color: var(--ink); }
.lib-rail { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: none; }
.lib-rail::-webkit-scrollbar { display: none; }
.lib-rail-card { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px;
  cursor: pointer; transition: var(--tr); }
.lib-rail-card svg { width: 36px; height: 36px; }
.lib-rail-card b { font-size: 10.5px; line-height: 1.2; text-align: center; color: var(--ink); }
.lib-rail-card:hover { border-color: var(--ink); }

/* ---- library hero: identity as text, status as one line ---- */
.lib-sub { display: flex; align-items: center; gap: 7px; margin-top: 5px;
  font-size: 12px; font-weight: 600; color: var(--muted); }
.lib-sub i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lib-status { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.lib-ing { border-color: rgba(163,230,53,.45); color: var(--acc); background: rgba(163,230,53,.08);
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.lib-ing i { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); flex: none; }
.lib-status .badge { display: inline-flex; align-items: center; }
.lib-toolbar .seg { align-self: flex-start; }
@media (max-width: 640px) { .lib-toolbar .seg { width: 100%; } .lib-toolbar .seg button { flex: 1; } }

/* ---- the Season Wheel ---- */
.wheel-wrap { max-width: 340px; margin: 4px auto 0; }
.wheel-wrap svg { width: 100%; height: auto; display: block; }
.wheel-wrap text { font-family: inherit; user-select: none; -webkit-user-select: none; }
.wheel-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center;
  margin: 6px 0 12px; font-size: 11px; font-weight: 650; color: var(--muted); }
.wheel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wheel-legend i { width: 9px; height: 9px; border-radius: 50%; }
.wheel-month { margin-bottom: 10px; }
.wl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; }
.lib-hero-icon { box-shadow: 0 0 48px -6px var(--cat, transparent); }

/* ---- inventory: every species leads with its drawing ---- */
#inventory td { padding-top: 8px; padding-bottom: 8px; }

/* ---- inline species icons: one drawing language across every list ---- */
.sp-ico { display: inline-flex; flex: none; vertical-align: middle; }
.sp-ico svg { width: 20px; height: 20px; display: block; }
.tl-name { display: flex; align-items: center; gap: 8px; }
.sow-head { display: inline-flex; align-items: center; gap: 7px; }
.hrow .sp-ico { margin-inline-end: 2px; }
.prog-species i { display: inline-flex; align-items: center; gap: 5px; }
.prog-species .sp-ico svg { width: 14px; height: 14px; }
.yrow .sow-head .sp-ico svg { width: 18px; height: 18px; }

/* ---- map species tokens: identity appears as the plan is zoomed, like any good map ---- */
#map-svg { touch-action: none; }
#map-svg .sp-token { opacity: 1; pointer-events: none; }

/* ---- inventory: the living collection ---- */
#inventory .inv-seg { margin-bottom: 18px; }
.inv-shelf { margin-bottom: 26px; }
.inv-shelf-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.inv-shelf-h i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.inv-shelf-h .n { font-weight: 600; opacity: .75; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.inv-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px 12px; cursor: pointer; transition: border-color .15s ease; }
@media (hover: hover) { .inv-card:hover { border-color: var(--acc); } }
.inv-ch { display: flex; align-items: flex-start; gap: 11px; }
.inv-ch > svg { width: 38px; height: 38px; flex: none; }
.inv-cn { min-width: 0; }
.inv-cn b { font-size: 15px; }
.inv-x { color: var(--muted); margin-inline-start: 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.inv-var { color: var(--muted); font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-tl { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 13px 0 11px; }
.inv-tl i { height: 6px; border-radius: 2px; background: rgba(255,255,255,.07); position: relative; }
.inv-tl i.on { background: var(--cc); }
.inv-tl i.now::after { content: ''; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px;
  transform: translateX(-50%); background: var(--acc); border-radius: 1px; }
.inv-cb { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.ib { font-size: 11px; font-weight: 650; padding: 3px 9px; border-radius: 999px; }
.ib-now { color: var(--acc); background: rgba(163,230,53,.12); }
.ib-next { color: var(--muted); background: rgba(255,255,255,.055); }
.ib-attn { color: var(--attn); background: rgba(255,107,94,.13); }
.ib-unv { color: var(--gold); background: rgba(229,192,91,.12); }
.inv-card.unplaced { border-style: dashed; opacity: .85; }

/* ---- care hub: triage strip, coverage meters, the garden wheel ---- */
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ct-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: border-color .15s ease; }
.ct-chip b { color: var(--ctc, var(--acc)); font-size: 15px; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .ct-chip:hover { border-color: var(--ctc, var(--acc)); } }
.ct-chip:active { border-color: var(--ctc, var(--acc)); }
.ct-meter { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.ct-meter > span:first-child { min-width: 110px; font-size: 12.5px; color: var(--ink); }
.ct-bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.ct-bar i { display: block; height: 100%; border-radius: 4px; }
.ct-meter .src { min-width: 52px; text-align: end; font-variant-numeric: tabular-nums; }
.prog-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 22px; align-items: start; }
.prog-wheel .wheel-wrap { margin: 0; }
.prog-act { position: relative; }
.prog-act .prog-add { margin-top: 6px; padding: 3px 10px; font-size: 11.5px; }
@media (max-width: 640px) {
  .prog-wrap { grid-template-columns: 1fr; }
  .prog-wheel { display: flex; flex-direction: column; align-items: center; }
  .ct-meter > span:first-child { min-width: 88px; }
}

/* ---- the plant care section (shared by the map card and the Care file) ---- */
.pc .care-list { margin: 6px 0 10px; }
.pc .care-month .wl-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.pc-more { margin: 4px 0 10px; }
.pc-more summary { cursor: pointer; }
.pc-hist { border-top: 1px solid var(--line); padding-top: 6px; }

/* ---- intelligence: model answers sit above the offline engines, visibly grounded ---- */
.ask-model { border-inline-start: 3px solid var(--acc); }
.ask-answer { font-size: 15px; line-height: 1.5; margin: 0; }
.diag-model { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.diag-m { margin: 10px 0 4px; }

/* ---- AR: reticle lock and the callout ---- */
.ar-reticle { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 1.5px solid rgba(255,255,255,.55); border-radius: 50%; pointer-events: none; z-index: 5; }
.ar-reticle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; background: var(--acc); }
.ar-label.lock { outline: 2px solid var(--acc); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(163,230,53,.18); }
.ar-lock { position: absolute; left: 12px; right: 12px; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 6;
  background: rgba(26,35,29,.92); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 14px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.arl-h { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.arl-h .sp-ico svg { width: 24px; height: 24px; }
.arl-d { margin-inline-start: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.arl-now { margin: 6px 0 10px; font-size: 13px; color: var(--ink); }
.arl-now .wl-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.arl-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.arl-acts button { margin: 0; padding: 7px 12px; font-size: 13px; }

/* ---- header: brand, launcher, settings - the weather rail lives on the Dashboard ---- */
.wx-rail { margin-bottom: 16px; }
.head-right { gap: 10px; }

/* ---- kitchen: what to make ---- */
.kit-seg { margin-bottom: 14px; flex-wrap: wrap; }
.rcp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rcp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.rcp-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rcp-h b { font-size: 15px; margin-inline-start: 2px; }
.rcp-h .ib { margin-inline-start: auto; }
.rcp-how { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 0 8px; }
.rcp-m { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---- doctor: the on-device read ---- */
.doc-net { margin-top: 8px; line-height: 1.9; }
.doc-net .ib { margin-inline-end: 4px; }

/* ---- doctor: symptom picker ---- */
.sym-picker { margin-top: 6px; }
.sym-sel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.sym-sel .ib { cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; border: 0; }
.sym-clear { padding: 3px 9px; font-size: 12px; margin: 0; }
.sym-empty { margin: 0 0 8px; }
.sym-q { width: 100%; margin-bottom: 10px; }
.sym-seg { flex-wrap: wrap; }
.sym-seg i { font-style: normal; font-size: 11px; color: var(--acc); margin-inline-start: 2px; }

/* ---- harvest timeline: dated weeks and a legend ---- */
.tl-head { align-items: end; }
.tl-head span { display: block; text-align: center; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.1; padding-bottom: 2px; }
.tl-head span small { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tl-head span.wk0 { color: var(--acc); font-weight: 700; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .src { flex-basis: 100%; }
.tl-sw { width: 14px; height: 9px; border-radius: 3px; background: rgba(255,255,255,.07); display: inline-block; }
.tl-sw.c-fruit { background: var(--fruit); } .tl-sw.c-nut { background: var(--nut); } .tl-sw.c-berry { background: var(--berry); }
.tl-sw.c-cucurbit { background: var(--cucurbit); } .tl-sw.c-veg { background: var(--veg); } .tl-sw.c-vine { background: var(--vine); }
.tl-sw.c-herb { background: var(--herb, #7E9B4A); } .tl-sw.c-hedge { background: #2F5D3A; }
.tl-sw.wk0 { outline: 1.5px solid var(--acc); outline-offset: -1.5px; }

/* ---- map: status rings in the legend ---- */
#map-legend .lg-ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid; background: transparent; }

/* ---- harvest timeline: ribbons ---- */
.tl-rib { position: relative; }
.tl-rib i, .tl-rib b, .tl-rib u { grid-row: 1; }
.tl-rib i { background: rgba(255,255,255,.06); }
.tl-rib b { display: block; height: 15px; border-radius: 8px; z-index: 1; box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.tl-rib b.c-fruit { background: var(--fruit); } .tl-rib b.c-nut { background: var(--nut); } .tl-rib b.c-berry { background: var(--berry); }
.tl-rib b.c-cucurbit { background: var(--cucurbit); } .tl-rib b.c-veg { background: var(--veg); } .tl-rib b.c-vine { background: var(--vine); }
.tl-rib b.c-herb { background: var(--herb, #7E9B4A); } .tl-rib b.c-hedge { background: #2F5D3A; }
.tl-rib u { grid-column: 1; display: block; height: 15px; border-radius: 4px; outline: 1.5px solid var(--acc); outline-offset: -1.5px; z-index: 2; pointer-events: none; }

/* ---- plant card: the wheel ---- */
.card-wheel { margin: 10px 0 6px; }
.card-wheel .wheel-wrap svg { max-width: 230px; margin: 0 auto; display: block; }

/* ---- health donut: draws itself in ---- */
@keyframes donut-in { from { stroke-dasharray: 0 1000; } }
.donut circle, .donut-mini circle { animation: donut-in 1.1s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .donut circle, .donut-mini circle { animation: none; } }

/* ---- the plant sheet (phone) ---- */
#plant-sheet { position: fixed; inset: 0; z-index: 70; }
#plant-sheet .ms-panel { max-height: 88vh; display: flex; flex-direction: column; padding-top: 6px; }
#plant-sheet.open .ms-scrim { opacity: 1; }
#plant-sheet.open .ms-panel { transform: none; }
#plant-sheet .ps-x { position: absolute; top: 12px; inset-inline-end: 12px; margin: 0; padding: 5px 11px; font-size: 12.5px; }
.ps-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 4px 8px; }
.ps-body h2 { padding-inline-end: 70px; }
.ps-body .ptl-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.ps-body .ptl-strip img { max-height: 64px; }

/* ---- harvest timeline: progress ---- */
.tl-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; white-space: normal; }
.tl-nm { font-weight: 700; }
.tl-prog { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 11px; font-weight: 500; color: var(--muted); flex-basis: 100%; }
.tl-kg { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.tl-prog .ib { padding: 2px 7px; font-size: 10.5px; }
.tl-rib b.ahead { opacity: .38; }
.tl-rib b.open { position: relative; overflow: hidden; background-color: rgba(255,255,255,.1) !important; box-shadow: inset 0 0 0 1.5px currentColor; }
.tl-rib b.open.c-fruit { color: var(--fruit); } .tl-rib b.open.c-nut { color: var(--nut); } .tl-rib b.open.c-berry { color: var(--berry); }
.tl-rib b.open.c-cucurbit { color: var(--cucurbit); } .tl-rib b.open.c-veg { color: var(--veg); } .tl-rib b.open.c-vine { color: var(--vine); }
.tl-rib b.open.c-herb { color: var(--herb, #7E9B4A); } .tl-rib b.open.c-hedge { color: #2F5D3A; }
.tl-rib b.open em { position: absolute; inset: 0 auto 0 0; background: currentColor; border-radius: 8px 0 0 8px; transition: width .6s ease; }
.tl { grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr); row-gap: 10px; align-items: center; }
.tl-more { margin: 10px 0 0; padding: 5px 12px; font-size: 12px; }

/* ---- map: rows and Move mode ---- */
.row-tag text { letter-spacing: .02em; }
#map-container.move-mode .canopy { cursor: pointer; }
.canopy.moving .ring { stroke: var(--acc); stroke-width: 0.3; }
.canopy.moving { filter: drop-shadow(0 0 0.6px rgba(163,230,53,.9)); }
.map-hint.moving { background: rgba(163,230,53,.16); border-color: rgba(163,230,53,.5); color: var(--ink); }
.map-hint-btn { margin: 0 0 0 8px; padding: 2px 9px; font-size: 11px; }
.map-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-zoom button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-solid, #1A231D); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.wheel-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(14,20,17,.82); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 6; }
.wheel-hint.show { opacity: 1; }
.canopy .halo { fill: none; stroke-width: 0.22; stroke-dasharray: 0.45 0.28; pointer-events: none; }
.canopy .halo.structure { stroke: #E4574A; }
.canopy .halo.offrow { stroke: #E5C05B; }

/* ---- Move mode: slots and the pending placement ---- */
.slot { cursor: pointer; }
.slot .slot-dot { fill: #FBF8EF; stroke: rgba(14,20,17,.55); stroke-width: 0.06; }
.slot.free .slot-dot { fill: #A3E635; }
.slot.taken .slot-dot { fill: rgba(251,248,239,.45); stroke: none; }
.slot:hover .slot-dot { r: 0.32; }
.ghost-ring { fill: rgba(163,230,53,.14); stroke: #A3E635; stroke-width: 0.16; stroke-dasharray: 0.4 0.25; }
.ghost-dot { fill: #A3E635; }
.map-hint.confirm { background: var(--card-solid, #1A231D); border-color: rgba(163,230,53,.6); }
.map-hint .btn-acc.map-hint-btn { padding: 3px 11px; font-size: 11.5px; margin: 0 0 0 8px; }

/* ---- Move plants: the one call to action on the map ---- */
.move-cta { padding: 8px 16px; font-weight: 750; }
.move-cta.on { background: var(--attn); color: #fff; box-shadow: 0 0 0 3px rgba(255,107,94,.25); }

.sibs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.sibs .src { flex-basis: 100%; }
.sibs .sib { margin: 0; padding: 4px 10px; font-size: 12px; }
.sibs .sib i { font-style: normal; color: var(--muted); margin-inline-start: 5px; }

.map-hint .add-row { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: 10px; }
.map-hint .add-row select { min-width: 140px; padding: 3px 28px 3px 8px; font-size: 12px; }
.map-hint .add-row input { width: 52px; padding: 3px 6px; font-size: 12px; }
.map-hint { flex-wrap: wrap; }

/* ---- the dialog ---- */
.dlg { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dlg-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .18s; }
.dlg-card { position: relative; width: min(440px, 100%); background: var(--card-solid, #1A231D); border: 1px solid var(--line-2); border-radius: 18px;
  padding: 18px 18px 16px; box-shadow: 0 24px 60px rgba(0,0,0,.55); transform: translateY(10px) scale(.98); opacity: 0; transition: transform .2s cubic-bezier(.2,.7,.2,1), opacity .18s; }
.dlg.open .dlg-scrim { opacity: 1; } .dlg.open .dlg-card { transform: none; opacity: 1; }
.dlg-card h3 { margin: 0 0 10px; font-size: 15px; }
.dlg-body { font-size: 15px; line-height: 1.5; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dlg-body .sp-ico svg { width: 26px; height: 26px; }
.dlg-form { display: grid; gap: 10px; margin-bottom: 14px; }
.dlg-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.dlg-form select, .dlg-form input { width: 100%; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 8px; }
.dlg-acts button { margin: 0; }
.btn-attn { background: var(--attn); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.ghost-btn.danger { color: var(--attn); border-color: rgba(255,107,94,.45); }
.dlg.danger .dlg-card { border-color: rgba(255,107,94,.5); }

/* ---- map search suggestions ---- */
.sg-menu { padding: 6px; }
.sg-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; }
.sg-row .sp-ico svg { width: 22px; height: 22px; }
.sg-name { font-weight: 650; }
.sg-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.sg-var { margin-inline-start: auto; color: var(--muted); font-size: 11px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-foot { padding: 6px 10px 2px; }
.sg-none { padding: 10px 10px 6px; display: grid; gap: 8px; }
.sg-lib { margin: 0; justify-self: start; }

/* ---- species picker ---- */
.add-cta { font-weight: 700; }
.dlg.picker .dlg-card { width: min(480px, 100%); }
.sp-list { max-height: min(52vh, 420px); overflow-y: auto; margin: 10px 0 12px; display: grid; gap: 2px; }
.sp-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: start; }
.sp-row .sp-ico svg { width: 24px; height: 24px; }
.sg-none .btn-acc { margin: 0; justify-self: start; }

#detail { position: relative; }
.detail-x { position: absolute; top: 10px; inset-inline-end: 10px; margin: 0; padding: 4px 10px; font-size: 12px; z-index: 2; }
#detail h2 { padding-inline-end: 70px; }

/* ---- map toolbar: Find on one line, Act on the next ---- */
.map-toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; }
.map-find, .map-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-find .search { flex: 0 1 240px; min-width: 160px; }
.map-filter { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.map-filter-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex: none; }
.map-act .map-reset { margin-inline-start: auto; }
.map-group { display: flex; align-items: center; gap: 6px; position: relative; }
.map-group + .map-group { padding-inline-start: 10px; border-inline-start: 1px solid var(--line-2); }
.map-act .ghost-btn, .map-act .btn-acc { margin: 0; }
.map-seg { gap: 0; }
.map-seg .ghost-btn { border-radius: 0; }
.map-seg .ghost-btn:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.map-seg .ghost-btn:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; margin-inline-start: -1px; }
.tools-cta { display: inline-flex; align-items: center; gap: 6px; }
.tools-cta svg { transition: transform .18s ease; }
.tools-cta[aria-expanded="true"] svg { transform: rotate(180deg); }
.map-toolbar, .map-act, .map-group { position: relative; z-index: 20; }
.map-tools { position: absolute; top: calc(100% + 6px); inset-inline-start: 10px; z-index: 260; min-width: 210px; max-width: calc(100vw - 28px);
  background: var(--card-solid, #1A231D); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35); }
.map-tools[hidden] { display: none; }
.map-tools .dd-opt { border-radius: 7px; }
@media (max-width: 700px) {
  .map-find .search { flex: 1 1 100%; }
  .map-filter { flex: 1 1 100%; overflow-x: auto; }
  .map-filter .chips { flex-wrap: nowrap; }
  .map-filter .chip { white-space: nowrap; flex: none; }
  .map-act { row-gap: 8px; }
  .map-act .map-reset { margin-inline-start: 0; }
  .map-group + .map-group { padding-inline-start: 0; border-inline-start: 0; }
  .map-filter { scrollbar-width: none; }
  .map-filter::-webkit-scrollbar { display: none; }
  .map-tools { inset-inline-start: auto; inset-inline-end: 0; }
}

/* ---- sign-in / setup ---- */
.au-ov { backdrop-filter: blur(14px); }
.au-card { max-width: 380px; }
.au-brand { display: flex; align-items: center; gap: 10px; color: var(--acc); font-weight: 800; letter-spacing: .28em; font-size: 15px; margin-bottom: 14px; }
.au-card form { display: flex; flex-direction: column; gap: 10px; }
.au-card input { width: 100%; }
.au-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.au-providers { display: flex; flex-direction: column; gap: 8px; }
.connect-card .au-prov { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; transition: var(--tr); }
.connect-card .au-prov:hover { border-color: var(--ink); background: rgba(255,255,255,.06); }
.connect-card .au-prov:disabled { opacity: .55; cursor: default; }
.au-fine { margin-top: 12px; font-size: 11px; }
.sec-links .hrow { gap: 10px; }
.ghost-btn.slim, select.slim { padding: 4px 10px; font-size: 12px; margin: 0; }
