/* =========================================================================
   Tesla Cam Drive — stylesheet
   ========================================================================= */

/* ---- Montserrat (self-hosted, Gotham-like — Tesla feel) --------------- *
 * Two subsets per weight so Slovak diacritics (latin-ext) render correctly. */
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-ext-500-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("/assets/fonts/montserrat/latin-ext-700-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
    --ink: #171a20;
    --ink-soft: #393c41;
    --muted: #5c5e62;
    --line: #e3e5e8;
    --bg: #ffffff;
    --surface: #f4f5f6;
    --surface-2: #eef0f2;
    --accent: #e82127;
    --accent-dark: #b6151a;
    --accent-soft: #fdecec;
    --ok: #1a7f4b;
    --ok-soft: #e6f4ec;
    --warn: #9a6b00;
    --warn-soft: #fcf3da;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(23, 26, 32, .06), 0 8px 24px rgba(23, 26, 32, .08);
    --shadow-sm: 0 1px 2px rgba(23, 26, 32, .08);
    --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --maxw: 1120px;

    /* Always-dark brand surfaces (header, hero, CTA, player) — stay dark in
       both themes so we never invert them. */
    --ink-fixed: #171a20;
    /* Primary button inverts with the theme (Tesla-style dark/white pill). */
    --btn-bg: #171a20;
    --btn-bg-hover: #000000;
    --btn-fg: #ffffff;
}

/* ---- Dark theme -------------------------------------------------------- */
:root[data-theme="dark"] {
    --ink: #f3f4f6;
    --ink-soft: #c7cace;
    --muted: #969ba3;
    --line: #2a2e36;
    --bg: #0e1014;
    --surface: #171a20;
    --surface-2: #20242c;
    --accent: #ff2a30;
    --accent-dark: #e0181e;
    --accent-soft: #2a1416;
    --ok: #4ade80;
    --ok-soft: #11331f;
    --warn: #e3b341;
    --warn-soft: #33280c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --btn-bg: #f3f4f6;
    --btn-bg-hover: #ffffff;
    --btn-fg: #171a20;
}

