:root {
    --ink: #121820;
    --muted: #5A6570;
    --ground: #E6ECF0;
    --surface: #F4F7F9;
    --line: rgba(18, 24, 32, 0.14);
    --accent: #1B6B63;
    --accent-ink: #F3FAF8;
    --danger: #9f1239;
    --radius: 8px;
    --radius-sm: 6px;
    --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
    --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: var(--font-body);
    background:
        linear-gradient(165deg, #dfe7ee 0%, var(--ground) 42%, #d8e2e9 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.045;
    background-image: var(--grain);
    z-index: 0;
}

a { color: inherit; text-decoration: none; }

/* —— App shell —— */
.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.shell.landing,
.shell.auth {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
}

.rail {
    padding: 1.75rem 1.35rem;
    border-right: 1px solid var(--line);
    background: rgba(244, 247, 249, 0.72);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    /* Word boundaries only — overflow-wrap:anywhere split "Campfire" mid-word on About (#33). */
    overflow-wrap: normal;
    word-break: normal;
}

.brand-tag {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
    font-size: 0.88rem;
}

.rail-archive {
    margin: 0.85rem 0 0;
    display: grid;
    gap: 0.15rem;
    font-size: 0.88rem;
}

.rail-archive a {
    color: var(--accent);
    font-weight: 600;
    width: fit-content;
    border-bottom: 2px solid transparent;
}

.rail-archive a:hover {
    border-bottom-color: var(--accent);
}

.empty-hint {
    color: var(--muted);
    margin: 0 0 0.75rem;
    line-height: 1.45;
    max-width: 36rem;
}

.check-list {
    display: grid;
    gap: 0.35rem;
    max-height: 10rem;
    overflow: auto;
    padding: 0.35rem 0;
}

.check-list label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.check-list input {
    width: auto;
}

.filter-row .btn.secondary.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.page-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.page-flow a {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.92rem;
}

@media (max-width: 720px) {
    /* Stack related links so they stop wrapping into cramped → clusters (#41). */
    .page-flow {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        margin: 0 0 1rem;
    }

    .page-flow a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.35rem 0;
        border-bottom: 1px solid var(--line);
        white-space: normal;
    }
}

.page-trail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.page-trail a {
    color: var(--accent);
    font-weight: 600;
}

.page-trail__sep {
    opacity: 0.55;
}

.page-trail__current {
    color: var(--ink);
    font-weight: 600;
}

.hub-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.hub-links a {
    color: var(--ink);
}

.hub-links a:hover {
    color: var(--accent);
}

.hub-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.15rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease;
}

.hub-link:hover {
    border-bottom-color: var(--accent);
}

.hub-link__text {
    display: grid;
    gap: 0.15rem;
}

.hub-link__chev {
    color: var(--muted);
    font-weight: 600;
    flex-shrink: 0;
}

.hub-link:hover .hub-link__chev {
    color: var(--accent);
}

.hub-grid .section {
    padding: 0.25rem 0 0.75rem;
}

.hub-grid .section > .muted {
    margin: 0 0 0.5rem;
}

.rail nav {
    display: grid;
    gap: 1.1rem;
}

.nav-group {
    display: grid;
    gap: 0.2rem;
}

.nav-group__label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.15rem;
    font-weight: 600;
}

.rail nav a,
.landing-chrome nav a,
.auth-chrome nav a {
    padding: 0.4rem 0.15rem;
    color: var(--ink);
    border-bottom: 2px solid transparent;
    transition: border-color 180ms ease, color 180ms ease;
    width: fit-content;
}

.rail nav a:hover,
.landing-chrome nav a:hover,
.auth-chrome nav a:hover {
    color: var(--accent);
}

.rail nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.rail nav a.rail-cta {
    display: inline-block;
    padding: 0.55rem 0.85rem;
    margin: 0.15rem 0 0.35rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    border-bottom: 0;
    width: fit-content;
}

.rail nav a.rail-cta:hover,
.rail nav a.rail-cta.active {
    background: #155851;
    color: var(--accent-ink);
    border-bottom: 0;
}

.rail-head {
    display: block;
}

.rail-brand {
    display: block;
}

.mobile-bottom-nav,
.mobile-nav-backdrop {
    display: none;
}

.mobile-nav-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1.25rem;
    min-height: 0;
}

.rail-nav {
    display: grid;
    gap: 1.1rem;
}

.rail-foot {
    margin-top: auto;
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem 1.15rem;
    font-size: 0.9rem;
}

.site-footer a {
    /* Ink (not muted) so Privacy/Terms stay WCAG AA on light footers (#48). */
    color: var(--ink);
}

.site-footer a:hover {
    color: var(--accent);
}

.shell.landing .site-footer--landing {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    color: #f4f7f9;
    background: rgba(8, 18, 20, 0.78);
}

.shell.landing .site-footer--landing a {
    color: #f4f7f9;
}

.shell.landing .site-footer--landing a:hover {
    color: #fff;
}

.site-footer--app {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    background: rgba(244, 247, 249, 0.72);
}

.legal-copy {
    color: var(--ink);
}

.legal-copy p {
    max-width: 42rem;
    color: var(--ink);
}

/* Legal muted lines stay secondary but clearly AA on surface (#48 reopen). */
.legal-copy .muted {
    color: #3d4751;
}

.stage {
    padding: 2rem clamp(1.25rem, 4vw, 3rem);
    max-width: 1100px;
}

.shell.landing .stage,
.shell.auth .stage {
    max-width: none;
    padding: 0;
    flex: 1;
}

