/* NQAVA — styles (UI v3 "Apple Glass" + auto Halloween, see season.js)
   App shell: translucent macOS-style sidebar on tablets/desktop, icon rail on portrait tablets,
   top bar + bottom tab bar on phones. Tokens follow shadcn/ui naming
   (background, card, muted, border, ring, radius) mapped onto the app's own variables.
   Labels are still drawn as thermal paper in real millimetres (section untouched). */

@font-face { font-family: "Readex Pro"; font-weight: 160 700; font-display: swap;
  src: url("fonts/readex-pro-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Readex Pro"; font-weight: 160 700; font-display: swap;
  src: url("fonts/readex-pro-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Readex Pro"; font-weight: 160 700; font-display: swap;
  src: url("fonts/readex-pro-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); }

/* ---------- design tokens (Apple glass, NQAVA colours: same as the site and the dashboard) ---------- */
:root {
  /* one colour per settings topic, the same everywhere in the app */
  --c-etab: #2e3a52; --c-label: #0055a6; --c-temp: #2f7fd6; --c-oil: #c27c0e; --c-prod: #2f9e5b; --c-team: #d6407f; --c-device: #6b6b75; --c-data: #4f46c8;
  /* shadcn-style semantic tokens, Apple values: translucent materials over a soft gradient mesh */
  --background: #f3f3f4; --card: rgba(255, 255, 255, .72); --popover: rgba(255, 255, 255, .9); --muted-bg: rgba(110, 110, 120, .09);
  --foreground: #1b1b1e; --heading: #2e3a52; --muted-foreground: #66666e; --border: rgba(27, 27, 30, .09); --input: rgba(27, 27, 30, .16);
  --primary: #0055a6; --primary-2: #1565c0; --primary-foreground: #ffffff; --primary-soft: rgba(0, 85, 166, .09);
  --ring: rgba(0, 85, 166, .28); --saffron: #3d8be0; --field: rgba(255, 255, 255, .85);
  --mesh:
    radial-gradient(900px 620px at 100% -10%, rgba(140, 190, 242, .17), transparent 62%),
    radial-gradient(820px 600px at -6% 0%, rgba(0, 85, 166, .1), transparent 60%),
    radial-gradient(900px 700px at 60% 115%, rgba(61, 139, 224, .08), transparent 62%),
    linear-gradient(180deg, #f6f6f7, #ececee);
  --brand-grad: linear-gradient(140deg, #1565c0 0%, #0055a6 100%);
  --glass-blur: saturate(180%) blur(24px); --hairline-hi: rgba(255, 255, 255, .7); --glow: 0 0 0 transparent;
  /* app variables (used across the app scripts) — mapped to the tokens above */
  --bg: var(--background); --surface: var(--card); --surface-2: var(--muted-bg); --ink: var(--foreground);
  --muted: var(--muted-foreground); --line: var(--border); --accent: var(--primary); --accent-ink: var(--primary-foreground);
  --accent-soft: var(--primary-soft);
  --danger: #d33a2c; --danger-soft: rgba(255, 59, 48, .1); --warn: #a8650a; --warn-soft: rgba(255, 159, 10, .14); --ok: #1f8a3b; --ok-soft: rgba(52, 199, 89, .14);
  --paper: #fdfdfb; --paper-ink: #111111; --scrim: rgba(15, 20, 28, .32);
  /* sidebar: macOS-style translucent source list */
  --side-bg: rgba(255, 255, 255, .5); --side-fg: var(--foreground); --side-muted: var(--muted-foreground); --side-strong: var(--foreground);
  --side-line: rgba(15, 23, 42, .08); --side-hover: rgba(118, 118, 128, .12); --side-active: rgba(255, 255, 255, .9);
  --side-btn: rgba(255, 255, 255, .6); --side-accent: var(--primary);
  /* depth */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05); /* flat, Apple-like: no coloured or wide drop shadow */
  --shadow-lg: 0 30px 70px -20px rgba(15, 23, 42, .35), 0 0 0 .5px rgba(15, 23, 42, .08);
  --primary-grad: linear-gradient(180deg, var(--primary-2), var(--primary));
  --glass: rgba(246, 248, 250, .7); --dock: rgba(30, 32, 36, .74);
  --f-ui: "Geist", "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --f-label: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; /* labels keep the font their sizes were measured with */
  --f-mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 16px; --r-sm: 12px; --r-lg: 24px; --tap: 48px;
  --side-w: 0px; --nav-h: 0px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --c-etab: #8ea3c8; --c-label: #6aa6f0; --c-temp: #6aaef0; --c-oil: #f0b44a; --c-prod: #5fcf8a; --c-team: #f08bb5; --c-device: #a6a3b0; --c-data: #9a93f5;
  --background: #141317; --card: rgba(34, 32, 40, .62); --popover: rgba(36, 34, 42, .9); --muted-bg: rgba(140, 130, 160, .16);
  --foreground: #f2f1f5; --heading: var(--foreground); --muted-foreground: #a6a3b0; --border: rgba(255, 255, 255, .09); --input: rgba(255, 255, 255, .16);
  --primary: #6aa6f0; --primary-2: #8dbbf4; --primary-foreground: #06213f; --primary-soft: rgba(106, 166, 240, .16);
  --ring: rgba(106, 166, 240, .32); --field: rgba(255, 255, 255, .06); --saffron: #8dbbf4;
  --mesh:
    radial-gradient(900px 620px at 100% -10%, rgba(140, 190, 242, .18), transparent 62%),
    radial-gradient(820px 600px at -6% 0%, rgba(30, 110, 200, .2), transparent 60%),
    linear-gradient(180deg, #17161b, #111014);
  --hairline-hi: rgba(255, 255, 255, .06);
  --danger: #ff6b5e; --danger-soft: rgba(255, 69, 58, .16); --warn: #ffb340; --warn-soft: rgba(255, 159, 10, .16); --ok: #4cd47a; --ok-soft: rgba(48, 209, 88, .15);
  --scrim: rgba(0, 0, 0, .5);
  --side-bg: rgba(24, 26, 30, .55); --side-strong: #ffffff; --side-line: rgba(255, 255, 255, .08); --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .1); --side-btn: rgba(255, 255, 255, .06); --side-accent: var(--primary-2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 30px 70px -16px rgba(0, 0, 0, .75), 0 0 0 .5px rgba(255, 255, 255, .1); --glass: rgba(12, 14, 17, .66);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --c-etab: #8ea3c8; --c-label: #6aa6f0; --c-temp: #6aaef0; --c-oil: #f0b44a; --c-prod: #5fcf8a; --c-team: #f08bb5; --c-device: #a6a3b0; --c-data: #9a93f5;
  --background: #141317; --card: rgba(34, 32, 40, .62); --popover: rgba(36, 34, 42, .9); --muted-bg: rgba(140, 130, 160, .16);
  --foreground: #f2f1f5; --heading: var(--foreground); --muted-foreground: #a6a3b0; --border: rgba(255, 255, 255, .09); --input: rgba(255, 255, 255, .16);
  --primary: #6aa6f0; --primary-2: #8dbbf4; --primary-foreground: #06213f; --primary-soft: rgba(106, 166, 240, .16);
  --ring: rgba(106, 166, 240, .32); --field: rgba(255, 255, 255, .06); --saffron: #8dbbf4;
  --mesh:
    radial-gradient(900px 620px at 100% -10%, rgba(140, 190, 242, .18), transparent 62%),
    radial-gradient(820px 600px at -6% 0%, rgba(30, 110, 200, .2), transparent 60%),
    linear-gradient(180deg, #17161b, #111014);
  --hairline-hi: rgba(255, 255, 255, .06);
  --danger: #ff6b5e; --danger-soft: rgba(255, 69, 58, .16); --warn: #ffb340; --warn-soft: rgba(255, 159, 10, .16); --ok: #4cd47a; --ok-soft: rgba(48, 209, 88, .15);
  --scrim: rgba(0, 0, 0, .5);
  --side-bg: rgba(24, 26, 30, .55); --side-strong: #ffffff; --side-line: rgba(255, 255, 255, .08); --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .1); --side-btn: rgba(255, 255, 255, .06); --side-accent: var(--primary-2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 30px 70px -16px rgba(0, 0, 0, .75), 0 0 0 .5px rgba(255, 255, 255, .1); --glass: rgba(12, 14, 17, .66);
  color-scheme: dark; }
/* Auto Halloween (season.js sets data-season from the device date, Oct 25–31): dark glass + warm orange light.
   html:root wins over the light/dark rules above, whatever theme the user picked. */
html:root[data-season="halloween"] {
  --c-etab: #8ea3c8; --c-label: #b49ae6; --c-temp: #6aaef0; --c-oil: #f0b44a; --c-prod: #5fcf8a; --c-team: #f08bb5; --c-device: #a6a3b0; --c-data: #9a93f5;
  --background: #0a0709; --card: rgba(36, 26, 24, .55); --popover: rgba(38, 28, 26, .86); --muted-bg: rgba(255, 170, 110, .08);
  --heading: var(--foreground); --foreground: #f6eee8; --muted-foreground: #b39f94; --border: rgba(255, 170, 110, .13); --input: rgba(255, 170, 110, .2);
  --primary: #f2771f; --primary-2: #ffb04d; --primary-foreground: #1f0d02; --primary-soft: rgba(255, 138, 42, .16);
  --ring: rgba(255, 138, 42, .35); --saffron: #ffb04d; --field: rgba(255, 220, 190, .05);
  --mesh:
    radial-gradient(900px 620px at 10% -10%, rgba(255, 122, 26, .3), transparent 62%),
    radial-gradient(760px 560px at 104% 6%, rgba(140, 60, 220, .17), transparent 60%),
    radial-gradient(1000px 720px at 60% 116%, rgba(255, 90, 20, .2), transparent 62%),
    linear-gradient(180deg, #0d090a, #070506);
  --brand-grad: linear-gradient(140deg, #ffc061 0%, #f2771f 55%, #9c3a0a 100%);
  --hairline-hi: rgba(255, 200, 150, .08); --glow: 0 0 22px -4px rgba(255, 122, 26, .55);
  --danger: #ff6b5e; --danger-soft: rgba(255, 69, 58, .16); --warn: #ffc14d; --warn-soft: rgba(255, 170, 30, .14); --ok: #7fdc6a; --ok-soft: rgba(110, 210, 90, .14);
  --scrim: rgba(5, 2, 3, .55);
  --side-bg: rgba(22, 15, 14, .55); --side-fg: var(--foreground); --side-muted: var(--muted-foreground); --side-strong: #fff4ea;
  --side-line: rgba(255, 170, 110, .1); --side-hover: rgba(255, 170, 110, .07); --side-active: rgba(255, 138, 42, .14);
  --side-btn: rgba(255, 220, 190, .05); --side-accent: #ffa340;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 1px 1px rgba(0, 0, 0, .35), 0 12px 30px -12px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -16px rgba(0, 0, 0, .8), 0 0 0 .5px rgba(255, 170, 110, .14); --glass: rgba(14, 9, 9, .66); --dock: rgba(30, 20, 18, .76);
  color-scheme: dark; }
/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui);
  font-size: 15px; line-height: 1.5; -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overscroll-behavior: none;
  background-image: var(--mesh); background-attachment: fixed; }
button, input, select { font: inherit; color: inherit; }
/* Fields are at least 16px: below that, iPad and iPhone browsers zoom the page in on a tap and it then slides sideways. */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { font-size: max(16px, 1em); }
button, label, select, [data-act] { touch-action: manipulation; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; color: var(--heading); line-height: 1.2; text-wrap: balance; font-weight: 600; letter-spacing: -.01em; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* ---------- buttons (shadcn: default / outline / ghost / destructive) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
  padding: 8px 16px; border-radius: var(--r-sm); font-weight: 500; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn.primary { background: var(--primary-grad); border-color: transparent; color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 0, 0, .12); }
.btn.big { min-height: 54px; font-size: 16.5px; padding-inline: 22px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; box-shadow: none; }
.btn.danger.armed { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 0; width: 42px; }
.btn:disabled { opacity: .45; cursor: default; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--surface-2); }
  .btn.primary:hover:not(:disabled) { background: var(--primary-grad); filter: brightness(1.06); }
  .btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
  .btn.danger:hover:not(:disabled) { background: var(--danger-soft); }
  .btn.danger.armed:hover { background: var(--danger); }
}

/* ---------- app shell ---------- */
.top { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); }
.top-in { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { position: relative; width: 40px; height: 40px; border-radius: 12px; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff;
  background: var(--brand-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--glow); }
.brand-logo::after { content: ""; position: absolute; top: 6px; inset-inline-end: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 2px rgba(0, 0, 0, .12); }
.brand-logo:has(img)::after { display: none; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-logo img.app-icon { object-fit: cover; background: none; }
.brand-logo svg { width: 22px; height: 22px; }
.brand-txt { min-width: 0; }
.brand-txt b { display: block; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; letter-spacing: -.01em; }
.brand-txt small { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
nav.tabs { display: flex; gap: 2px; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { position: relative; border: 0; background: none; color: var(--muted); font-weight: 500;
  white-space: nowrap; display: flex; align-items: center; gap: 12px; -webkit-user-select: none; user-select: none; }
.tab-ico { position: relative; display: grid; place-items: center; flex: none; }
.tab-ico .ico { width: 21px; height: 21px; }
nav.tabs .badge { position: absolute; top: -6px; inset-inline-end: -9px; min-width: 18px; height: 18px; display: grid; place-items: center;
  background: var(--danger); color: #fff; border-radius: 999px; font-size: 10.5px; padding: 0 5px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--badge-ring, var(--surface)); font-style: normal; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.who-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-style: normal;
  font-weight: 600; font-size: 13px; color: #fff; background: linear-gradient(140deg, var(--saffron), var(--primary)); }
/* nav groups: labelled in the wide sidebar, flat on the rail and the phone bar */
.nav-g { display: contents; }
.nav-gl { display: none; }
/* account button + menu */
.acct-wrap { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.acct { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 44px; padding: 6px 8px; border-radius: 14px;
  border: 1px solid var(--side-line, var(--line)); background: var(--side-btn, var(--surface)); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.acct-who { display: grid; line-height: 1.2; min-width: 0; }
.acct-who b, .acct-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who b { font-weight: 600; font-size: 14px; }
.acct-who small { color: var(--side-muted, var(--muted)); font-size: 12px; }
.acct > .ico { margin-inline-start: auto; width: 16px; height: 16px; color: var(--side-muted, var(--muted)); transform: rotate(-90deg); transition: transform .15s; }
.acct[aria-expanded="true"] > .ico { transform: rotate(90deg); }
.acct-menu { position: absolute; z-index: 40; display: grid; gap: 2px; padding: 8px; border-radius: 16px; color: var(--ink);
  /* solid: a blur inside the blurred sidebar does not work, text behind would show through */
  background: linear-gradient(var(--popover), var(--popover)), var(--background); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.acct-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; min-width: 0; }
.acct-head > div { min-width: 0; }
.acct-head b { display: block; }
.acct-head small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.mi > .ico { color: var(--muted); }
.mi-val { margin-inline-start: auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.mi.warn, .mi.warn > .ico { color: var(--danger); }
@media (hover: hover) { .mi:hover { background: var(--surface-2); } }
.demo-strip { position: relative; z-index: 21; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; text-align: center; font-size: 12.5px; padding: 5px 16px; font-weight: 500;
  color: var(--warn); background: repeating-linear-gradient(-45deg, var(--warn-soft) 0 12px, color-mix(in srgb, var(--warn-soft) 70%, var(--bg)) 12px 24px);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 18%, transparent); }
main.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 20px; padding-block: 0 140px; }

/* ----- sidebar layout (tablet landscape / desktop) ----- */
@media (min-width: 1024px) {
  :root { --side-w: 248px; }
  .top { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 30;
    background: var(--side-bg); color: var(--side-fg); --badge-ring: var(--background);
    box-shadow: inset -1px 0 0 var(--side-line); }
  [dir="rtl"] .top { box-shadow: inset 1px 0 0 var(--side-line); }
  .top-in { height: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 18px 14px calc(14px + var(--safe-b)); }
  .brand { padding: 4px 8px 20px; border-bottom: 1px solid var(--side-line); margin-bottom: 14px; }
  .brand-txt b { color: var(--side-strong); max-width: 150px; }
  .brand-txt small { color: var(--side-muted); }
  nav.tabs { flex-direction: column; flex: 1; overflow-y: auto; gap: 14px; }
  .nav-g { display: grid; gap: 3px; }
  .nav-gl { display: block; padding: 2px 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
  nav.tabs button { color: var(--side-muted); padding: 11px 12px; border-radius: 11px; font-size: 14.5px; text-align: start; }
  nav.tabs button[aria-current="true"] { color: var(--side-strong); background: var(--side-active);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
  nav.tabs button[aria-current="true"]::before { content: ""; position: absolute; inset-inline-start: -14px; top: 10px; bottom: 10px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--saffron); }
  [dir="rtl"] nav.tabs button[aria-current="true"]::before { border-radius: 3px 0 0 3px; }
  nav.tabs button[aria-current="true"] .tab-ico { color: var(--side-accent); }
  .top-actions { display: block; padding-top: 14px; border-top: 1px solid var(--side-line); }
  .acct-menu { inset-inline-start: 0; width: 290px; bottom: calc(100% + 8px); }
  .top .btn { background: var(--side-btn); border-color: var(--side-line); color: var(--side-fg); box-shadow: none; }
  .top .btn.ghost { background: transparent; border-color: transparent; }
  .demo-strip, .sens-alerts, main.wrap { margin-inline-start: var(--side-w); }
  main.wrap { max-width: none; padding-inline: max(28px, calc((100vw - var(--side-w) - 1180px) / 2)); }
}
@media (min-width: 1024px) and (hover: hover) {
  nav.tabs button:hover:not([aria-current="true"]) { background: var(--side-hover); color: var(--side-fg); }
  .top .btn:hover { background: var(--side-hover); }
}

/* ----- icon rail (portrait tablets) ----- */
@media (min-width: 700px) and (max-width: 1023px) {
  :root { --side-w: 92px; }
  .top { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 30;
    background: var(--side-bg); color: var(--side-fg); --badge-ring: var(--background); box-shadow: inset -1px 0 0 var(--side-line); }
  .top-in { height: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 16px 8px calc(12px + var(--safe-b)); }
  .brand { justify-content: center; padding-bottom: 16px; margin-bottom: 10px; border-bottom: 1px solid var(--side-line); }
  .brand-txt { display: none; }
  nav.tabs { flex-direction: column; flex: 1; overflow-y: auto; gap: 4px; }
  nav.tabs button { flex-direction: column; gap: 5px; padding: 9px 2px 8px; border-radius: 14px; color: var(--side-muted); font-size: 10.5px; line-height: 1.15; }
  .tab-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  nav.tabs button[aria-current="true"] { color: var(--side-strong); background: var(--side-active); }
  nav.tabs button[aria-current="true"] .tab-ico { color: var(--side-accent); }
  .nav-g { display: flex; flex-direction: column; gap: 4px; }
  .nav-g + .nav-g { border-top: 1px solid var(--side-line); padding-top: 6px; margin-top: 2px; }
  .top-actions { display: block; padding-top: 10px; border-top: 1px solid var(--side-line); }
  .acct-wrap { flex-direction: column; }
  .acct { flex: none; width: 100%; justify-content: center; padding: 6px; }
  .acct-who, .acct > .ico { display: none; }
  .acct-menu { bottom: 0; inset-inline-start: calc(100% + 10px); width: 290px; }
  .top .btn { background: var(--side-btn); border-color: var(--side-line); color: var(--side-fg); box-shadow: none; }
  .top .btn.ghost { background: transparent; border-color: transparent; }
  .demo-strip, main.wrap { margin-inline-start: var(--side-w); }
  main.wrap { padding-inline: 24px; }
}

/* ----- phone: compact top bar + bottom tab bar ----- */
@media (max-width: 699px) {
  :root { --nav-h: 64px; }
  .top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--glass);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
  .top-in { padding: 8px 12px 8px 14px; min-height: 58px; }
  .brand-logo { width: 36px; height: 36px; border-radius: 11px; }
  .brand-txt b { max-width: 130px; font-size: 15px; }
  .top-actions { margin-inline-start: auto; }
  .acct { flex: none; border: 0; background: none; padding: 4px; }
  .acct-who, .acct > .ico { display: none; }
  .acct-menu { top: calc(100% + 8px); inset-inline-end: 0; width: min(300px, calc(100vw - 24px)); }
  nav.tabs { position: fixed; z-index: 25; inset-inline: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b));
    padding: 6px 6px var(--safe-b); gap: 0; overflow-x: auto; overscroll-behavior-x: contain;
    background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid color-mix(in srgb, var(--line) 85%, transparent); }
  nav.tabs button { flex: 1 0 68px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; font-size: 10.5px; line-height: 1.1; border-radius: 12px; }
  .tab-ico { width: 52px; height: 30px; border-radius: 999px; transition: background-color .15s; }
  nav.tabs button[aria-current="true"] { color: var(--ink); font-weight: 600; }
  nav.tabs button[aria-current="true"] .tab-ico { background: var(--accent-soft); color: var(--accent); }
  nav.tabs .badge { top: -3px; inset-inline-end: 4px; --badge-ring: var(--bg); }
  main.wrap { padding-inline: 16px; padding-bottom: calc(150px + var(--nav-h) + var(--safe-b)); }
}

.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 28px 16px; }
.page-h h1 { font-size: 28px; font-weight: 650; letter-spacing: -.025em; }
.page-h p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 699px) { .page-h { padding-block: 18px 12px; } .page-h h1 { font-size: 26px; } }
/* settings hub: one coloured card per topic */
.set-group { margin-bottom: 22px; }
.set-group > h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 84px; padding: 16px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: inherit; font: inherit;
  text-align: start; cursor: pointer; transition: transform .15s; }
.tile b { display: block; font-size: 15px; font-weight: 600; }
.tile small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.tile .go { color: var(--muted); display: grid; }
.sq { --c: var(--primary); width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); }
.sq .ico { width: 24px; height: 24px; }
.sq.big { width: 54px; height: 54px; border-radius: 15px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 16px; padding: 0; border: 0; background: none;
  color: var(--primary); font: inherit; font-weight: 500; cursor: pointer; }
.back-link .ico { transform: scaleX(-1); }
[dir="rtl"] .back-link .ico { transform: none; }
[dir="rtl"] .tile .go .ico { transform: scaleX(-1); }
.page-h.set-h { justify-content: flex-start; align-items: center; flex-wrap: nowrap; padding-top: 6px; }
@media (hover: hover) { .tile:hover { transform: translateY(-1px); } }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel > h3 { font-size: 15.5px; margin-bottom: 16px; letter-spacing: -.005em; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .flabel { font-size: 13px; color: var(--ink); font-weight: 500; opacity: .82; }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .input, #cname {
  border: 1px solid var(--input); background: var(--surface); border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; min-height: 44px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .input:focus, #cname:focus, .tin input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
select { -webkit-appearance: none; appearance: none; padding-inline-end: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a9692' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
[dir="rtl"] select { background-position: left 10px center; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > input, .inline > select { flex: 1; min-width: 0; }
.err { color: var(--danger); font-size: 13px; min-height: 1.3em; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap;
  box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: none; padding: 7px 14px; min-height: 36px; color: var(--muted); font-weight: 500; border-radius: 9px; transition: background-color .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.algs { display: flex; flex-wrap: wrap; gap: 6px; }
.algs label { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; background: var(--surface); }
.algs label:has(input:checked) { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); color: var(--danger); }
.algs input { accent-color: var(--danger); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.switch input { width: 44px; height: 26px; accent-color: var(--accent); }

/* logo picker */
.logo-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-box { width: 84px; height: 84px; border-radius: 18px; border: 1.5px dashed var(--input);
  background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-box .ico { color: #9aa7a5; width: 30px; height: 30px; }
/* framing the logo (crop.js): the canvas is the real square frame; a checkerboard shows transparent parts */
.crop-cv { display: block; width: min(260px, 70vw); aspect-ratio: 1; margin: 0 auto; border-radius: 18px; background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 10px 26px -14px rgba(0, 0, 0, .35); touch-action: none; cursor: grab; }
.crop-cv:active { cursor: grabbing; }
.crop-cv.alpha { background: repeating-conic-gradient(#ececef 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.crop-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 13.5px;
  background: var(--warn-soft); color: var(--ink); }
.crop-warn[hidden] { display: none; }
.crop-warn .ico { width: 18px; height: 18px; flex: none; color: var(--warn); }

/* ---------- print screen ---------- */
.alert-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px;
  padding: 10px 12px 10px 14px; border-radius: var(--r); font-weight: 500; color: var(--danger);
  background: linear-gradient(90deg, var(--danger-soft), color-mix(in srgb, var(--danger-soft) 40%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-strip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent);
  background: linear-gradient(90deg, var(--warn-soft), color-mix(in srgb, var(--warn-soft) 40%, var(--surface))); }
.alert-strip .btn { margin-inline-start: auto; color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); background: var(--surface); box-shadow: none; }
.toolbar { display: grid; gap: 12px; padding-block: 18px 6px; }
main.wrap > .alert-strip:first-child { margin-top: 22px; }
.searchbox { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding-inline: 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring), var(--shadow); }
.searchbox .ico { color: var(--muted); }
.searchbox input { flex: 1; min-width: 0; border: 0; background: none; padding: 14px 0; outline: none; font-size: 16.5px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 16px; font-size: 14px; min-height: 38px; color: var(--ink); transition: background-color .15s; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .35); }
.letters { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.letters > span { font-size: 11.5px; color: var(--muted); margin-inline-end: 6px; text-transform: uppercase; letter-spacing: .08em; }
.letters button { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.letters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding-block: 10px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; min-width: 0;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .08s; }
.card:active { transform: scale(.985); }
.card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring), var(--shadow);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)), var(--surface) 70%); }
.card-hit { all: unset; cursor: pointer; display: grid; gap: 7px; padding: 15px; border-radius: 16px; -webkit-user-select: none; user-select: none; }
.card-hit:focus-visible { outline: 2px solid var(--accent); }
.card .nm { font-weight: 600; font-size: 15.5px; line-height: 1.25; padding-inline-end: 30px; letter-spacing: -.005em; }
.card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.life { font-family: var(--f-mono); font-size: 11.5px; font-weight: 700; background: var(--surface-2); padding: 2px 8px; border-radius: 7px; color: var(--ink); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.alg { font-size: 12px; color: var(--danger); }
.check { position: absolute; inset-inline-end: 12px; top: 13px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--input); display: grid; place-items: center; background: var(--surface); }
.check .ico { width: 14px; height: 14px; stroke-width: 3; }
.card.on .check { background: var(--primary-grad); border-color: transparent; color: var(--accent-ink); box-shadow: none; }
.stepper { display: flex; align-items: center; gap: 4px; margin: 0 15px 15px; padding: 4px; border-radius: 12px; background: var(--surface-2); align-self: flex-start; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 38px; height: 38px; border-radius: 9px; border: 0; background: var(--surface); font-size: 19px; font-weight: 600; box-shadow: var(--shadow-sm); }
.stepper button:active { background: var(--accent-soft); }
.stepper output { min-width: 32px; text-align: center; font-family: var(--f-mono); font-weight: 700; font-size: 17px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.selbar { position: fixed; z-index: 26; inset-inline: calc(var(--side-w) + 20px) 20px; bottom: calc(16px + var(--safe-b));
  max-width: 980px; margin-inline: auto; border-radius: 20px; padding: 10px 10px 10px 18px; color: #f2f1f5;
  background: linear-gradient(180deg, rgba(38, 36, 44, .94), rgba(22, 21, 26, .96));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .08); }
[dir="rtl"] .selbar { padding: 10px 18px 10px 10px; }
.selbar-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.selbar .count { font-weight: 600; font-size: 15px; }
.selbar .btn { background: rgba(255, 255, 255, .06); color: inherit; border-color: rgba(255, 255, 255, .14); box-shadow: none; }
.selbar .btn.primary { background: var(--primary-grad); color: var(--accent-ink); border-color: transparent; margin-inline-start: auto; border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
@media (max-width: 699px) {
  .selbar { inset-inline: 10px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); padding: 8px 8px 8px 14px; border-radius: 18px; }
  .selbar .btn.primary.big { min-height: 46px; font-size: 15px; padding-inline: 14px; }
  .selbar-in { flex-wrap: nowrap; gap: 8px; }
  .selbar .count { font-size: 12.5px; line-height: 1.25; flex: 1; min-width: 0; }
  .selbar .btn.primary { margin-inline-start: 0; }
  .alert-strip { flex-wrap: nowrap; font-size: 14px; line-height: 1.35; padding-block: 9px; }
  .alert-strip > span { flex: 1; min-width: 0; }
  .alert-strip .btn { flex: none; }
}

/* ---------- tracking ---------- */
.track-list { display: grid; gap: 10px; }
.trow { display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 14px 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
[dir="rtl"] .trow { padding: 14px 10px 14px 14px; }
.trow .stripe { align-self: stretch; background: var(--ok); border-radius: 4px; }
.trow.exp .stripe { background: var(--danger); }
.trow.soon .stripe { background: var(--warn); }
.trow.exp { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.trow .t-main { min-width: 0; display: grid; gap: 3px; }
.trow .t-main b { font-size: 15.5px; }
.trow .t-meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.trow .t-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }
.pill.exp { background: var(--danger-soft); color: var(--danger); }
.pill.soon { background: var(--warn-soft); color: var(--warn); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }
@media (max-width: 620px) { .trow { grid-template-columns: 4px 1fr; } .trow .t-acts { grid-column: 2; justify-content: flex-start; } }

/* ---------- tables, stats ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) { tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); } }
td .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--saffron)); opacity: .75; }
.stat b { display: block; font-family: var(--f-mono); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-bottom: 4px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.bad b { color: var(--danger); }
.stat.bad::before { background: var(--danger); }
.catlist { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.catlist span { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding-block: 4px; padding-inline: 12px 4px; font-size: 14px; }
.catlist button { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.catlist button:hover { background: var(--danger-soft); color: var(--danger); }
.role { font-size: 11.5px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.role.admin { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }

/* ---------- full-screen flows: setup + login ---------- */
.screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-inline: 16px;
  padding-block: calc(28px + env(safe-area-inset-top, 0px)) calc(28px + var(--safe-b));
  background:
    radial-gradient(700px 420px at 0% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%),
    radial-gradient(600px 380px at 100% 100%, color-mix(in srgb, var(--saffron) 16%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--mesh); background-attachment: fixed; }
.sheet { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 28px; display: grid; gap: 22px;
  box-shadow: var(--shadow-lg); }
@media (max-width: 520px) { .sheet { padding: 22px 18px; border-radius: 24px; gap: 18px; } }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sheet h2 { font-size: 23px; font-weight: 650; letter-spacing: -.02em; }
.sheet p { margin: 0; color: var(--muted); }
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.progress i.on { background: linear-gradient(90deg, var(--primary-2), var(--primary)); box-shadow: none; }
.starter-list { display: grid; gap: 8px; }
.starter-list label { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface); box-shadow: var(--shadow-sm); }
.starter-list label:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.starter-list input { width: 20px; height: 20px; accent-color: var(--accent); }
.starter-list small { margin-inline-start: auto; color: var(--muted); }
.users { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.users button { display: grid; justify-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 18px 10px 14px; box-shadow: var(--shadow-sm); transition: transform .08s, border-color .15s; }
.users button:active { transform: scale(.97); }
.users button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); box-shadow: 0 0 0 3px var(--ring); }
.avatar { width: 52px; height: 52px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 19px;
  background: linear-gradient(145deg, #1565c0, #0055a6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.users button:nth-child(4n+2) .avatar { background: linear-gradient(145deg, #f1b23e, #c9702a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.users button:nth-child(4n+3) .avatar { background: linear-gradient(145deg, #5d6c88, #2e3a52); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.users button:nth-child(4n+4) .avatar { background: linear-gradient(145deg, #f08bb5, #b83470); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.users small { color: var(--muted); font-size: 12px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; direction: ltr; padding-block: 4px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--input); transition: background-color .12s, transform .12s; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-dots.shake { animation: shake .35s; }
.pin-dots.shake i.on { background: var(--danger); border-color: var(--danger); }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .pin-dots.shake { animation: none; } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; direction: ltr; max-width: 300px; margin: 0 auto; width: 100%; }
.keypad button { height: 64px; border-radius: 20px; border: 0; background: var(--surface-2); font-family: var(--f-mono); font-size: 25px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(0, 0, 0, .03); transition: background-color .1s, transform .08s; }
.keypad button:active { background: var(--accent-soft); transform: scale(.96); }
.keypad .ghost { background: transparent; box-shadow: none; font-family: var(--f-ui); font-size: 14px; color: var(--muted); }
.center { text-align: center; }
.install-tip { display: flex; gap: 10px; align-items: center; border-radius: 14px; padding: 10px 12px; font-size: 13px;
  background: linear-gradient(100deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 30%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.install-tip .btn { margin-inline-start: auto; }

/* ---------- modal + toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: grid; place-items: center; padding: 16px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(920px, 100%); max-height: calc(100% - 16px); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal.narrow { width: min(460px, 100%); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h2 { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.modal-b { padding: 20px; overflow: auto; background: var(--surface-2); overscroll-behavior: contain; }
.modal.narrow .modal-b { background: var(--surface); display: grid; gap: 14px; }
.modal-f { padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
@media (max-width: 699px) {
  .overlay { place-items: end stretch; padding: 0; padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
  .modal, .modal.narrow, .modal.legal { width: 100%; max-height: 100%; border-radius: 24px 24px 0 0; border-inline: 0; border-bottom: 0; }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 5px; background: var(--input); margin: 8px auto 0; flex: none; }
  .modal-h { padding: 10px 18px 14px; }
  .modal-f { padding-inline: 16px; }
  .modal-f .btn { flex: 1; }
}
.toast { position: fixed; inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  bottom: calc(100px + var(--nav-h) + var(--safe-b)); z-index: 60; color: #f2f1f5;
  background: linear-gradient(180deg, rgba(38, 36, 44, .96), rgba(22, 21, 26, .98));
  padding: 11px 12px 11px 18px; border-radius: 16px; font-weight: 500; font-size: 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .08); }
@media (min-width: 700px) { .toast { inset-inline: var(--side-w) 0; max-width: calc(100% - var(--side-w) - 32px); } }
.toast .btn { min-height: 32px; padding: 2px 12px; background: var(--primary-grad); color: var(--accent-ink); border: 0; box-shadow: none; }

/* ---------- glass layer (Apple materials) ----------
   Big surfaces get a real backdrop blur; small repeated cards stay translucent without blur
   so long product grids keep scrolling smoothly on kitchen tablets. */
.panel, .sheet, .stat, .tfoot, .searchbox, .modal, .selbar, .toast, .demo-strip {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.panel, .card, .trow, .tcard, .task, .stat, .sheet, .searchbox, .users button, .starter-list label, .chips button, .btn:not(.primary):not(.ghost):not(.danger) {
  box-shadow: inset 0 1px 0 var(--hairline-hi), var(--shadow-sm); }
.panel, .stat, .sheet, .searchbox { box-shadow: inset 0 1px 0 var(--hairline-hi), var(--shadow); }
.panel, .card, .trow, .tcard, .task, .stat, .searchbox { border-radius: var(--r); }
.sheet { border-radius: 28px; background: var(--popover); }
.modal { background: var(--popover); border-color: var(--border); box-shadow: inset 0 1px 0 var(--hairline-hi), var(--shadow-lg); }
.modal-b { background: transparent; }
.modal-h, .modal-f, .modal-sub { border-color: var(--border); }
.overlay { -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%); }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .input, #cname, .tin input, .tact {
  background-color: var(--field); }
.chips button, .algs label { background: var(--field); }
.chips button[aria-pressed="true"] { background: var(--ink); }
.seg { background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--line); }
.seg button[aria-pressed="true"] { background: var(--popover); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px var(--line); }
.stepper button, .tin .pm { background: var(--popover); }
.urow, .snap { background: var(--surface-2); border-color: var(--line); }
.demo-strip { background: color-mix(in srgb, var(--warn-soft) 70%, transparent); border-bottom-color: var(--line); }
/* always visible way out of the demo, for every user (staff cannot open Settings) */
.demo-exit { font: inherit; font-weight: 600; color: var(--primary); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; min-height: 30px; cursor: pointer; }
.demo-exit:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.stat::before { background: linear-gradient(90deg, var(--primary-2), var(--primary)); }
.who-av { background: var(--brand-grad); }
.btn.primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .12), var(--glow); }
/* sidebar + rail as a macOS source list */
@media (min-width: 700px) {
  .top { background: var(--side-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: inset -.5px 0 0 var(--side-line), 8px 0 30px -20px rgba(0, 0, 0, .25); }
  [dir="rtl"] .top { box-shadow: inset .5px 0 0 var(--side-line), -8px 0 30px -20px rgba(0, 0, 0, .25); }
  nav.tabs button[aria-current="true"] { background: var(--side-active);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 0 0 .5px var(--side-line); }
  nav.tabs button[aria-current="true"]::before { display: none; }
  .who-av { box-shadow: var(--glow); }
}
/* phone: the floating bars become iOS materials */
@media (max-width: 699px) {
  nav.tabs { border-top: .5px solid var(--line); }
  .top::before { border-bottom: .5px solid var(--line); }
  nav.tabs button[aria-current="true"] .tab-ico { box-shadow: var(--glow); }
}
.selbar, .toast { background: var(--dock); border: .5px solid rgba(255, 255, 255, .12);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .1); }
/* Halloween light touches */
html:root[data-season="halloween"] nav.tabs button[aria-current="true"] .tab-ico { filter: drop-shadow(0 0 6px rgba(255, 138, 42, .7)); }
html:root[data-season="halloween"] .card.on { box-shadow: 0 0 0 3px var(--ring), var(--glow); }
html:root[data-season="halloween"] .page-h h1 { background: linear-gradient(90deg, #fff1e3, #ffb04d 70%, #f2771f);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
html:root[data-season="halloween"] .selbar, html:root[data-season="halloween"] .toast { border-color: rgba(255, 150, 60, .25); }
html:root[data-season="halloween"] .avatar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), var(--glow); }

/* ---------- Halloween decorations ----------
   Only while data-season="halloween" (see season.js): a glass jack-o'-lantern watermark in the page
   and in the top bar / sidebar, and a witch hat on the app logo. Inline SVG, works offline. */
html:root[data-season="halloween"] { --pumpkin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 112'%3E%3Cdefs%3E%3CradialGradient id='b' cx='.45' cy='.35' r='.75'%3E%3Cstop offset='0' stop-color='%23ffc46b'/%3E%3Cstop offset='.55' stop-color='%23f5841f'/%3E%3Cstop offset='1' stop-color='%23b84a08'/%3E%3C/radialGradient%3E%3CradialGradient id='f' cx='.5' cy='.5' r='.6'%3E%3Cstop offset='0' stop-color='%23fff4c2'/%3E%3Cstop offset='1' stop-color='%23ffc23d'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M58 22c-1-8 2-15 9-18l3 4c-5 3-6 8-5 14z' fill='%235b6b2a'/%3E%3Cpath d='M66 12c6-6 15-6 20-2-6 1-12 3-16 8z' fill='%237f9a35'/%3E%3Cellipse cx='38' cy='66' rx='31' ry='38' fill='url(%23b)'/%3E%3Cellipse cx='82' cy='66' rx='31' ry='38' fill='url(%23b)'/%3E%3Cellipse cx='60' cy='64' rx='27' ry='42' fill='url(%23b)'/%3E%3Cpath d='M60 24c-6 12-6 68 0 82M60 24c6 12 6 68 0 82' stroke='%23a8420a' stroke-opacity='.45' stroke-width='1.6' fill='none'/%3E%3Cpath d='M37 55l11-12 9 14zM83 55l-11-12-9 14z' fill='url(%23f)'/%3E%3Cpath d='M57 64l3-6 3 6z' fill='url(%23f)'/%3E%3Cpath d='M29 70Q60 106 91 70L83 75 78 69 71 77 65 71 60 77 55 71 49 77 42 69 37 75z' fill='url(%23f)'/%3E%3C/svg%3E"); --witch-hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 40'%3E%3Cellipse cx='24' cy='33' rx='22' ry='5.5' fill='%233a2350'/%3E%3Cpath d='M12 32c4-9 6-18 8-24 1-4 6-7 12-5-4 1-6 4-6 8l4 21z' fill='%234e2d6e'/%3E%3Cpath d='M13.5 28.5c6 2 15 2 19 .2l.9 3.6c-6 1.8-15 1.6-21.4-.4z' fill='%23ff8a2a'/%3E%3Crect x='21' y='28.6' width='5' height='4.4' rx='1' fill='none' stroke='%23ffd27a' stroke-width='1.2'/%3E%3C/svg%3E"); }
html:root[data-season="halloween"] body { isolation: isolate; }
html:root[data-season="halloween"] body::after { content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: min(62vw, 460px); aspect-ratio: 120 / 112; inset-inline-end: -4vw; bottom: calc(var(--nav-h) + 4vh);
  background: var(--pumpkin) center / contain no-repeat; opacity: .17; filter: drop-shadow(0 0 40px rgba(255, 122, 26, .6)); }
html:root[data-season="halloween"] .brand-logo { overflow: visible; }
html:root[data-season="halloween"] .brand-logo img { border-radius: inherit; }
html:root[data-season="halloween"] .brand-logo::after { display: block; width: 38px; height: 32px; top: -21px; inset-inline-end: auto; inset-inline-start: -9px;
  border-radius: 0; background: var(--witch-hat) center / contain no-repeat; box-shadow: none; transform: rotate(-18deg);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)) drop-shadow(0 0 6px rgba(160, 90, 255, .45)); }
