/* ───────────────────────── Audio Transcriber web ─────────────────────────
   Built on Radzen's Material theme (light and dark), re-tinted to the desktop app's teal.
   Dark mode is detected from the loaded theme stylesheet, so it follows Radzen's appearance toggle. */

:root {
    --at-accent: #0b7a75;
    --at-accent-strong: #09625e;
    --at-accent-soft: rgba(11, 122, 117, 0.10);
    --at-ink: #1d2b33;
    --at-ok: #2e7d32;
    --at-bad: #c62828;
    --at-warn: #b26a00;
    --at-mark: #ffe68c;
    --at-mark-active: #ffc94d;
    --at-current: rgba(11, 122, 117, 0.16);
    --at-radius: 14px;
    --at-radius-sm: 9px;
    --at-card: var(--rz-base-background-color, #fff);
    --at-line: rgba(29, 43, 51, 0.10);
    --at-muted: var(--rz-text-secondary-color, #6b7a83);
    --at-faint: var(--rz-text-tertiary-color, #8a979e);
    --at-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --at-shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .25);

    --rz-primary: var(--at-accent);
    --rz-primary-light: #13958f;
    --rz-primary-lighter: var(--at-accent-soft);
    --rz-primary-dark: var(--at-accent-strong);
    --rz-primary-darker: #074d4a;
    --rz-on-primary: #fff;
    --rz-body-background-color: #eef1f2;
    --rz-header-background-color: var(--at-card);
    --rz-text-font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --rz-border-radius: 8px;
}

html:has(link[href*="material-dark"]) {
    --at-accent: #34bfb6;
    --at-accent-strong: #5fd4cc;
    --at-accent-soft: rgba(52, 191, 182, 0.14);
    --at-ok: #66bb6a;
    --at-bad: #ef5350;
    --at-warn: #ffb74d;
    --at-mark: rgba(255, 214, 92, 0.32);
    --at-mark-active: rgba(255, 196, 0, 0.6);
    --at-current: rgba(52, 191, 182, 0.24);
    --at-line: rgba(255, 255, 255, 0.09);
    --at-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --rz-primary-light: #4fd0c8;
    --rz-primary-dark: #22968f;
    --rz-on-primary: #00201e;
    --rz-body-background-color: #101416;
    --rz-base-background-color: #1a2023;
    --rz-header-background-color: #1a2023;
    --rz-sidebar-background-color: #161b1e;
    --rz-panel-background-color: #1a2023;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: var(--rz-text-font-family);
    background: var(--rz-body-background-color);
    color: var(--rz-text-color);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--at-accent); }
code { font-family: "Cascadia Code", Consolas, ui-monospace, monospace; font-size: .88em; padding: .08em .35em; border-radius: 5px; background: var(--at-accent-soft); }
.grow { flex: 1 1 auto; }
.muted { color: var(--at-muted); }
.small { font-size: .8rem; }
.mono { font-family: "Cascadia Code", Consolas, ui-monospace, monospace; font-size: .85em; }
.w-100 { width: 100%; }
.link { color: var(--at-accent); text-decoration: none; font-weight: 600; font-size: .875rem; }
.link:hover { text-decoration: underline; }
.link-button { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; text-align: left; }
.link-button:hover { color: var(--at-accent); text-decoration: underline; }
.page-loading { display: grid; place-items: center; min-height: 50vh; }

/* ───────── Shell ───────── */
.app-header { box-shadow: none; border-bottom: 1px solid var(--at-line); background: var(--rz-header-background-color); color: var(--rz-text-color); }
.app-header__row { display: flex; align-items: center; gap: .5rem; height: 60px; padding: 0 1rem 0 .5rem; }
.app-header .rz-sidebar-toggle { color: var(--rz-text-color); }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--rz-text-color); font-weight: 650; font-size: 1.05rem; letter-spacing: -.01em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__mark--lg { width: 40px; height: 40px; }
.brand__tile { fill: var(--at-ink); }
.brand__bars line { stroke: #5fd4cc; }
html:has(link[href*="material-dark"]) .brand__tile { fill: #0d3b39; }
.app-sidebar { border-right: 1px solid var(--at-line); display: flex; flex-direction: column; }
.app-sidebar .rz-panel-menu { padding: .75rem .5rem; background: transparent; }
.app-sidebar .rz-navigation-item-link { border-radius: 10px; margin: 2px 0; }
.app-sidebar .rz-navigation-item-link-active,
.app-sidebar .rz-navigation-item-wrapper-active .rz-navigation-item-link { background: var(--at-accent-soft); color: var(--at-accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 1rem; border-top: 1px solid var(--at-line); }
.sidebar-foot__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--at-faint); margin-bottom: .5rem; font-weight: 600; }
.sidebar-foot__chips, .perm-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.perm-chip { font-size: .72rem; padding: .18rem .5rem; border-radius: 999px; background: var(--at-accent-soft); color: var(--at-accent); font-weight: 600; white-space: nowrap; }
.perm-chip--admin { background: rgba(124, 58, 237, .12); color: #7c3aed; }
html:has(link[href*="material-dark"]) .perm-chip--admin { color: #c4a5ff; background: rgba(167, 139, 250, .16); }
.perm-chip--muted { background: transparent; border: 1px dashed var(--at-line); color: var(--at-muted); }
.app-body { padding: 0; }

.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
          background: linear-gradient(135deg, var(--at-accent), #2563eb); color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .02em; }
.avatar--0 { background: linear-gradient(135deg, #0b7a75, #14b8a6); }
.avatar--1 { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.avatar--2 { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.avatar--3 { background: linear-gradient(135deg, #db2777, #f472b6); }
.avatar--4 { background: linear-gradient(135deg, #ea580c, #fbbf24); }
.avatar--5 { background: linear-gradient(135deg, #16a34a, #4ade80); }
.profile-menu { background: transparent !important; }
.profile-menu .rz-navigation-item-link { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem; border-radius: 999px; }
.profile-menu__name { font-weight: 600; font-size: .9rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rz-text-color); }
.profile-menu__header { padding: .75rem 1rem; border-bottom: 1px solid var(--at-line); min-width: 240px; }
.profile-menu__display { font-weight: 650; }
.profile-menu__email { font-size: .82rem; color: var(--at-muted); }

/* ───────── Page scaffolding ───────── */
.page { padding: 1.5rem clamp(1rem, 2.5vw, 2rem) 2.5rem; max-width: 1680px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head__title { margin: 0; font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; }
.page-head__subtitle { margin: .2rem 0 0; color: var(--at-muted); font-size: .92rem; max-width: 70ch; }
.page-head__actions { display: flex; gap: .5rem; }
.card { background: var(--at-card); border: 1px solid var(--at-line); border-radius: var(--at-radius); box-shadow: var(--at-shadow); }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3.5rem 1.5rem; gap: .35rem; }
.empty-state__icon { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; background: var(--at-accent-soft); color: var(--at-accent); margin-bottom: .6rem; }
.empty-state__icon .rzi { font-size: 34px; }
.empty-state__title { margin: 0; font-size: 1.15rem; font-weight: 650; }
.empty-state__text { margin: 0; color: var(--at-muted); max-width: 42ch; line-height: 1.5; }

/* Buttons for plain-HTML forms and links (Radzen buttons are used inside interactive pages) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 10px;
       padding: .62rem 1.1rem; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--at-accent); color: #fff; box-shadow: 0 1px 2px rgba(11, 122, 117, .3); }
html:has(link[href*="material-dark"]) .btn--primary { color: #00201e; }
.btn--primary:hover { background: var(--at-accent-strong); }
.btn--ghost { background: transparent; color: var(--rz-text-color); border-color: var(--at-line); }
.btn--ghost:hover { background: var(--at-accent-soft); color: var(--at-accent); }
.btn--sm { padding: .35rem .7rem; font-size: .82rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn .rzi { font-size: 1.15em; }

/* ───────── Sign-in pages ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 560px); }
.auth__hero { position: relative; overflow: hidden; color: #e8f6f5;
              background: radial-gradient(1200px 600px at 10% 10%, #13958f 0%, transparent 60%),
                          radial-gradient(900px 700px at 90% 100%, #2563eb 0%, transparent 55%), #0e1c22; }
.auth__hero-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; padding: clamp(2rem, 5vw, 4rem); }
.auth__brand { display: flex; align-items: center; gap: .75rem; font-weight: 650; font-size: 1.1rem; }
.auth__brand .brand__tile { fill: rgba(255, 255, 255, .1); }
.auth__headline { margin: auto 0 1rem; font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 750; }
.auth__lede { max-width: 38ch; font-size: 1.05rem; line-height: 1.55; color: rgba(232, 246, 245, .78); margin: 0 0 2.5rem; }
.auth__wave { display: flex; align-items: center; gap: 5px; height: 90px; opacity: .75; }
.auth__wave span { flex: 1; height: var(--h); border-radius: 4px; background: linear-gradient(180deg, #5fd4cc, rgba(95, 212, 204, .25));
                   animation: wave 2.8s ease-in-out var(--d) infinite alternate; transform-origin: center; }
@keyframes wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .auth__wave span { animation: none; } }
.auth__main { display: flex; flex-direction: column; justify-content: center; padding: 2rem clamp(1.25rem, 4vw, 3.5rem); background: var(--rz-body-background-color); }
.auth__card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth__mobile-brand { display: none; align-items: center; gap: .6rem; font-weight: 650; margin-bottom: 2rem; }
.auth__title { margin: 0 0 .35rem; font-size: 1.75rem; font-weight: 720; letter-spacing: -.02em; }
.auth__subtitle { margin: 0 0 1.6rem; color: var(--at-muted); line-height: 1.5; }
.auth__legal { text-align: center; color: var(--at-faint); font-size: .78rem; margin-top: 2.5rem; }
.auth__message { text-align: center; }
.auth__message-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 1.25rem; }
.auth__message-icon .rzi { font-size: 32px; }
.auth__message-icon--ok { background: rgba(46, 125, 50, .12); color: var(--at-ok); }
.auth__message-icon--warn { background: rgba(178, 106, 0, .12); color: var(--at-warn); }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--at-muted); text-decoration: none; font-size: .88rem; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--at-accent); }
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__hero { display: none; }
    .auth__mobile-brand { display: flex; }
}

.form { display: flex; flex-direction: column; gap: 1.05rem; }
.field__label-row { display: flex; justify-content: space-between; align-items: baseline; }
.field__label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .4rem; }
.field__control { position: relative; }
.field__icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--at-faint); font-size: 20px; pointer-events: none; }
.field__input { width: 100%; padding: .8rem .95rem .8rem 2.75rem; border: 1px solid var(--at-line); border-radius: 11px; font: inherit; font-size: .98rem;
                background: var(--at-card); color: var(--rz-text-color); transition: border-color .15s, box-shadow .15s; }
.field__input:focus { outline: none; border-color: var(--at-accent); box-shadow: 0 0 0 4px var(--at-accent-soft); }
.field__input.invalid { border-color: var(--at-bad); }
.field__error { color: var(--at-bad); font-size: .82rem; margin-top: .3rem; }
.check { display: flex; align-items: center; gap: .55rem; font-size: .9rem; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--at-accent); }
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 11px; margin-bottom: 1.1rem; font-size: .9rem; line-height: 1.45; }
.notice .rzi { font-size: 20px; flex: none; }
.notice--error { background: rgba(198, 40, 40, .08); color: var(--at-bad); border: 1px solid rgba(198, 40, 40, .2); }
.notice--ok { background: rgba(46, 125, 50, .08); color: var(--at-ok); border: 1px solid rgba(46, 125, 50, .2); }

/* ───────── Library: search ───────── */
.search-panel { display: flex; flex-direction: column; gap: .75rem; }
.search-panel__main { display: flex; gap: .5rem; align-items: center; }
.search-panel__filters { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.search-panel__error { color: var(--at-bad); font-size: .86rem; display: inline-flex; gap: .3rem; align-items: center; }
.search-box { position: relative; flex: 1; display: flex; align-items: center; background: var(--at-card); border: 1px solid var(--at-line);
              border-radius: 14px; box-shadow: var(--at-shadow); transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: var(--at-accent); box-shadow: 0 0 0 4px var(--at-accent-soft); }
.search-box--error { border-color: var(--at-bad); }
.search-box__icon { position: absolute; left: 1rem; color: var(--at-faint); font-size: 22px; pointer-events: none; }
.search-box__input { flex: 1; border: 0; background: transparent; padding: .95rem 2.75rem .95rem 3.1rem; font: inherit; font-size: 1.02rem; color: var(--rz-text-color); min-width: 0; }
.search-box__input:focus { outline: none; }
.search-box__input::-webkit-search-cancel-button { display: none; }
.search-box__clear { position: absolute; right: .55rem; border: 0; background: transparent; color: var(--at-muted); cursor: pointer; border-radius: 8px; padding: .3rem; display: grid; }
.search-box__clear:hover { background: var(--at-accent-soft); color: var(--at-accent); }
.search-box--sm { flex: 0 1 320px; border-radius: 10px; box-shadow: none; }
.search-box--sm .search-box__input { padding: .55rem .75rem .55rem 2.5rem; font-size: .9rem; }
.search-box--sm .search-box__icon { left: .75rem; font-size: 19px; }
.filter-dropdown { min-width: 200px; }
.filter-dropdown--tags { min-width: 220px; }
.tag-option { display: flex; align-items: center; gap: .5rem; width: 100%; }
.tag-option__name { flex: 1; }
.tag-option__count { font-size: .75rem; color: var(--at-muted); background: var(--at-accent-soft); padding: 0 .45rem; border-radius: 999px; }
.tag-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ───────── Library: results + detail ───────── */
.library { display: grid; grid-template-columns: minmax(360px, 42%) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.results { overflow: hidden; position: sticky; top: 1rem; }
.results__grid { border: 0; }
.results .rz-data-grid { border: 0; background: transparent; }
.results .rz-grid-table td { padding-top: .7rem; padding-bottom: .7rem; vertical-align: top; }
.results .rz-data-row { cursor: pointer; transition: background .1s; }
.results .rz-data-row.rz-state-highlight > td,
.results .rz-data-row.rz-state-highlight:hover > td { background: var(--at-accent-soft) !important; box-shadow: inset 3px 0 0 var(--at-accent); }
.result { min-width: 0; }
.result__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__snippet { font-size: .83rem; color: var(--at-muted); margin-top: .2rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.result__snippet mark { background: var(--at-mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.result__tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .4rem; }
.result__more { font-size: .72rem; color: var(--at-muted); align-self: center; }
.result__date { font-size: .88rem; white-space: nowrap; }
.result__sub { font-size: .75rem; color: var(--at-faint); white-space: nowrap; }
.result__len { font-variant-numeric: tabular-nums; color: var(--at-muted); font-size: .88rem; }
.detail__back { display: none; }
.detail__empty { min-height: 420px; display: grid; place-items: center; }

@media (max-width: 1100px) {
    .library { grid-template-columns: 1fr; }
    .results { position: static; }
    .library--has-selection .results { display: none; }
    .library:not(.library--has-selection) .detail { display: none; }
    .detail__back { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: none; color: var(--at-accent); font: inherit; font-weight: 600; cursor: pointer; padding: .25rem 0 .75rem; }
}

/* Tag chips */
.tag-chip { --tag: #0b7a75; display: inline-flex; align-items: center; gap: .38rem; padding: .28rem .6rem .28rem .5rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
            background: color-mix(in srgb, var(--tag) 13%, transparent); color: color-mix(in srgb, var(--tag) 82%, var(--rz-text-color)); border: 1px solid color-mix(in srgb, var(--tag) 26%, transparent); line-height: 1.2; }
.tag-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tag); flex: none; }
.tag-chip--sm { font-size: .72rem; padding: .12rem .45rem .12rem .38rem; gap: .3rem; }
.tag-chip--sm .tag-chip__dot { width: 6px; height: 6px; }
.tag-chip--clickable { cursor: pointer; }
.tag-chip--clickable:hover { background: color-mix(in srgb, var(--tag) 20%, transparent); }
.tag-chip__remove { border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 0; margin-right: -.2rem; border-radius: 50%; opacity: .6; }
.tag-chip__remove:hover { opacity: 1; background: color-mix(in srgb, var(--tag) 25%, transparent); }
.tag-chip__remove .rzi { font-size: 15px; }

/* Transcript panel */
.tp { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.tp__title-row { display: flex; align-items: center; gap: .3rem; }
.tp__title { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; word-break: break-word; }
.tp__title-edit { opacity: .55; }
.tp__title-row:hover .tp__title-edit { opacity: 1; }
.tp__rename { display: flex; gap: .4rem; align-items: center; }
.tp__rename-input { flex: 1; font-size: 1.1rem; }
.tp__facts { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .65rem; }
.fact { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; color: var(--at-muted); }
.fact .rzi { font-size: 17px; color: var(--at-faint); }
.fact--accent, .fact--accent .rzi { color: var(--at-accent); }
.tp__props { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1rem 1.5rem; padding: 1rem 1.1rem; border-radius: var(--at-radius-sm); background: color-mix(in srgb, var(--rz-body-background-color) 55%, transparent); border: 1px solid var(--at-line); }
@media (max-width: 720px) { .tp__props { grid-template-columns: 1fr; } }
.prop__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--at-faint); margin-bottom: .4rem; }
.prop__edit { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.prop__date { width: 100%; }
.prop__value { font-size: .92rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tag-add { display: inline-flex; align-items: center; gap: .1rem; }
.tag-add__input { width: 150px; }
.tag-add__input input { border-radius: 999px !important; padding-left: .8rem !important; height: 30px; font-size: .85rem; }

/* Player */
.player { border-radius: var(--at-radius-sm); padding: .85rem; background: linear-gradient(135deg, var(--at-accent-soft), transparent 70%); border: 1px solid var(--at-line); display: flex; flex-direction: column; gap: .6rem; }
.player audio { width: 100%; height: 44px; border-radius: 999px; }
.player__tools { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.player__error { display: none; align-items: center; gap: .4rem; color: var(--at-warn); font-size: .86rem; }
.player--error .player__error { display: flex; }
.player--error audio { opacity: .4; }
.switch-label { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--at-muted); cursor: pointer; user-select: none; }

/* Transcript */
.tp__toolbar { display: flex; align-items: center; gap: .4rem .8rem; flex-wrap: wrap; border-bottom: 1px solid var(--at-line); padding-bottom: .6rem; margin-bottom: -.4rem; }
.hits { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; padding: .2rem .65rem; border-radius: 999px; background: var(--at-mark); }
.hits .rzi { font-size: 17px; }
.hits--none { background: transparent; color: var(--at-muted); padding: 0; }
.transcript { position: relative; max-height: min(64vh, 860px); overflow: auto; white-space: pre-wrap; word-wrap: break-word; font-size: 1.04rem; line-height: 1.85;
              padding: .4rem .35rem 2rem 0; scroll-behavior: smooth; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, Georgia, serif; }
.transcript::-webkit-scrollbar { width: 10px; }
.transcript::-webkit-scrollbar-thumb { background: var(--at-line); border-radius: 10px; border: 2px solid var(--at-card); }
.transcript--loading { display: flex; flex-direction: column; gap: .6rem; }
.transcript--timed .w { cursor: pointer; border-radius: 4px; transition: background .12s, box-shadow .12s; }
.transcript--timed .w:hover { background: var(--at-accent-soft); box-shadow: 0 0 0 2px var(--at-accent-soft); }
.transcript .w.is-current { background: var(--at-current); box-shadow: 0 0 0 2px var(--at-current); color: var(--at-accent-strong); }
.transcript--unsure .w.low { text-decoration: underline dotted color-mix(in srgb, var(--at-warn) 75%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.transcript mark.hit { background: var(--at-mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.transcript mark.hit.is-active { background: var(--at-mark-active); box-shadow: 0 0 0 2px var(--at-mark-active); animation: pulse .6s ease-out; }
@keyframes pulse { from { box-shadow: 0 0 0 8px transparent; } }
.tp__hint { display: flex; align-items: center; gap: .4rem; color: var(--at-muted); font-size: .84rem; margin: 0; }

/* Dialogs */
.tips__table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tips__table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--at-faint); padding: .3rem .5rem; }
.tips__table td { padding: .55rem .5rem; border-top: 1px solid var(--at-line); vertical-align: top; }
.tips__note { color: var(--at-muted); font-size: .88rem; line-height: 1.55; }
.color-dialog { display: flex; flex-direction: column; gap: 1rem; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; }
.swatch { aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; background: var(--c); cursor: pointer; transition: transform .1s; }
.swatch:hover { transform: scale(1.08); }
.swatch--on { border-color: var(--rz-text-color); box-shadow: inset 0 0 0 2px var(--at-card); }
.color-dialog__custom { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: var(--at-muted); }
.dialog-actions { display: flex; align-items: center; gap: .5rem; padding-top: .5rem; }

/* ───────── Admin ───────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.stat { display: flex; gap: 1rem; padding: 1.15rem 1.2rem; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--at-shadow-lg); }
.stat--alert { border-color: color-mix(in srgb, var(--at-bad) 40%, transparent); }
.stat__icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat__icon .rzi { font-size: 24px; }
.stat__icon--teal { background: rgba(11, 122, 117, .12); color: var(--at-accent); }
.stat__icon--amber { background: rgba(202, 138, 4, .14); color: #b7791f; }
.stat__icon--blue { background: rgba(37, 99, 235, .12); color: #2563eb; }
.stat__icon--red { background: rgba(220, 38, 38, .12); color: var(--at-bad); }
.stat__value { font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { font-weight: 600; font-size: .88rem; }
.stat__sub { color: var(--at-muted); font-size: .8rem; margin-top: .15rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; }
@media (max-width: 520px) { .admin-grid { grid-template-columns: 1fr; } }
.panel { padding: 1.1rem 1.25rem 1.25rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.panel__head h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.panel__note { color: var(--at-muted); font-size: .82rem; margin: .75rem 0 0; }
.legend { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--at-muted); }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: .4rem; }
.legend__dot--ok { background: var(--at-ok); }
.legend__dot--bad { background: var(--at-bad); }
.signin-chart { height: 240px; width: 100%; }
.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.event { display: flex; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--at-line); align-items: flex-start; }
.event:first-child { border-top: 0; }
.event__icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--at-accent-soft); color: var(--at-accent); flex: none; }
.event__icon .rzi { font-size: 18px; }
.event--bad .event__icon { background: rgba(220, 38, 38, .1); color: var(--at-bad); }
.event__body { flex: 1; min-width: 0; font-size: .88rem; }
.event__line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event__detail { color: var(--at-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event__time { color: var(--at-faint); font-size: .76rem; white-space: nowrap; }
.event-list__empty { margin: .5rem 0; }
.settings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .9rem; }
.settings-list li { display: flex; gap: .6rem; align-items: center; }
.settings-list .rzi { color: var(--at-accent); font-size: 19px; }

.toolbar { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--at-line); }
.toolbar--wrap { flex-wrap: wrap; }
.log-date { width: 150px; }
.users-grid, .log-grid { border: 0 !important; }
.users-grid .rz-grid-table td, .log-grid .rz-grid-table td { padding-top: .65rem; padding-bottom: .65rem; }
.user-cell { display: flex; align-items: center; gap: .7rem; }
.user-cell__name { font-weight: 600; }
.user-cell__email { color: var(--at-muted); font-size: .82rem; }
.you { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: .05rem .4rem; border-radius: 6px; background: var(--at-accent-soft); color: var(--at-accent); margin-left: .25rem; vertical-align: middle; }
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; padding: .18rem .6rem; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--active { color: var(--at-ok); background: rgba(46, 125, 50, .1); }
.status--invited { color: #b7791f; background: rgba(202, 138, 4, .12); }
.status--lockedout { color: var(--at-bad); background: rgba(220, 38, 38, .1); }
.status--disabled { color: var(--at-muted); background: var(--at-line); }
.event-kind { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .86rem; }
.event-kind .rzi { font-size: 18px; color: var(--at-accent); }
.event-kind--bad, .event-kind--bad .rzi { color: var(--at-bad); }
.log-detail { font-size: .86rem; color: var(--at-muted); white-space: normal; }

.user-form__label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.user-form__label { font-weight: 650; font-size: .9rem; }
.presets { display: flex; gap: .3rem; }
.preset { border: 1px solid var(--at-line); background: transparent; color: var(--rz-text-color); border-radius: 999px; padding: .2rem .65rem; font: inherit; font-size: .78rem; cursor: pointer; }
.preset:hover { border-color: var(--at-accent); color: var(--at-accent); }
.perm-list { display: flex; flex-direction: column; gap: .4rem; }
.perm { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--at-line); border-radius: 11px; cursor: pointer; transition: border-color .12s, background .12s; }
.perm--on { border-color: color-mix(in srgb, var(--at-accent) 45%, transparent); background: var(--at-accent-soft); }
.perm--locked { cursor: default; opacity: .85; }
.perm__text { display: flex; flex-direction: column; }
.perm__name { font-weight: 600; font-size: .9rem; }
.perm__desc { color: var(--at-muted); font-size: .8rem; }

/* Radzen tweaks */
.rz-dialog { border-radius: 16px !important; }
.rz-dialog-titlebar { padding-bottom: .25rem; }
.rz-notification-item-wrapper { border-radius: 12px; }

#blazor-error-ui { background: #fff3cd; color: #5c4400; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
