/*
 * AI Bistro — application shell (app.html): login, installation wizard, menu, Nastavení, Integrace.
 * ------------------------------------------------------------------
 * Dark operational UI: neutral surfaces, sentence-case labels and gold reserved for the brand and primary actions. Builds on css/tokens.css
 * (Switzer, type scale, spacing, motion); the colour tokens are redefined for the shell on
 * body.shell-body, so Sál v1 (index.html with css/app.css) keeps its light look until F4 hangs it
 * into the shell.
 *
 * Contrast on --bg #0a0a0a: --text-strong 18.5:1, --text 13.5:1, --text-muted 6.2:1, --gold 11.0:1;
 * on --surface-2 #222222 (inputs) --text-muted still has 4.9:1 and --placeholder is decoration only.
 */

body.shell-body {
  color-scheme: dark;
  /* ground and surfaces (web: --black, --off-black, --dark, --mid) */
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-1: #161616;
  --surface-2: #222222;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --line-gold: rgba(201, 168, 76, 0.32);
  /* text (web: --white, --off-white; --muted #888 brightened for AA on the panels) */
  --text-strong: #f9f7f2;
  --text: #d9d5cb;
  --text-muted: #938f87;
  --placeholder: rgba(255, 255, 255, 0.3);
  /* gold (web: --gold, --gold-light, --gold-dim) */
  --gold: #edba37;
  --gold-light: #e8c97a;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --on-gold: #0a0a0a;
  /* states, tuned for the dark ground */
  --ok: #7bd2ab;
  --ok-bg: #14291f;
  --warn: #f1a878;
  --warn-bg: #33211a;
  --bad: #f29b91;
  --bad-bg: #351c1a;
  --info: #9dbdec;
  --info-bg: #1a2432;
  --toast-info: var(--info);
  --toast-success: var(--ok);
  --toast-warning: var(--warn);
  --toast-danger: var(--bad);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 44px rgba(0, 0, 0, 0.6);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --shell-side-w: 218px;
  --shell-side-w-rail: 64px;
  --label: var(--fw-600) 11px/1.2 var(--font-sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body.shell-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fw-400) var(--fs-14)/var(--lh-14) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--gold) var(--bg);
}
.shell-body ::-webkit-scrollbar { width: 6px; height: 6px; }
.shell-body ::-webkit-scrollbar-track { background: var(--bg); }
.shell-body ::-webkit-scrollbar-thumb { background: var(--gold); }
/* marked text is blue everywhere, as on a Mac (Štěpán 13. 11. 2026); it was the accent of each app */
::selection { background: var(--sys-blue, #0a84ff); color: #fff; }
h1, h2, h3, h4 { color: var(--text-strong); margin: 0; font-weight: var(--fw-700); letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-light); }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-muted); }
.num { font-variant-numeric: var(--numeric); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- boot / loading ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; color: var(--text-muted); font: var(--label); letter-spacing: 0.25em; text-transform: uppercase; }
/* the start of the OS (app.html): a quiet turning ring instead of words (16. 11. 2026); it shows only after a moment,
   so a quick start does not flash it */
.boot-spin { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--text-muted) 30%, transparent);
  border-top-color: var(--sys-blue, #0a84ff); opacity: 0; animation: boot-in 0.3s ease-out 0.25s forwards, boot-turn 0.85s linear infinite; }
@keyframes boot-in { to { opacity: 1; } }
@keyframes boot-turn { to { transform: rotate(360deg); } }

/* ---------- buttons (web: .btn-gold, .btn-outline-gold) ---------- */
.btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: var(--fw-700) 11.5px/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 0; background: transparent; color: var(--text-strong);
  border: 1px solid var(--line-strong); white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-dim); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.btn--primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--on-gold); transform: none; box-shadow: none; }
.btn--primary:disabled:hover { background: var(--gold); border-color: var(--gold); box-shadow: none; }
.btn--danger { color: var(--bad); border-color: rgba(242, 155, 145, 0.45); }
.btn--danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn--ghost { border-color: transparent; }
.btn--small { padding: 7px 11px; font-size: 10.5px; letter-spacing: 0.12em; }
.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ---------- badges (web: pill tags) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font: var(--fw-600) 11px/1 var(--font-sans); letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 100px; white-space: nowrap; background: var(--surface-2); color: var(--text-muted);
}
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--gold { background: var(--gold); color: var(--on-gold); }
.phase { font: var(--fw-500) 10px/1 var(--mono); color: var(--text-muted); border: 1px solid var(--line-strong); border-radius: 100px; padding: 3px 6px; }
.phase--now { color: var(--ok); border-color: transparent; background: var(--ok-bg); }

