/*
 * NoQ redesign, version 3 «Кольцо свежести» (freshness ring).
 * Loaded last (index.html link; main.tsx keeps it last in development), so it overrides
 * tokens.css, app.css and src/styles/redesign.css. Cards differ from the page only slightly.
 *
 * 1. Palette per theme (--v-*)   2. Mapping onto the site tokens   3. Chrome (header, footer, dialog)
 * 4. Letovo page and count cards  5. Places, content and developer pages   6. Motion and forced colours
 */

/* ---------- 1. Palette ---------- */
/* Letovo school colours: navy #0d3174 and yellow #fdc300 (sampled from assets/letovo-original.png). */
:root {
  --v-bg: #f5f7fb; --v-surface: #edf1f8; --v-surface-2: #e5ebf5; --v-rule: #dfe5f0; --v-track: #dce3ef;
  --v-ink: #0d3174; --v-ink-2: #1c4590; --v-muted: #56627e; --v-field: #7f8aa3;
  --v-arc: var(--v-ink); --v-fresh: #2c6650; --v-nodata: #a51f1b; --v-caution-bg: #fff6d6;
  --v-backdrop: rgb(13 49 116 / .4); --v-shadow: 0 1px 2px rgb(13 49 116 / .05);
  --v-logo-filter: none; --v-photo-filter: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --v-bg: #0a1630; --v-surface: #0f1d3d; --v-surface-2: #142448; --v-rule: #1a2a50; --v-track: #1e2f57;
    --v-ink: #eef2fb; --v-ink-2: #d3dcf0; --v-muted: #a3aecb; --v-field: #4f5f86;
    --v-fresh: #6fbf9a; --v-nodata: #f4a49f; --v-caution-bg: #1d2236;
    --v-backdrop: rgb(2 8 22 / .66); --v-shadow: none;
    --v-logo-filter: brightness(0) invert(.95); --v-photo-filter: brightness(.94);
  }
}
:root[data-theme='dark'] {
  --v-bg: #0a1630; --v-surface: #0f1d3d; --v-surface-2: #142448; --v-rule: #1a2a50; --v-track: #1e2f57;
  --v-ink: #eef2fb; --v-ink-2: #d3dcf0; --v-muted: #a3aecb; --v-field: #4f5f86;
  --v-fresh: #6fbf9a; --v-nodata: #f4a49f; --v-caution-bg: #1d2236;
  --v-backdrop: rgb(2 8 22 / .66); --v-shadow: none;
  --v-logo-filter: brightness(0) invert(.95); --v-photo-filter: brightness(.94);
}

/* ---------- 2. Site tokens (higher specificity than every theme rule in tokens.css) ---------- */
:root:root:root {
  --color-bg: var(--v-bg); --color-surface: var(--v-surface); --color-surface-strong: var(--v-surface-2);
  --color-on-strong: var(--v-ink); --color-on-strong-muted: var(--v-muted); --color-on-strong-accent: var(--v-ink);
  --color-on-strong-rule: var(--v-rule);
  --color-text: var(--v-ink); --color-text-muted: var(--v-muted); --color-border: var(--v-rule); --color-field-border: var(--v-field);
  --color-primary: var(--v-ink); --color-primary-hover: var(--v-ink-2); --color-on-primary: var(--v-bg);
  --color-selected: var(--v-ink); --color-on-selected: var(--v-bg); --color-signal: var(--v-ink);
  --color-link: var(--v-ink); --color-icon: var(--v-muted);
  --color-count-surface: var(--v-surface); --color-count-border: transparent; --color-directory-row: var(--v-surface);
  --color-school-logo-bg: transparent; --school-logo-padding: 0px;
  --color-current: var(--v-fresh); --color-nodata: var(--v-nodata); --color-nodata-bg: var(--v-surface);
  --color-caution: var(--v-ink); --color-caution-bg: var(--v-caution-bg); --color-neutral-bg: var(--v-surface);
  --color-demo-bg: var(--v-caution-bg); --color-on-demo: var(--v-ink);
  --color-focus: var(--v-ink); --color-focus-on-strong: var(--v-ink); --color-backdrop: var(--v-backdrop);
  --skeleton: var(--v-surface-2);
  /* names used by src/styles/redesign.css and the page stylesheets */
  --paper: var(--v-bg); --surface: var(--v-surface); --ink: var(--v-ink); --muted: var(--v-muted); --line: var(--v-rule);
  --forest: var(--v-ink); --lime: var(--v-fresh); --soft-lime: var(--v-surface);
  --gutter: clamp(16px, 4vw, 56px); --container: 84rem; --radius-md: 20px;
}

/* ---------- 3. Chrome ---------- */
body { background: var(--v-bg); color: var(--v-ink); }
:focus-visible { outline: 2px solid var(--v-ink); outline-offset: 3px; }
.demo-banner { background: var(--v-caution-bg); color: var(--v-ink); font-size: 12.5px; font-weight: 500; line-height: 1.45; padding-block: 8px; }
.demo-banner strong { font-weight: 750; }

.site-header { background: var(--v-bg); border: 0; }
.header-inner { min-height: 76px; padding-block: 10px; gap: 22px; }
.lockup { display: inline-flex; color: var(--v-ink); }
.lockup-logo { display: block; width: 104px; height: auto; }
.header-school { border-left: 1px solid var(--v-rule); padding-left: 20px; }
.header-school .letovo-logo, .letovo-logo { filter: var(--v-logo-filter); }
.header-school .letovo-logo { width: 128px; }
.main-nav { font-size: 16px; gap: clamp(18px, 2.6vw, 40px); }
.main-nav a { color: var(--v-ink); }
.main-nav a:hover { color: var(--v-muted); }
.main-nav a[aria-current='page']::after { height: 2px; background: var(--v-ink); }
.location-trigger { background: var(--v-surface); color: var(--v-ink); font-weight: 650; }
.location-trigger:hover { background: var(--v-surface-2); }
.icon-button { color: var(--v-ink); }
.icon-button:hover { background: var(--v-surface); }
.locale-toggle { color: var(--v-muted); }
.locale-toggle:hover { color: var(--v-ink); }
.developer-mode-badge { background: var(--v-surface); color: var(--v-ink); }
.mobile-navigation { background: var(--v-bg); color: var(--v-ink); border-bottom: 1px solid var(--v-rule); box-shadow: 0 16px 24px rgb(0 0 0 / .04); }
.mobile-navigation > a { color: var(--v-ink); }
.mobile-preferences select { background: var(--v-surface); color: var(--v-ink); border-color: var(--v-field); }

.site-footer { background: var(--v-bg); color: var(--v-ink); }
.footer-brand .lockup-logo { width: 86px; }
.footer-brand p, .footer-credits { color: var(--v-muted); }
.footer-links a { color: var(--v-ink); }
.footer-credits a { color: var(--v-ink); }

.location-dialog { background: var(--v-bg); color: var(--v-ink); border: 0; box-shadow: 0 24px 80px rgb(0 0 0 / .18); }
@media (min-width: 761px) { .location-dialog { border-radius: 24px; } }
.location-dialog::backdrop { background: var(--v-backdrop); backdrop-filter: blur(3px); }
.all-places-link, .queue-select-row .ui-icon:first-child { color: var(--v-ink); }
.queue-select-row { color: var(--v-ink); }
.queue-select-row:hover { color: var(--v-muted); }
.selected-place { background: var(--v-surface); color: var(--v-ink); }
.selected-place span, .upcoming-place span { color: var(--v-muted); }
.upcoming-place { border: 0; background: transparent; }
.letovo-junior-logo { background: transparent; padding: 0; filter: var(--v-logo-filter); }
.search-field { background: var(--v-surface); border: 1px solid transparent; color: var(--v-muted); }
.search-field:hover { border-color: var(--v-rule); }
.search-field:focus-within { border-color: var(--v-field); outline: 2px solid var(--v-ink); outline-offset: 2px; }

