/* HiRO design system: the tokens and hi-* parts the redesigned station pages share (dashboard,
   fuel delivery journal, actual daily dip). Global rather than scoped because the parts are drawn by
   several components on each page. Source of truth: the HiRO Design System artifact
   (claude.ai/artifact/LsvKmDYfA8yvbELYo5UN8d). Light values first, dark under data-bs-theme="dark". */

.hi-root {
    --hi-bg: #f5f5f5; --hi-surface: #ffffff; --hi-surface-sunken: #fafafa; --hi-line: #e5e5e5; --hi-line-strong: #d4d4d4;
    --hi-ink: #171717; --hi-ink-muted: #5c5c5c;
    --hi-primary: #066fd1; --hi-primary-strong: #0559a8; --hi-on-primary: #ffffff; --hi-focus: #066fd1;
    --hi-good: #2fb344; --hi-good-ink: #1b6b2b; --hi-good-soft: #e8f5eb;
    --hi-warn: #f76707; --hi-warn-ink: #a84400; --hi-warn-soft: #fff1e6; --hi-on-warn: #1a0d03;
    --hi-bad: #d63939; --hi-bad-ink: #b02525; --hi-bad-soft: #fcebeb;
    --hi-fuel-primax95: #f59f00; --hi-fuel-primax97: #0ca678; --hi-fuel-diesel: #525252; --hi-fuel-euro5: #4299e1;
    /* the four papers of one delivery: order, delivery, PDB's invoice, the bank's auto-debit */
    --hi-b-order: #066fd1; --hi-b-order-soft: #e7f0fa;
    --hi-b-dn: #1c91c9; --hi-b-dn-soft: #e6f4fa;
    --hi-b-inv: #ae3ec9; --hi-b-inv-soft: #f6eafa;
    --hi-b-pay: #2fb344; --hi-b-pay-ink: #1b6b2b; --hi-b-pay-soft: #e8f5eb;
    --hi-font-sans: var(--tblr-font-sans-serif, "IBM Plex Sans", system-ui, sans-serif);
    --hi-font-mono: var(--tblr-font-monospace, "IBM Plex Mono", ui-monospace, Menlo, monospace);
    --hi-space-1: 4px; --hi-space-2: 8px; --hi-space-3: 12px; --hi-space-4: 16px; --hi-space-5: 24px; --hi-space-6: 32px; --hi-space-7: 48px;
    --hi-radius-sm: 4px; --hi-radius-md: 8px; --hi-radius-lg: 12px; --hi-radius-pill: 999px;
    color: var(--hi-ink);
}

:root[data-bs-theme="dark"] .hi-root {
    --hi-bg: #171717; --hi-surface: #262626; --hi-surface-sunken: #1f1f1f; --hi-line: #383838; --hi-line-strong: #4a4a4a;
    --hi-ink: #f5f5f5; --hi-ink-muted: #a3a3a3;
    --hi-primary: #4a9bea; --hi-primary-strong: #6aaef0; --hi-on-primary: #0b1a2b; --hi-focus: #6aaef0;
    --hi-good-ink: #6fd383; --hi-good-soft: #183a20; --hi-warn-ink: #ffa261; --hi-warn-soft: #3a2414;
    --hi-bad: #e05252; --hi-bad-ink: #f58a8a; --hi-bad-soft: #3d1b1b;
    --hi-fuel-primax95: #f5a623; --hi-fuel-primax97: #20c997; --hi-fuel-diesel: #a3a3a3; --hi-fuel-euro5: #5aa9eb;
    --hi-b-order: #4a9bea; --hi-b-order-soft: #162838;
    --hi-b-dn: #3fb0e0; --hi-b-dn-soft: #13303b;
    --hi-b-inv: #c76fdd; --hi-b-inv-soft: #2f1c36;
    --hi-b-pay: #3cc455; --hi-b-pay-ink: #6fd383; --hi-b-pay-soft: #183a20;
}

/* HiRO components — plain CSS classes over tokens.css. Prefix hi- (hr- is taken by Human Resources). */

