/* ============================================================
   Speaker Studio — flat editorial + kinetic typography layer.
   No shadows, no glows: ink, paper, rules, and type in motion.
   ============================================================ */

:root {
    /* display face = the same gothic family, pushed to its heaviest weights */
    --font-display: var(--font-jp);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

/* Chrome (especially Android) paints a rounded gray blob over tapped elements
   by default — kill it app-wide. */
* { -webkit-tap-highlight-color: transparent; }

/* ---- global view transition: every routed view slides in ---- */
.main-content > * { animation: view-in 0.55s var(--ease-out) both; }
@keyframes view-in {
    from { opacity: 0; transform: translateY(18px); }
}

/* generic staggered row entrance (set --i from JS) */
@keyframes row-in {
    from { opacity: 0; transform: translateY(14px); }
}

/* number "pop" when a counter changes */
.pop { animation: pop 0.4s var(--ease-out); }
@keyframes pop { 30% { transform: scale(1.4); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---- kinetic per-character text (shared) ---- */
/* NOTE: no filter/blur here — Chrome rasterizes blurred text layers with a
   visible rounded gray backing rectangle on some GPUs. */
.ch {
    display: inline-block; white-space: pre;
    animation: ch-in 0.7s var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 24ms + 0.1s);
}
@keyframes ch-in {
    0%   { opacity: 0; transform: translateY(0.7em) rotate(3deg) scale(0.92); }
    100% { opacity: 1; transform: none; }
}

/* ---- progress bar (flat) ---- */
.bar { display: flex; flex-direction: column; gap: 0.45rem; }
.bar__track { height: 4px; border-radius: 999px; background: var(--paper-4); overflow: hidden; }
.bar__fill { height: 100%; background: var(--ink); transition: width 0.6s var(--ease-out); }
.bar__fill.is-complete { background: var(--success); }
.bar__label {
    display: flex; justify-content: space-between;
    font-family: var(--font-mono); font-feature-settings: 'tnum';
    font-size: var(--t-eyebrow); color: var(--ink-4); letter-spacing: var(--tracking-wide);
}

/* ---- project list: editorial index rows ---- */
.proj-list { margin-top: 2rem; border-top: 1px solid var(--rule); }
.proj-row {
    position: relative; cursor: pointer;
    display: grid;
    grid-template-columns: 3.2em minmax(0,1fr) minmax(140px, 200px) auto auto auto;
    gap: 1.5rem; align-items: center;
    width: 100%; text-align: left;
    padding: 1.75rem 0.25rem; border-bottom: 1px solid var(--rule);
    animation: row-in 0.5s var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 55ms + 0.1s);
    transition: padding-left var(--dur-2) var(--ease-out);
}
.proj-row::after {
    content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
    background: var(--ink); transform: scaleX(0); transform-origin: left;
    transition: transform 0.45s var(--ease-out);
}
.proj-row:hover { padding-left: 0.75rem; }
.proj-row:hover::after { transform: scaleX(1); }
.proj-row:hover .proj-row__arrow { color: var(--ink); transform: translateX(4px); }
.proj-row__num {
    font-family: var(--font-mono); font-size: var(--t-caption); color: var(--ink-4);
    font-feature-settings: 'tnum';
}
.proj-row__name {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 800; color: var(--ink);
    letter-spacing: var(--tracking-snug); line-height: 1.3;
}
.proj-row__meta {
    display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.3rem;
    font-size: var(--t-caption); color: var(--ink-4);
}
.proj-row__arrow { color: var(--ink-5); transition: color var(--dur-1), transform var(--dur-2) var(--ease-out); }
.proj-row__arrow svg { width: 20px; height: 20px; display: block; }
.proj-row__del {
    width: 38px; height: 38px; display: grid; place-items: center;
    border-radius: var(--radius-sm); color: var(--ink-5);
    transition: color var(--dur-1), background var(--dur-1);
}
.proj-row__del:hover { color: var(--danger); background: var(--danger-soft); }
.proj-row__del svg { width: 17px; height: 17px; }
@media (max-width: 720px) {
    .proj-row { grid-template-columns: 2.4em 1fr auto auto; }
    .proj-row__progress { grid-column: 2 / -1; order: 5; }
    .proj-row__arrow { display: none; }
}

/* huge count numeral for list headers */
.count-display {
    display: flex; align-items: baseline; gap: 0.75rem; margin: 2.25rem 0 0;
}
.count-display__num {
    font-family: var(--font-en); font-size: clamp(3rem, 7vw, 4.5rem); font-weight: 900;
    letter-spacing: var(--tracking-tight); line-height: 1; color: var(--ink);
    font-feature-settings: 'tnum';
}
.count-display__label {
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase; color: var(--ink-4);
}

/* ---- wizard steps ---- */
.wiz-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 0.875rem; margin-bottom: 2.75rem; }
.wiz-step {
    display: flex; align-items: center; gap: 0.625rem;
    font-family: var(--font-en); font-size: var(--t-small); font-weight: 600;
    color: var(--ink-4); letter-spacing: var(--tracking-snug);
    transition: color var(--dur-2) var(--ease);
}
.wiz-step__num {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
    border: 1px solid var(--rule-2);
    font-family: var(--font-mono); font-weight: 700; font-size: var(--t-caption);
    transition: background var(--dur-2) var(--ease), color var(--dur-2), border-color var(--dur-2);
}
.wiz-step__num svg { width: 14px; height: 14px; }
.wiz-step.is-active { color: var(--ink); }
.wiz-step.is-active .wiz-step__num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.wiz-step.is-done .wiz-step__num { background: var(--success); color: #fff; border-color: var(--success); }
.wiz-step__bar { width: 40px; height: 1px; background: var(--rule-2); }

/* ---- terms ---- */
.terms {
    max-height: 300px; overflow-y: auto;
    padding: 1.75rem 2rem; margin-bottom: 1.75rem;
    border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper);
    font-size: var(--t-small); color: var(--ink-3); line-height: 2;
}
.terms h4 {
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase;
    color: var(--ink); margin: 1.75rem 0 0.5rem;
}
.terms h4:first-child { margin-top: 0; }
.checkline { display: flex; gap: 0.875rem; align-items: flex-start; cursor: pointer; font-size: var(--t-body); color: var(--ink-2); }
.checkline input { margin-top: 0.3rem; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }

/* ---- explainer video (flat) ---- */
.video { position: relative; aspect-ratio: 16 / 9; width: 100%; background: var(--ink); border-radius: var(--radius-lg); overflow: hidden; }
[data-theme="dark"] .video { border: 1px solid var(--rule-2); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__ph {
    position: absolute; inset: 0; display: grid; place-content: center; gap: 1.5rem; text-align: center;
    color: var(--paper); padding: 2rem;
}
.video__eyebrow {
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase; opacity: 0.5;
}
.video__title { font-family: var(--font-display); font-size: var(--t-h3); font-weight: 800; letter-spacing: 0.02em; }
.video__play {
    justify-self: center; display: grid; place-items: center; width: 80px; height: 80px;
    border-radius: 999px; border: 1px solid color-mix(in srgb, var(--paper) 40%, transparent);
    color: var(--paper); background: transparent;
    transition: background var(--dur-2) var(--ease), color var(--dur-2), transform var(--dur-2) var(--ease-out);
}
.video__play:hover { background: var(--paper); color: var(--ink); transform: scale(1.06); }
.video__play svg { width: 30px; height: 30px; margin-left: 4px; }
.video__progress { width: min(320px, 60vw); height: 2px; background: color-mix(in srgb, var(--paper) 22%, transparent); overflow: hidden; margin: 0 auto; }
.video__progress-fill { height: 100%; width: 0; background: var(--paper); }

/* ============================================================
   RECORDER — the kinetic type stage
   ============================================================ */
.rec {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 1023px) { .rec { grid-template-columns: 1fr; gap: 1.5rem; } }
.rec-main { min-width: 0; }

.rec-bar {
    position: sticky; top: 0.75rem; z-index: 40;
    display: grid; grid-template-columns: auto 1fr auto; gap: 1.75rem; align-items: center;
    padding: 0.95rem 1.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--rule-2) 70%, transparent);
    border-radius: var(--radius-lg);
}
.rec-bar__id { min-width: 0; }
.rec-bar__eyebrow {
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase; color: var(--ink-4);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-bar__count { font-family: var(--font-mono); font-feature-settings: 'tnum'; font-size: var(--t-caption); color: var(--ink-4); }
.rec-bar__count b { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: var(--tracking-tight); display: inline-block; }
.rec-bar__actions { display: flex; align-items: center; gap: 0.6rem; }
.rec-bar__gear {
    width: 42px; height: 42px; display: grid; place-items: center;
    border: 1px solid var(--rule-2); border-radius: 999px; color: var(--ink-4);
}
.rec-bar__gear svg { width: 18px; height: 18px; }
/* On tablet/phone the rail drops below the stage, so a sticky bar would
   just collide with the app top-bar (higher z-index) when scrolling. Let it
   scroll away with the content. */
@media (max-width: 1023px) {
    .rec-bar { position: static; }
}
@media (max-width: 720px) {
    .rec-bar {
        grid-template-columns: 1fr auto;
        gap: 0.75rem 1rem;
        padding: 0.85rem 1.1rem;
    }
    .rec-bar__id { grid-column: 1; grid-row: 1; }
    .rec-bar__actions { grid-column: 2; grid-row: 1; justify-self: end; }
    /* progress spans the full width on its own row instead of being crushed
       into the narrow middle auto-column */
    #topProgress { grid-column: 1 / -1; grid-row: 2; order: 3; min-width: 0; }
    .rec-bar__count b { font-size: 1.25rem; }
    .rec-bar__actions .btn { padding: 0 1.1rem; }
}

/* full-screen seascape painted from recording progress. Fixed behind the
   whole recording view; the nav sidebar (z:2, opaque) and the corpus rail
   sit above it. Readability comes from the glass chips and soft text
   edges, so the picture itself stays untinted edge to edge. */
/* The routed-view entrance animation puts a transform on .rec, which would
   turn it into the containing block for position:fixed and trap the scene
   inside the column. Keep .rec transform-free and animate its children. */
.main-content > .rec { animation: none; }
.rec > .rec-main, .rec > .rec-rail { animation: view-in 0.55s var(--ease-out) both; }

.rec-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.rec-sky canvas { display: block; width: 100%; height: 100%; transition: opacity 1.2s linear; }
.rec-main { position: relative; z-index: 1; }
.rec-rail { z-index: 1; }
.rec .rec-bar {
    background: color-mix(in srgb, var(--paper-2) 68%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

/* stage */
.rec-stage {
    position: relative; z-index: 1;
    display: grid; gap: 1.6rem; justify-items: center; text-align: center; align-content: center;
    min-height: min(62vh, 580px);
    padding: clamp(2rem, 5vw, 4rem) 1rem 2.25rem;
    overflow: hidden;
}
/* subtitle-style drop shadow: keeps type legible over the scene in any
   phase. Always dark (like the record button's shadow) — a white halo
   around dark light-theme text looked like glow. Kept subtle. */
.rec-stage__index, .rec-stage__kana, .rec-stage__text, .rec-stage__note,
.rec-stage__state, .rec-cancel, .rec-main .btn--text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 2px 16px rgba(0, 0, 0, 0.16);
}
.rec-stage > * { position: relative; z-index: 1; }

/* giant ghost numeral — outlined display type behind the stage */
.rec-stage__ghost {
    position: absolute; z-index: 0; right: -0.04em; top: -0.1em;
    font-family: var(--font-en); font-weight: 900;
    font-size: clamp(7rem, 24vw, 16rem); line-height: 1; letter-spacing: -0.06em;
    color: transparent; -webkit-text-stroke: 1px var(--rule-2);
    opacity: 0.75;
    user-select: none; pointer-events: none;
    font-feature-settings: 'tnum';
    animation: ghost-in 0.9s var(--ease-out) both;
}
@keyframes ghost-in {
    from { opacity: 0; transform: translateX(0.15em); }
    to   { opacity: 0.75; transform: none; }
}

.rec-stage__index {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase; color: var(--ink-4);
    animation: soft-in 0.5s var(--ease-out) backwards;
}
.rec-stage__index .cat { color: var(--premium); }
.rec-stage__index .n { color: var(--ink); font-feature-settings: 'tnum'; }

.rec-stage__kana {
    font-size: var(--t-small); color: var(--ink-4);
    animation: kana-in 0.8s var(--ease-out) 0.05s backwards;
}
@keyframes kana-in {
    from { opacity: 0; letter-spacing: 0.5em; }
    to   { opacity: 1; letter-spacing: 0.18em; }
}

/* the corpus line — heavy gothic, the star of the screen.
   .seg wraps each Japanese phrase so line breaks land on natural boundaries.
   Not selectable: double-taps on mobile must not paint a selection blob. */
.rec-stage__text {
    font-size: clamp(2rem, 5.4vw, 3.9rem); line-height: 1.55; font-weight: 900;
    letter-spacing: var(--tracking-snug); color: var(--ink);
    max-width: 17ch;
    user-select: none; -webkit-user-select: none;
    cursor: pointer;   /* click = copy the sentence */
}
.rec-stage__text .pseg { display: inline-block; }

/* furigana */
.rec-stage__text.has-ruby { line-height: 1.95; }
.rec-stage__text ruby { ruby-position: over; ruby-align: center; }
.rec-stage__text rt {
    font-size: 0.26em; font-weight: 500; letter-spacing: 0.06em;
    color: var(--ink-4); user-select: none;
    animation: soft-in 0.5s var(--ease-out) 0.25s backwards;
}
.rec-stage__text.is-long  { font-size: clamp(1.65rem, 4.3vw, 3rem); max-width: 22ch; line-height: 1.65; }
.rec-stage__text.is-xlong { font-size: clamp(1.35rem, 3.4vw, 2.3rem); max-width: 28ch; line-height: 1.75; }
.rec-stage__text.is-recorded .ch { color: var(--ink-2); }

/* calibration instruction under the text */
.rec-stage__note {
    font-size: var(--t-body); color: var(--ink-3); max-width: 34ch; line-height: 1.8;
    animation: soft-in 0.5s var(--ease-out) 0.12s backwards;
}

@keyframes soft-in { from { opacity: 0; transform: translateY(10px); } }

.rec-stage__state {
    min-height: 1.6rem; font-size: var(--t-small); color: var(--ink-3);
    letter-spacing: var(--tracking-snug);
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 1rem; border-radius: 999px;
    background: color-mix(in srgb, var(--paper-2) 66%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid color-mix(in srgb, var(--rule-2) 60%, transparent);
    animation: soft-in 0.5s var(--ease-out) 0.16s backwards;
}
.rec-stage__state.is-recorded { color: var(--success); }
.rec-stage__state.is-live { color: var(--danger); font-weight: 700; }
.stamp {
    display: inline-grid; place-items: center; width: 20px; height: 20px;
    background: var(--success); color: #fff; border-radius: 999px;
    animation: stamp-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stamp svg { width: 12px; height: 12px; }
@keyframes stamp-in { from { transform: scale(0) rotate(-40deg); opacity: 0; } }

/* custom take player (native <audio controls> is unreliable across browsers) */
.take-player {
    display: flex; align-items: center; gap: 1rem;
    width: min(440px, 100%);
    padding: 0.6rem 1.1rem 0.6rem 0.6rem;
    border: 1px solid color-mix(in srgb, var(--rule-2) 70%, transparent);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--paper-2) 68%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    animation: soft-in 0.4s var(--ease-out);
}
.take-player audio { display: none; }
.take-player__btn {
    flex: none; width: 44px; height: 44px; border-radius: 999px;
    display: grid; place-items: center;
    background: var(--ink); color: var(--paper);
    transition: transform var(--dur-1) var(--ease), background var(--dur-1);
}
.take-player__btn:hover { transform: scale(1.06); }
.take-player__btn:active { transform: scale(0.95); }
.take-player__btn svg { width: 18px; height: 18px; }
.take-player__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; text-align: left; }
.take-player__label { font-size: var(--t-caption); color: var(--ink-4); letter-spacing: var(--tracking-snug); }
.take-player__track { height: 3px; border-radius: 999px; background: var(--paper-4); overflow: hidden; }
.take-player__fill { height: 100%; width: 0; background: var(--ink); border-radius: 999px; transition: width 0.2s linear; }

/* equalizer while recording — heights are driven by the REAL mic level (JS),
   so flat bars = your microphone is not picking anything up */
.eq { display: none; align-items: flex-end; gap: 4px; height: 28px; }
.rec-stage.is-live .eq { display: inline-flex; }
.eq span { width: 3px; height: 8%; background: var(--danger); transition: height 90ms var(--ease); }

/* controls */
.rec-ctrls { display: flex; align-items: center; justify-content: center; gap: 2.25rem; margin-top: 0.25rem; }
.rec-btn-wrap { position: relative; display: grid; place-items: center; }
.rec-btn {
    position: relative; z-index: 2;
    display: grid; place-items: center; width: 94px; height: 94px; border-radius: 999px;
    background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.20);
    transition: transform var(--dur-2) var(--ease-out), background var(--dur-1) var(--ease), color var(--dur-1);
}
.rec-btn:hover:not(:disabled) { transform: scale(1.05); background: var(--ink-2); }
.rec-btn:active:not(:disabled) { transform: scale(0.96); }
.rec-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.rec-btn svg { width: 34px; height: 34px; }
.rec-btn.is-recording { background: var(--danger); border-color: var(--danger); }
.rec-ring { position: absolute; inset: 0; border-radius: 999px; border: 1px solid var(--danger); opacity: 0; pointer-events: none; }
.rec-btn-wrap.is-recording .rec-ring { animation: ring 1.9s var(--ease-out) infinite; }
.rec-btn-wrap.is-recording .rec-ring:nth-child(2) { animation-delay: 0.63s; }
.rec-btn-wrap.is-recording .rec-ring:nth-child(3) { animation-delay: 1.26s; }
@keyframes ring { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }

.rec-step {
    color: var(--ink-3); width: 50px; height: 50px; display: grid; place-items: center;
    border: 1px solid color-mix(in srgb, var(--rule-2) 70%, transparent); border-radius: 999px;
    background: color-mix(in srgb, var(--paper-2) 55%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
    transition: color var(--dur-1), background var(--dur-2) var(--ease), border-color var(--dur-1), transform var(--dur-2) var(--ease-out);
}
.rec-step:hover:not(:disabled) { color: var(--paper); background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.rec-step:disabled { opacity: 0.25; cursor: not-allowed; }
.rec-step svg { width: 20px; height: 20px; display: block; }

/* cancel-take button — only visible while recording */
.rec-cancel {
    display: none; align-items: center; gap: 0.45rem;
    justify-self: center;
    padding: 0.5rem 1.15rem;
    font-size: var(--t-caption); font-weight: 600; letter-spacing: var(--tracking-snug);
    color: var(--ink-4); border: 1px solid var(--rule-2); border-radius: 999px;
    transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1);
    animation: soft-in 0.3s var(--ease-out);
}
.rec-stage.is-live .rec-cancel { display: inline-flex; }
.rec-cancel:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.rec-cancel svg { width: 14px; height: 14px; }

/* keyboard hints — a translucent chip so the list stays readable on the sea */
.kbd-hints {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem;
    width: fit-content; margin: 1rem auto 0; padding: 0.6rem 1.25rem;
    font-size: var(--t-caption); color: var(--ink-4);
    background: color-mix(in srgb, var(--paper-2) 74%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid color-mix(in srgb, var(--rule-2) 70%, transparent);
    border-radius: 999px;
    animation: soft-in 0.5s var(--ease-out) 0.3s backwards;
}
.kbd-hints .k { display: inline-flex; align-items: center; gap: 0.45rem; }
kbd {
    font-family: var(--font-mono); font-size: 0.7rem; line-height: 1;
    padding: 0.3em 0.5em; color: var(--ink-3); border-radius: 4px;
    border: 1px solid var(--rule-2); border-bottom-width: 2px; background: var(--paper);
}
@media (max-width: 720px) { .kbd-hints { display: none; } }

/* tighten the stage on phones so the corpus line and the record button both
   sit comfortably inside one screen */
@media (max-width: 720px) {
    .rec-stage {
        min-height: min(56vh, 470px);
        padding: 1.5rem 0.5rem 1.25rem;
        gap: 1.15rem;
    }
    .rec-ctrls { gap: 1.5rem; margin-top: 0.5rem; }
    .rec-btn { width: 84px; height: 84px; }
    .rec-btn svg { width: 30px; height: 30px; }
    .rec-stage__ghost { font-size: clamp(6rem, 30vw, 11rem); }
}

/* ---- right rail: full corpus list ---- */
.rec-rail {
    position: sticky; top: 1rem;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--rule-2); border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    overflow: hidden;
}
@media (max-width: 1023px) { .rec-rail { position: static; max-height: 60vh; } }
.rec-rail__head {
    flex-shrink: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem; border-bottom: 1px solid var(--rule);
}
.rec-rail__title {
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase; color: var(--ink-4);
}
.rec-rail__count { font-family: var(--font-mono); font-size: var(--t-caption); color: var(--ink-3); font-feature-settings: 'tnum'; }
.rec-rail__tabs { flex-shrink: 0; display: flex; border-bottom: 1px solid var(--rule); }
.rail-tab {
    flex: 1; padding: 0.6rem 0;
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-wide); text-transform: uppercase; text-align: center;
    color: var(--ink-5); border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color var(--dur-1), border-color var(--dur-1);
}
.rail-tab:hover { color: var(--ink); }
.rail-tab.is-active { color: var(--ink); border-color: var(--ink); }
.rec-rail__list { flex: 1; min-height: 0; overflow-y: auto; padding: 0.4rem; scroll-behavior: smooth; }
.rail-row {
    position: relative;
    display: grid; grid-template-columns: 2.6em 1fr auto; gap: 0.65rem; align-items: center;
    width: 100%; text-align: left; padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    transition: background var(--dur-1) var(--ease), padding-left var(--dur-2) var(--ease-out);
    animation: row-in 0.4s var(--ease-out) backwards;
    animation-delay: calc(min(var(--i), 18) * 22ms);
}
.rail-row:hover { background: var(--paper-2); padding-left: 0.95rem; }
.rail-row.is-current { background: var(--paper-3); }
.rail-row.is-current::before {
    content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 999px; background: var(--ink);
}
.rail-row.is-hidden { display: none; }
.rail-row__num { font-family: var(--font-mono); font-feature-settings: 'tnum'; font-size: var(--t-caption); color: var(--ink-4); }
.rail-row.is-current .rail-row__num { color: var(--ink); font-weight: 700; }
.rail-row__text { font-size: var(--t-small); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-row.is-current .rail-row__text { color: var(--ink); font-weight: 600; }
.rail-row.is-recorded .rail-row__text { color: var(--ink-5); }
.rail-row__check {
    width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center;
    background: var(--success); color: #fff;
    opacity: 0; transform: scale(0); transition: opacity var(--dur-1), transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rail-row__check svg { width: 11px; height: 11px; }
.rail-row.is-recorded .rail-row__check { opacity: 1; transform: scale(1); }

/* ---- status timeline ---- */
.tl { display: flex; flex-direction: column; margin-top: 1.5rem; }
.tl-item {
    display: grid; grid-template-columns: auto 1fr; gap: 1.1rem;
    animation: row-in 0.5s var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 90ms + 0.15s);
}
.tl-item__rail { display: flex; flex-direction: column; align-items: center; }
.tl-item__dot { width: 12px; height: 12px; border-radius: 999px; border: 2px solid var(--rule-2); background: var(--paper-2); margin-top: 6px; }
.tl-item__line { flex: 1; width: 1px; background: var(--rule); min-height: 28px; }
.tl-item.is-done .tl-item__dot { background: var(--success); border-color: var(--success); }
.tl-item.is-current .tl-item__dot { background: var(--ink); border-color: var(--ink); animation: dot-blink 2s var(--ease) infinite; }
@keyframes dot-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.tl-item.is-rejected .tl-item__dot { background: var(--danger); border-color: var(--danger); }
.tl-item__body { padding-bottom: 1.9rem; }
.tl-item__title { font-weight: 700; font-size: var(--t-body); color: var(--ink); letter-spacing: var(--tracking-snug); }
.tl-item.is-upcoming .tl-item__title { color: var(--ink-4); }
.tl-item__desc { font-size: var(--t-caption); color: var(--ink-4); margin-top: 0.15rem; }

/* ---- misc ---- */
.center-note { text-align: center; color: var(--ink-4); padding: 4rem 1rem; }
.empty-block { text-align: center; padding: clamp(2.5rem, 7vw, 5rem) 1rem; border: 1px dashed var(--rule-2); border-radius: var(--radius-lg); }
.empty-block__mark {
    display: inline-grid; place-items: center; width: 56px; height: 56px;
    border-radius: 999px; background: var(--paper-3); color: var(--ink-3);
    margin-bottom: 1.25rem;
}
.empty-block__mark svg { width: 24px; height: 24px; }
.empty-block h3 { font-size: var(--t-h4); font-weight: 800; letter-spacing: var(--tracking-tight); }
.empty-block p { color: var(--ink-4); margin: 0.75rem auto 1.75rem; max-width: 40ch; }
.stack-lg { display: flex; flex-direction: column; gap: 1rem; }

/* toasts (flat) */
.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 0.6rem; max-width: min(360px, calc(100vw - 2rem)); }
.toast {
    display: flex; align-items: flex-start; gap: 0.65rem;
    padding: 0.9rem 1.15rem; background: var(--ink); color: var(--paper);
    border-radius: var(--radius-md);
    font-size: var(--t-small); font-weight: 500;
    animation: toast-in 0.4s var(--ease-out);
}
.toast--danger { background: var(--danger); }
.toast--success { background: var(--success); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* admin table */
.table-wrap { margin-top: 1.75rem; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: var(--radius-md); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-small); min-width: 720px; }
/* keep every cell on one line so narrow viewports scroll horizontally inside
   .table-wrap instead of squishing columns (which stacked the status tag
   vertically as 録/音/中) */
table.data th, table.data td { padding: 1rem 1.1rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: middle; white-space: nowrap; }
table.data th {
    font-family: var(--font-en); font-size: var(--t-eyebrow); font-weight: 700;
    letter-spacing: var(--tracking-eye); text-transform: uppercase; color: var(--ink-4); background: var(--paper);
}
table.data tbody tr { animation: row-in 0.45s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 40ms); transition: background var(--dur-1) var(--ease); }
table.data tbody tr:hover { background: var(--paper-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data .mono { font-family: var(--font-mono); font-size: var(--t-caption); color: var(--ink-4); }
.cell-actions { display: flex; align-items: center; gap: 0.5rem; }
.select--sm { height: 38px; padding: 0 2.25rem 0 0.75rem; }

/* admin inspection list */
.insp-list { margin-top: 2rem; border: 1px solid var(--rule-2); border-radius: var(--radius-md); overflow: hidden; background: var(--paper); }
.insp-row {
    display: grid; grid-template-columns: 3.2em 1fr auto auto; gap: 0.9rem; align-items: center;
    width: 100%; text-align: left; padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--rule); font-size: var(--t-small);
    cursor: pointer;
    transition: background var(--dur-1) var(--ease);
    animation: row-in 0.4s var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 18ms);
}
.insp-row:last-child { border-bottom: 0; }
.insp-row:not(.is-missing):hover { background: var(--paper-2); }
.insp-row.is-playing { background: var(--paper-3); }
.insp-row.is-missing { cursor: default; grid-template-columns: 3.2em 1fr auto; }
.insp-row.is-missing .insp-row__text { color: var(--ink-5); }
.insp-row.is-flagged { background: var(--danger-soft); }
.insp-row.is-flagged .insp-row__text { color: var(--ink); }
.insp-row__flag {
    width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
    border: 1px solid var(--rule-2); color: var(--ink-5); background: transparent;
    transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1);
}
.insp-row__flag:hover { color: var(--danger); border-color: var(--danger); }
.insp-row.is-flagged .insp-row__flag { background: var(--danger); border-color: var(--danger); color: #fff; }
.insp-row__flag svg { width: 14px; height: 14px; }
.insp-row__num { font-size: var(--t-caption); color: var(--ink-4); }
.insp-row__text { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-row.is-playing .insp-row__text { color: var(--ink); font-weight: 600; }
.insp-row__play {
    width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
    background: var(--ink); color: var(--paper);
}
.insp-row__play svg { width: 14px; height: 14px; }

.subtabs { display: flex; gap: 0.25rem; margin: 2rem 0 0; border-bottom: 1px solid var(--rule); }
.subtab {
    padding: 0.75rem 1.1rem; margin-bottom: -1px;
    font-family: var(--font-en); font-size: var(--t-small); font-weight: 600; letter-spacing: var(--tracking-snug);
    color: var(--ink-4); border-bottom: 2px solid transparent;
    transition: color var(--dur-1), border-color var(--dur-1);
}
.subtab.is-active { color: var(--ink); border-color: var(--ink); }
.subtab:hover { color: var(--ink); }

/* login */
.login-demo-note {
    margin-top: 2rem; padding: 0.875rem 1.125rem;
    border-left: 3px solid var(--premium); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--premium-soft); color: var(--premium);
    font-size: var(--t-caption); line-height: 1.6; max-width: 32em;
}
.login-fields { display: grid; gap: 1rem; margin-bottom: 2rem; max-width: 24rem; }

/* typed-confirm (destructive) dialog */
.typed-confirm__target {
    display: block; margin: 0.75rem 0 1rem; padding: 0.6rem 0.9rem;
    background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius-sm);
    font-weight: 700; color: var(--ink); font-size: var(--t-body);
    text-align: center; letter-spacing: var(--tracking-snug);
}