/* —— Landing chrome —— */
.landing-chrome,
.auth-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: calc(1.1rem + env(safe-area-inset-top, 0px))
             calc(clamp(1.25rem, 4vw, 2.5rem) + env(safe-area-inset-right, 0px))
             1.1rem
             calc(clamp(1.25rem, 4vw, 2.5rem) + env(safe-area-inset-left, 0px));
    position: relative;
    z-index: 2;
}

.shell.landing .landing-chrome {
    position: absolute;
    inset: 0 0 auto 0;
    color: #f4f7f9;
    /* Scrim so nav links keep AA contrast over bright hero regions (#48). */
    background: linear-gradient(180deg, rgba(8, 18, 20, 0.78) 0%, rgba(8, 18, 20, 0.35) 70%, rgba(8, 18, 20, 0) 100%);
}

.shell.landing .landing-chrome .brand,
.shell.landing .landing-chrome a {
    color: #f4f7f9;
}

.shell.landing .landing-chrome a:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.55);
}

/* Non-hero public pages (Help/About/Pricing/Demo): static chrome so the
   absolute hero scrim does not overlap the page heading (#48 reopen). */
.shell.landing:not(:has(.landing-hero)) .landing-chrome {
    position: relative;
    inset: auto;
    color: var(--ink);
    background: rgba(244, 247, 249, 0.92);
    border-bottom: 1px solid var(--line);
}

.shell.landing:not(:has(.landing-hero)) .landing-chrome .brand,
.shell.landing:not(:has(.landing-hero)) .landing-chrome a {
    color: var(--ink);
}

.shell.landing:not(:has(.landing-hero)) .landing-chrome a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.shell.landing:not(:has(.landing-hero)) .landing-nav__cta {
    color: var(--accent-ink) !important;
}

.shell.landing:not(:has(.landing-hero)) .site-footer--landing {
    position: relative;
    inset: auto;
    color: var(--ink);
    background: rgba(244, 247, 249, 0.92);
    border-top: 1px solid var(--line);
}

.shell.landing:not(:has(.landing-hero)) .site-footer--landing a {
    color: var(--ink);
}

.shell.landing:not(:has(.landing-hero)) .site-footer--landing a:hover {
    color: var(--accent);
}

.shell.landing:not(:has(.landing-hero)) .stage {
    padding: 1.25rem 0 2.5rem;
}

.auth-chrome {
    border-bottom: 1px solid var(--line);
    background: rgba(244, 247, 249, 0.85);
}

.auth-chrome nav {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.auth-stage {
    padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
    display: grid;
    justify-items: center;
}

.auth-stage .page-header,
.auth-stage .panel {
    width: 100%;
    max-width: 420px;
}

.legal-stage {
    padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
    display: grid;
    justify-items: center;
}

.legal-stage .page-header,
.legal-stage .panel {
    width: 100%;
    max-width: 42rem;
}

/* —— Full-bleed home hero —— */
.landing-hero {
    min-height: 100vh;
    display: grid;
    align-content: end;
    padding: clamp(5.5rem, 14vh, 8rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 8vh, 4.5rem);
    background-color: #0e2a2c;
    background-image:
        linear-gradient(180deg, rgba(10, 28, 30, 0.28) 0%, rgba(10, 24, 26, 0.58) 50%, rgba(8, 18, 20, 0.88) 100%),
        url("/images/hero.jpg");
    background-position: 55% 42%;
    background-size: cover;
    background-repeat: no-repeat;
    color: #f4f7f9;
    animation: hero-fade 900ms ease both;
}

.landing-hero__inner {
    max-width: 36rem;
    display: grid;
    gap: 1rem;
}

.landing-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 9vw, 5.6rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.landing-hero p {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    line-height: 1.45;
    color: rgba(244, 247, 249, 0.88);
    max-width: 28rem;
}

.landing-hero .actions {
    margin-top: 0.35rem;
}

.landing-hero .btn {
    background: var(--accent);
    color: var(--accent-ink);
}

.landing-hero .btn.secondary {
    background: transparent;
    color: #f4f7f9;
    border-color: rgba(244, 247, 249, 0.45);
}

.landing-hero .btn.secondary:hover {
    border-color: #fff;
    color: #fff;
}

/* —— Page headers & sections —— */
.page-header {
    margin: 0 0 1.5rem;
    display: grid;
    gap: 0.35rem;
    animation: rise 500ms ease both;
}

.page-header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
}

.page-header p {
    margin: 0;
    color: var(--muted);
    max-width: 40rem;
    line-height: 1.45;
}

.section {
    animation: rise 500ms ease both;
}

.section + .section,
.panel + .section,
.section + .panel {
    margin-top: 1.75rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    align-items: center;
}

.btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.7rem 1.15rem;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:hover { background: #155851; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.secondary {
    background: #fff;
    color: var(--ink);
    border-color: rgba(18, 24, 32, 0.28);
}

.btn.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff;
}

/* Interaction surfaces only */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.35rem;
    animation: rise 500ms ease both;
}

.panel h2,
.panel h3 {
    font-family: var(--font-display);
    margin-top: 0;
    letter-spacing: -0.02em;
}

.grid {
    display: grid;
    gap: 1.25rem;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    align-items: start;
}

.grid.two > * {
    min-width: 0;
}

.success,
.error,
.panel code {
    overflow-wrap: anywhere;
}

label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}

label:has(> input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

label:has(> input[type="checkbox"]) input {
    width: auto;
}

label .hint,
label.muted {
    font-weight: 500;
    color: var(--muted);
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    background: #fff;
    font: inherit;
    color: var(--ink);
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(27, 107, 99, 0.35);
    outline-offset: 1px;
}

textarea { min-height: 120px; resize: vertical; }

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.list li {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--line);
}

.list li:first-child { padding-top: 0.25rem; }