/* Follow the system setting when the user has not chosen explicitly and JS is
   unavailable (with JS, the resolved theme is set on <html data-theme>). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --ink: #f3f4f6;
        --ink-soft: #c7cace;
        --muted: #969ba3;
        --line: #2a2e36;
        --bg: #0e1014;
        --surface: #171a20;
        --surface-2: #20242c;
        --accent: #ff2a30;
        --accent-dark: #e0181e;
        --accent-soft: #2a1416;
        --ok: #4ade80;
        --ok-soft: #11331f;
        --warn: #e3b341;
        --warn-soft: #33280c;
        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .55);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
        --btn-bg: #f3f4f6;
        --btn-bg-hover: #ffffff;
        --btn-fg: #171a20;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -.025em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    font: inherit; font-weight: 600; font-size: .8rem; cursor: pointer;
    text-transform: uppercase; letter-spacing: .12em;
    padding: .95em 1.7em; border-radius: 100px; border: 1.5px solid transparent;
    transition: transform .05s ease, background .15s ease, color .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
/* Primary = Tesla's high-contrast CTA. Inverts with the theme (dark pill on
   light UI, white pill on dark UI). */
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover { background: var(--btn-bg-hover); }
.btn--dark { background: var(--btn-bg); color: var(--btn-fg); }
.btn--dark:hover { background: var(--btn-bg-hover); }
/* Accent = Tesla red, for brand / high-emphasis moments only. */
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn--light { background: #fff; color: var(--ink-fixed); }
.btn--light:hover { background: rgba(255, 255, 255, .85); }
/* Translucent pill — Tesla's signature button over dark/hero backgrounds. */
.btn--translucent { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn--translucent:hover { background: rgba(255, 255, 255, .2); border-color: #fff; }
.btn--link { background: none; border: none; color: var(--muted); padding: .4em .2em; text-transform: none; letter-spacing: 0; font-size: .95rem; }
.btn--link:hover { color: var(--ink); }
.btn--block { display: flex; width: 100%; }
.btn--lg { padding: 1.05em 2em; font-size: .86rem; }
.btn--sm { padding: .5em 1.05em; font-size: .72rem; letter-spacing: .1em; }
/* Soft = small, translucent grey pill (Tesla's subtle nav buttons). Tints with
   the text colour so it reads on both light and dark headers. */
.btn--soft { background: rgba(23, 26, 32, .05); color: var(--ink); border-color: rgba(23, 26, 32, .14); }
.btn--soft:hover { background: rgba(23, 26, 32, .1); border-color: rgba(23, 26, 32, .24); }
:root[data-theme="dark"] .btn--soft { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
:root[data-theme="dark"] .btn--soft:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .32); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .btn--soft { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
    :root:not([data-theme]) .btn--soft:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .32); }
}

/* ---- Header / nav ----------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; }
.brand__logo { width: 1.6rem; height: 1.6rem; flex: none; display: block; }
.brand__name { font-size: .92rem; text-transform: uppercase; letter-spacing: .2em; font-weight: 600; }
.brand--sm .brand__logo { width: 1.35rem; height: 1.35rem; }
.brand--sm .brand__name { font-size: .82rem; letter-spacing: .18em; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--ink-soft); font-weight: 550; font-size: .96rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: var(--ink); }
/* Compact, natural-height nav buttons (Registrácia, Moja aplikácia). */
.site-nav .btn { padding: .55em 1.2em; font-size: .72rem; line-height: 1; }
.site-nav .btn--primary { color: var(--btn-fg); }
.site-nav .btn--ghost { color: var(--ink); }
.site-nav .btn--soft { color: var(--ink); }
.inline-form { display: inline; margin: 0; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---- Hero ------------------------------------------------------------- */
.hero {
    position: relative; color: #fff; overflow: hidden;
    background: radial-gradient(1000px 520px at 50% -12%, #2b2f36 0%, var(--ink-fixed) 62%);
}
.hero__inner {
    padding: clamp(4rem, 10vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem);
    max-width: 880px; margin-inline: auto; text-align: center;
}
.hero h1 { color: #fff; }
.hero p.lead {
    font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: #c7cace;
    max-width: 620px; margin-inline: auto;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; justify-content: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.3rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
    color: #ff6b6f; background: rgba(232, 33, 39, .14); padding: .4em .9em; border-radius: 100px;
}

/* ---- Sections --------------------------------------------------------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--surface { background: var(--surface); }
.section__head { max-width: 640px; margin: 0 auto 2.6rem; text-align: center; }
.section__head p { color: var(--muted); font-size: 1.08rem; }

/* ---- Product screenshots --------------------------------------------- */
.product-preview { background: var(--surface); }
.product-preview__kicker {
    margin: 0 0 .65rem; color: var(--accent) !important; font-size: .72rem !important;
    font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.product-preview__shots { display: grid; gap: clamp(2.8rem, 7vw, 5rem); }
.product-shot { margin: 0; min-width: 0; }
.product-shot__frame {
    overflow: hidden; background: #171a20; border: 1px solid var(--line);
    border-radius: 8px; box-shadow: var(--shadow);
}
.product-shot__frame img { width: 100%; height: auto; }
.product-shot figcaption {
    display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 1rem;
    max-width: 760px; margin-top: 1rem;
}
.product-shot__number {
    color: var(--accent); font-size: .78rem; font-weight: 700;
    letter-spacing: .08em; padding-top: .2rem;
}
.product-shot figcaption h3 { margin: 0 0 .3rem; font-size: 1.08rem; }
.product-shot figcaption p { margin: 0; color: var(--muted); font-size: .94rem; }

@media (max-width: 620px) {
    .product-shot figcaption { grid-template-columns: 1.8rem minmax(0, 1fr); gap: .65rem; }
    .product-shot__frame { border-radius: 6px; }
}

/* ---- Feature grid ----------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.card--pad { padding: 1.8rem; }
.feature__icon {
    width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem;
    background: var(--accent-soft); color: var(--accent); border-radius: 12px; margin-bottom: 1rem;
}
.feature h3 { margin-bottom: .35rem; }
.feature p { color: var(--muted); margin: 0; font-size: .97rem; }
.seo-list { margin: .9rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.seo-list li + li { margin-top: .45rem; }
.answer-card h3 { margin-bottom: .45rem; }
.answer-card p { margin: 0; color: var(--muted); }

/* ---- Camera chips ----------------------------------------------------- */
.cameras { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2rem; }
.chip {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 100px;
    padding: .5em 1em; font-size: .9rem; font-weight: 550;
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---- Steps ------------------------------------------------------------ */
.steps { counter-reset: step; display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
.step { position: relative; padding-left: 3.2rem; }
.step::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 0; top: 0; width: 2.2rem; height: 2.2rem;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--ink-fixed); color: #fff; font-weight: 700;
}
.step h3 { margin-bottom: .25rem; }
.step p { color: var(--muted); margin: 0; font-size: .96rem; }

/* ---- CTA banner ------------------------------------------------------- */
.cta {
    background: var(--ink-fixed); color: #fff; border-radius: 20px;
    padding: clamp(2rem, 5vw, 3.5rem); text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #c7cace; max-width: 460px; margin-inline: auto; }

/* ---- Pricing ---------------------------------------------------------- */
.pricing { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan--featured { border-color: var(--ink); box-shadow: var(--shadow); }
.plan__badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--ink-fixed); color: #fff; font-size: .72rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; padding: .3em .8em; border-radius: 100px;
}
.plan__name { font-size: 1.05rem; font-weight: 650; }
.plan__price { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; margin: .3rem 0 0; }
.plan__price span { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan__list { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: .7rem; }
.plan__list li { padding-left: 1.6rem; position: relative; color: var(--ink-soft); font-size: .96rem; }
.plan__list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan__list li.off { color: var(--muted); }
.plan__list li.off::before { content: "–"; color: var(--muted); }
.plan .btn { margin-top: auto; }

/* ---- FAQ -------------------------------------------------------------- */
.faq { max-width: 760px; margin-inline: auto; }
.faq details {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0 1.3rem; margin-bottom: .8rem; background: var(--bg);
}
.faq summary {
    list-style: none; cursor: pointer; font-weight: 600; padding: 1.1rem 0;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { margin: 0 0 1.2rem; color: var(--muted); }

/* ---- Legal document ---------------------------------------------------- */
.legal-doc {
    max-width: 860px; margin-inline: auto; color: var(--ink-soft);
    font-size: 1rem; line-height: 1.75;
}
.legal-doc h3 {
    margin-top: 2.2rem; margin-bottom: .55rem; color: var(--ink);
    font-size: clamp(1.08rem, 2vw, 1.22rem);
}
.legal-doc p { margin: 0 0 1rem; }
.legal-doc a { color: var(--accent); font-weight: 600; text-decoration: none; }
.legal-doc a:hover { text-decoration: underline; }
.legal-doc code {
    background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
    padding: .08em .35em; font-size: .92em;
}
.legal-doc__updated {
    color: var(--muted); font-size: .9rem; margin-bottom: 1.6rem;
}
.legal-doc__facts {
    display: grid; gap: .7rem; margin: 1.2rem 0 1.6rem;
    padding: 1.2rem; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius);
}
.legal-doc__facts > div {
    display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: .8rem;
}
.legal-doc__facts dt { color: var(--muted); font-weight: 650; }
.legal-doc__facts dd { margin: 0; color: var(--ink); }
.legal-doc__table-wrap {
    overflow-x: auto; margin: 1.1rem 0 1.5rem;
    border: 1px solid var(--line); border-radius: var(--radius);
}
.legal-doc__table {
    width: 100%; min-width: 680px; border-collapse: collapse; background: var(--bg);
}
.legal-doc__table th,
.legal-doc__table td {
    padding: .9rem 1rem; border-bottom: 1px solid var(--line); text-align: left;
    vertical-align: top;
}
.legal-doc__table th { background: var(--surface); color: var(--ink); font-size: .9rem; }
.legal-doc__table tr:last-child td { border-bottom: 0; }
.legal-doc__table td { color: var(--ink-soft); font-size: .95rem; }

/* ---- Auth ------------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: clamp(2.5rem, 6vw, 5rem) 0; background: var(--surface); min-height: calc(100vh - 64px); }
.auth__card { width: 100%; max-width: 420px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 2.2rem; box-shadow: var(--shadow); }
.auth__card h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.auth__sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth__alt { text-align: center; margin: 1.4rem 0 0; color: var(--muted); font-size: .95rem; }

/* ---- Forms ------------------------------------------------------------ */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.field__row label { margin-bottom: .4rem; }
.field__link { font-size: .82rem; color: var(--accent-dark); font-weight: 550; }
.field__link:hover { text-decoration: underline; }
.field input {
    width: 100%; font: inherit; padding: .75em .9em; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 26, 32, .08); }
.field input.is-invalid { border-color: var(--accent); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.field .field-error { color: var(--accent-dark); font-size: .85rem; margin-top: .4rem; }

/* ---- Alerts / flash --------------------------------------------------- */
.flash-stack { margin-top: 1rem; display: grid; gap: .6rem; }
.alert {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .85em 1.1em; border-radius: var(--radius-sm); font-size: .95rem; border: 1px solid transparent;
}
.alert--success { background: var(--ok-soft); color: #14613a; border-color: #bfe3cd; }
.alert--error { background: var(--accent-soft); color: var(--accent-dark); border-color: #f6cdce; }
.alert--info { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line); }
.alert__close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.alert__close:hover { opacity: 1; }

/* ---- Badges ----------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; padding: .25em .7em; border-radius: 100px; font-size: .78rem; font-weight: 650; }
.badge--plan { background: var(--accent-soft); color: var(--accent-dark); text-transform: uppercase; letter-spacing: .04em; }
.badge--soon { background: var(--warn-soft); color: var(--warn); }

/* ---- App shell -------------------------------------------------------- */
.app-body { background: var(--surface); min-height: 100vh; }
.app-header { background: var(--ink-fixed); color: #fff; position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.app-header__inner { max-width: 1200px; margin-inline: auto; padding: 0 20px; min-height: 60px; display: flex; align-items: center; gap: 1.5rem; }
.app-header .brand { color: #fff; }
.app-nav { display: flex; gap: 1.2rem; margin-right: auto; }
.app-nav a { color: #b9bcc1; font-weight: 550; font-size: .95rem; }
.app-nav a:hover, .app-nav a.is-active { color: #fff; }
.app-header__user { display: flex; align-items: center; gap: .9rem; }
.app-header__name { font-size: .92rem; color: #e3e5e8; }
.app-header .btn--link { color: #b9bcc1; }
.app-header .btn--link:hover { color: #fff; }
.app-main { padding: clamp(1.6rem, 4vw, 2.6rem) 0 4rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.page-head h1 { font-size: 1.7rem; margin: 0; }

/* ---- Search / filter bar --------------------------------------------- */
.filters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem 1.1rem; margin-bottom: 1.4rem; box-shadow: var(--shadow-sm);
}
.filters__field { display: flex; flex-direction: column; gap: .35rem; }
.filters__field--grow { flex: 1 1 220px; min-width: 0; }
.filters__field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters__field input {
    font: inherit; padding: .6em .8em; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.filters__field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 26, 32, .08); }
.filters__actions { display: flex; gap: .5rem; align-items: center; }
@media (max-width: 620px) {
    .filters { align-items: stretch; }
    .filters__field { flex: 1 1 100%; }
    .filters__actions { width: 100%; }
    .filters__actions .btn { flex: 1; }
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.stat__num { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.stat__label { color: var(--muted); font-size: .9rem; }

/* ---- Empty state ------------------------------------------------------ */
.empty {
    background: var(--bg); border: 1px dashed var(--line); border-radius: 16px;
    padding: clamp(2.5rem, 6vw, 4rem); text-align: center;
}
.empty__icon { font-size: 2.6rem; margin-bottom: .6rem; }
.empty h2 { font-size: 1.35rem; }
.empty p { color: var(--muted); max-width: 460px; margin-inline: auto; }
.empty .cameras { margin-top: 1.6rem; }

/* ---- Footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; margin-top: 2rem; }
.site-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.site-footer__inner .muted { margin: .6rem 0 0; max-width: 280px; font-size: .92rem; }
.site-footer__links { display: flex; align-items: flex-start; gap: 1.4rem; flex-wrap: wrap; }
.site-footer__links a,
.footer-link {
    color: var(--ink-soft); font: inherit; font-size: .95rem; background: none;
    border: 0; padding: 0; cursor: pointer; appearance: none; -webkit-appearance: none;
    line-height: inherit;
}
.site-footer__links a:hover,
.footer-link:hover { color: var(--ink); }
.site-footer__legal { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: .85rem; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 860px) {
    .grid--3, .pricing, .steps, .stat-row { grid-template-columns: 1fr; }
    .grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: .4rem;
        background: var(--bg); border-bottom: 1px solid var(--line);
        padding: 1rem 20px 1.4rem; box-shadow: var(--shadow);
        display: none;
    }
    .site-nav.is-open { display: flex; }
    .site-nav .btn { width: 100%; }
    .inline-form, .site-nav .inline-form .btn { width: 100%; text-align: left; }
    .app-nav { display: none; }
    .app-header__name { display: none; }
}
@media (max-width: 560px) {
    .app-header__inner { padding-inline: 14px; gap: .65rem; }
    .app-header__user { margin-left: auto; gap: .55rem; }
    .app-header .brand__name,
    .app-header .badge--plan { display: none; }
}
@media (max-width: 620px) {
    .legal-doc { line-height: 1.65; }
    .legal-doc__facts { padding: 1rem; }
    .legal-doc__facts > div { grid-template-columns: 1fr; gap: .1rem; }
    .legal-doc__table { min-width: 580px; }
}

/* =========================================================================
   Recordings: uploader, grid, player
   ========================================================================= */

/* ---- Uploader --------------------------------------------------------- */
.uploader { margin-bottom: 2rem; }
.dropzone {
    border: 2px dashed var(--line); border-radius: 16px; background: var(--bg);
    padding: clamp(1.8rem, 5vw, 3rem); text-align: center;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { font-size: 2.4rem; }
.dropzone__title { font-weight: 650; font-size: 1.1rem; margin: .5rem 0 .1rem; }
.dropzone .btn { margin-top: .3rem; }
.dropzone__hint { font-size: .85rem; margin: 1.1rem auto 0; max-width: 520px; }

.upload-panel { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; }
.upload-panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .7rem; }
.progress { height: 10px; background: var(--surface-2); border-radius: 100px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--accent); border-radius: 100px; transition: width .2s ease; }
.upload-panel__file { margin: .7rem 0 0; font-size: .82rem; word-break: break-all; }

/* ---- Recording grid --------------------------------------------------- */
.section-title { margin: 1.6rem 0 1rem; font-size: 1.3rem; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }
.rec-card {
    display: flex; flex-direction: column; background: var(--bg); color: inherit;
    border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform .08s ease, box-shadow .15s ease;
}
.rec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rec-card__thumb {
    position: relative; aspect-ratio: 128 / 83; background: #0b0d10;
    display: grid; place-items: center; overflow: hidden;
}
.rec-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-card__placeholder { font-size: 2rem; opacity: .5; }
.rec-card__status {
    position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .65);
    color: #fff; font-size: .72rem; padding: .2em .6em; border-radius: 100px;
}
.rec-card__body { padding: 1rem; }
.rec-card__body h3 { font-size: 1.02rem; margin: 0 0 .2rem; }
.rec-card__sub { font-size: .85rem; margin: 0 0 .7rem; }
.rec-card__meta { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }

/* ---- Recording detail + player --------------------------------------- */
.back-link { color: var(--muted); font-weight: 550; }
.back-link:hover { color: var(--ink); }
.rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.rec-head h1 { font-size: 1.6rem; margin: 0 0 .3rem; }
.rec-head__sub { margin: 0; font-size: .95rem; }
.rec-head__sub a { color: var(--accent-dark); font-weight: 550; }

.player { background: #0b0d10; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }

/* ---- Camera screen: single video or 6-camera grid --------------------- */
.player__grid { background: #000; }
.player__grid.is-single { display: block; }
.player__grid.is-single .cell { aspect-ratio: auto; }
.player__grid.is-single .cell video { width: 100%; height: auto; max-height: 72vh; }
.player__grid.is-single .cell__tag { display: none; }

.player__grid.is-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #000;
}

.cell { position: relative; background: #000; min-height: 0; }
.cell video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.player__grid.is-grid .cell { aspect-ratio: 16 / 10; }
.cell.is-master { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.cell.cell--empty video { display: none; }
.cell__tag {
    position: absolute; left: 6px; top: 6px; z-index: 2;
    background: rgba(0, 0, 0, .6); color: #fff; font-size: .72rem; font-weight: 600;
    padding: .15em .55em; border-radius: 100px; pointer-events: none;
}
.cell__ph {
    position: absolute; inset: 0; display: none; place-items: center;
    color: #5c5e62; font-size: 1.4rem;
}
.cell--empty .cell__ph { display: grid; }

/* ---- Controls --------------------------------------------------------- */
.player__controls { background: var(--ink-fixed); padding: .6rem 1rem 1rem; }

/* Scrubber */
.seekbar { padding: .7rem 0 .5rem; cursor: pointer; touch-action: none; outline: none; }
.seekbar__track {
    position: relative; height: 6px; border-radius: 100px;
    background: rgba(255, 255, 255, .16);
}
.seekbar:hover .seekbar__track, .seekbar:focus-visible .seekbar__track { height: 8px; }
.seekbar:focus-visible { outline: none; }
.seekbar:focus-visible .seekbar__track { box-shadow: 0 0 0 2px rgba(232, 33, 39, .5); }
.seekbar__buf {
    position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 100px;
    background: rgba(255, 255, 255, .28);
}
.seekbar__fill {
    position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 100px; background: var(--accent);
}
.seekbar__knob {
    position: absolute; top: 50%; left: 0; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
    transition: transform .1s ease;
}
.seekbar:hover .seekbar__knob, .seekbar:focus-visible .seekbar__knob { transform: translate(-50%, -50%) scale(1.15); }

/* Transport row */
.player__row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-top: .3rem;
}
.transport { display: flex; align-items: center; gap: .35rem; }
.tbtn {
    display: inline-grid; place-items: center; min-width: 38px; height: 38px;
    background: rgba(255, 255, 255, .08); color: #e3e5e8; border: 0; border-radius: 10px;
    font-size: 1rem; line-height: 1; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.tbtn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.tbtn.is-active { background: var(--accent); color: #fff; }
.tbtn--play { min-width: 46px; height: 46px; font-size: 1.15rem; background: rgba(255, 255, 255, .16); }
.tbtn--play:hover { background: rgba(255, 255, 255, .28); }
.time { color: #b9bcc1; font-size: .85rem; margin-left: .5rem; font-variant-numeric: tabular-nums; }

.player__opts { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.speed { display: inline-flex; align-items: center; gap: .45rem; color: #b9bcc1; font-size: .85rem; }
.speed select {
    font: inherit; font-size: .85rem; color: #fff; background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; padding: .3em .5em; cursor: pointer;
}
.speed select option { color: #171a20; }

.view-toggle { display: inline-flex; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 2px; }
.vbtn {
    background: transparent; color: #cfd2d6; border: 0; border-radius: 8px;
    padding: .4em .8em; font: inherit; font-size: .82rem; font-weight: 550; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.vbtn:hover { color: #fff; }
.vbtn.is-active { background: var(--accent); color: #fff; }

/* Camera tabs + segment info */
.camera-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.camera-tab {
    background: rgba(255, 255, 255, .08); color: #cfd2d6; border: 0; border-radius: 100px;
    padding: .45em .95em; font: inherit; font-size: .85rem; font-weight: 550; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.camera-tab:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.camera-tab.is-active { background: var(--accent); color: #fff; }
.player__seg { color: #b9bcc1; font-size: .85rem; margin-top: .6rem; }

@media (max-width: 760px) {
    .player__grid.is-grid { grid-template-columns: repeat(2, 1fr); }
    .player__row { gap: .6rem; }
    .time { margin-left: .25rem; }
}
@media (max-width: 460px) {
    .player__grid.is-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Recordings map (Leaflet + OpenStreetMap)
   ========================================================================= */
.rec-map {
    position: relative; z-index: 0;            /* contain Leaflet's stacking */
    height: 70vh; min-height: 420px;
    border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
    background: var(--surface-2);
}

/* Custom teardrop marker (divIcon has no default chrome). */
.map-pin { background: none; border: 0; }
.map-pin svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }

/* Clusters (Leaflet.markercluster) — Tesla-red bubbles. */
.map-cluster { background: none; }
.map-cluster__inner {
    width: 100%; height: 100%; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(232, 33, 39, .92); color: #fff; font-weight: 700;
    font-size: .85rem; line-height: 1;
    border: 3px solid rgba(255, 255, 255, .9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.map-cluster--l .map-cluster__inner { font-size: .95rem; }

/* Popup */
.leaflet-popup-content { margin: 12px; font-family: var(--font); }
.map-popup { width: 200px; }
.map-popup__thumb {
    width: 100%; aspect-ratio: 128 / 83; object-fit: cover; display: block;
    border-radius: 8px; background: #0b0d10;
}
.map-popup__title { font-weight: 650; font-size: 1rem; margin-top: .5rem; color: var(--ink); }
.map-popup__sub { color: var(--muted); font-size: .85rem; margin-top: .1rem; }
.map-popup__meta { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.map-popup__btn { display: flex; width: 100%; margin-top: .7rem; padding: .55em 1em; }

/* =========================================================================
   Theme toggle (footer) + dark-mode component touch-ups
   ========================================================================= */
.site-footer__legal {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem 1.5rem; flex-wrap: wrap;
}

.app-footer { border-top: 1px solid var(--line); padding: 1.2rem 0; margin-top: 1rem; }
.app-footer__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; font-size: .85rem;
}
.app-footer__links {
    display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
}
.app-footer__links a { color: var(--ink-soft); }
.app-footer__links a:hover { color: var(--ink); }

.theme-toggle {
    display: inline-flex; gap: 2px; padding: 3px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px;
}
.theme-toggle__btn {
    display: inline-flex; align-items: center; gap: .35rem; line-height: 1;
    background: none; border: 0; cursor: pointer; color: var(--muted);
    font: inherit; font-size: .8rem; font-weight: 500;
    padding: .45em .8em; border-radius: 100px;
    transition: background .12s ease, color .12s ease;
}
.theme-toggle__btn:hover { color: var(--ink); }
.theme-toggle__btn.is-active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
@media (max-width: 560px) { .theme-toggle__btn span { display: none; } }

/* ---- Cookie consent ---------------------------------------------------- */
html.has-cookie-banner body { padding-bottom: var(--cookie-banner-height, 0); }
.cookie-banner {
    position: fixed; inset: auto 0 0; z-index: 1000;
    background: var(--bg); color: var(--ink); border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px rgba(23, 26, 32, .1);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner { width: 100%; max-width: var(--maxw); margin-inline: auto; padding: 1rem 20px; }
.cookie-banner__top {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 1.25rem 2rem;
}
.cookie-banner__copy > strong { display: block; margin-bottom: .25rem; font-size: 1rem; }
.cookie-banner p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; max-width: 680px; }
.cookie-banner__more {
    display: inline-block; margin-top: .35rem; color: var(--ink-soft);
    font-size: .82rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.cookie-banner__more:hover { color: var(--ink); }
.cookie-banner__actions {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; justify-content: flex-end;
}
.cookie-banner__decision { min-width: 9.5rem; }
.cookie-banner__preferences {
    margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.cookie-banner__preferences[hidden] { display: none; }
.cookie-banner__categories {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
}
.cookie-category {
    position: relative; min-width: 0; padding: .9rem 4rem .9rem 1rem;
}
.cookie-category + .cookie-category { border-left: 1px solid var(--line); }
.cookie-category__heading { display: flex; align-items: center; gap: .5rem; min-height: 1.5rem; }
.cookie-category__heading strong { font-size: .88rem; }
.cookie-category__heading span {
    color: var(--muted); font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
}
.cookie-category p { margin-top: .25rem; font-size: .78rem; line-height: 1.45; }
.cookie-switch {
    position: absolute; top: 50%; right: 1rem; width: 2.6rem; height: 1.45rem;
    transform: translateY(-50%); cursor: pointer;
}
.cookie-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cookie-switch span {
    display: block; width: 100%; height: 100%; border-radius: 100px;
    background: var(--line); border: 1px solid var(--line); transition: background .15s ease;
}
.cookie-switch span::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
    border-radius: 50%; background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .15s ease;
}
.cookie-switch input:checked + span { background: var(--ink); border-color: var(--ink); }
.cookie-switch input:checked + span::after { transform: translateX(18px); }
.cookie-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.cookie-switch input:disabled + span { opacity: .65; cursor: not-allowed; }
.cookie-banner__preferences-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 1rem;
    margin-top: .8rem;
}
.cookie-banner__preferences-footer span { margin-right: auto; color: var(--muted); font-size: .78rem; }

@media (max-width: 920px) {
    .cookie-banner__top { grid-template-columns: 1fr; }
    .cookie-banner__actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
    .cookie-banner__categories { grid-template-columns: 1fr; }
    .cookie-category + .cookie-category { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
    .cookie-banner__inner { padding: .9rem 14px; }
    .cookie-banner__actions {
        display: grid; grid-template-columns: 1fr 1fr; width: 100%;
    }
    .cookie-banner__actions .btn { width: 100%; min-width: 0; white-space: normal; line-height: 1.25; }
    .cookie-banner__actions [data-cookie-manage] { grid-column: 1 / -1; grid-row: 2; }
    .cookie-category { padding-right: 4.25rem; }
    .cookie-banner__preferences-footer { align-items: stretch; flex-direction: column; }
    .cookie-banner__preferences-footer .btn { width: 100%; }
}

/* Elements that hard-code a light surface need a nudge in dark mode. */
:root[data-theme="dark"] .site-header { background: rgba(14, 16, 20, .8); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .alert--success { color: #7ee2a8; border-color: #1f5236; }
:root[data-theme="dark"] .alert--error { color: #ff8a8d; border-color: #5a1f22; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .site-header { background: rgba(14, 16, 20, .8); }
    :root:not([data-theme]) .leaflet-popup-content-wrapper,
    :root:not([data-theme]) .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
    :root:not([data-theme]) .alert--success { color: #7ee2a8; border-color: #1f5236; }
    :root:not([data-theme]) .alert--error { color: #ff8a8d; border-color: #5a1f22; }
}

/* =========================================================================
   Language switcher (flag + name dropdown)
   ========================================================================= */
.lang-menu { position: relative; display: inline-block; }
.lang-menu__toggle {
    list-style: none; cursor: pointer; user-select: none;
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    min-width: 2.6rem;
    border: 1px solid var(--line); border-radius: 100px; padding: .32em .58em;
    font-size: .72rem; font-weight: 700; letter-spacing: 0; color: var(--ink);
}
.lang-menu__toggle::-webkit-details-marker { display: none; }
.lang-menu__toggle:hover { background: var(--surface); }
.lang-menu__flag { font-size: 1.05rem; line-height: 1; }
.lang-menu__caret { font-size: .65rem; color: var(--muted); transition: transform .15s ease; }
.lang-menu[open] .lang-menu__caret { transform: rotate(180deg); }

.lang-menu__list {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
    min-width: 190px; padding: .35rem; display: grid; gap: 2px;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.lang-menu__list .lang-menu__item {
    display: flex; align-items: center; gap: .6rem; padding: .5em .7em;
    border-radius: var(--radius-sm); color: var(--ink); font-size: .9rem;
    font-weight: 550; letter-spacing: 0; text-transform: none; white-space: nowrap;
}
.lang-menu__list .lang-menu__item:hover { background: var(--surface); color: var(--ink); }
.lang-menu__list .lang-menu__item.is-active { font-weight: 700; }
.lang-menu__list .lang-menu__name { flex: 1; }
.lang-menu__list .lang-menu__check { color: var(--accent); font-weight: 700; }

/* On the always-dark app header. */
.app-header .lang-menu__toggle { border-color: rgba(255, 255, 255, .22); color: #e3e5e8; }
.app-header .lang-menu__toggle:hover { background: rgba(255, 255, 255, .08); }

/* =========================================================================
   Uploader: large-file note, live stats, warning
   ========================================================================= */
.dropzone__note { margin: .8rem 0 0; font-size: .82rem; color: var(--muted); }
.upload-panel__stats {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-top: .55rem; font-size: .82rem;
}
.upload-panel__stats #uploadEta { font-weight: 600; color: var(--ink-soft); }
.upload-warning {
    margin: .8rem 0 0; font-size: .82rem; color: var(--warn);
    background: var(--warn-soft); padding: .55em .8em; border-radius: var(--radius-sm);
}
/* Standalone upload error/notice (e.g. "already uploaded") — lives outside the
   progress panel so it stays visible after showError() hides that panel. */
.upload-error {
    margin: .9rem 0 0; padding: .7em 1em; font-size: .92rem;
    background: var(--accent-soft); border: 1px solid var(--accent);
    border-radius: var(--radius-sm); color: var(--accent-dark);
}

/* =========================================================================
   Time pins (comments on the recording timeline)
   ========================================================================= */
.pins { margin-top: 1.8rem; }
.pin-add { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.pin-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; flex: 1; min-width: 260px; }
.pin-form__time {
    font-weight: 700; font-variant-numeric: tabular-nums; font-size: .85rem;
    background: var(--accent-soft); color: var(--accent-dark);
    border-radius: 100px; padding: .35em .7em;
}
.pin-form input {
    flex: 1; min-width: 160px; font: inherit; padding: .55em .8em;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--ink);
}
.pin-form input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 26, 32, .08); }

.pin-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pin { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.pin__time {
    flex: none; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .85rem;
    color: var(--accent); background: var(--accent-soft);
    border: 0; border-radius: 100px; padding: .35em .75em; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.pin__time::before { content: "▶"; font-size: .72em; margin-right: .4em; }
.pin__time:hover { background: var(--accent); color: #fff; }
.pin__comment { flex: 1; word-break: break-word; }
.pin__del {
    flex: none; background: none; border: 0; color: var(--muted);
    cursor: pointer; font-size: 1rem; line-height: 1; padding: .3em; border-radius: 6px;
}
.pin__del:hover { color: var(--accent); background: var(--surface); }
.pin-empty { padding: .8rem .2rem; }

/* =========================================================================
   Public sharing
   ========================================================================= */
.rec-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rec-actions form { margin: 0; }
.share-panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.4rem;
}
.share-panel p { margin: 0 0 .8rem; }
.share-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.share-row input {
    flex: 1; min-width: 220px; font: inherit; font-size: .9rem;
    padding: .55em .8em; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); background: var(--bg); color: var(--ink);
}
.share-row input:focus { outline: none; border-color: var(--ink); }
.badge--live { background: var(--ok-soft); color: var(--ok); }

/* =========================================================================
   Administration
   ========================================================================= */
.field select {
    width: 100%; font: inherit; padding: .75em .9em; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); background: var(--bg); color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 26, 32, .08); }
.field select.is-invalid { border-color: var(--accent); }

.table-wrap {
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .8rem 1rem; text-align: left; vertical-align: top; }
.table thead th {
    font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody tr + tr td { border-top: 1px solid var(--line); }
.table__num { text-align: right !important; white-space: nowrap; }
.table__actions { text-align: right; white-space: nowrap; }
.table__note { font-size: .78rem; }

.admin-form__grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.4rem;
}
.rec-card--admin { cursor: default; }
.rec-card__link { color: inherit; }
.rec-card__link:hover { text-decoration: underline; }
.rec-card__admin-actions { display: flex; gap: .5rem; margin-top: .7rem; }
.rec-card__admin-actions form { margin: 0; }

@media (max-width: 640px) {
    .admin-form__grid { grid-template-columns: 1fr; }
}

/* ---- Pricing: 4-plan layout ------------------------------------------- */
.pricing--4 { grid-template-columns: repeat(4, 1fr); }
.plan__price--text { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; padding: .35em 0; }
.stat__limit { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
@media (max-width: 1100px) {
    .pricing--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .pricing--4 { grid-template-columns: 1fr; }
}

/* ---- Stripe billing ---------------------------------------------------- */
.pricing__notice { max-width: 760px; margin: 0 auto 1.25rem; }
.pricing-cycle {
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    flex-wrap: wrap; width: fit-content; margin: 0 auto 1.5rem; padding: .3rem;
    border: 1px solid var(--line); border-radius: 100px; background: var(--bg-soft);
}
.pricing-cycle__option {
    padding: .55rem .9rem; border-radius: 100px; color: var(--muted);
    font-size: .86rem; font-weight: 650; text-decoration: none;
}
.pricing-cycle__option.is-active { color: var(--bg); background: var(--ink); }
.pricing-cycle__saving { padding: 0 .65rem 0 .35rem; color: var(--ok); font-size: .76rem; font-weight: 700; }
.plan__saving { min-height: 1.2em; margin: .15rem 0 0; color: var(--ok); font-size: .76rem; font-weight: 650; }
.plan__form { display: flex; flex-direction: column; gap: .7rem; margin-top: auto; }
.plan__consent {
    display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start;
    gap: .55rem; color: var(--muted); font-size: .76rem; line-height: 1.45;
}
.plan__consent input { width: 18px; height: 18px; margin: .08rem 0 0; accent-color: var(--accent); }
.plan__consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.billing-panel {
    border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
    padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 2.5rem;
}
.billing-panel__head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.billing-panel__head h2 { margin: .2rem 0 0; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.billing-panel__eyebrow {
    margin: 0; color: var(--muted); font-size: .74rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
}
.billing-status {
    display: inline-flex; align-items: center; min-height: 30px; padding: .35rem .7rem;
    border: 1px solid var(--line); border-radius: 100px; color: var(--muted);
    font-size: .78rem; font-weight: 650;
}
.billing-status--active { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.billing-facts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px; margin: 0 0 1.4rem; background: var(--line); border: 1px solid var(--line);
}
.billing-facts > div { background: var(--bg); padding: 1rem; }
.billing-facts dt { color: var(--muted); font-size: .78rem; margin-bottom: .2rem; }
.billing-facts dd { margin: 0; font-weight: 600; }
.billing-panel__note { max-width: 720px; margin: .8rem 0 0; font-size: .82rem; }
.billing-history { margin-bottom: 2rem; }
.billing-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .9rem; }
.billing-table th, .billing-table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.billing-table th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.billing-table tr:last-child td { border-bottom: 0; }
.billing-result { max-width: 680px; margin: 7vh auto; text-align: center; padding: 2rem 0; }
.billing-result__icon {
    display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 1.25rem;
    border: 2px solid var(--ink); border-radius: 50%; font-size: 1.7rem; font-weight: 700;
}
.billing-result h1 { margin-bottom: .7rem; }
.billing-result p { max-width: 560px; margin: 0 auto; color: var(--muted); }
.billing-result__actions { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }
.sr-only {
    position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 620px) {
    .billing-facts { grid-template-columns: 1fr; }
    .billing-result__actions .btn { width: 100%; }
}
