/* Layout: a slim navy top bar, a sidebar menu with icons on computers (a bottom bar on phones), and
   one working column of white cards. Tables scroll inside their own frames. */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;            /* table heads, quiet fills */
  --ink: #111827;
  --muted: #5d6b7e;
  --line: #e3e8ef;
  --line-strong: #cfd7e2;
  --head: #0f1f33;               /* top bar and sidebar (a company's header color replaces it) */
  --head-ink: #e8eef6;
  --accent: #0f766e;             /* buttons and highlights (a company's button color replaces it) */
  --accent-ink: #ffffff;
  --accent-soft: #e6f4f2;
  --accent-text: #0f766e;
  --good: #15803d;
  --good-soft: #e7f6ec;
  --amber: #b45309;
  --amber-soft: #fef3e2;
  --warn: #b42318;
  --warn-soft: #fdecea;
  --info-soft: #eef2f7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
  --r-sm: 7px;
  --side: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b121c; --panel: #111a26; --panel-2: #152030; --ink: #e6ecf3; --muted: #93a1b3; --line: #223042; --line-strong: #2d3d52;
    --head: #0a1424; --head-ink: #e6ecf3; --accent: #14b8a6; --accent-ink: #04201d; --accent-soft: #0f2e2b; --accent-text: #5eead4;
    --good: #4ade80; --good-soft: #12261a; --amber: #fbbf24; --amber-soft: #2e2410; --warn: #f87171; --warn-soft: #2d1414; --info-soft: #172231;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--head); }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; text-wrap: balance; margin: 0; }
