/* Landscape Office prototype. Calm paper surfaces, one eucalyptus-green accent.
   Phase colours (map pins, badges) are validated: blue / orange / aqua / neutral, always with a letter. */

:root {
  color-scheme: light;
  --bg: #f4f3ee;
  --surface: #fcfcfb;
  --surface-2: #f0efe9;
  --line: #e1dfd6;
  --line-2: #cfccc0;
  --ink: #171a16;
  --ink-2: #4a4f47;
  --ink-3: #6f746b;
  --accent: #2f6b4f;
  --accent-2: #3d8462;
  --accent-soft: #e3efe7;
  --accent-ink: #ffffff;
  --ph-design: #2a78d6;
  --ph-approval: #eb6834;
  --ph-delivery: #1baf7a;
  --ph-establish: #52514e;
  --good: #0ca30c;
  --good-ink: #12701a;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --serious: #ec835a;
  --bad: #d03b3b;
  --bad-ink: #a42727;
  --track: #e7e5dd;
  --shadow: 0 1px 2px rgba(20, 24, 18, .05), 0 6px 20px rgba(20, 24, 18, .05);
  --shadow-pop: 0 18px 50px rgba(20, 24, 18, .18);
  --r: 14px;
  --r-sm: 9px;
  --side: 232px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121411; --surface: #1a1c19; --surface-2: #222521; --line: #2d302b; --line-2: #3b3f38;
    --ink: #eeefe9; --ink-2: #c3c6bb; --ink-3: #969a8f;
    --accent: #6fbf94; --accent-2: #84cfa6; --accent-soft: #20352a; --accent-ink: #0d1a12;
    --ph-design: #3987e5; --ph-approval: #d95926; --ph-delivery: #199e70; --ph-establish: #a3a29b;
    --good-ink: #5fd06a; --warn-ink: #f4c35a; --bad-ink: #f08080; --track: #2d302b;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-pop: 0 18px 50px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121411; --surface: #1a1c19; --surface-2: #222521; --line: #2d302b; --line-2: #3b3f38;
  --ink: #eeefe9; --ink-2: #c3c6bb; --ink-3: #969a8f;
  --accent: #6fbf94; --accent-2: #84cfa6; --accent-soft: #20352a; --accent-ink: #0d1a12;
  --ph-design: #3987e5; --ph-approval: #d95926; --ph-delivery: #199e70; --ph-establish: #a3a29b;
  --good-ink: #5fd06a; --warn-ink: #f4c35a; --bad-ink: #f08080; --track: #2d302b;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-pop: 0 18px 50px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.svg-ic { width: 18px; height: 18px; flex: none; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.brand b { display: block; font-size: 14.5px; }
.brand span { font-size: 11.5px; color: var(--ink-3); }
.nav-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-2); cursor: pointer; text-align: left; font-weight: 520;
}
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-btn .count { margin-left: auto; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); padding: 1px 7px; border-radius: 99px; }
.nav-btn[aria-current="page"] .count { background: var(--surface); }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.side-foot button { justify-content: flex-start; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .svg-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 60vh; overflow: auto; }
.search-results button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.search-results button:hover, .search-results button.on { background: var(--surface-2); }
.search-results .kind { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.sync-status .btn { color: var(--ink-3); }
.sync-status.st-offline .btn, .sync-status.st-signin .btn, .sync-status.st-problem .btn { color: #b45309; }
.view { padding: 26px 28px 60px; width: 100%; } /* no max width: pages fill the whole screen (her choice, Nov 2026) */
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 560; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn .svg-ic { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 560; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

/* ---------- cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.grid > *, .stack > * { min-width: 0; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.tile { padding: 16px 18px; }
.tile .k { font-size: 12.5px; color: var(--ink-3); font-weight: 560; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .d { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; } .li.click:hover { background: var(--surface-2); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 560; }
.li .s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 26px 18px; color: var(--ink-3); text-align: center; }
.check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; color: transparent; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check .svg-ic { width: 12px; height: 12px; }
.li.done .t { text-decoration: line-through; color: var(--ink-3); }

/* status pills: always icon + label, colour never alone */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill .svg-ic { width: 13px; height: 13px; }
.pill.good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill.warn { color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 22%, transparent); }
.pill.bad  { color: var(--bad-ink);  background: color-mix(in srgb, var(--bad) 13%, transparent); }
.pill.accent { color: var(--accent); background: var(--accent-soft); }
.phase { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.phase i { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 750; color: #fff; }
.ph-design i { background: var(--ph-design); } .ph-approval i { background: var(--ph-approval); }
.ph-delivery i { background: var(--ph-delivery); } .ph-establish i { background: var(--ph-establish); }
:root[data-theme="dark"] .ph-establish i { color: #121411; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ph-establish i { color: #121411; } }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); flex: none; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.kind-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.kind-ic .svg-ic { width: 15px; height: 15px; }

/* meters (budget used) */
.meter { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; position: relative; }
.meter > b { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
.meter.warn > b { background: var(--warn); }
.meter.bad > b { background: var(--bad); }
.meter-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.meter-row .meter { grid-column: 1 / -1; }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }

/* ---------- pipeline ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: var(--surface-2); border-radius: var(--r); padding: 10px; min-height: 360px; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 6px; }
.col-head b { font-size: 13px; }
.col-head span { font-size: 12px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow); }
.deal:hover { border-color: var(--line-2); }
.deal.dragging { opacity: .45; }
.deal .t { font-weight: 600; line-height: 1.3; }
.deal .c { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.deal .m { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 12.5px; }
.deal .next { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.deal .next .svg-ic { width: 14px; height: 14px; margin-top: 2px; }
.deal .next.late { color: var(--bad-ink); }

/* ---------- project page ---------- */
.proj-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.proj-head .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.crumb button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }
.stagebar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 6px 0 18px; }
.stagebar .s { padding: 8px 8px 7px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; min-width: 0; }
.stagebar .s b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.stagebar .s span { color: var(--ink-3); font-size: 11.5px; }
.stagebar .s.done { background: var(--accent-soft); border-color: transparent; }
.stagebar .s.done b { color: var(--accent); }
.stagebar .s.now { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 13px; cursor: pointer; color: var(--ink-3); font-weight: 580; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 10px; }
.photo { aspect-ratio: 4/3; border-radius: 8px; background: linear-gradient(135deg, #8fae8b, #496f52); display: grid; place-items: center; color: rgba(255,255,255,.85); }
.photo:nth-child(3n+2) { background: linear-gradient(135deg, #b9a77d, #6f6243); }
.photo:nth-child(3n) { background: linear-gradient(135deg, #8eb0bf, #4b6d7c); }
.photo .svg-ic { width: 18px; height: 18px; }
.countdown { display: flex; align-items: baseline; gap: 8px; }
.countdown .big { font-size: 34px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 14.5px; top: 32px; bottom: 2px; width: 1px; background: var(--line); }
.capture-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0; overflow: hidden; }
.capture-vis { min-height: 220px; background: radial-gradient(ellipse at 30% 40%, #6c8f5f 0, #3e5b3a 45%, #253824 100%); position: relative; display: grid; place-items: center; color: #fff; }
.capture-vis .dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.4px); background-size: 9px 9px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.capture-vis .lbl { position: relative; text-align: center; font-weight: 650; }

/* map */
.map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 180px); min-height: 520px; }
.map-list { overflow: auto; }
#map { width: 100%; height: 100%; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); cursor: pointer; }
.pin i { transform: rotate(45deg); font-style: normal; color: #fff; font-weight: 750; font-size: 11px; }
.pin.lead { background: #fff; border-color: var(--ink-2); border-style: dashed; }
.pin.lead i { color: var(--ink); }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.maplibregl-popup-content { border-radius: 12px !important; padding: 12px 14px !important; font: 13px/1.4 Inter, system-ui, sans-serif; color: #171a16; }

/* plants */
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; min-width: 180px; }
.months span { height: 14px; border-radius: 3px; background: var(--track); font-size: 8.5px; color: var(--ink-3); display: grid; place-items: center; }
.months span.on { background: var(--accent); color: var(--accent-ink); }
.months span.mark { outline: 2px solid var(--ink); outline-offset: 0; }

/* tenders */
.score-row { display: grid; grid-template-columns: 130px 1fr 26px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.score-row input[type=range] { accent-color: var(--accent); width: 100%; }
.score-big { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(15, 18, 14, .4); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s var(--ease); }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: rise .2s var(--ease); }
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 11px; box-shadow: var(--shadow-pop); font-weight: 560; animation: rise .2s var(--ease); display: flex; gap: 8px; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.proposal-doc { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--surface-2); }
.proposal-doc .tbl td, .proposal-doc .tbl th { padding: 7px 8px; }
.sign-box { margin-top: 14px; border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.notice { display: flex; gap: 10px; padding: 11px 14px; border-radius: 11px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); align-items: flex-start; }
.notice .svg-ic { margin-top: 1px; }
.proto-tag { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

/* ---------- phone ---------- */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 10px 16px; }
  .view { padding: 18px 16px 96px; }
  .g-2 { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-layout #map { height: 56vh; }
  .stagebar { grid-template-columns: repeat(4, 1fr); }
  .capture-card { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
  .tabbar {
    display: flex; position: fixed; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 40; justify-content: space-around;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border: 1px solid var(--line); border-radius: 16px; padding: 5px; box-shadow: var(--shadow-pop);
  }
  .tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 10.5px; color: var(--ink-3); padding: 5px 4px; border-radius: 10px; flex: 1; cursor: pointer; }
  .tabbar button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .hide-phone { display: none !important; }
  .tile .v { font-size: 22px; }
}
@media (max-width: 480px) {
  .tiles { gap: 10px; }
  .tile { padding: 12px 14px; }
  .row { flex-direction: column; gap: 0; }
}

/* ---------- reports charts ---------- */
.vchart { position: relative; height: 230px; padding-left: 44px; }
.vchart-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vchart-grid div { border-top: 1px solid var(--line); position: relative; height: 0; }
.vchart-grid span { position: absolute; left: 0; top: -8px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vchart-bars { position: absolute; inset: 0 0 0 44px; display: grid; grid-template-columns: repeat(12, 1fr); }
.vcol { display: flex; flex-direction: column; align-items: center; outline: none; cursor: default; border-radius: 6px; }
.vcol:hover, .vcol:focus-visible { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.vbar-wrap { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vbar { width: min(24px, 60%); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.vlabel { position: absolute; font-size: 11.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.vx { height: 22px; line-height: 22px; font-size: 11px; color: var(--ink-3); }
.hchart { display: grid; gap: 4px; }
.hrow { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 92px; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; outline: none; }
.hrow:not(.hlegend):hover, .hrow:focus-visible { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.hname { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htrack { position: relative; height: 14px; }
.hbar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar.over { background: var(--bad); }
.hbar.watch { background: var(--warn); }
.href { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1.5px dashed var(--ink-2); }
.href-label { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.hval { font-size: 12.5px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.tview { margin-top: 12px; }
.tview summary { cursor: pointer; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.tview .tbl td, .tview .tbl th { padding: 6px 8px; font-size: 13px; }
.chart-tip { position: fixed; z-index: 95; display: none; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 8px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.4; max-width: 260px; }

/* ---------- client view ---------- */
.client-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); margin-bottom: 18px; flex-wrap: wrap; }
.client-bar .btn { margin-left: auto; }
.client-hero { padding: 26px; background: linear-gradient(140deg, var(--accent-soft), var(--surface)); }
.client-hero h1 { font-size: 28px; }
.client-steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 18px; }
.client-steps div { font-size: 11.5px; color: var(--ink-3); }
.client-steps div i { display: block; height: 6px; border-radius: 99px; background: var(--track); margin-bottom: 6px; }
.client-steps div.done i { background: var(--accent); }
.client-steps div.now i { background: linear-gradient(90deg, var(--accent) var(--p), var(--track) var(--p)); }
.client-steps div.now { color: var(--ink); font-weight: 650; }

@media (max-width: 820px) {
  .topbar .spacer { display: none; }
  .search { max-width: none; }
  .hrow { grid-template-columns: 1fr 70px; }
  .hrow .htrack { grid-column: 1 / -1; grid-row: 2; }
  .hrow.hlegend { display: none; }
  .client-steps { grid-template-columns: repeat(4, 1fr); }
  .client-hero { padding: 18px; }
}

/* ---------- priority + outreach ---------- */
.prio { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 11px; font-weight: 750; border: 1.5px solid var(--line-2); color: var(--ink-2); background: var(--surface); flex: none; }
/* priority colours (her choice, Nov 2026): A+ gold, A green, B yellow, C orange, D red; filled so they read in light and dark */
.prio-Aplus { background: linear-gradient(135deg, #f1d27a, #c8962c); border-color: #a87a1c; color: #3b2a00; }
.prio-A { background: #2e9e5b; border-color: #23824a; color: #fff; }
.prio-B { background: #fbefa8; border-color: #e3cf6a; color: #4a3d00; }
.prio-C { background: #f28b30; border-color: #d4731c; color: #2e1600; }
.prio-D { background: #d9443a; border-color: #b8342b; color: #fff; }
.col-more { display: block; width: 100%; margin: 2px 0 6px; padding: 7px; border: 1px dashed var(--line-2); border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.col-more:hover { background: var(--surface-2); color: var(--ink); }
/* compact outreach cards: 3 lines (name, organisation, follow-up date) */
.deal.compact { padding: 7px 10px; }
.deal.compact .cl1 { display: flex; gap: 6px; align-items: center; }
.deal.compact .cl1 .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal.compact .c, .deal.compact .cl3 { margin-top: 1px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal.compact .cl3.late-text { color: var(--bad-ink); font-weight: 600; }
button.prio-btn { cursor: pointer; font-family: inherit; line-height: 1; }
button.prio-btn:hover, button.prio-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.prio-menu { position: fixed; z-index: 95; display: grid; gap: 2px; min-width: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; }
.prio-menu button { display: flex; align-items: center; padding: 6px 8px; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.prio-menu button:hover, .prio-menu button:focus-visible, .prio-menu button.on { background: var(--accent-soft); }
.tpl-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.tpl-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tpl-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.deal .m.muted { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.deal .m .svg-ic { width: 13px; height: 13px; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }

/* ---------- multi-series charts (validated categorical slots 1-6; text never wears these) ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; } }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; }
.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); }
.s4 { background: var(--s4); } .s5 { background: var(--s5); } .s6 { background: var(--s6); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vstack { width: min(24px, 60%); display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.vstack i { display: block; min-height: 2px; }
.vpair { gap: 2px; }
.vpair .vbar { width: min(16px, 30%); }
.vbar.s1 { background: var(--s1); } .vbar.s2 { background: var(--s2); }

/* ---------- plant tags and month picker ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 560; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip.toggle { cursor: pointer; padding: 4px 10px; font-size: 12.5px; }
.chip.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.toggle[aria-pressed="true"]::before { content: "✓"; margin-right: 4px; font-weight: 700; }
.month-pick { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.month-pick button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 6px 0; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.month-pick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.sup-tbl td, .sup-tbl th { padding: 6px 6px; vertical-align: top; }
.sup-tbl .input { padding: 6px 8px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .month-pick { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- plant schedule layout (Candice's column groups) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filters .input { width: auto; }
.filters #pq { flex: 1 1 200px; max-width: 320px; }
.seg-scroll { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll button { white-space: nowrap; }
.tbl.sheet th, .tbl.sheet td { white-space: nowrap; }
.tbl.sheet td.cell { white-space: normal; min-width: 120px; max-width: 260px; font-size: 13px; }
.tbl.sheet .sheet-group th { background: var(--surface-2); color: var(--ink); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); border-left: 2px solid var(--surface); padding: 6px 14px; }
.tbl.sheet .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); min-width: 210px; white-space: normal; }
.tbl.sheet thead .stick { z-index: 2; }
.tbl.sheet .sheet-group .stick { background: var(--surface-2); }
.tbl.sheet tr.click:hover .stick { background: var(--surface-2); }
.tbl.sheet tr.band td { background: var(--accent-soft); color: var(--accent); padding-top: 7px; padding-bottom: 7px; }
.tbl.sheet tr.band .stick { background: var(--accent-soft); }
.tbl.sheet tr.band .muted { color: var(--accent); opacity: .75; font-variant-numeric: tabular-nums; }
.tbl.sheet .calc { color: var(--accent); font-weight: 650; }
.code { display: inline-block; min-width: 38px; margin-right: 6px; font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-3); }
.fsec { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--surface); }
.fsec > summary { cursor: pointer; padding: 11px 14px; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.fsec > summary::-webkit-details-marker { display: none; }
.fsec > summary::before { content: "▸"; color: var(--ink-3); transition: transform .15s; }
.fsec[open] > summary::before { transform: rotate(90deg); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; padding: 0 14px 6px; }
.fgrid .field.wide { grid-column: 1 / -1; }
.psec { margin-bottom: 16px; }
.psec h3 { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
.psec dl { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 6px 14px; margin: 0; }
.psec dt { color: var(--ink-3); font-size: 13px; }
.psec dd { margin: 0; min-width: 0; }
@media (max-width: 600px) { .psec dl { grid-template-columns: 1fr; gap: 0; } .psec dd { margin-bottom: 8px; } .tbl.sheet .stick { min-width: 160px; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* a window with unsaved changes shakes instead of closing on an outside click */
.modal.nudge { animation: nudge .32s var(--ease); }
@keyframes nudge { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }

/* fee proposal: hours and rate inputs */
.pp-tbl .pp-in { width: 84px; padding: 4px 6px; text-align: right; display: inline-block; }
.pp-tbl tr.off td { color: var(--ink-3); }
.pp-tbl tr.tot td { border-top: 1.5px solid var(--line-2); }

.toast.warn { background: var(--bad); color: #fff; }

/* bin (delete) buttons on cards and rows: quiet until hovered; always visible on touch screens */
.bin { border: 0; background: none; color: var(--ink-3); width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; flex: none; opacity: .55; }
.bin .svg-ic { width: 16px; height: 16px; }
.bin:hover, .bin:focus-visible { opacity: 1; color: var(--bad-ink); background: color-mix(in srgb, var(--bad) 12%, transparent); }
@media (hover: hover) { .deal .bin, tr .bin { opacity: 0; } .deal:hover .bin, tr:hover .bin, .bin:focus-visible { opacity: 1; } }

/* getting-started card on an empty Today page */
.start-card { margin-bottom: 18px; border-color: var(--accent); }
.start-card ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* tag filter with tick boxes */
.tag-filter { position: relative; }
.tag-btn { position: relative; width: auto; min-width: 140px; text-align: left; cursor: pointer; padding-right: 30px; }
.tag-btn::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); }
.tag-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 10px; }
.tag-list { max-height: 300px; overflow: auto; display: grid; gap: 2px; }
.tag-list label { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; cursor: pointer; }
.tag-list label:hover { background: var(--surface-2); }
.tag-list label span:first-of-type { flex: 1; }
.tag-list input { width: 16px; height: 16px; accent-color: var(--accent); }
.tag-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- overheads: categories you open and close ---------- */
.oh-bar { width: 100%; text-align: left; background: none; border: 0; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; border-radius: 6px; }
.oh-bar:hover b { text-decoration: underline; }
.oh-cat { border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.oh-cat > summary, .oh-total { display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.oh-cat > summary { cursor: pointer; list-style: none; }
.oh-cat > summary::-webkit-details-marker { display: none; }
.oh-cat > summary:hover { background: var(--hover, rgba(127,127,127,.06)); }
.oh-cat > summary .grow, .oh-total .grow { flex: 1; min-width: 0; }
.oh-chev { display: inline-block; width: 14px; color: var(--ink-3); font-size: 18px; line-height: 1; transition: transform .15s; }
.oh-cat[open] > summary .oh-chev { transform: rotate(90deg); }
.oh-cat[open] > summary { border-bottom: 1px solid var(--line); }
.oh-cat .tbl th:first-child, .oh-cat .tbl td:first-child { padding-left: 42px; }
.oh-total { border-top: 1px solid var(--line); }
@media (max-width: 640px) { .oh-cat .tbl th:first-child, .oh-cat .tbl td:first-child { padding-left: 18px; } }

/* ---------- fee proposal: stages of tasks × roles ---------- */
.pv-stage.off > summary { color: var(--ink-3); }
.pv-inc { display: flex; align-items: center; }
.pp-tbl .pv-name { width: 100%; min-width: 180px; padding: 4px 6px; }
.pp-tbl .pv-kind { padding: 4px 6px; width: auto; }
#pv-stages .oh-cat:first-child { border-top: 0; }
#pv-stages .oh-cat .tbl th:first-child, #pv-stages .oh-cat .tbl td:first-child { padding-left: 18px; }

/* Outreach: columns that can be moved (drag the heading) and edited */
.tp-head { cursor: grab; border-radius: 8px; }
.tp-head:hover { background: var(--surface); }
.tp-head .tp-edit { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-grid; place-items: center; }
.tp-head .tp-edit:hover, .tp-head .tp-edit:focus-visible { color: var(--ink); background: var(--surface-2); }
.col.dragging { opacity: .5; }
.oc-row { border-radius: 10px; padding: 4px 6px; }
.oc-row.over { background: var(--accent-soft); }
.oc-row.dragging { opacity: .45; }
.drag-handle { display: inline-grid; place-items: center; width: 22px; height: 38px; cursor: grab; color: var(--ink-3); font-size: 16px; user-select: none; }
.tp-head .tp-edit .svg-ic { width: 14px; height: 14px; }

/* Side menu: drag an item up or down to change the order */
#side [data-nav] { cursor: pointer; }
#side [data-nav].dragging { opacity: .45; }
#side [data-nav].drop-before { box-shadow: inset 0 2px 0 var(--accent); }
#side [data-nav].drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* Outreach categories: tabs above the board, a small label on each card */
.cat-tabs button.over { background: var(--accent-soft); color: var(--accent); outline: 2px dashed var(--accent); }
.cat-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-top: 2px; }
/* "Add people" at the bottom of each outreach column */
.col-people { border: 1px dashed var(--line-2); background: none; color: var(--ink-3); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 12.5px; cursor: pointer; display: flex; align-items: center; gap: 6px; justify-content: center; }
.col-people:hover, .col-people:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.col-people .svg-ic { width: 14px; height: 14px; }
/* Outreach history: the words that were sent, under each touch */
.sent { margin: -4px 0 12px 44px; font-size: 13px; }
.sent summary { cursor: pointer; color: var(--accent); }
.sent-body { white-space: pre-wrap; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