[dir="rtl"]:root[data-season="halloween"] .brand-logo::after { transform: rotate(18deg) scaleX(-1); }
html:root[data-season="halloween"] .brand { padding-top: 10px; }
html:root[data-season="halloween"] .top-in { position: relative; isolation: isolate; }
@media (max-width: 699px) {
  html:root[data-season="halloween"] .brand { padding-top: 0; }
  html:root[data-season="halloween"] .top-in::before { content: ""; position: absolute; z-index: -1; pointer-events: none;
    width: 60px; height: 56px; inset-inline-start: calc(43% - 30px); top: calc(50% - 26px); transform: rotate(-6deg);
    background: var(--pumpkin) center / contain no-repeat; opacity: .38; filter: drop-shadow(0 0 14px rgba(255, 122, 26, .8)); }
}
@media (min-width: 700px) {
  html:root[data-season="halloween"] .top-in::after { content: ""; position: absolute; pointer-events: none; z-index: -1;
    width: min(150px, 80%); aspect-ratio: 120 / 112; inset-inline-start: 50%; bottom: 160px; transform: translateX(-50%) rotate(-8deg);
    background: var(--pumpkin) center / contain no-repeat; opacity: .18; filter: drop-shadow(0 0 30px rgba(255, 122, 26, .8)); }
  [dir="rtl"] html:root[data-season="halloween"] .top-in::after { transform: translateX(50%) rotate(8deg); }
}