.btn-primary { background: var(--v-ink); border-color: var(--v-ink); color: var(--v-bg); border-radius: 999px; }
.btn-primary:hover { background: var(--v-ink-2); border-color: var(--v-ink-2); }
.btn-secondary { color: var(--v-ink); border-color: var(--v-rule); border-radius: 999px; }
.btn-secondary:hover { background: var(--v-surface); }
.text-link, .content-link { color: var(--v-ink); text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.text-link:hover, .content-link:hover { text-decoration-color: currentColor; }
.eyebrow { color: var(--v-muted); }
.status-dot { background: var(--v-fresh); }
.status-dot.preparing { background: var(--v-field); }

/* ---------- 4. Letovo page ---------- */
.fq-page { padding-bottom: 8px; }
.letovo-page .fq-intro { display: block; padding: clamp(20px, 3vw, 40px) 0 clamp(14px, 2vw, 26px); }
.fq-intro .eyebrow { margin: 0 0 8px; font-size: 11px; }
.fq-intro h1 { margin: 0; font-size: clamp(28px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -.04em; }
.letovo-page .fq-intro > p { margin: 8px 0 0; padding: 0; border: 0; color: var(--v-muted); font-size: clamp(14px, 1.3vw, 17px); }

.queue-cards-grid.fq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); }
.fq-grid.selected-canteen, .fq-grid.selected-cafe { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.fq-grid > .queue-current { order: -1; }

.fq-card {
  position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0;
  padding: clamp(14px, 2.2vw, 32px) clamp(10px, 2vw, 32px) clamp(16px, 2.2vw, 30px);
  background: var(--v-surface); border-radius: clamp(18px, 2vw, 26px); color: var(--v-ink); text-align: center;
  transition: background-color .2s;
}
.fq-card h2, .fq-card p { margin: 0; }
.fq-head { display: flex; align-items: center; justify-content: center; gap: 7px; max-width: 100%; }
.fq-head .ui-icon { width: 20px; height: 20px; flex: 0 0 20px; color: var(--v-muted); }
.fq-head h2 { font-size: clamp(15px, 1.5vw, 21px); line-height: 1.25; letter-spacing: -.02em; font-weight: 750; overflow-wrap: anywhere; }
.fq-head a { color: inherit; text-decoration: none; }
.fq-head a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.fq-card:has(.fq-head a:hover) { background: var(--v-surface-2); }
.fq-card:has(.fq-head a:focus-visible) { outline: 2px solid var(--v-ink); outline-offset: 3px; }
.fq-head a:focus-visible { outline: 0; }

.fq-gauge-ring { display: grid; justify-items: center; width: min(100%, clamp(124px, 17vw, 236px)); margin: clamp(8px, 1.2vw, 18px) 0 clamp(6px, 1vw, 12px); container-type: inline-size; }
.fq-gauge-ring .fq-reading { display: contents; }
.fq-gauge-ring .fq-ring, .fq-gauge-ring .fq-value { grid-area: 1 / 1; }
.fq-ring { display: block; width: 100%; height: auto; overflow: visible; }
.fq-ring-track { fill: none; stroke: var(--v-track); stroke-width: 6; }
.fq-ring-reveal { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .26s linear; }
.fq-ring-arc { fill: none; stroke: var(--v-arc); stroke-width: 6; }
.fq-ring-arc.fq-dashed { stroke: var(--v-muted); stroke-dasharray: 3.2 5.6; }
.fq-value { align-self: center; font-size: 46px; font-size: 34cqi; font-weight: 800; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.fq-last .fq-value, .fq-value-empty { color: var(--v-muted); }
.fq-unit { grid-area: 2 / 1; margin-top: 8px; color: var(--v-muted); font-size: clamp(12px, 1.1vw, 15px); line-height: 1.3; }
.fq-none .fq-unit, .fq-loading .fq-unit { color: var(--v-ink); font-weight: 650; }

.fq-facts { display: grid; gap: 4px; justify-items: center; width: 100%; }
.fq-status { display: flex; align-items: baseline; justify-content: center; gap: 7px; font-size: clamp(12.5px, 1.1vw, 15px); line-height: 1.35; font-weight: 600; }
.fq-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--v-nodata); transform: translateY(-1px); }
.fq-fresh .fq-dot { background: var(--v-fresh); box-shadow: 0 0 0 3px color-mix(in srgb, var(--v-fresh) 18%, transparent); }
.fq-last .fq-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--v-muted); }
.fq-loading .fq-dot { background: var(--v-field); }
.fq-last .fq-status, .fq-loading .fq-status, .fq-none .fq-status { color: var(--v-muted); font-weight: 500; }
.fq-age { color: var(--v-muted); font-size: clamp(12px, 1vw, 14px); font-variant-numeric: tabular-nums; line-height: 1.4; }
.fq-none .fq-age, .fq-loading .fq-age { max-width: 30ch; }
.fq-estimate { margin-top: clamp(6px, 1vw, 14px) !important; padding-top: clamp(8px, 1vw, 14px); border-top: 1px solid var(--v-rule); width: 100%; color: var(--v-muted); font-size: clamp(12px, 1vw, 14px); line-height: 1.4; }
.fq-estimate time { color: var(--v-ink); font-weight: 650; white-space: nowrap; }
.fq-last .fq-estimate time { color: var(--v-muted); }
.fq-meaning { margin-top: auto !important; padding-top: 12px; color: var(--v-muted); font-size: 11.5px; line-height: 1.45; }
.fq-grid.selected-all .fq-meaning, .fq-grid.selected-all :is(.fq-none, .fq-loading) .fq-age { display: none; }

.fq-other { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 18px; border-radius: 16px; background: var(--v-surface); color: var(--v-ink); text-decoration: none; }
.fq-other:hover { background: var(--v-surface-2); }
.fq-other > .ui-icon:first-child { color: var(--v-muted); }
.fq-other > .ui-icon:last-child { margin-left: auto; }
.fq-other strong { display: block; font-size: 16px; line-height: 1.3; }
.fq-other span span { display: block; color: var(--v-muted); font-size: 13px; }