.hi-root {
  background: var(--hi-bg);
  color: var(--hi-ink);
  font-family: var(--hi-font-sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

.hi-num { font-variant-numeric: tabular-nums; }
.hi-mono { font-family: var(--hi-font-mono); font-size: 13px; letter-spacing: 0; }
.hi-muted { color: var(--hi-ink-muted); }

/* ── Card ─────────────────────────────────────────── */
.hi-card {
  background: var(--hi-surface);
  border: 1px solid var(--hi-line);
  border-radius: var(--hi-radius-lg);
  padding: var(--hi-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--hi-space-4);
  min-width: 0;
}
.hi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hi-space-3);
  flex-wrap: wrap;
}
.hi-card-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.hi-card-meta { color: var(--hi-ink-muted); font-size: 12px; line-height: 16px; }

/* Section label above a group of cards */
.hi-section {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hi-ink-muted);
}

/* ── Buttons ──────────────────────────────────────── */
.hi-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--hi-space-2);
  height: 36px;
  padding: 0 var(--hi-space-4);
  border-radius: var(--hi-radius-md);
  border: 1px solid var(--hi-line-strong);
  background: var(--hi-surface);
  color: var(--hi-ink);
  font: 500 14px/20px var(--hi-font-sans);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.hi-btn:hover { background: var(--hi-surface-sunken); }
.hi-btn:focus-visible { outline: 2px solid var(--hi-focus); outline-offset: 2px; }
.hi-btn svg { width: 16px; height: 16px; flex: none; }
.hi-btn.is-primary { background: var(--hi-primary); border-color: var(--hi-primary); color: var(--hi-on-primary); }
.hi-btn.is-primary:hover { background: var(--hi-primary-strong); }
.hi-btn.is-quiet { border-color: transparent; background: transparent; color: var(--hi-ink-muted); padding: 0 var(--hi-space-2); }
.hi-btn.is-quiet:hover { color: var(--hi-ink); background: var(--hi-surface-sunken); }
.hi-btn.is-small { height: 30px; padding: 0 var(--hi-space-3); font-size: 13px; }
.hi-btn.is-icon { width: 36px; padding: 0; justify-content: center; }

/* ── Status pill: a state, never a number ─────────── */
.hi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--hi-radius-pill);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--hi-surface-sunken);
  color: var(--hi-ink-muted);
}
.hi-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hi-pill.is-good { background: var(--hi-good-soft); color: var(--hi-good-ink); }
.hi-pill.is-warn { background: var(--hi-warn-soft); color: var(--hi-warn-ink); }
.hi-pill.is-bad { background: var(--hi-bad-soft); color: var(--hi-bad-ink); }
.hi-pill.is-plain::before { display: none; }

/* ── Fuel tag: the fuel's colour as a square, the name in ink ── */
.hi-fuel {
  display: inline-flex;
  align-items: center;
  gap: var(--hi-space-2);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.hi-fuel::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--hi-fuel, var(--hi-ink-muted)); }
.fuel-primax95 { --hi-fuel: var(--hi-fuel-primax95); }
.fuel-primax97 { --hi-fuel: var(--hi-fuel-primax97); }
.fuel-diesel { --hi-fuel: var(--hi-fuel-diesel); }
.fuel-euro5 { --hi-fuel: var(--hi-fuel-euro5); }

/* ── Figure: label above, value, unit, one short note ── */
.hi-figure { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hi-figure-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--hi-ink-muted); }
.hi-figure-value { font-size: 20px; line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hi-figure-value small { font-size: 13px; font-weight: 500; color: var(--hi-ink-muted); margin-left: 3px; }
.hi-figure-note { font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); }
.hi-figure.is-hero .hi-figure-value { font-size: 36px; line-height: 40px; letter-spacing: -.01em; }
.hi-figure.is-hero .hi-figure-value small { font-size: 16px; }
.hi-figure.is-warn .hi-figure-value { color: var(--hi-warn-ink); }
.hi-figure.is-bad .hi-figure-value { color: var(--hi-bad-ink); }
.hi-figure-note.is-warn { color: var(--hi-warn-ink); }
.hi-figure-note.is-good { color: var(--hi-good-ink); }

/* ── Tank gauge ──────────────────────────────────── */
.hi-tanks { display: flex; gap: var(--hi-space-3); align-items: flex-end; }
.hi-tank { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; line-height: 14px; color: var(--hi-ink-muted); font-variant-numeric: tabular-nums; }
.hi-tank-body {
  position: relative;
  width: 26px;
  height: 56px;
  border-radius: 6px;
  border: 1px solid var(--hi-line-strong);
  background: var(--hi-surface-sunken);
  overflow: hidden;
}
.hi-tank-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--hi-fuel, var(--hi-ink-muted)); }
.hi-tank-safe { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--hi-ink-muted); }