.list li.is-focus {
    background: rgba(27, 107, 99, 0.08);
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.muted { color: var(--muted); font-weight: 500; }
.error { color: var(--danger); }
.success { color: var(--accent); }

.linkish {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-align: left;
    font-weight: 600;
}

.chat {
    display: grid;
    gap: 0.55rem;
    max-height: min(52vh, 520px);
    overflow: auto;
    padding-right: 0.25rem;
}

.bubble {
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius);
    max-width: 48rem;
    border: 1px solid var(--line);
    background: #fff;
    animation: rise 280ms ease both;
}

.bubble strong {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.bubble.user {
    background: rgba(27, 107, 99, 0.08);
    border-color: rgba(27, 107, 99, 0.2);
    justify-self: end;
}

.bubble.assistant {
    background: var(--surface);
    justify-self: start;
}

.recording-on {
    color: var(--danger);
    font-weight: 600;
}

.interview-start,
.interview-live {
    max-width: 48rem;
}

.interview-hero-panel .interview-lede {
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0 0 1.1rem;
    color: var(--ink);
}

.interview-start-actions {
    margin-bottom: 0.5rem;
}

.interview-resume-preview {
    margin: 0 0 0.85rem;
    line-height: 1.45;
}

.interview-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.interview-stage-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.interview-stage-head h2 {
    margin: 0 0 0.2rem;
}

/* Safari will not play <audio hidden> / display:none. Keep the element
   in the layout as a 1px clip so TTS unlock and playback still count. */
.storytime-playback {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    pointer-events: none;
}

.interview-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.interview-status .interview-pulse {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.interview-status.speaking {
    border-color: rgba(27, 107, 99, 0.35);
    background: rgba(27, 107, 99, 0.08);
}

.interview-status.speaking .interview-pulse {
    background: var(--accent);
    animation: interview-breathe 1.1s ease-in-out infinite;
}

.interview-status.listening {
    border-color: rgba(180, 70, 50, 0.35);
    background: rgba(180, 70, 50, 0.07);
}

.interview-status.listening .interview-pulse {
    background: var(--danger);
    animation: interview-pulse 0.9s ease-in-out infinite;
}

.interview-meter {
    display: flex;
    align-items: flex-end;
    gap: 0.22rem;
    height: 2.25rem;
    margin: 0 0 0.45rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--danger, #b44632) 6%, var(--surface, #fff));
}

.interview-meter__bar {
    flex: 1 1 0;
    min-width: 0;
    height: 18%;
    border-radius: 2px;
    background: color-mix(in srgb, var(--muted, #888) 35%, transparent);
    transition: height 80ms linear, background 80ms linear;
}

.interview-meter__bar.on {
    height: 55%;
    background: color-mix(in srgb, var(--danger, #b44632) 55%, #fff);
}

.interview-meter__bar.hot {
    height: 100%;
    background: var(--danger, #b44632);
}

.interview-meter-hint {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
}

.interview-listen-actions {
    margin: 0 0 0.85rem;
}

.interview-status.reviewing {
    border-color: rgba(27, 107, 99, 0.35);
    background: rgba(27, 107, 99, 0.08);
}

.interview-status.reviewing .interview-pulse {
    background: var(--accent);
}

.interview-status.checking {
    border-color: rgba(27, 107, 99, 0.28);
    background: rgba(27, 107, 99, 0.06);
}

.interview-phone {
    width: min(100%, 22.5rem);
    margin: 0 auto 1rem;
    padding: 0.85rem 0.85rem 1rem;
    border-radius: 1.65rem;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(244, 247, 249, 0.96) 0%, rgba(230, 236, 240, 0.94) 100%);
    box-shadow: 0 10px 28px rgba(18, 24, 32, 0.08);
}

.interview-phone__notch {
    width: 4.25rem;
    height: 0.35rem;
    margin: 0 auto 0.7rem;
    border-radius: 999px;
    background: rgba(18, 24, 32, 0.16);
}

.interview-phone__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.interview-phone__rec {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.interview-phone__rec.is-hot { color: var(--danger); }
.interview-phone__rec.is-paused { color: var(--muted); }
.interview-phone__rec.is-ok { color: var(--accent); }

.interview-phone__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: currentColor;
}

.interview-phone__rec.is-hot .interview-phone__dot {
    animation: interview-pulse 0.9s ease-in-out infinite;
}

.interview-phone__clocks {
    display: grid;
    justify-items: end;
    gap: 0.05rem;
    font-variant-numeric: tabular-nums;
}

.interview-phone__answer-clock {
    font-weight: 700;
    font-size: 1.15rem;
    font-family: var(--font-display);
}

.interview-phone__session-clock {
    color: var(--muted);
    font-size: 0.78rem;
}

.interview-wave {
    display: flex;
    align-items: flex-end;
    gap: 0.14rem;
    height: 3.4rem;
    margin: 0 0 0.65rem;
    padding: 0.4rem 0.45rem;
    border-radius: 0.75rem;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--danger, #9f1239) 6%, var(--surface, #fff));
}

.interview-wave.is-idle {
    background: color-mix(in srgb, var(--accent, #1B6B63) 7%, var(--surface, #fff));
}

.interview-wave__bar {
    flex: 1 1 0;
    min-width: 0;
    height: 14%;
    border-radius: 2px;
    background: color-mix(in srgb, var(--muted, #888) 40%, transparent);
    transition: height 90ms linear, background 90ms linear;
}

.interview-wave.is-live .interview-wave__bar.on {
    background: color-mix(in srgb, var(--danger, #9f1239) 55%, #fff);
}

.interview-wave.is-live .interview-wave__bar.hot {
    background: var(--danger, #9f1239);
}

.interview-wave.is-idle .interview-wave__bar.on,
.interview-wave.is-idle .interview-wave__bar.hot {
    background: var(--accent);
}

.interview-transcript {
    min-height: 4.6rem;
    margin: 0 0 0.7rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.7rem;
    border: 1px solid var(--line);
    background: var(--surface);
}

.interview-transcript__label {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.interview-transcript__live,
.interview-transcript__placeholder {
    margin: 0;
    line-height: 1.45;
}

.interview-transcript__placeholder { color: var(--muted); }

.interview-transcript textarea {
    width: 100%;
    min-height: 5.5rem;
    resize: vertical;
    font: inherit;
}

.interview-phone__hint {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
}

.interview-phone__actions {
    margin: 0;
}

.interview-recover {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
}

.interview-miccheck__title {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.interview-miccheck__copy {
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.interview-miccheck.is-ok .interview-miccheck__title { color: var(--accent); }
.interview-miccheck.is-bad .interview-miccheck__title { color: var(--danger); }

.interview-status.thinking .interview-pulse {
    background: var(--accent);
    animation: interview-breathe 1.4s ease-in-out infinite;
}

.interview-status.paused .interview-pulse {
    background: var(--muted);
}

@keyframes interview-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.55; }
}

@keyframes interview-breathe {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

.meter {
    height: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(18, 24, 32, 0.08);
    overflow: hidden;
}

.meter > span {
    display: block;
    height: 100%;
    background: var(--accent);
    transition: width 600ms ease;
}

.thumb {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1rem 0;
    border: 1px solid var(--line);
}

h1:focus { outline: none; }
main.stage:focus { outline: none; }
main.stage:focus-visible {
    outline: 2px solid rgba(27, 107, 99, 0.35);
    outline-offset: 4px;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.settings-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.15rem;
    margin: 0 0 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.settings-toc a {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.92rem;
}

@media (max-width: 720px) {
    .settings-toc {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .settings-toc a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.55rem 0.1rem;
        border-bottom: 1px solid var(--line);
        font-size: 1rem;
    }
}

#profile,
#security,
#archives,
#export {
    scroll-margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .shell:not(.landing):not(.auth) {
        grid-template-columns: 1fr;
        padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
        /* Clip off-canvas drawer so closed translateX does not widen the scrollport (#36). */
        overflow-x: clip;
    }

    .shell--nav-open {
        /* Drawer open: keep page from scrolling under the overlay (#36). */
        overflow: hidden;
    }

    .rail {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: calc(0.55rem + env(safe-area-inset-top, 0px))
                 calc(0.85rem + env(safe-area-inset-right, 0px))
                 0.55rem
                 calc(0.85rem + env(safe-area-inset-left, 0px));
        display: block;
        position: sticky;
        top: 0;
        z-index: 40;
        /* Keep translucent fill only — frosted blur lives on .rail-head (#37).
           Blur on this sticky shell trapped the fixed drawer to header height. */
        background: rgba(244, 247, 249, 0.94);
        gap: 0;
    }

    .rail-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        /* Blur stays on the head only so the drawer (sibling panel) can fix to the viewport. */
        margin: calc(-0.55rem - env(safe-area-inset-top, 0px))
                calc(-0.85rem - env(safe-area-inset-right, 0px))
                0
                calc(-0.85rem - env(safe-area-inset-left, 0px));
        padding: calc(0.55rem + env(safe-area-inset-top, 0px))
                 calc(0.85rem + env(safe-area-inset-right, 0px))
                 0.55rem
                 calc(0.85rem + env(safe-area-inset-left, 0px));
        background: rgba(244, 247, 249, 0.94);
        backdrop-filter: blur(8px);
    }

    .rail-brand {
        display: block;
        min-width: 0;
    }

    .rail-brand .brand {
        font-size: 1.05rem;
        line-height: 1.15;
        letter-spacing: -0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rail-archive {
        margin: 0.2rem 0 0;
        font-size: 0.78rem;
        gap: 0;
        line-height: 1.25;
    }

    .rail-archive .muted {
        /* Archive name alone is enough context on the sticky mobile chrome (#38). */
        display: none;
    }

    .brand-tag {
        display: none;
    }

    .mobile-nav-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(20rem, 88vw);
        z-index: 50;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        padding: calc(1.15rem + env(safe-area-inset-top, 0px))
                 calc(1.15rem + env(safe-area-inset-right, 0px))
                 calc(5.5rem + env(safe-area-inset-bottom, 0px))
                 calc(1.15rem + env(safe-area-inset-left, 0px));
        background: rgba(244, 247, 249, 0.98);
        border-right: 1px solid var(--line);
        box-shadow: 8px 0 28px rgba(18, 24, 32, 0.12);
        transform: translateX(-105%);
        transition: transform 180ms ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Closed drawer must not intercept header / bottom-nav taps (#36 / !45). */
        pointer-events: none;
    }

    .shell--nav-open .mobile-nav-panel {
        transform: translateX(0);
        pointer-events: auto;
    }

    /* Sticky .rail (z-index 40) traps the panel; raise the rail above the
       backdrop while open so drawer links / Sign out receive taps (#36 / !45). */
    .shell--nav-open .rail {
        z-index: 50;
    }

    .shell--nav-open .mobile-bottom-nav {
        z-index: 46;
    }

    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 45;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(18, 24, 32, 0.42);
        cursor: pointer;
    }

    .rail-nav {
        display: grid;
        gap: 1.1rem;
    }

    .nav-group {
        display: grid;
        gap: 0.15rem;
    }

    .nav-group__label {
        display: block;
    }

    .rail nav a,
    .rail-nav a {
        white-space: normal;
        width: auto;
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.55rem 0.2rem;
    }

    .rail nav a.rail-cta,
    .rail-nav a.rail-cta {
        margin: 0.15rem 0 0.35rem;
        padding: 0.7rem 0.9rem;
        width: fit-content;
        min-height: 44px;
    }

    .rail-foot {
        margin-top: auto;
        text-align: left;
        font-size: 0.9rem;
    }

    .rail-foot span {
        display: block;
    }

    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.15rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 35;
        padding: 0.35rem
                 calc(0.35rem + env(safe-area-inset-right, 0px))
                 calc(0.35rem + env(safe-area-inset-bottom, 0px))
                 calc(0.35rem + env(safe-area-inset-left, 0px));
        background: rgba(244, 247, 249, 0.96);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(8px);
    }

    .mobile-bottom-nav__item,
    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        appearance: none;
        border: 0;
        background: transparent;
        color: var(--ink);
        font: inherit;
        font-size: 0.72rem;
        font-weight: 600;
        line-height: 1.15;
        text-align: center;
        text-decoration: none;
        min-height: 48px;
        padding: 0.35rem 0.2rem;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .mobile-bottom-nav__item.active,
    .mobile-bottom-nav a.active,
    .mobile-bottom-nav button.active {
        color: var(--accent);
    }

    .mobile-bottom-nav__record {
        background: var(--accent) !important;
        color: var(--accent-ink) !important;
        font-weight: 700;
        border-radius: 999px;
        margin: 0.1rem 0.1rem;
        box-shadow: 0 6px 16px rgba(27, 107, 99, 0.28);
    }

    .mobile-bottom-nav__record.active {
        background: #155851 !important;
        color: var(--accent-ink) !important;
    }

    .mobile-bottom-nav__skel {
        display: block;
        height: 2.4rem;
        margin: 0.35rem;
        border-radius: var(--radius-sm);
        background: rgba(18, 24, 32, 0.08);
    }

    .mobile-bottom-nav__skel--cta {
        border-radius: 999px;
        background: rgba(27, 107, 99, 0.22);
    }

    .stage {
        padding: 1.5rem 1.15rem 2.5rem;
    }

    .site-footer--app {
        padding-bottom: 0.75rem;
    }
}

/* —— Home feed —— */
.home-capture {
    margin-bottom: 1.25rem;
}

.home-capture__lede {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 34rem;
}

.home-capture__actions {
    margin: 0 0 0.85rem;
}

.home-type-fallback {
    margin: 0;
}

.home-type-form {
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}

.home-quiet-capture {
    margin: 0 0 1.25rem;
}

.home-families {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

.home-family-chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--stroke, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--ink);
}

.home-family-chip:hover {
    border-color: var(--accent, #2a6f6a);
}

.feed-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.feed-tabs button {
    appearance: none;
    border: 1px solid var(--stroke, rgba(0, 0, 0, 0.12));
    background: transparent;
    color: var(--muted);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
}

.feed-tabs button.active {
    color: var(--ink);
    border-color: var(--ink);
    font-weight: 600;
}

.home-feed-list p {
    margin: 0.35rem 0 0;
}

.home-families {
    align-items: center;
}

.home-families__label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.1rem;
    border-left: 2px solid var(--line);
    display: grid;
    gap: 1.35rem;
}

.timeline__year h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.timeline__year .list li:first-child {
    padding-top: 0.15rem;
}

.media-row {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.thumb--list {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    margin: 0;
    flex-shrink: 0;
}

.narrative-preview {
    margin-top: 0.5rem;
}

.narrative-preview summary {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

.filter-row .btn.secondary.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(27, 107, 99, 0.08);
}

/* —— Persistent chrome / pane skeletons —— */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.rail-skel--cta {
    height: 2.1rem;
    width: 10.5rem;
    border-radius: var(--radius);
}

.rail-skel {
    display: block;
    height: 0.85rem;
    width: 7.5rem;
    max-width: 70%;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(18, 24, 32, 0.08) 0%, rgba(18, 24, 32, 0.16) 50%, rgba(18, 24, 32, 0.08) 100%);
    background-size: 140% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    margin: 0.45rem 0;
}

.page-skeleton {
    display: grid;
    gap: 0.7rem;
    max-width: 42rem;
    padding: 0.15rem 0 1rem;
}

.page-skeleton__trail,
.page-skeleton__title,
.page-skeleton__sub,
.page-skeleton__line {
    display: block;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(18, 24, 32, 0.07) 0%, rgba(18, 24, 32, 0.14) 50%, rgba(18, 24, 32, 0.07) 100%);
    background-size: 140% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.page-skeleton__trail { height: 0.7rem; width: 9rem; }
.page-skeleton__title { height: 1.65rem; width: 14rem; margin-top: 0.2rem; }
.page-skeleton__sub { height: 0.85rem; width: 22rem; max-width: 100%; }
.page-skeleton__panel {
    margin-top: 0.75rem;
    padding: 1.15rem 0 0;
    display: grid;
    gap: 0.75rem;
}
.page-skeleton__line { height: 0.85rem; width: 100%; }
.page-skeleton__line--mid { width: 72%; }
.page-skeleton__line--short { width: 48%; }

.pane-progress {
    margin: 0.75rem 0 0;
    display: grid;
    gap: 0.45rem;
    max-width: 28rem;
}

.pane-progress__label {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
}

.pane-progress__track {
    height: 0.4rem;
    border-radius: 999px;
    background: rgba(18, 24, 32, 0.1);
    overflow: hidden;
}

.pane-progress__bar {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: var(--accent);
    animation: pane-progress-slide 1.1s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -40% 0; }
}

@keyframes pane-progress-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}

.interview-photo {
    margin: 0.85rem 0 0;
    padding: 0;
}

.interview-photo img,
.interview-photo-fallback {
    display: block;
    width: 100%;
    max-height: 22rem;
    object-fit: contain;
    border-radius: 0.75rem;
    background: rgba(18, 24, 32, 0.06);
}

.interview-photo-fallback {
    min-height: 8rem;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 600;
}

.interview-photo figcaption {
    display: grid;
    gap: 0.15rem;
    margin-top: 0.45rem;
}

.story-saved-card {
    margin-top: 1.1rem;
    padding: 1.15rem 1.2rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(243, 250, 248, 0.92) 0%, rgba(244, 247, 249, 0.96) 100%);
}

.story-saved-card h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
}

.story-saved-card > p {
    margin: 0 0 0.85rem;
}

.story-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin: 0.35rem 0 0;
}

.story-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(27, 107, 99, 0.1);
    font-weight: 600;
    font-size: 0.88rem;
}

.story-chip.is-tag {
    background: rgba(18, 24, 32, 0.06);
    font-weight: 500;
}

.story-chip__remove {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0 0.05rem;
}

.story-add-person {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: end;
    margin-top: 0.65rem;
}

.story-add-person label {
    flex: 1 1 12rem;
}

/* —— First-run wizard —— */
.wizard-panel {
    max-width: 36rem;
}
.wizard-progress {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.topic-chip {
    display: grid;
    gap: 0.15rem;
    text-align: left;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    font: inherit;
    cursor: pointer;
    max-width: 16rem;
}
.topic-chip strong {
    font-weight: 650;
}
.topic-chip:hover {
    border-color: var(--accent);
}
.topic-chip.is-on {
    border-color: var(--accent);
    background: rgba(27, 107, 99, 0.08);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.family-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(8rem, 10rem);
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
@media (max-width: 640px) {
    .family-row {
        grid-template-columns: 1fr;
    }
}
.empty-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

/* —— Unified Archive browser —— */
.archive-empty p {
    max-width: 36rem;
    line-height: 1.5;
}

.archive-toolbar {
    margin-bottom: 1rem;
    display: grid;
    gap: 0.85rem;
}

.archive-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    justify-content: space-between;
}

.archive-view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.archive-sort {
    min-width: min(12rem, 100%);
}

.archive-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
}

.archive-count {
    margin: 0;
}

.archive-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(16.5rem, 100%), 1fr));
    gap: 0.85rem;
}

.archive-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.05rem 1.05rem;
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.archive-card.is-focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(27, 107, 99, 0.18);
}

.archive-card__link {
    display: grid;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.archive-card__link h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.12rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.archive-card__excerpt {
    margin: 0;
    color: var(--ink);
    line-height: 1.45;
}

.archive-card__select {
    margin: 0;
}

.archive-list__link {
    display: grid;
    gap: 0.2rem;
    color: inherit;
    text-decoration: none;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(27, 107, 99, 0.06);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

a.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.story-detail {
    align-items: start;
}

.story-detail__main {
}

/* —— Marketing landing bands (issue #33) —— */
.landing-kicker {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(244, 247, 249, 0.72);
}

.landing-band {
    padding: clamp(2.5rem, 6vh, 4rem) clamp(1.25rem, 5vw, 4rem);
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.landing-band--soft {
    background: rgba(244, 247, 249, 0.92);
}

.landing-band__inner {
    max-width: 56rem;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

.landing-band h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2rem);
    letter-spacing: -0.03em;
}

.landing-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
}

.story-body {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 1.05rem;
}

.story-transcript {
    margin: 0;
    white-space: pre-wrap;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink);
    background: transparent;
}

.story-audio audio {
    width: 100%;
    margin-top: 0.35rem;
}

.story-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem;
}

.story-attachment {
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.story-attachment img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    background: rgba(18, 24, 32, 0.06);
}

.story-attachment figcaption {
    display: grid;
    gap: 0.1rem;
    font-size: 0.85rem;
}

.story-meta {
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.story-meta > div {
    display: grid;
    gap: 0.15rem;
}

.story-meta dt {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.story-meta dd {
    margin: 0;
}

.story-detail__meta h3 {
    margin: 1.1rem 0 0.45rem;
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .story-detail {
        grid-template-columns: 1fr;
    }

    .archive-toolbar__row {
        align-items: stretch;
    }

    .archive-sort {
        width: 100%;
    }
}

/* Unified Archive / Memories browser (#29) */
.archive-toolbar {
    margin-bottom: 1rem;
}

.archive-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.archive-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin: 0;
}

.archive-sort select,
.archive-filters select {
    min-width: 8rem;
}

.archive-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
    align-items: end;
}

.archive-filters label {
    display: grid;
    gap: 0.3rem;
    margin: 0;
    font-weight: 600;
    font-size: 0.92rem;
}

.archive-clear {
    justify-self: start;
    align-self: center;
}

.archive-empty {
    max-width: 36rem;
}

.memory-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.85rem;
}