.fq-legend { display: flex; gap: 10px; align-items: flex-start; max-width: 76ch; margin: 16px 0 0; color: var(--v-muted); font-size: 12.5px; line-height: 1.5; }
.fq-legend-mark { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: conic-gradient(var(--v-ink) 0 68%, var(--v-track) 0); -webkit-mask: radial-gradient(circle, transparent 0 4.5px, #000 5px); mask: radial-gradient(circle, transparent 0 4.5px, #000 5px); }
.letovo-page .queue-caption { margin: 18px 0 0; padding: 14px 0; border-top: 1px solid var(--v-rule); color: var(--v-muted); }
.letovo-page .queue-explanation { padding: 6px 0 34px; }

/* Place page: the selected card turns horizontal on wider screens. */
@media (min-width: 761px) {
  .fq-card.fq-selected { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto;
    column-gap: clamp(28px, 4.5vw, 72px); align-items: start; text-align: left; padding: clamp(24px, 3vw, 44px); }
  .fq-selected .fq-gauge { grid-column: 1; grid-row: 1 / -1; align-self: center; width: 100%; margin: 0; }
  .fq-selected .fq-head, .fq-selected .fq-facts, .fq-selected .fq-meaning { grid-column: 2; }
  .fq-selected .fq-head { justify-content: flex-start; align-self: end; margin-bottom: 14px; }
  .fq-selected .fq-head h2 { font-size: clamp(26px, 3vw, 42px); letter-spacing: -.04em; }
  .fq-selected .fq-head .ui-icon { width: 28px; height: 28px; flex-basis: 28px; }
  .fq-selected .fq-facts { justify-items: start; gap: 6px; }
  .fq-selected .fq-status { justify-content: flex-start; font-size: 17px; }
  .fq-selected .fq-age, .fq-selected .fq-estimate { font-size: 15px; }
  .fq-selected .fq-estimate { max-width: 44ch; }
  .fq-grid.selected-canteen, .fq-grid.selected-cafe { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); align-items: start; }
  .fq-grid.selected-canteen > .queue-other, .fq-grid.selected-cafe > .queue-other { order: 1; }
}
@media (max-width: 760px) {
  .fq-gauge-ring { width: min(100%, 132px); }
  .fq-selected .fq-gauge-ring { width: min(100%, 210px); }
  .fq-selected .fq-head h2 { font-size: 22px; }
  .fq-estimate span { display: block; }
  .fq-selected .fq-estimate span { display: inline; }
}
@media (max-width: 340px) {
  .queue-cards-grid.fq-grid { gap: 8px; }
  .fq-card { padding-inline: 8px; }
}

/* Developer page: same card, aligned with the developer column. */
.developer .fq-card { width: 100%; align-items: center; padding: 24px; }
.developer-workspace .developer > .developer-card > .fq-card { width: 100%; }

/* ---------- 5. Places, content and developer pages ---------- */
body .page-heading h1, body .content-heading h1 { letter-spacing: -.045em; }
body .filter-pill { border-color: var(--v-rule); color: var(--v-ink); }
body .filter-pill:hover { border-color: var(--v-field); }
body .filter-pill[aria-pressed='true'] { background: var(--v-ink); border-color: var(--v-ink); color: var(--v-bg); }
body .organization-row { background: var(--v-surface); border-color: transparent; box-shadow: none; }
body .organization-logo, body .organization-summary { border-color: var(--v-rule); }
body .connect-strip { border-color: var(--v-rule); }

body .inquiry-panel, body .inquiry-panel-connection { color-scheme: inherit; background: var(--v-surface); color: var(--v-ink); border: 0; box-shadow: none; }
body .inquiry-tag, body .inquiry-panel-connection .inquiry-tag { color: var(--v-muted); }
body .inquiry-heading h2, body .inquiry-panel-connection .inquiry-heading h2 { color: var(--v-ink); }
body .inquiry-intro, body .inquiry-privacy, body .inquiry-panel-connection .inquiry-intro, body .inquiry-panel-connection .inquiry-privacy { color: var(--v-muted); }
body .inquiry-form input,
body .inquiry-form select,
body .inquiry-form textarea,
body .inquiry-panel-connection .inquiry-form input,
body .inquiry-panel-connection .inquiry-form select,
body .inquiry-panel-connection .inquiry-form textarea { background: var(--v-bg); color: var(--v-ink); border-color: var(--v-field); }
body .inquiry-form input::placeholder, body .inquiry-form textarea::placeholder { color: var(--v-muted); }
body .inquiry-form input:focus-visible,
body .inquiry-form select:focus-visible,
body .inquiry-form textarea:focus-visible,
body .inquiry-panel-help :is(a, button):focus-visible { outline-color: var(--v-ink); }
body .inquiry-submit.btn, body .inquiry-panel-connection .inquiry-submit.btn { background: var(--v-ink); color: var(--v-bg); border-radius: 999px; }
body .inquiry-submit.btn:hover, body .inquiry-panel-connection .inquiry-submit.btn:hover { background: var(--v-ink-2); }
body .inquiry-email, body .inquiry-result, body .inquiry-panel-connection .inquiry-email, body .inquiry-panel-connection .inquiry-result { color: var(--v-ink); }
body .about-purpose { background: var(--v-surface); color: var(--v-ink); }
body .about-purpose h2 { color: var(--v-ink); }
body .about-purpose .eyebrow, body .about-purpose p { color: var(--v-muted); }
body .document-draft { background: var(--v-surface); color: var(--v-muted); }
body .step-number { border-color: var(--v-field); color: var(--v-ink); }
body .document-download { border-color: var(--v-rule); border-radius: 999px; color: var(--v-ink); }
body .content-page :is(a, button, summary):focus-visible { outline: 2px solid var(--v-ink); outline-offset: 4px; }

/* Team: round portraits, the ring motif. */
body .team-list { gap: clamp(18px, 2.4vw, 32px); }
body .team-member { text-align: center; }
body .team-photo { width: 78%; margin: 0 auto; border-radius: 50%; aspect-ratio: 1; object-fit: cover; filter: var(--v-photo-filter);
  box-shadow: 0 0 0 5px var(--v-bg), 0 0 0 6px var(--v-track); }
body .team-list h3 { max-width: none; margin-top: 18px; }

body .developer-login-intro, body .developer-sidebar { background: var(--v-surface); color: var(--v-ink); }
body .developer-login-intro > p:not(.developer-kicker) { color: var(--v-muted); opacity: 1; }
body .developer-login-intro li { border-color: var(--v-rule); }
body .developer-login-intro .developer-kicker, body .developer-sidebar > .developer-kicker { color: var(--v-muted); opacity: 1; }
body .developer-sidebar nav button[aria-current='page'] { background: var(--v-bg); color: var(--v-ink); }
body .developer-sidebar nav button:not([aria-current]):hover { background: var(--v-surface-2); }
body .developer-sidebar-note { color: var(--v-muted); opacity: 1; }
body .developer-org-row { background: var(--v-surface); border-color: transparent; }
body .developer-draft-status, body .developer-org-symbol, body .developer-local-note { background: var(--v-surface-2); color: var(--v-ink); }
body .developer-workspace-notice { border-left-color: var(--v-ink); }
body .developer-icon-button:hover { background: var(--v-surface); }
body .developer-org-drawer { background: var(--v-bg); border-left-color: var(--v-rule); }
body .developer-org-drawer input, body .developer-org-drawer select, body .developer-org-drawer textarea { border-color: var(--v-field); }
body .developer-workspace button:focus-visible,
body .developer-org-drawer button:focus-visible,
body .developer-org-drawer input:focus-visible,
body .developer-org-drawer select:focus-visible,
body .developer-org-drawer textarea:focus-visible { outline: 2px solid var(--v-ink); }
body .temp-camera-login { background: var(--v-surface); border: 0; }
body .temp-camera-login input { background: var(--v-bg); border-color: var(--v-field); }
body .session-row, body .card { border-color: var(--v-rule); }

/* ---------- 6. Motion and forced colours ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fq-loading .fq-ring-track { animation: fq-breathe 1.4s ease-in-out infinite alternate; }
  .fq-loading .fq-dot { animation: fq-breathe 1.4s ease-in-out infinite alternate; }
  @keyframes fq-breathe { from { opacity: 1; } to { opacity: .35; } }
}
@media (prefers-reduced-motion: reduce) {
  .fq-ring-reveal, .fq-card { transition: none; }
}
@media (forced-colors: active) {
  .fq-card, .fq-other { border: 1px solid CanvasText; }
  .fq-ring-arc { stroke: CanvasText; }
  .fq-ring-track { stroke: GrayText; }
  .fq-dot { forced-color-adjust: none; border: 1px solid CanvasText; }
}

/* ---------- 7. Colour: Letovo navy and yellow ----------
 * Navy (#0d3174) is the text and the canteen; Letovo yellow (#fdc300) is the café and the highlights.
 * Each place's hue colours its ring and icon badge, and faintly tints its card (same lightness as the plain
 * surface, so cards stay quiet). A yellow line under the header echoes the school's identity.
 */
:root {
  --c-navy: #0d3174; --c-yellow: #fdc300; --c-label: #1c4590; --c-focus: #0d3174;
  --c-yellow-tint: #fff4cc; --c-yellow-soft: #fff9e6;
  --c-canteen: #0d3174; --c-canteen-tint: #eaeff8; --c-canteen-tint-2: #e1e8f5; --c-canteen-badge: #0d3174; --c-canteen-badge-ink: #fdc300;
  --c-cafe: #efb400; --c-cafe-tint: #fbf6e6; --c-cafe-tint-2: #f7efd5; --c-cafe-badge: #fdc300; --c-cafe-badge-ink: #0d3174;
  --c-primary: #0d3174; --c-primary-hover: #1c4590; --c-on-primary: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --c-label: #fdc300; --c-focus: #fdc300; --c-yellow-tint: #1c2747; --c-yellow-soft: #1a2138;
    --c-canteen: #9db8f2; --c-canteen-tint: #0f1d3d; --c-canteen-tint-2: #142448; --c-canteen-badge: #1f4596; --c-canteen-badge-ink: #fdc300;
    --c-cafe: #fdc300; --c-cafe-tint: #161f38; --c-cafe-tint-2: #1c2541; --c-cafe-badge: #fdc300; --c-cafe-badge-ink: #0d3174;
    --c-primary: #fdc300; --c-primary-hover: #ffd54a; --c-on-primary: #0d3174;
  }
}
:root[data-theme='dark'] {
  --c-label: #fdc300; --c-focus: #fdc300; --c-yellow-tint: #1c2747; --c-yellow-soft: #1a2138;
  --c-canteen: #9db8f2; --c-canteen-tint: #0f1d3d; --c-canteen-tint-2: #142448; --c-canteen-badge: #1f4596; --c-canteen-badge-ink: #fdc300;
  --c-cafe: #fdc300; --c-cafe-tint: #161f38; --c-cafe-tint-2: #1c2541; --c-cafe-badge: #fdc300; --c-cafe-badge-ink: #0d3174;
  --c-primary: #fdc300; --c-primary-hover: #ffd54a; --c-on-primary: #0d3174;
}
[data-place='canteen'] { --place: var(--c-canteen); --place-tint: var(--c-canteen-tint); --place-tint-2: var(--c-canteen-tint-2); --place-badge: var(--c-canteen-badge); --place-badge-ink: var(--c-canteen-badge-ink); }
[data-place='cafe'] { --place: var(--c-cafe); --place-tint: var(--c-cafe-tint); --place-tint-2: var(--c-cafe-tint-2); --place-badge: var(--c-cafe-badge); --place-badge-ink: var(--c-cafe-badge-ink); }

