/* FuelDesk GT — "Night Garage" (dark) and "Showroom" (light). */
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-400.woff) format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-500.woff) format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-600.woff) format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-700.woff) format('woff'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-500i.woff) format('woff'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-800i.woff) format('woff'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fira GT'; src: url(../fonts/fira-900i.woff) format('woff'); font-weight: 900; font-style: italic; font-display: swap; }

:root {
  /* Kora Fuel: red #E60012, white, charcoal #1A1A1A */
  --bg: #121212; --bg2: #171717; --panel: #1D1D1D; --panel2: #242424; --panel3: #2E2E2E; --line: #333333; --line2: #444444;
  --ink: #F4F4F4; --ink2: #A6A6A6; --ink3: #707070;
  --brand: #E60012; --brand-ink: #FFFFFF; --brand-hi: #FF2E40; --accent: var(--brand-hi);
  --amber: #F5A623; --cyan: #F4F4F4; --red: #FF5C5C; --green: #2BD58C; --violet: #B9A7FF;
  --glow: 0 0 0 1px rgba(255, 46, 64, .7), 0 0 26px rgba(230, 0, 18, .35);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --r-lg: 16px; --r: 12px; --r-sm: 8px;
  --side: 248px; --top: 60px;
  --font: 'Fira GT', 'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F1F1F1; --bg2: #F7F7F7; --panel: #FFFFFF; --panel2: #F6F6F6; --panel3: #E6E6E6; --line: #DDDDDD; --line2: #C6C6C6;
  --ink: #1A1A1A; --ink2: #5E5E5E; --ink3: #8C8C8C;
  --brand: #E60012; --brand-ink: #FFFFFF; --brand-hi: #E60012; --accent: #E60012;
  --amber: #B86E00; --cyan: #1A1A1A; --red: #B3001B; --green: #0E8F5F; --violet: #6B4FD8;
  --glow: 0 0 0 2px rgba(230, 0, 18, .6), 0 8px 24px rgba(230, 0, 18, .16);
  --shadow: 0 8px 24px rgba(20, 35, 60, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* Responsive safety net: nothing may push the page sideways on any screen. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; }
img, svg, canvas, video { max-width: 100%; }
input, select, textarea, button { max-width: 100%; min-width: 0; }
.main, .view, .panel, .grid2 > *, .grid3 > *, .stats > *, .set > * { min-width: 0; }
.view { overflow-wrap: break-word; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100vh; }
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 8px; }
code { background: var(--panel3); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.muted { color: var(--ink2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; }

/* brand mark: a slanted fuel drop in a chevron */
.brand-mark { width: 38px; height: 38px; flex: none; display: inline-block; border-radius: 10px; background: var(--brand) url(../img/kora-mark-white.png) center / 70% no-repeat; box-shadow: 0 4px 14px rgba(230, 0, 18, .35); }
.brand-word { display: block; height: 17px; aspect-ratio: 774 / 118; background: var(--ink); -webkit-mask: url(../img/kora-word-white.png) left center / contain no-repeat; mask: url(../img/kora-word-white.png) left center / contain no-repeat; }
.brand.big .brand-word { height: 24px; }
.brand.big .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.brand b { display: block; font-size: 18px; font-weight: 800; font-style: italic; letter-spacing: -.01em; }
.brand b i { color: var(--brand-hi); font-weight: 900; }
.brand small { margin-top: 4px; letter-spacing: .02em; }
.brand small { display: block; color: var(--ink2); font-size: 12px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand.big b { font-size: 24px; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .brand-mark { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: skewX(-6deg); } }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.shell.rail { --side: 76px; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 16px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink2); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a.on { background: var(--panel2); color: var(--ink); }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; background: var(--brand); transform: skewY(-20deg); border-radius: 2px; }
.nav a.on .ic { color: var(--brand-hi); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font: 700 11px/20px var(--font); font-style: normal; text-align: center; }
.ngrp { margin-top: 6px; }
.ngrp-h { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink2); font: 600 italic 14px var(--font); cursor: pointer; text-align: left; }
.ngrp-h:hover { background: var(--panel); color: var(--ink); }
.ngrp-h span { flex: 1; }
.ngrp-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--panel3); color: var(--ink2); font: 700 11px/20px var(--font); font-style: normal; text-align: center; transition: opacity .15s; }
.ngrp.open .ngrp-n { opacity: 0; }
.ngrp-c { width: 16px; height: 16px; transition: transform .2s ease-out; }
.ngrp.open .ngrp-c { transform: rotate(180deg); }
.ngrp.open > .ngrp-h { color: var(--ink); }
.ngrp:has(a.on) > .ngrp-h .ic:first-child { color: var(--brand-hi); }
.ngrp-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease-out; }
.ngrp.open .ngrp-b { grid-template-rows: 1fr; }
.ngrp-in { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding-left: 14px; margin-left: 21px; border-left: 1px solid var(--line); }
.ngrp-in a { padding: 8px 10px; }
.shell.rail .ngrp-h { display: none; }
.shell.rail .ngrp-b { grid-template-rows: 1fr; }
.shell.rail .ngrp-in { padding-left: 0; margin-left: 0; border-left: 0; }
.shell.rail .ngrp { margin-top: 0; border-top: 1px solid var(--line); padding-top: 4px; }
.railbtn { margin: 8px 10px 14px; height: 36px; border: 1px solid var(--line); background: transparent; color: var(--ink2); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.shell.rail .nav a span, .shell.rail .brand div { display: none; }
.shell.rail .nav a { justify-content: center; }
.shell.rail .nav a .badge { position: absolute; top: 2px; right: 6px; }
.shell.rail .railbtn .ic { transform: rotate(180deg); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-st { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.st-name { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stpick { display: flex; align-items: center; gap: 6px; }
.stpick select { max-width: 220px; }
.shiftpill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.shiftpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); }
.shiftpill.live { color: var(--ink); border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.shiftpill.live i { background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.top-a { display: flex; align-items: center; gap: 6px; }
.iconbtn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink2); cursor: pointer; }
.iconbtn:hover { background: var(--panel); color: var(--ink); }
.iconbtn .badge { position: absolute; top: 2px; right: 0; }
.iconbtn.sm { width: 32px; height: 32px; }
.langbtn { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink2); font: 600 12px var(--font); cursor: pointer; }
:root[data-theme="light"] .i-sun, :root:not([data-theme="light"]) .i-moon { display: none; }
.who { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 12px; font: inherit; text-align: left; }
.who:hover { background: var(--panel); }
.who-t b { display: block; font-size: 13px; font-weight: 600; } .who-t small { display: block; font-size: 11px; color: var(--ink2); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--panel3); color: var(--ink); font: 800 italic 13px var(--font); flex: none; }
.view { padding: 22px 24px 60px; max-width: 1440px; width: 100%; outline: none; }
.tabbar, .scrim, .only-m { display: none; }