/* ---------- forms (web: .form-label, .form-control) ---------- */
.form { display: grid; gap: var(--space-5); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4) var(--space-5); }
.form-grid .field--wide { grid-column: 1 / -1; }
@media (min-width: 721px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field > label, .field > .field-label { font: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.field .req { color: var(--gold); margin-left: 3px; }
.field-help { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.field-error { font-size: var(--fs-13); color: var(--bad); }
.input, .select, .textarea {
  width: 100%; font: var(--fw-400) var(--fs-14)/1.3 var(--font-sans); color: var(--text-strong);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; padding: 10px 12px; min-width: 0;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.textarea { min-height: 88px; resize: vertical; font-family: var(--mono); font-size: var(--fs-13); line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: rgba(201, 168, 76, 0.65); box-shadow: none; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-1); color: var(--text-muted); border-color: var(--line); }
.select option { background: var(--surface-2); color: var(--text-strong); }
.input--mono { font-family: var(--mono); font-size: var(--fs-13); }
.range { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); }
.range .input { width: 92px; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--fs-14); color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }
.secret-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.secret-row .input { flex: 1 1 200px; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-4); }
.fieldset > legend { font: var(--label); letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); padding: 0 0 var(--space-3); }
details.advanced { border-top: 1px dashed var(--line-strong); padding-top: var(--space-3); }
details.advanced > summary { cursor: pointer; font: var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); list-style: none; }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary:hover { color: var(--gold-light); }
details.advanced > summary::before { content: "+ "; color: var(--gold); }
details.advanced[open] > summary::before { content: "– "; }
details.advanced[open] > .form-grid, details.advanced[open] > .tbl-wrap { margin-top: var(--space-4); }
/* picker of values read from the source of an integration (folders, sheets, accounts) — F3 */
.picker { display: grid; gap: var(--space-2); max-height: 320px; overflow: auto; padding: var(--space-3); background: var(--surface-2); border: 1px solid var(--line); }
.picker-row { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); min-width: 0; }
.picker-row > span { overflow-wrap: anywhere; }
.picker-row .select { flex: none; }
.picker-pick { justify-self: start; text-transform: none; letter-spacing: 0; }
@media (min-width: 521px) { .picker-row { flex-direction: row; justify-content: space-between; align-items: center; } .picker-row .select { flex: 0 0 170px; } }
.image-field { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.image-field img { width: 56px; height: 56px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); padding: 4px; }
.image-field input[type="file"] { color: var(--text-muted); font-size: var(--fs-13); }
.image-field input[type="file"]::file-selector-button { font: var(--fw-700) 10.5px/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-strong); background: transparent; border: 1px solid var(--line-strong); padding: 8px 11px; margin-right: 10px; cursor: pointer; }
.image-field input[type="file"]::file-selector-button:hover { border-color: var(--gold); color: var(--gold-light); }

/* ---------- cards, tables, notes (web: .form-wrap) ---------- */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: 0; padding: var(--space-5) var(--space-6); display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.card-head h2 { font-size: var(--fs-16); line-height: var(--lh-16); letter-spacing: -0.01em; }
.card-head .aside { font-size: var(--fs-12); color: var(--text-muted); }
.stack { display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
/* Grid children must be allowed to shrink below the width of a table, which then scrolls in .tbl-wrap. */
.content > *, .stack > *, .form > *, .card > * { min-width: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
/* by the width of the window (css/desktop.css: container win) */
@container win (min-width: 1101px) { .two-col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.note { font-size: var(--fs-13); color: var(--text); background: var(--gold-dim); border-left: 2px solid var(--gold); padding: 11px 14px; }
.note--warn { background: var(--warn-bg); color: var(--warn); border-left-color: var(--warn); }
.note--bad { background: var(--bad-bg); color: var(--bad); border-left-color: var(--bad); }
.note--ok { background: var(--ok-bg); color: var(--ok); border-left-color: var(--ok); }
.empty { padding: var(--space-10) var(--space-4); text-align: center; color: var(--text-muted); display: grid; gap: var(--space-3); justify-items: center; }
.empty h2 { font-size: var(--fs-20); line-height: var(--lh-20); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.tbl th { font: var(--fw-600) 10.5px/1.2 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 0 12px 10px 0; border-bottom: 1px solid var(--line-gold); white-space: nowrap; }
.tbl td { padding: 10px 12px 10px 0; border-bottom: 1px dashed var(--line-strong); vertical-align: top; color: var(--text); }
.tbl td b { color: var(--text-strong); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: var(--numeric); }
/* a column name that sorts the table (Prodej › Položky): looks like the name, with a small arrow */
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.th-sort:hover, .th-sort.is-on { color: var(--text-strong); }
.th-sort:focus-visible { box-shadow: var(--focus-ring); border-radius: 4px; }
.th-sort-arrow { font-size: 9px; letter-spacing: 0; opacity: .45; }
.th-sort.is-on .th-sort-arrow { opacity: 1; color: var(--gold); }
.tbl .mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.tbl .actions { text-align: right; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px var(--space-5); font-size: var(--fs-13); margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text-strong); min-width: 0; overflow-wrap: anywhere; }
.kv dd .badge { white-space: normal; line-height: 1.35; } /* a whole sentence in a badge may wrap on a phone */

/* ---------- login and wizard ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6) var(--space-4);
  background: var(--bg); }
.gate-card { width: min(440px, 100%); background: var(--surface-1); border: 1px solid var(--line); border-top: 2px solid var(--gold); padding: var(--space-10) var(--space-8) var(--space-8); display: grid; gap: var(--space-6); box-shadow: var(--shadow-1); }
.gate-brand { display: flex; align-items: center; gap: var(--space-3); }
.gate-brand img, .gate-brand svg { width: 46px; height: 46px; object-fit: contain; flex: none; }
.gate-brand b { display: block; font-size: var(--fs-20); line-height: var(--lh-20); color: var(--text-strong); letter-spacing: -0.02em; font-weight: var(--fw-700); }
.gate-brand span { display: block; font: var(--label); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-top: 5px; }
/* the card of a phone (js/shell/phone.js): in the middle of what is seen, the page does not scroll */
.gate--phone { position: fixed; inset: 0; min-height: 0; overflow: hidden; overscroll-behavior: none; touch-action: none;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom)); }
.gate-phone { text-align: center; justify-items: center; width: min(360px, 100%); padding: var(--space-8) var(--space-6); }
.gate-phone .gate-brand { justify-content: center; }
.gate-phone__text { display: grid; gap: var(--space-3); color: var(--text-muted); }
.gate-phone__text p { margin: 0; }
.gate-phone__lead { color: var(--text-strong); font-size: var(--fs-20); line-height: var(--lh-20); font-weight: var(--fw-600); }
.gate-phone__text b { color: var(--text-strong); font-weight: inherit; overflow-wrap: anywhere; }
.gate-foot { font-size: var(--fs-12); color: var(--text-muted); text-align: center; }
.gate-card .btn--primary { width: 100%; padding: 14px 18px; }
.wizard { width: min(1060px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface-1); border: 1px solid var(--line); border-top: 2px solid var(--gold); box-shadow: var(--shadow-1); }
.wizard-steps { background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--space-6) var(--space-4); display: grid; gap: var(--space-2); align-content: start; }
.wizard-steps ol { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: 2px; counter-reset: s; }
.wizard-steps li { counter-increment: s; display: flex; gap: var(--space-3); align-items: center; padding: 9px 10px; color: var(--text-muted); font-size: var(--fs-13); border-left: 2px solid transparent; }
.wizard-steps li::before { content: counter(s, decimal-leading-zero); font: var(--fw-600) 11px/1 var(--mono); color: var(--text-muted); flex: none; width: 20px; }
.wizard-steps li[aria-current="step"] { color: var(--text-strong); border-left-color: var(--gold); background: var(--gold-dim); }
.wizard-steps li[aria-current="step"]::before { color: var(--gold); }
.wizard-steps li.done { color: var(--text); }
.wizard-steps li.done::before { content: "✓"; color: var(--ok); }
.wizard-main { padding: var(--space-6); display: grid; gap: var(--space-5); align-content: start; min-width: 0; }
.wizard-main h1 { font-size: var(--fs-28); line-height: var(--lh-28); letter-spacing: -0.03em; font-weight: 800; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: var(--fs-13); }
.checks li { display: flex; gap: var(--space-2); align-items: baseline; color: var(--text); }
.checks .mark { width: 18px; flex: none; font-weight: var(--fw-700); }
.checks .ok .mark { color: var(--ok); }
.checks .bad .mark { color: var(--bad); }
.checks .opt .mark { color: var(--warn); }
@media (min-width: 821px) {
  .wizard { grid-template-columns: 250px minmax(0, 1fr); }
  .wizard-steps { border-bottom: 0; border-right: 1px solid var(--line); padding: var(--space-8) var(--space-4); }
  .wizard-main { padding: var(--space-10); }
  .wizard-main h1 { font-size: var(--fs-40); line-height: var(--lh-40); }
}

