/* Gesera Link · every page. Colours and text sizes come from tokens.css. */
@import url("tokens.css");
* { box-sizing: border-box; }
body { margin: 0; font: var(--fs)/1.3 "Segoe UI", system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; background: var(--surface-0); color: var(--text-primary); }
button, select, input { font: inherit; color: inherit; }
button { background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button.ghost { background: transparent; }
select, input[type=search], input[type=password] { background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.bar { display: flex; gap: 10px; align-items: center; height: var(--bar-h); padding: 0 10px; background: var(--surface-1); border-bottom: 1px solid var(--border); }
.brand { white-space: nowrap; }
.page-title { margin: 0; font-size: var(--fs); font-weight: 400; color: var(--text-secondary); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.text2 { color: var(--text-secondary); }
/* The project chip: "Workspace · Project ▾", the select inside it. */
.proj-chip { position: relative; display: inline-flex; align-items: center; gap: 0; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-primary); white-space: nowrap; cursor: pointer; }
.proj-chip select { appearance: none; field-sizing: content; border: 0; padding: 0; margin: 0; background: transparent; color: inherit; cursor: pointer; }
.proj-chip select:focus-visible { outline: none; }
.proj-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.proj-chip .caret { margin-left: 4px; }
.site-counts { display: flex; gap: 10px; color: var(--text-secondary); white-space: nowrap; }
.site-counts .ok { color: var(--status-good); }
.site-counts .late { color: var(--status-warning); }
.site-counts .none { color: var(--status-none); }
.avatar { width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 11px; font-weight: 600; line-height: 1; }
.account-who { display: grid; gap: 1px; padding: 6px 8px 4px; }
.account-ws { padding: 5px 8px; font-weight: 600; }
.account-ws-list { display: grid; }
.account-ws-list > button { display: flex; column-gap: 8px; align-items: center; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--text-primary); text-align: left; }
.account-ws-list > button:hover { background: var(--surface-2); }
.account-ws-list > [aria-checked]::before { content: ""; width: 12px; color: var(--accent); }
.account-ws-list > [aria-checked="true"]::before { content: "✓"; }
.pop-menu .accent, .account-ws-list > .accent { color: var(--accent); }
.pop-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.bar > label:not(.proj-chip) { display: inline-flex; gap: 6px; align-items: center; color: var(--text-secondary); }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - var(--bar-h)); }
.side { border-right: 1px solid var(--border); background: var(--surface-1); padding: 12px; overflow: auto; }
.side input[type=search] { width: 100%; margin-bottom: 8px; }
.tree details { margin: 2px 0; }
.tree summary { cursor: pointer; padding: 3px 0; color: var(--text-primary); }
.tree summary .kind { color: var(--text-muted); font-size: var(--fs-sm); margin-left: 4px; }
.tree label { display: flex; gap: 6px; align-items: center; padding: 2px 0 2px 16px; color: var(--text-secondary); cursor: pointer; }
.tree .swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.tree .children { padding-left: 12px; }
.main { padding: 12px 16px; min-width: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--surface-1); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.check { display: inline-flex; gap: 4px; align-items: center; }
.empty { color: var(--text-muted); padding: 32px 0; }
.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 8px 8px 4px; margin-bottom: 12px; }
.panel h2 { font-size: var(--fs); font-weight: 600; margin: 0 0 4px 4px; color: var(--text-secondary); }
.uplot, .u-legend { font-family: inherit; color: var(--text-secondary); }
.u-legend .u-value { color: var(--text-primary); }
.u-select { background: color-mix(in srgb, var(--accent) 15%, transparent); }
#table-wrap { overflow: auto; max-height: 60vh; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 4px 10px; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; background: var(--surface-1); color: var(--text-secondary); font-weight: 600; }
dialog { background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 8px; }
dialog input { width: 320px; }
dialog menu { padding: 0; margin: 12px 0 0; text-align: right; }
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--border); max-height: 40vh; }
  .bar { gap: 8px; padding: 6px 10px; height: auto; min-height: var(--bar-h); }
  .main { padding: 12px 16px; }
}
.marks-note { font-size: var(--fs-sm); margin: 0 0 4px 4px; }
.profile-main { max-width: 1200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); color: var(--text-secondary); }
.chip .swatch { width: 10px; height: 10px; border-radius: 2px; }
.chip button { border: 0; background: transparent; padding: 0 6px; color: var(--text-muted); }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
/* The panels (panels.js): custom elements fed the generic series. */
gl-panel-series, gl-panel-bars { display: block; position: relative; min-height: 120px; overflow: hidden; }
gl-panel-profile, gl-panel-windrose { display: block; position: relative; }
gl-panel-windrose svg { display: block; height: 100%; width: auto; max-width: 100%; margin: 0 auto; }
gl-panel-profile svg { display: block; width: 100%; height: auto; }
gl-panel-profile svg text { fill: var(--text-muted); font-size: var(--fs-sm); }
gl-panel-profile svg .axis-title { fill: var(--text-secondary); }
gl-panel-profile[mini] svg { width: 60px; height: 80px; }
.gl-panel-empty { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--text-muted); text-align: center; padding: 8px; }
gl-panel-profile .gl-panel-empty { position: static; min-height: 80px; }
.notes p { font-size: var(--fs-sm); margin: 4px 0; color: var(--text-secondary); }
.tip { position: fixed; z-index: 2000; pointer-events: none; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: var(--fs-sm); color: var(--text-primary); box-shadow: var(--shadow-sm); }
/* Grafik bebas: drag data types onto a chart's left or right axis. */
.hint { margin: 0 0 8px; }
.tree label[draggable="true"] { cursor: grab; }
.tree .grip { margin-left: auto; width: 8px; height: 12px; opacity: 0.5; background: radial-gradient(circle, var(--text-muted) 1px, transparent 1.5px) 0 0 / 4px 4px; }
.chart-panel { position: relative; }
.chart-panel.active { border-color: var(--accent); }
.chart-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.chart-head h2 { margin: 0 0 0 4px; }
button.small { font-size: var(--fs-sm); padding: 2px 8px; }
.chart-panel .chips { margin: 4px 0 6px; }
.chart-panel .chip { cursor: grab; font-size: var(--fs-sm); }
.chart-panel .chip .axis-toggle { border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; font-size: var(--fs-sm); }
.chart-body { position: relative; min-height: 120px; }
.drop-zones { position: absolute; inset: 0; display: none; grid-template-columns: 1fr 1fr; gap: 4px; z-index: 5; }
.dragging .drop-zones, .drop-zones.empty { display: grid; }
.drop-zone { display: grid; place-items: center; border: 2px dashed var(--border); border-radius: 6px; color: var(--text-muted); font-size: var(--fs-sm); background: color-mix(in srgb, var(--surface-1) 70%, transparent); }
.drop-zones.empty .drop-zone { background: transparent; }
.drop-zone.over { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.drop-hint { text-align: center; padding: 16px 16px 8px; margin: 0; }
.drop-zones.empty { position: static; }
.drop-zones.empty .drop-zone { min-height: 80px; }
.chart-body:has(.drop-zones.empty) { min-height: 0; }
.axis-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.axis-form fieldset { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; margin: 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.axis-form legend { padding: 0 4px; }
.axis-form input[type=number] { width: 90px; }
.hide-mode .chart-body .u-over { cursor: crosshair; }
.hide-mode .u-select { background: color-mix(in srgb, var(--series-8) 18%, transparent); }
.hide-bar { display: grid; gap: 6px; margin-top: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-0); font-size: var(--fs); }
.hide-bar p { margin: 0; }
.hide-bar .grow { flex: 1; min-width: 200px; }
.hidden-list .row { font-size: var(--fs-sm); color: var(--text-secondary); }
/* The chart page inside the map's chart panel. */
.embed .bar, .embed .side { display: none; }
.embed .layout { grid-template-columns: 1fr; min-height: 0; }
.embed .main { padding: 8px 12px; }
.chart-head select.small { font-size: var(--fs-sm); padding: 2px 6px; }
/* Peta site (L7) */
.small { font-size: var(--fs-sm); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 8px; margin-top: 8px; }
.stack label, .bounds label { display: grid; gap: 2px; color: var(--text-secondary); font-size: var(--fs-sm); }
input[type=number], input:not([type]), input[type=file] { background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; min-width: 0; }
input[type=file] { padding: 3px; }
.btn { display: inline-block; text-decoration: none; color: inherit; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; }
.side-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); margin: 8px 0 0; text-transform: uppercase; letter-spacing: 0.04em; }
.dot { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; flex: none; font: 700 10px/1 system-ui, sans-serif; font-style: normal; color: var(--on-status); }
.dot.ok { background: var(--status-good); }
.dot.late { background: var(--status-warning); }
.dot.none { background: var(--status-none); }
.site-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.layer-row { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
.layer-row .code { font-weight: 600; flex: 1; }
.bounds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border: 0; padding: 0; margin: 0; }
.bounds legend { font-size: var(--fs-sm); color: var(--text-secondary); padding: 0; margin-bottom: 4px; }
.bounds .row { grid-column: 1 / 3; }
#upload summary { cursor: pointer; color: var(--accent); }
#late-form label { display: inline-flex; gap: 6px; align-items: center; color: var(--text-secondary); }
#late-form input { width: 72px; }
#map { position: absolute; inset: 0; background: var(--surface-0); }
#map.placing { cursor: crosshair; }
.place-bar { position: absolute; z-index: 1000; top: 12px; left: 56px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow-sm); }
.place-bar input { width: 130px; }
[hidden] { display: none !important; }
.cursor { position: absolute; z-index: 900; left: 8px; bottom: 30px; font-size: var(--fs-sm); background: color-mix(in srgb, var(--surface-1) 85%, transparent); padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.cursor:empty { display: none; }
/* a map vendor's logo, which its terms require on the map */
.map-logo { position: absolute; z-index: 900; left: 8px; bottom: 8px; line-height: 0; }
.map-logo img { height: 18px; width: auto; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface-1) 80%, transparent) !important; color: var(--text-secondary); }
.leaflet-control-attribution a { color: var(--text-secondary); }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; row-gap: 4px; }
  .place-bar { left: 8px; right: 8px; top: 8px; }
  .place-bar input { width: 100px; }
}
/* L8: sign-in, account and access pages */
.account { display: inline-flex; align-items: center; }
dialog.wizard .field input:not(.narrow, [type=checkbox], [type=radio]), dialog.wizard .field select { width: 100%; }
dialog.wizard details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }
.field .secret { display: flex; gap: 6px; }
.field .secret input { flex: 1; min-width: 0; }
.field .secret .show-secret { white-space: nowrap; }
input[type=email], input[type=text], input:not([type]) { background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.login { max-width: 360px; margin: 12vh auto 0; padding: 24px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; }
.login h1 { font-size: var(--fs-xl); margin: 0 0 16px; }
.login label { display: grid; gap: 4px; margin-bottom: 12px; color: var(--text-secondary); }
.login input { width: 100%; padding: 8px; }
.login button[type=submit] { width: 100%; padding: 8px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.error { color: var(--text-primary); background: color-mix(in srgb, var(--danger) 14%, transparent); border-left: 3px solid var(--danger); padding: 6px 10px; border-radius: 4px; }
.saved { color: var(--text-primary); background: color-mix(in srgb, var(--status-good) 14%, transparent); border-left: 3px solid var(--status-good); padding: 6px 10px; border-radius: 4px; }
.access { max-width: 960px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.access section { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; min-width: 0; }
.access h2 { font-size: var(--fs-lg); margin: 0 0 8px; }
.access .table-wrap { overflow-x: auto; }
.access td, .access th { text-align: left; }
.access form.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px; }
.access form.row label { display: grid; gap: 2px; color: var(--text-secondary); font-size: var(--fs-sm); }
.badge { display: inline-block; padding: 0 6px; border-radius: 4px; border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-secondary); }
.access td.actions { white-space: normal; min-width: 240px; }
.access td.actions button { margin: 2px 4px 2px 0; }
.access form.row label.check { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs); color: var(--text-primary); padding-bottom: 6px; }
.device { border-top: 1px solid var(--border); padding: 12px 0; }
.device:first-child { border-top: 0; }
.device h3 { font-size: var(--fs); margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.device p { margin: 4px 0 8px; }
.geometry { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.geometry summary { cursor: pointer; color: var(--text-secondary); }
.geo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; align-items: end; border: 0; padding: 0; margin: 12px 0; }
.geo-grid label:not(.check) { display: grid; gap: 2px; color: var(--text-secondary); font-size: var(--fs-sm); }
.geo-grid .wide { grid-column: 1 / -1; }
.geo-grid:disabled { opacity: 1; }
.notes p.warn { color: var(--text-primary); }
.tip-elev { margin: 8px 0; }
.tip-elev p { margin: 0 0 4px; }
.tip-elev input { width: 120px; }
/* Data masuk: sources and the "Tambah sumber" wizard (tambah-sumber.md) */
.section-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
.filter { display: inline-flex; gap: 6px; align-items: center; color: var(--text-secondary); margin-bottom: 4px; }
.access tr.sub > td { background: var(--surface-0); white-space: normal; }
.batches p { margin: 4px 0; }
.batches .table-wrap { max-height: 320px; overflow: auto; }
.batches button { margin-top: 6px; }
dialog.wizard { width: min(640px, calc(100vw - 32px)); padding: 16px 20px; }
dialog.wizard::backdrop { background: var(--backdrop); }
dialog.wizard h2 { font-size: var(--fs-lg); margin: 0 0 8px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 0 8px; list-style-position: inside; margin: 0 0 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-sm); }
.steps li[aria-current] { color: var(--text-primary); font-weight: 600; }
.steps li.done { color: var(--text-secondary); }
.choices { display: grid; gap: 8px; margin: 8px 0; }
.choices.row { display: flex; }
.choice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice span { display: grid; gap: 2px; }
.field { display: grid; gap: 4px; margin: 0 0 12px; color: var(--text-secondary); border: 0; padding: 0; }
.field legend { padding: 0; margin-bottom: 4px; }
.field input[type=text], .field input[type=password] { width: 100%; }
.field input.narrow { width: 8em; }
.gw-result { margin: 8px 0 12px; }
.gw-result table { font-size: var(--fs); }
dialog.wizard .table-wrap { overflow-x: auto; }
dialog.wizard .check { display: inline-flex; gap: 6px; align-items: center; color: var(--text-primary); }
dialog.wizard .check input[type=text] { width: 180px; }
dialog.wizard .basemap-list { display: grid; gap: 4px; margin: 4px 0 8px; }
dialog.wizard .basemap-key { width: 320px; max-width: 100%; }
dialog.wizard h2.basemap-keys { margin-top: 20px; }
dialog.wizard .row { flex-wrap: wrap; }
input.token { font-family: ui-monospace, Consolas, monospace; width: min(440px, 100%); }
.warn { background: color-mix(in srgb, var(--status-warning) 18%, transparent); border-left: 3px solid var(--status-warning); padding: 6px 10px; border-radius: 4px; margin: 0 0 12px; }
.how { margin: 12px 0; }
.how p { margin: 4px 0; }
.how pre { background: var(--surface-0); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; overflow-x: auto; font-size: var(--fs-sm); margin: 4px 0; }
.wait { min-height: 48px; }
.wait p { margin: 4px 0; }
.access table.sources td { white-space: normal; vertical-align: top; }
.access table.sources td.actions { min-width: 0; width: 220px; }
dialog.wizard input[type=radio], dialog.wizard input[type=checkbox] { width: auto; margin: 2px 0 0; flex: none; }

