/* ═══════════════════════════════════════════════════════════════
   DEMO BAR — the same top bar on every project page (2026-10-14)
   ModelVault + back arrow on the window's left edge, the project name on the right edge,
   the tabs centred in their own bar. Loaded after each project's style.css; "html body >"
   outranks the projects' own header / .tabs-bar rules (and their media queries).
   ═══════════════════════════════════════════════════════════════ */
html body > header {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
}
html body > header > .hdr-right { margin-left: auto; }

/* Tabs centred with auto margins (not justify-content: center): when they do not fit,
   the bar still scrolls from the first tab. */
html body > .tabs-bar { padding-left: 1rem; padding-right: 1rem; justify-content: flex-start; }
html body > .tabs-bar > :first-child { margin-left: auto; }
html body > .tabs-bar > :last-child { margin-right: auto; }

/* F1: one bar (brand | tabs | live badge). Desktop: three columns, tabs on the centre of the
   bar; a phone keeps the project's two rows (brand + badge, tabs below). */
@media (min-width: 641px) {
    html body > .navbar {
        display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 24px;
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }
    html body > .navbar > .nav-start { justify-self: start; }
    html body > .navbar > .nav-tabs { justify-self: center; }
    html body > .navbar > .live-badge { justify-self: end; margin-left: 0; }
}
.navbar > .nav-start { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }

@media (max-width: 768px) {
    html body > header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    html body > .tabs-bar { padding-left: .5rem; padding-right: .5rem; }
}
@media (max-width: 360px) {
    html body > header {
        padding-left: max(.75rem, env(safe-area-inset-left));
        padding-right: max(.75rem, env(safe-area-inset-right));
    }
}
@media (max-width: 640px) {
    .navbar > .nav-start { gap: 10px; }   /* the project's own gap on a phone */
    /* F1 on a phone: the tabs row is centred too (auto margins: it still scrolls from the first tab) */
    .navbar > .nav-tabs > :first-child { margin-left: auto; }
    .navbar > .nav-tabs > :last-child { margin-right: auto; }
}

/* ═══ The site's wordmark on every demo (2026-10-27) ═══
   Same type as the site's navbar (Cinzel, no mark in front: the owner found it too showy), in the project's own colours: «Model» keeps the bar's
   text colour, «Vault» the project's accent (each project sets it on .logo span). The bar carries only the wordmark and the back arrow (owner, 2026-10-31: no «Dashboard» label). Only the bar changes: each project keeps its palette and content. */
html body > header .logo, html body > .navbar .nav-brand {
    display: inline-flex; align-items: center; font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
    font-weight: 500; font-size: 1.15rem; letter-spacing: .06em; line-height: 1;
}
html body > header .logo span, html body > .navbar .nav-brand span { font-weight: 700; }
html body > header .logo, html body > .navbar .nav-brand { padding: .75rem 0; }
@media (max-width: 520px) {
    html body > header .logo, html body > .navbar .nav-brand { font-size: 1rem; letter-spacing: .03em; }
}

/* Readable floor (2026-11-15): tabs at 13px, field labels and small capital labels at
   12px, only where a demo went below; each project keeps its font, weight and colour. */
html body .tabs-bar .tab-link { font-size: max(13px, .8125rem); }
html body .nav-tab { font-size: 13px; }
html body .field label, html body .f-lab > span { font-size: max(12px, .75rem) !important; }   /* readable floor of the demo forms (NHP, ST, MAS) */

html body[data-tab="home"] .kx-state { font-size: 12px; padding: 5px 10px; }
html body .kx-state { font-size: 12px !important; }
@media (max-width: 768px) {
  html body .field input:not([type="checkbox"]):not([type="radio"]), html body .field select, html body .field textarea { font-size: 16px; }
}