/* ---------- shell, mobile first (3. 11. 2026) ----------
 * Phone (the base, 390 px): a sticky header with the menu button, the title, Orbit and the account as round icons,
 * the ticker and the tabs each a row across the whole width; the menu is a drawer from the left over a scrim
 * (body.nav-open, js/shell/shell.js). From 821 px the side menu stands in place and the header has the tools beside the
 * title. Every control of the shell is a touch target of at least 44 × 44 px.
 */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); height: 100vh; height: 100dvh; z-index: var(--z-modal);
  background: var(--surface); border-right: 1px solid var(--line); padding: calc(14px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-100%); visibility: hidden; transition: transform var(--dur-base) var(--ease-standard), visibility 0s linear var(--dur-base); }
body.nav-open .side { transform: none; visibility: visible; box-shadow: var(--shadow-2); transition: transform var(--dur-base) var(--ease-standard); }
.nav-scrim { position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: var(--scrim, rgba(0, 0, 0, 0.6)); opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease-standard); }
body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; min-width: 0; border-bottom: 1px solid var(--line); }
.brand img, .brand svg { width: 30px; height: 30px; object-fit: contain; flex: none; }
.brand b { display: block; font-size: var(--fs-14); color: var(--text-strong); letter-spacing: -0.01em; font-weight: var(--fw-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > div { min-width: 0; }
.groups { display: flex; flex-direction: column; gap: 14px; }
.group { display: grid; gap: 2px; }
.group-label { font: var(--fw-600) 10px/1 var(--font-sans); letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); padding: 0 10px 7px; }
.nav-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; color: var(--text); font: var(--fw-500) 15px/20px var(--font-sans); cursor: pointer; position: relative;
  transition: color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard); }
.nav-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--surface-2); color: var(--text-strong); }
.nav-item[aria-current="page"] { background: var(--gold-dim); color: var(--text-strong); }
.nav-item[aria-current="page"] svg { color: var(--gold); }
.nav-item[aria-disabled="true"] { cursor: default; color: var(--text-muted); }
.nav-item[aria-disabled="true"]:hover { background: transparent; color: var(--text-muted); }
.nav-item:focus-visible { outline: 2px solid var(--text-strong); outline-offset: -2px; box-shadow: none; }
.nav-item .phase { margin-left: auto; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; font-size: 12px; line-height: 18px; color: var(--text-muted); display: grid; gap: 5px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); margin-right: 6px; vertical-align: 1px; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--bad { background: var(--bad); }

.main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-width: 0; }
.top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 0; position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg); border-bottom: 1px solid var(--line); }
.nav-toggle { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text-strong); }
.nav-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 2px; }
.title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crumb { font: var(--fw-600) 10.5px/14px var(--font-sans); letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title h1 { font-size: 22px; line-height: 28px; letter-spacing: -0.02em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.clock { display: none; font: var(--fw-400) 13px/20px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
/* ticker: the newest event of the shared stream, a row across the whole header at every width */
.ticker { all: unset; box-sizing: border-box; cursor: pointer; grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 44px;
  background: var(--surface-2); border: 1px solid var(--line); padding: 8px 14px; font-size: 13px; line-height: 18px; color: var(--text); }
.ticker:hover { border-color: var(--line-gold); }
.ticker:focus-visible { box-shadow: var(--focus-ring); }
.ticker .t-time { font: var(--fw-500) 13px/18px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--text-muted); flex: none; }
.ticker .t-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.sev { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-strong); }
.sev[data-s="notice"] { background: var(--info); }
.sev[data-s="warning"] { background: var(--warn); }
.sev[data-s="alert"] { background: var(--bad); }
.sev[data-s="ai"] { background: #bdb0e6; }
.orbit-btn { min-width: 44px; min-height: 44px; padding: 0; }
.orbit-btn svg { width: 18px; height: 18px; }
.orbit-label, .user-name, .user-btn small { display: none; }
.user-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; font: var(--fw-600) 13px/1.2 var(--font-sans); color: var(--text-strong);
  transition: border-color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard); }
