/* Shell views: Overview, Nest explorer, Nest map, Calendar, Reports.
   Layout follows the reference demo; colours are ours (navy / sea / aqua).
   Loaded after shell.css. Rendered by public/js/app-shell-views.js. */

#shellView.sv-wide .sv-wrap { max-width: 1180px; }
/* Keep "+" reachable above a view, at the viewport edge (views are wider than the field list). */
body.shell-view-open .cur-fab { z-index: 95; right: 20px; }
#shellView .sv-wrap { padding-bottom: 110px; }

.vw-eyebrow { font: 700 11px/1 var(--f-mono, ui-monospace, monospace); letter-spacing: 0.16em; text-transform: uppercase; color: var(--sea-800, #0E7490); margin-bottom: 8px; }
.ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ov-title { font-size: clamp(24px, 4vw, 34px); line-height: 1.1; margin: 0 0 6px; color: var(--ink, #06243B); }
.ov-sub { margin: 0 0 14px; color: var(--cur-gray-500, #6E8085); font-size: 14px; }
.ov-head .ov-sub { margin-bottom: 0; }

.vw-btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--aqua-200, #B9EBF1); background: #fff; color: var(--sea-800, #0E7490); font: 600 14px var(--f-sans, inherit); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.vw-btn.primary { background: linear-gradient(180deg, var(--sea-600, #16A6C4), var(--sea-800, #0E7490)); color: #fff; border-color: transparent; }
.vw-btn:disabled { opacity: 0.45; cursor: default; }
.vw-link { background: none; border: none; color: var(--sea-800, #0E7490); font: 700 13px var(--f-sans, inherit); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 10px 0 0; min-height: 44px; }
.vw-input { min-height: 44px; border: 1.5px solid var(--cur-gray-300, #C6D2D4); border-radius: 12px; padding: 0 12px; font: 14px var(--f-sans, inherit); background: #fff; color: inherit; box-sizing: border-box; width: 100%; }

.vw-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.vw-stat { background: #fff; border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 16px; padding: 16px; box-shadow: 0 6px 20px -14px rgba(6, 36, 59, 0.35); }
.vw-stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--cur-gray-600, #4B5563); font: 600 13px var(--f-sans, inherit); }
.vw-stat b { display: block; font-size: 34px; line-height: 1.1; margin: 10px 0 6px; }
.vw-stat small { color: var(--cur-gray-500, #6E8085); font-size: 12px; }
.vw-stat-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-style: normal; flex: none; }
.vw-stat-ico.teal { background: var(--aqua-100, #DEF6F9); color: var(--sea-800, #0E7490); }
.vw-stat-ico.amber { background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); }
.vw-stat-ico.blue { background: var(--aqua-50, #EFFAFB); color: var(--sea-700, #0E8BA8); }
.vw-stat-ico.red { background: var(--coral-soft, #FBE6DD); color: var(--cur-error, #DC2626); }

.vw-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.vw-card { background: #fff; border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 16px; padding: 18px; box-shadow: 0 6px 20px -14px rgba(6, 36, 59, 0.35); }
.vw-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--cur-gray-500, #6E8085); }
.vw-card-h h2 { margin: 0; font-size: 17px; color: var(--ink, #06243B); }
.vw-card-h p { margin: 3px 0 0; font-size: 12.5px; }
.vw-empty { padding: 22px 8px; text-align: center; color: var(--cur-gray-500, #6E8085); font-size: 14px; }
.vw-note { font-size: 12.5px; color: var(--cur-gray-500, #6E8085); line-height: 1.45; margin: 12px 0 0; }

.vw-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; border-top: 1px solid var(--cur-gray-100, #EEF2F2); padding: 12px 0; min-height: 56px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.vw-row:hover { background: var(--aqua-50, #EFFAFB); }
.vw-row-main { flex: 1; min-width: 0; }
.vw-row-main b { display: block; font-size: 14px; }
.vw-row-main small, .vw-table small { display: block; color: var(--cur-gray-500, #6E8085); font-size: 12px; }
.vw-date { width: 46px; flex: none; text-align: center; background: var(--aqua-100, #DEF6F9); color: var(--sea-900, #0B4A5A); border-radius: 10px; padding: 5px 0; font: 700 10px/1.2 var(--f-sans, inherit); }
.vw-date b { display: block; font-size: 17px; }
.vw-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--aqua-100, #DEF6F9); color: var(--sea-800, #0E7490); display: flex; align-items: center; justify-content: center; flex: none; }

.vw-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 700 11.5px var(--f-sans, inherit); white-space: nowrap; }
.vw-chip.ok { background: rgba(31, 158, 110, 0.14); color: #137A54; }
.vw-chip.warn { background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); }
.vw-chip.bad { background: var(--coral-soft, #FBE6DD); color: #B3261E; }
.vw-chip.draft { background: #EEF2F2; color: #4B5563; }
.vw-chip.done { background: var(--aqua-100, #DEF6F9); color: var(--sea-900, #0B4A5A); }

.vw-q { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; background: none; border: none; border-top: 1px solid var(--cur-gray-100, #EEF2F2); padding: 12px 0; font: 14px var(--f-sans, inherit); color: inherit; text-align: left; min-height: 44px; }
button.vw-q { cursor: pointer; }
.vw-q small { color: var(--cur-gray-500, #6E8085); font-size: 12px; max-width: 60%; text-align: right; }
.vw-q.has b { color: var(--amber-700, #B26A12); }

.vw-bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 8px; }
.vw-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.vw-bar-col { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.vw-bar-col i { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--aqua-200, #B9EBF1); }
.vw-bar-col i.peak { background: var(--sea-800, #0E7490); }
.vw-bar-n { font: 700 12px var(--f-sans, inherit); }
.vw-bar-l { font-size: 11.5px; color: var(--cur-gray-500, #6E8085); }

/* Explorer: stacked cards on phones, table from 900px */
.vw-tools { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
.vw-tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; width: 100%; padding: 12px 4px; background: none; border: none; border-top: 1px solid var(--cur-gray-100, #EEF2F2); text-align: left; font: 14px var(--f-sans, inherit); color: inherit; cursor: pointer; align-items: center; }
button.vw-tr:hover { background: var(--aqua-50, #EFFAFB); }
.vw-th { display: none; }
.c-id { font-weight: 700; color: var(--sea-800, #0E7490); }
.vw-pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--cur-gray-500, #6E8085); flex-wrap: wrap; }
.vw-pager .vw-btn { margin-left: 6px; }

/* Map */
.vw-map { height: min(60vh, 560px); min-height: 320px; border-radius: 12px; overflow: hidden; background: var(--aqua-100, #DEF6F9); }
.vw-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; }
.vw-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* Calendar */

/* Reports */
.rp-bar { display: grid; grid-template-columns: minmax(80px, 1.2fr) 3fr 28px; gap: 10px; align-items: center; padding: 8px 0; font-size: 13.5px; }
.rp-bar div { height: 10px; background: var(--cur-gray-100, #EEF2F2); border-radius: 6px; overflow: hidden; }
.rp-bar i { display: block; height: 100%; background: var(--sea-600, #16A6C4); border-radius: 6px; }
.rp-bar b { text-align: right; }
.vw-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Phone: calendar cells are too narrow for text, so events become dots; the "This month" list is the tap target. */
@media (max-width: 699px) {
}

@media (min-width: 700px) {
  .vw-stats { grid-template-columns: repeat(4, 1fr); }
  .vw-grid { grid-template-columns: 1fr 1fr; }
  .vw-tools { grid-template-columns: 1fr 160px 150px 150px; }
}
@media (min-width: 900px) {
  .vw-th { display: grid; cursor: default; font-weight: 700; color: var(--cur-gray-500, #6E8085); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
  .vw-tr { grid-template-columns: 1.2fr 1.4fr 1fr 1fr 1fr 0.5fr; }
}

/* ── Calendar notes ─────────────────────────────────────── */
.cn-status { background: var(--aqua-100, #DEF6F9); color: var(--sea-900, #0B4A5A); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.cn-status.pend { background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); }
.vw-btn.danger { color: #B3261E; border-color: #F3C4BF; }

.cn-scrim { position: fixed; inset: 0; z-index: 760; background: rgba(6, 36, 59, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.cn-sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25); font-family: var(--f-sans, inherit); color: var(--ink, #06243B); }
.cn-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--cur-gray-100, #EEF2F2); }
.cn-head h2 { margin: 0; font-size: 18px; }
.cn-x { width: 44px; height: 44px; border: none; background: none; font-size: 26px; cursor: pointer; color: inherit; }
.cn-body { padding: 14px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; }
.cn-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--cur-gray-100, #EEF2F2); }
.cn-foot .vw-btn { margin-left: 6px; }
.cn-f { display: flex; flex-direction: column; gap: 5px; font: 600 13px var(--f-sans, inherit); flex: 1; min-width: 0; }
.cn-f small { font-weight: 400; color: var(--cur-gray-500, #6E8085); }
.cn-f textarea { padding: 10px 12px; resize: vertical; min-height: 88px; }
.cn-row { display: flex; gap: 10px; }
.cn-fs { border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 12px; padding: 8px 12px 10px; margin: 0; }
.cn-fs legend { font: 700 12px var(--f-sans, inherit); color: var(--cur-gray-600, #4B5563); padding: 0 6px; }
.cn-radio, .cn-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.cn-radio input, .cn-check input { width: 20px; height: 20px; flex: none; }
.cn-people { margin: 0 0 6px 30px; max-height: 160px; overflow-y: auto; border-left: 3px solid var(--aqua-200, #B9EBF1); padding-left: 10px; }
.cn-static { margin: 6px 0; font-size: 14px; color: var(--cur-gray-600, #4B5563); }
.cn-msg { border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.cn-msg.bad { background: var(--coral-soft, #FBE6DD); color: #B3261E; }
.cn-msg.warn { background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); }
.cn-actions { display: flex; gap: 8px; margin-top: 8px; }
@media (min-width: 700px) { .cn-scrim { align-items: center; } .cn-sheet { border-radius: 20px; } }

/* Lists of the original nest cards (Overview): a plain scroll box. It deliberately does not use
   the `.cur` page class, whose min-height stretches it past the panel and defeats scrolling. */
.ov-scroll { max-height: min(560px, 70vh); overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; padding: 4px 6px 10px 2px; font-family: var(--f-sans, inherit); color: var(--ink, #06243B); }
.ov-scroll, .ov-scroll * { box-sizing: border-box; }
.ov-scroll > .cur-nest { flex: none; }

/* Season activity drill-down */
.vw-bar { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 10px; min-width: 0; }
.vw-bar:hover .vw-bar-col i, .vw-bar:focus-visible .vw-bar-col i { filter: brightness(0.92); }
.vw-bar:focus-visible { outline: 2px solid var(--cyan, #2BBFD4); outline-offset: 2px; }
.vw-bar.sel .vw-bar-col i { background: var(--sea-800, #0E7490); }
.vw-bar.sel .vw-bar-l { font-weight: 700; color: var(--ink, #06243B); }
.vw-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin: 2px 0 6px; color: var(--cur-gray-500, #6E8085); }
.vw-crumbs b { color: var(--ink, #06243B); }
.vw-crumb { background: none; border: none; padding: 0; min-height: 32px; font: 600 13px var(--f-sans, inherit); color: var(--sea-800, #0E7490); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.vw-sub-h { font: 700 13px var(--f-sans, inherit); margin: 14px 0 8px; color: var(--cur-gray-600, #4B5563); }

/* ── Admin inside the shell ─────────────────────────────────
   The panel keeps its own dark header; the shell's top bar and sidebar stay visible around it.
   z-index sits below the top bar / drawer so the nav still opens over it, and above
   views; forms and modals (500+) still open over everything. */
body.has-shell #adminPanel { top: var(--shell-bar-h) !important; z-index: 95 !important; }
@media (min-width: 1024px) { body.has-shell #adminPanel { left: var(--shell-w) !important; } }
body.has-shell #adminPanel .adm-wrap { max-width: 940px !important; }
.adm-hide { display: none !important; }
.adm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 4px; position: sticky; top: 0; z-index: 5; background: linear-gradient(180deg, var(--aqua-50, #EFFAFB) 80%, transparent); -webkit-overflow-scrolling: touch; }
.adm-tab { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--aqua-200, #B9EBF1); background: #fff; color: var(--sea-800, #0E7490); font: 600 14px var(--f-sans, inherit); cursor: pointer; }
.adm-tab[aria-selected="true"] { background: linear-gradient(180deg, var(--sea-600, #16A6C4), var(--sea-800, #0E7490)); color: #fff; border-color: transparent; }
#cnModal [hidden] { display: none !important; }

/* A view fills the screen with its own scroll area, so the page behind it must not scroll too
   (it showed a second scrollbar and let the old home screen scroll underneath). */
body.shell-view-open { overflow: hidden; }

/* Explorer: date-range chip (set from the Overview chart) */
.vw-filterchip { display: inline-flex; align-items: center; gap: 6px; background: var(--aqua-100, #DEF6F9); color: var(--sea-900, #0B4A5A); border-radius: 999px; padding: 4px 6px 4px 12px; font: 600 13px var(--f-sans, inherit); margin-bottom: 10px; }
.vw-filterchip button { width: 28px; height: 28px; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.7); color: inherit; font-size: 16px; cursor: pointer; }
.vw-sub-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* ── Recent field activity rows + nest record page ───────── */
.vw-ico.warn { background: var(--coral-soft, #FBE6DD); color: #B3261E; }
.vw-go { color: var(--cur-gray-400, #93A4A8); display: flex; flex: none; }
.vw-row:hover .vw-go { color: var(--sea-800, #0E7490); }
.ov-rows .vw-row:first-child { border-top: none; }

.rc-head-r { padding-top: 4px; }
.rc-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rc-main, .rc-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 4px; }
.rc-facts span { display: block; font-size: 12px; color: var(--cur-gray-500, #6E8085); margin-bottom: 4px; }
.rc-facts b { font-size: 15px; }
.rc-spark { width: 100%; height: auto; max-height: 160px; display: block; margin-top: 6px; }
.rc-spark-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--cur-gray-500, #6E8085); border-top: 1px solid var(--cur-gray-100, #EEF2F2); padding-top: 8px; margin-top: 6px; }
.rc-place { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 2px; }
.rc-place small { color: var(--cur-gray-500, #6E8085); font-size: 12.5px; }
.rc-coords { font: 600 13px var(--f-mono, ui-monospace, monospace); margin: 0 0 10px; }
.rc-audit { display: flex; gap: 10px; align-items: flex-start; background: var(--aqua-100, #DEF6F9); color: var(--sea-900, #0B4A5A); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.4; }
.rc-timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--aqua-200, #B9EBF1); display: flex; flex-direction: column; gap: 16px; }
.rc-timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; }
.rc-timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--sea-800, #0E7490); box-shadow: 0 0 0 3px #fff; }
.rc-timeline li.future::before { background: #fff; border: 2px solid var(--amber, #E8A13C); width: 10px; height: 10px; }
.rc-timeline time { font-size: 12px; color: var(--cur-gray-500, #6E8085); }
.rc-timeline b { font-size: 14px; }
.rc-timeline em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.rc-timeline small { color: var(--cur-gray-500, #6E8085); font-size: 12.5px; }
@media (min-width: 900px) { .rc-layout { grid-template-columns: 2fr 1fr; align-items: start; } }

/* ── Record page: interactive temperature chart, map, media ─ */
.tc { position: relative; }
.tc-read { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; min-height: 40px; }
.tc-read b { font-size: 28px; line-height: 1.1; color: var(--sea-800, #0E7490); font-family: var(--f-curr, serif); font-weight: 400; }
.tc-read span { font-size: 13.5px; color: var(--cur-gray-600, #4B5563); font-weight: 600; }
.tc-read small { font-size: 12.5px; color: var(--cur-gray-500, #6E8085); }
.tc-svg { width: 100%; height: auto; display: block; touch-action: pan-y; cursor: crosshair; border-radius: 10px; }
.tc-svg:focus-visible { outline: 2px solid var(--cyan, #2BBFD4); outline-offset: 2px; }
.tc-grid { stroke: var(--cur-gray-100, #EEF2F2); stroke-width: 1; }
.tc-ax { font: 11px var(--f-sans, sans-serif); fill: var(--cur-gray-500, #6E8085); }
.tc-line { fill: none; stroke: var(--sea-800, #0E7490); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.tc-cross { stroke: var(--sea-600, #16A6C4); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tc-dot { fill: #fff; stroke: var(--sea-800, #0E7490); stroke-width: 3; }

.rc-map { height: 220px; border-radius: 12px; overflow: hidden; background: var(--aqua-100, #DEF6F9); margin-bottom: 10px; }
.rc-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rc-media figure { margin: 0; min-width: 0; }
.rc-media-tile { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 12px; background: var(--aqua-50, #EFFAFB); cursor: pointer; overflow: hidden; }
.rc-media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-media-load { color: var(--cur-gray-400, #93A4A8); font-size: 18px; }
.rc-media-miss { font-size: 11px; color: var(--amber-700, #B26A12); text-align: center; padding: 4px; line-height: 1.3; }
.rc-media figcaption { font-size: 11.5px; color: var(--cur-gray-500, #6E8085); text-align: center; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Beach events ───────────────────────────────────────── */
.vw-evpin { width: 28px; height: 28px; border-radius: 8px; transform: rotate(45deg); background: var(--amber, #E8A13C); border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); display: flex; align-items: center; justify-content: center; }
.vw-evpin::before { content: "!"; transform: rotate(-45deg); font: 800 15px/1 var(--f-sans, sans-serif); color: #3b2500; }
.vw-evkey { border-radius: 3px !important; transform: rotate(45deg); background: var(--amber, #E8A13C); }
.rc-impact { margin: 4px 0 12px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rc-sevs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* The floating "report a problem" button is redundant inside the shell: the sidebar has the same action. */
body.has-shell #stjFbBtn { display: none !important; }

/* Triangulation distances listed under the record's location */
.rc-tri { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; font-size: 13px; }
.rc-tri b { font-size: 12px; color: var(--cur-gray-500, #6E8085); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.rc-tri span { font-family: var(--f-mono, ui-monospace, monospace); font-size: 12.5px; }

/* ── Hand-drawn zone map on the record page ─────────────── */
.zm-tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.zm-pane.hide { display: none; }
.zm-stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--aqua-50, #EFFAFB); border: 1px solid var(--cur-gray-100, #EEF2F2); line-height: 0; }
.zm-stage img { width: 100%; height: auto; display: block; }
.zm-blank { min-height: 160px; display: flex; align-items: center; justify-content: center; padding: 16px; font: 13px/1.4 var(--f-sans, sans-serif); color: var(--cur-gray-500, #6E8085); text-align: center; background: var(--aqua-50, #EFFAFB); }
.zm-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.zm-svg polyline { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.zm-svg .zm-in { stroke: #10B981; }
.zm-svg .zm-out { stroke: #EF4444; }
.zm-nest { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2.5px solid #1D4ED8; background: rgba(59, 130, 246, 0.3); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.zm-nest.reloc { border-color: #B45309; background: rgba(245, 158, 11, 0.3); }
.zm-nest::before, .zm-nest::after { content: ""; position: absolute; left: 50%; top: 50%; background: #fff; transform: translate(-50%, -50%); }
.zm-nest::before { width: 14px; height: 2px; }
.zm-nest::after { width: 2px; height: 14px; }
.zm-cap { margin: 8px 0 0; font-size: 13px; color: var(--cur-gray-600, #4B5563); font-weight: 600; text-transform: capitalize; }
.zm-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12.5px; color: var(--cur-gray-600, #4B5563); }
.zm-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.zm-key.nest { background: rgba(59, 130, 246, 0.35); border: 2px solid #1D4ED8; }
.zm-key.in { background: #10B981; border-radius: 3px; height: 4px; }
.zm-key.out { background: #EF4444; border-radius: 3px; height: 4px; }

/* Overview summary: same layout as the field list (4 live counts, then the season row) */
.vw-stat-ico.green { background: rgba(31, 158, 110, 0.14); color: var(--cur-success, #1F9E6E); }
.vw-season-h { margin: 6px 0 8px; color: var(--cur-gray-500, #6E8085); }
.vw-stats-3 { grid-template-columns: repeat(3, 1fr); }
.vw-stats-3 .vw-stat { padding: 14px; }
.vw-stats-3 .vw-stat b { font-size: 30px; }
.vw-warn { background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); border-radius: 12px; padding: 10px 14px; font: 600 13px var(--f-sans, inherit); margin: -2px 0 14px; }
@media (max-width: 520px) { .vw-stats-3 .vw-stat small { display: none; } .vw-stats-3 .vw-stat-top { font-size: 12px; } }
.vw-stat { min-width: 0; }
@media (max-width: 520px) { .vw-stats-3 { gap: 8px; } .vw-stats-3 .vw-stat { padding: 12px 10px; } .vw-stats-3 .vw-stat-ico { display: none; } .vw-stats-3 .vw-stat b { font-size: 28px; } }

/* ── Incident explorer, approximate positions, data quality ─ */
.vw-tr { grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .vw-tr { grid-template-columns: 1.25fr 1fr 1.3fr 1fr 1fr 1fr 0.45fr; } }
.vw-tri { width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-bottom: 22px solid var(--c, #F59E0B); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55)); position: relative; }
.vw-tri::after { content: ""; position: absolute; left: -7px; top: 6px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid rgba(255, 255, 255, 0.55); }
.vw-trikey { display: inline-block; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--amber, #E8A13C); margin-right: 6px; vertical-align: -1px; }
.rc-confirm { background: var(--amber-soft, #FBEFD6); border-radius: 12px; padding: 12px 14px; margin: 8px 0 10px; font-size: 13px; color: #6B3F00; }
.rc-confirm p { margin: 0 0 8px; line-height: 1.45; }
.rc-confirm .vw-actions { margin: 0; }
.rc-tri em { color: var(--amber-700, #B26A12); font-style: normal; font-family: var(--f-sans, sans-serif); }
.vw-ok { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; font-size: 14px; color: #137A54; }
.vw-cluster { width: 32px; height: 32px; border-radius: 50%; background: #0B4A5A; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55); }
.vw-clkey { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: #0B4A5A; color: #fff; font-size: 10px; font-weight: 700; align-items: center; justify-content: center; margin-right: 6px; font-style: normal; }
.leaflet-tooltip.vw-maptip { font-size: 13px; line-height: 1.35; width: 250px; white-space: normal !important; box-sizing: border-box; }
.vw-tipline { padding: 3px 0; border-top: 1px solid rgba(0, 0, 0, 0.12); }
.vw-tipline:first-of-type { border-top: 0; }
.vw-poplist { max-height: 240px; overflow: auto; margin-top: 4px; }

/* ── Calendar: month / week / day + the side list ─────────────────────── */
.cal-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 12px; }
.cal-seg { display: inline-flex; border: 1px solid var(--aqua-200, #B9EBF1); border-radius: 12px; overflow: hidden; }
.cal-segb { border: none; background: #fff; padding: 0 18px; min-height: 40px; font: 600 14px var(--f-sans, inherit); cursor: pointer; color: var(--sea-900, #0B4A5A); }
.cal-segb.on { background: var(--sea-900, #0B4A5A); color: #fff; }
.cal-field { display: flex; align-items: center; gap: 6px; font: 600 12.5px var(--f-sans, inherit); color: var(--cur-gray-600, #4B5563); flex-wrap: wrap; }
.cal-field .vw-input { min-height: 40px; width: auto; }
.cal-rng .vw-btn { min-height: 40px; }
.cal-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-bar h2 { margin: 0; font-size: 18px; }
.cal-bar .vw-btn { min-width: 44px; justify-content: center; padding: 0 12px; margin-left: 4px; }
.cal-key { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-key .k, .cal-ev { --c: #2563EB; font: 600 11px/1.2 var(--f-sans, inherit); border-radius: 6px; padding: 5px 7px; border: none; border-left: 4px solid var(--c); background: #EEF2F7; background: color-mix(in srgb, var(--c) 14%, #fff); color: #1F2937; color: color-mix(in srgb, var(--c) 68%, #000); }
.cal-ev { text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.cal-ev.done { text-decoration: line-through; opacity: 0.65; }
.cal-ev.pend, .cal-item.pend { outline: 1.5px dashed var(--amber, #E8A13C); outline-offset: -1.5px; }
.cal-ev.bad, .cal-item.bad { outline: 1.5px solid var(--cur-error, #DC2626); outline-offset: -1.5px; }
.cal-ev .ic { vertical-align: -1px; margin-right: 3px; }
.cal-grid, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font: 700 11px var(--f-sans, inherit); color: var(--cur-gray-500, #6E8085); text-align: center; padding: 4px 0; }
.cal-cell { position: relative; min-height: 96px; border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; cursor: pointer; }
.cal-cell.out { border: none; cursor: default; }
.cal-cell.today { background: var(--aqua-50, #EFFAFB); border-color: var(--aqua-200, #B9EBF1); }
.cal-cell.sel { outline: 2px solid var(--sea-600, #16A6C4); outline-offset: -2px; }
.cal-d { font: 700 12px var(--f-sans, inherit); color: var(--cur-gray-600, #4B5563); }
.cal-add { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: none; background: var(--aqua-100, #DEF6F9); color: var(--sea-900, #0B4A5A); font-weight: 700; line-height: 1; cursor: pointer; opacity: 0; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-more { background: none; border: none; padding: 2px 0; text-align: left; font: 600 10.5px var(--f-sans, inherit); color: var(--sea-700, #0E7490); cursor: pointer; }
.cal-week .cal-cell { min-height: 260px; overflow: visible; }
.cal-week .cal-ev { white-space: normal; }
.cal-day { display: flex; flex-direction: column; gap: 2px; }
.cal-allday { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; margin-bottom: 6px; background: var(--aqua-50, #EFFAFB); border-radius: 10px; }
.cal-allday > b { width: 54px; flex: none; font-size: 12px; color: var(--cur-gray-600, #4B5563); }
.cal-allday > div { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-hr { display: grid; grid-template-columns: 54px 1fr; gap: 8px; border-top: 1px solid var(--cur-gray-100, #EEF2F2); min-height: 44px; padding: 4px 0; }
.cal-hr > span { font-size: 12px; color: var(--cur-gray-500, #6E8085); padding-top: 4px; }
.cal-hr > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-rangelist { max-height: 70vh; overflow-y: auto; }
.cal-panel-body { max-height: min(68vh, 640px); overflow-y: auto; padding-right: 4px; }
.cal-item { display: block; width: 100%; text-align: left; border: 1px solid var(--cur-gray-100, #EEF2F2); border-left: 5px solid var(--c, #2563EB); border-radius: 10px; padding: 9px 12px; margin: 0 0 8px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.cal-item:hover { background: var(--aqua-50, #EFFAFB); }
.cal-item.done b { text-decoration: line-through; opacity: 0.7; }
.cal-item b { display: block; font-size: 14px; }
.cal-item small { display: block; color: var(--cur-gray-500, #6E8085); font-size: 12px; margin-top: 1px; }
.cal-tag { display: inline-block; font: 700 10.5px var(--f-sans, inherit); text-transform: uppercase; letter-spacing: 0.05em; color: #374151; color: color-mix(in srgb, var(--c, #2563EB) 72%, #000); margin-bottom: 2px; }
.cal-dayh { font: 700 12px var(--f-sans, inherit); color: var(--cur-gray-500, #6E8085); padding: 10px 2px 6px; position: sticky; top: 0; background: #fff; z-index: 1; cursor: pointer; }
.cal-dayh.over { color: #B3261E; cursor: default; }
.cal-detail { border-left: 5px solid var(--c, #2563EB); padding-left: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cal-detail h3 { margin: 0; font-size: 18px; }
.cal-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
.cal-detail dt { color: var(--cur-gray-500, #6E8085); }
.cal-detail dd { margin: 0; font-weight: 600; }

@media (max-width: 699px) {
  .cal-month .cal-cell { flex-direction: row; flex-wrap: wrap; align-content: flex-start; min-height: 58px; gap: 3px; }
  .cal-month .cal-d { width: 100%; }
  .cal-month .cal-ev { width: 10px; height: 10px; padding: 0; font-size: 0; border-radius: 50%; border: none; background: var(--c); pointer-events: none; }
  .cal-month .cal-more { font-size: 10px; pointer-events: none; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-week .cal-cell { min-height: 0; }
  .cal-add { display: none; }
}
@media (min-width: 900px) {
  .cal-layout:not(.cal-ranged) { grid-template-columns: 2fr 1fr; align-items: start; }
  .cal-panel { position: sticky; top: 12px; }
}
@media (hover: none) { .cal-add { display: none; } }
.cn-colours { display: flex; gap: 2px; flex-wrap: wrap; }
.cn-sw { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cn-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cn-sw span { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
.cn-sw input:checked + span { box-shadow: 0 0 0 3px var(--c); }
.cn-sw input:focus-visible + span { outline: 3px solid var(--sea-600, #16A6C4); outline-offset: 3px; }

/* ── Document sheets (admin card, review screen, print picker) ───────────── */
.ds-sheet { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--cur-gray-100, #EEF2F2); }
.ds-sheet small { display: block; color: var(--cur-gray-500, #6E8085); font-size: 12px; }
.cn-sheet.ds-wide { max-width: 920px; }
.ds-rows { display: flex; flex-direction: column; }
.ds-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--cur-gray-100, #EEF2F2); }
.ds-lab b { display: block; font-size: 14px; }
.ds-lab small { display: block; color: var(--cur-gray-500, #6E8085); font-size: 12px; overflow-wrap: anywhere; }
.ds-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-pick select { flex: 1 1 220px; min-width: 0; }
.ds-days { width: 78px; flex: none; }
.ds-b { font: 700 11px var(--f-sans, inherit); border-radius: 999px; padding: 4px 9px; white-space: nowrap; background: var(--cur-gray-100, #EEF2F2); color: var(--cur-gray-600, #4B5563); }
.ds-b.ok { background: rgba(31, 158, 110, 0.15); color: #137A54; }
.ds-b.maybe { background: var(--amber-soft, #FBEFD6); color: var(--amber-700, #B26A12); }
.ds-b.none { background: var(--coral-soft, #FBE6DD); color: #B3261E; }
.ds-extra { margin-top: 10px; font-size: 13px; }
.ds-extra summary { cursor: pointer; font-weight: 600; }
@media (max-width: 699px) { .ds-row { grid-template-columns: 1fr; } }

/* ── Sheet preview (review screen) ─────────────────────────────────────── */
.cn-sheet.ds-xwide { max-width: 1320px; }
.ds-split { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ds-right { min-width: 0; order: -1; }
.ds-prev-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 6px; font-size: 13px; }
.ds-prev-key { display: inline-flex; align-items: center; gap: 4px; color: var(--cur-gray-500, #6E8085); font-size: 12px; }
.ds-prev-fill { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.ds-prev-fill select { min-height: 36px; max-width: 220px; }
.ds-prev { background: #E4E9EC; border-radius: 12px; padding: 10px; max-height: 42vh; overflow: auto; }
.ds-num { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--cur-gray-100, #EEF2F2); color: var(--cur-gray-600, #4B5563); font: 700 11px var(--f-sans, inherit); align-items: center; justify-content: center; margin-right: 6px; vertical-align: 1px; }
.ds-row.flash { background: var(--amber-soft, #FBEFD6); transition: background 0.3s; }
.pv-wrap { position: relative; overflow: hidden; }
.pv-page { --c: #64748B; background: #fff; color: #111; font: 11pt/1.25 "Liberation Sans", Arial, sans-serif; box-sizing: content-box; transform-origin: 0 0; padding: 0.4cm 0.2cm; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
.pv-p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.1em; }
.pv-tab { display: inline-block; width: 1.25cm; }
.pv-t { border-collapse: collapse; table-layout: fixed; margin: 0.12cm 0; }
.pv-t td { vertical-align: top; padding: 0.05cm 0.1cm; border: 0; overflow-wrap: anywhere; }
.pv-ul { margin: 0 0 0 0.6cm; padding: 0; }
.pv-box { display: inline-block; width: 0.34cm; height: 0.34cm; border: 1px solid #333; vertical-align: -0.05cm; margin: 0 0.06cm; position: relative; }
.pv-box.on::after { content: "✕"; position: absolute; inset: -0.08cm 0 0 0.02cm; font-size: 10pt; line-height: 1; font-weight: 700; }
.pv-frame { display: inline-block; position: relative; vertical-align: top; }
.pv-frame img { width: 100%; height: 100%; object-fit: fill; display: block; }
.pv-noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: #eee; color: #888; font-size: 9pt; }
.pv-n { display: inline-flex; width: 0.62cm; height: 0.62cm; border-radius: 50%; background: var(--c); color: #fff; font: 700 9pt/1 Arial, sans-serif; align-items: center; justify-content: center; margin: 0 0.08cm; vertical-align: middle; font-style: normal; flex: none; box-shadow: 0 0 0 0.04cm #fff; }
.pv-ok { --c: #16A34A; } .pv-maybe { --c: #E08A00; } .pv-none { --c: #DC2626; } .pv-img { --c: #64748B; }
.ds-prev-key .pv-n { width: 18px; height: 18px; font-size: 10px; margin: 0 2px 0 6px; box-shadow: none; }
.pv-cell { position: relative; outline: 2px dashed var(--c); outline-offset: -2px; background: rgba(0, 0, 0, 0.02); }
.pv-rg { background: rgba(255, 220, 90, 0.35); border-bottom: 2px solid var(--c); }
.pv-pt { display: inline-block; min-width: 0.9cm; border-bottom: 2px dashed var(--c); }
.pv-frame.pv-slot { outline: 3px dashed var(--c); outline-offset: -3px; }
.pv-slot { cursor: pointer; }
.pv-slot.hot { outline: 3px solid var(--c); outline-offset: -1px; background: rgba(255, 220, 90, 0.55); }
.pv-slot.hot > .pv-n { transform: scale(1.35); }
@media (min-width: 1100px) {
  .ds-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .ds-right { order: 0; position: sticky; top: 0; }
  .ds-prev { max-height: calc(92vh - 260px); }
}
.ds-disp { grid-column: 1 / -1; font-size: 13px; margin: -2px 0 2px; }
.ds-disp summary { cursor: pointer; color: var(--sea-700, #0E7490); font-weight: 600; }
.ds-disp[hidden], .ds-d[hidden] { display: none; }
.ds-d { display: inline-flex; align-items: center; gap: 6px; margin: 6px 14px 0 0; font-weight: 600; }
.ds-d select { min-height: 36px; width: auto; }
.rc-annot { position: relative; line-height: 0; max-width: 760px; }
.rc-annot img { width: 100%; display: block; border-radius: 10px; }
.rc-annot img.rc-annot-ov { position: absolute; left: 0; top: 0; height: 100%; border-radius: 0; }

/* ── UI kit (k-*) ───────────────────────────────────────────
   The shared building blocks for the screens that used to be styled inline in JavaScript:
   cards with a header, list rows, buttons, chips, form fields and sheets. Phone first:
   tap targets are at least 40px, text at least 13px, and nothing is laid out side by side
   unless it fits. */
.k-card { margin-bottom: 14px; background: #fff; border-radius: 18px; border: 1px solid var(--line, #E4ECEC); box-shadow: 0 18px 40px -28px rgba(6, 36, 59, 0.4); overflow: hidden; }
.k-card-hd { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px; min-height: 56px; cursor: pointer; user-select: none; }
.k-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 160px; }
.k-chev { display: inline-block; color: var(--sea-700, #0E8BA8); font-size: 12px; transition: transform 0.15s ease; flex: none; }
.k-card-name { font-family: var(--f-curr, var(--font-display)); font-size: 19px; line-height: 1.15; color: var(--ink, #06243B); }
.k-count { display: inline-block; background: var(--error, #D64545); color: #fff; font: 700 12px/1.3 var(--f-sans, inherit); border-radius: 999px; padding: 2px 8px; }
.k-count.hidden { display: none; }
.k-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; max-width: 100%; }
.k-card-actions button, .k-card-actions select { min-height: 40px; padding: 0 14px !important; font-size: 13.5px !important; font-weight: 600; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.k-card-actions input { min-height: 40px; padding: 0 14px !important; font-size: 16px !important; border-radius: 999px; flex: 1 1 140px; min-width: 0; width: auto !important; max-width: 100%; }
.k-card-body { padding: 2px 14px 16px; }

.k-btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--aqua-200, #B9EBF1); background: #fff; color: var(--sea-800, #0E7490); font: 600 14px var(--f-sans, inherit); cursor: pointer; }
.k-btn.sm { min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; background: var(--gray-50, #F4F8F8); border-color: var(--gray-300, #DBE6E6); color: var(--gray-700, #3A4A4E); white-space: nowrap; }
.k-btn.primary { background: linear-gradient(180deg, var(--sea-600, #16A6C4), var(--sea-800, #0E7490)); color: #fff; border-color: transparent; }
.k-btn.warn { background: var(--amber-soft, #FBEFD6); border-color: #F1D79B; color: #7A4A0A; }
.k-btn.danger { background: #fff; border-color: rgba(204, 79, 44, 0.35); color: var(--coral-700, #CC4F2C); }
.k-btn:disabled { opacity: 0.5; cursor: default; }
.k-btn:focus-visible, .k-card-hd:focus-visible { outline: 2px solid var(--cyan, #2BBFD4); outline-offset: 2px; }

.k-chip { display: inline-block; vertical-align: middle; font: 700 11.5px/1.5 var(--f-sans, inherit); padding: 1px 9px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.k-chip.warn { background: #FEF3C7; color: #92400E; }
.k-chip.pink { background: #FCE7F3; color: #9D174D; }
.k-chip.info { background: #E0E7FF; color: #3730A3; }
.k-chip.muted { background: var(--gray-100, #EEF2F2); color: var(--cur-gray-600, #4B5563); }

/* A list row: avatar and text on the first line; its actions wrap underneath. */
.k-row { display: grid; grid-template-columns: 40px 1fr; gap: 6px 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--gray-100, #EEF2F2); }
.k-row:last-child { border-bottom: none; }
.k-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sea-700, #0E8BA8); color: #fff; display: flex; align-items: center; justify-content: center; font: 700 14px var(--f-sans, inherit); }
.k-row-main { min-width: 0; }
.k-row-name { font: 600 15px/1.4 var(--f-sans, inherit); color: var(--ink, #06243B); overflow-wrap: anywhere; }
.k-row-sub { font-size: 13px; color: var(--cur-gray-500, #6E8085); line-height: 1.4; overflow-wrap: anywhere; }
.k-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
@media (min-width: 900px) {
  .k-row { grid-template-columns: 40px 1fr auto; align-items: center; }
  .k-row-actions { grid-column: auto; margin-top: 0; justify-content: flex-end; max-width: 460px; }
}

/* Admin header inside the shell: the shell's top bar already names the page, so only the
   organisation picker stays, as a slim light bar. */
body.has-shell #adminPanel .adm-hdr { background: none !important; box-shadow: none !important; border-radius: 0 !important; min-height: 0 !important; padding: 8px 16px 0 !important; position: static !important; justify-content: flex-end; }
body.has-shell #adminPanel .adm-hdr-title { display: none !important; }
body.has-shell #adminPanel .adm-hdr select { background: #fff !important; color: var(--ink, #06243B) !important; border: 1.5px solid var(--aqua-200, #B9EBF1) !important; min-height: 40px; font-size: 14px !important; max-width: 100% !important; width: 100%; }
@media (min-width: 700px) { body.has-shell #adminPanel .adm-hdr select { width: auto; min-width: 220px; } }
.adm-tabs { scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.k-row.noav { grid-template-columns: 1fr; }
.k-row.tap { cursor: pointer; }
.k-row.tap:active { background: var(--aqua-50, #EFFAFB); }
@media (min-width: 900px) { .k-row.noav { grid-template-columns: 1fr auto; } }
.k-group-h { font: 700 12px var(--f-sans, inherit); letter-spacing: 0.05em; text-transform: uppercase; color: var(--sea-800, #0E7490); margin: 8px 0 2px; }
.k-row-sub { text-transform: none; }
#adminPanel input[type="checkbox"], #adminPanel input[type="radio"] { width: 20px; height: 20px; accent-color: var(--sea-700, #0E8BA8); }
.k-chip.ok { background: #DDF5E9; color: #0F6B47; }
.k-chip.danger { background: #FDE8E8; color: #B42318; }
.k-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.k-chips .k-chip { margin-left: 0; }
.k-rec { padding: 14px; margin-bottom: 10px; cursor: default; }
.k-rec-code { font: 12.5px ui-monospace, Menlo, Consolas, monospace; color: var(--cur-gray-500, #6E8085); }
.k-rec .k-row-actions { margin-top: 10px; }
.k-btn.sm.primary { background: linear-gradient(180deg, var(--sea-600, #16A6C4), var(--sea-800, #0E7490)); color: #fff; border-color: transparent; }
.k-btn.sm.danger { background: #fff; }
/* Buttons in the older admin screens that are still inline-styled: keep them thumb-sized. */
#adminPanel button { min-height: 38px; }
#adminPanel [id^="adminCardBody_"] button:not(.k-btn) { font-size: 13px !important; }
#adminPanel select, #adminPanel input[type="text"], #adminPanel input[type="search"], #adminPanel input[type="date"], #adminPanel input[type="number"] { min-height: 40px; }
@media (max-width: 699px) { #adminPanel select, #adminPanel input:not([type="checkbox"]):not([type="radio"]), #adminPanel textarea { font-size: 16px !important; } }

/* ── Form builder: works by touch and on a narrow screen ───── */
.vb-add { flex: none; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--aqua-200, #B9EBF1); background: #fff; color: var(--sea-800, #0E7490); font: 700 12px var(--f-sans, inherit); cursor: pointer; }
.vb-nudge { display: flex; flex-direction: column; flex: none; border-left: 1px solid var(--line, #E4ECEC); }
.vb-nudge button { flex: 1; min-width: 36px; border: none; background: transparent; color: var(--sea-800, #0E7490); cursor: pointer; font-size: 12px; padding: 0 6px; min-height: 28px !important; }
.vb-nudge button:first-child { border-bottom: 1px solid var(--line, #E4ECEC); }
@media (max-width: 899px) {
  #vb-root .vb-cols { flex-direction: column; }
  #vb-root #vb-lib { width: auto !important; min-width: 0 !important; align-self: stretch; border-right: none !important; border-bottom: 1px solid var(--line, #E4ECEC); padding: 0 0 10px !important; max-height: 280px; overflow-y: auto; overflow-x: hidden; }
  #vb-root .vb-cols > #vb-canvas { width: 100%; }
  #vb-root > div:first-child > div:first-child { flex: 1 1 100% !important; white-space: normal !important; }
  #vb-root > div:first-child button { min-height: 40px; padding: 0 14px !important; font-size: 13.5px !important; }
}
/* The admin tab strip scrolls sideways on a phone; fade its right edge so that is visible. */
@media (max-width: 699px) { .adm-tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; } }

/* ── Platform overview ───────────────────────────────────── */
.pl-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 10px; margin: 6px 0 8px; }
.pl-nums > div { background: var(--aqua-50, #EFFAFB); border-radius: 12px; padding: 10px 8px; text-align: center; }
.pl-nums b { display: block; font-size: 22px; color: var(--sea-800, #0E7490); }
.pl-nums small, .pl-note { display: block; font-size: 12px; color: var(--cur-gray-500, #6E8085); font-weight: 400; }
.pl-org .vw-actions { margin-top: 8px; }
.pl-people { display: grid; gap: 0; max-height: 360px; overflow-y: auto; }
.pl-person { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 0; border-top: 1px solid var(--cur-gray-100, #EEF2F2); }
.pl-person b { font-size: 14px; }
.pl-person span { grid-column: 1; font-size: 13px; color: var(--cur-gray-500, #6E8085); }
.pl-person small { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 12px; color: var(--cur-gray-500, #6E8085); }
.adm-return { margin: 4px 0 10px; }

/* ── Messages ─────────────────────────────────────────────── */
.msg-list { display: grid; gap: 8px; }
.msg-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%; min-height: 64px; padding: 12px 14px; border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--ink, #06243B); }
.msg-row:hover { background: var(--aqua-50, #EFFAFB); }
.msg-dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.msg-row.unread .msg-dot { background: var(--sea-600, #16A6C4); }
.msg-row.unread b { font-weight: 800; }
.msg-main { display: grid; gap: 2px; min-width: 0; }
.msg-main b { font-size: 15px; }
.msg-main span { font-size: 13px; color: var(--cur-gray-500, #6E8085); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row small { font-size: 12px; color: var(--cur-gray-500, #6E8085); white-space: nowrap; }
.msg-thread { display: grid; gap: 10px; margin: 8px 0 14px; }
.msg-bubble { background: #fff; border: 1px solid var(--cur-gray-100, #EEF2F2); border-radius: 14px; padding: 12px 14px; max-width: 640px; }
.msg-bubble.mine { background: var(--aqua-50, #EFFAFB); margin-left: auto; }
.msg-who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.msg-who span, .msg-who small { color: var(--cur-gray-500, #6E8085); font-size: 12px; }
.msg-who small { margin-left: auto; }
.msg-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.msg-compose, .msg-reply { display: grid; gap: 10px; max-width: 640px; }
.msg-compose .vw-input, .msg-reply .vw-input { width: 100%; font-size: 16px; }
.vw-btn.primary { background: linear-gradient(180deg, var(--sea-600, #16A6C4), var(--sea-800, #0E7490)); color: #fff; border-color: transparent; }
.sh-bell { position: relative; width: 44px; height: 44px; border: none; background: transparent; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: inherit; cursor: pointer; }
.sh-bell-n { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--coral, #F2724B); color: #fff; font: 700 11px/18px var(--f-sans, inherit); text-align: center; }
.sh-bell-n[hidden] { display: none; }
#shellTopbar .sh-burger.has-unread { position: relative; }
#shellTopbar .sh-burger.has-unread::after { content: ""; position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral, #F2724B); }

/* Sheets (dialogs): centred on a wide screen, a bottom sheet on a phone. */
.k-scrim { position: fixed; inset: 0; z-index: 610; background: rgba(6, 36, 59, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.k-sheet { background: #fff; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3); display: grid; gap: 8px; font-family: var(--f-sans, var(--font-body)); }
.k-sheet h3 { font-size: 18px; margin: 0; color: var(--ink, #06243B); }
.k-label { font: 700 12px var(--f-sans, inherit); letter-spacing: 0.04em; text-transform: uppercase; color: var(--cur-gray-500, #6E8085); margin-top: 6px; }
.k-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--gray-300, #DBE6E6); border-radius: 12px; font-size: 16px; box-sizing: border-box; }
.k-help { margin: 0; font-size: 13px; line-height: 1.45; color: var(--cur-gray-600, #4B5563); }
.k-error { margin: 0; font-size: 13px; color: #B42318; font-weight: 600; }
.k-error[hidden] { display: none; }
.k-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.k-actions .k-btn { flex: 1; }
@media (min-width: 700px) { .k-scrim { align-items: center; } .k-sheet { border-radius: 20px; } }

/* Admin runs in two modes (app-shell-admin.js). In an organisation's own Admin there is no organisation picker. */
body.has-shell #adminPanel.adm-org-mode .adm-hdr { display: none !important; }
.k-find { margin-bottom: 8px; }

/* ── Presence dot, and the Platform records search ─────────── */
.pres { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--cur-gray-500, #6E8085); }
.pres i { width: 9px; height: 9px; border-radius: 50%; background: var(--cur-gray-300, #C6D2D4); }
.pres.on { color: #137A54; font-weight: 600; }
.pres.on i { background: #1F9E6E; box-shadow: 0 0 0 3px rgba(31, 158, 110, 0.18); }
.pr-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.pr-filters #prQ { grid-column: 1 / -1; }
.pr-demo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cur-gray-600, #4B5563); }
.pr-out .k-rec { box-shadow: none; }
#adminPanel #platRecords { margin-bottom: 14px; }

/* The Platform workspace shows an icon, not initials, in the switcher. */
#shellSidebar .sh-org-btn .ini.pl { background: var(--amber-700, #B26A12); }
#shellSidebar .sh-org-btn .ini svg { width: 18px; height: 18px; }

/* ── Visiting mode bar ───────────────────────────────────── */
#visitBar { position: fixed; top: var(--shell-bar-h, 56px); left: 0; right: 0; z-index: 99; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 14px; background: #E8F4F8; color: var(--ink, #06243B); border-bottom: 1px solid var(--aqua-200, #B9EBF1); font: 500 13.5px/1.35 var(--f-sans, inherit); }
#visitBar.editing { background: #FBEFD6; border-bottom-color: #F1D79B; }
#visitBar .vb-btn { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid currentColor; background: #fff; color: inherit; font: 700 13px var(--f-sans, inherit); cursor: pointer; }
#visitBar.flash { animation: vbflash 0.9s ease; }
@keyframes vbflash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(242, 114, 75, 0.6); } }
@media (min-width: 1024px) { #visitBar { left: var(--shell-w, 260px); } }
body.has-visit #shellView { top: calc(var(--shell-bar-h, 56px) + 44px); }
body.has-visit #dashboardRoot { padding-top: calc(var(--shell-bar-h, 56px) + 44px); }
body.has-visit.has-shell #adminPanel { top: calc(var(--shell-bar-h, 56px) + 44px) !important; }
@media (max-width: 699px) { body.has-visit #shellView, body.has-visit #dashboardRoot { padding-top: calc(var(--shell-bar-h, 56px) + 78px); } body.has-visit #shellView { top: calc(var(--shell-bar-h, 56px) + 78px); padding-top: 0; } body.has-visit.has-shell #adminPanel { top: calc(var(--shell-bar-h, 56px) + 78px) !important; } }
/* Nothing to start while read-only. */
body.visit-ro .cur-fab, body.visit-ro #shellSidebar [data-nav="register"] { display: none !important; }
#shellSidebar .vis-tag { margin-left: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.65; }

/* ── Platform: organisations table ─────────────────────────── */
.pl-tablewrap { padding: 8px 12px 12px; overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl-table th { text-align: left; font: 700 11.5px var(--f-sans, inherit); letter-spacing: 0.05em; text-transform: uppercase; color: var(--cur-gray-500, #6E8085); padding: 8px 10px; border-bottom: 1px solid var(--cur-gray-100, #EEF2F2); white-space: nowrap; }
.pl-table td { padding: 12px 10px; border-bottom: 1px solid var(--cur-gray-100, #EEF2F2); vertical-align: top; }
.pl-table tr:last-child td { border-bottom: none; }
.pl-table td small { margin-left: 8px; color: var(--cur-gray-500, #6E8085); font-size: 12px; }
.pl-chips { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.pl-go { text-align: right; white-space: nowrap; }
@media (max-width: 899px) {
  .pl-table thead { display: none; }
  .pl-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--cur-gray-100, #EEF2F2); }
  .pl-table td { display: block; border: none; padding: 0; }
  .pl-table td:first-child { grid-column: 1 / -1; }
  .pl-table td[data-l]:not(:first-child)::before { content: attr(data-l); display: block; font: 700 11px var(--f-sans, inherit); letter-spacing: 0.05em; text-transform: uppercase; color: var(--cur-gray-500, #6E8085); }
  .pl-go { grid-column: 1 / -1; text-align: left; }
}

/* ── Platform admin header: organisation picker only where it matters ─── */
#adminPanel.adm-platform-mode:not([data-group="records"]):not([data-group="reference"]) .adm-hdr { display: none !important; }
body.has-shell #adminPanel.adm-platform-mode .adm-hdr { flex-direction: column; align-items: stretch; gap: 4px; }
.adm-hdr-label { font: 700 11.5px var(--f-sans, inherit); letter-spacing: 0.05em; text-transform: uppercase; color: var(--cur-gray-500, #6E8085); }

/* Report generator (Reports page) */
.rb-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.rb-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--cur-gray-600, #4B5F63); }
.rb-saved { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rb-saved .vw-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 10px; min-height: 32px; }
.rb-saved .vw-chip button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; min-height: 32px; padding: 0 6px; }
.rb-out { margin-top: 14px; }
.rb-out h3 { margin: 0 0 6px; font-size: 16px; }
.rb-out h3 small { font-weight: 400; color: var(--cur-gray-500, #6E8085); }
.rb-notes { margin: 0 0 8px; padding-left: 18px; font-size: 13px; color: var(--amber-700, #B45309); }
.rb-scroll { overflow-x: auto; border: 1px solid var(--cur-gray-200, #E2EAEB); border-radius: 10px; max-width: 100%; }
.rb-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rb-table th, .rb-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--cur-gray-200, #E2EAEB); white-space: nowrap; }
.rb-table th { background: var(--cur-gray-50, #F4F8F8); font-weight: 600; position: sticky; top: 0; }

/* ── Touch pass (phones and touch screens) ────────────────────────────────────
   Found by measuring every screen at 390 px: the field-list action buttons were 24–28 px tall, close buttons 22 px, and
   several text inputs were 14 px (iPhones zoom the page when you focus an input under 16 px). */
@media (max-width: 640px), (pointer: coarse) {
  button.cur-ntag, a.cur-ntag { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; font-size: 13px; }
  #sharingDashboardModal button, #tourMenu button, #pinSetupBanner button, #shellView summary, .rb-saved button { min-height: 40px; }
  #pinSetupBanner button { min-width: 40px; }
  .vw-input, #shellView input:not([type=checkbox]):not([type=radio]):not([type=range]), #shellView select, #shellView textarea,
  #sharingDashboardModal input, #sharingDashboardModal select, #sharingDashboardModal textarea { font-size: 16px; }
  #shellView select { min-height: 44px; }
}
