/*
Platform UI v3 "Workshop": warm concrete + white surfaces, graphite dock, Optinovus orange #F15A24 as the one accent (fills only, ink on it).
Spec: studio-ui/DESIGN.md. Themes: light on :root, dark on :root[data-theme="dark"] and on a dark phone unless data-theme="light".
Public customer pages set data-theme="light" and stay light.
Contrast (qa/contrast.mjs): ink on accent 5.42 · light muted #646770 4.65+ on every light surface · accent-ink #A6390A 5.4+ · dark muted #9A9DA4 5.8+ · field borders 3.2+.
Bulgarian letterforms: body sets "locl" 0 (standard Cyrillic shapes read better at UI sizes).
*/
:root {
  color-scheme: light;
  --bg: #F2F1EE;
  --surface: #FFFFFF;
  --surface-2: #EAE9E5;
  --surface-3: #E1E0DB;
  --line: #E2E0DB;
  --line-strong: #CFCDC7;
  --field: #7E8188;
  --ink: #141517;
  --ink-2: #43464C;
  --ink-3: #646770;

  --accent: #F15A24;
  --accent-hover: #F46C3B;
  --accent-ink: #A6390A;
  --accent-soft: rgb(241 90 36 / .13);
  --on-accent: #141517;

  --dock: #161719;
  --dock-ink: #F4F4F2;
  --dock-muted: #A1A3A8;
  --dock-on: rgb(255 255 255 / .13);
  --dock-line: transparent;

  --ok: #136B41;      --ok-soft: rgb(19 107 65 / .12);
  --warn: #7F4B00;    --warn-soft: rgb(196 120 0 / .16);
  --bad: #B42318;     --bad-soft: rgb(180 35 24 / .11);
  --bad-solid: #B42318; --on-bad: #FFFFFF;
  --star: #C98A00;
  --scrim: rgb(20 21 23 / .42);
  --overlay: rgb(20 21 23 / .72);
  --on-overlay: #FFFFFF;
  --plate: #FFFFFF; --plate-ink: #111214; --plate-eu: #1E3FA0;

  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font);
  --font-plate: 'Plate', 'Arial Narrow', var(--font);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-chip: 999px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 28px;
  --r-pill: 999px;

  --tap: 44px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --shadow-float: 0 2px 6px rgb(20 21 23 / .06), 0 12px 32px rgb(20 21 23 / .14);
  --shadow-thumb: 0 1px 2px rgb(20 21 23 / .1), 0 2px 8px rgb(20 21 23 / .06);

  --bg1: var(--surface); --bg2: var(--surface-2);
  --fg: var(--ink); --fg2: var(--ink-2); --fg3: var(--ink-3); --a: var(--accent);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0C0D; --surface: #17181B; --surface-2: #212327; --surface-3: #2A2C31;
  --line: #2A2C31; --line-strong: #383B41; --field: #6D7078;
  --ink: #F2F2F0; --ink-2: #C4C6CA; --ink-3: #9A9DA4;
  --accent-hover: #F46C3B; --accent-ink: #FF8A57; --accent-soft: rgb(241 90 36 / .18);
  --dock: #1E2023; --dock-on: rgb(255 255 255 / .1); --dock-line: rgb(255 255 255 / .06);
  --ok: #4CC38A;      --ok-soft: rgb(76 195 138 / .15);
  --warn: #F2B33D;    --warn-soft: rgb(242 179 61 / .15);
  --bad: #FF8078;     --bad-soft: rgb(255 128 120 / .15);
  --bad-solid: #FF8078; --on-bad: #141517;
  --star: #F2B33D;
  --scrim: rgb(0 0 0 / .6); --overlay: rgb(0 0 0 / .72);
  --shadow-float: 0 2px 6px rgb(0 0 0 / .4), 0 16px 40px rgb(0 0 0 / .5);
  --shadow-thumb: 0 1px 2px rgb(0 0 0 / .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0C0D; --surface: #17181B; --surface-2: #212327; --surface-3: #2A2C31;
    --line: #2A2C31; --line-strong: #383B41; --field: #6D7078;
    --ink: #F2F2F0; --ink-2: #C4C6CA; --ink-3: #9A9DA4;
    --accent-hover: #F46C3B; --accent-ink: #FF8A57; --accent-soft: rgb(241 90 36 / .18);
    --dock: #1E2023; --dock-on: rgb(255 255 255 / .1); --dock-line: rgb(255 255 255 / .06);
    --ok: #4CC38A;      --ok-soft: rgb(76 195 138 / .15);
    --warn: #F2B33D;    --warn-soft: rgb(242 179 61 / .15);
    --bad: #FF8078;     --bad-soft: rgb(255 128 120 / .15);
    --bad-solid: #FF8078; --on-bad: #141517;
    --star: #F2B33D;
    --scrim: rgb(0 0 0 / .6); --overlay: rgb(0 0 0 / .72);
    --shadow-float: 0 2px 6px rgb(0 0 0 / .4), 0 16px 40px rgb(0 0 0 / .5);
    --shadow-thumb: 0 1px 2px rgb(0 0 0 / .5);
  }
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; font-feature-settings: "locl" 0; }
button, input, select, textarea { font-feature-settings: "locl" 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "locl" 0; /* standard Cyrillic shapes */
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, textarea { caret-color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--font-display); text-wrap: balance; color: var(--ink); }
h1 { font-size: 32px; font-weight: 750; letter-spacing: -.025em; margin-bottom: 4px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 32px 0 12px; }
h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -.005em; }
b, strong { font-weight: 600; }
p { text-wrap: pretty; }
.muted { color: var(--ink-3); font-size: 14.5px; }
.sub { color: var(--ink-3); margin: 0 0 24px; font-size: 15px; }
.num { white-space: nowrap; }
.ic { flex: none; }