.user-btn:focus-visible { box-shadow: var(--focus-ring); }
.user-btn--static { cursor: default; }
.shell-body .user-btn--static:hover { background: transparent; }
.user-btn small { color: var(--gold); font-weight: var(--fw-600); font-size: 12px; }
/* tabs: one row that scrolls sideways on the phone, the selected tab kept in sight (js/shell/shell.js) */
.tabs { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; margin-inline: -12px; padding: 2px 12px 8px; scroll-padding-inline: 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs:empty { display: none; }
.tab { all: unset; box-sizing: border-box; cursor: pointer; flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; font: var(--fw-500) 14px/20px var(--font-sans); color: var(--text-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.tab:hover { color: var(--text-strong); }
.tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--text-strong); }
.tab:focus-visible { box-shadow: var(--focus-ring); }
.content { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); display: grid; gap: 20px; align-content: start; min-width: 0; }
/* a tab whose code lives in another module is mounted into a wrapper: it keeps the spacing of .content between its parts */
.tab-slot { display: grid; gap: 20px; align-content: start; min-width: 0; }
.tab-slot > * { min-width: 0; }

@media (min-width: 821px) {
  .shell { grid-template-columns: var(--shell-side-w) minmax(0, 1fr); }
  .side { position: sticky; top: 0; inset: auto; width: auto; height: 100vh; z-index: var(--z-sticky); transform: none; visibility: visible; transition: none; padding: 24px 12px 16px; gap: 22px; }
  .nav-scrim, .nav-toggle { display: none; }
  body.nav-open { overflow: visible; }
  .nav-item { min-height: 40px; padding: 9px 10px; font-size: 14px; }
  .nav-item[aria-disabled="true"] { min-height: 32px; padding-block: 6px; }
  .top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 22px 32px 0; position: static; border-bottom: 0; background: transparent; }
  .title { flex: 1 1 180px; gap: 4px; }
  .title h1 { font-size: 30px; line-height: 36px; white-space: normal; }
  .tools { gap: 12px; margin-left: auto; flex-wrap: wrap; }
  .clock { display: inline; }
  .orbit-label, .user-name, .user-btn small { display: inline; }
  .orbit-btn { min-height: 40px; padding: 9px 16px; }
  .user-btn { min-height: 40px; justify-content: flex-start; }
  .ticker { flex: 1 1 100%; order: 3; }
  .tabs { flex: 1 1 100%; order: 4; margin-inline: 0; padding: 4px 0 2px; }
  .content { padding: 28px 32px 40px; gap: 24px; }
  .tab-slot { gap: 24px; }
}
@container win (max-width: 1200px) {
  .top { padding: 20px 24px 0; }
  .content { padding: 24px; }
  .nav-item { gap: 8px; padding-inline: 8px; font-size: 13px; }
  .brand span { white-space: normal; }
}

/* ---------- data modules (F4): KPI, the hall frame, the rail of events, day controls ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.kpi { background: var(--surface-1); border: 1px solid var(--line); padding: 12px 14px; display: grid; gap: 5px; align-content: start; min-width: 0; }
.kpi-l { font: var(--fw-600) 10.5px/1.2 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.kpi-v { font-size: 24px; line-height: 1.1; font-weight: var(--fw-700); letter-spacing: -0.02em; color: var(--text-strong); font-variant-numeric: var(--numeric); white-space: nowrap; }
.kpi-v small { font-size: 12px; font-weight: var(--fw-600); margin-left: 6px; letter-spacing: 0; }
.kpi-v small.up { color: var(--ok); }
.kpi-v small.down { color: var(--warn); }
.kpi-n { font-size: var(--fs-12); color: var(--text-muted); line-height: 1.35; }
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@container win (min-width: 1381px) { .with-rail { grid-template-columns: minmax(0, 1fr) 300px; } }
.sal-wrap { border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.sal-replay { display: block; width: 100%; height: max(600px, calc(100vh - 290px)); background: #f4f1ea; color: #25342f; --line: #e4e7de; --text: #25342f; --bg: #fff; }
/* Přehled (D0): only the model of the hall, straight on the dark surface, a soft light under it, the switch on the right */
.hall-hero { position: relative; display: grid; gap: var(--space-3); min-width: 0; }
.hall-hero[hidden] { display: none; } /* Kancelář in a narrow window: no robots (js/modules/kancelar.js) */
.hall-hero__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--line); }
.seg button { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 500; line-height: 1; padding: 8px 12px; border-radius: 7px; color: var(--text-muted); }
.seg button:hover { color: var(--text-strong); }
.seg button[aria-pressed="true"] { background: var(--text-strong); color: var(--bg); }
.seg button:focus-visible { box-shadow: var(--focus-ring); }
.hall-hero__stage { position: relative; min-width: 0; }
.hall-hero__stage::before { content: ""; position: absolute; inset: 10% 4% -2%; pointer-events: none;
  background: transparent; }
