/* Visual language inspired by vinehealth.com.au: charcoal, lime, leaf and wine, with a serif display face. */
:root {
  --ink: #282c28; --ink-2: #3a3f39; --muted: #61675e; --line: #dedbd5; --line-2: #ecebe6;
  --paper: #faf9f6; --card: #ffffff; --sage: #eef2e4; --sage-2: #e2e9d1;
  --lime: #d3e275; --lime-ink: #59661a; --leaf: #455c35; --wine: #733f45; --blush: #f6e9e7; --gold: #b39553;
  --ok: #3d7a35; --ok-bg: #e8f3e3; --warn: #a3660b; --warn-bg: #fdf1dc; --bad: #b3261e; --bad-bg: #fbe5e3; --info: #2e5f8a; --info-bg: #e5eef7;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 10px; --shadow: 0 1px 2px rgba(40,44,40,.06), 0 4px 16px rgba(40,44,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14.5px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
a { color: var(--leaf); }
small, .muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid #c9ccc1; background: #fff; border-radius: 8px; padding: 8px 14px; transition: background .15s, border-color .15s, transform .05s; }
button:hover:not(:disabled) { background: var(--sage); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--leaf); border-color: var(--leaf); }
button.lime { background: var(--lime); border-color: #bfcf5c; color: var(--ink); font-weight: 600; }
button.lime:hover:not(:disabled) { background: #c6d65f; }
button.danger { color: var(--bad); border-color: #e3b5b1; }
button.ghost { border-color: transparent; background: transparent; }
button.sm { padding: 4px 10px; font-size: 13px; }
input, select, textarea { border: 1px solid #c9ccc1; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(160,180,60,.45); outline-offset: 1px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 380px; }
.g-side-l { grid-template-columns: 340px minmax(0, 1fr); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-side, .g-side-l { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; }
.kicker { text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.lime { background: var(--lime); color: var(--ink); } .pill.wine { background: var(--blush); color: var(--wine); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.stat { font-family: var(--serif); font-size: 32px; line-height: 1.1; }
.stat small { font-family: var(--sans); font-size: 13px; }
.kpi .delta { font-size: 12.5px; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; position: sticky; top: 0; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f8f1; }
tr.sel td { background: #f3f6e6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow: auto; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hr { height: 1px; background: var(--line-2); margin: 14px 0; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.callout { border-left: 4px solid var(--lime); background: var(--sage); padding: 12px 14px; border-radius: 0 8px 8px 0; margin-bottom: 14px; }
.callout.wine { border-color: var(--wine); background: var(--blush); }
.callout.bad { border-color: var(--bad); background: var(--bad-bg); }
.callout.info { border-color: var(--info); background: var(--info-bg); }
.ai { border: 1px solid #d7cfee; background: linear-gradient(180deg, #faf8ff, #f4f1fc); border-radius: var(--r); padding: 14px 16px; }
.ai .ai-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5b4a9a; margin-bottom: 6px; }
body.ai-off .ai, body.ai-off .ai-only { display: none !important; }

/* ===== Staff console shell ===== */
#app { min-height: 100%; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #e9ebe4; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; border-bottom: 1px solid #454a43; margin-bottom: 12px; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand b { font: 22px/1 var(--serif); letter-spacing: -.01em; display: block; color: #fff; }
.brand small { color: #aeb5a4; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.nav-group { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8f978a; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: #dfe3d7; text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: #353a34; }
.nav a.on { background: var(--lime); color: var(--ink); font-weight: 600; }
.nav a .ic { width: 18px; text-align: center; opacity: .9; }
.nav a .count { margin-left: auto; background: var(--wine); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.nav a.on .count { background: var(--ink); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(250,249,246,.92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; }
.topbar .search { max-width: 420px; position: relative; flex: 1; }
.topbar .search input { padding-left: 32px; background: #fff; }
.topbar .search::before { content: '\2315'; position: absolute; left: 11px; top: 7px; color: var(--muted); font-size: 16px; transform: scaleX(-1); }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); max-width: 760px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.env { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--blush); color: var(--wine); padding: 3px 8px; border-radius: 6px; }

/* ===== Grower portal shell ===== */
.portal-top { background: var(--ink); color: #fff; }
.portal-top .inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 0 22px; height: 66px; }
.portal-top nav { display: flex; gap: 4px; flex: 1; }
.portal-top nav a { color: #dfe3d7; text-decoration: none; padding: 8px 12px; border-radius: 7px; font-size: 14px; }
.portal-top nav a:hover { background: #3a3f39; }
.portal-top nav a.on { color: var(--ink); background: var(--lime); font-weight: 600; }
.portal-hero { background: linear-gradient(110deg, rgba(40,44,40,.92) 30%, rgba(69,92,53,.75)), repeating-linear-gradient(-28deg, #4b5a3a 0 6px, #55663f 6px 13px); color: #fff; }
.portal-hero .inner { max-width: 1240px; margin: 0 auto; padding: 30px 22px 34px; }
.portal-hero h1 { color: #fff; margin-bottom: 6px; }
.portal-hero p { color: #dfe5d2; margin: 0; }
.portal-body { max-width: 1240px; margin: 0 auto; padding: 24px 22px 80px; }
.portal-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 26px; border-top: 1px solid var(--line); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: linear-gradient(160deg, rgba(40,44,40,.55), rgba(40,44,40,.88)), repeating-linear-gradient(-28deg, #5a6b45 0 7px, #687a50 7px 15px); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login .art h1 { color: #fff; font-size: 42px; max-width: 520px; }
.login .panel { display: grid; place-items: center; padding: 40px; }
.login form { width: 100%; max-width: 380px; }
.code-inputs { display: flex; gap: 8px; } .code-inputs input { text-align: center; font-size: 22px; font-family: var(--mono); padding: 10px 0; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login .art { display: none; } }

/* Steps */
.steps { display: flex; gap: 0; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.steps div { flex: 1; padding: 12px 16px; font-size: 13px; color: var(--muted); border-right: 1px solid var(--line-2); display: flex; gap: 10px; align-items: center; }
.steps div:last-child { border-right: 0; }
.steps .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #c3c7bb; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.steps .on { color: var(--ink); font-weight: 600; background: var(--sage); }
.steps .on .n { background: var(--ink); color: #fff; border-color: var(--ink); }
.steps .done .n { background: var(--lime); border-color: #bfcf5c; color: var(--ink); }

/* Map */
.map { position: relative; height: 520px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #cfd6bf; }
.map.tall { height: calc(100vh - 210px); min-height: 520px; }
.map.short { height: 340px; }
.map-tools { position: absolute; top: 10px; left: 10px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; }
.map-tools button { background: rgba(255,255,255,.95); box-shadow: var(--shadow); font-size: 13px; padding: 6px 11px; }
.map-tools button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.basemap-switch { position: absolute; bottom: 30px; left: 10px; z-index: 5; display: flex; background: rgba(255,255,255,.95); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.basemap-switch button { border: 0; border-radius: 0; padding: 5px 10px; font-size: 12px; background: transparent; }
.basemap-switch button.on { background: var(--ink); color: #fff; }
.map-legend { position: absolute; bottom: 30px; right: 10px; z-index: 5; background: rgba(255,255,255,.95); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); }
.map-legend div { display: flex; align-items: center; gap: 7px; }
.sw { width: 14px; height: 10px; border-radius: 2px; display: inline-block; border: 1.5px solid; }
.map-hint { position: absolute; top: 10px; left: 10px; z-index: 5; background: rgba(40,44,40,.88); color: #fff; padding: 7px 11px; border-radius: 8px; font-size: 12.5px; max-width: 300px; }
.vlabel { background: rgba(40,44,40,.82); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 5px; white-space: nowrap; pointer-events: none; font-weight: 600; }
.vlabel.mine { background: var(--lime); color: var(--ink); }
.vlabel.bad { background: var(--bad); }
.blabel { color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 6px #000; pointer-events: none; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }
.offline-note { position: absolute; inset: auto 0 0 0; background: rgba(115,63,69,.92); color: #fff; font-size: 12px; padding: 5px 10px; z-index: 6; display: none; }
.map.tiles-failed .offline-note { display: block; }

/* Validation list */
.vlist { list-style: none; padding: 0; margin: 0; }
.vlist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.vlist li:last-child { border-bottom: 0; }
.vlist .ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.vlist .pass .ico { background: var(--ok-bg); color: var(--ok); }
.vlist .warn .ico { background: var(--warn-bg); color: var(--warn); }
.vlist .fail .ico { background: var(--bad-bg); color: var(--bad); }
.vlist b { font-weight: 600; }
.block-list .blk { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.block-list .blk.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); }
.block-list .blk .row { gap: 8px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--leaf); }
.timeline li.now::before { background: var(--lime); border-color: var(--lime-ink); }
.timeline li.bad::before { border-color: var(--bad); }

/* Presenter dock */
.dock { position: fixed; right: 16px; bottom: 16px; z-index: 100; font-size: 13px; }
.dock-btn { background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 10px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.dock-btn:hover:not(:disabled) { background: var(--leaf); }
.dock-panel { position: absolute; right: 0; bottom: 52px; width: 360px; background: #fff; border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.25); border: 1px solid var(--line); padding: 16px; display: none; max-height: 80vh; overflow: auto; }
.dock.open .dock-panel { display: block; }
.persona { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; }
.persona:hover { background: var(--sage); }
.persona.on { border-color: var(--ink); background: var(--sage); }
.persona b { display: block; font-size: 13.5px; } .persona small { font-size: 12px; }
.scen a { display: block; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.scen a:hover { background: var(--sage); }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.toggle { width: 38px; height: 22px; border-radius: 999px; background: #c9ccc1; position: relative; border: 0; padding: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--leaf); } .toggle.on::after { left: 19px; }
.toggle:hover:not(:disabled) { background: #b7bbae; } .toggle.on:hover:not(:disabled) { background: var(--leaf); }

/* Delivery-basis tags (Standard / Configured / Custom build) */
.basis { display: none; font: 700 10px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; vertical-align: middle; margin-left: 6px; white-space: nowrap; }
body.show-basis .basis { display: inline-block; }
.basis.S { background: #dbe8f6; color: #22507a; } .basis.C { background: #fbecc9; color: #7a5208; } .basis.B { background: #f3d9de; color: #7a2737; }
.basis-legend { display: none; gap: 8px; align-items: center; font-size: 12px; }
body.show-basis .basis-legend { display: flex; }
body.show-basis .basis-legend .basis { display: inline-block; margin: 0; }

/* API console drawer */
.api { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; background: #1d201d; color: #dfe5d2; z-index: 90; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.3); }
.api.open { transform: none; }
.api header { padding: 14px 16px; border-bottom: 1px solid #333833; display: flex; justify-content: space-between; align-items: center; }
.api header b { font: 18px var(--serif); color: #fff; }
.api header button { background: transparent; color: #dfe5d2; border-color: #4a5049; }
.api header button:hover:not(:disabled) { background: #333833; }
.api .log { overflow: auto; flex: 1; padding: 10px; }
.api .entry { border: 1px solid #333833; border-radius: 8px; margin-bottom: 8px; overflow: hidden; animation: flash 1.2s ease; }
@keyframes flash { from { border-color: var(--lime); } }
.api .entry .h { display: flex; gap: 8px; align-items: center; padding: 7px 10px; background: #262a26; font-size: 12px; cursor: pointer; }
.api .entry .sys { font-weight: 700; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; }
.api .sys.xero { background: #13b5ea; color: #002a3a; } .api .sys.sms { background: #ffb547; color: #3a2400; } .api .sys.email { background: #9ad1a0; color: #10351a; }
.api .sys.pay { background: #a99cff; color: #1c1050; } .api .sys.esri { background: #6fc3c9; color: #083033; } .api .sys.sailis { background: #d9c27a; color: #3a2e00; } .api .sys.ai { background: #d6c8ff; color: #2c1f66; } .api .sys.hook { background: #ff8fa3; color: #4a0012; }
.api .meth { font-family: var(--mono); color: var(--lime); } .api .st { margin-left: auto; font-family: var(--mono); }
.api pre { margin: 0; padding: 10px; font: 11.5px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; color: #c7cfbb; background: #1d201d; max-height: 300px; overflow: auto; }
.api-fab { position: fixed; right: 16px; bottom: 70px; z-index: 99; }

/* Toasts & modal */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 13.5px; animation: up .25s ease; max-width: 620px; }
.toast.ok { border-left: 4px solid var(--lime); } .toast.bad { border-left: 4px solid #ff8a80; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(28,30,28,.5); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal .mh { padding: 18px 22px 8px; } .modal .mb { padding: 8px 22px 12px; } .modal .mf { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 0 6px 6px 0; background: #fbfaf7; font-size: 13px; }

/* Payment page */
.checkout { max-width: 960px; margin: 30px auto; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.08); border: 1px solid var(--line); }
.checkout .summary { background: #f6f6f3; padding: 30px; }
.checkout .pay { padding: 30px; }
.test-ribbon { background: #fff4d6; color: #7a5208; font-size: 12px; font-weight: 700; text-align: center; padding: 6px; letter-spacing: .05em; }
.card-input { display: flex; border: 1px solid #c9ccc1; border-radius: 8px; overflow: hidden; } .card-input input { border: 0; border-radius: 0; }
.big-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 34px; margin: 0 auto 12px; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--leaf), #8aa35a); transition: width .3s; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 10px; background: var(--leaf); border-radius: 3px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; border-radius: 8px 8px 0 0; background: transparent; padding: 9px 14px; color: var(--muted); }
.tabs button.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
.phone { width: 270px; border-radius: 30px; background: #111; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.phone .scr { background: #f2f2f6; border-radius: 20px; padding: 16px 12px; min-height: 220px; font-size: 13px; }
.bubble { background: #e5e5ea; border-radius: 16px; padding: 9px 12px; color: #111; }
.email-prev { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.email-prev .eh { background: var(--ink); color: #fff; padding: 10px 14px; font-family: var(--serif); font-size: 16px; }
.email-prev .eb { padding: 14px; font-size: 13px; white-space: pre-wrap; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.chart-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.chart-bars .b { width: 100%; border-radius: 4px 4px 0 0; background: var(--leaf); }
.chart-bars .b.alt { background: var(--lime); }
.flowchart { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flowchart .node { border: 1.5px solid var(--ink); border-radius: 8px; padding: 8px 12px; background: #fff; font-size: 13px; }
.flowchart .node.dec { border-style: dashed; background: var(--sage); }
.flowchart .arr { color: var(--muted); }
.stat { font-size: clamp(22px, 2.2vw, 32px); }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .topbar .basis-legend, .topbar .env { display: none; } .portal-top .inner { flex-wrap: wrap; height: auto; padding: 10px 16px; } .portal-top nav { overflow-x: auto; } .g2 { grid-template-columns: 1fr; } .checkout { grid-template-columns: 1fr; } }

/* Full-screen maps (MapLibre FullscreenControl, native or pseudo full screen) */
.map-wrap { position: relative; }
.map-wrap:fullscreen, .map-wrap.maplibregl-pseudo-fullscreen { background: var(--ink); }
.map-wrap.maplibregl-pseudo-fullscreen { position: fixed !important; inset: 0; z-index: 140; }
.map-wrap:fullscreen > .map, .map-wrap.maplibregl-pseudo-fullscreen > .map { height: 100% !important; min-height: 0; border-radius: 0; border: 0; }
.map:fullscreen, .map.maplibregl-pseudo-fullscreen { border-radius: 0; border: 0; }

/* Action feedback */
.toast { display: flex; gap: 10px; align-items: flex-start; }
.toast-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: #4a5049; color: #fff; margin-top: 1px; }
.toast.ok .toast-ic { background: var(--lime); color: var(--ink); }
.toast.bad { background: #5c1d19; } .toast.bad .toast-ic { background: #ff8a80; color: #5c1d19; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
button[aria-disabled="true"]:hover { background: inherit; }
button.primary[aria-disabled="true"]:hover { background: var(--ink); }
button.lime[aria-disabled="true"]:hover { background: var(--lime); }
@keyframes done-flash { 0% { box-shadow: 0 0 0 0 rgba(211,226,117,.9); } 100% { box-shadow: 0 0 0 14px rgba(211,226,117,0); } }
.just-done { animation: done-flash .9s ease-out; }

/* Reference layer control (live PIRSA layers) */
.ref-ctrl { position: relative; }
.ref-ctrl .ref-btn { font-size: 15px; line-height: 1; font-weight: 700; color: var(--ink); }
.ref-panel { position: absolute; right: 38px; top: 0; width: 300px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 10px 12px; font: 13px/1.4 var(--sans); color: var(--ink); text-align: left; z-index: 3; }
.ref-panel[hidden] { display: none; }
.ref-title { font-weight: 700; margin-bottom: 6px; } .ref-title span { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ref-row { display: grid; grid-template-columns: 18px 16px 1fr; gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line-2); font-weight: 400; margin: 0; cursor: pointer; }
.ref-row input { width: auto; margin-top: 2px; } .ref-row .sw { margin-top: 4px; }
.ref-row small { display: block; color: var(--muted); font-size: 11.5px; } .ref-row .ref-stat { color: var(--ink-2); margin-top: 2px; }
.ref-foot { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 6px; margin-top: 2px; }
/* Fly-in caption, incident counter, boundary history bar */
.fly-cap { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); background: rgba(40,44,40,.85); color: #fff; font: 20px/1.2 var(--serif); padding: 8px 16px; border-radius: 10px; opacity: 0; transition: opacity .6s; pointer-events: none; z-index: 5; white-space: nowrap; }
.fly-cap.on { opacity: 1; }
.map-count { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); background: rgba(40,44,40,.88); color: #fff; font: 600 14px var(--sans); padding: 6px 14px; border-radius: 999px; z-index: 5; pointer-events: none; font-variant-numeric: tabular-nums; }
.map-count:empty { display: none; }
.hist-bar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: min(480px, calc(100% - 120px)); background: rgba(255,255,255,.96); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 14px; z-index: 5; font-size: 13px; }
.hist-bar input[type=range] { padding: 0; margin: 6px 0 2px; accent-color: var(--leaf); }
.hist-ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.hist-cap { margin-top: 6px; min-height: 36px; }

/* Grower "My vineyards": list linked to map */
.vy-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vy-card:hover { border-color: #b9c08f; }
.vy-card.sel { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime), var(--shadow); }
.vy-card:focus-visible { outline: 3px solid rgba(160,180,60,.6); outline-offset: 2px; }
/* Block-level selection (overrides the earlier whole-card version) */
.vy-card { cursor: default; }
.vy-card .vy-head { cursor: pointer; border-radius: 8px; margin: -6px -8px 6px; padding: 6px 8px; }
.vy-card .vy-head:hover { background: var(--sage); }
.vy-card.sel { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime), var(--shadow); }
.blk-row td { transition: background .15s; }
.blk-row.sel td { background: #e9f3b0; font-weight: 600; }
.blk-row.sel td:first-child { box-shadow: inset 4px 0 0 var(--ink); }
.blk-row:focus-visible { outline: 3px solid rgba(160,180,60,.6); outline-offset: -3px; }
.vlabel.sel-info { background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.35); font-size: 12.5px; font-weight: 400; padding: 5px 9px; line-height: 1.35; text-align: center; transform: translateY(-34px); }
/* Dismissable tip */
.hint-bar { display: flex; align-items: center; gap: 10px; background: var(--sage); border: 1px solid var(--sage-2); border-radius: 8px; padding: 6px 6px 6px 12px; margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.hint-bar span { flex: 1; }
.hint-x { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 2px 8px; border-radius: 6px; color: var(--muted); }
.hint-x:hover:not(:disabled) { background: var(--sage-2); color: var(--ink); }
