/* Hydration stays put horizontally: reserved history can add a vertical
   scrollbar when records arrive, and without a pre-reserved gutter the whole
   centered story shell re-centers a few pixels sideways. Reserving the gutter
   keeps the layout at the same origin whether or not records render. */
html:has(body.app-theme.story-page) { scrollbar-gutter: stable; }
body.app-theme.story-page { padding: 0 0 70px; text-align: left; }
.story-page [hidden] { display: none !important; }
.story-page .story-shell { width: min(960px, calc(100% - 48px)); margin: auto; }
/* Destination header geometry follows the shared page-header pattern in
   app-theme.css (.page-intro / .page-eyebrow / .page-lede): 42px above the
   heading, 28px below it, a 12px eyebrow gap and a 12px title gap, so the
   destination pages all open on the same grid. */
/* Story snapshot: all-time context, quiet and horizontal so the timeline
   remains the primary surface. */
/* Story Cover: the mint front cover of the Dismissal Story. */
.story-page .story-cover {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 28px;
    margin: 8px 0 18px;
    padding: 30px 32px;
    color: var(--story-ink, #19374a);
    background:
        radial-gradient(circle at 86% 12%, rgba(255, 255, 255, .7), transparent 24rem),
        linear-gradient(145deg, rgba(230, 249, 242, .97), rgba(183, 230, 217, .96));
    border: 1px solid rgba(255, 255, 255, .75);
    border-left: 5px solid #55b9a7;
    border-radius: 18px;
    box-shadow:
        8px 8px 0 rgba(183, 230, 217, .15),
        16px 16px 0 rgba(183, 230, 217, .07),
        0 22px 50px rgba(0, 0, 0, .16);
    overflow: hidden;
}
.story-page .story-cover::after {
    position: absolute;
    top: -80px;
    right: -40px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(25, 55, 74, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 30px rgba(25, 55, 74, .025), 0 0 0 60px rgba(25, 55, 74, .02);
    content: "";
    pointer-events: none;
}
.story-page .story-cover-copy { position: relative; z-index: 1; min-width: 0; }
.story-page .story-cover-kicker {
    margin: 0 0 12px;
    color: #176f71;
    font: 800 10px Manrope, sans-serif;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.story-page .story-cover-title {
    margin: 0;
    color: #19374a;
    font: 800 34px/1.05 Manrope, sans-serif;
    letter-spacing: -.045em;
}
.story-page .story-cover-range {
    margin: 9px 0 0;
    color: #176f71;
    font-size: 13px;
    font-weight: 700;
}
.story-page .story-cover-note {
    max-width: 560px;
    margin: 16px 0 0;
    color: #344b61;
    font-size: 14px;
    line-height: 1.5;
}
.story-page .story-cover-records {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 14px 20px;
    padding-left: 26px;
    border-left: 1px solid rgba(25, 55, 74, .18);
}
.story-page .story-cover-record {
    min-width: 0;
    padding-left: 11px;
    border-left: 2px solid rgba(212, 175, 55, .7);
}
.story-page .story-cover-record strong {
    display: block;
    color: #19374a;
    font: 800 24px/1 Manrope, sans-serif;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}
.story-page .story-cover-record span {
    display: block;
    margin-top: 4px;
    color: #466073;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}
.story-page .story-cover-footnote {
    grid-column: 1 / -1;
    position: relative;
    z-index: 1;
    margin: 0;
    color: #466073;
    font-size: 10px;
}/* Story / Insights / Recovery switcher plus the shared month control. */
.story-page .story-view-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; padding: 14px 0; border-bottom: 1px solid var(--app-line); }
.story-page .story-view-tabs { display: inline-flex; flex: 0 0 auto; flex-wrap: wrap; align-items: stretch; max-width: 100%; min-height: 34px; overflow: hidden; background: rgba(255,255,255,.055); border: 1px solid var(--app-line); border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }
.story-page .story-view-tab { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 0; margin: 0; padding: 0 11px; color: var(--app-muted); background: transparent; border: 0; border-radius: 0; box-shadow: none; font: 700 12px "DM Sans", Arial, sans-serif; white-space: nowrap; cursor: pointer; transition: background-color .13s ease, color .13s ease; }
.story-page .story-view-tab + .story-view-tab::before { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: rgba(255,255,255,.22); content: ""; }
.story-page .story-view-tab:hover { color: #fff; background: rgba(255,255,255,.055); box-shadow: none; filter: none; transform: none; }
.story-page .story-view-tab:active { transform: none; }
.story-page .story-view-tab[aria-selected="true"],
.story-page .story-view-tab.is-active,
.story-page .story-view-tab[aria-current="page"] { color: #ffe9a6; background: linear-gradient(180deg, rgba(255,224,138,.24), rgba(255,224,138,.13)); box-shadow: inset 0 1px 0 rgba(255,255,255,.13), inset 0 -1px 0 rgba(0,0,0,.1); }
.story-page .story-view-tab:focus-visible { outline: 2px solid #fff0a7; outline-offset: -3px; }
.story-page .story-view-tab[aria-current="page"] { cursor: default; }
.story-page .story-view-heading { padding: 22px 0 18px; }
.story-page .story-month-jump { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.6); font-size: 11px; font-weight: 700; }
.story-page .story-month-jump select { min-height: 34px; padding: 4px 26px 4px 9px; color: #fff; background: rgba(255,255,255,.06); border: 1px solid var(--app-line); border-radius: 6px; font: 600 12px "DM Sans", Arial, sans-serif; color-scheme: dark; }
.story-page .story-month-jump select:disabled { color: rgba(255,255,255,.48); background: rgba(255,255,255,.025); border-color: rgba(255,255,255,.09); opacity: 1; cursor: default; }
.story-page .story-month-jump select option { color: #fff; background: #102a43; }
.story-page .story-view-count { display: inline-grid; min-width: 16px; height: 16px; padding: 0 4px; place-items: center; color: #ffe08a; background: rgba(255,224,138,.12); border: 1px solid rgba(255,224,138,.28); border-radius: 999px; font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.story-page .story-view-tab[aria-selected="true"] .story-view-count,
.story-page .story-view-tab.is-active .story-view-count,
.story-page .story-view-tab[aria-current="page"] .story-view-count { color: #2b2715; background: #ffe08a; border-color: #ffe08a; }
.story-page .story-view-panel { min-width: 0; }
.story-page .story-view-empty h2,
.story-page .story-view-empty strong { display: block; margin: 0 0 4px; color: #fff; font: 800 14px Manrope, sans-serif; }
.story-page .story-view-empty p { margin: 0; font-size: 12px; line-height: 1.45; }
.story-page .story-recovery-retry { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin: 12px 0 0; padding: 8px 14px; color: #102a43; background: #ffe08a; border: 1px solid #fff0a7; border-radius: 8px; box-shadow: none; font: 800 12px "DM Sans", Arial, sans-serif; cursor: pointer; }
.story-page .story-recovery-retry:hover { background: #fff0b5; transform: none; }
.story-page .story-recovery-retry:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* V3.2 chapter covers: compact chapter plates with a single open body. */
.tone-amber {
    --story-tone: #e3b45f;
    --story-tone-soft: rgba(227, 180, 95, .17);
    --story-tone-line: rgba(227, 180, 95, .38);
}
.tone-sea-glass {
    --story-tone: #8fd4c4;
    --story-tone-soft: rgba(143, 212, 196, .16);
    --story-tone-line: rgba(143, 212, 196, .36);
}
.tone-slate {
    --story-tone: #8fafd4;
    --story-tone-soft: rgba(143, 175, 212, .16);
    --story-tone-line: rgba(143, 175, 212, .36);
}
.tone-clay {
    --story-tone: #cf9a7e;
    --story-tone-soft: rgba(207, 154, 126, .17);
    --story-tone-line: rgba(207, 154, 126, .38);
}
.story-page .story-chapter-stream { min-width: 0; }
.story-page .story-chapter {
    position: relative;
    --chapter-pad-x: 18px;
    --chapter-number-width: 62px;
    --chapter-column-gap: 13px;
    --chapter-content-x: calc(var(--chapter-pad-x) + var(--chapter-number-width) + var(--chapter-column-gap));
    --chapter-rail-x: 27px;
    /* Day cards may sit closer to the rail than the cover's copy column; the
       gap is reclaimed for the record itself instead of left as empty gutter. */
    --chapter-day-x: var(--chapter-content-x);
    margin: 0 0 9px;
    scroll-margin-top: 96px;
}
.story-page .story-chapter:last-child { margin-bottom: 0; }
.story-page .story-chapter.open { border-radius: 16px; box-shadow: 0 18px 36px rgba(0, 0, 0, .16); }
.story-page .story-chapter-heading { margin: 0; }
.story-page .story-chapter-cover {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 84px;
    display: grid;
    grid-template-columns: var(--chapter-number-width) minmax(0, 1fr) 22px;
    align-items: center;
    gap: var(--chapter-column-gap);
    margin: 0;
    padding: 3px var(--chapter-pad-x);
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, var(--story-tone-soft), transparent 16rem),
        linear-gradient(140deg, rgba(19, 47, 73, .98), rgba(10, 28, 45, .98));
    border: 1px solid var(--story-tone-line);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .16);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.story-page .story-chapter-cover:hover {
    transform: translateY(-2px);
    border-color: var(--story-tone);
    box-shadow: 0 20px 42px rgba(0, 0, 0, .22);
}
.story-page .story-chapter-cover:active { transform: translateY(0); }
.story-page .story-chapter-cover:focus-visible { outline: 3px solid #fff0a7; outline-offset: 3px; }
.story-page .story-chapter.open .story-chapter-cover {
    border-bottom: 1px solid rgba(255,255,255,.14);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
}
.story-page .story-chapter.open .story-chapter-cover:hover {
    transform: none;
    border-color: var(--story-tone-line);
    border-bottom-color: rgba(255,255,255,.14);
    box-shadow: none;
}
.story-page .story-chapter-number {
    color: var(--story-tone);
    font: 800 54px/.82 Manrope, sans-serif;
    letter-spacing: -.075em;
    opacity: .95;
}
.story-page .story-chapter-copy { min-width: 0; }
.story-page .story-chapter-month {
    display: block;
    color: #fff;
    font: 800 22px/1.05 Manrope, sans-serif;
    letter-spacing: -.035em;
}
.story-page .story-chapter-year {
    display: inline-block;
    margin-left: 6px;
    color: rgba(255, 255, 255, .43);
    font: 700 11px Manrope, sans-serif;
    letter-spacing: .02em;
    vertical-align: .2em;
}
.story-page .story-chapter-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    margin-top: 5px;
    color: var(--app-muted);
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.story-page .story-chapter-stats span { white-space: nowrap; }
.story-page .story-chapter-stats span + span::before {
    margin: 0 7px;
    color: rgba(255, 255, 255, .38);
    content: "·";
}
.story-page .story-chapter-stats strong { color: #fff; font-weight: 800; }
.story-page .story-chapter-chevron {
    display: grid;
    align-self: center;
    justify-self: end;
    width: 22px;
    height: 22px;
    place-items: center;
    color: var(--story-tone);
    font-size: 12px;
    line-height: 1;
    opacity: .9;
    transition: transform .16s ease, opacity .16s ease;
}
.story-page .story-chapter.open .story-chapter-chevron {
    transform: rotate(180deg);
    opacity: .72;
}
.story-page .story-chapter-body {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    padding: 8px var(--chapter-pad-x) 14px var(--chapter-day-x);
    background:
        linear-gradient(180deg, var(--story-tone-soft), rgba(255, 255, 255, .015) 210px),
        rgba(8, 26, 43, .42);
    border: 1px solid var(--story-tone-line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
}
.story-page .story-chapter-body-slot { width: 100%; }
.story-page .story-chapter-body::before {
    position: absolute;
    top: 0;
    bottom: 20px;
    left: var(--chapter-rail-x);
    width: 2px;
    background: var(--story-tone);
    opacity: .38;
    content: "";
}
.story-page .story-day-list { margin: 0; padding: 0; list-style: none; }
/* Recovery stays a compact recycle-bin surface with static month headers. */
.story-page .story-recovery-summary { display: inline-flex; align-items: center; max-width: 100%; min-height: 30px; margin: 0 0 14px; padding: 6px 10px; color: #dff5ec; background: rgba(143, 220, 199, .09); border: 1px solid rgba(143, 220, 199, .22); border-radius: 7px; font: 700 12px "DM Sans", Arial, sans-serif; line-height: 1.35; }
.story-page .story-load-older-row { display: flex; justify-content: center; margin: 16px 0 6px; }
.story-page .story-load-older { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; margin: 0; padding: 8px 16px; color: #102a43; background: #ffe08a; border: 1px solid #fff0a7; border-radius: 8px; box-shadow: none; font: 800 12px "DM Sans", Arial, sans-serif; cursor: pointer; }
.story-page .story-load-older:hover { background: #fff0b5; transform: none; }
.story-page .story-load-older:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.story-page .story-load-older[disabled] { opacity: .7; cursor: default; }
.story-page .story-recovery-stream { display: grid; gap: 18px; }
.story-page .story-recovery-chapter { min-width: 0; }
.story-page .story-recovery-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin: 0 0 4px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .1);
    border-left: 3px solid rgba(143, 220, 199, .75);
    border-radius: 8px;
}
.story-page .story-recovery-title { margin: 0; color: #fff; font: 800 14px Manrope, sans-serif; }
.story-page .recovery-record-list {
    margin: 0 0 0 3px;
    padding: 2px 0 2px 26px;
    border-left: 1px solid rgba(143, 220, 199, .22);
    list-style: none;
}
.story-page .recovery-record { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.story-page .recovery-record:last-child { border-bottom: 0; }
.story-page .recovery-record-details { min-width: 0; }
.story-page .recovery-record-summary { display: flex; align-items: center; justify-content: space-between; gap: 9px; cursor: pointer; list-style: none; }
.story-page .recovery-record-summary::-webkit-details-marker { display: none; }
.story-page .recovery-record-summary::marker { content: ""; }
.story-page .recovery-record-summary:focus-visible { outline: 3px solid #fff0a7; outline-offset: 3px; border-radius: 4px; }
.story-page .recovery-record-copy { flex: 1 1 auto; display: grid; gap: 1px; min-width: 0; }
.story-page .recovery-record-date { color: #fff; font: 700 13.5px Manrope, sans-serif; }
.story-page .recovery-record-meta { color: var(--app-muted); font-size: 11.5px; font-weight: 600; }
.story-page .recovery-record-chevron { flex: none; color: #ffe08a; font-size: 10px; transition: transform .15s ease; }
.story-page .recovery-record-details[open] .recovery-record-chevron { transform: rotate(180deg); }
.story-page .recovery-record-body { padding: 8px 0 2px; }
.story-page .recovery-record-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; }
.story-page .recovery-record-facts dt { color: rgba(255,255,255,.52); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.story-page .recovery-record-facts dd { margin: 1px 0 0; color: rgba(255,255,255,.88); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.story-page .recovery-record-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: flex-start; }
.story-page .recovery-action { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; margin: 0; padding: 6px 9px; border-radius: 6px; box-shadow: none; font: 700 11px "DM Sans", Arial, sans-serif; white-space: nowrap; }
.story-page .recovery-restore { color: #173e3b; background: #a6e3c9; border: 1px solid rgba(166, 227, 201, .4); }
.story-page .recovery-delete { color: #fff; background: rgba(151, 47, 62, .72); border: 1px solid rgba(255, 208, 214, .38); }
.story-page .story-month-insights-panel,
.story-page .story-view-empty { margin: 0; padding: 18px; color: #fff; border: 1px solid var(--app-line); border-radius: 12px; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.025)), #102a43; }
.story-page .story-month-insights-panel > .story-view-empty { padding: 0; border: 0; border-radius: 0; background: none; }
.story-page .story-month-insights-panel[hidden] { display: none; }/* Insights is a first-class analytical view. */
.story-page .story-insights-view { display: grid; gap: 14px; }
.story-page .story-insights-comparison { min-width: 0; }
.story-page .story-insights-comparison[hidden] { display: none; }
.story-page .story-insights-comparison-list { display: grid; grid-template-columns: repeat(var(--comparison-count, 3), minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.story-page .story-comparison-month { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; justify-items: stretch; gap: 2px; width: 100%; height: 100%; padding: 9px 10px; color: #fff; text-align: left; background: rgba(6,28,44,.32); border: 1px solid rgba(255,255,255,.11); border-radius: 9px; cursor: pointer; font: inherit; }
.story-page .story-comparison-month:hover { border-color: rgba(255,224,138,.38); background: rgba(255,255,255,.055); }
.story-page .story-comparison-month:focus-visible { outline: 3px solid #fff0a7; outline-offset: 2px; }
.story-page .story-comparison-month.is-current { border-color: rgba(255,224,138,.55); background: linear-gradient(145deg, rgba(255,224,138,.1), rgba(255,255,255,.04)); box-shadow: inset 0 0 0 1px rgba(255,224,138,.25); }
.story-page .story-comparison-label { overflow: hidden; color: #fff; font: 800 11px Manrope, sans-serif; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.story-page .story-comparison-metric { color: rgba(212,227,233,.68); font: 600 10.5px "DM Sans", Arial, sans-serif; }
.story-page .story-comparison-metric strong { color: #fff; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.story-page .story-comparison-metric.is-muted strong { color: rgba(212,227,233,.5); }
.story-page .story-comparison-deltas { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.12); }
.story-page .story-comparison-delta { font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.story-page .story-comparison-delta.is-improved { color: #94e9c0; }
.story-page .story-comparison-delta.is-regressed { color: #ffb08a; }
.story-page .story-comparison-delta.is-steady { color: rgba(212,227,233,.62); font-weight: 600; }
.story-page .story-insights-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.story-page .story-insights-head h3 { margin: 0; color: #fff; font: 800 17px Manrope, sans-serif; }
.story-page .story-insights-sample { color: rgba(212,227,233,.7); font-size: 11px; font-weight: 600; text-align: right; }
.story-page .story-insights-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; }
.story-page .story-insights-card { min-width: 0; padding: 11px 12px; border: 1px solid rgba(255,255,255,.11); border-radius: 8px; background: rgba(6,28,44,.3); }
.story-page .story-insights-card h4 { margin: 0 0 6px; color: #fff; font: 800 12px Manrope, sans-serif; letter-spacing: .02em; }
.story-page .story-insights-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 6px; }
.story-page .story-insights-card-head h4 { margin: 0; }
.story-page .story-tag-lookup-trigger { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; margin: 0; padding: 4px 8px; color: #ffe08a; background: transparent; border: 1px solid rgba(255, 224, 138, .28); border-radius: 6px; box-shadow: none; font: 700 11px "DM Sans", Arial, sans-serif; line-height: 1.2; cursor: pointer; }
.story-page .story-tag-lookup-trigger:hover { color: #fff0b5; background: rgba(255, 224, 138, .08); transform: none; }
.story-page .story-tag-lookup-trigger:focus-visible { outline: 3px solid #fff0a7; outline-offset: 2px; }
.story-page .story-tag-lookup-trigger i { font-size: 10px; }
.story-page .story-tag-lookup-content { width: min(100%, 500px); max-height: min(90vh, 760px); overflow-y: auto; }
.story-page .story-tag-lookup-scope { margin: 0 0 6px; color: #ffe08a; font-size: 12px; font-weight: 800; }
.story-page .story-tag-lookup-hint { margin: 0 0 16px; color: rgba(212, 227, 233, .7); font-size: 12px; line-height: 1.45; }
.story-page .story-tag-lookup-label { display: block; margin: 0 0 6px; color: #fff; font-size: 12px; font-weight: 700; }
.story-page .story-tag-lookup-content input { width: 100%; }
.story-page .story-tag-lookup-status { margin: 10px 0 0; font-size: 12px; font-weight: 600; line-height: 1.45; }
.story-page .story-tag-lookup-status.is-error { color: #ffb3bd; }
.story-page .story-tag-lookup-status.is-info { color: rgba(212, 227, 233, .78); }
.story-page .story-tag-lookup-results { display: grid; gap: 8px; margin-top: 12px; }
.story-page .story-tag-lookup-results[hidden], .story-page .story-tag-lookup-status[hidden] { display: none; }
.story-page .story-tag-lookup-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 9px 12px; color: #fff; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; box-shadow: none; text-align: left; cursor: pointer; }
.story-page .story-tag-lookup-result:hover { background: rgba(255, 255, 255, .1); transform: none; }
.story-page .story-tag-lookup-result:focus-visible { outline: 3px solid #fff0a7; outline-offset: 2px; }
.story-page .story-tag-lookup-result-copy { display: grid; gap: 3px; min-width: 0; }
.story-page .story-tag-lookup-result-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.story-page .story-tag-lookup-result-meta { color: rgba(212, 227, 233, .7); font-size: 11px; font-weight: 600; }
.story-page .story-tag-lookup-result > i { flex: none; color: rgba(255, 224, 138, .7); font-size: 10px; }
.story-page .story-contributor-eyebrow { margin: 0 0 4px; color: #ffe08a; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.story-page .story-contributor-grouped { display: grid; gap: 4px; margin-top: 14px; }
.story-page .story-contributor-grouped h3 { margin: 0; color: rgba(212,227,233,.55); font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.story-page .story-contributor-grouped .story-contributor-chips .story-insight-tag-chip { padding: 2px 7px; font-size: 12px; }
.story-page .story-contributor-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0 0 2px; color: rgba(212,227,233,.66); font-size: 11px; font-weight: 600; }
.story-page .story-contributor-counts strong { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.story-page .story-contributor-count-separator { color: rgba(212,227,233,.35); }
.story-page .story-insights-contributors { margin-top: 10px; }
.story-page .story-insights-hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; color: #ffe08a; font: 800 20px Manrope, sans-serif; font-variant-numeric: tabular-nums; }
.story-page .story-insights-hero span { color: rgba(212,227,233,.66); font: 600 10.5px "DM Sans", Arial, sans-serif; }
.story-page .story-readiness-bar { display: flex; width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.story-page .story-readiness-segment { display: block; height: 100%; }
.story-page .story-readiness-segment.is-fast,
.story-page .story-readiness-swatch.is-fast { background: #82dfd0; }
.story-page .story-readiness-segment.is-steady,
.story-page .story-readiness-swatch.is-steady { background: #b7e6d9; }
.story-page .story-readiness-segment.is-slow,
.story-page .story-readiness-swatch.is-slow { background: #ffe08a; }
.story-page .story-readiness-segment.is-late,
.story-page .story-readiness-swatch.is-late { background: #ff9f7a; }
.story-page .story-readiness-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 9px 0 0; padding: 0; list-style: none; }
.story-page .story-readiness-legend li { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 5px; color: rgba(212,227,233,.78); font-size: 10.5px; }
.story-page .story-readiness-legend li em { grid-column: 2 / -1; color: rgba(212,227,233,.48); font-size: 9.5px; font-style: normal; }
.story-page .story-readiness-legend strong { color: #fff; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.story-page .story-readiness-swatch { display: block; width: 7px; height: 7px; border-radius: 50%; }
.story-page .story-insight-tag-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.story-page .story-insight-tag { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 0 6px; min-width: 0; min-height: 30px; }
.story-page .story-insight-tag-rank { width: 14px; min-width: 14px; color: rgba(255,255,255,.48); font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.story-page .story-insight-tag-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; min-width: 0; }
.story-page .story-insight-tag-group { display: inline-flex; flex-wrap: wrap; flex: none; gap: 3px; }
.story-page .story-insight-tag-chip { display: inline-flex; flex: none; align-items: center; justify-content: center; padding: 1px 6px; color: #142f45; background: #fff; border-radius: 4px; font-size: 11px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.story-page .story-insight-tag-chip[data-tag-length="1"] { min-width: 22px; }
.story-page .story-insight-tag-chip[data-tag-length="2"] { min-width: 29px; }
.story-page .story-insight-tag-chip[data-tag-length="3"] { min-width: 36px; }
.story-page .story-insight-tag-chip[data-tag-length="4"] { min-width: 43px; }
.story-page .story-insight-tag-chip[data-tag-length="5"] { min-width: 50px; }
.story-page .story-insight-tag-meta { display: inline-flex; align-items: center; gap: 3px; min-width: 0; color: rgba(212,227,233,.66); font-size: 10.5px; line-height: 1.2; white-space: nowrap; }
.story-page .story-insight-tag-separator { color: rgba(212,227,233,.4); }
.story-page .story-insight-tag-metric { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 2px; line-height: 1.2; text-align: right; }
.story-page .story-insight-tag-value { color: #ffe08a; font-size: 11px; font-weight: 800; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.story-page .story-insight-tag-trend { font-size: 10px; font-weight: 800; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.story-page .story-insight-tag-trend.is-improving { color: #94e9c0; }
.story-page .story-insight-tag-trend.is-worsening { color: #ff9aa5; }
.story-page .story-insight-tag-trend.is-steady { color: rgba(212,227,233,.62); }
.story-page .story-insight-tag-open { display: inline-flex; align-items: center; justify-content: flex-start; gap: 0; width: auto; height: auto; min-width: 30px; min-height: 30px; margin: 0; padding: 0 2px; color: inherit; background: none; border: 0; border-radius: 6px; box-shadow: none; cursor: pointer; font: inherit; line-height: 1; text-align: left; transition: none; }
.story-page .story-insight-tag-open:hover { transform: none; filter: none; box-shadow: none; }
.story-page .story-insight-tag-open:active { transform: none; }
.story-page .story-insight-tag-open:hover .story-insight-tag-chip { background: #ffe08a; }
.story-page .story-insight-tag-open:focus-visible { outline: 3px solid #fff0a7; outline-offset: 3px; }
body.story-drawer-open { overflow: hidden; }
.story-contributor-drawer { position: fixed; z-index: 700; inset: 0; display: flex; justify-content: flex-end; }
.story-contributor-drawer.hidden { display: none; }
.story-contributor-backdrop { position: absolute; inset: 0; background: rgba(5,17,28,.68); backdrop-filter: blur(4px); }
.story-contributor-panel { position: relative; z-index: 1; width: min(100%, 460px); height: 100%; overflow: auto; overscroll-behavior: contain; padding: 0; color: #fff; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.02)), #102a43; border-left: 1px solid rgba(255,255,255,.14); box-shadow: -18px 0 45px rgba(0,0,0,.35); }
.story-contributor-panel:focus { outline: none; }
.story-contributor-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 14px; background: rgba(16,42,67,.96); border-bottom: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.story-contributor-heading { flex: 1 1 auto; min-width: 0; }
.story-contributor-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.story-contributor-drawer .story-contributor-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; margin: 0; padding: 0; color: #fff; background: transparent; border: 0; border-radius: 8px; box-shadow: none; font: 800 15px/1 "DM Sans", Arial, sans-serif; cursor: pointer; transform: none; filter: none; -webkit-tap-highlight-color: transparent; transition: background .14s ease, color .14s ease, transform .1s ease; }
.story-contributor-drawer .story-contributor-icon-btn:hover { background: rgba(255,255,255,.08); transform: none; filter: none; box-shadow: none; }
.story-contributor-drawer .story-contributor-icon-btn:active { background: rgba(255,255,255,.12); transform: scale(.94); filter: none; }
.story-contributor-drawer .story-contributor-icon-btn:focus-visible { background: rgba(255,255,255,.08); outline: 3px solid #fff0a7; outline-offset: 2px; }
.story-contributor-drawer .story-contributor-icon-btn[hidden] { display: none; }
.story-contributor-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: #fff; font: 800 20px Manrope, sans-serif; }
.story-contributor-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.story-contributor-chips .story-insight-tag-chip { padding: 4px 9px; font-size: 14px; }
.story-contributor-month { margin: 0 0 7px; color: rgba(232,244,247,.84); font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.story-contributor-body { padding: 18px 22px 28px; }
.story-contributor-average { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin: 4px 0 10px; color: #ffe08a; font: 800 28px Manrope, sans-serif; font-variant-numeric: tabular-nums; }
.story-contributor-average span { color: rgba(212,227,233,.66); font: 600 11px "DM Sans", Arial, sans-serif; }
.story-contributor-average.is-empty { color: rgba(212,227,233,.55); font-size: 16px; }
.story-contributor-comparison { margin: 8px 0 0; }
.story-contributor-comparison strong { font-size: 13px; font-weight: 800; }
.story-contributor-comparison.is-faster strong { color: #94e9c0; }
.story-contributor-comparison.is-slower strong { color: #ff9aa5; }
.story-contributor-comparison.is-even strong { color: rgba(212,227,233,.62); }
.story-contributor-trend { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 7px 0 0; font-size: 11px; font-weight: 700; }
.story-contributor-trend strong { font-size: 11px; font-weight: 800; }
.story-contributor-trend span { color: rgba(212,227,233,.58); font-weight: 600; }
.story-contributor-trend.is-improving strong { color: #94e9c0; }
.story-contributor-trend.is-worsening strong { color: #ff9aa5; }
.story-contributor-trend.is-steady strong { color: rgba(212,227,233,.62); }
.story-contributor-trend-chart { margin-top: 8px; }
.story-contributor-sparkline { margin: 0; }
.story-contributor-sparkline svg { display: block; width: 100%; height: auto; aspect-ratio: 132 / 44; overflow: visible; }
.story-contributor-spark-baseline { stroke: rgba(212,227,233,.3); stroke-width: 1; stroke-dasharray: 2 3; }
.story-contributor-spark-line { stroke: rgba(212,227,233,.45); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.story-contributor-spark-dot { fill: #e8f0f4; }
.story-contributor-spark-dot.is-improving { fill: #94e9c0; }
.story-contributor-spark-dot.is-worsening { fill: #ff9aa5; }
.story-contributor-spark-dot.is-steady { fill: #d4e3e9; }
.story-contributor-chart-dates { display: flex; justify-content: space-between; gap: 10px; padding: 0 4%; margin-top: 1px; color: rgba(212,227,233,.5); font-size: 9.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.story-contributor-section { margin-top: 14px; }
.story-contributor-section h3 { margin: 0 0 7px; color: #fff; font: 800 12px Manrope, sans-serif; letter-spacing: .02em; }
.story-contributor-event-list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.story-contributor-event-day { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.09); }
.story-contributor-event-day:last-child { border-bottom: 0; }
.story-contributor-event-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.story-contributor-event-day-head strong { color: #fff; font-size: 12px; font-weight: 800; }
.story-contributor-event-day-head span { color: rgba(212,227,233,.5); font-size: 10px; white-space: nowrap; }
.story-contributor-event-day-items { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.story-contributor-event-day-items li,
.story-contributor-event-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 5px 0; }
.story-contributor-event-row { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.09); }
.story-contributor-event-row:last-child { border-bottom: 0; }
.story-contributor-event-when { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.story-contributor-event-when strong { color: #fff; font-size: 12px; font-weight: 800; }
.story-contributor-event-when span { color: rgba(212,227,233,.6); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.story-contributor-arrow { display: inline-block; flex: none; width: 12px; height: 12px; vertical-align: -.15em; color: currentColor; }
.story-contributor-event-when .story-contributor-arrow { width: 12px; height: 12px; vertical-align: -.15em; }
.story-contributor-back .story-contributor-arrow { width: 18px; height: 18px; vertical-align: middle; }
.story-contributor-event-duration { color: #ffe08a; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.story-contributor-event-row.is-untimed .story-contributor-event-duration { color: rgba(212,227,233,.55); font-size: 10px; }
.story-contributor-event-flow { display: inline-flex; align-items: center; gap: 5px; color: #ffe08a; font-size: 10px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.story-contributor-event-flow:hover { color: #fff4bd; }
.story-contributor-event-flow .story-contributor-arrow { width: 11px; height: 11px; vertical-align: -.1em; }
.story-contributor-event-day-head .story-contributor-event-flow { margin-left: auto; }
.story-contributor-empty { margin: 0; color: rgba(212,227,233,.6); font-size: 11px; }
.story-page .story-insights-finding { margin: 11px 0 0; padding-top: 9px; color: rgba(232,244,247,.9); border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; line-height: 1.45; }
.story-page .story-insights-finding strong { color: #ffe08a; }
.story-page .story-insights-note { margin: 8px 0 0; color: rgba(212,227,233,.55); font-size: 10px; line-height: 1.4; }
.story-page .story-insights-status,
.story-page .story-insights-empty { margin: 0; color: rgba(212,227,233,.72); font-size: 12px; line-height: 1.45; }
.story-page .story-insights-empty strong { color: #fff; }
.story-page .story-view-empty { color: rgba(212,227,233,.72); font-size: 12px; line-height: 1.45; }
/* Dismissal days are the primary objects on the continuous rail. */
.story-page .story-day { list-style: none; min-width: 0; }
.story-page .story-day-folder { padding: 13px 0 14px; border-bottom: 1px solid rgba(255,255,255,.16); }
.story-page .story-day-heading { display: grid; grid-template-columns: 33px 14px minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.story-page .story-day-heading::-webkit-details-marker { display: none; }
.story-page .story-day-heading:focus-visible { outline: 3px solid #fff0a7; outline-offset: 3px; }
/* One timeline marker per dismissal sits in its own column on the thread line.
   The open state is carried by the card, chevron and details; the marker stays
   neutral unless Worth a Look styling gives it significance. */
.story-page .story-day-marker { position: relative; z-index: 1; display: grid; width: 33px; height: 33px; place-items: center; color: #143f43; background: linear-gradient(135deg, #a6e3c9, #82dfd0); border: 3px solid #8797ad; border-radius: 50%; font-size: 12px; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.story-page .story-day-caret { color: #ffe08a; font-size: 10px; transition: transform .14s ease; }
.story-page .story-day-folder[open] .story-day-caret { transform: rotate(90deg); }
.story-page .story-day-date { margin: 0; color: #fff; font: 700 15.5px Manrope, sans-serif; overflow-wrap: anywhere; }
.story-page .story-day-flags { grid-column: 4; display: inline-flex; align-items: center; gap: 6px; }
.story-page .story-day-flag { font-size: 14px; }
.story-page .story-day-flag.story-day-flag-best { color: #ffe08a; }
.story-page .story-day-flag.fa-cloud-rain { color: #a9dff1; }
.story-page .story-day-stats { grid-column: 5; justify-self: end; display: inline-flex; align-items: baseline; gap: 9px; color: var(--app-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.story-page .story-day-stats strong { color: #fff; font: 800 14.5px Manrope, sans-serif; overflow-wrap: anywhere; }
.story-page .story-day-stats strong.story-day-best { color: #ffe08a; }
.story-page .story-day-unit { font-style: normal; }
/* Show information exactly once: while the day is open the summary chips and
   the icon flags retire — the metrics reappear as the Performance Summary and
   the flags are explained by the operational details. */
/* Worth a look: dismissals that fall well outside the school's typical range
   wear an amber marker - dashed for mild deviations, solid gold fill for strong
   ones. Deliberately not red: this names review, never error, and the open
   state never changes the marker. */
.story-page .story-day-marker.story-day-marker-review { border-style: dashed; border-color: #d4af37; }
.story-page .story-day-marker.story-day-marker-review.story-day-marker-review-strong { border-style: solid; color: #2e2b1c; background: linear-gradient(135deg, #f1d46b, #d4af37); }
.story-page .story-day-group { margin: 0; color: rgba(255,255,255,.62); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.story-page .story-day-details { display: grid; gap: 0; margin: 0; margin-left: 0; padding: 0; border-top: none; grid-template-columns: 1fr; align-items: start; }
/* Report pairs: label/value on one printed-report line — label quieter, value
   carrying the weight. */
.story-page .story-day-pair { display: grid; grid-template-columns: minmax(110px, 176px) minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 6px 0; min-width: 0; }
.story-page .story-day-pair > * { min-width: 0; }
.story-page .story-day-pair dt { color: rgba(255,255,255,.55); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.story-page .story-day-rule { border-top: 1px dotted rgba(255,255,255,.1); margin: 6px 0; }
/* Fixed metric channels: identical stops for every row make the list scannable
   column-wise; fixed span widths hold the columns steady whether or not a row
   carries flags, and tabular numerals keep digit widths constant. */
.story-page .story-day-stats span { flex: none; text-align: left; font-variant-numeric: tabular-nums; }
.story-page .story-day-stats span:nth-child(1) { width: 100px; }
.story-page .story-day-stats span:nth-child(2) { width: 62px; }
.story-page .story-day-stats span:nth-child(3) { width: 84px; }
.story-page .story-day-details dd { margin: 0; color: #fff; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.story-page .story-day-details-empty { margin: 10px 0 0 67px; color: var(--app-muted); font-size: 12.5px; }
.story-page .story-day-body { display: block; margin: 12px 0 0 67px; padding: 13px 0 6px; border-top: 1px solid rgba(255,255,255,.14); }
.story-page .story-day-body > .story-day-section .story-day-group { margin-bottom: 5px; }
.story-page .story-day-body > .story-day-details-empty { margin: 4px 0 0; }
/* Run attach: the expanded record's text action into the run's Dismissal
   Flow report — Journey-style quiet slate that warms gold on hover, full
   touch height, no icon-button chrome. */
.story-page .story-day-flow { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin: 0 0 0 auto; color: rgba(212,227,233,.92); font: 700 13px "DM Sans", Arial, sans-serif; }
.story-page .story-day-footer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 10px; }
.story-page .story-day-flow i { font-size: 11px; }
.story-page .story-day-flow:hover { color: #ffe08a; }
/* Header-level actions: icon-only buttons trailing the summary line, hidden
   on collapsed rows so the list stays quiet; hover paints them (edit gold,
   delete danger) while the click stays isolated from the folder toggle. */
.story-page .story-day-actions { grid-column: 6; display: none; align-items: center; gap: 6px; }
.story-page .story-day-folder[open] .story-day-actions { display: inline-flex; }
.story-page .story-day-actions button { display: grid; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; place-items: center; color: rgba(255,255,255,.66); background: transparent; border: none; border-radius: 9px; box-shadow: none; transition: background .13s ease, color .13s ease; }
.story-page .story-day-actions button:hover { transform: none; box-shadow: none; background: rgba(255,255,255,.12); }
.story-page .story-day-actions button i { font-size: 15px; }
.story-page .story-day-actions button.story-edit i { color: #ffd700; }
.story-page .story-day-actions button.story-delete i { color: #ff6b73; }
.story-page .story-day-actions button:focus-visible { outline: 3px solid #fff0a7; outline-offset: 3px; }
/* V3.2 day cards: compact neutral surfaces attached to the chapter spine. */
.story-page .story-day-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.story-page .story-day-folder {
    position: relative;
    max-width: 100%;
    padding: 0;
    background: rgba(8, 26, 43, .72);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
    overflow: visible;
}
.story-page .story-day-folder[open] {
    background: rgba(8, 26, 43, .9);
    border-color: rgba(255, 255, 255, .17);
}
.story-page .story-day-heading {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 13px;
    min-height: 66px;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
}
.story-page .story-day-folder[open] .story-day-heading {
    border-bottom: 1px solid rgba(255,255,255,.14);
}
.story-page .story-day-marker {
    position: absolute;
    z-index: 2;
    top: 24px;
    left: calc(var(--chapter-rail-x) - var(--chapter-day-x));
    transform: translateX(-50%);
    display: block;
    width: 11px;
    height: 11px;
    color: transparent;
    background: var(--page);
    border: 2px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .06);
    font-size: 0;
}
.story-page .story-day-marker i { display: none; }
.story-page .story-day-marker.story-day-marker-review {
    border-style: dashed;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .08);
}
.story-page .story-day-marker.story-day-marker-review.story-day-marker-review-strong {
    border-style: solid;
    background: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .2);
}
.story-page .story-day-caret {
    color: rgba(255, 255, 255, .42);
    font-size: 11px;
    transition: transform .14s ease;
}
.story-page .story-day-date {
    margin: 0;
    color: #fff;
    font: 700 15px Manrope, sans-serif;
    overflow-wrap: anywhere;
}
.story-page .story-day-flags {
    grid-column: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.story-page .story-day-stats {
    grid-column: 4;
    justify-self: end;
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    color: var(--app-muted);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.story-page .story-day-stats strong {
    color: #fff;
    font: 800 14px Manrope, sans-serif;
    overflow-wrap: anywhere;
}
.story-page .story-day-actions { grid-column: 5; }
.story-page .story-day-folder[open] .story-day-stats,
.story-page .story-day-folder[open] .story-day-flags { display: inline-flex; }
.story-page .story-day-body {
    min-width: 0;
    margin: 0;
    padding: 0 16px 15px 41px;
    border-top: 0;
}
.story-page .story-day-body > .story-day-section .story-day-group { margin-bottom: 5px; }
.story-page .story-day-body > .story-day-details-empty { margin: 4px 0 0; }/* Buttons inside the summary with default order after the date/flags/stats:
   they keep the header grid's last columns and hover paint sets them apart. */
.story-page .story-event { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 15px; }
.story-page .story-event-marker { position: relative; z-index: 1; display: grid; width: 33px; height: 33px; margin-top: 18px; place-items: center; color: #143f43; background: #a6e3c9; border: 3px solid #8797ad; border-radius: 50%; font-size: 12px; }
.story-page .story-event-content { min-width: 0; padding: 17px 0 19px; border-bottom: 1px solid rgba(255,255,255,.16); }
.story-page .story-event-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.story-page .story-event-header h3 { margin: 0; color: #fff; font: 800 16px Manrope, sans-serif; }
.story-page .story-event-header p { margin: 5px 0 0; color: var(--app-muted); font-size: 13px; }
.story-page .story-archive-date { margin-top: 5px; color: rgba(212,227,233,.7); font-size: 11px; }
.story-page .story-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.story-page .story-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 3px 8px; color: #e5f9f1; background: rgba(255,255,255,.09); border: 1px solid var(--app-line); border-radius: 5px; font-size: 11px; font-weight: 700; }
.story-page .story-badge-condition { color: #19374a; background: #a9dff1; border-color: rgba(255,255,255,.65); }
.story-page .story-badge-auto { color: #2b2715; background: #f2d46b; border-color: rgba(255,255,255,.65); }
.story-page .story-event-primary-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.12); }
.story-page .story-primary-metric { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.story-page .story-primary-metric strong { color: #fff; font: 800 20px Manrope, sans-serif; line-height: 1.1; overflow-wrap: anywhere; }
.story-page .story-primary-metric span { color: #d4e3e9; font-size: 11px; font-weight: 700; line-height: 1.25; }
.story-page .story-event-metrics-secondary { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 9px; color: rgba(212,227,233,.76); font-size: 11px; }
.story-page .story-event-metrics-secondary strong { color: rgba(255,255,255,.88); }
.story-page .story-event-metrics-secondary .story-metric-legacy { color: rgba(212,227,233,.54); font-size: 10px; }
.story-page .story-event-metrics-secondary .story-metric-legacy strong { color: rgba(255,255,255,.62); }
.story-page .story-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.story-page .story-actions button { display: grid; width: 38px; height: 38px; min-height: 38px; margin: 0; padding: 0; place-items: center; color: #fff; background: rgba(255,255,255,.1); border: 1px solid var(--app-line); border-radius: 7px; box-shadow: none; }
.story-page .story-actions .story-delete { color: #ffd6d9; }
.story-page .story-actions button:hover { background: rgba(255,255,255,.2); }
.story-page .story-archive-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.story-page .story-archive-actions button { width: auto; min-width: 44px; max-width: 100%; min-height: 38px; margin: 0; padding: 8px 11px; border-radius: 6px; box-shadow: none; font-size: 12px; }
.story-page .story-archive-restore { color: #173e3b; background: #a6e3c9; }
.story-page .story-archive-delete { color: #fff; background: rgba(151,47,62,.72); border: 1px solid rgba(255,208,214,.38); }
@media (max-width: 680px) {
    .story-page .story-shell { width: calc(100% - 36px); }
    .story-page .story-view-bar { flex-wrap: wrap; align-items: center; gap: 8px; }
    .story-page .story-view-tabs { flex: 0 1 auto; width: max-content; max-width: 100%; min-width: 0; min-height: 32px; }
    .story-page .story-view-tab { flex: 0 0 auto; gap: 4px; padding: 0 7px; font-size: 11px; }
    .story-page .story-view-heading { padding: 18px 0 14px; }
    .story-page .story-month-jump { flex: 0 0 auto; margin-left: auto; gap: 0; }
    .story-page .story-month-jump select { min-height: 32px; padding: 4px 22px 4px 7px; font-size: 11px; }
    .story-page .story-insights-grid { grid-template-columns: 1fr; }
    .story-page .story-insights-comparison-list { display: flex; flex-direction: column-reverse; }
    .story-page .story-comparison-month { display: block; padding: 8px 10px; text-align: left; }
    .story-page .story-comparison-label { display: block; margin-bottom: 2px; }
    .story-page .story-comparison-metric { display: inline; margin-right: 10px; }
    .story-page .story-comparison-deltas { margin-top: 5px; }
    .story-page .story-insights-head { flex-direction: column; gap: 4px; }
    .story-page .story-insights-sample { text-align: left; }
    .story-page .story-insight-tag { grid-template-columns: 14px minmax(0, 1fr) auto; }
    .story-page .story-insight-tag-metric { grid-column: auto; justify-content: flex-end; text-align: right; }
    .story-contributor-drawer { align-items: flex-end; }
    .story-contributor-panel { width: 100%; height: min(92vh, 100dvh); border-left: 0; border-top: 1px solid rgba(255,255,255,.14); border-radius: 16px 16px 0 0; }
    .story-contributor-panel-head { padding: 18px 16px 12px; }
    .story-contributor-body { padding: 16px 16px calc(22px + env(safe-area-inset-bottom)); }
    .story-contributor-average { font-size: 25px; }
    .story-page .story-event { grid-template-columns: 28px minmax(0,1fr); gap: 11px; }
    .story-page .story-event-marker { width: 27px; height: 27px; }
    .story-page .story-event-header { gap: 8px; }
    .story-page .story-event-primary-metrics { gap: 7px; }
    .story-page .story-primary-metric strong { font-size: 17px; }
    .story-page .story-primary-metric span { font-size: 10px; }
    .story-page .story-actions button { width: 35px; height: 35px; min-height: 35px; }
    .story-page .story-archive-actions button { min-height: 36px; }
    /* Stacked day rows: line one carries the marker, caret, date and trailing
       indicators; line two indents under the date and lists the three metrics
       with separator dots as a compact summary. */
    .story-page .story-day-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 9px; }
    .story-page .story-day-marker { flex: none; align-self: flex-start; margin-top: 2px; }
    .story-page .story-day-caret { flex: none; }
    .story-page .story-day-date { flex: 1 1 auto; min-width: 0; }
    .story-page .story-day-flags { order: 1; flex: none; margin-left: auto; }
    .story-page .story-day-body { margin-left: 47px; padding-top: 11px; }
    .story-page .story-day-marker { width: 27px; height: 27px; font-size: 11px; }
    .story-page .story-day-details { margin-left: 0; }
    .story-page .story-day-details-empty { margin-left: 0; }
    .story-page .story-day-folder .story-actions { margin-left: 47px; }
    .story-page .story-day-date { font-size: 14px; }
    .story-page .story-day-stats { order: 3; flex: 1 1 100%; margin-left: 47px; justify-self: auto; justify-content: flex-start; gap: 0; font-size: 11.5px; }
    .story-page .story-day-stats span { width: auto; }
    .story-page .story-day-stats span + span::before { content: "•"; margin: 0 6px; color: rgba(255,255,255,.38); }
    .story-page .story-day-stats strong { font-size: 13px; }
    .story-page .story-day-actions { order: 5; flex: none; margin-left: auto; }
    .story-page .story-day-details > div { grid-template-columns: minmax(104px, 40%) minmax(0, 1fr); gap: 9px; }
}
/* Very narrow phones tighten spacing and the date size so the date and its
   indicators share one line without wrapping mid-date. */
@media (max-width: 480px) {
    .story-page .story-day-heading { gap: 6px 7px; }
    .story-page .story-day-date { font-size: 13px; }
}

/* Expanded dismissal summary: outcome rows first, exceptions only when present,
   and diagnostics behind one native disclosure. */
.story-page .story-day-body > .story-day-details + .story-day-details { margin-top: 8px; }
.story-page .story-day-exceptions,
.story-page .story-day-worth {
    margin: 10px 0 0; padding: 9px 11px;
    border: 1px solid rgba(255, 224, 138, .28);
    border-left: 3px solid #ffe08a;
    border-radius: 8px;
    background: rgba(255, 224, 138, .08);
}
.story-page .story-day-exceptions strong,
.story-page .story-day-worth strong {
    display: block; color: #ffe08a; font-size: 10.5px;
    font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.story-page .story-day-exceptions ul {
    display: grid; gap: 4px; margin: 5px 0 0; padding: 0; list-style: none;
}
.story-page .story-day-exceptions li {
    display: flex; align-items: baseline; gap: 7px;
    color: rgba(255,255,255,.84); font-size: 12.5px; line-height: 1.35;
}
.story-page .story-day-exceptions i,
.story-page .story-day-worth > i {
    color: #ffe08a; font-size: 11px;
}
.story-page .story-day-worth { display: flex; align-items: flex-start; gap: 9px; }
.story-page .story-day-worth span {
    display: block; margin-top: 2px; color: rgba(255,255,255,.84);
    font-size: 12.5px; line-height: 1.35;
}
.story-page .story-day-notes {
    margin-top: 12px; padding-top: 0;
    border-top: 0;
}
.story-page .story-day-notes h4 {
    margin: 0 0 8px; color: #ffe08a; font-size: 11px;
    font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.story-page .story-day-notes ul {
    display: grid; gap: 8px; margin: 0 0 9px; padding: 0; list-style: none;
}
.story-page .story-note {
    padding: 9px 11px; border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px; background: rgba(255,255,255,.05);
}
.story-page .story-note p {
    margin: 0; color: rgba(255,255,255,.9); font-size: 13px; line-height: 1.4;
    overflow-wrap: anywhere;
}
.story-page .story-note-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
    margin-top: 6px; color: rgba(255,255,255,.58); font-size: 11px;
}
.story-page .story-note-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.story-page .story-note-actions button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; min-width: 28px; height: 28px; min-height: 28px;
    margin: 0; padding: 0; color: rgba(255,255,255,.75);
    background: transparent; border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
}
.story-page .story-note-actions button:hover { background: rgba(255,255,255,.1); }
.story-page .story-note-actions button:disabled { cursor: wait; }
.story-page .story-note-empty {
    margin: 0 0 9px; color: rgba(255,255,255,.58); font-size: 12.5px;
}
.story-page .story-note-add {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 34px; margin: 0; padding: 7px 11px;
    color: #ffe08a; background: transparent;
    border: 1px solid rgba(255,224,138,.32); border-radius: 7px;
    font: 700 12px "DM Sans", Arial, sans-serif;
}
.story-page .story-note-add:hover { background: rgba(255,224,138,.08); }
.story-page .story-note-add i { width: 1em; flex: none; text-align: center; }
.story-page .story-note-add:disabled { cursor: wait; }
.story-page .story-event .story-day-notes { margin-top: 10px; padding-top: 0; border-top: 0; }

.story-page .story-day-reconciliation {
    margin: 10px 0 0; padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.14);
    border-left: 3px solid rgba(255,255,255,.35);
    border-radius: 8px;
    background: rgba(255,255,255,.045);
}
.story-page .story-day-reconciliation-header {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px; cursor: pointer; list-style: none;
}
.story-page .story-day-reconciliation-header::-webkit-details-marker { display: none; }
.story-page .story-day-reconciliation-header::marker { content: ""; }
.story-page .story-day-reconciliation-header::before {
    content: "\25B8"; display: inline-flex; align-items: center; justify-content: center;
    width: 14px; flex: none; color: rgba(255,255,255,.55);
    font-size: 12px; line-height: 1;
}
.story-page .story-day-reconciliation[open] > .story-day-reconciliation-header::before {
    content: "\25BE";
}
.story-page .story-day-reconciliation-header:focus-visible {
    outline: 2px solid #ffe08a; outline-offset: 3px; border-radius: 4px;
}
.story-page .story-day-reconciliation-title {
    color: #ffe08a; font-size: 10.5px;
    font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.story-page .story-reconciliation-badge {
    display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
    padding: 3px 8px; border-radius: 999px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
}
.story-page .story-day-reconciliation-matched { border-left-color: #7ed6a5; }
.story-page .story-day-reconciliation-matched .story-reconciliation-badge {
    color: #0f3d2a; background: #a9e8c4;
}
.story-page .story-day-reconciliation-queueHigher { border-left-color: #f2c46d; }
.story-page .story-day-reconciliation-queueHigher .story-reconciliation-badge {
    color: #4c3604; background: #f8d98d;
}
.story-page .story-day-reconciliation-ledgerHigher { border-left-color: #8cc8f2; }
.story-page .story-day-reconciliation-ledgerHigher .story-reconciliation-badge {
    color: #10334d; background: #b7dcf7;
}
.story-page .story-day-reconciliation-ledgerIncomplete { border-left-color: #f0a36f; }
.story-page .story-day-reconciliation-ledgerIncomplete .story-reconciliation-badge {
    color: #4b2410; background: #f6c39f;
}
.story-page .story-day-reconciliation-legacy { border-left-color: rgba(255,255,255,.25); }
.story-page .story-day-reconciliation-legacy .story-reconciliation-badge {
    color: rgba(255,255,255,.8); background: rgba(255,255,255,.12);
}
.story-page .story-reconciliation-explanation {
    margin: 6px 0 0; color: rgba(255,255,255,.76);
    font-size: 12px; line-height: 1.4;
}
.story-page .story-reconciliation-facts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px; margin: 10px 0 0;
}
.story-page .story-reconciliation-facts > div { min-width: 0; }
.story-page .story-reconciliation-facts dt {
    color: rgba(255,255,255,.52); font-size: 10.5px; font-weight: 700;
    letter-spacing: .03em; text-transform: uppercase;
}
.story-page .story-reconciliation-facts dd {
    margin: 2px 0 0; color: #fff; font-size: 13px; font-weight: 700;
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
@media (max-width: 620px) {
    .story-page .story-reconciliation-facts { grid-template-columns: 1fr; }
    .story-page .story-day-reconciliation-header { align-items: flex-start; }
}

@media (max-width: 980px) {
    .story-page .story-cover { grid-template-columns: 1fr; }
    .story-page .story-cover-records { padding: 18px 0 0; border-top: 1px solid rgba(25, 55, 74, .18); border-left: 0; }
}

@media (max-width: 680px) {
    .story-page .story-cover { gap: 10px; margin-bottom: 22px; padding: 24px; }
    .story-page .story-cover-title { font-size: 28px; }
    .story-page .story-cover-records { gap: 10px 16px; }
    .story-page .story-cover-record strong { font-size: 20px; }
    .story-page .story-chapter {
        --chapter-pad-x: 13px;
        --chapter-number-width: 46px;
        --chapter-column-gap: 9px;
        --chapter-rail-x: 19px;
        /* Reclaim the gutter between the rail and the cards: the marker only
           needs its own halo, not the cover's full number-column offset. */
        --chapter-day-x: 40px;
    }
    .story-page .story-chapter-cover {
        grid-template-columns: var(--chapter-number-width) minmax(0, 1fr) 20px;
        gap: var(--chapter-column-gap);
        min-height: 80px;
        padding: 3px var(--chapter-pad-x);
    }
    .story-page .story-chapter-number { font-size: 44px; }
    .story-page .story-chapter-month { font-size: 20px; }
    .story-page .story-chapter-year { margin-left: 5px; font-size: 10.5px; }
    .story-page .story-chapter-stats { margin-top: 4px; font-size: 10px; }
    .story-page .story-chapter-body { padding: 8px var(--chapter-pad-x) 12px var(--chapter-day-x); }
    .story-page .story-chapter-body::before { top: 0; left: var(--chapter-rail-x); bottom: 18px; }
    .story-page .story-day-marker {
        top: 23px;
        width: 10px;
        height: 10px;
        margin-top: 0;
    }
    .story-page .story-day-heading { padding: 10px 11px; gap: 7px 9px; min-width: 0; }
    .story-page .story-day-stats {
        min-width: 0;
        margin-left: 0;
        flex-wrap: wrap;
        white-space: normal;
        row-gap: 2px;
    }
    .story-page .story-day-stats span { white-space: nowrap; }
    .story-page .story-day-body { margin: 0; padding: 0 12px 13px 30px; }
    .story-page .recovery-record { padding: 7px 0; }
    .story-page .recovery-record-facts { grid-template-columns: 1fr; }
}