.agents-net { position: relative; display: block; width: 100%; }
.rail { max-height: max(600px, calc(100vh - 290px)); overflow: auto; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; font-size: 12.5px; line-height: 1.4; }
.feed li.muted { display: block; }
.feed .sev { margin-top: 6px; }
.feed .f-text { color: var(--text); overflow-wrap: anywhere; }
.feed .f-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; font: var(--fw-500) 10.5px/1.3 var(--mono); color: var(--text-muted); }
.toolbar { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; justify-content: space-between; }
.shell-body .seg.seg--neutral button[aria-pressed="true"] { background: color-mix(in srgb, var(--text-strong) 12%, transparent); color: var(--text-strong); box-shadow: none; }
.day-picker { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.day-input { width: auto; padding: 7px 10px; color-scheme: dark; }
.bar-cell { display: grid; grid-template-columns: minmax(60px, 1fr) auto; gap: 8px; align-items: center; min-width: 140px; }
.bar-track { height: 6px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { all: unset; box-sizing: border-box; cursor: pointer; font-size: var(--fs-12); padding: 6px 11px; border: 1px solid var(--line-strong); color: var(--text-muted); }
.chip:hover { border-color: var(--gold); color: var(--gold-light); }
.chip[aria-pressed="true"] { border-color: var(--gold); color: var(--text-strong); background: var(--gold-dim); }
.chip:focus-visible { box-shadow: var(--focus-ring); }
.filter-bar { display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; flex-wrap: wrap; }
.select--small, .input--small { width: auto; padding: 7px 10px; font-size: var(--fs-13); }
.input--small[type="search"] { min-width: 0; max-width: 100%; }
@media (min-width: 821px) { .input--small[type="search"] { min-width: 220px; } }
.feed--wide li { grid-template-columns: 10px minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.feed--wide li:last-child { border-bottom: 0; }
.txt-warn { color: var(--warn); }
.txt-ok { color: var(--ok); }
.offer-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-items: center; }
@media (min-width: 721px) { .offer-row { grid-template-columns: minmax(0, 2fr) 110px minmax(0, 2fr) auto; } }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }
.flags .chip { padding: 4px 8px; font-size: 11px; }
.price-input { width: 90px; text-align: right; }
.textarea--text { font-family: var(--font-sans); font-size: var(--fs-14); }
.items-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: var(--fs-12); color: var(--text-muted); }

/* ---------- integrations ---------- */
.intg-list { display: grid; gap: var(--space-3); }
.intg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; background: var(--surface-1); border: 1px solid var(--line); border-left: 2px solid var(--line-strong); padding: 16px 18px;
  transition: border-color var(--dur-fast) var(--ease-standard); }
.intg:hover { border-left-color: var(--gold); }
.intg-title { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.intg-title b, .intg-title h2 { color: var(--text-strong); font-size: var(--fs-16); }
.intg-meta { font-size: var(--fs-12); color: var(--text-muted); margin-top: 4px; }
.intg-err { font-size: var(--fs-12); color: var(--bad); margin-top: 4px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--space-3); }
.type-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 8px; align-content: start; background: var(--surface-1); border: 1px solid var(--line); border-top: 2px solid transparent; padding: 16px 18px;
  transition: border-color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard); }
.type-card:hover { border-top-color: var(--gold); background: var(--surface-2); }
.type-card:focus-visible { box-shadow: var(--focus-ring); }
.type-card[aria-disabled="true"] { cursor: default; opacity: 0.55; }
.type-card[aria-disabled="true"]:hover { border-top-color: transparent; background: var(--surface-1); }
.type-card b { color: var(--text-strong); font-size: var(--fs-14); }
.type-card p { font-size: var(--fs-12); color: var(--text-muted); line-height: 1.5; }
.type-cat { font: var(--fw-600) 10.5px/1 var(--font-sans); letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); margin: var(--space-3) 0 0; }
.test-result { font-size: var(--fs-13); padding: 11px 14px; border-left: 2px solid currentColor; }
.test-result--ok { background: var(--ok-bg); color: var(--ok); }
.test-result--bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- dialogs, toasts, account menu ---------- */
dialog.dlg { border: 1px solid var(--line-strong); border-top: 2px solid var(--gold); border-radius: 0; padding: 0; width: min(540px, calc(100% - 32px)); box-shadow: var(--shadow-2); color: var(--text); background: var(--surface-1); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, 0.68);  }
.dlg-body { padding: var(--space-8); display: grid; gap: var(--space-4); }
.dlg-body h2 { font-size: var(--fs-20); line-height: var(--lh-20); }
.token-box { font: var(--fw-500) var(--fs-13)/1.5 var(--mono); background: var(--surface-2); border: 1px dashed var(--line-gold); padding: 11px 13px; word-break: break-all; color: var(--gold-light); user-select: all; white-space: pre-wrap; margin: 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: var(--z-toast); width: min(400px, calc(100% - 32px)); }
.toast { background: var(--surface-2); border: 1px solid var(--line-strong); border-left: 2px solid var(--toast-info); padding: 12px 14px; box-shadow: var(--shadow-2); font-size: var(--fs-13); color: var(--text-strong); }
.toast--success { border-left-color: var(--toast-success); }
.toast--warning { border-left-color: var(--toast-warning); }
.toast--danger { border-left-color: var(--toast-danger); }
.menu-pop { position: absolute; right: 28px; top: 64px; background: var(--surface-1); border: 1px solid var(--line-strong); border-top: 2px solid var(--gold); box-shadow: var(--shadow-2); padding: 8px; display: grid; min-width: 240px; z-index: var(--z-popover); }
.menu-pop .who { padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: var(--fs-13); display: grid; gap: 4px; }
.menu-pop .who b { display: block; color: var(--text-strong); }
.menu-pop button, .menu-pop a { all: unset; cursor: pointer; padding: 9px 10px; font-size: var(--fs-13); color: var(--text); }
.menu-pop button:hover, .menu-pop a:hover, .menu-pop button:focus-visible, .menu-pop a:focus-visible { background: var(--gold-dim); color: var(--gold-light); }

@media (prefers-reduced-motion: reduce) {
  .btn--primary:hover { transform: none; }
}