/* Chrome */
.header-inner::after { border-bottom: 0; height: 3px; border-radius: 3px; background: var(--c-yellow); }
.main-nav a:hover { color: var(--v-ink-2); }
.main-nav a[aria-current='page']::after { height: 3px; background: var(--c-yellow); }
.location-trigger { background: var(--c-yellow-tint); color: var(--v-ink); }
.location-trigger:hover { background: var(--c-yellow); color: #0d3174; }
.eyebrow, .fq-intro .eyebrow { color: var(--c-label); }
.text-link, .content-link { text-decoration-color: var(--c-yellow); text-decoration-thickness: 2px; }
:focus-visible { outline-color: var(--c-focus); }
.demo-banner { background: var(--c-yellow-tint); }
.footer-links a:hover { color: var(--v-ink-2); text-decoration-color: var(--c-yellow); }
.footer-credits a { color: var(--v-ink); text-decoration-color: var(--c-yellow); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }

/* Count cards */
.fq-card[data-place] { background: var(--place-tint); }
.fq-card[data-place]:has(.fq-head a:hover) { background: var(--place-tint-2); }
.fq-card:has(.fq-head a:focus-visible) { outline-color: var(--c-focus); }
.fq-head .ui-icon { box-sizing: content-box; padding: 6px; border-radius: 50%; background: var(--place-badge, var(--v-surface-2)); color: var(--place-badge-ink, var(--v-ink)); }
.fq-fresh .fq-ring-arc { stroke: var(--place, var(--v-arc)); }
.fq-last .fq-ring-arc.fq-dashed { stroke: color-mix(in srgb, var(--place, var(--v-muted)) 40%, var(--v-muted)); }
.fq-estimate { border-top-color: color-mix(in srgb, var(--place, var(--v-rule)) 16%, var(--v-rule)); }
.fq-other[data-place] { background: var(--place-tint); }
.fq-other[data-place]:hover { background: var(--place-tint-2); }
.fq-other[data-place] > .ui-icon:first-child { box-sizing: content-box; padding: 7px; border-radius: 50%; background: var(--place-badge); color: var(--place-badge-ink); }
.fq-legend-mark { background: conic-gradient(var(--c-canteen) 0 34%, var(--c-cafe) 0 68%, var(--v-track) 0); }

/* Places, dialog and content pages */
body .filter-pill[aria-pressed='true'] { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.selected-place { background: var(--c-yellow-soft); }
.all-places-link .ui-icon { color: var(--v-ink); }
.queue-select-row[href='/canteen/'] .ui-icon:first-child { color: var(--c-canteen); }
.queue-select-row[href='/cafe/'] .ui-icon:first-child { color: var(--c-cafe); }
.status-dot.preparing { background: var(--c-yellow); }
body .inquiry-submit.btn, body .inquiry-panel-connection .inquiry-submit.btn { background: var(--c-primary); color: var(--c-on-primary); }
body .inquiry-submit.btn:hover, body .inquiry-panel-connection .inquiry-submit.btn:hover { background: var(--c-primary-hover); }
body .inquiry-tag, body .inquiry-panel-connection .inquiry-tag, body .about-purpose .eyebrow { color: var(--c-label); }
body .step-number { border-color: var(--c-yellow); color: var(--v-ink); }
body .how-flow li { border-top: 3px solid var(--v-rule); }
body .how-flow li:nth-child(odd) { border-top-color: var(--c-canteen); }
body .how-flow li:nth-child(even) { border-top-color: var(--c-yellow); }
body .how-flow li > span, body .document-outline li > span:first-child { color: var(--c-label); }
body .team-member:nth-child(odd) .team-photo { box-shadow: 0 0 0 5px var(--v-bg), 0 0 0 7px var(--c-canteen); }
body .team-member:nth-child(even) .team-photo { box-shadow: 0 0 0 5px var(--v-bg), 0 0 0 7px var(--c-yellow); }
body .developer-sidebar nav button[aria-current='page'] { background: var(--c-yellow-tint); color: var(--v-ink); }
body .developer-login-intro .developer-kicker { color: var(--c-label); }
@media (forced-colors: active) { .header-inner::after { background: CanvasText; } }

/* ---------- 8. Clearer colour ----------
 * Stronger place tints, a 4 px place-coloured stripe on top of each card, thicker rings,
 * a solid yellow place button and darker secondary text.
 */
:root {
  --v-muted: #46536f;
  --c-canteen-tint: #e2e9f7; --c-canteen-tint-2: #d8e1f3;
  --c-cafe: #f2b500; --c-cafe-tint: #fcf0c8; --c-cafe-tint-2: #f9e8b0;
  --v-track: #d3dbeb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --v-muted: #b6c0da;
    --c-canteen: #a9c3ff; --c-canteen-tint: #132a5c; --c-canteen-tint-2: #183168; --c-canteen-badge: #2a56b8;
    --c-cafe-tint: #2a2a3a; --c-cafe-tint-2: #33323f;
    --v-track: #243762;
  }
}
:root[data-theme='dark'] {
  --v-muted: #b6c0da;
  --c-canteen: #a9c3ff; --c-canteen-tint: #132a5c; --c-canteen-tint-2: #183168; --c-canteen-badge: #2a56b8;
  --c-cafe-tint: #2a2a3a; --c-cafe-tint-2: #33323f;
  --v-track: #243762;
}
.header-inner::after { height: 4px; border-radius: 4px; }
.fq-card[data-place], .fq-other[data-place] { box-shadow: inset 0 4px 0 var(--place); }
.fq-card[data-place] { padding-top: clamp(18px, 2.4vw, 34px); }
.fq-ring-track, .fq-ring-arc, .fq-ring-reveal { stroke-width: 8.5; }
.fq-fresh .fq-ring-track { stroke: var(--v-track); }
.fq-head .ui-icon { padding: 7px; }
.fq-head h2 { color: var(--v-ink); }
.fq-value { color: var(--v-ink); }
.fq-unit, .fq-age { color: var(--v-muted); }
.location-trigger { background: var(--c-yellow); color: #0d3174; }
.location-trigger:hover { background: #ffd23f; }
.location-trigger .ui-icon { color: #0d3174; }
.eyebrow, .fq-intro .eyebrow { font-weight: 800; }
.fq-legend-mark { width: 18px; height: 18px; flex-basis: 18px; }

/* ---------- 9. Larger place titles, shorter page ---------- */
.fq-head h2 { font-size: clamp(20px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.035em; font-weight: 800; }
.fq-head .ui-icon { width: 22px; height: 22px; flex-basis: 22px; }
.fq-other strong { font-size: 19px; letter-spacing: -.02em; }
.fq-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.fq-caption p { margin: 0 auto 0 0; }
@media (min-width: 761px) { .fq-selected .fq-head h2 { font-size: clamp(32px, 4vw, 56px); } }
@media (max-width: 760px) { .fq-selected .fq-head h2 { font-size: 28px; } }
@media (max-width: 560px) {
  .fq-grid.selected-all .fq-head { flex-direction: column; gap: 6px; }
  .fq-grid.selected-all .fq-head h2 { font-size: 20px; }
}

@media (max-width: 760px) { .fq-caption { align-items: flex-start; } }

/* ---------- 10. No circle around the number ----------
 * The number stands on its own; a short Letovo-coloured bar under it shows freshness
 * (full right after an update, empty after 6 s, dashed = last result, none = no data).
 */
.fq-gauge-bar { display: grid; justify-items: center; gap: 12px; width: 100%; margin: clamp(10px, 1.6vw, 22px) 0 clamp(10px, 1.2vw, 16px); }
.fq-gauge-bar .fq-reading { display: grid; justify-items: center; gap: 2px; }
.fq-gauge-bar .fq-value { font-size: clamp(72px, 9vw, 132px); line-height: .92; letter-spacing: -.06em; }
.fq-gauge-bar .fq-unit { margin: 0; }
.fq-bar { position: relative; display: block; width: min(100%, 210px); height: 6px; border-radius: 6px; background: var(--v-track); overflow: hidden; }
.fq-bar-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--place, var(--v-ink)); transition: clip-path .26s linear; }
.fq-bar-fill.fq-dashed { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--place, var(--v-muted)) 45%, var(--v-muted)) 0 8px, transparent 8px 12px); }
.fq-legend-mark { flex: 0 0 24px; width: 24px; height: 6px; margin-top: 8px; border-radius: 6px; -webkit-mask: none; mask: none;
  background: linear-gradient(90deg, var(--c-canteen) 0 34%, var(--c-cafe) 0 68%, var(--v-track) 0); }