/* Data masuk: channel mapping (petakan kanal) */
dialog.wizard.wide { width: min(1000px, calc(100vw - 32px)); }
.mapping td, .mapping th { vertical-align: top; text-align: left; white-space: normal; }
.mapping .target + .target { margin-top: 4px; }
.mapping select, .mapping input[type=text] { max-width: 180px; }
.mapping input[type=datetime-local] { max-width: 200px; }
.mapping .target { display: grid; gap: 4px; }

/* Menu rail of every signed-in page (shell.js) */
body.with-rail { padding-left: var(--rail-w); }
.embed .rail { display: none; }
.rail { position: fixed; z-index: 1500; inset: 0 auto 0 0; width: var(--rail-w); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; background: var(--rail-bg); border-right: 1px solid var(--rail-border); }
.rail-logo { width: 32px; height: 32px; flex: none; margin-bottom: 10px; border-radius: 7px; display: grid; place-items: center; background: var(--logo-bg); }
.rail-item { width: 40px; height: 38px; flex: none; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--rail-text); text-decoration: none; cursor: pointer; }
.rail-item:hover { background: var(--rail-hover); color: var(--rail-active-text); }
.rail-item[aria-current="page"], .rail-item[aria-expanded="true"] { background: var(--rail-active-bg); color: var(--rail-active-text); }
.rail-item.later { opacity: 0.55; cursor: default; }
.rail-item.later:hover { background: transparent; color: var(--rail-text); }
.rail-item:focus-visible, .rail-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rail-gap { flex: 1; }
.rail-pop { position: fixed; z-index: 1600; left: calc(var(--rail-w) + 6px); bottom: 8px; width: 240px; display: grid; gap: 10px; padding: 10px 12px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.rail-pop h2 { font-size: var(--fs-lg); margin: 0; }
.rail-pop p { margin: 0; }
.rail-pop fieldset { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; }
.rail-pop legend { padding: 0 0 4px; font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.rail-choice { display: flex; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 5px; cursor: pointer; }
.rail-choice:hover { background: var(--surface-0); }
.rail-choice input { margin: 0; accent-color: var(--accent); }
/* Each theme's swatch shows that theme's rail and accent, whatever theme is on. */
.rail-swatch { width: 22px; height: 14px; border-radius: 3px; border: 1px solid var(--border); flex: none; }
.rail-swatch[data-swatch="strata"] { background: linear-gradient(90deg, var(--basalt-800) 50%, var(--clay-600) 50%); }
.rail-swatch[data-swatch="light"] { background: linear-gradient(90deg, var(--white) 50%, var(--blue-600) 50%); }
.rail-swatch[data-swatch="dark"] { background: linear-gradient(90deg, var(--basalt-950) 50%, var(--clay-400) 50%); }
.rail-swatch[data-swatch="slate"] { background: linear-gradient(90deg, var(--navy-900) 50%, var(--blue-700) 50%); }
@media (max-width: 720px) {
  :root { --rail-w: 40px; }
  .rail-item { width: 32px; height: 30px; }
  .rail-logo { width: 28px; height: 28px; }
}

/* Map page (map.js): the map, the chart drawer under it, the instrument
   list on the right. Sizes follow the approved prototype (Home.dc.html). */
.map-page { display: flex; height: calc(100vh - var(--bar-h)); }
.map-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.map-main { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#map { position: absolute; inset: 0; background: var(--surface-0); }
#map.plan { background: var(--surface-1); }
#map.placing { cursor: crosshair; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface-1) 80%, transparent) !important; color: var(--text-secondary); }
.leaflet-control-attribution a { color: var(--text-secondary); }
.ibtn { border: 0; border-radius: 4px; background: none; color: var(--text-secondary); padding: 0; cursor: pointer; transition: background 0.12s ease; }
.ibtn:hover, .ibtn[aria-expanded="true"], .ibtn.on { background: var(--surface-2); }
.ibtn.icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; }
/* zoom and filter, one group */
.map-ctl { position: absolute; z-index: 1000; left: 10px; top: 10px; display: flex; flex-direction: column; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.map-ctl button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--text-primary); font-size: 16px; line-height: 1; display: grid; place-items: center; }
.map-ctl button + button { border-top: 1px solid var(--border); }
.map-ctl button:hover, .map-ctl button[aria-expanded="true"] { background: var(--surface-2); }
.map-ctl button.filtered { color: var(--accent); }
.map-tools { position: absolute; z-index: 1002; box-sizing: content-box; left: 46px; top: 10px; width: 210px; max-height: calc(100% - 40px); overflow: auto; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.map-tools-head { display: flex; justify-content: space-between; align-items: center; }
.map-tools-head button { border: 0; background: none; padding: 1px 6px; color: var(--text-secondary); font-size: 15px; line-height: 17px; }
.mt-title { margin-top: 6px; font-size: 0.92em; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.map-tools-head + .mt-title { margin-top: 4px; }
.mt-list { display: flex; flex-direction: column; gap: 4px; }
.mt-row { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.mt-row .grow, .pop-menu .grow, .ghead .grow, .pop-head .grow { flex: 1; min-width: 0; }
.fdot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.fdot.ok { background: var(--status-good); }
.fdot.late { background: var(--status-warning); }
.fdot.none { background: var(--status-none); }
.mt-link { margin-top: 6px; align-self: flex-start; border: 0; background: none; padding: 0; color: var(--accent); }
/* Map | Site plan */
.view-seg { position: absolute; z-index: 1000; right: 10px; top: 10px; display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface-1); }
.view-seg button { border: 0; border-radius: 0; padding: 4px 10px; background: transparent; color: var(--text-primary); }
.view-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.plan-empty { position: absolute; z-index: 999; left: 50%; top: 45%; transform: translate(-50%, -50%); margin: 0; }
/* markers: a dot in the status colour and the code */
.mk-wrap { background: none; border: 0; }
.mk { display: flex; align-items: center; gap: 4px; cursor: grab; white-space: nowrap; }
.mk-dot { width: 14px; height: 14px; flex: none; box-sizing: content-box; border-radius: 50%; border: 2px solid var(--white); box-shadow: var(--marker-shadow); }
.mk.sel .mk-dot { box-shadow: 0 0 0 3px var(--accent); }
.mk-dot.ok { background: var(--status-good); }
.mk-dot.late { background: var(--status-warning); }
.mk-dot.none { background: var(--status-none); }
.mk-label { font-weight: 600; font-size: 0.95em; padding: 0 4px; border-radius: 3px; background: var(--label-bg); color: var(--text-primary); }
.no-labels .mk-label { display: none; }
/* the popup of a node */
.node-pop { position: absolute; z-index: 1001; box-sizing: content-box; width: 270px; transform: translate(-50%, calc(-100% - 14px)); display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.node-pop.below { transform: translate(-50%, 14px); }
.pop-head { display: flex; align-items: flex-start; gap: 6px; }
.pop-name { font-size: 1.15em; }
.pop-x { border: 0; background: none; padding: 1px 6px; color: var(--text-secondary); font-size: 16px; line-height: 1; }
/* The prototype drew these glyph buttons (+ − ×) in the browser default button face. */
.map-ctl button, .map-tools-head button, .pop-x, .modal-head .ibtn { font-family: Arial, sans-serif; }
.pop-note { margin: 0; }
.pop-note .link-btn { margin-left: 6px; }
.pop-ipi { display: flex; gap: 8px; align-items: center; border: 1px dashed var(--border); border-radius: 6px; padding: 4px; cursor: grab; }
.pop-ipi svg { flex: none; }
.pop-rows { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pop-rows .vrow { padding: var(--cell) 4px; border-bottom: 1px solid var(--border); }
.pop-rows .vrow .v { width: 84px; }
.cursor { position: absolute; z-index: 900; left: 8px; bottom: 8px; font-size: var(--fs-sm); background: color-mix(in srgb, var(--surface-1) 85%, transparent); padding: 1px 6px; border-radius: 4px; }
.place-bar { position: absolute; z-index: 1003; top: 10px; left: 46px; right: 120px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow-lg); }
.place-bar input { width: 120px; }
/* the chart drawer */
.drawer { position: relative; flex: none; height: 301px; display: flex; flex-direction: column; background: var(--surface-1); border-top: 1px solid var(--border); }
.drawer-grip { position: absolute; z-index: 2; left: 0; right: 0; top: -3px; height: 6px; cursor: ns-resize; touch-action: none; }
.drawer.resizing iframe { pointer-events: none; }
.drawer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 10px; border-bottom: 1px solid var(--border); }
.pages { display: flex; align-items: stretch; margin: -4px 0; }
.page-tab { font-weight: 600; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--text-secondary); padding: 6px 10px; }
.page-tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text-primary); }
.page-add { border: 0; background: none; color: var(--text-secondary); padding: 4px 8px; }
.drawer-sep { width: 1px; height: 18px; background: var(--border); }
.seg-sm { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg-sm button { border: 0; border-radius: 0; padding: 2px 10px; background: transparent; color: var(--text-primary); }
.seg-sm button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.drawer-chips { display: contents; }
.dchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 0 2px 0 8px; }
.dchip .swatch { width: 8px; height: 8px; border-radius: 2px; }
.dchip .axis { border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); padding: 0 6px; }
.dchip .x { border: 0; background: none; color: var(--text-secondary); padding: 0 4px; }
.drawer-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); border-radius: 6px; padding: 1px 8px; }
.drawer-btn:disabled { opacity: 0.5; cursor: default; }
.drawer-full { color: var(--accent); text-decoration: none; }
.drawer-body { position: relative; flex: 1; min-height: 0; }
.drawer-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface-1); }
/* the Views tab: the registry's panels of one instrument, side by side */
.views { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; padding: 6px 10px; overflow: hidden; }
.views gl-panel-series, .views gl-panel-bars, .views gl-panel-windrose { height: 100%; min-height: 0; }
.views .view-cell { display: flex; flex-direction: column; min-height: 0; }
.views .view-title { flex: none; padding: 0 0 2px 8px; }
.views .view-cell gl-panel-profile { flex: 1; min-height: 0; }
.views .view-cell gl-panel-profile svg { height: 100%; width: auto; max-width: 100%; margin: 0 auto; }
.views > .gl-panel-empty { position: static; }
.chip-select { max-width: 180px; padding: 1px 4px; border-radius: 999px; font-size: var(--fs-sm); }
.drawer-empty { position: absolute; inset: 10px; display: grid; place-items: center; border: 2px dashed var(--border); border-radius: 8px; color: var(--text-secondary); background: var(--surface-1); }
.drawer-zones { position: absolute; z-index: 3; inset: 8px 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.drawer-zone { display: grid; place-items: center; border: 2px dashed var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 92%, transparent); color: var(--text-primary); font-size: 1.2em; visibility: hidden; }
.drawer-zones.over .drawer-zone { visibility: visible; }
.drawer-zone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-1)); }
.drawer-zones.single { grid-template-columns: 1fr; }
.drawer-zones.single .drawer-zone { font-size: 0; }
.drawer-zones.single .drawer-zone + .drawer-zone { display: none; }
.drawer-zones.single.over .drawer-zone { background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: var(--accent); }
/* the instrument list */
.inst-strip { width: 22px; flex: none; display: flex; flex-direction: column; align-items: center; padding-top: 4px; background: var(--surface-1); border-left: 1px solid var(--border); }
.inst-strip .ibtn { width: 18px; height: 18px; line-height: 1; }
.inst-panel { width: 301px; flex: none; position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--surface-1); border-left: 1px solid var(--border); }
.inst-bar { display: flex; gap: 2px; align-items: center; padding: 4px 6px 4px 8px; border-bottom: 1px solid var(--border); }
.sets-btn { display: flex; align-items: center; gap: 5px; max-width: 170px; padding: 3px 6px; font-weight: 600; color: var(--text-primary); }
.sets-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-hide { font-size: inherit; }
.inst-search { display: flex; gap: 6px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.inst-search input { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; color: var(--text-primary); }
.inst-list { flex: 1; overflow: auto; }
.inst-empty { padding: 8px 10px; margin: 0; }
.inst-status { margin: 0; padding: 4px 10px; }
.inst-status:empty { display: none; }
.ghead { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 0; background: none; padding: 7px 10px 4px; font-size: 0.92em; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); text-align: left; }
.ghead:hover { color: var(--text-primary); }
.ghead svg { transition: transform 0.15s; }
.ghead[aria-expanded="false"] svg { transform: rotate(-90deg); }
.inst-group { list-style: none; margin: 0; padding: 0; }
.inst { position: relative; margin: 0 6px 3px; border: 1px solid var(--border); border-left: 3px solid var(--status-none); border-radius: 6px; background: var(--surface-1); }
.inst.s-ok { border-left-color: var(--status-good); }
.inst.s-late { border-left-color: var(--status-warning); }
.irow { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; cursor: grab; transition: background 0.15s ease, box-shadow 0.15s ease; }
.irow.sel { background: var(--sel-bg); }
.irow:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.irow .xp { width: 18px; height: 18px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1.5px solid var(--text-secondary); background: transparent; color: var(--text-secondary); opacity: 0.45; transform: rotate(-90deg); transition: opacity 0.15s ease, transform 0.2s ease, background 0.15s ease; }
.irow .xp[aria-expanded="true"] { transform: none; }
.irow:hover .xp, .irow .xp:focus-visible { opacity: 1; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.iname { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 0; border-radius: 0; background: none; padding: 0; color: var(--text-primary); text-align: left; }
.iname .n { font-weight: 600; }
.iname .k { color: var(--text-secondary); font-size: 0.92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow .acts { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s ease; }
.irow:hover .acts, .irow.menu-on .acts, .irow .acts:focus-within { opacity: 1; }
.irow .age { min-width: 26px; text-align: right; color: var(--text-secondary); }
.s-late .irow .age { color: var(--status-warning); }
.s-none .irow .age { color: var(--status-none); }
.ivals { border-top: 1px solid var(--border); background: var(--surface-2); }
.vrow { display: flex; align-items: center; gap: 8px; padding: var(--cell) 8px; }
.vrow[draggable="true"] { cursor: grab; }
.vrow .v { width: 86px; flex: none; text-align: right; font-weight: 600; }
.vrow .k { flex: 1; min-width: 0; color: var(--text-secondary); }
.vrow .add { border: 0; background: none; padding: 0 2px; color: var(--accent); }
.nrow { display: flex; align-items: center; gap: 8px; padding: var(--cell) 8px; }
.nrow.nhead { padding: 4px 8px 1px; color: var(--text-secondary); border-top: 1px solid var(--border); }
.nrow .nd { width: 86px; flex: none; text-align: right; color: var(--text-secondary); }
.nrow .nv { width: 60px; flex: none; text-align: right; font-weight: 600; }
.nrow.nhead .nv { font-weight: 400; }
/* small menus: row actions, sets, group by, sort by */
.pop-menu { position: fixed; z-index: 2100; box-sizing: content-box; min-width: 180px; display: flex; flex-direction: column; padding: 4px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.pop-menu > button, .pop-menu > a { width: 100%; display: flex; column-gap: 8px; align-items: center; padding: 5px 8px; border: 0; border-radius: 5px; background: none; color: var(--text-primary); text-align: left; text-decoration: none; }
.pop-menu > button:hover, .pop-menu > a:hover, .pop-menu > :focus-visible, .set-row:hover { background: var(--surface-2); outline: none; }
.pop-menu > button:disabled { cursor: default; color: var(--text-secondary); }
.pop-menu > button:disabled:hover { background: none; }
.pop-menu .mhint { color: var(--text-secondary); }
.pop-menu .mark { width: 12px; flex: none; color: var(--accent); }
.pop-title { padding: 4px 8px; font-size: 0.92em; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.set-row { position: relative; display: flex; align-items: center; column-gap: 8px; padding: 5px 8px; border-radius: 5px; color: var(--text-primary); cursor: pointer; }
.set-del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; border-radius: 4px; background: var(--surface-2); padding: 0 6px; color: var(--text-secondary); visibility: hidden; }
.set-row:hover .set-del, .set-del:focus-visible { visibility: visible; }
.set-none { margin: 0; padding: 5px 8px; }
/* dialogs: instrument settings and map settings */
.modal-back { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: var(--modal-backdrop); }
.modal { width: 760px; max-width: calc(100vw - 24px); height: 480px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface-1); color: var(--text-primary); border-radius: 10px; box-shadow: var(--modal-shadow); }
.modal-sm { width: 460px; height: auto; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.modal-head strong { font-size: 1.2em; }
.modal-head .ibtn { margin-left: auto; width: 26px; height: 26px; border-radius: 5px; font-size: 16px; }
.modal-main { flex: 1; display: flex; min-height: 0; }
.modal-tabs { box-sizing: content-box; width: 190px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--border); background: var(--surface-2); }
.modal-tabs button { text-align: left; border: 0; border-radius: 6px; padding: 6px 10px; background: transparent; color: var(--text-secondary); }
.modal-tabs button[aria-current="page"] { background: var(--surface-1); color: var(--text-primary); font-weight: 600; }
.modal-fields { flex: 1; overflow: auto; padding: 14px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-content: start; }
.modal-fields .wide, .modal-fields .note, .field-actions { grid-column: 1 / -1; }
.modal-fields p { margin: 0; }
.modal-fields p.note { margin-top: 4px; }
.modal-fields a { color: var(--accent); }
.field-up { display: flex; flex-direction: column; gap: 3px; color: var(--text-secondary); font-size: 0.92em; text-transform: uppercase; letter-spacing: 0.03em; }
.field-up input { font-size: 1.1em; text-transform: none; letter-spacing: 0; color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
.field-up input[readonly] { background: var(--surface-2); }
.field-actions { display: flex; gap: 12px; align-items: center; }
.modal-foot { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.modal-foot #set-status { align-self: center; }
.btn-plain { border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); border-radius: 6px; padding: 5px 16px; }
.btn-accent { border: 0; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 5px 18px; font-weight: 600; }
.modal-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.ms-late { display: flex; gap: 8px; align-items: flex-end; }
.ms-late input { width: 120px; }
@media (max-width: 720px) {
  .map-page { flex-direction: column; height: auto; }
  .map-col { min-height: 80vh; }
  .inst-panel { width: auto; border-left: 0; border-top: 1px solid var(--border); max-height: 60vh; }
  .inst-strip { width: auto; flex-direction: row; justify-content: center; padding: 4px; border-left: 0; border-top: 1px solid var(--border); }
  .irow .acts { opacity: 1; }
  .modal-main { flex-direction: column; }
  .modal-tabs { width: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .modal-fields { grid-template-columns: 1fr; }
  .place-bar { left: 46px; right: 8px; top: 48px; }
  .place-bar input { width: 100px; }
}
/* The Time series and Depth profile pages inside the map's chart drawer. */
.embed .controls, .embed #chips, .embed #geometry, .embed .hint, .embed #status, .embed #notes { display: none; }
.embed .main { padding: 8px 10px; }
.embed { background: var(--surface-1); }
.embed .chart-panel { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.embed.profile-embed .profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.embed.profile-embed .panel { margin: 0; padding: 4px 8px 0; border: 0; }
.embed.profile-embed .profiles svg { height: calc(100vh - 46px); }
.embed .empty { padding: 16px 0; }
/* The street map turned dark with the dark theme; site plan images keep their colours. */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.6); }
/* Status dots with their marks (status.js): no contact (slash) and reading
   fails (!) are violet, a contact problem; red stays for alarm levels. */
.sdot { flex: none; display: block; }
.sdot > circle:first-child { fill: currentColor; }
.sdot.ok { color: var(--status-good); }
.sdot.late { color: var(--status-warning); }
.sdot.none, .sdot.info { color: var(--status-none); }
.sdot.comm { color: var(--status-comm); }
.smark { fill: none; stroke: var(--white); stroke-width: 1.5; stroke-linecap: round; }
.smark.bold { stroke-width: 2; }
.smark-dot { fill: var(--white); stroke: none; }
.site-counts > span { display: inline-flex; align-items: center; gap: 4px; }
.site-counts .comm { color: var(--status-comm); }
.mk-dot { display: grid; place-items: center; }
.mk-dot.comm { background: var(--status-comm); }
.inst.s-comm { border-left-color: var(--status-comm); }
.s-comm .irow .age { color: var(--status-comm); }
.iname .ev { display: flex; align-items: center; gap: 4px; font-size: 0.92em; }
.ev.late { color: var(--status-warning); }
.ev.comm { color: var(--status-comm); }
.ev.none, .ev.info { color: var(--status-none); }
.pop-ev { --ev: var(--status-none); display: flex; gap: 6px; align-items: flex-start; padding: 5px 7px; border-radius: 6px; background: color-mix(in srgb, var(--ev) 9%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--ev) 35%, var(--surface-1)); }
.pop-ev.late { --ev: var(--status-warning); }
.pop-ev.comm { --ev: var(--status-comm); }
.pop-ev > .sdot { margin-top: 1px; }
.pop-ev .grow { flex: 1; min-width: 0; }
.pop-ev strong { color: var(--ev); }
.pop-ev-link { color: var(--accent); text-decoration: none; white-space: nowrap; }
/* the chart drawer folded to its bar */
.drawer.shut { height: auto !important; }
.drawer.shut .drawer-grip { display: none; }
.drawer-toggle { width: 22px; height: 22px; flex: none; margin-right: -4px; display: grid; place-items: center; }
.drawer-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
/* the rail's bell and its count of open warnings */
.rail-item { position: relative; }
.rail-badge { position: absolute; right: 3px; top: 4px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--badge-bg); color: var(--badge-text); font-size: 9px; font-weight: 700; line-height: 14px; text-align: center; }
/* Alarms page (alarms.js): what Link's own checks found, newest first. */
.al-page { display: flex; height: calc(100vh - var(--bar-h)); }
.al-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.al-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; background: var(--surface-1); border-bottom: 1px solid var(--border); }
.al-bar h1 { margin: 0; font-size: 1.15em; }
.al-bar label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.al-bar select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; color: var(--text-primary); }
.al-bar input[type=search] { width: 220px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; color: var(--text-primary); }
.al-scroll { flex: 1; overflow: auto; padding: 10px 12px; background: var(--surface-0); }
.al-table { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.al-row { --ev: transparent; display: grid; grid-template-columns: 150px minmax(150px, 1.2fr) 100px 80px minmax(160px, 2fr) 140px; align-items: center; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.al-row.open { border-left-color: var(--ev); }
.al-row.late { --ev: var(--status-warning); }
.al-row.comm { --ev: var(--status-comm); }
.al-row.info, .al-row.none { --ev: var(--status-none); }
.al-row.sel { background: var(--sel-bg); }
.al-row > span { padding: 5px 10px; min-width: 0; }
.al-head { color: var(--text-secondary); font-size: 0.92em; text-transform: uppercase; letter-spacing: 0.04em; border-left: 0; }
.al-head > span { padding: 6px 10px; }
.al-head > span:first-child { padding-left: 13px; }
.al-ev { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font-weight: 600; color: var(--text-primary); text-align: left; }
.al-subject { display: block; font-weight: 600; }
.al-device { display: block; color: var(--text-secondary); font-size: 0.92em; }
.al-row .nowrap { white-space: nowrap; }
.al-state { white-space: nowrap; color: var(--text-secondary); }
.al-state.open { color: var(--text-primary); font-weight: 600; }
.al-more { margin: 10px 0 0; }
.al-empty { margin: 0; padding: 16px 13px; }
.al-side { box-sizing: content-box; width: 300px; flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow: auto; background: var(--surface-1); border-left: 1px solid var(--border); }
.al-side-head { display: flex; align-items: center; gap: 8px; }
.al-side-head strong { font-size: 1.15em; }
.al-side-head .al-state { margin-left: auto; }
.al-facts { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.al-fact { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.al-fact > span:first-child { width: 100px; flex: none; color: var(--text-secondary); }
.al-fact > span:last-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.al-why { margin: 0; padding: 8px 10px; border-left: 3px solid var(--status-warning); background: var(--surface-2); border-radius: 0 6px 6px 0; line-height: 1.45; }
.al-why.info { border-left-color: var(--status-none); }
.al-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.al-acts button { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; color: var(--text-primary); }
.al-acts a { color: var(--accent); text-decoration: none; }
.al-side p { margin: 0; }
@media (max-width: 720px) {
  .al-page { flex-direction: column; height: auto; }
  .al-side { width: auto; border-left: 0; border-top: 1px solid var(--border); }
  .al-row { grid-template-columns: 1fr 1fr; }
  .al-head { display: none; }
}

/* Weekly reports: weeks and the AI setting on the left, the report on the
   right; printing shows the report alone. */
.rp-page { display: flex; height: calc(100vh - var(--bar-h)); }
.rp-weeks { width: 240px; flex: none; overflow: auto; padding: 10px; border-right: 1px solid var(--border); background: var(--surface-1); display: flex; flex-direction: column; gap: 6px; }
.rp-weeks h1 { margin: 0 0 4px; font-size: 1.15em; }
.rp-week { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text-primary); }
.rp-week[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--border); }
.rp-ai { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.rp-ai h2 { margin: 0; font-size: 1em; }
.rp-ai p { margin: 0; }
.rp-ai select, .rp-ai input[type=number] { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; color: var(--text-primary); }
.rp-agree { display: flex; gap: 6px; align-items: flex-start; }
.rp-main { flex: 1; min-width: 0; overflow: auto; background: var(--surface-0); }
.rp-tools { display: flex; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface-1); }
.rp-tools button, .rp-ai button { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; color: var(--text-primary); }
.rp-report { max-width: 860px; margin: 12px auto; padding: 16px 20px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; line-height: 1.45; }
.rp-head h2 { margin: 0; font-size: 1.3em; }
.rp-head p { margin: 2px 0 0; }
.rp-sec { margin-top: 14px; }
.rp-sec h3 { margin: 0 0 4px; font-size: 1.05em; }
.rp-sec h4 { margin: 8px 0 2px; font-size: 1em; }
.rp-sec p, .rp-sec ul { margin: 0 0 4px; }
.rp-words { padding: 10px 12px; background: var(--surface-2); border-radius: 6px; }
.rp-byai { margin-top: 6px; font-size: 0.92em; }
.rp-note { margin-top: 12px; }
.rp-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.rp-table th, .rp-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rp-table th { color: var(--text-secondary); font-weight: 600; }
.rp-made { margin-top: 12px; }
.rp-problem { margin: 0; padding: 6px 8px; border-left: 3px solid var(--status-warning); background: var(--surface-2); border-radius: 4px; }
.sys-warning { padding: 6px 12px; border-bottom: 1px solid var(--border); border-left: 4px solid var(--status-warning); background: var(--surface-2); color: var(--text-primary); }
.rp-spark { width: 120px; height: 28px; display: block; }
.rp-spark polyline { fill: none; stroke: var(--series-1); stroke-width: 1.5; stroke-linejoin: round; }
.rp-spark circle { fill: var(--series-1); }
.rp-table a { color: inherit; }
.rp-ai select, .rp-ai input[type=number] { max-width: 100%; }
@media (max-width: 720px) {
  .rp-page { flex-direction: column; height: auto; }
  .rp-weeks { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .rp-report { margin: 8px; padding: 12px; }
  .rp-table { display: block; overflow-x: auto; }
}
@media print {
  html, body { background: none; }
  .rail, body > header.bar, .rp-weeks, .rp-tools { display: none !important; }
  body.with-rail { padding-left: 0; }
  .rp-page, .rp-main { display: block; height: auto; overflow: visible; background: none; }
  .rp-report { border: none; margin: 0; max-width: none; }
  .rp-table a { text-decoration: none; }
  .rp-table tr { break-inside: avoid; }
}
/* TARP levels (status.js, map.js, alarms.js): red belongs to them alone and
   the level number is always drawn. Level 1 a red ring, level 2 solid red,
   level 3 dark red with a halo on the map. */
.sdot.tarp1 { color: var(--tarp-1); }
.sdot.tarp2 { color: var(--tarp-2); }
.sdot.tarp3 { color: var(--tarp-3); }
.sdot > circle.sring:first-child { fill: var(--surface-1); stroke: var(--tarp-1); stroke-width: 1.6; }
.snum { font: 700 7px/1 "Segoe UI", Arial, sans-serif; fill: var(--on-tarp); }
.sdot.tarp1 .snum { fill: var(--tarp-1); }
.mk-dot.tarp1 { background: var(--white); box-shadow: inset 0 0 0 2px var(--tarp-1), var(--marker-shadow); }
.mk-dot.tarp2 { background: var(--tarp-2); }
.mk-dot.tarp3 { background: var(--tarp-3); outline: 3px solid var(--tarp-halo); outline-offset: 1px; }
.mk-num { font: 700 10px/1 "Segoe UI", Arial, sans-serif; color: var(--on-tarp); }
.mk-dot.tarp1 .mk-num { color: var(--tarp-1); }
.inst.s-tarp1 { border-left-color: var(--tarp-1); }
.inst.s-tarp2, .inst.s-tarp3 { border-left-color: var(--tarp-2); background: var(--tarp-row); }
.inst.s-tarp3 { border-left-color: var(--tarp-3); }
.inst.s-tarp2 .irow:not(:hover):not(.sel), .inst.s-tarp3 .irow:not(:hover):not(.sel) { background: var(--tarp-row); }
.ev.tarp1, .ev.tarp2 { color: var(--tarp-2); font-weight: 600; }
.ev.tarp3 { color: var(--tarp-3); font-weight: 600; }
.site-counts .tarp { color: var(--tarp-2); font-weight: 600; }
.rail-badge.tarp { background: var(--badge-tarp-bg); color: var(--badge-tarp-text); }
.vrow .v.tarp { color: var(--tarp-2); }
.vrow .lvl { flex: none; font-size: var(--fs-sm); color: var(--text-muted); }
.pop-ev.tarp1, .pop-ev.tarp2 { --ev: var(--tarp-2); background: var(--tarp-soft); border-color: var(--tarp-2); }
.pop-ev.tarp3 { --ev: var(--tarp-3); background: var(--tarp-soft); border-color: var(--tarp-3); }
.pop-ev.tarp1 strong, .pop-ev.tarp2 strong { color: var(--tarp-2); }
/* Alarms: the level rows, the Acknowledged column, the acknowledgement. */
.al-row { grid-template-columns: 150px minmax(150px, 1.2fr) 100px 80px minmax(160px, 2fr) 130px 130px; }
.al-row.tarp1, .al-row.tarp2 { --ev: var(--tarp-2); }
.al-row.tarp3 { --ev: var(--tarp-3); }
.al-row.tarp1:not(.sel), .al-row.tarp2:not(.sel), .al-row.tarp3:not(.sel) { border-left-color: var(--ev); }
.al-row.sel.tarp1, .al-row.sel.tarp2, .al-row.sel.tarp3 { background: var(--tarp-row); border-left-color: var(--ev); }
.al-ack { color: var(--tarp-2); font-weight: 600; }
.al-ack.done { color: var(--text-secondary); font-weight: 400; }
.al-sub { color: var(--text-secondary); font-size: 0.92em; text-transform: uppercase; letter-spacing: 0.04em; }
.al-steps { display: flex; flex-direction: column; gap: 4px; }
.al-step { display: flex; gap: 6px; align-items: center; }
.al-step.on { font-weight: 600; }
.al-step-t { width: 80px; flex: none; font-weight: 400; }
.al-side textarea { font: inherit; color: inherit; background: var(--surface-1); border: 1px solid var(--border); border-radius: 5px; padding: 5px 6px; resize: vertical; min-height: 44px; }
.al-ack-row { display: flex; gap: 8px; align-items: center; }
.al-acked { padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }
.al-acked p { margin: 4px 0 0; white-space: pre-wrap; }
.al-acts a + a, .al-acts button + a { margin-top: 2px; }
/* the Thresholds section of an instrument's settings */
.thr-pick { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.thr-pick label { display: inline-flex; gap: 8px; align-items: center; color: var(--text-secondary); }
.thr-pick select { background: var(--surface-1); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; color: var(--text-primary); }
table.thr-table { border-collapse: collapse; width: 100%; font-size: inherit; }
.thr-table th { position: static; white-space: normal; text-align: left; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.92em; padding: 4px 8px; border-bottom: 1px solid var(--border); background: none; }
.thr-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--grid); }
.thr-table td:last-child { width: 100%; }
.thr-table input { background: var(--surface-1); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; }
.thr-table input[type=number] { width: 76px; text-align: right; }
.thr-table input[type=text] { width: 100%; min-width: 120px; }
.thr-table input[readonly] { background: var(--surface-2); }
.thr-num { display: inline-flex; gap: 4px; align-items: center; }
.thr-level { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.thr-line { display: block; line-height: 26px; color: var(--text-primary); }
.thr-line > span + span { margin-left: 6px; }
.thr-line input { margin: 0 6px; width: 60px; text-align: right; background: var(--surface-1); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; }
.thr-mini svg { display: block; width: 100%; height: auto; }
.thr-mini text { fill: var(--text-secondary); font-size: 9px; }
.thr-grid { stroke: var(--grid); }
.thr-band { fill: var(--tarp-band); }
.thr-l1 { stroke: var(--tarp-1); stroke-width: 1.2; stroke-dasharray: 6 4; }
.thr-l2 { stroke: var(--tarp-2); stroke-width: 1.2; stroke-dasharray: 6 3; }
.thr-l3 { stroke: var(--tarp-3); stroke-width: 1.6; }
.thr-mini text.thr-t1 { fill: var(--tarp-1); font-weight: 600; }
.thr-mini text.thr-t2 { fill: var(--tarp-2); font-weight: 600; }
.thr-mini text.thr-t3 { fill: var(--tarp-3); font-weight: 600; }
.thr-line-s { fill: none; stroke: var(--series-1); stroke-width: 1.4; stroke-linejoin: round; }
.thr-copy, .thr-names { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.thr-copy p, .thr-names p { margin: 0; }
.thr-copy-list { display: flex; flex-direction: column; gap: 2px; }
.thr-copy-list label { display: flex; gap: 6px; align-items: center; }
.thr-copy .btn-accent, .thr-names .btn-plain { align-self: flex-start; }
.thr-name { display: flex; gap: 10px; align-items: center; }
.thr-name input { width: 200px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; }
/* the Thresholds toggle of the chart drawer and the lines on a chart */
.chip.toggle { padding: 1px 8px; cursor: pointer; }
.chip.toggle[aria-pressed="true"] { border-color: var(--tarp-2); color: var(--tarp-2); background: var(--tarp-soft); }
@media (max-width: 720px) {
  .al-row { grid-template-columns: 1fr 1fr; }
}

/* Notifications (notify.js on Account, the Notifications tab of Alarms,
   sending.html for HMA staff), laid out as the approved prototype: panels
   in a grid, a pill for each channel's state. */
.nt { display: grid; gap: 14px; min-width: 0; }
.access section.nt { background: none; border: 0; padding: 0; }
.nt-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nt-head h2, .nt-head h1 { font-size: var(--fs-xl); margin: 0; }
.nt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.nt-grid.tight { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.nt-panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 14px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.nt-panel h3 { font-size: var(--fs-lg); margin: 0; }
.nt-panel p { margin: 0; max-width: 68ch; }
.nt-panel .text2, .nt-head .text2 { color: var(--text-secondary); }
.nt-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nt-row .spacer { flex: 1; }
.nt-field { display: grid; gap: 4px; color: var(--text-secondary); }
.nt-field > input, .nt-field select { color: var(--text-primary); }
.nt input[type=text], .nt input[type=tel], .nt input[type=password], .nt input[type=number], .nt input[type=time], .nt select { background: var(--surface-1); border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; min-width: 0; }
.nt input[readonly] { background: var(--surface-2); }
.nt input.mono, .nt-mono { font-family: ui-monospace, Consolas, monospace; }
.nt button { border-radius: 4px; padding: 5px 10px; }
.nt button.primary { font-weight: 600; }
.nt .check { display: flex; gap: 6px; align-items: flex-start; }
.nt .check input { margin-top: 2px; accent-color: var(--accent); }
.nt-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 10px; padding: 1px 8px; font-size: var(--fs-sm); font-weight: 600; border: 1px solid currentColor; white-space: nowrap; color: var(--status-none); }
.nt-pill.good { color: var(--status-good); }
.nt-pill.warn { color: var(--status-warning); }
.nt-pill.tarp { background: var(--tarp-2); border-color: var(--tarp-2); color: var(--on-tarp); }
.nt-toast { min-height: 1.4em; color: var(--status-good); font-size: var(--fs-sm); }
.nt-toast.bad { color: var(--danger); }
.nt-link { font-family: ui-monospace, Consolas, monospace; color: var(--accent); word-break: break-all; }
.nt-steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text-secondary); }
.nt-note { background: color-mix(in srgb, var(--status-warning) 14%, transparent); border-left: 3px solid var(--status-warning); padding: 8px 10px; border-radius: 4px; }
.nt-scroll { overflow-x: auto; }
.nt table th, .nt table td { text-align: left; padding: 6px 8px; vertical-align: middle; position: static; }
.nt table th.c, .nt table td.c { text-align: center; }
.nt table td { white-space: normal; }
.nt td input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.nt-main { padding: 16px; display: grid; gap: 14px; max-width: 980px; }
.al-scroll .nt { max-width: 980px; }
.nt-btn-link { justify-self: start; border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; background: var(--surface-1); color: var(--text-primary); text-decoration: none; }

/* Conversion section of instrument settings (conversion.js); follows the
   approved prototype konversi/prototipe.html. */
.modal.modal-xl { width: 1180px; height: 860px; }
.conv { display: grid; gap: 0; margin: -14px -16px; }
.conv h3 { margin: 0; font-size: var(--fs); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.conv p { margin: 0; }
.conv-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.conv-col { padding: 14px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.conv-col + .conv-col { border-left: 1px solid var(--border); }
.conv-group { display: grid; gap: 6px; min-width: 0; }
.conv-label { font-size: var(--fs-sm); color: var(--text-muted); }
.conv-mono, .conv-formula, .conv textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.conv-mono { font-size: var(--fs-sm); }
.conv-f { display: grid; gap: 3px; font-size: var(--fs-sm); color: var(--text-secondary); min-width: 0; }
.conv input, .conv select, .conv textarea { font: inherit; color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; width: 100%; min-width: 0; box-sizing: border-box; }
.conv textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; resize: vertical; min-height: 56px; }
.conv input:focus-visible, .conv select:focus-visible, .conv textarea:focus-visible, .conv button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.conv-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.conv-inputs { display: grid; gap: 4px; }
.conv-inputs > div { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 5px 8px; background: var(--surface-2); border-radius: 4px; }
.conv-var { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; color: var(--accent); }
.conv-strip { position: relative; height: 34px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.conv-seg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; border-left: 2px solid var(--surface-1); box-sizing: border-box; }
.conv-seg.v0 { color: var(--text-muted); background: repeating-linear-gradient(135deg, transparent 0 6px, var(--grid) 6px 8px); }
.conv-seg.v1 { background: var(--accent-soft); color: var(--text-primary); }
.conv-seg.v2 { background: var(--accent); color: var(--on-accent); }
.conv-axis { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.conv-versions { display: grid; gap: 6px; }
.conv-ver { border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; display: grid; gap: 4px; }
.conv-ver.now { border-color: var(--accent); }
.conv-ver.gone { opacity: .6; }
.conv-ver.gone .conv-formula { text-decoration: line-through; }
.conv-ver-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.conv-ver-h b { font-weight: 600; }
.conv-tag { display: inline-block; font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; padding: 0 6px; border-radius: 3px; border: 1px solid currentColor; color: var(--accent); }
.conv-tag.off { color: var(--text-muted); }
.conv-formula { font-size: var(--fs-sm); background: var(--surface-2); padding: 6px 8px; border-radius: 4px; overflow-x: auto; white-space: pre; }
.conv-vf { display: grid; gap: 6px; }
.conv-vf-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.conv-seg2 { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.conv-seg2 button { font: inherit; border: 0; background: var(--surface-1); color: var(--text-secondary); padding: 5px 10px; cursor: pointer; }
.conv-seg2 button + button { border-left: 1px solid var(--border); }
.conv-seg2 button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; }
.conv-vf-btn { padding: 5px 12px; }
.conv-vf-btn:disabled { color: var(--text-muted); cursor: default; }
.conv-quick { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: var(--fs-sm); }
.conv-quick button { font: inherit; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); border-radius: 10px; padding: 1px 8px; cursor: pointer; }
.conv-quick button:hover { border-color: var(--accent); }
.conv-note { font-size: var(--fs-sm); color: var(--text-secondary); }
.conv-note.warn { color: var(--status-warning); }
.conv-cal { border: 1px solid var(--border); border-radius: 6px; padding: 10px; display: grid; gap: 8px; background: var(--surface-1); max-width: 360px; box-shadow: var(--shadow-lg); }
.conv-cal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-cal-h b { font-weight: 600; }
.conv-cal-h button { font: inherit; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); border-radius: 4px; width: 28px; height: 26px; cursor: pointer; }
.conv-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.conv-cal-g .wd { text-align: center; font-size: var(--fs-sm); color: var(--text-muted); padding-bottom: 2px; }
.conv-day { position: relative; font: inherit; height: 34px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0 0 6px; }
.conv-day::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; box-sizing: border-box; }
.conv-day.full { color: var(--text-primary); font-weight: 600; background: var(--surface-2); }
.conv-day.full::after { background: var(--status-good); }
.conv-day.part { color: var(--text-primary); background: var(--surface-2); }
.conv-day.part::after { border: 1.5px solid var(--status-good); }
.conv-day.none { text-decoration: line-through; text-decoration-color: var(--border); }
.conv-day.pre { opacity: .45; }
.conv-day:disabled { cursor: default; opacity: .3; }
.conv-day.first { border-color: var(--status-good); }
.conv-day.ev::before { content: ""; position: absolute; top: 2px; right: 3px; border: 4px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); }
.conv-day.ver { box-shadow: inset 0 -2px 0 var(--accent); }
.conv-day[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.conv-day[aria-pressed="true"]::after { background: var(--on-accent); border-color: var(--on-accent); }
.conv-day:hover:not(:disabled) { border-color: var(--accent); }
.conv-cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-sm); color: var(--text-secondary); }
.conv-cal-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; box-sizing: border-box; }
.conv-cal-legend i.full { background: var(--status-good); }
.conv-cal-legend i.part { border: 1.5px solid var(--status-good); }
.conv-cal-legend i.ev { border-radius: 0; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.conv-cal-legend i.ver { border-radius: 0; height: 2px; background: var(--accent); }
.conv-cal-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.conv-inline { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); }
.conv-inline input { width: auto; }
.conv-cal-info { font-size: var(--fs-sm); color: var(--text-secondary); min-height: 1.4em; }
.conv-lib { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; padding: 4px; }
.conv-grp { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 6px 2px; }
.conv-lib button { font: inherit; text-align: left; border: 0; background: transparent; color: var(--text-primary); padding: 5px 8px; border-radius: 3px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.conv-lib button:hover { background: var(--surface-2); }
.conv-lib button[aria-pressed="true"] { background: var(--accent-soft); font-weight: 600; }
.conv-lib button span:last-child { color: var(--text-muted); font-weight: 400; white-space: nowrap; }
.conv-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.conv-chips button { font: inherit; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--fs-sm); border: 1px dashed var(--accent); color: var(--accent); background: transparent; border-radius: 10px; padding: 1px 8px; cursor: pointer; }
.conv-result { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 8px 10px; border-radius: 4px; background: var(--surface-2); }
.conv-result.err { color: var(--danger); }
.conv-big { font-size: var(--fs-xl); font-weight: 600; }
.conv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.conv-chart { padding: 14px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.conv-chart svg { width: 100%; height: auto; display: block; font-size: 11px; }
.conv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); color: var(--text-secondary); }
.conv-legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 4px; }
.conv-legend i.dash { height: 0; border-top: 1px dashed var(--text-muted); }
@media (max-width: 820px) {
  .conv-cols { grid-template-columns: minmax(0, 1fr); }
  .conv-col + .conv-col { border-left: 0; border-top: 1px solid var(--border); }
}