/* page header with the racing stripe */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.phead h1 { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: -.02em; position: relative; padding-left: 18px; }
.phead h1::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 7px; background: var(--brand); transform: skewX(-14deg); }
.phead p { margin: 6px 0 0 18px; color: var(--ink2); }
.phead-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ building blocks */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel.pad { padding: 18px; }
.panel > h2, .panel .ph { padding: 16px 18px 0; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ph h2 { padding: 0; }
.pb { padding: 14px 18px 18px; }
.panel.pad > h2 { padding: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.stat-l { display: block; font-size: 13px; color: var(--ink2); }
.stat-v { display: block; font-size: 24px; font-weight: 800; font-style: italic; letter-spacing: -.01em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-s { display: block; font-size: 12px; color: var(--ink2); margin-top: 2px; }
.stat.hot { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 10%, var(--panel)), var(--panel) 60%); }
.stat.bad .stat-v { color: var(--red); } .stat.good .stat-v { color: var(--green); }
.chip.edited { background: color-mix(in srgb, var(--violet) 22%, transparent); color: var(--violet); }
.chip.edited .ic { width: 12px; height: 12px; }
.edited-line { color: var(--violet); display: block; margin-top: 2px; }
.edited-line .ic { width: 12px; height: 12px; vertical-align: -2px; }
.eline { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.eline:last-of-type { border-bottom: 0; }
.etotal { display: flex; justify-content: space-between; font-weight: 700; padding: 10px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel3); color: var(--ink2); white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.chip.bad { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.chip.wait { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.chip.live { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.chip.mute { background: var(--panel3); color: var(--ink3); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; transform: skewX(-12deg); flex: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); margin-bottom: 14px; }
.note.warn { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); }
.note.bad { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); }
.note.ok { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.note .ic { margin-top: 1px; }
.note.warn .ic { color: var(--amber); } .note.bad .ic { color: var(--red); } .note.ok .ic { color: var(--green); }
.note.mx { margin: 4px 18px 14px; align-items: center; }
.note > .btn { margin-left: auto; flex: none; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 16px; color: var(--ink2); }
.empty .ic { width: 38px; height: 38px; color: var(--ink3); margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: 16px; }
.empty .btn { margin-top: 10px; }
.loading { display: flex; gap: 6px; justify-content: center; padding: 60px 0; }
.loading span { width: 10px; height: 22px; background: var(--brand); transform: skewX(-18deg); animation: bars 1s ease-in-out infinite; opacity: .3; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bars { 40% { opacity: 1; } }

/* buttons: primary actions are slanted like a racing livery */
.btn { --b: var(--panel2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--b); color: var(--ink); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.go.is-busy::after { border-color: var(--brand-ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.go { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 700; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); border-radius: 4px; padding: 0 24px; }
.btn.blue { background: var(--accent); color: #fff; border-color: transparent; }
.btn.blue { background: var(--ink); color: var(--bg); }
.btn.danger { background: color-mix(in srgb, var(--red) 18%, var(--panel)); color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn.ghost { background: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.go.sm { padding: 0 18px; }
.btn.wide { width: 100%; }
.btn.xl { height: 58px; font-size: 18px; font-style: italic; font-weight: 800; }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink2); font-weight: 500; }
.input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); font: 400 15px var(--font); font-variant-numeric: tabular-nums; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.sm { height: 34px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
select.input.sm { background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; padding-right: 28px; }
.input.big { height: 56px; font-size: 26px; font-weight: 800; font-style: italic; text-align: right; }
.input.num { text-align: right; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.fgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 1px; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 4px; margin: 0 0 14px; min-width: 0; }
.check span { min-width: 0; overflow-wrap: anywhere; }
legend { padding: 0 6px; font-weight: 600; color: var(--ink2); font-size: 13px; }

/* segmented switch (payment method, tabs) */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1 0 auto; height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); font: 600 14px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.seg button.on { background: var(--panel3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; height: 42px; padding: 0 14px; border: 0; background: none; color: var(--ink2); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--brand); transform: skewX(-20deg); }
.tabs .chip { height: 19px; padding: 0 7px; font-size: 11px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line2); background: var(--panel2); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--panel2); }
.t-empty { text-align: center; color: var(--ink2); padding: 28px !important; }
.neg { color: var(--red); } .pos { color: var(--green); }

/* list rows */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink); min-width: 0; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: var(--panel2); }
button.li { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.li-m { flex: 1; min-width: 0; }
.li-m b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-m small { display: block; color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-r { text-align: right; white-space: nowrap; }
.li-r b { display: block; font-weight: 700; }
.li-r small { color: var(--ink2); font-size: 12px; }
.li .ic.go { color: var(--ink3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink2); } .kv dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv { min-width: 0; }

/* modal & toast */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5, 9, 14, .62); backdrop-filter: blur(3px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: rise .18s ease-out; }
.modal.wide { width: min(860px, 100%); }
.modal { min-width: 0; max-width: 100%; }
.modal-b { min-width: 0; overflow-x: hidden; }
.modal-b input[type=date], .modal-b input[type=datetime-local], .modal-b input[type=time] { min-width: 0; width: 100%; }
@keyframes rise { from { transform: translateY(12px); opacity: .4; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 18px; font-weight: 800; font-style: italic; }
.modal-h h2 .ic { color: var(--brand-hi); }
.modal-b { padding: 16px 20px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--panel3); color: var(--ink); border: 1px solid var(--line2); box-shadow: var(--shadow); font-weight: 500; animation: rise .2s; transition: opacity .3s, transform .3s; }
.toast.ok .ic { color: var(--green); } .toast.bad { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); } .toast.bad .ic { color: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* gauges */
.gauge .g-track { fill: none; stroke: var(--panel3); stroke-width: 6; stroke-linecap: round; }
.gauge .g-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .6s ease-out; stroke: var(--ink); }
.gauge.g-mid .g-fill { stroke: var(--amber); }
.gauge.g-low .g-fill { stroke: var(--red); }
.gauge .g-txt { fill: var(--ink); font: 800 italic 14px var(--font); }
.gauge.g-low .g-txt { fill: var(--red); }

/* tank cups */
.cup { display: block; flex: none; overflow: visible; }
.cup-body { fill: var(--bg2); }
.cup-rim { fill: none; stroke: var(--line2); stroke-width: 2; }
.cup-cap { fill: var(--line2); }
.cup-tick { stroke: var(--ink3); stroke-width: 1; opacity: .7; }
.cup-reorder { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 4 3; }
.cup-txt { fill: #fff; font: 900 italic 22px var(--font); paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 3px; }
:root[data-theme="light"] .cup-txt { fill: var(--ink); stroke: rgba(255, 255, 255, .85); }
.cup-low .cup-rim { stroke: var(--red); }
.cup-wave { animation: cupwave 4s linear infinite; }
.cup-wave.w2 { animation-duration: 6.5s; animation-direction: reverse; }
@keyframes cupwave { from { transform: translateX(0); } to { transform: translateX(-50px); } }
.cup.sm .cup-txt { font-size: 26px; }
.tankcard .tank-top { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }
.tankcard .tank-top .kv { flex: 1 1 170px; min-width: 0; }
.tankmini .cup { width: 44px; height: 62px; }

/* period picker */
.period { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period select { width: auto; min-width: 150px; }
.period input[type=date] { width: 150px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ------------------------------------------------------------------ home */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.board { position: relative; overflow: hidden; padding: 20px; }
.board::after { content: ''; position: absolute; right: -40px; top: -30px; width: 220px; height: 160%; background: linear-gradient(100deg, transparent 0 30%, color-mix(in srgb, var(--brand) 12%, transparent) 30% 42%, transparent 42% 52%, color-mix(in srgb, var(--ink) 5%, transparent) 52% 58%, transparent 58%); transform: skewX(-18deg); pointer-events: none; }
.board-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.board h2 { font-size: 15px; color: var(--ink2); font-weight: 600; }
.speedo { font-size: 54px; font-weight: 900; font-style: italic; letter-spacing: -.03em; line-height: 1; margin: 10px 0 4px; }
.speedo small { font-size: 20px; font-weight: 800; color: var(--ink2); margin-left: 6px; }
.speedo-sub { color: var(--ink2); }
.tanks-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.tankmini { color: var(--ink); display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: var(--panel2); border-radius: 12px; border: 1px solid var(--line); min-width: 190px; }
.tankmini b { display: block; font-size: 14px; } .tankmini small { display: block; color: var(--ink2); font-size: 12px; }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 120px; margin-top: 12px; }
.spark i { flex: 1; background: linear-gradient(var(--ink3), color-mix(in srgb, var(--ink3) 25%, transparent)); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; transform: skewX(-8deg); }
.spark i.today { background: linear-gradient(var(--brand), color-mix(in srgb, var(--brand) 35%, transparent)); }
.spark-x { display: flex; justify-content: space-between; color: var(--ink3); font-size: 11px; margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); position: relative; overflow: hidden; }
.tile:hover { border-color: var(--line2); background: var(--panel2); }
.tile .ic { width: 26px; height: 26px; color: var(--brand-hi); }
.tile b { font-weight: 700; } .tile small { color: var(--ink2); font-size: 12px; margin-top: -6px; }
.tile .badge { position: absolute; top: 12px; right: 12px; }
.alert-li .ic { color: var(--amber); }
.alert-li.warn .ic { color: var(--red); }

/* ------------------------------------------------------------------ POS — the pump bay */
.posgrid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.pos-left { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pos-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.mode { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); font: 700 italic 15px var(--font); cursor: pointer; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.mode.on { background: var(--panel3); color: var(--ink); border-color: var(--line2); box-shadow: inset 0 -3px 0 var(--brand); }
.mode.on.test { box-shadow: inset 0 -3px 0 var(--violet); } .mode.on.air { box-shadow: inset 0 -3px 0 var(--ink2); }
.bay { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px 18px; }
/* one pump = one island with its nozzles side by side */
.isle { min-width: 0; }
.isle-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--ink2); }
.isle-h b { font: 800 italic 15px var(--font); color: var(--ink); }
.isle-h small { font-size: 12px; }
.isle-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.isle-n { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.bay-key { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; color: var(--ink2); margin: 0 0 8px; }
.bay-key span, .mt-leg span { display: inline-flex; align-items: center; gap: 5px; }
.bay-key i, .mt-leg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
i.s { background: var(--green); } i.t { background: var(--violet); } i.a { background: var(--ink3); } i.u { background: var(--red); }
/* meter block: totalizer wheels, usage bar, opening */
.nz-meter { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 12px; padding: 9px 10px 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); min-width: 0; }
.nz-meter.idle { opacity: .85; }
.mt-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--ink2); }
.mt-h em { font: 800 italic 13px var(--font); color: var(--green); white-space: nowrap; }
.odo { display: flex; gap: 2px; min-width: 0; }
.odo i { flex: 1 1 0; min-width: 0; max-width: 19px; height: 26px; display: grid; place-items: center; border-radius: 3px; font: 700 15px/1 var(--font); font-style: normal; font-variant-numeric: tabular-nums; color: #F4F4F4;
  background: linear-gradient(180deg, #050505 0%, #2A2A2A 46%, #2A2A2A 54%, #050505 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 0 rgba(0, 0, 0, .35); }
.odo i.g { margin-left: 3px; }
.odo i.dec { background: linear-gradient(180deg, #7A0009 0%, #E60012 46%, #E60012 54%, #7A0009 100%); color: #fff; }
.odo i.dp { flex: 0 0 auto; width: 6px; max-width: 6px; background: none; box-shadow: none; color: var(--ink2); align-items: end; }
.mt-bar { display: flex; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mt-bar i { display: block; height: 100%; border-radius: 0; }
.mt-leg { display: flex; gap: 10px; font-size: 11.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.mt-l { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12px; color: var(--ink2); padding-top: 5px; border-top: 1px dashed var(--line); }
.mt-l b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.nz-foot .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.pump-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--ink2); font: 700 italic 14px var(--font); margin-top: 4px; }
.pump-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.nz { --c: var(--brand); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; grid-template-rows: auto auto auto; gap: 2px 10px; text-align: left; padding: 16px 16px 14px 18px; min-height: 140px;
  background: linear-gradient(155deg, var(--panel2), var(--panel) 55%); border: 1px solid var(--line); border-radius: 4px 18px 4px 18px; color: var(--ink); cursor: pointer; font: inherit;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px)); transition: transform .12s, box-shadow .15s, border-color .15s; }
.nz::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.nz:hover { border-color: var(--line2); transform: translateY(-2px); }
.nz.on { border-color: var(--accent); box-shadow: var(--glow); background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 14%, var(--panel2)), var(--panel) 65%); }
.nz:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.nz-name { font: 900 italic 26px/1 var(--font); letter-spacing: -.02em; }
.nz-prod { grid-column: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.nz-price { grid-column: 1 / -1; margin-top: 12px; font: 800 italic 22px/1 var(--font); }
.nz-price small { font-size: 13px; color: var(--ink2); font-weight: 500; font-style: normal; margin-left: 4px; }
.nz-g { grid-row: 1 / 3; grid-column: 2; }
.nz-foot { grid-column: 1 / -1; font-size: 12px; color: var(--ink2); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.nz-tick { position: absolute; right: 12px; bottom: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; }
.nz.on .nz-tick { display: grid; }

.nz-tick .ic { width: 15px; height: 15px; stroke-width: 3; }
.cart { position: sticky; top: calc(var(--top) + 16px); display: flex; flex-direction: column; max-height: calc(100vh - var(--top) - 32px); overflow: hidden; }
.cart-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; gap: 8px; }
.cart-h h2 { font-size: 18px; font-weight: 800; font-style: italic; }
.cart-b { padding: 0 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.cart .seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
.cart .seg button { padding: 4px 6px; height: auto; min-height: 38px; white-space: normal; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.cart-f { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--panel2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.line { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--bg2); }
.line-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.line-h b { font: 800 italic 17px var(--font); }
.line-h small { color: var(--ink2); }
.line-h .iconbtn { margin-left: auto; }
.unit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.unit button { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink2); font: 600 13px var(--font); cursor: pointer; }
.unit button.on { background: var(--panel3); color: var(--ink); border-color: var(--line2); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { flex: 1 0 auto; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 13px var(--font); cursor: pointer; }
.quick button:hover { border-color: var(--accent); }
.line-sum { display: flex; justify-content: space-between; color: var(--ink2); font-size: 13px; margin-top: 8px; }
.line-sum b { color: var(--ink); }
.totalbar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.totalbar span { color: var(--ink2); font-weight: 600; }
.totalbar b { font: 900 italic 34px/1 var(--font); letter-spacing: -.02em; }
.totalbar small { color: var(--ink2); font-size: 13px; }
/* two currencies in one sale */
.fx { margin-top: 12px; padding: 12px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel2); display: grid; gap: 10px; min-width: 0; }
.fx-h { display: flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 13px; }
.fx-h .ic { width: 16px; height: 16px; color: var(--cyan); }
.fx-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fx-rate span, .fx-rate b { white-space: nowrap; font-weight: 700; }
.fx-rate .input { flex: 1 1 100px; min-width: 0; max-width: 170px; font-weight: 700; }
.fx-in { gap: 10px; margin: 0; }
.fx-in .field { margin: 0; }
.fx-split { display: grid; gap: 6px; border-top: 1px dashed var(--line2); padding-top: 10px; }
.fx-split > div { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.fx-split span { color: var(--ink2); font-weight: 600; }
.fx-split small { flex-basis: 100%; text-align: right; color: var(--ink3); font-size: 12px; }
.fx-split .fx-rest b { font: 900 italic 24px/1.1 var(--font); color: var(--ink); }
.fx-split .pos b { color: var(--green); }
.fx-split .neg b, .fx-split .neg span { color: var(--red); }
.fx-split p { margin: 0; }
.custbtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line2); background: transparent; color: var(--ink); font: inherit; cursor: pointer; text-align: left; margin-bottom: 10px; }
.custbtn.has { border-style: solid; background: var(--bg2); }
.custbtn .li-m small { white-space: normal; }
.shift-gate { text-align: center; padding: 36px 20px; }
.shift-gate > .ic { width: 44px; height: 44px; color: var(--brand-hi); }
.shift-gate h2 { justify-content: center; font-size: 22px; font-style: italic; font-weight: 800; margin: 10px 0 6px; }
.recent .li-r b { font-size: 15px; }
.livebar { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.livebar b { font: 800 italic 20px var(--font); }
.livebar span { color: var(--ink2); font-size: 13px; display: block; }
.livebar .lb-a { gap: 8px; flex-wrap: wrap; }
.swap-ft { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr); gap: 10px; align-items: end; margin: 4px 0 14px; }
.swap-ft small { display: block; color: var(--ink2); font-size: 12.5px; margin-bottom: 6px; }
.swap-ft b { display: flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.swap-ft > .ic { margin-bottom: 12px; color: var(--brand-hi); }
.sale-done { text-align: center; }
.sale-done .big-tick { width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.sale-done .big-tick .ic { width: 34px; height: 34px; stroke-width: 2.6; }
.sale-done .amount { font: 900 italic 38px var(--font); margin: 4px 0; }

/* meters table on close */
.mtr { display: grid; grid-template-columns: minmax(120px, 1.2fr) repeat(2, minmax(110px, 1fr)) minmax(90px, .8fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mtr:last-child { border-bottom: 0; }
.mtr .input { height: 40px; }
.mtr-h { color: var(--ink2); font-size: 12px; font-weight: 600; padding-top: 0; }
.mtr b { font-weight: 700; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps button { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); font: 700 italic 14px var(--font); cursor: pointer; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); border-radius: 3px; }
.steps button.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.steps button.done { color: var(--green); }
.steps i { font-style: normal; opacity: .7; }

/* person page */
.person-h { display: flex; gap: 16px; align-items: center; padding: 20px; flex-wrap: wrap; }
.person-h .avatar { width: 64px; height: 64px; font-size: 22px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); }
.person-h h2 { font-size: 24px; font-weight: 900; font-style: italic; }
.wallet { display: flex; gap: 12px; flex-wrap: wrap; }
.wcard { flex: 1 1 200px; padding: 16px; border-radius: 14px; background: linear-gradient(140deg, var(--panel3), var(--panel2)); border: 1px solid var(--line2); position: relative; overflow: hidden; }
.wcard::after { content: ''; position: absolute; right: -20px; top: 0; bottom: 0; width: 70px; background: color-mix(in srgb, var(--brand) 14%, transparent); transform: skewX(-18deg); }
.wcard span { color: var(--ink2); font-size: 13px; }
.wcard b { display: block; font: 900 italic 28px var(--font); margin: 4px 0; }
.wcard small { display: block; color: var(--ink2); font-size: 12px; }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--line); align-items: center; }
.tl:first-child { border-top: 0; }
.tl .tl-i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--panel3); color: var(--ink2); }
.tl .tl-i .ic { width: 16px; height: 16px; }
.tl.in .tl-i { color: var(--green); } .tl.out .tl-i { color: var(--red); } .tl.wait .tl-i { color: var(--amber); }
.tl b { font-weight: 600; } .tl small { display: block; color: var(--ink2); font-size: 12px; }
.tl .amt { text-align: right; font-weight: 700; white-space: nowrap; }
.tl > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.tl { grid-template-columns: 28px minmax(0, 1fr) auto; }
.mx-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* settings */
.set { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.setnav { position: sticky; top: calc(var(--top) + 16px); display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.setnav button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--ink2); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.setnav button:hover { background: var(--panel2); color: var(--ink); }
.setnav button.on { background: var(--panel3); color: var(--ink); }
.setnav button.on .ic { color: var(--brand-hi); }
.toggle { position: relative; display: inline-block; vertical-align: middle; width: 44px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle i { position: absolute; inset: 0; border-radius: 13px; background: var(--panel3); border: 1px solid var(--line2); transition: background .15s; cursor: pointer; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink2); transition: transform .15s, background .15s; }
.toggle input:checked + i { background: var(--accent); border-color: transparent; }
.toggle input:checked + i::after { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.setrow:first-of-type { border-top: 0; }
.setrow b { display: block; font-weight: 600; } .setrow small { display: block; color: var(--ink2); font-size: 13px; }
.setrow .input { max-width: 220px; }
.matrix { width: 100%; border-collapse: collapse; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix th { font-size: 12px; color: var(--ink2); font-weight: 600; }
.matrix td.locked { color: var(--ink3); }
.permlist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.permlist li { display: flex; gap: 8px; align-items: center; }
.permlist .ic { color: var(--green); width: 18px; height: 18px; }
.swatch { width: 18px; height: 18px; border-radius: 5px; display: inline-block; vertical-align: middle; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login-art { position: absolute; inset: 0; pointer-events: none; }
.lane { position: absolute; left: -10%; right: -10%; top: 62%; height: 120px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 26%, transparent) 40%, transparent 75%); transform: skewY(-12deg); }
.lane.l2 { top: 70%; height: 36px; background: linear-gradient(90deg, transparent 10%, color-mix(in srgb, var(--ink) 10%, transparent) 55%, transparent); }
.lane.l3 { top: 20%; height: 2px; background: linear-gradient(90deg, transparent, var(--line2), transparent); transform: skewY(-12deg); }
.login-card { position: relative; width: min(400px, 100%); padding: 26px 26px 18px; box-shadow: var(--shadow); }
.login-card .brand { padding: 0 0 18px; }
.login-card h1 { font-size: 26px; font-weight: 900; font-style: italic; margin-bottom: 16px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.inst-err { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); padding: 10px 12px; border-radius: 10px; }

/* installer page */
body.install { background: var(--bg); }
.inst { max-width: 680px; margin: 0 auto; padding: 30px 16px 60px; }
.inst-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.inst-brand b { display: block; font: 900 italic 22px var(--font); } .inst-brand small { color: var(--ink2); }
.inst-card { padding: 22px; }
.inst-card h1 { font-size: 28px; font-weight: 900; font-style: italic; margin-bottom: 16px; }
.inst-list { padding-left: 18px; }
.inst .grid2 { gap: 0 14px; }
.inst-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.inst-top .inst-brand { margin-bottom: 0; }
.inst-lang { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.inst-lang a { padding: 6px 12px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 13px; }
.inst-lang a[aria-current] { background: var(--brand); color: #fff; }
.inst-card + .inst-card { margin-top: 16px; }
.inst-card .inst-h { font-size: 17px; font-weight: 800; margin: 0 0 10px; padding: 0; }
.inst-checks { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.inst-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.inst-checks .dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.inst-checks .ok .dot { background: var(--green); }
.inst-checks .bad .dot { background: var(--red); }
.inst-checks .warn .dot { background: var(--amber); color: #1A1A1A; }
.inst-checks .hint { display: block; color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
.inst-warn { color: var(--amber); font-weight: 600; }
.inst .btn.go[disabled] { opacity: .45; cursor: not-allowed; }


/* ------------------------------------------------------------------ shift dot, drawer footer, settings list (all sizes) */
.stdot { display: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink3); flex: none; }
.stdot.live { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.side-foot { display: none; }
.period-d { display: contents; }
.setlist { display: flex; flex-direction: column; padding: 6px; }
.setlist button { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 600 15px var(--font); text-align: left; cursor: pointer; }
.setlist button + button { border-top: 1px solid var(--line); border-radius: 0; }
.setlist button .ic:first-child { color: var(--brand-hi); flex: none; }
.setlist button span { flex: 1; }
.setlist button .chev { color: var(--ink3); }
.setlist button:active { background: var(--panel2); }
.backlink { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 6px; margin: 0 0 12px -6px; border: 0; background: none; color: var(--ink2); font: 600 15px var(--font); cursor: pointer; border-radius: 10px; }
.backlink:active { background: var(--panel2); }

/* ------------------------------------------------------------------ phones & tablets */
@media (max-width: 1180px) {
  .posgrid { grid-template-columns: minmax(0, 1fr) 360px; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; max-width: 86vw; height: 100%; z-index: 60; transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: var(--shadow); padding-bottom: env(safe-area-inset-bottom); }
  .shell.nav-open .side { transform: none; }
  .shell.rail .nav a span, .shell.rail .brand div { display: initial; }
  .shell.rail .nav a { justify-content: flex-start; }
  .shell.rail .ngrp-h { display: flex; }
  .shell.rail .ngrp-b { grid-template-rows: 0fr; }
  .shell.rail .ngrp.open .ngrp-b { grid-template-rows: 1fr; }
  .shell.rail .ngrp-in { padding-left: 14px; margin-left: 21px; border-left: 1px solid var(--line); }
  .shell.rail .ngrp { border-top: 0; padding-top: 0; margin-top: 6px; }
  .railbtn { display: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .only-m { display: inline-grid; }
  .top { padding: 0 10px; }
  .who-t { display: none; }
  .view { padding: 16px 16px 96px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg2); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; color: var(--ink2); font: 500 11px var(--font); background: none; border: 0; cursor: pointer; }
  .tabbar a.on { color: var(--brand-hi); }
  .tabbar .badge { position: absolute; top: 0; left: 52%; margin: 0; }
  .posgrid { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; max-height: none; }
  .set { grid-template-columns: minmax(0, 1fr); }
  .setnav { display: none; }
  .side-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 18px; margin-top: auto; border-top: 1px solid var(--line); }
  .side-foot .btn { flex: 1 1 auto; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .phead h1 { font-size: 25px; }
  .grid2, .grid3, .fgrid, .fgrid3 { grid-template-columns: minmax(0, 1fr) !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-v { font-size: 20px; }
  .bay { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .isle-n { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .odo i { height: 22px; font-size: 13px; max-width: 16px; }
  .odo i.g { margin-left: 2px; }
  .nz-meter { padding: 8px 8px 7px; margin-top: 10px; }
  .mt-leg { gap: 7px; font-size: 11px; }
  .bay-key { justify-content: flex-start; }
  .nz { min-height: 128px; padding: 12px 12px 12px 14px; }
  .nz-name { font-size: 22px; }
  .nz-price { font-size: 18px; }
  .nz-g svg { width: 46px; height: 46px; }
  .speedo { font-size: 42px; }
  .shiftpill { padding: 4px 9px; font-size: 12px; }
  .st-name { max-width: 34vw; }
  .st-name .ic { display: none; }
  #toasts { bottom: 86px; }
  .stpick select { max-width: 130px; }
  .langbtn { display: none; }
  .mtr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtr > :first-child { grid-column: 1 / -1; }
  .mtr-h { display: none; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; text-align: right; }
  .tbl.cards td::before { content: attr(data-label); color: var(--ink2); font-size: 12px; text-align: left; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .period input[type=date] { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* two prices, one in use */
.pswitch { display: inline-flex; gap: 4px; padding: 3px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.pswitch button { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 104px; padding: 5px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink2); font: inherit; cursor: pointer; text-align: left; }
.pswitch button small { font-size: 11px; font-weight: 600; }
.pswitch button b { font: 800 italic 15px var(--font); color: var(--ink2); white-space: nowrap; }
.pswitch button.on { background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 10px rgba(230, 0, 18, .3); }
.pswitch button.on b { color: var(--brand-ink); }
.pswitch button:not(.on):hover { background: var(--panel3); }

/* AI analyst */
.ai-tile { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; color: var(--ink); background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 16%, var(--panel)), var(--panel) 60%); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.ai-tile > .ic:first-child { width: 34px; height: 34px; color: var(--brand-hi); }
.ai-tile div { flex: 1; } .ai-tile b { display: block; font: 900 italic 20px var(--font); } .ai-tile span { color: var(--ink2); font-size: 14px; }
.ai-hero { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.ai-score { display: flex; align-items: center; gap: 18px; }
.ai-score .verdict { font: 900 italic 30px var(--font); margin: 2px 0 6px; }
.score-ring .g-txt { font-size: 17px; }
.score-ring.s-ok .g-fill { stroke: var(--green); } .score-ring.s-mid .g-fill { stroke: var(--amber); } .score-ring.s-low .g-fill { stroke: var(--red); }
.score-ring.s-ok .g-txt, .score-ring.s-mid .g-txt, .score-ring.s-low .g-txt { fill: var(--ink); }
.ai-stats { margin: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.findings { display: flex; flex-direction: column; padding: 8px 0 4px; }
.finding { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.finding:first-child { border-top: 0; }
.finding.f-high { border-left-color: var(--red); } .finding.f-medium { border-left-color: var(--amber); } .finding.f-good { border-left-color: var(--green); }
.finding > div { flex: 1; } .finding b { display: block; font-weight: 600; } .finding small { display: flex; gap: 4px; align-items: center; color: var(--ink2); margin-top: 3px; }
.finding small .ic { width: 14px; height: 14px; }
.finding .chip { flex: none; min-width: 70px; justify-content: center; }
.risk { display: inline-block; width: 70px; height: 7px; border-radius: 4px; background: var(--panel3); vertical-align: middle; overflow: hidden; }
.risk i { display: block; height: 100%; border-radius: 4px; } .risk i.lo { background: var(--green); } .risk i.mid { background: var(--amber); } .risk i.hi { background: var(--red); }
.risk-n { margin-left: 6px; font-size: 13px; }
.wchart { width: 100%; height: auto; margin-top: 10px; }
.wchart .gl { stroke: var(--line); stroke-dasharray: 3 4; } .wchart .ax { fill: var(--ink3); font: 500 11px var(--font); }
.b-test { fill: var(--ink3); background: var(--ink3); } .b-lost { fill: var(--red); background: var(--red); } .b-air { fill: var(--amber); background: var(--amber); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink2); font-size: 13px; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hstrip { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; margin-top: 14px; }
.hstrip span { height: 52px; border-radius: 5px; background: color-mix(in srgb, var(--brand) calc(var(--a) * 100%), var(--panel3)); display: flex; align-items: flex-end; justify-content: center; }
.hstrip b { font-size: 10px; color: var(--ink2); font-weight: 600; padding-bottom: 3px; }
.lbars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lbar { display: grid; grid-template-columns: 64px 1fr 74px; gap: 10px; align-items: center; font-size: 13px; }
.lbar span { color: var(--ink2); } .lbar em { font-style: normal; text-align: right; font-weight: 600; }
.lbar i { height: 12px; background: var(--panel3); border-radius: 6px; overflow: hidden; } .lbar i b { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.ai-out { margin-top: 12px; }
.ai-text { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; line-height: 1.55; max-width: 900px; }
.ai-text h3 { font: 800 italic 16px var(--font); margin: 14px 0 6px; color: var(--brand-hi); } .ai-text h3:first-child { margin-top: 0; }
.ai-text ul { margin: 4px 0 8px; padding-left: 20px; } .ai-text p { margin: 0 0 8px; }
.ai-q { font-weight: 600; display: flex; gap: 8px; align-items: center; }
@media (max-width: 960px) { .ai-hero { grid-template-columns: minmax(0, 1fr); } .hstrip span { height: 40px; } .hstrip b { font-size: 8px; } }

.center { text-align: center; }

/* ------------------------------------------------------------------ phones: organised layout */
@media (max-width: 640px) {
  :root { --top: 56px; }
  .input, .input.sm, select.input, textarea.input { font-size: 16px; }
  .top { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  #toasts { top: calc(var(--top) + 8px + env(safe-area-inset-top)); bottom: auto !important; }
  .view { padding: 14px 12px 96px; }

  /* top bar: menu · station (with shift dot) · bell · me */
  .top { gap: 4px; padding: 0 6px; }
  .top-st { gap: 0; }
  .shiftpill, .hide-s { display: none !important; }
  .stdot { display: inline-block; }
  .stpick { flex: 1; min-width: 0; gap: 8px; padding-left: 6px; }
  .stpick > .ic, .st-name > .ic { display: none; }
  .stpick select { flex: 1; min-width: 0; max-width: none; height: 40px; border: 0; background-color: transparent; font: 700 15px var(--font); color: var(--ink); padding-left: 0; text-overflow: ellipsis; }
  .st-name { max-width: none; flex: 1; min-width: 0; padding-left: 6px; font-size: 15px; font-weight: 700; }
  .st-name span { overflow: hidden; text-overflow: ellipsis; }
  .top-a { gap: 2px; }
  .who { padding: 3px; }

  /* page head: title, then actions in one tidy row */
  .phead { gap: 12px; margin-bottom: 14px; align-items: stretch; }
  .phead-t { width: 100%; }
  .phead h1 { font-size: 26px; padding-left: 15px; }
  .phead h1::before { width: 6px; }
  .phead p { margin-left: 15px; font-size: 14px; }
  .phead-a { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .phead-a > * { flex: 1 1 auto; }
  .phead-a > .btn, .phead-a > a.btn { justify-content: center; padding: 0 14px; }
  .phead-a > .chip, .phead-a > .badge { flex: none; align-self: center; }
  .tbl td:not(.t-first):not(.t-empty):empty { display: none; }

  /* period filter: preset on its own line, the two dates side by side */
  .period { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; }
  .period select { width: 100%; min-width: 0; }
  .period-d { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
  .period-d input[type=date] { width: 100%; min-width: 0; }

  /* every table becomes a list of cards */
  .tbl-wrap { overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tfoot { display: block; width: 100%; }
  .tbl tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; text-align: right; min-width: 0; }
  .tbl td::before { content: attr(data-label); flex: none; max-width: 48%; color: var(--ink2); font-size: 13px; font-weight: 500; text-align: left; }
  .tbl td.n { white-space: normal; }
  .tbl td.t-first { display: block; text-align: left; font-size: 16px; font-weight: 700; padding: 0 0 6px; }
  .tbl td.t-first::before { display: none; }
  .tbl td.t-nol { justify-content: flex-end; flex-wrap: wrap; padding-top: 8px; }
  .tbl td.t-nol::before { display: none; }
  .tbl td.t-nol:empty { display: none; }
  .tbl td.t-empty { display: block; text-align: center; padding: 26px 0; color: var(--ink2); }
  .tbl td.t-empty::before { display: none; }
  .tbl tfoot tr { background: var(--panel2); border-top: 2px solid var(--line2); }
  .tbl tfoot td { background: none; border: 0; }
  .tbl tfoot td:first-child { display: block; text-align: left; }
  .tbl tfoot td:first-child::before { display: none; }
  .tbl tfoot td:empty { display: none; }
  .tbl tr.clickable:active { background: var(--panel2); }
  .tbl tr.clickable:hover td { background: none; }
  .ph { padding-left: 14px; padding-right: 14px; }

  /* settings rows: label on top, field full width */
  .setrow { flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 0; }
  .setrow .input, .setrow select.input { max-width: none !important; width: 100%; }
  .setrow > .toggle, .setrow > label.toggle { align-self: flex-start; }
  .pad { padding: 16px; }

  /* POS modes: three equal buttons */
  .pos-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
  .mode { flex-direction: column; justify-content: center; gap: 3px; height: 58px; padding: 0 6px; font-size: 13px; clip-path: none; border-radius: 12px; text-align: center; line-height: 1.15; }

  /* price switch fits a card */
  .pswitch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .li.pli { flex-wrap: wrap; }
  .li.pli .pswitch { flex: 1 1 100%; }
  .pswitch button { min-width: 0; }
  .tbl td .pswitch { margin-top: 4px; }

  .tabs button { padding: 0 10px; }
  /* person access list inside a window: name above, choice below */
  .modal .matrix, .modal .matrix tbody, .modal .matrix tr, .modal .matrix td { display: block; width: 100%; }
  .modal .matrix tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .modal .matrix td { border: 0; padding: 2px 0; text-align: left; }
  .modal .matrix td select { width: 100%; }
  .toolbar { width: 100%; }
  .toolbar > select.input, [data-st] { width: 100% !important; }
  .toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 8px; }

  /* role grid: the permission column stays visible while the roles scroll */
  .matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); min-width: 128px; box-shadow: 1px 0 0 var(--line); }
  .btn { white-space: nowrap; }
}

/* ------------------------------------------------------------------ very small phones (≤ 360px) */
@media (max-width: 360px) {
  .view { padding: 12px 8px 92px; }
  .isle-n, .bay, .stats, .wallet, .tiles { grid-template-columns: minmax(0, 1fr) !important; }
  .odo i { height: 22px; font-size: 13px; }
  .phead h1 { font-size: 23px; }
  .pos-modes .mode { font-size: 12px; }
  .tabbar a, .tabbar button { font-size: 10px; }
  .modal-f { flex-wrap: wrap; }
  .tl { grid-template-columns: 28px minmax(0, 1fr); padding: 10px 12px; }
  .tl .amt { grid-column: 2; text-align: left; }
  .modal-f .btn { flex: 1 1 auto; }
  .pswitch button { padding: 5px 6px; }
}
/* phones turned sideways: keep windows usable */
@media (max-height: 480px) and (orientation: landscape) {
  .modal, .modal.wide { max-height: 96vh; }
  .tabbar { padding-top: 2px; padding-bottom: 2px; }
}

/* a table in a narrow box (half-width panel on a tablet, small window) also becomes cards */
.tbl-wrap { container-type: inline-size; }
@container (max-width: 600px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tfoot { display: block; width: 100%; }
  .tbl tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; text-align: right; min-width: 0; }
  .tbl td::before { content: attr(data-label); flex: none; max-width: 48%; color: var(--ink2); font-size: 13px; font-weight: 500; text-align: left; }
  .tbl td.n { white-space: normal; }
  .tbl td.t-first { display: block; text-align: left; font-size: 16px; font-weight: 700; padding: 0 0 6px; }
  .tbl td.t-first::before { display: none; }
  .tbl td.t-nol { justify-content: flex-end; flex-wrap: wrap; padding-top: 8px; }
  .tbl td.t-nol::before { display: none; }
  .tbl td.t-nol:empty { display: none; }
  .tbl td.t-empty { display: block; text-align: center; padding: 26px 0; color: var(--ink2); }
  .tbl td.t-empty::before { display: none; }
  .tbl tfoot tr { background: var(--panel2); border-top: 2px solid var(--line2); }
  .tbl tfoot td { background: none; border: 0; }
  .tbl tfoot td:first-child { display: block; text-align: left; }
  .tbl tfoot td:first-child::before { display: none; }
  .tbl tfoot td:empty { display: none; }
  .tbl tr.clickable:active { background: var(--panel2); }
  .tbl tr.clickable:hover td { background: none; }
}

/* ---------- fuel check, report details */
.sec-h { display: flex; align-items: center; gap: 8px; font: 800 italic 18px/1.2 var(--font); margin: 6px 0 12px; }
.sec-h .ic { width: 18px; height: 18px; color: var(--brand); }
details.how summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
details.how summary::-webkit-details-marker { display: none; }
details.how summary .ic { width: 18px; height: 18px; color: var(--cyan); }
details.how summary::after { content: '+'; margin-left: auto; font-weight: 700; color: var(--ink2); }
details.how[open] summary::after { content: '−'; }
details.how ol { margin: 12px 0 0; padding-left: 20px; color: var(--ink2); display: grid; gap: 6px; line-height: 1.5; }
.fchart .b-loss { fill: var(--red); } .fchart .b-extra { fill: var(--green); } .fchart .b-short { fill: var(--amber); }
.fchart .cum { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linejoin: round; }
.fchart .nodip { fill: var(--ink3); }
.fchart .gl.zero { stroke: var(--ink3); stroke-dasharray: none; }
.legend .b-loss { background: var(--red); } .legend .b-extra { background: var(--green); } .legend .b-short { background: var(--amber); }
.legend .l-cum { background: var(--cyan); height: 3px; border-radius: 2px; vertical-align: 3px; }
.legend .d-nodip { background: var(--ink3); border-radius: 50%; width: 8px; height: 8px; }
.fc-tanks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; margin-bottom: 16px; }
.fc-tank { padding: 16px; border-top: 3px solid var(--line2); display: flex; flex-direction: column; gap: 12px; }
.fc-tank.st-loss { border-top-color: var(--red); } .fc-tank.st-extra { border-top-color: var(--amber); } .fc-tank.st-ok { border-top-color: var(--green); }
.fc-tank header { display: flex; align-items: center; gap: 10px; }
.fc-tank header > div { flex: 1; min-width: 0; } .fc-tank header b { display: block; font: 800 italic 17px/1.2 var(--font); }
.fc-tank header small { color: var(--ink2); font-size: 12px; }
.fc-tank .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fc-meter { position: relative; height: 10px; border-radius: 5px; background: var(--panel3); overflow: hidden; }
.fc-meter .tol { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--green) 22%, transparent); }
.fc-meter i { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.fc-meter i.neg { background: var(--red); } .fc-meter i.pos { background: var(--amber); }
.fc-meter b { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.fc-pct { font: 900 italic 26px/1 var(--font); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fc-pct small { font: 500 12px var(--font); color: var(--ink2); }
.fc-tank .kv { font-size: 13px; }
.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) auto 3.4em; gap: 10px; align-items: center; font-size: 13px; }
.hbar > span { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar i { height: 12px; background: var(--panel3); border-radius: 6px; overflow: hidden; } .hbar i b { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.hbar em { font-style: normal; font-weight: 700; text-align: right; display: flex; flex-direction: column; line-height: 1.15; }
.hbar em small { font-weight: 500; color: var(--ink2); font-size: 11px; }
.hbar > small { text-align: right; }
@media (max-width: 420px) { .hbar { grid-template-columns: minmax(0, 1fr) auto; } .hbar i { grid-column: 1 / -1; grid-row: 2; } .hbar > small { display: none; } }

/* ---------- AI: connect with one key, organised answers */
.ai-c-h { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.ai-c-h > .ic { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); flex: none; }
.ai-c-h > div { flex: 1 1 220px; min-width: 0; } .ai-c-h h2 { margin: 0 0 4px; }
.ai-key-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ai-key-row .input { flex: 1 1 240px; min-width: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.ai-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ai-empty > .ic { width: 28px; height: 28px; color: var(--violet); }
.ai-empty p { margin: 0; color: var(--ink2); max-width: 62ch; }
.air-rep { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.air-rep h3 { font: 800 italic 16px/1.2 var(--font); margin: 8px 0 0; }
.air-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel2); border-left: 5px solid var(--amber); }
.air-head.s-ok { border-left-color: var(--green); } .air-head.s-bad { border-left-color: var(--red); }
.air-head > .ic { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--amber); }
.air-head.s-ok > .ic { color: var(--green); } .air-head.s-bad > .ic { color: var(--red); }
.air-head small { display: block; color: var(--ink2); font-size: 12px; font-weight: 600; }
.air-head b { display: block; font-size: 17px; line-height: 1.35; }
.air-ans { padding: 12px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--cyan) 10%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent); }
.air-ans small { color: var(--cyan); font-weight: 700; font-size: 12px; } .air-ans p { margin: 4px 0 0; line-height: 1.5; }
.air-sum { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.air-finds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.air-f { border: 1px solid var(--line2); border-radius: var(--r); padding: 12px 14px; background: var(--panel); border-top: 3px solid var(--amber); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.air-f.f-high { border-top-color: var(--red); } .air-f.f-good { border-top-color: var(--green); } .air-f.f-low { border-top-color: var(--line2); }
.air-f header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.air-area { display: inline-flex; align-items: center; gap: 5px; color: var(--ink2); font-size: 12px; font-weight: 600; } .air-area .ic { width: 14px; height: 14px; }
.air-num { font: 900 italic 24px/1.1 var(--font); overflow-wrap: anywhere; }
.air-f p { margin: 0; color: var(--ink2); font-size: 13px; line-height: 1.45; }
.air-acts { display: grid; gap: 12px; }
.air-when ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.air-when li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 12px; border-radius: 10px; background: var(--panel2); }
.air-when li .ic { width: 16px; height: 16px; color: var(--green); margin-top: 2px; }
.air-when li em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink2); background: var(--panel3); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.air-causes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.air-cause { border: 1px solid var(--line2); border-radius: var(--r); padding: 12px 14px; }
.air-cause b { display: flex; gap: 6px; align-items: center; } .air-cause b .ic { width: 16px; height: 16px; }
.air-cause.c-theft b .ic { color: var(--red); } .air-cause.c-technical b .ic { color: var(--cyan); } .air-cause.c-paperwork b .ic { color: var(--amber); }
.air-cause ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink2); font-size: 13px; display: grid; gap: 4px; }
.ai-meta { margin-top: 10px; }
@media (max-width: 480px) { .air-when li { grid-template-columns: auto minmax(0, 1fr); } .air-when li em { grid-column: 2; justify-self: start; } }

/* ---------- accounts: corner menu and sign-in chooser */
.avatar[style*="--av"] { background: var(--av); color: #fff; border-radius: 50%; font-style: normal; font-weight: 800; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; box-shadow: 0 0 0 4px var(--panel), 0 0 0 6px var(--av, var(--line2)); }
.acct-menu { position: fixed; z-index: 90; width: min(300px, calc(100vw - 16px)); padding: 8px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); border-radius: 14px; animation: acctIn .14s ease-out; }
@keyframes acctIn { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .acct-menu { animation: none; } }
.acct-me { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-me > div { min-width: 0; } .acct-me b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-me small { color: var(--ink2); font-size: 12px; }
.acct-menu button { display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 600 14px var(--font); text-align: left; cursor: pointer; min-height: 44px; }
.acct-menu button:hover, .acct-menu button:focus-visible { background: var(--panel2); outline: none; }
.acct-menu button > .ic { width: 20px; height: 20px; color: var(--ink2); flex: none; margin: 0 4px; }
.acct-menu button span { min-width: 0; } .acct-menu button span b { display: block; font-weight: 600; } .acct-menu button span small { color: var(--ink2); font-weight: 500; font-size: 12px; }
.acct-menu button.danger, .acct-menu button.danger .ic { color: var(--red); }
.acct-sep { font-size: 11px; font-weight: 700; color: var(--ink3); padding: 10px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.acct-list { display: flex; flex-direction: column; gap: 8px; }
.acct-row { display: flex; align-items: center; gap: 6px; }
.acct-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); color: var(--ink); cursor: pointer; text-align: left; font: inherit; min-height: 64px; transition: border-color .12s, background .12s; }
.acct-pick:hover, .acct-pick:focus-visible { border-color: var(--brand); background: var(--panel3); outline: none; }
.acct-pick > span:not(.avatar) { flex: 1; min-width: 0; } .acct-pick b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pick small { color: var(--ink2); font-size: 12px; } .acct-pick .go { width: 18px; height: 18px; color: var(--ink3); flex: none; }
.acct-x { flex: none; color: var(--ink3); }
.acct-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 4px 0 16px; }
.acct-hero h1 { margin: 8px 0 0 !important; font-size: 22px !important; overflow-wrap: anywhere; }
.acct-hero small { color: var(--ink2); }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 46px; }
.pw-wrap .iconbtn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.login .center { text-align: center; } .login .tiny .ic { width: 12px; height: 12px; vertical-align: -1px; }
.nowrap { white-space: nowrap; }
.login .langbtn { display: inline-flex; align-items: center; }
@media (max-width: 600px) { .wchart .ax { font-size: 20px; } }

/* ---------- profit */
.pf-cur { align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-cur .seg { width: auto; }
.pf-cur .ic { width: 14px; height: 14px; vertical-align: -2px; }
.wfall { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wf-row { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.wf-row > span { color: var(--ink2); }
.wf-row i { height: 16px; border-radius: 4px; background: var(--panel3); overflow: hidden; }
.wf-row i b { display: block; height: 100%; border-radius: 4px; }
.wf-row em { font-style: normal; font-weight: 700; text-align: right; white-space: nowrap; }
.w-in i b { background: var(--ink3); } .w-out i b { background: var(--red); } .w-sum i b { background: var(--amber); }
.w-net i b { background: var(--green); } .w-neg i b { background: var(--red); }
.w-sum > span, .w-net > span, .w-neg > span { color: var(--ink); font-weight: 700; }
.w-out em { color: var(--red); } .w-net em { color: var(--green); } .w-neg em { color: var(--red); }
.pchart .b-gross, .legend .b-gross { fill: var(--green); background: var(--green); }
.pchart .b-exp, .legend .b-exp { fill: var(--amber); background: var(--amber); }
.pchart .b-loss { fill: var(--red); } .pchart .gl.zero { stroke: var(--ink3); stroke-dasharray: none; }
.pl-kv { margin-top: 12px; }
.pf-tool h3 { font: 800 italic 15px/1.2 var(--font); margin: 0 0 8px; }
.pf-tool .fgrid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.pf-out { padding: 12px 14px; border-radius: 10px; background: var(--panel2); line-height: 1.6; font-size: 14px; }
.tbl.cmp { margin-top: 8px; } .tbl.cmp td, .tbl.cmp th { padding: 8px 6px; }
@media (max-width: 480px) { .wf-row { grid-template-columns: minmax(0, 1fr) auto; } .wf-row i { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- many prices */
.pswitch.many { flex-wrap: wrap; }
.lv-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lv-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.lv-row.off { opacity: .6; } .lv-row.off .input { text-decoration: line-through; }
.lv-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel3); font-weight: 800; font-size: 12px; }
.lv-on { display: inline-flex; align-items: center; gap: 6px; } .lv-on em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink2); min-width: 2em; }
.ph0 h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; } .ph0 h2 .ic { width: 18px; height: 18px; color: var(--brand); }
@media (max-width: 420px) { .lv-row { grid-template-columns: 24px minmax(0, 1fr) auto; } .lv-move { display: none; } }

/* ---------- dollars at the POS */
.line .unit.u3 { grid-template-columns: repeat(3, 1fr); }
.fx-h .fx-open { margin-left: auto; }
.fxc-rate { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--panel2); font-size: 18px; }
.fxc-rate b { font: 900 italic 22px var(--font); } .fxc-rate small { color: var(--ink2); font-size: 12px; }
.fxc { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; margin-top: 14px; }
.fxc .field { margin: 0; } .fxc-eq { padding-bottom: 14px; color: var(--ink3); } .fxc-eq .ic { width: 20px; height: 20px; }
.fxc-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.fxc-quick .btn { flex-direction: column; height: auto; padding: 8px; gap: 2px; line-height: 1.2; }
.fxc-quick small { color: var(--ink2); font-size: 11px; font-weight: 500; }
@media (max-width: 420px) { .fxc { grid-template-columns: minmax(0, 1fr); } .fxc-eq { display: none; } }
.line-h small span { color: var(--cyan); font-weight: 700; }
.tbl.cmp { width: 100%; table-layout: fixed; } .tbl.cmp td, .tbl.cmp th { overflow-wrap: anywhere; font-size: 13px; } .tbl.cmp td:first-child { width: 28%; }
/* customer balance at the POS */
.wal { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel2); display: grid; gap: 10px; min-width: 0; }
.wal.on { border-color: color-mix(in srgb, var(--green) 55%, var(--line2)); background: color-mix(in srgb, var(--green) 7%, var(--panel2)); }
.wal-h { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.wal-t { display: grid; gap: 2px; min-width: 0; }
.wal-t small { color: var(--green); font-weight: 700; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wal-t small .ic { width: 14px; height: 14px; }
.wal-in { gap: 10px; margin: 0; }
.wal-in .field { margin: 0; }
.wal-sum { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; border-top: 1px dashed var(--line2); padding-top: 10px; }
.wal-sum span { color: var(--ink2); font-weight: 600; }
.wal-sum b { color: var(--ink); }
.wal-sum em { flex-basis: 100%; font-style: normal; font-weight: 700; color: var(--green); }
.wal p { margin: 0; }
.totalbar.due { margin-top: -6px; padding-top: 8px; border-top: 1px dashed var(--line2); }
.totalbar.due b { font-size: 26px; color: var(--green); }
.wal-done { color: var(--green); }
.wal-done .ic { width: 16px; height: 16px; vertical-align: -3px; }
.chip .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.usdp { margin-bottom: 12px; padding: 12px; border: 1px dashed var(--line2); border-radius: var(--r); }
.usdp .field { margin: 0 0 6px; }
.usdp p { margin: 0; }
.stat-v .wal-line { display: block; overflow: hidden; text-overflow: ellipsis; }
.stat-v .wal-line + .wal-line { font-size: .8em; margin-top: 2px; }