@media (min-width: 761px) {
  .fq-selected .fq-gauge-bar { justify-items: start; margin: 0; }
  .fq-selected .fq-gauge-bar .fq-reading { justify-items: start; }
  .fq-selected .fq-gauge-bar .fq-value { font-size: clamp(120px, 13vw, 200px); }
  .fq-selected .fq-bar { width: min(100%, 260px); }
}
@media (max-width: 560px) {
  .fq-gauge-bar .fq-value { font-size: 64px; }
  .fq-selected .fq-gauge-bar .fq-value { font-size: 112px; }
  .fq-bar { width: min(100%, 140px); }
}
@media (prefers-reduced-motion: no-preference) { .fq-loading .fq-bar { animation: fq-breathe 1.4s ease-in-out infinite alternate; } }
@media (prefers-reduced-motion: reduce) { .fq-bar-fill { transition: none; } }
@media (forced-colors: active) { .fq-bar { border: 1px solid CanvasText; } .fq-bar-fill { forced-color-adjust: none; background: CanvasText; } }

/* ---------- 11. School break banner (src/letovo-breaks.ts) ---------- */
.fq-break { display: flex; align-items: center; gap: 10px; margin: 0 0 clamp(10px, 1.4vw, 16px); padding: 11px 16px; border-radius: 14px;
  background: var(--c-yellow); color: #0d3174; font-size: clamp(14px, 1.3vw, 17px); font-weight: 700; line-height: 1.35; }
.fq-break .ui-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.fq-break-now { background: #0d3174; color: #fff; }
.fq-break-now .ui-icon { color: var(--c-yellow); }
.fq-break-sample { margin-left: auto; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgb(13 49 116 / .12); }
.fq-break-now .fq-break-sample { background: rgb(255 255 255 / .16); }
@media (prefers-reduced-motion: no-preference) { .fq-break { animation: fq-rise .4s ease-out both; } @keyframes fq-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } } }
@media (forced-colors: active) { .fq-break { border: 1px solid CanvasText; } }

/* ---------- 12. Version 6: research-based changes (reports/Best website design practices 2026.md) ----------
 * Explicit per-card states, a level word with a 4-step meter, a live dot with "updated N s ago",
 * contrast-checked colours (no yellow on light), a pause control, 44 px controls, a two-colour focus ring.
 */
:root {
  --l-0: #2c6650; --l-1: #2f6fbf; --l-2: #c2410c; --l-3: #a51f1b; /* ≥4.7:1 on the light page */
  --c-cafe-bar: #8a6400;                                              /* 4.7:1 on the café tint; Letovo yellow is 1.6:1 */
  --c-live: #2c8a5f; --c-focus-a: #0d3174; --c-focus-b: #fdc300;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --l-0: #6fcf97; --l-1: #7fb0ff; --l-2: #ff9a6b; --l-3: #ff8a8a; --c-cafe-bar: #fdc300; --c-live: #6fcf97; --c-focus-a: #fdc300; --c-focus-b: #0d3174; }
}
:root[data-theme='dark'] { --l-0: #6fcf97; --l-1: #7fb0ff; --l-2: #ff9a6b; --l-3: #ff8a8a; --c-cafe-bar: #fdc300; --c-live: #6fcf97; --c-focus-a: #fdc300; --c-focus-b: #0d3174; }
[data-place='cafe'] { --place-bar: var(--c-cafe-bar); }
[data-place='canteen'] { --place-bar: var(--c-canteen); }

/* Focus: a navy ring with a yellow halo (yellow ring with navy halo in dark), visible on every surface. */
:focus-visible { outline: 3px solid var(--c-focus-a); outline-offset: 2px; box-shadow: 0 0 0 6px var(--c-focus-b); border-radius: 4px; }
.fq-card:has(.fq-head a:focus-visible) { outline: 3px solid var(--c-focus-a); outline-offset: 3px; box-shadow: 0 0 0 7px var(--c-focus-b); }
.theme-toggle { width: 44px; min-width: 44px; }
.locale-toggle { min-width: 44px; }

/* The first screen is the product: a narrower page on desktop, the pause control beside the heading. */
.fq-page { max-width: 1040px; margin-inline: auto; }
.letovo-page .fq-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fq-pause { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--v-rule);
  background: var(--v-surface); color: var(--v-ink); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; }
.fq-pause:hover { background: var(--v-surface-2); }
.fq-pause[aria-pressed='true'] { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.fq-pause-icon { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.fq-pause-icon.is-paused { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-block: 6px solid transparent; }

/* Card: level → number → freshness bar → live line → wait range. */
.fq6 .fq-level { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px; margin-top: 10px; font-weight: 750; font-size: clamp(15px, 1.4vw, 18px); color: var(--lv); }
.fq-level-0 { --lv: var(--l-0); } .fq-level-1 { --lv: var(--l-1); } .fq-level-2 { --lv: var(--l-2); } .fq-level-3 { --lv: var(--l-3); }
.fq-meter { display: inline-flex; gap: 3px; }
.fq-meter i { width: 7px; height: 16px; border-radius: 2px; background: color-mix(in srgb, var(--lv) 22%, transparent); }
.fq-meter i:nth-child(1) { height: 7px; } .fq-meter i:nth-child(2) { height: 10px; } .fq-meter i:nth-child(3) { height: 13px; }
.fq-meter { align-items: flex-end; }
.fq-meter i.on { background: var(--lv); }
.fq6 .fq-gauge-bar { margin-top: 6px; }
.fq6 .fq-reading { min-height: clamp(96px, 11vw, 150px); align-content: center; }
.fq6 .fq-bar-fill { background: var(--place-bar, var(--v-ink)); }
.fq6.fq-stale .fq-value, .fq6.fq-paused .fq-value { color: var(--v-muted); }
.fq6.fq-closed .fq-value { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.03em; color: var(--v-ink); }
.fq6.fq-none .fq-value, .fq6.fq-loading .fq-value { color: var(--v-muted); }

.fq-fresh-line { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; color: var(--v-muted); font-size: clamp(12.5px, 1.1vw, 14.5px); font-variant-numeric: tabular-nums; }
.fq-fresh-line time, .fq-fresh-line span:last-child { min-width: 0; }
.fq-live-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--v-nodata); }
.fq-live .fq-live-dot { background: var(--c-live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-live) 22%, transparent); }
.fq-live .fq-fresh-line { color: var(--v-ink); font-weight: 600; }
.fq-stale .fq-live-dot, .fq-paused .fq-live-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--v-muted); }
.fq-loading .fq-live-dot, .fq-closed .fq-live-dot { background: var(--v-field); }
.fq6 .fq-estimate strong { color: var(--v-ink); font-weight: 750; white-space: nowrap; }
.fq6.fq-stale .fq-estimate strong, .fq6.fq-paused .fq-estimate strong { color: var(--v-muted); }
.fq-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fq-legend-mark { background: linear-gradient(90deg, var(--c-canteen) 0 34%, var(--c-cafe-bar) 0 68%, var(--v-track) 0); }