/* buttons: primary = orange fill + ink; secondary = tonal fill, no border; ghost + bad = text */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--r);
  border: 0; background: var(--surface-2); color: var(--ink);
  font: 650 16px/1 var(--font); letter-spacing: -.005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease), opacity 160ms var(--ease);
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--accent); color: var(--on-accent); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ghost, .btn.bad { background: transparent; padding: 0 12px; }
.btn.ghost { color: var(--accent-ink); }
.btn.bad { color: var(--bad); }
.btn.sm { min-height: var(--tap); padding: 0 16px; font-size: 14.5px; border-radius: 12px; }
.btn.sm svg { width: 18px; height: 18px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-3); }
  .btn.pri:hover { background: var(--accent-hover); }
  .btn.ghost:hover, .btn.bad:hover { background: var(--surface-2); }
}

/* forms */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 18px 0 8px; }
input, select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--field); background: var(--surface); color: var(--ink);
  font: 400 16px/1.3 var(--font);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[disabled], textarea[disabled], select[disabled] { background: var(--surface-2); border-color: transparent; color: var(--ink-2); -webkit-text-fill-color: var(--ink-2); opacity: 1; }
input[type=checkbox] { width: 24px; min-height: 24px; height: 24px; accent-color: var(--accent); flex: none; }
input[type=color] { padding: 4px; }
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-cancel-button { display: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 256 256' fill='%238A8D93'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 44px; }
input[type=file] { padding: 12px; }

/* surfaces: no borders; a surface sits on the concrete bg by colour step */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; margin-bottom: 12px; }
.card.tap { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: background-color 160ms var(--ease); }
.card.tap:active { background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .card.tap:hover { background: var(--surface-2); } }

/* small controls */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-pill); border: 0; background: var(--surface-2); color: var(--ink);
  font: 600 14.5px/1.2 var(--font); cursor: pointer; text-decoration: none;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease);
}
.chip:active { transform: scale(.97); }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 6px 10px 6px 9px; min-height: 24px;
  border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.a { background: var(--accent-soft); color: var(--accent-ink); }

/* layout helpers */
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.grid2 > *, .grid4 > * { min-width: 0; }
input[type=date], input[type=time] { min-width: 0; max-width: 100%; }

/* monogram + wordmark */
.mono { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font: 800 22px/1 var(--font); letter-spacing: -.04em; }
.wordmark { font: 750 21px/1 var(--font); letter-spacing: -.03em; color: var(--ink); }

/* licence plate: a white EU plate with the blue BG strip, in any theme */
.plate {
  display: inline-flex; align-items: stretch; vertical-align: middle; height: 24px; flex: none;
  background: var(--plate); color: var(--plate-ink); border: 1.5px solid var(--plate-ink); border-radius: 4px; overflow: hidden;
  font: 600 16px/1 var(--font-plate); letter-spacing: .04em; white-space: nowrap; font-variant-numeric: normal;
}
.plate::before { content: "BG"; display: flex; align-items: flex-end; justify-content: center; width: 11px; padding-bottom: 2px; background: var(--plate-eu); color: #fff; font: 700 6px/1 var(--font); letter-spacing: 0; }
.plate > span { display: flex; align-items: center; padding: 1px 6px 0 5px; }
.plate.md { height: 30px; font-size: 20px; border-width: 2px; border-radius: 5px; }
.plate.md::before { width: 14px; font-size: 7.5px; padding-bottom: 3px; }
.plate.md > span { padding: 1px 8px 0 7px; }
.plate.lg { height: 56px; font-size: 40px; border-width: 2.5px; border-radius: 8px; letter-spacing: .05em; }
.plate.lg::before { width: 26px; font-size: 12px; padding-bottom: 6px; }
.plate.lg > span { padding: 3px 14px 0 12px; }
.plate.none { background: transparent; color: var(--ink-3); border: 1.5px dashed var(--line-strong); font: 600 12px/1 var(--font); letter-spacing: 0; }
.plate.none::before { display: none; }
.plate.lg.none { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
  .btn:active, .chip:active, .act:active { transform: none !important; }
}
[hidden] { display: none !important; }