.memory-card {
    display: grid;
    gap: 0.4rem;
    padding: 1rem;
    border: 1px solid var(--stroke, rgba(0, 0, 0, 0.12));
    border-radius: 0.9rem;
    background: var(--panel, #fff);
    color: inherit;
    text-decoration: none;
    min-height: 8.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.memory-card:hover {
    border-color: var(--accent, #2a6f6a);
    box-shadow: 0 6px 18px rgba(18, 24, 32, 0.06);
}

.memory-card.is-focus {
    border-color: var(--accent, #2a6f6a);
    box-shadow: 0 0 0 2px rgba(42, 111, 106, 0.2);
}

.memory-card p {
    margin: 0;
    color: var(--ink, #1c242c);
    line-height: 1.45;
}

.memory-list a {
    color: inherit;
    text-decoration: none;
}

.memory-list a:hover strong {
    color: var(--accent, #2a6f6a);
}

.memory-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.65rem 0 0;
}

.memory-chips--compact {
    margin-top: 0.35rem;
}

.memory-chip {
    display: inline-block;
    padding: 0.28rem 0.7rem;
    border: 1px solid var(--stroke, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
    font-size: 0.86rem;
    text-decoration: none;
    color: var(--ink, #1c242c);
    background: rgba(42, 111, 106, 0.06);
}

.memory-chip:hover {
    border-color: var(--accent, #2a6f6a);
}

.memory-chip--static {
    background: transparent;
}

.memory-detail h2 {
    margin-bottom: 0.35rem;
}

.memory-detail__meta {
    margin-bottom: 0.75rem;
}

.memory-detail__updated {
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.memory-audio {
    margin: 1rem 0;
}

.memory-audio audio {
    width: 100%;
    max-width: 36rem;
}

.memory-transcript {
    margin: 1rem 0 0;
}

.memory-transcript__body {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0.5rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: rgba(18, 24, 32, 0.04);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: 28rem;
    overflow: auto;
}

.memory-story {
    margin: 1rem 0 0;
    line-height: 1.55;
    max-width: 40rem;
}

.memory-attachments {
    margin-top: 1.25rem;
}

.memory-attachments__grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.65rem;
}

.memory-attachment {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: center;
}

@media (max-width: 720px) {
    .archive-toolbar__row {
        flex-direction: column;
        align-items: stretch;
    }

    .memory-cards {
        grid-template-columns: 1fr;
    }

    .memory-attachment {
        grid-template-columns: 1fr;
    }
}

/* Unified search (#31) */
.search-panel .search-form {
    margin-top: 0.25rem;
}

.search-actions {
    align-items: center;
}

.search-facets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.85rem;
}

.search-facets__label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.search-chip {
    appearance: none;
    border: 1px solid var(--stroke, rgba(0, 0, 0, 0.12));
    background: transparent;
    color: var(--muted);
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
}

.search-chip.active {
    color: var(--ink);
    border-color: var(--ink);
    font-weight: 600;
}

.search-ask__answer {
    white-space: pre-wrap;
}

.search-suggestions {
    margin-top: 0.5rem;
}

.search-scope-hint {
    margin-top: 0.75rem;
}

/* Families / sharing — issue #30 */
.flow-steps {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.55;
    color: var(--text);
}

.flow-steps li + li {
    margin-top: 0.35rem;
}

.memory-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    min-width: 0;
}

.audience-badge {
    /* inline-block so text-overflow ellipsis truncates the label reliably (#30). */
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
    max-width: min(100%, 18rem);
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audience-badge.audience-private {
    color: var(--muted);
}

.audience-badge.audience-shared {
    color: var(--accent);
    border-color: rgba(27, 107, 99, 0.35);
    background: rgba(27, 107, 99, 0.08);
}

.audience-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.65rem;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.share-sheet h3 {
    margin-top: 0;
}

.share-sheet {
    min-width: 0;
}

.invite-link {
    display: block;
    font-size: 0.8rem;
    word-break: break-all;
    overflow-wrap: anywhere;
    margin-top: 0.35rem;
    min-width: 0;
}

.family-member-list > .family-member {
    min-width: 0;
}

.family-member__name {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.family-member__meta {
    margin-top: 0.2rem;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.family-member__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
    margin-top: 0.45rem;
    align-items: center;
}

.invite-form__link-row {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.share-toolbar {
    align-items: stretch;
}

.share-toolbar select {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 720px) {
    /* Stack invite / role / share controls with touch spacing (#30). */
    .invite-form {
        gap: 0.85rem;
    }

    .invite-form__link-row,
    .invite-accept__actions,
    .share-toolbar,
    .share-sheet__actions,
    .family-member__actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.65rem;
        align-items: stretch;
    }

    .invite-form__link-row .btn,
    .invite-accept__actions .btn,
    .share-toolbar .btn,
    .share-sheet__actions .btn,
    .family-member__actions .btn {
        width: 100%;
        min-height: 44px;
    }

    .family-member__actions .linkish {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0.35rem 0;
        border-bottom: 1px solid var(--line);
        width: 100%;
    }

    .share-toolbar select,
    .invite-form__role select,
    .invite-form__email input {
        width: 100%;
        min-height: 44px;
    }

    .share-sheet .check-list {
        max-height: none;
        gap: 0.15rem;
    }

    .share-sheet .check-list label {
        min-height: 44px;
        padding: 0.35rem 0;
        align-items: flex-start;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .audience-badge {
        max-width: 100%;
    }

    /* Shrink/truncate without growing into a full-width bar (#30). */
    .memory-head .audience-badge {
        flex: 0 1 auto;
    }

    .family-member__actions .linkish:last-child {
        border-bottom: none;
    }

    /* Share… / Manage sharing touch target */
    .share-trigger {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0.35rem 0;
    }
}

.landing-steps li {
    display: grid;
    gap: 0.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

/* —— Memoir keepsake —— */
.memoir-keepsake {
    margin-bottom: 1rem;
}
.memoir-preview h3 {
    font-family: var(--font-display);
    margin: 0.25rem 0 0.5rem;
}
.memoir-toc {
    margin: 0.75rem 0 0;
    padding-left: 1.2rem;
}
.memoir-toc li {
    margin: 0.35rem 0;
}
.memoir-excerpt {
    white-space: pre-wrap;
    font-family: var(--font-body);
    margin: 0.75rem 0 0;
    max-height: 14rem;
    overflow: auto;
}

.landing-steps strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.landing-steps span {
    color: var(--muted);
    line-height: 1.45;
}

.landing-split {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 860px) {
    .landing-split {
        grid-template-columns: 1.2fr 0.9fr;
        align-items: start;
    }
}

.aria-teaser {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.aria-teaser__turn {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
}

.aria-teaser__turn--aria {
    border-left: 3px solid var(--accent);
}

.aria-teaser__turn--you {
    border-left: 3px solid rgba(18, 24, 32, 0.25);
}

.aria-teaser__who {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.aria-teaser__turn p {
    margin: 0;
    line-height: 1.45;
}

.landing-payoff h3 {
    margin: 0.35rem 0 0.5rem;
    font-family: var(--font-display);
}

.landing-badge {
    display: inline-block;
    margin: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(27, 107, 99, 0.12);
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.landing-bullets {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.45rem;
    color: var(--ink);
    line-height: 1.45;
}

.landing-tiers {
    display: grid;
    gap: 1rem;
}

@media (min-width: 780px) {
    .landing-tiers {
        grid-template-columns: repeat(3, 1fr);
    }
}

.landing-tier h3 {
    margin: 0 0 0.35rem;
}

.landing-tier__price {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--accent);
}

.landing-cta {
    text-align: center;
    justify-items: center;
}

.landing-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
}

@media (max-width: 720px) {
    /* Keep Sign in + Start free in the header; secondary links live in the footer (#45). */
    .landing-nav__secondary {
        display: none !important;
    }

    .landing-chrome {
        flex-wrap: nowrap;
        gap: 0.75rem;
        align-items: center;
    }

    /* About/guest mobile wordmark: wrap to two lines at word boundaries —
       never ellipsis mid-"Campfire" (#33 Product reopen after !45). */
    .landing-chrome .brand {
        flex: 1 1 auto;
        min-width: 0;
        white-space: normal;
        overflow: visible;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: none;
        font-size: clamp(0.95rem, 3.8vw, 1.35rem);
        line-height: 1.15;
    }

    .landing-nav {
        flex-wrap: nowrap;
        gap: 0.65rem;
        flex-shrink: 0;
    }

    .landing-nav a {
        white-space: nowrap;
    }
}

.landing-nav__cta {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink) !important;
    border-bottom: none !important;
}

.landing-nav__cta:hover {
    filter: brightness(1.05);
}

.demo-banner {
    display: grid;
    gap: 0.25rem;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(27, 107, 99, 0.35);
    background: rgba(27, 107, 99, 0.08);
}

.demo-banner strong {
    color: var(--accent);
}

.demo-disclaimer {
    margin: 0 0 1rem;
}

.shell.landing .stage {
    padding: 0;
}

.shell.landing .stage > .page-header,
.shell.landing .stage > .panel,
.shell.landing .stage > .demo-banner,
.shell.landing .stage > .muted,
.shell.landing .stage > .demo-chrome,
.shell.landing .stage > .demo-grid,
.shell.landing .stage > .landing-tiers,
.shell.landing .stage > .section,
.shell.landing .stage > .grid,
.shell.landing .stage > .actions,
.shell.landing .stage > .error,
.shell.landing .stage > p {
    margin-left: clamp(1.25rem, 5vw, 4rem);
    margin-right: clamp(1.25rem, 5vw, 4rem);
}

.shell.landing .stage > .landing-hero,
.shell.landing .stage > .landing-band {
    margin-left: 0;
    margin-right: 0;
}

/* --- Inclusive capture / elder mode (#35) --- */
.capture-mode-chooser {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1rem 0;
}
@media (min-width: 520px) {
    .capture-mode-chooser {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 720px) {
    .capture-mode-chooser {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.capture-mode-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border, #ccc));
    background: color-mix(in srgb, var(--accent) 8%, var(--panel, #fff));
    color: inherit;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    min-height: 4.5rem;
}
.capture-mode-card:hover,
.capture-mode-card:focus-visible {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 2px;
}
.capture-mode-card strong {
    font-size: 1.05rem;
}
.capture-mode-card span {
    color: var(--muted);
    font-size: 0.92rem;
}
.interview-capture-prefs,
.interview-live-prefs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    margin: 0.75rem 0 0.25rem;
}
.interview-pref-check {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    margin: 0;
}
.interview-import-panel {
    border-top: 1px solid var(--border, #ddd);
    padding-top: 1rem;
}
.interview-captions {
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
}
.interview-captions__label {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #bbb;
}
.interview-captions__text {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.45;
}

html.elder-mode {
    font-size: 118%;
}
html.elder-mode body {
    background: #f7f4ef;
    color: #1a1a1a;
}
html.elder-mode .shell {
    --muted: #444;
}
html.elder-mode .btn,
html.elder-mode .capture-mode-card,
html.elder-mode .linkish,
html.elder-mode input,
html.elder-mode textarea,
html.elder-mode select,
html.elder-mode button {
    font-size: 1.05em;
}
html.elder-mode .interview-stage-head .actions,
html.elder-mode .page-flow {
    gap: 0.75rem;
}
html.elder-mode .interview-live.elder-session .interview-phone,
html.elder-mode .interview-live.elder-session .interview-wave {
    /* Fewer simultaneous chrome pieces in elder sessions */
}
html.elder-mode .rail .brand-tag,
html.elder-mode .interview-live.elder-session .page-flow a:nth-child(n+3) {
    display: none;
}
html.elder-mode .bubble {
    font-size: 1.08em;
    line-height: 1.5;
}
html.elder-mode .interview-captions__text {
    font-size: 1.35rem;
}