/* ── Fuel card ───────────────────────────────────── */
.hi-fuelcard { gap: var(--hi-space-5); }
.hi-fuelcard-top { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--hi-space-4); }
.hi-fuelcard-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hi-space-4); padding-top: var(--hi-space-4); border-top: 1px solid var(--hi-line); }
.hi-price { font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); font-variant-numeric: tabular-nums; }
.hi-price b { color: var(--hi-ink); font-weight: 600; }

/* ── Needs line ─────────────────────────────────── */
.hi-needs {
  display: flex;
  align-items: center;
  gap: var(--hi-space-4);
  flex-wrap: wrap;
  padding: var(--hi-space-3) var(--hi-space-4);
  border-radius: var(--hi-radius-lg);
  background: var(--hi-warn-soft);
  color: var(--hi-ink);
}
.hi-needs-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--hi-radius-pill);
  background: var(--hi-warn); color: var(--hi-on-warn); font-weight: 600; font-size: 13px;
}
.hi-needs-title { font-weight: 600; }
.hi-needs-list { display: flex; flex-wrap: wrap; gap: var(--hi-space-2) var(--hi-space-5); flex: 1 1 400px; min-width: 0; }
.hi-needs-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hi-needs-item::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--hi-warn); }
.hi-needs-item.is-bad::before { background: var(--hi-bad); }

/* ── Ledger: money down a column, total ruled off ── */
.hi-ledger { display: flex; flex-direction: column; }
.hi-ledger-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--hi-space-4); padding: var(--hi-space-2) 0; }
.hi-ledger-row > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.hi-ledger-row small { display: block; color: var(--hi-ink-muted); font-size: 12px; line-height: 16px; }
.hi-ledger-row.is-total { border-top: 1px solid var(--hi-line); margin-top: var(--hi-space-1); padding-top: var(--hi-space-3); font-weight: 600; }
.hi-ledger-row.is-total > span:last-child { font-weight: 600; }
.hi-ledger-row.is-result { border-top: 2px solid var(--hi-ink); margin-top: var(--hi-space-2); padding-top: var(--hi-space-3); }
.hi-ledger-row.is-result > span:last-child { font-size: 24px; line-height: 30px; font-weight: 600; }

/* ── Table (the old dashboard's strength: fuels as columns) ── */
.hi-table-wrap { overflow-x: auto; }
.hi-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hi-table th, .hi-table td { padding: 10px var(--hi-space-3); text-align: right; border-bottom: 1px solid var(--hi-line); white-space: nowrap; }
.hi-table th:first-child, .hi-table td:first-child { text-align: left; color: var(--hi-ink-muted); font-weight: 400; }
.hi-table thead th { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--hi-ink-muted); border-bottom-color: var(--hi-line-strong); }
.hi-table tbody tr:last-child td { border-bottom: 0; }
.hi-table tr.is-key td { font-weight: 600; color: var(--hi-ink); }
.hi-table tr.is-key td:first-child { color: var(--hi-ink); }