/* ---------- labels (thermal paper, real millimetres) — unchanged ---------- */
.labels { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.lbl { --w: 62; --h: 40; --k: 1; width: calc(var(--w) * 1mm); height: calc(var(--h) * 1mm);
  background: var(--paper); color: var(--paper-ink); overflow: hidden; position: relative;
  padding: calc(1.6mm * var(--k)) calc(2mm * var(--k)); display: flex; flex-direction: column; gap: calc(.5mm * var(--k));
  font-family: var(--f-label); font-size: calc(7.5pt * var(--k)); line-height: 1.18;
  border-radius: 2mm; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 8px 18px rgba(0,0,0,.16); }
.lbl .l-top { display: flex; align-items: center; gap: 1.5mm; font-size: calc(6.5pt * var(--k)); border-bottom: .25mm dashed #888; padding-bottom: .6mm; }
.lbl .l-top img { height: calc(5mm * var(--k)); width: auto; max-width: 14mm; object-fit: contain; }
.lbl .l-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl .l-top .l-lot { margin-inline-start: auto; font-family: var(--f-mono); white-space: nowrap; }
.lbl .l-name { font-weight: 700; font-size: calc(12pt * var(--k)); line-height: 1.05; }
.lbl .l-name2 { font-weight: 600; font-size: calc(9pt * var(--k)); line-height: 1.05; }
.lbl .l-sub { display: flex; gap: 2mm; flex-wrap: wrap; }
.lbl .l-alg { font-weight: 700; font-size: calc(6.5pt * var(--k)); }
.lbl .l-row { display: flex; justify-content: space-between; gap: 2mm; margin-top: auto; }
.lbl .l-exp { display: flex; justify-content: space-between; align-items: center; gap: 2mm; background: var(--paper-ink); color: var(--paper); padding: .6mm 1.4mm; border-radius: .6mm; }
.lbl .l-exp b { font-family: var(--f-mono); font-size: calc(10pt * var(--k)); }
.lbl .l-row span:last-child, .lbl .l-by { font-family: var(--f-mono); }
.lbl .l-by { font-size: calc(6.5pt * var(--k)); }
.lbl.compact .l-top img, .lbl.compact .l-sub, .lbl.compact .l-name2 { display: none; }
.lbl.compact .l-name { font-size: calc(10.5pt * var(--k)); }
.lbl .bi { display: flex; justify-content: space-between; gap: 1mm; }

#print-root { display: none; }
@media print {
  html, body { background: #fff !important; height: auto; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .lbl { border-radius: 0; box-shadow: none; break-after: page; page-break-after: always;
    transform: translate(calc(var(--ox) * 1mm), calc(var(--oy) * 1mm)); }
  #print-root .lbl:last-child { break-after: auto; page-break-after: auto; }
}
.lbl .l-demo { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: calc(18pt * var(--k));
  color: rgba(0,0,0,.13); transform: rotate(-18deg); pointer-events: none; letter-spacing: .2em; }
.lbl .l-warn { font-weight: 700; font-size: calc(7pt * var(--k)); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- settings, legal, misc ---------- */
.device-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-radius: 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 35%, var(--surface))); }
.device-box > div { display: grid; }
.device-box b { font-size: 24px; letter-spacing: .14em; }
.code-in { font-size: 20px !important; letter-spacing: .08em; text-align: center; font-family: var(--f-mono); }
.terms { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.terms input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; font: inherit; cursor: pointer; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 12.5px; color: var(--muted); }
.legal-links .linkish { color: var(--muted); }
.modal-sub { padding: 10px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal-sub .flabel { font-size: 13px; color: var(--muted); font-weight: 500; }
.modal.legal { width: min(760px, 100%); }
.legal-body { background: var(--surface) !important; line-height: 1.7; }
.legal-body h3 { font-size: 15px; margin: 20px 0 6px; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body p { margin: 0; max-width: 68ch; }
.legal-body a { color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- temperatures ---------- */
.tbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tbar .month { font-size: 17px; font-weight: 600; min-width: 150px; text-align: center; text-transform: capitalize; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; box-shadow: var(--shadow-sm); }
.tcard b { font-size: 15.5px; }
.tcard small { color: var(--muted); font-size: 13px; }
.tcard.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 12%, transparent); }
.tcard.bad, .tcard.invalid { border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
  background: linear-gradient(180deg, var(--danger-soft), color-mix(in srgb, var(--danger-soft) 30%, var(--surface))); }
.tcard .pill { justify-self: start; }
.tin { display: flex; align-items: center; gap: 8px; }
.tin input { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 24px; text-align: center; padding: 8px 10px; min-height: 54px;
  border: 1px solid var(--input); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.tin span { font-family: var(--f-mono); color: var(--muted); }
.tact { border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); border-radius: 10px; padding: 9px 11px; background: var(--surface); min-height: 42px; }
.tval-big { font-size: 26px; font-weight: 700; }
.tfoot { position: sticky; bottom: calc(12px + var(--nav-h) + var(--safe-b)); z-index: 5; margin-top: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 18px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.tfoot .err { flex: 1; min-width: 160px; }
.auth-panel { max-width: 560px; display: grid; gap: 16px; }
.auth-panel h3 { margin: 0; }
table.reg { font-size: 13px; }
table.reg th, table.reg td { text-align: center; white-space: nowrap; }
table.reg th:first-child, table.reg td:first-child, table.reg td.by, table.reg th:last-child { text-align: start; }
table.reg td.m { font-family: var(--f-mono); line-height: 1.6; }
table.reg td.by { font-size: 12px; color: var(--muted); }
table.reg .x { color: var(--danger); font-weight: 700; }
table.reg .n { color: var(--muted); }
table.reg .tv { border: 0; background: none; padding: 0 3px; font: inherit; color: inherit; cursor: pointer; border-radius: 5px; }
table.reg .tv:hover { background: var(--accent-soft); }
table.reg .tv.x { color: var(--danger); }
.ulist { display: grid; gap: 10px; margin-bottom: 12px; }
.urow { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(140px, 1.3fr) minmax(80px, .7fr) minmax(80px, .7fr) auto auto; gap: 10px; align-items: end;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.urow .field input, .urow .field select { background-color: var(--surface); }
.uchk { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; white-space: nowrap; }
.uchk input { width: 20px; height: 20px; accent-color: var(--accent); }
.urow .acts { display: flex; gap: 6px; align-items: center; min-height: 44px; }
@media (max-width: 900px) { .urow { grid-template-columns: 1fr 1fr; } .urow .field:first-child { grid-column: 1 / -1; } }
.tcard > * { min-width: 0; }
.tin input, .tact { width: 100%; }

/* ---------- fryer oils ---------- */
.ocard.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.ocard.soon { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: linear-gradient(180deg, var(--warn-soft), color-mix(in srgb, var(--warn-soft) 30%, var(--surface))); }
.ocard.exp { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); background: linear-gradient(180deg, var(--danger-soft), color-mix(in srgb, var(--danger-soft) 30%, var(--surface))); }
.orow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.orow .field label { font-size: 12px; color: var(--muted); }
.orow .tin input { font-size: 20px; min-height: 48px; }
.omsg { display: flex; gap: 8px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; font-weight: 500; }
.omsg .ico { flex: none; margin-top: 1px; }
.omsg.ok { background: var(--ok-soft); color: var(--ok); }
.omsg.soon { background: var(--warn-soft); color: var(--warn); }
.omsg.exp { background: var(--danger-soft); color: var(--danger); }
.ocard.soon .omsg.soon, .ocard.exp .omsg.exp { background: var(--surface); box-shadow: var(--shadow-sm); }
.ohint { margin: 0; color: var(--warn); }
.frow { grid-template-columns: minmax(180px, 1fr) auto auto; }
table.oreg th.h-good { background: var(--ok-soft); color: var(--ok); }
table.oreg th.h-soon { background: var(--warn-soft); color: var(--warn); }
table.oreg th.h-change { background: var(--danger-soft); color: var(--danger); }
table.oreg th { white-space: normal; line-height: 1.3; }
table.oreg tr.nf td { color: var(--danger); font-weight: 600; }
@media (max-width: 900px) { .frow { grid-template-columns: 1fr auto; } .frow .field:first-child { grid-column: 1 / -1; } }

/* ---------- automatic copies ---------- */
.snaps { display: grid; gap: 8px; }
.snap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.snap > div { display: grid; gap: 2px; min-width: 0; }
.tin .pm { flex: none; width: 48px; min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; font-weight: 700; font-family: var(--f-mono); }
.tin .pm:active { background: var(--accent-soft); }
.modal .tin input { font-size: 20px; }

/* ---------- Today ---------- */
.today-date { text-transform: capitalize; }
.progress-bar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.progress-bar span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary-2), var(--ok));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.tasks { display: grid; gap: 10px; max-width: 820px; }
.task { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; box-shadow: var(--shadow-sm); }
.task-ico { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--input); display: grid; place-items: center; flex: none; }
.task-ico .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.task.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.task.done .task-ico { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.task.done .task-tx b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-decoration-thickness: 1.5px; }
.task.late .task-ico { border-color: color-mix(in srgb, var(--warn) 45%, var(--input)); color: var(--warn); }
.clean { max-width: 820px; margin-top: 8px; }
.page-h.sub { padding-block: 22px 10px; } .page-h.sub h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.clean-area { font-size: 13px; font-weight: 600; color: var(--muted); margin: 8px 2px 0; text-transform: uppercase; letter-spacing: .04em; }
.fix-redo { color: var(--warn); font-weight: 600; }
.fixes .task-ico .ico { color: var(--danger); }
.task.late .task-tx small { color: var(--warn); }
.task-tx { display: grid; gap: 2px; flex: 1; min-width: 0; }
.task-tx b { font-size: 15.5px; }
.task-tx small { color: var(--muted); font-size: 13px; }