/* Operational shell: scoped tokens and hierarchy; Sál v1 keeps its own theme. */
body.shell-body {
 --bg:#0a0a0a; --surface:#111111; --surface-1:#141414; --surface-2:#202020;
 --text-muted:#aaa69e; --line:rgba(255,255,255,.12); --line-strong:#77736c;
 --focus-ring:0 0 0 2px var(--bg),0 0 0 4px var(--text-strong);
 --shell-side-w:218px; --mono:var(--font-sans); --placeholder:#aaa69e;
 scrollbar-color:#77736c var(--bg);
}
.shell-body ::-webkit-scrollbar-thumb {background:#77736c}
a {color:var(--text-strong)}
h1,h2,h3,h4 {font-weight:600}
.crumb {font-size:13px;line-height:18px;font-weight:400;color:var(--text-muted)}
.orbit-btn {background:transparent;border-color:#77736c;color:var(--text)}
.orbit-btn:hover {background:var(--surface-2);color:var(--text-strong);border-color:var(--text-muted)}
.user-btn small {font-size:12px;font-weight:400;color:var(--text-muted)}
.user-btn:hover {background:transparent;color:var(--text-strong)}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.boot-spin{opacity:1}}
.brand {padding:0 8px 22px;gap:10px}
.brand b {font-size:18px;line-height:24px}
.brand span {font-size:11px;line-height:16px}
.groups {gap:18px}
.group-label {color:var(--text-muted);font-size:12px;line-height:16px;padding:0 10px 6px;font-weight:500}
.nav-item[aria-current="page"] {background:#282725;color:var(--text-strong)}
.nav-item[aria-current="page"] svg {color:var(--text-strong)}
.nav-item:hover {background:var(--surface-2);color:var(--text-strong)}
.nav-item[aria-disabled="true"] {opacity:1;color:#aaa69e}
.nav-item[aria-disabled="true"] .phase {border:0;background:transparent;font-size:10px}
.tab[aria-selected="true"] {border-color:var(--text-strong)}
.tab:hover {color:var(--text-strong)}
.btn,.btn--small {font-size:14px;line-height:20px;font-weight:500;min-height:44px;min-width:44px;padding:11px 14px;border-radius:4px}
.btn:hover {border-color:var(--text-muted);background:var(--surface-2);color:var(--text-strong)}
.btn--primary:hover {background:var(--gold-light);color:var(--on-gold);border-color:var(--gold-light);transform:none;box-shadow:none}
.btn--danger:hover {background:var(--bad-bg);color:var(--bad)}
.btn--ghost {border-color:transparent}
.btn svg {width:16px;height:16px}
.field>label,.field>.field-label {font-size:14px;font-weight:500;line-height:20px;color:var(--text)}
.field-help {font-size:13px;line-height:19px}
.input,.select,.textarea {border-color:var(--line-strong);border-radius:4px;min-height:44px;font-size:16px}
.input:focus,.select:focus,.textarea:focus {outline:2px solid var(--text-strong);outline-offset:2px;border-color:var(--text-muted)}
.fieldset>legend,details.advanced>summary {font-size:15px;color:var(--text-strong)}
.card {padding:18px 16px;border-color:var(--line);gap:20px}
.card .card {padding:20px 0;border:0;border-top:1px solid var(--line);background:transparent}
.card-head h2 {font-size:18px;font-weight:600}
.note {background:var(--surface-2);border-left-color:var(--text-muted)}
.note--warn {background:var(--warn-bg);border-left-color:var(--warn)}
.note--bad {background:var(--bad-bg);border-left-color:var(--bad)}
.note--ok {background:var(--ok-bg);border-left-color:var(--ok)}
.filter-bar {align-items:start;gap:12px;min-width:0}
.filter-bar>.btn-row {width:100%;display:grid;grid-template-columns:125px minmax(0,1fr);gap:8px}
.filter-bar select,.filter-bar input {width:100%;min-width:0}
.chips {gap:2px;flex-wrap:nowrap;overflow-x:auto;width:100%;padding-bottom:4px;scrollbar-width:none}
.chip {flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:44px;padding:10px 12px;min-height:44px;font-size:13px;line-height:22px;border-color:transparent;border-radius:3px}
.chip:hover {border-color:var(--text-muted);color:var(--text-strong)}
.chip[aria-pressed="true"] {background:var(--surface-2);border-color:var(--line-strong);color:var(--text-strong)}
.day-picker {gap:8px}
.day-input {min-height:44px;font-size:16px}
.badge {font-size:12px;line-height:18px;padding:2px 8px;letter-spacing:0;font-weight:500;border-radius:3px}
.check {min-height:44px;min-width:44px}
.check input {accent-color:var(--text-strong);width:18px;height:18px}
.tbl {font-size:14px;line-height:21px}
.tbl th {font-size:13px;line-height:20px;font-weight:500;padding:12px 16px 12px 0;border-color:var(--line)}
.tbl td {padding:14px 16px 14px 0;border-bottom-style:solid;border-color:var(--line)}

/* Shared states and form affordances. Loading never pulses or shimmers. */
.loading-state {display:grid;gap:12px;min-height:132px;padding:16px 0;color:var(--text-muted)}
.loading-state__lines {display:grid;gap:12px;max-width:680px}
.loading-state__lines span {height:12px;background:var(--surface-2);border-radius:2px}
.loading-state__lines span:nth-child(2) {width:82%}
.loading-state__lines span:nth-child(3) {width:58%}
.error-state {display:grid;gap:8px}
.error-state .field-help {color:inherit}
.connection-note {flex:1 1 100%;font-size:13px;line-height:20px;color:var(--warn);padding:10px 0;border-top:1px solid var(--line)}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {border-color:var(--bad)}
.field-error {line-height:20px}
.tbl-wrap {max-width:100%;overscroll-behavior-x:contain}
.tbl-wrap:focus-visible {outline:2px solid var(--text-strong);outline-offset:2px}
.tbl th {vertical-align:bottom}
.tbl tbody tr:hover {background:var(--surface-1)}
.tbl td:has(.input), .tbl td:has(.select) {vertical-align:middle}
.tbl td .input[type="time"] {min-width:110px}
.tbl td .input[type="date"] {min-width:145px}
.tbl td .btn-row {min-width:max-content}
.badge--gold {background:var(--surface-2);color:var(--text)}
.field .req {color:var(--text-muted)}
.empty {text-align:left;justify-items:start;max-width:760px;padding:28px 0;gap:12px}
.empty p {line-height:24px;max-width:68ch}
.gate-card, .wizard {box-shadow:none;border-top-color:var(--line)}
.gate-brand span {font:500 13px/20px var(--font-sans);text-transform:none;letter-spacing:0;color:var(--text-muted)}
.gate-card .btn--primary {min-height:44px}
.boot {font:500 14px/20px var(--font-sans);letter-spacing:0;text-transform:none}
.image-field input[type="file"]::file-selector-button {font:500 13px/20px var(--font-sans);letter-spacing:0;text-transform:none;min-height:44px;border-radius:4px}
.image-field input[type="file"] {max-width:100%}
details.advanced>summary {display:flex;align-items:center;padding-block:10px;min-height:44px}
details.advanced>summary::before, details.advanced>summary:hover {color:var(--text-strong)}
.dialog, dialog.dlg {border-top-color:var(--line-strong)}
.menu-pop {border-top-color:var(--line-strong)}
.menu-pop button, .menu-pop a {display:flex;align-items:center;min-height:44px;box-sizing:border-box}
.menu-pop button:hover, .menu-pop a:hover, .menu-pop button:focus-visible, .menu-pop a:focus-visible {background:var(--surface-2);color:var(--text-strong)}
.token-box {border-color:var(--line-strong);color:var(--text-strong)}
.type-cat {color:var(--text-muted);font-size:13px;line-height:20px}
.type-card:hover {border-top-color:var(--text-muted)}
:focus-visible {outline:2px solid var(--text-strong);outline-offset:2px;box-shadow:none}
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .seg button:focus-visible {outline:2px solid var(--text-strong);outline-offset:2px;box-shadow:none}
.btn,.btn--small,.field>label,.field>.field-label,.fieldset>legend,.group-label,.crumb,.tab,.kpi-l,.tbl th,.user-btn small,details.advanced>summary,.type-cat {
 text-transform:none;letter-spacing:0;font-family:var(--font-sans);
}
.seg {border-radius:5px;background:transparent;border-color:var(--line-strong);padding:3px}
.seg button {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:3px;font-size:14px;line-height:20px;min-height:44px;min-width:44px;padding:8px 14px}
.hall-hero {gap:18px}
.hall-hero__stage {border:1px solid var(--line);background:var(--bg)}
.hall-hero__stage::before {display:none}
body[data-module="denik"] .content>.card {padding:0;background:transparent;border:0;gap:16px}
.feed--wide {gap:0;border-top:1px solid var(--line)}
.feed--wide li {padding:16px 0;border-bottom:1px solid var(--line);gap:8px;font-size:14px;line-height:22px}
.intg-list {gap:0;border-top:1px solid var(--line)}
.intg {grid-template-columns:minmax(0,1fr);background:transparent;border:0;border-bottom:1px solid var(--line);padding:20px 0;gap:12px}
.intg:hover {border-left-color:transparent}
.intg-title {gap:8px 12px}
.intg-title b {font-size:17px;line-height:24px;font-weight:600}
.intg-title>.muted {font-size:13px}
.intg-meta {font-size:13px;line-height:20px;margin-top:9px;max-width:76ch}
.intg-err {font-size:13px;line-height:20px}
.intg .btn-row {justify-content:space-between;gap:18px}
.kpis {gap:0;border-block:1px solid var(--line)}
.kpi {background:transparent;border:0;border-right:1px solid var(--line);padding:16px 12px}
.kpi:last-child {border:0}
.kpi-l {font-size:13px;font-weight:500;line-height:20px}
.kpi-v {font-size:26px;line-height:36px;font-weight:600}
.bar-fill {background:var(--text-muted)}

/* Event metadata is explicit markup: no actor inferred from the assigned agent. */
.feed li.feed-entry {display:grid;grid-template-columns:7px 43px minmax(0,1fr);gap:6px 10px;padding:15px 0;align-items:start;font-size:14px;line-height:22px;border-bottom:1px solid var(--line)}
.feed .f-body {grid-column:3}
.feed .feed-entry>.f-body {display:block;min-width:0}
.feed .f-time {color:var(--text-muted);font-size:13px;line-height:22px;font-variant-numeric:tabular-nums}
.feed .f-text {color:var(--text-strong)}
.feed .f-meta {display:flex;gap:8px 12px;margin-top:5px;font:400 12px/18px var(--font-sans);flex-wrap:wrap}
.feed .f-meta span {grid-column:auto;grid-row:auto;text-align:left;overflow-wrap:anywhere}
.feed .f-meta span::before {content:none}
.feed .f-actor {color:var(--text)}
.feed .f-source {grid-column:3;font-size:12px;line-height:20px;color:var(--text-muted);text-align:left;overflow-wrap:anywhere}
.feed .f-type {color:var(--text-muted)}
.feed li.feed-state {display:block;border:0}
.rail .feed li.feed-entry {grid-template-columns:7px 43px minmax(0,1fr)}
.rail .f-time {grid-column:2}.rail .f-body,.rail .f-source {grid-column:3;text-align:left}
body[data-module="prodej"] .content>.card,
body[data-module="nabidka"] .stack>.card {border:0;background:transparent;padding:0}
body[data-module="nabidka"] .stack>.card+.card {border-top:1px solid var(--line);padding-top:24px}
body[data-module="nastaveni"] .content>.stack {max-width:1100px}
body[data-module="nastaveni"] .form {gap:28px}
body[data-module="nastaveni"] .fieldset+.fieldset {border-top:1px solid var(--line);padding-top:24px}
body[data-module="nastaveni"] .content>div>.stack>.btn-row {position:sticky;bottom:0;z-index:2;background:var(--bg);border-top:1px solid var(--line);padding:16px 0}
.offer-row:has(> :nth-child(5)) {grid-template-columns:repeat(2,minmax(0,1fr))}
.offer-row:has(> :nth-child(5))>:first-child {grid-column:1/-1}
.offer-row:has(> :nth-child(5))>:nth-child(4) {grid-column:1/-1;width:100%}
.offer-row>* {min-width:0;max-width:100%}
.flags {min-width:150px;max-width:220px}
.flags .chip {min-height:44px;padding:8px 10px;font-size:12px}
.intg .check {white-space:nowrap}
.intg .btn-row {flex-wrap:nowrap}
.kpis {grid-template-columns:repeat(2,minmax(0,1fr))}
.kpi {border-bottom:1px solid var(--line)}
.kpi-v {font-variant-numeric:tabular-nums}

/* Larger screens (mobile first: the rules above are the phone). */
.agents-net {height:max(560px,calc(100dvh - 190px))}
@media(min-width:821px) {
 .btn,.btn--small {min-height:40px;min-width:0;padding-block:9px}
 .input,.select,.textarea {min-height:42px;font-size:var(--fs-14)}
 .day-input {min-height:40px;font-size:14px}
 .check {min-height:40px;min-width:0}
 .chip {padding:8px 11px;min-height:40px;min-width:0}
 .chips {gap:5px;flex-wrap:wrap;overflow-x:visible;width:auto;padding-bottom:0}
 .flags .chip {min-height:40px}
 .seg button {min-height:36px;min-width:0}
 details.advanced>summary {min-height:40px;padding-block:8px}
 .menu-pop button, .menu-pop a {min-height:40px}
 .image-field input[type="file"]::file-selector-button {min-height:40px}
 .card {padding:24px}
 .agents-net {height:max(480px,calc(100dvh - 242px));min-height:0}
 body[data-module="denik"] .content>.card {gap:24px}
 .filter-bar>.btn-row {width:auto;display:flex;grid-template-columns:none}
 .filter-bar select,.filter-bar input {width:auto}
 .feed--wide li {padding:17px 0;gap:12px;font-size:15px}
 .intg {grid-template-columns:minmax(0,1fr) auto;padding:24px 0;gap:24px}
 .intg-meta {line-height:21px}
 .intg .btn-row {justify-content:end}
 .kpis {grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
 .kpi {padding:18px 20px}
 .kpi-v {font-size:30px}
 .feed li.feed-entry {grid-template-columns:7px 54px minmax(0,1fr) 170px;gap:8px 14px}
 .feed .f-body {grid-column:auto}
 .feed .f-source {grid-column:auto;text-align:right}
 .feed .f-meta {line-height:19px}
 .rail .feed li.feed-entry {grid-template-columns:7px minmax(0,1fr)}
 .rail .f-body,.rail .f-source {grid-column:2}
}

/* Přehled: how the log is doing, at the very bottom of the page */
.log-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--text-muted); }
.log-foot[hidden] { display: none; }
.log-foot .dot { display: inline-block; margin-right: 7px; }

/* Deník › Živě: the number of events beside the search */
/* as high as the search beside it; flat, without a frame, so it does not look like a button */
.count-tile { display: inline-flex; align-items: center; align-self: stretch; gap: 5px; padding: 0 4px 0 10px; border: 0; background: none; font-size: 13px; color: var(--text-muted); white-space: nowrap; cursor: default; user-select: none; }
.count-tile b { color: var(--text-strong); font-weight: 700; }

/* Kancelář live (13. 11. 2026, Štěpán): the robots narrower (without the stream panel), the tiles of today beside them in
   two columns, the cards of the day under both. On a narrow window the tiles go under the robots. */
.office-live { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.office-side { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
/* on a wide window the column is at least as tall as the robots (Štěpán 13. 11. 2026); a longer one runs on under
   them and the robots stay in view beside it (15. 11. 2026, below) */
@media (min-width: 821px) {
  .office-live { align-items: stretch; }
  /* the cards are as high as their lines; what the robots leave free under them is shared evenly (15. 11. 2026: rows
     of one height made every card as high as the longest one and the column four times that) */
  .office-side { align-content: stretch; min-height: 0; }
  .shell-body .office-side .card { min-height: 0; overflow: auto; padding: 14px 18px; }
  .shell-body .office-side .card .card-head { margin-bottom: 6px; }
}
@container win (max-width: 1050px) {
  .office-side { grid-template-rows: none; }
}
.office-side .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.office-side .kpis > .kpi:first-child { grid-column: 1 / -1; } /* Tržba across both columns */
/* lower tiles beside the robots (Štěpán 13. 11. 2026) */
.shell-body .office-side .kpi { padding-block: 10px; gap: 2px; }
.shell-body .office-side .kpi-v { font-size: 22px; line-height: 28px; }
@media (min-width: 821px) {
  .office-live { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
  /* The scene keeps its own height: what the window shows at once, and never much higher than wide, because the
     camera of the scene keeps its vertical angle and a higher picture cuts the robots at its sides. Until 15. 11. 2026
     it stretched with the column beside it; on a busy day (twelve hours in Rytmus dne) that made it 1 900 px high and
     the robots left the picture. When the column is longer, the scene stays in view beside it while the page scrolls. */
  .office-live .hall-hero { align-self: start; position: sticky; top: var(--space-3, 12px); }
  .office-live .hall-hero__stage { container-type: inline-size; }
  .office-live .agents-net { height: max(460px, min(calc(100dvh - 260px), 78cqw)); min-height: 0; }
}
@container win (max-width: 1050px) {
  .office-live { grid-template-columns: minmax(0, 1fr); }
}
/* Kancelář without the robots (a window under 1200 px, js/modules/kancelar.js): the overview of the day takes the whole
   width, the tiles in one row as they fit and the cards two beside each other where there is room */
.office-live.office-live--plain { grid-template-columns: minmax(0, 1fr); align-items: start; }
.office-live--plain .office-side { grid-template-rows: none; align-content: start; }
.office-live--plain .office-side .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.office-live--plain .office-side .kpis > .kpi:first-child { grid-column: auto; }
@container win (min-width: 900px) {
  .office-live--plain .office-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-live--plain .office-side > .kpis { grid-column: 1 / -1; }
}