h2 { font-size: 1.75rem; line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.25; }
.num, td.n, .mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 8; background: var(--head); color: var(--head-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); flex-wrap: wrap; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; width: 100%; padding-block: 8px; }
.brand h1 { font-size: 1.3rem; line-height: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 #company-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark-ico { width: 32px; height: 32px; display: block; flex: none; }
#app-mark { display: inline-flex; }
.brand .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { font-size: .78rem; font-weight: 500; padding: 4px 10px 4px 22px; border-radius: 99px; background: rgba(255, 255, 255, .08); position: relative; white-space: nowrap; }
.status::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.account-btn { font: 600 .85rem var(--font-body); color: var(--head-ink); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 99px; padding: 6px 14px; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn:hover { background: rgba(255, 255, 255, .16); }

/* ---------- sidebar menu (bottom bar on phones) ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.tabs { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); align-self: start; height: calc(100vh - 60px - env(safe-area-inset-top, 0px)); background: var(--head); display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; overflow-y: auto; }
.tabs button { display: flex; align-items: center; gap: 12px; font: 500 .94rem var(--font-body); color: var(--head-ink); opacity: .72; background: transparent; border: 0; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; text-align: left; width: 100%; }
.tabs button:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.tabs button[aria-selected="true"] { opacity: 1; background: rgba(255, 255, 255, .12); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.tabs .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs .lbl-s { display: none; }
.content { min-width: 0; }
main { padding-block: 28px 64px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 9; flex-direction: row; gap: 0; padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); overflow-x: auto; scrollbar-width: none; box-shadow: 0 -1px 0 rgba(255, 255, 255, .08), 0 -6px 20px rgba(0, 0, 0, .18); }
  .tabs button { flex: 1 0 64px; flex-direction: column; gap: 3px; padding: 6px 4px; font-size: .7rem; text-align: center; }
  .tabs button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .tabs .lbl { display: none; }
  .tabs .lbl-s { display: block; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- page content ---------- */
.view { display: flex; flex-direction: column; gap: 20px; }
.lede { color: var(--muted); max-width: 70ch; margin: 6px 0 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
@media (max-width: 980px) { .grid2 { grid-template-columns: 1fr; } }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.hint { font-size: .86rem; color: var(--muted); margin: 0; }

/* ---------- forms ---------- */
form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink); }
input, select, textarea { font: 400 .97rem var(--font-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
.qty { display: flex; align-items: stretch; }
.qty input { border-radius: var(--r-sm) 0 0 var(--r-sm); font-family: var(--font-data); font-size: 1.1rem; }
.qty span { display: flex; align-items: center; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-family: var(--font-data); color: var(--muted); }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--info-soft); border-radius: var(--r-sm); }
.seg button { flex: 1; font: 600 .86rem var(--font-body); padding: 8px 8px; background: transparent; color: var(--muted); border: 0; border-radius: 5px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.seg.wrap-seg { flex-wrap: wrap; }
.seg.wrap-seg button { flex: 1 1 30%; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; align-items: center; }
.item-row .qty input { font-size: .97rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: .95rem; font-weight: 500; }
label.check input { width: auto; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .92rem var(--font-body); padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-align: center; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--panel-2); filter: none; }
.btn.small { padding: 6px 11px; font-size: .82rem; }
.btn.danger { background: var(--warn); color: #fff; }
.btn.link { background: none; border: 0; box-shadow: none; color: var(--accent-text); padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- messages ---------- */
.msg { font-size: .9rem; padding: 10px 14px; border-radius: var(--r-sm); margin: 0; border: 1px solid transparent; }
.msg.ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.msg.err { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.msg.note { background: var(--amber-soft); color: var(--ink); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30; max-width: min(520px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
@media (max-width: 860px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--panel-2); font-weight: 600; position: sticky; top: 0; z-index: 1; }
th.n, td.n { text-align: right; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
tr:last-child td { border-bottom: 0; }
tr.group td { background: var(--panel-2); font-weight: 600; font-size: .92rem; }
td.wrap-txt { white-space: normal; min-width: 160px; }
tr.red td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.orange td:first-child { box-shadow: inset 3px 0 0 var(--amber); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; font: 600 .7rem var(--font-body); text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill.used { background: var(--accent-soft); color: var(--accent-text); }
.pill.delivered, .pill.ok { background: var(--good-soft); color: var(--good); }
.pill.count { background: var(--info-soft); color: var(--muted); }
.pill.low, .pill.waiting, .pill.red { background: var(--warn-soft); color: var(--warn); }
.pill.orange { background: var(--amber-soft); color: var(--amber); }
.pill.batch { background: var(--head); color: var(--head-ink); }
.pill.note { background: var(--info-soft); color: var(--ink); }

/* ---------- totals ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.toolbar .seg { min-width: 240px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .label { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; min-width: 200px; text-align: center; }
.stepper button { width: 40px; height: 40px; padding: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); opacity: .85; }
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--font-data); font-size: 1.65rem; font-weight: 600; letter-spacing: -.01em; }
.stat .v small { font-size: .82rem; color: var(--muted); font-weight: 400; margin-left: 4px; }
.stat .s { font-size: .82rem; color: var(--muted); }
.bar { height: 6px; background: var(--info-soft); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* month to month recap */
.recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.recap .tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.recap .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.recap .v { font-family: var(--font-data); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.recap .d { font-size: .84rem; color: var(--muted); }
.recap .d b { color: var(--ink); font-weight: 600; }
.chart-wrap { margin-top: 16px; overflow-x: auto; }
.chart-wrap svg { display: block; width: 100%; min-width: 420px; height: auto; }
.chart-wrap .bar-cur { fill: var(--accent); }
.chart-wrap .bar-part { fill: var(--accent); fill-opacity: .4; }
.chart-wrap rect.hit { fill: transparent; }
.chart-wrap g:hover .bar-cur, .chart-wrap g:hover .bar-part { filter: brightness(1.12); }
.chart-wrap .grid { stroke: var(--line); stroke-width: 1; }
.chart-wrap .axis { fill: var(--muted); font: 500 12px var(--font-body); }
.chart-wrap .val { fill: var(--ink); font: 600 12px var(--font-data); }
.chart-tip { position: fixed; z-index: 25; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: .85rem; box-shadow: var(--shadow-lg); }
.chart-tip b { font-family: var(--font-data); }

/* ---------- tanks & notes ---------- */
.wells { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.well-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.well-card header { padding: 14px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.well-card header h3 { font-size: 1.1rem; }
.well-card header span { font-size: .8rem; color: var(--muted); text-align: right; }
.tank { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.tank:last-child { border-bottom: 0; }
.tank .nm { font-weight: 600; }
.tank .amt { font-family: var(--font-data); font-weight: 600; text-align: right; }
.tank .sub { font-size: .8rem; color: var(--muted); grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tank-form { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; align-items: end; padding-top: 8px; }
.tank-form label, .sched-form label { font-size: .72rem; }
.tank-form input, .sched-form input, .sched-form select { padding: 7px 9px; font-size: .92rem; }
.notes-block { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.notes-block .note { font-size: .88rem; }
.notes-block .note .meta, .sched .meta { font-size: .78rem; color: var(--muted); }
.notes-block form { flex-direction: row; gap: 8px; }
.notes-block form input { flex: 1; padding: 7px 10px; font-size: .92rem; }
.sched { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: .88rem; }
.sched-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; align-items: end; padding-top: 8px; }
details.picker summary { cursor: pointer; font-size: .85rem; font-weight: 500; color: var(--accent-text); }
details.picker .opts { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; max-height: 220px; overflow-y: auto; }
details.picker .opts label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: .9rem; }
details.picker .opts input { width: auto; }

/* ---------- lists, empty states ---------- */
.empty { padding: 26px; border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); background: var(--panel); }
.empty strong { color: var(--ink); display: block; font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 4px; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list .item:last-child { border-bottom: 0; }
.list .item > div { min-width: 0; }
.list .item .meta { font-size: .82rem; color: var(--muted); }
.list .item .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list .item.archived { opacity: .55; }
.stop-reasons { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; }
.stop-reasons li.red { color: var(--warn); }

/* ---------- today map ---------- */
.map { height: min(62vh, 560px); min-height: 320px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--info-soft); box-shadow: var(--shadow); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 700 12px/1 var(--font-body); font-style: normal; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.dot.red { background: #c0392b; }
.dot.orange { background: #d97706; }
.dot.ok { background: #15803d; }
.dot.none { background: #7c8798; }
.pin { background: none; border: 0; }
.pin .dot { width: 28px; height: 28px; font-size: 14px; }
.leaflet-popup-content { font: 14px var(--font-body); margin: 12px 14px; }
.leaflet-popup-content h4 { margin: 0 0 2px; font: 700 1.05rem var(--font-display); }
.leaflet-popup-content ul { margin: 6px 0 8px; padding-left: 18px; }

/* ---------- sign in ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.gate-brand { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 38%, var(--head)) 0%, var(--head) 58%); color: var(--head-ink); padding: 40px max(32px, env(safe-area-inset-left, 0px)) 32px 40px; display: flex; flex-direction: column; gap: 32px; }
.gate-mark { display: flex; align-items: center; gap: 12px; font: 700 1.2rem var(--font-display); }
.gate-pitch { margin-top: auto; margin-bottom: auto; max-width: 30rem; }
.gate-pitch h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.06; }
.gate-pitch p { margin: 14px 0 0; font-size: 1.05rem; opacity: .85; }
.gate-pitch ul { margin: 26px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.gate-pitch li { position: relative; padding-left: 28px; opacity: .92; }
.gate-pitch li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--accent) 40%, var(--head)); }
.gate-foot { margin: 0; font-size: .8rem; opacity: .55; }
.gate-main { display: flex; align-items: center; justify-content: center; padding: 40px max(20px, env(safe-area-inset-right, 0px)) 40px 20px; }
.gate .card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.gate .card .panel { padding: 28px; box-shadow: var(--shadow-lg); }
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; min-height: auto; }
  .gate-brand { padding: 28px max(20px, env(safe-area-inset-left, 0px)) 28px max(20px, env(safe-area-inset-right, 0px)); gap: 16px; }
  .gate-pitch ul, .gate-foot { display: none; }
  .gate-pitch h1 { font-size: 1.7rem; }
  .gate-main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); align-items: flex-start; }
}
.code { font-family: var(--font-data); font-size: 1.6rem; letter-spacing: .2em; font-weight: 600; }
.choice { display: grid; gap: 12px; }
.choice button { text-align: left; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.choice button span { font-weight: 400; font-size: .88rem; opacity: .8; }

/* ---------- account sheet ---------- */
.sheet { position: fixed; inset: 0; background: rgba(10, 18, 30, .45); z-index: 20; display: flex; justify-content: flex-end; backdrop-filter: blur(2px); }
.sheet .panel { width: min(440px, 100%); height: 100%; border-radius: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding-top: calc(22px + env(safe-area-inset-top, 0px)); padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-lg); }

/* ---------- company logo, colors and switcher ---------- */
.company-logo { height: 34px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 6px; }
.company-switch { width: auto; max-width: 220px; padding: 6px 10px; font-size: .85rem; background: rgba(255, 255, 255, .1); color: var(--head-ink); border-color: rgba(255, 255, 255, .16); }
.company-switch option { color: var(--ink); background: var(--panel); }
.logo-preview { min-height: 72px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); padding: 12px; background: #fff; }
.logo-preview img { max-height: 64px; max-width: 100%; object-fit: contain; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 46px; height: 30px; border-radius: 6px; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; overflow: hidden; display: flex; }
.swatches button span { flex: 1; }

/* ---------- owner console and read-only support view ---------- */
.support-bar { background: var(--amber-soft); border-bottom: 1px solid var(--line); }
.support-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; font-weight: 600; flex-wrap: wrap; }
/* while support is looking at a company, nothing that writes is shown (the database refuses writes anyway) */
body.readonly form:not(.keep), body.readonly .file-btn, body.readonly .actions .btn, body.readonly .actions input, body.readonly details.picker,
body.readonly #kmz-panel, body.readonly #import-panel, body.readonly .write { display: none !important; }
body.readonly .actions .btn.keep-btn { display: inline-flex !important; }  /* support can still open lab results */

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