/* ---------- A4 documents (print only) — unchanged ---------- */
/* ---------- v1.5: A4 documents (print only) ---------- */
.doc { font-family: var(--f-ui); color: #111; background: #fff; font-size: 9.5pt; line-height: 1.35; }
.doc-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1.5pt solid #111; padding-bottom: 6pt; margin-bottom: 8pt; }
.doc-brand { display: flex; align-items: center; gap: 8pt; }
.doc-brand img { height: 32pt; width: auto; max-width: 70pt; object-fit: contain; }
.doc-brand b { display: block; font-size: 12pt; }
.doc-brand span { font-size: 10pt; }
.doc-period { font-size: 11pt; text-transform: capitalize; }
.doc-t { width: 100%; border-collapse: collapse; }
.doc-t th, .doc-t td { border: 0.5pt solid #888; padding: 2.5pt 3pt; text-align: center; font-variant-numeric: tabular-nums; }
.doc-t th { background: #eee; font-weight: 600; font-size: 8.5pt; }
.doc-t td.by { text-align: start; font-size: 8.5pt; }
.doc-t tr { break-inside: avoid; }
.doc-t thead { display: table-header-group; }
.doc .x { color: #b4361b; font-weight: 700; }
.doc h4 { margin: 10pt 0 4pt; font-size: 10pt; }
.doc ul { margin: 0; padding-inline-start: 14pt; }
.doc-note { font-size: 8pt; color: #555; margin: 4pt 0 0; }
.doc-f { display: flex; justify-content: space-between; border-top: 0.5pt solid #888; margin-top: 10pt; padding-top: 4pt; font-size: 8pt; color: #555; }

/* reception of goods (deliveries.js) */
.dv-form { display: grid; gap: 16px; }
.dv-form textarea { border: 1px solid var(--input); background: var(--field); border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
  font: inherit; color: inherit; resize: vertical; min-height: 64px; }
.dv-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.dv-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dv-thumb { display: grid; gap: 4px; justify-items: center; }
.dv-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.dv-gallery { display: grid; gap: 12px; }
.dv-gallery figure { margin: 0; }
.dv-gallery img { width: 100%; height: auto; border-radius: 12px; }
/* photos & pertes: two filters in a row, then a compact grid of thumbnails */
.ls-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 16px; }
.ls-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ls-tile { display: grid; gap: 6px; width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: start; cursor: pointer; }
.ls-tile:hover { border-color: var(--primary); }
.ls-img { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--muted-bg); color: var(--muted); }
.ls-img img { width: 100%; height: 100%; object-fit: cover; }
.ls-cap { display: grid; gap: 2px; padding: 0 4px 4px; min-width: 0; }
.ls-cap b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-cap small { color: var(--muted); font-size: 12px; }

/* recipe cards, "mode cuisine" (recipes.js): big text, readable from a step away */
.rc-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 12px; }
.rc-item { display: grid; gap: 4px; justify-items: start; text-align: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.rc-item b { font-size: 17px; }
.rc-item small { color: var(--muted); }
.rc-card { display: grid; gap: 14px; font-size: 18px; line-height: 1.5; }
.rc-card h2 { font-size: 26px; margin: 0; }
.rc-card h3 { font-size: 19px; margin: 6px 0 0; }
.rc-top { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.rc-photo { margin: 0; }
.rc-photo:empty { display: none; }
.rc-photo img { display: block; width: 100%; max-width: 640px; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 14px; background: var(--muted-bg, rgba(110, 110, 120, .09)); }
.rc-steps .rc-photo img { max-width: 420px; }
.rc-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.rc-facts dt { color: var(--muted); }
.rc-facts dd { margin: 0; }
.rc-alg { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-alg .pill { font-size: 14px; }
.rc-ing, .rc-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.rc-steps p { margin: 0; }
.rc-notes { margin: 0; white-space: pre-wrap; }

/* fridge sensors (sensors.js): open alerts on every screen, live values on the temperatures screen */
.sens-alerts { position: relative; z-index: 20; display: grid; gap: 1px; background: var(--danger); }
.sens-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 20px; background: var(--danger); color: #fff; font-size: 15px; }
.sens-alert .ico { width: 20px; height: 20px; flex: none; }
.sens-alert > span { flex: 1; min-width: 200px; }
.sens-alert .btn { margin-inline-start: auto; background: #fff; color: var(--danger); border-color: #fff; }
.sens-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 4px 0 16px; }
.sens-tile { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.sens-chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.sens-chip .ico { width: 15px; height: 15px; align-self: center; color: var(--muted); }
.sens-chip .mono { font-size: 20px; font-weight: 600; }
.sens-chip small { color: var(--muted); }
.sens-chip small.warn { color: var(--warn); }
.sens-chip.bad .mono { color: var(--danger); }
.sens-use { justify-self: start; }