@media (min-width: 761px) {
  .fq6.fq-selected .fq-level, .fq6.fq-selected .fq-fresh-line { justify-content: flex-start; }
  .fq6.fq-selected .fq-level { grid-column: 2; margin-top: 0; }
}
@media (max-width: 560px) {
  .fq6 .fq-reading { min-height: 88px; }
  .fq6 .fq-level { font-size: 14px; gap: 6px; }
  .fq-pause { padding: 0 14px; font-size: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .fq-live .fq-live-dot { animation: fq-live 2s ease-out infinite; }
  @keyframes fq-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-live) 45%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
}
@media (forced-colors: active) {
  .fq-meter i.on, .fq-live-dot { forced-color-adjust: none; background: CanvasText; }
  :focus-visible { box-shadow: none; }
}
.fq6.fq-stale .fq-level, .fq6.fq-paused .fq-level { --lv: var(--v-muted); }

/* ---------- 13. Version 7 «Табло» (departure board) ----------
 * One row per place: name, level and freshness on the left; the count on a navy tile with yellow digits
 * (7.6:1) on the right. Uniform rows; places are told apart by their icon badge. Works in both themes.
 */
:root {
  --v-bg: #eef1f6; --v-surface: #f7f9fc; --v-surface-2: #e9edf4; --v-rule: #dde3ee; --v-track: #d3dbeb;
  --b-tile: #0d3174; --b-digit: #fdc300; --b-row-line: #dde3ee;
  --c-canteen-tint: var(--v-surface); --c-canteen-tint-2: var(--v-surface-2); --c-cafe-tint: var(--v-surface); --c-cafe-tint-2: var(--v-surface-2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --v-bg: #080e1c; --v-surface: #0f1830; --v-surface-2: #142040; --v-rule: #1a2646; --v-track: #22305a;
    --b-tile: #050a16; --b-digit: #fdc300; --b-row-line: #1a2646;
    --c-canteen-tint: var(--v-surface); --c-canteen-tint-2: var(--v-surface-2); --c-cafe-tint: var(--v-surface); --c-cafe-tint-2: var(--v-surface-2);
  }
}
:root[data-theme='dark'] {
  --v-bg: #080e1c; --v-surface: #0f1830; --v-surface-2: #142040; --v-rule: #1a2646; --v-track: #22305a;
  --b-tile: #050a16; --b-digit: #fdc300; --b-row-line: #1a2646;
  --c-canteen-tint: var(--v-surface); --c-canteen-tint-2: var(--v-surface-2); --c-cafe-tint: var(--v-surface); --c-cafe-tint-2: var(--v-surface-2);
}
.fq-intro .eyebrow::after { content: ' · табло'; }
:lang(en) .fq-intro .eyebrow::after { content: ' · board'; }
.queue-cards-grid.fq-grid, .fq-grid.selected-canteen, .fq-grid.selected-cafe { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fq-grid > .queue-other { order: 1; }

.fq-card.fq6, .fq-card.fq6.fq-selected {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'head gauge' 'level gauge' 'facts gauge';
  align-items: center; column-gap: 16px; row-gap: 6px; text-align: left; padding: 16px 16px 16px 20px;
  border-radius: 14px; box-shadow: none; border-left: 4px solid var(--place-bar, var(--v-ink));
}
.fq6 .fq-head { grid-area: head; justify-content: flex-start; flex-direction: row; gap: 10px; }
.fq6 .fq-head .ui-icon { border-radius: 8px; }
.fq6 .fq-head h2, .fq6.fq-selected .fq-head h2 { font-size: clamp(20px, 2.2vw, 28px); }
.fq6 .fq-level { grid-area: level; justify-content: flex-start; margin: 0; min-height: 22px; }
.fq6 .fq-level-empty { display: none; }
.fq6 .fq-gauge.fq-gauge-bar, .fq6.fq-selected .fq-gauge.fq-gauge-bar { grid-area: gauge; margin: 0; width: auto; justify-items: center; gap: 8px; }
.fq6 .fq-reading, .fq6.fq-selected .fq-reading { min-height: 0; justify-items: center; }
.fq6 .fq-value, .fq6.fq-selected .fq-value, .fq6 .fq-gauge-bar .fq-value {
  display: block; min-width: 2.1ch; padding: 6px 14px 4px; border-radius: 10px; background: var(--b-tile); color: var(--b-digit);
  font-size: clamp(54px, 7vw, 84px); line-height: 1; letter-spacing: -.02em; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / .25), inset 0 calc(50% - 1px) 0 rgb(255 255 255 / .04);
}
.fq6.fq-stale .fq-value, .fq6.fq-paused .fq-value { color: color-mix(in srgb, var(--b-digit) 45%, var(--b-tile)); }
.fq6.fq-none .fq-value, .fq6.fq-loading .fq-value { color: #8b98b8; }
.fq6.fq-closed .fq-value { font-size: 22px; padding: 14px 12px; color: #c9d2e6; }
.fq6 .fq-unit { font-size: 12px; margin-top: 4px; }
.fq6 .fq-bar, .fq6.fq-selected .fq-bar { width: 100%; height: 4px; }
.fq6 .fq-facts { grid-area: facts; justify-items: start; gap: 2px; }
.fq6 .fq-fresh-line { justify-content: flex-start; }
.fq6 .fq-estimate { margin-top: 2px !important; padding-top: 0; border-top: 0; }
.fq6 .fq-estimate span { display: inline; }
.fq-other { border-left: 4px solid var(--place-bar, var(--v-ink)); }
.fq-break { border-radius: 12px; }
@media (max-width: 560px) {
  .fq-card.fq6, .fq-card.fq6.fq-selected { padding: 14px 12px 14px 14px; column-gap: 10px; }
  .fq6 .fq-head h2, .fq6.fq-selected .fq-head h2 { font-size: 19px; }
  .fq6 .fq-value, .fq6.fq-selected .fq-value, .fq6 .fq-gauge-bar .fq-value { font-size: 52px; padding: 6px 10px 4px; }
  .fq6 .fq-level { font-size: 13px; }
}
@media (forced-colors: active) { .fq6 .fq-value { forced-color-adjust: none; border: 2px solid CanvasText; } }
.fq-other[data-place] { box-shadow: none; }
@media (max-width: 560px) { .fq-grid.selected-all .fq6 .fq-head { flex-direction: row; justify-content: flex-start; gap: 10px; } .fq-grid.selected-all .fq6 .fq-head h2 { text-align: left; } }
@media (max-width: 560px) { .fq-grid.selected-all .fq6 .fq-head h2 { font-size: 18px; overflow-wrap: normal; word-break: normal; hyphens: none; } .fq-grid.selected-all .fq6 .fq-head .ui-icon { width: 18px; height: 18px; flex-basis: 18px; padding: 5px; } }

/* ---------- 14. Version 7: opening animation («табло включается») ----------
 * Plays once when a page opens (elements mounting), never on count updates. About 1.3 s in total.
 * Header slides in and its yellow rule draws → heading rises → rows slide in one by one → number tiles
 * flip down like a split-flap board and a light sweeps across them → meters and freshness bars grow →
 * legend and caption fade in. Entirely skipped when the visitor prefers reduced motion.
 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes nq7-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
  @keyframes nq7-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes nq7-row { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
  @keyframes nq7-flap { 0% { opacity: 0; transform: perspective(420px) rotateX(-92deg); } 55% { opacity: 1; transform: perspective(420px) rotateX(14deg); } 78% { transform: perspective(420px) rotateX(-5deg); } 100% { opacity: 1; transform: none; } }
  @keyframes nq7-sweep { from { transform: translateX(-120%); } to { transform: translateX(220%); } }
  @keyframes nq7-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes nq7-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes nq7-fade { from { opacity: 0; } to { opacity: 1; } }

  .site-header .header-inner { animation: nq7-down .45s cubic-bezier(.2, .8, .2, 1) both; }
  .site-header .header-inner::after { transform-origin: left; animation: nq7-grow-x .7s .15s cubic-bezier(.6, 0, .2, 1) both; }

  .fq-intro .eyebrow { animation: nq7-rise .45s .15s ease-out both; }
  .fq-intro h1 { animation: nq7-rise .5s .22s ease-out both; }
  .fq-intro .fq-pause { animation: nq7-rise .45s .3s ease-out both; }
  .fq-page .fq-break { animation: nq7-rise .45s .35s ease-out both; }

  .fq-grid > div:nth-child(1) > * { animation: nq7-row .5s .38s cubic-bezier(.2, .8, .2, 1) both; }
  .fq-grid > div:nth-child(2) > * { animation: nq7-row .5s .5s cubic-bezier(.2, .8, .2, 1) both; }

  /* Split-flap tile: flips down, overshoots a little, then a soft light sweeps across once. */
  .fq6 .fq-value { position: relative; overflow: hidden; transform-origin: 50% 0; animation: nq7-flap .62s .62s cubic-bezier(.3, .7, .3, 1) both; }
  .fq-grid > div:nth-child(2) .fq6 .fq-value { animation-delay: .74s; }
  .fq6 .fq-value::after {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 45%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgb(253 195 0 / .28), transparent);
    animation: nq7-sweep .8s 1.15s ease-in-out both;
  }
  .fq-grid > div:nth-child(2) .fq6 .fq-value::after { animation-delay: 1.27s; }

  .fq6 .fq-meter i { transform-origin: bottom; animation: nq7-grow-y .32s ease-out both; }
  .fq6 .fq-meter i:nth-child(1) { animation-delay: .9s; } .fq6 .fq-meter i:nth-child(2) { animation-delay: .97s; }
  .fq6 .fq-meter i:nth-child(3) { animation-delay: 1.04s; } .fq6 .fq-meter i:nth-child(4) { animation-delay: 1.11s; }
  .fq6 .fq-level-word { animation: nq7-fade .4s .95s both; }
  .fq6 .fq-bar { transform-origin: left; animation: nq7-grow-x .6s 1s cubic-bezier(.6, 0, .2, 1) both; }
  .fq6 .fq-facts { animation: nq7-fade .45s 1s both; }

  .fq-page .fq-legend { animation: nq7-fade .5s 1.15s both; }
  .fq-page .fq-caption, .fq-other { animation: nq7-fade .5s 1.25s both; }
}