/* ── Delivery row ───────────────────────────────── */
.hi-rows { display: flex; flex-direction: column; }
.hi-day { display: flex; gap: var(--hi-space-3); align-items: baseline; flex-wrap: wrap; padding: var(--hi-space-3) 0 var(--hi-space-2); border-bottom: 1px solid var(--hi-line); }
.hi-day b { font-weight: 600; }
.hi-day span { color: var(--hi-ink-muted); font-size: 12px; }
.hi-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(80px, .8fr) minmax(120px, 1.2fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: var(--hi-space-4);
  padding: var(--hi-space-3) 0;
  border-bottom: 1px solid var(--hi-line);
}
.hi-row:last-child { border-bottom: 0; }
.hi-row .hi-litres { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hi-dn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hi-dn .hi-mono { color: var(--hi-ink); }
.hi-dn small { color: var(--hi-ink-muted); font-size: 12px; line-height: 16px; }

/* ── motion: moving dashes = still waiting; a pulse = a rare money case that needs a look ── */
@keyframes hi-march { to { background-position: 24px 0; } }
@keyframes hi-dash { to { stroke-dashoffset: -24; } }
@keyframes hi-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 57, 57, .45); } 50% { box-shadow: 0 0 0 7px rgba(214, 57, 57, 0); } }
@keyframes hi-drive { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes hi-flow { to { stroke-dashoffset: -60; } }
.hi-wait { background-image: repeating-linear-gradient(90deg, var(--hi-wait-c, var(--hi-line-strong)) 0 8px, transparent 8px 12px); background-size: 24px 100%; animation: hi-march 1.2s linear infinite; }
.hi-pulse { animation: hi-pulse 1.8s ease-in-out infinite; }
.hi-drive { animation: hi-drive 2.4s ease-in-out infinite; }
.hi-svgdash { stroke-dasharray: 6 6; animation: hi-dash 1.2s linear infinite; }
.hi-flowline { stroke-dasharray: 2 18; stroke-linecap: round; animation: hi-flow 2.4s linear infinite; }
@media (prefers-reduced-motion: reduce) {
    .hi-wait, .hi-pulse, .hi-drive, .hi-svgdash, .hi-flowline { animation: none; }
}
/* a closing dialog waits for its running animations (top-layer.js); an endless one would hold it open 2 s */
dialog[data-closing] :is(.hi-wait, .hi-pulse, .hi-drive, .hi-svgdash, .hi-flowline) { animation: none; }

/* a fuel as its square mark: --hi-fuel is set by the page from the product's theme colour */
.hi-sq { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 4px; border-radius: 5px; font-size: 11px; font-weight: 700; background: var(--hi-fuel, var(--hi-ink-muted)); color: #fff; flex: none; box-sizing: border-box; }

/* ── Dialogs and side panels ──────────────────────────────────────────────────────────────────────
   A HiRO dialog draws its own head and footer: the component renders <div class="hi-root hi-dlg is-m">
   with .hi-dlg-head, .hi-dlg-body and .hi-dlg-foot, and the Tabler shell around it (modal or offcanvas)
   gives up its own header, padding and width. The head and the footer stay put while the body scrolls.
   Widths: is-s 520, is-m 640, is-l 760, is-xl 880. On a phone a modal becomes a sheet from the bottom. */
.modal-dialog:has(> .modal-content > .modal-body > .hi-dlg) { --hi-dlg-w: 640px; max-width: min(calc(100vw - 32px), var(--hi-dlg-w)); }
.modal-dialog:has(> .modal-content > .modal-body > .hi-dlg.is-s) { --hi-dlg-w: 520px; }
.modal-dialog:has(> .modal-content > .modal-body > .hi-dlg.is-l) { --hi-dlg-w: 760px; }
.modal-dialog:has(> .modal-content > .modal-body > .hi-dlg.is-xl) { --hi-dlg-w: 880px; }
.modal-content:has(> .modal-body > .hi-dlg) { border-radius: 16px; overflow: hidden; border-color: transparent !important; box-shadow: 0 24px 64px rgba(0, 0, 0, .28); }
.modal-content:has(> .modal-body > .hi-dlg) > .modal-header { display: none; }
.modal-body:has(> .hi-dlg) { padding: 0; }
.offcanvas:has(> .offcanvas-body > .hi-dlg) { --hi-dlg-w: 600px; width: min(100vw, var(--hi-dlg-w)) !important; border-left: 0; box-shadow: -24px 0 48px rgba(0, 0, 0, .18); }
.offcanvas:has(> .offcanvas-body > .hi-dlg.is-s) { --hi-dlg-w: 520px; }
.offcanvas:has(> .offcanvas-body > .hi-dlg.is-l) { --hi-dlg-w: 760px; }
.offcanvas:has(> .offcanvas-body > .hi-dlg) > .offcanvas-header { display: none; }
.offcanvas-body:has(> .hi-dlg) { padding: 0; display: flex; flex-direction: column; }
/* the panel grows with its content; shrunk to the body's height, the sticky head would scroll away with it */
.offcanvas-body > .hi-dlg { flex: 1 0 auto; }

.hi-dlg { display: flex; flex-direction: column; min-height: 100%; background: var(--hi-surface); }
.hi-dlg-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: flex-start; gap: var(--hi-space-4); padding: 24px 28px 20px; border-bottom: 1px solid var(--hi-line); background: var(--hi-surface); }
.hi-dlg-head > .t { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.hi-dlg-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--hi-ink-muted); }
.hi-dlg-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hi-dlg-c, var(--hi-primary)); }
.hi-dlg-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; color: var(--hi-ink); overflow-wrap: anywhere; }
.hi-dlg-title.is-mono { font-family: var(--hi-font-mono); font-size: 22px; }
.hi-dlg-sub { font-size: 14px; line-height: 20px; color: var(--hi-ink-muted); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* the words after a fuel square wrap beside it, so the square never sits alone on a line */
.hi-dlg-sub > .hi-sq + span:last-child { flex: 1 1 0; min-width: 0; }
.hi-dlg-x { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--hi-line); background: transparent; color: var(--hi-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.hi-dlg-x:hover { background: var(--hi-surface-sunken); }
.hi-dlg-x:focus-visible { outline: 2px solid var(--hi-focus); outline-offset: 2px; }
.hi-dlg-x svg { width: 18px; height: 18px; }
.hi-dlg-body { flex: 1; padding: 24px 28px 32px; display: flex; flex-direction: column; gap: 28px; }
.hi-dlg-foot { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: var(--hi-space-3); padding: 16px 28px; border-top: 1px solid var(--hi-line); background: var(--hi-surface); }
.hi-dlg-foot > .grow { flex: 1 1 auto; min-width: 0; }
.hi-dlg-foot .hi-btn { height: 44px; padding: 0 20px; }
.hi-dlg-foot .hi-btn.is-quiet { padding: 0 12px; }
.hi-dlg-missing { font-size: 13px; line-height: 18px; color: var(--hi-ink-muted); }
/* a long note wraps inside its own room instead of pushing the buttons onto a second line */
.hi-dlg-foot > .hi-dlg-missing { flex: 1 1 0; min-width: 0; }
@media (min-width: 576px) { .hi-dlg-foot > .hi-dlg-missing + .grow { flex: 0 0 0; } }
.hi-dlg-missing.is-ok { color: var(--hi-good-ink); }

.hi-dlg-sec { display: flex; flex-direction: column; gap: var(--hi-space-3); }
.hi-dlg-sec > h3 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--hi-ink-muted); letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.hi-dlg-sec > h3 > .grow { flex: 1; }
.hi-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 0; }
.hi-facts > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hi-facts dt { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--hi-ink-muted); }
.hi-facts dd { margin: 0; font-size: 15px; line-height: 22px; font-weight: 500; overflow-wrap: anywhere; }
.hi-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--hi-line); border-radius: var(--hi-radius-lg); overflow: hidden; }
.hi-figs > div { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--hi-line); min-width: 0; }
.hi-figs > div:first-child { border-left: 0; }
.hi-figs .k { font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); }
.hi-figs .v { font-size: 22px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hi-figs .s { font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); }
.hi-figs > .is-good { background: var(--hi-good-soft); }
.hi-figs > .is-good > * { color: var(--hi-good-ink); }
.hi-figs > .is-bad { background: var(--hi-bad-soft); }
.hi-figs > .is-bad > * { color: var(--hi-bad-ink); }
.hi-dtbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hi-dtbl th { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--hi-ink-muted); text-align: left; padding: 0 8px 8px 0; border-bottom: 1px solid var(--hi-line); }
.hi-dtbl td { padding: 12px 8px 12px 0; border-bottom: 1px solid var(--hi-line); font-size: 15px; line-height: 22px; vertical-align: middle; color: var(--hi-ink); }
.hi-dtbl th:last-child, .hi-dtbl td:last-child { padding-right: 0; }
.hi-dtbl .r { text-align: right; white-space: nowrap; }
.hi-dtbl small { display: block; font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); }
.hi-dtbl tfoot td { border-bottom: 0; font-weight: 600; }
.hi-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--hi-space-3); }
.hi-doc { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--hi-line); border-radius: var(--hi-radius-lg); background: var(--hi-surface-sunken); color: var(--hi-ink); text-decoration: none; min-height: 44px; min-width: 0; cursor: pointer; text-align: left; font: inherit; }
.hi-doc:hover { border-color: var(--hi-line-strong); color: var(--hi-ink); }
.hi-doc .n { font-size: 14px; line-height: 20px; font-weight: 600; }
.hi-doc .f { font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); font-family: var(--hi-font-mono); overflow-wrap: anywhere; }
.hi-doc.is-missing { border-style: dashed; background: transparent; color: var(--hi-bad-ink); justify-content: center; align-items: center; text-align: center; cursor: default; }
.hi-paper { width: 36px; height: 44px; flex: none; }
.hi-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hi-field > label, .hi-field > .l { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--hi-ink); }
.hi-field .help { font-size: 12px; line-height: 16px; color: var(--hi-ink-muted); }
.hi-field .help.is-bad { color: var(--hi-bad-ink); }
.hi-field .help.is-warn { color: var(--hi-warn-ink); }
.hi-input { height: 44px; border-radius: 10px; border: 1px solid var(--hi-line-strong); background: var(--hi-surface); color: var(--hi-ink); font: inherit; font-size: 15px; padding: 0 14px; box-sizing: border-box; width: 100%; min-width: 0; }
.hi-input:focus { outline: 2px solid var(--hi-focus); outline-offset: 1px; border-color: var(--hi-focus); }
.hi-input[readonly], .hi-input:disabled { background: var(--hi-surface-sunken); color: var(--hi-ink-muted); border-style: dashed; }
.hi-input.is-big { height: 56px; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hi-input.is-mono { font-family: var(--hi-font-mono); letter-spacing: .02em; }
.hi-input.is-bad { border-color: var(--hi-bad); }
textarea.hi-input { height: auto; min-height: 88px; padding: 10px 14px; resize: vertical; }
select.hi-input { appearance: auto; }
.hi-unit { position: relative; display: block; }
.hi-unit > .hi-input { padding-right: 40px; }
.hi-unit > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--hi-ink-muted); pointer-events: none; }
.hi-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.hi-grid2 > .is-wide { grid-column: 1 / -1; }
.hi-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--hi-surface-sunken); border: 1px solid var(--hi-line); flex-wrap: wrap; }
.hi-seg > button { height: 38px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--hi-ink-muted); font: inherit; font-weight: 600; cursor: pointer; }
.hi-seg > button.is-on { background: var(--hi-surface); color: var(--hi-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.hi-seg > button:focus-visible { outline: 2px solid var(--hi-focus); outline-offset: 1px; }
.hi-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 20px; background: var(--hi-surface-sunken); border: 1px solid var(--hi-line); color: var(--hi-ink); }
.hi-note > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.hi-note.is-warn { background: var(--hi-warn-soft); border-color: transparent; color: var(--hi-warn-ink); }
.hi-note.is-bad { background: var(--hi-bad-soft); border-color: transparent; color: var(--hi-bad-ink); }
.hi-note.is-good { background: var(--hi-good-soft); border-color: transparent; color: var(--hi-good-ink); }
.hi-more { border: 1px solid var(--hi-line); border-radius: var(--hi-radius-lg); }
.hi-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; font-weight: 600; }
.hi-more > summary::-webkit-details-marker { display: none; }
.hi-more > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--hi-ink-muted); border-bottom: 2px solid var(--hi-ink-muted); transform: rotate(45deg); transition: transform .15s; }
.hi-more[open] > summary::after { transform: rotate(-135deg); }
.hi-more > summary small { font-weight: 400; color: var(--hi-ink-muted); }
.hi-more > .in { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 575.98px) {
    .modal:has(.hi-dlg) { padding: 0 !important; }
    .modal-dialog:has(> .modal-content > .modal-body > .hi-dlg) { position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; margin: 0; max-width: none; width: 100%; height: auto; max-height: 94dvh; }
    .modal-dialog:has(> .modal-content > .modal-body > .hi-dlg) > .modal-content { border-radius: 20px 20px 0 0; height: auto; max-height: 94dvh; }
    .hi-dlg-head { padding: 22px 16px 14px; }
    .modal-body > .hi-dlg > .hi-dlg-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--hi-line-strong); }
    .hi-dlg-title { font-size: 19px; line-height: 24px; }
    .hi-dlg-body { padding: 18px 16px 24px; gap: 22px; }
    .hi-dlg-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
    .hi-dlg-foot > .grow { flex-basis: 100%; }
    .hi-dlg-foot .hi-btn:not(.is-quiet) { flex: 1; justify-content: center; height: 48px; }
    .hi-grid2, .hi-facts { grid-template-columns: minmax(0, 1fr); }
    .hi-figs { grid-template-columns: minmax(0, 1fr); }
    .hi-figs > div { border-left: 0; border-top: 1px solid var(--hi-line); flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
    .hi-figs > div:first-child { border-top: 0; }
    .hi-figs .s { flex-basis: 100%; }
}