/* ---------- 15. Version 7: smooth page changes (places, about, services, help, files, documents) ----------
 * 1) Between pages: a View Transition cross-fade (the old page fades up and out, the new one rises in);
 *    the header keeps its place. Driven by `smoothly()` in src/app/route.ts.
 * 2) On the new page: its parts rise in one after another (heading → filters → rows → sections →
 *    team / FAQ / documents). Only after in-app navigation (`html.nq-navigated`), so the prerendered first
 *    load never blinks. Everything is skipped for reduced motion.
 */
@media (prefers-reduced-motion: no-preference) {
  .site-header { view-transition-name: nq-header; }
  ::view-transition-old(root) { animation: nq7-vt-out .2s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: nq7-vt-in .42s .06s cubic-bezier(.2, .8, .2, 1) both; }
  ::view-transition-group(nq-header) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  @keyframes nq7-vt-out { to { opacity: 0; transform: translateY(-8px); } }
  @keyframes nq7-vt-in { from { opacity: 0; transform: translateY(12px); } }

  @keyframes nq7-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  @keyframes nq7-in-row { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
  @keyframes nq7-in-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

  .nq-navigated :is(.content-page, .places-page, .developer-login-stage, .developer-workspace) > * { animation: nq7-in .6s cubic-bezier(.2, .8, .2, 1) both; }
  .nq-navigated :is(.content-page, .places-page, .developer-login-stage, .developer-workspace) > :nth-child(1) { animation-delay: .04s; }
  .nq-navigated :is(.content-page, .places-page, .developer-login-stage, .developer-workspace) > :nth-child(2) { animation-delay: .11s; }
  .nq-navigated :is(.content-page, .places-page, .developer-login-stage, .developer-workspace) > :nth-child(3) { animation-delay: .18s; }
  .nq-navigated :is(.content-page, .places-page, .developer-login-stage, .developer-workspace) > :nth-child(4) { animation-delay: .25s; }
  .nq-navigated :is(.content-page, .places-page, .developer-login-stage, .developer-workspace) > :nth-child(n+5) { animation-delay: .32s; }

  /* Places: search, filters, then each organisation row slides in like a board row. */
  .nq-navigated .places-directory > * { animation: nq7-in .5s cubic-bezier(.2, .8, .2, 1) both; }
  .nq-navigated .places-directory > .organization-row { animation-name: nq7-in-row; }
  .nq-navigated .places-directory > :nth-child(1) { animation-delay: .14s; }
  .nq-navigated .places-directory > :nth-child(2) { animation-delay: .2s; }
  .nq-navigated .places-directory > :nth-child(3) { animation-delay: .28s; }
  .nq-navigated .places-directory > :nth-child(4) { animation-delay: .38s; }
  .nq-navigated .places-directory > :nth-child(n+5) { animation-delay: .46s; }

  /* About: the three steps and the team portraits appear in turn. */
  .nq-navigated .how-flow > li { animation: nq7-in .5s cubic-bezier(.2, .8, .2, 1) both; }
  .nq-navigated .how-flow > li:nth-child(1) { animation-delay: .3s; } .nq-navigated .how-flow > li:nth-child(2) { animation-delay: .38s; } .nq-navigated .how-flow > li:nth-child(3) { animation-delay: .46s; }
  .nq-navigated .team-list > .team-member { animation: nq7-in-pop .55s cubic-bezier(.2, .8, .2, 1) both; }
  .nq-navigated .team-list > .team-member:nth-child(1) { animation-delay: .4s; } .nq-navigated .team-list > .team-member:nth-child(2) { animation-delay: .48s; }
  .nq-navigated .team-list > .team-member:nth-child(3) { animation-delay: .56s; } .nq-navigated .team-list > .team-member:nth-child(4) { animation-delay: .64s; }

  /* Services, help, files: steps, questions and documents follow one another. */
  .nq-navigated :is(.service-steps > li, .faq-list > details, .document-list > .document-entry, .document-outline > li) { animation: nq7-in .45s cubic-bezier(.2, .8, .2, 1) both; }
  .nq-navigated :is(.service-steps > li, .faq-list > details, .document-list > .document-entry, .document-outline > li):nth-child(1) { animation-delay: .22s; }
  .nq-navigated :is(.service-steps > li, .faq-list > details, .document-list > .document-entry, .document-outline > li):nth-child(2) { animation-delay: .28s; }
  .nq-navigated :is(.service-steps > li, .faq-list > details, .document-list > .document-entry, .document-outline > li):nth-child(3) { animation-delay: .34s; }
  .nq-navigated :is(.service-steps > li, .faq-list > details, .document-list > .document-entry, .document-outline > li):nth-child(4) { animation-delay: .4s; }
  .nq-navigated :is(.service-steps > li, .faq-list > details, .document-list > .document-entry, .document-outline > li):nth-child(n+5) { animation-delay: .46s; }

  /* Small interactions eased too: FAQ answers and the mobile menu slide open. */
  .faq-list details[open] > p { animation: nq7-in .35s cubic-bezier(.2, .8, .2, 1) both; }
  .mobile-navigation { animation: nq7-in .3s cubic-bezier(.2, .8, .2, 1) both; }
}

/* Outside the school section, use NoQ's paper, graphite and tomato palette.
   The section is present in both prerendered HTML and client navigation. */
html:root[data-noq-section='main'] {
  color-scheme: light dark;
  --v-bg: light-dark(#f6f5ed, #191a18);
  --v-surface: light-dark(#fffcf4, #262724);
  --v-surface-2: light-dark(#ecebe1, #30312d);
  --v-rule: light-dark(#c4c4b8, #54554e);
  --v-track: var(--v-rule);
  --v-ink: light-dark(#222321, #f6f5ed);
  --v-ink-2: light-dark(#45463f, #deded2);
  --v-muted: light-dark(#585950, #c4c4b8);
  --v-field: light-dark(#787970, #95978c);
  --v-caution-bg: light-dark(#fff1dc, #34271f);
  --v-backdrop: rgb(28 26 23 / .55);
  --v-shadow: 0 1px 2px rgb(32 29 24 / .05);
  --c-navy: #222321;
  --c-yellow: #fa4d30;
  --c-label: light-dark(#a52f1a, #ff9179);
  --c-yellow-tint: light-dark(#ffdacc, #49291f);
  --c-yellow-soft: light-dark(#fff1e7, #30231f);
  --c-focus: var(--c-label);
  --c-focus-a: var(--c-label);
  --c-focus-b: var(--v-bg);
  --c-primary: var(--v-ink);
  --c-primary-hover: var(--v-ink-2);
  --c-on-primary: var(--v-bg);
  --c-canteen: var(--v-ink);
  --c-canteen-badge: #24241f;
  --c-canteen-badge-ink: #f6f5ed;
  --c-cafe: var(--c-yellow);
  --c-cafe-bar: var(--c-yellow);
  --c-cafe-badge: #dfed9e;
  --c-cafe-badge-ink: #222321;
  --b-row-line: var(--v-rule);
  --b-tile: #252520;
  --b-digit: #e5f365;
  --nq-line: var(--c-yellow);
  --ribbon-shadow: #222321;
  --ribbon-face: #fa4d30;
}
html[data-noq-section='main'][data-theme='light'] { color-scheme: light; }
html[data-noq-section='main'][data-theme='dark'] { color-scheme: dark; }
[data-noq-section='main'] .location-trigger { background: var(--c-primary); color: var(--c-on-primary); }
[data-noq-section='main'] .location-trigger:hover { background: var(--c-primary-hover); color: var(--c-on-primary); }
[data-noq-section='main'] .location-trigger .ui-icon { color: inherit; }
[data-noq-section='main'] .lockup-logo > rect { fill: var(--c-yellow); }
[data-noq-section='main'] .fq-break { background: var(--c-yellow-tint); color: var(--v-ink); }
[data-noq-section='main'] .fq-break .ui-icon { color: var(--c-label); }
[data-noq-section='main'] .site-footer { background: #232420; color: #f6f5ed; }
[data-noq-section='main'] .site-footer :is(.lockup, .footer-links a, .footer-credits a) { color: #f6f5ed; }
[data-noq-section='main'] .site-footer :is(.footer-brand p, .footer-credits) { color: #c9cabe; }
.header-inner::after, .main-nav a[aria-current='page']::after { background: var(--nq-line, var(--c-yellow)); }
html:not(:has(.letovo-page)) :is(.text-link, .content-link) { text-decoration-color: var(--c-label); }
html:not(:has(.letovo-page)) .text-link .ui-icon { color: var(--c-label); }
html:not(:has(.letovo-page)) body .step-number { border-color: var(--c-label); color: var(--c-label); }
html:not(:has(.letovo-page)) body .how-flow li:nth-child(even) { border-top-color: var(--c-label); }
html:not(:has(.letovo-page)) body .team-member:nth-child(even) .team-photo { box-shadow: 0 0 0 5px var(--v-bg), 0 0 0 7px var(--c-label); }
html:not(:has(.letovo-page)) body .about-purpose { background: var(--c-yellow-soft); }
html:not(:has(.letovo-page)) .demo-banner strong { color: var(--c-label); }

/* ---------- 17. Version 7: more animation ----------
 * Count changes flip the tile (up or down) and re-sweep its light, never on plain polls; rows lift on hover;
 * the logo's lanes slide in; the break bell rings once; nav links get a sliding underline; buttons press in;
 * level meters and the pause icon ease between states; on content pages, sections reveal as they scroll in.
 * All motion is skipped for reduced motion.
 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes nq7-flip-up { 0% { opacity: .15; transform: perspective(420px) rotateX(-85deg); } 60% { opacity: 1; transform: perspective(420px) rotateX(9deg); } 100% { opacity: 1; transform: none; } }
  @keyframes nq7-flip-down { 0% { opacity: .15; transform: perspective(420px) rotateX(85deg); } 60% { opacity: 1; transform: perspective(420px) rotateX(-9deg); } 100% { opacity: 1; transform: none; } }
  @keyframes nq7-lane { from { opacity: 0; transform: translateX(-9px); } to { opacity: 1; transform: none; } }
  @keyframes nq7-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
  @keyframes nq7-reveal { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

  /* Count changed: quick split-flap flip in the direction of the change, then the light sweeps again. */
  .fq-grid > div .fq6 .fq-value[data-flip='up'] { transform-origin: 50% 0; animation: nq7-flip-up .46s cubic-bezier(.3, .7, .3, 1) both; }
  .fq-grid > div .fq6 .fq-value[data-flip='down'] { transform-origin: 50% 100%; animation: nq7-flip-down .46s cubic-bezier(.3, .7, .3, 1) both; }
  .fq-grid > div .fq6 .fq-value[data-flip]::after { animation: nq7-sweep .7s .12s ease-in-out both; }

  /* Rows lift a little on hover; the tile gets a soft yellow halo. (`translate` leaves the entry transform alone.) */
  .fq-card.fq6 { transition: translate .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, background-color .2s; }
  .fq-card.fq6:has(.fq-head a:hover) { translate: 0 -3px; box-shadow: 0 12px 28px rgb(13 49 116 / .14); }
  .fq6 .fq-value { transition: box-shadow .25s; }
  .fq-card.fq6:has(.fq-head a:hover) .fq-value { box-shadow: inset 0 -2px 0 rgb(0 0 0 / .25), 0 0 0 4px rgb(253 195 0 / .3); }
  .fq-other { transition: translate .25s cubic-bezier(.2, .8, .2, 1), background-color .2s; }
  .fq-other:hover { translate: 4px 0; }

  /* Logo: the three lanes slide in one after another. */
  .lockup-logo > g:first-of-type > path { transform-box: fill-box; animation: nq7-lane .5s cubic-bezier(.2, .8, .2, 1) both; }
  .lockup-logo > g:first-of-type > path:nth-child(1) { animation-delay: .1s; }
  .lockup-logo > g:first-of-type > path:nth-child(2) { animation-delay: .18s; }
  .lockup-logo > g:first-of-type > path:nth-child(3) { animation-delay: .26s; }

  /* Break banner: the bell rings once after the banner appears. */
  .fq-break .ui-icon { transform-origin: 50% 12%; animation: nq7-ring 1s .85s ease-in-out both; }

  /* Navigation: underline slides in on hover; buttons press in; small state changes ease. */
  .main-nav a:not([aria-current='page'])::after { content: ''; position: absolute; left: 0; right: 0; bottom: 5px; height: 2px; border-radius: 2px;
    background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .main-nav a:not([aria-current='page']):hover::after { transform: scaleX(1); }
  :is(.btn, .fq-pause, .location-trigger, .filter-pill, .icon-button, .locale-toggle, .document-download) { transition: scale .12s ease-out, background-color .2s, color .2s, border-color .2s; }
  :is(.btn, .fq-pause, .location-trigger, .filter-pill, .icon-button, .locale-toggle, .document-download):active { scale: .95; }
  .fq-pause-icon { transition: width .2s, height .2s, border-width .2s; }
  .fq-meter i { transition: background-color .4s ease, height .3s ease; }
  .theme-toggle svg { transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
  .theme-toggle:hover svg { transform: rotate(28deg); }

  /* Content pages: sections and items further down reveal as they scroll into view (where supported). */
  @supports (animation-timeline: view()) {
    :is(.content-rule-section, .reading-section, .team-member, .document-entry, .faq-list > details, .connect-strip) {
      animation: nq7-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%;
    }
  }
}

/* ---------- 18. Version 7: no line under the number tiles ----------
 * The freshness bar was removed from the card markup; freshness is shown by the live dot and its text.
 * The legend now explains the dot, so its mark is a small green dot.
 */
.fq-legend-mark { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--c-live); }

/* Carry the two location symbols to their new positions when switching boards. */
@media (prefers-reduced-motion: no-preference) {
  #queue-canteen :is(.fq-head, .fq-other) > .ui-icon:first-child { view-transition-name: canteen-symbol; }
  #queue-cafe :is(.fq-head, .fq-other) > .ui-icon:first-child { view-transition-name: cafe-symbol; }
  ::view-transition-group(canteen-symbol), ::view-transition-group(cafe-symbol) {
    animation-duration: .48s;
    animation-timing-function: cubic-bezier(.2,.85,.22,1);
  }
  @supports (animation-timeline: view()) {
    .how-flow li, .service-steps li { position: relative; }
    .how-flow li::after, .service-steps li::after {
      content: ""; position: absolute; left: 0; right: 0; top: -2px;
      height: 2px; background: var(--c-label); transform-origin: left;
      animation: route-line linear both;
      animation-timeline: view(); animation-range: entry 0% cover 30%;
    }
    @keyframes route-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }
}
