* {
    box-sizing: border-box;
}

body {
    background-color: #121215;
    color: #f1f1f4;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    user-select: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: #121215;
}
::-webkit-scrollbar-thumb {
    background: #2e2e38;
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: #434352;
}

/* Tactile physical cards & buttons */
.tactile-card {
    background-color: #202026;
    border: 1px solid #2e2e38;
    border-radius: 5px;
    box-shadow: 0 2px 0 #0c0c0e;
}

.tactile-btn {
    background-color: #202026;
    border: 1px solid #2e2e38;
    border-radius: 5px;
    box-shadow: 0 2px 0 #0c0c0e;
    transition: transform 0.07s ease, box-shadow 0.07s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.tactile-btn:hover:not(:disabled) {
    background-color: #27272f;
    border-color: #464654;
}
.tactile-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 0px 0 #0c0c0e;
}
.tactile-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.tactile-btn-amber {
    background-color: #f59e0b;
    border: 1px solid #fbbf24;
    border-radius: 5px;
    box-shadow: 0 3px 0 #92400e;
    color: #121215;
    transition: transform 0.07s ease, box-shadow 0.07s ease, background-color 0.12s ease;
}
.tactile-btn-amber:hover:not(:disabled) {
    background-color: #fbbf24;
}
.tactile-btn-amber:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 0px 0 #92400e;
}

.tactile-btn-speed-active {
    background-color: #f59e0b !important;
    border-color: #fbbf24 !important;
    color: #121215 !important;
    font-weight: 700;
}

/* Signature 5px & 4px slim progress bars */
.slim-bar-5 {
    height: 5px;
    background-color: #121215;
    border: 1px solid #2a2a34;
    border-radius: 2px;
    overflow: hidden;
}
.slim-bar-4 {
    height: 4px;
    background-color: #121215;
    border: 1px solid #2a2a34;
    border-radius: 2px;
    overflow: hidden;
}
.slim-bar-fill {
    height: 100%;
    transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.year-progress-bar {
    height: 6px;
    background-color: #121215;
    border: 1px solid #2e2e38;
    border-radius: 3px;
    overflow: hidden;
}
.year-progress-fill {
    height: 100%;
    transition: width 0.08s linear;
}

/* Floating stat popups */
@keyframes floatUpFade {
    0% { opacity: 0; transform: translateY(6px) scale(0.92); }
    15% { opacity: 1; transform: translateY(0px) scale(1); }
    80% { opacity: 1; transform: translateY(-18px) scale(1); }
    100% { opacity: 0; transform: translateY(-28px) scale(0.95); }
}
#floating-layer { z-index: 100; }
.floating-delta {
    position: fixed;
    max-width: min(360px, calc(100vw - 24px));
    max-height: calc(100dvh - 58px);
    overflow-y: auto;
    overflow-wrap: anywhere;
    pointer-events: none;
    animation: floatUpFade 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.notification-dot { flex-shrink: 0; margin-top: .4em; }
.notification-text { min-width: 0; }

/* Milestone warm border pulse */
@keyframes milestonePulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); border-color: #fbbf24; }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); border-color: #f59e0b; }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); border-color: #2e2e38; }
}
.milestone-flash {
    animation: milestonePulse 1.1s ease-out;
}

/* Dilemma urgent pulse */
@keyframes dilemmaBorderPulse {
    0%, 100% { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.18); }
    50% { border-color: #fbbf24; box-shadow: 0 0 20px rgba(251, 191, 36, 0.35); }
}
.dilemma-pulse {
    animation: dilemmaBorderPulse 2s infinite ease-in-out;
}

/* Fixed composition, proportional display and native household navigation. */
.diorama-viewport {
    position: relative;
    width: 100%;
    max-width: var(--diorama-max-width, 480px);
    margin-inline: auto;
}
.diorama-scene {
    display: block;
    width: 100%;
    aspect-ratio: var(--diorama-ratio, 2.5);
    position: relative;
    isolation: isolate;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #716653 #cbb99f;
    text-align: left;
    padding: 0;
    border: 0;
    background: #cbb99f;
    cursor: pointer;
}
.diorama-scene:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: -2px;
}
.diorama-canvas {
    display: block;
    max-width: none;
    pointer-events: none;
}
.diorama-scene[data-diorama-status="error"]::after {
    content: attr(data-error);
    position: absolute;
    inset: 35% 12px auto;
    color: #242022;
    font: 11px/1.5 Inter, sans-serif;
    text-align: center;
}
.diorama-time-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.diorama-time-day { background: #10b981; }
.diorama-time-evening { background: #f59e0b; }
.diorama-time-night { background: #60a5fa; }

/* Subtle screen shake for major events */
@keyframes microShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, -1px); }
}
.screen-shake {
    animation: microShake 0.24s ease-in-out;
}

/* Explicit hidden state takes precedence over utility and button display rules. */
[hidden] { display: none !important; }

/* Keep all three panels reachable on small screens and at browser zoom. */
#app-main, #app-main > *, #header-controls { min-width: 0; }
#app-main { min-height: 0; }
#app-header { height: auto; min-height: 3.5rem; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
#header-controls { flex-wrap: wrap; max-width: 100%; }
/* Let the header wrap before squeezing four labels and percentages together. */
#character-stats { flex: 1 0 36rem; max-width: 100%; }
#character-stats > button > div:first-child { gap: .5rem; }
#character-stats > button > div:first-child > span { flex-shrink: 0; white-space: nowrap; }
#app-header > div:first-child { min-width: 0; max-width: 100%; }
#app-header > div:first-child > .leading-tight { min-width: 0; }
#app-header > div:first-child > .leading-tight > div { flex-wrap: wrap; }
@media (max-width: 1023px) {
    body#app-body { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
    #app-header > div:first-child { min-width: 0; max-width: 100%; }
    #app-header > div:first-child > .leading-tight { min-width: 0; flex: 1; }
    #app-header > div:first-child > .leading-tight > div { flex-wrap: wrap; }
    #header-controls { width: 100%; justify-content: space-between; gap: .4rem; }
    #character-stats { order: 3; flex-basis: 100%; max-width: none; padding: .5rem 0; border: 0; gap: .6rem 1rem; }
    #app-main { display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: 'news' 'journal' 'controls' 'character'; overflow: visible; flex: none; }
    #app-main > aside, #app-main > section { height: auto; overflow: visible; }
    #right-sidebar { display: contents; }
    #world-news { grid-area: news; }
    #life-journal { grid-area: journal; }
    #right-gameplay { grid-area: controls; }
    #character-sidebar { grid-area: character; }
    #journal-feed { min-height: 12rem; max-height: 45dvh; flex: none; }
    #app-main > aside > .overflow-y-auto { overflow: visible; }
    #birth-modal, #death-modal { overflow-y: auto; align-items: flex-start; }
    #birth-modal > div, #death-modal > div { margin: auto; flex-shrink: 0; min-width: 0; }
}

@media (min-width: 640px) and (max-width: 1023px) {
    #character-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


#hdr-year, #hdr-season, #hdr-age { white-space: nowrap; flex-shrink: 0; }
.country-flag {
    display: inline-block;
    width: 1.4em;
    height: 1.05em;
    object-fit: contain;
    vertical-align: -0.12em;
    flex-shrink: 0;
    border-radius: 2px;
}
.country-flag-large { width: 64px; height: 48px; }
.household-figures > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.household-figures dt { color: #8b8b99; }
.household-figures dd { margin: 0; overflow-wrap: anywhere; }
.occupation-result { min-width: 0; overflow-wrap: anywhere; }
.occupation-search { width: 100%; }

/* Occupation names must remain readable in narrow birth cards. */
.birth-stats-grid > div { min-width: 0; overflow-wrap: anywhere; }
.birth-parent-job { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.birth-identity-name { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

.savings-controls { display: flex; flex: 1 1 150px; min-width: 0; align-items: center; gap: 6px; }
.savings-controls input { flex: 1; width: 100%; min-width: 0; }
.savings-action { min-width: 0; overflow-wrap: anywhere; }
.budget-choice-grid { display: grid; gap: .5rem; }
.budget-choice-grid label { display: grid; gap: .2rem; min-width: 0; }
.budget-choice-grid select { width: 100%; min-width: 0; padding: .4rem; background: #121215; color: #f1f1f4; border: 1px solid #3a3a45; border-radius: 4px; }
.budget-choice-grid select:disabled { opacity: .55; }
.budget-details dl > div { align-items: baseline; }
.budget-details dt { flex: 1 1 10rem; overflow-wrap: anywhere; }
.budget-details dd { margin-left: auto; white-space: nowrap; }

/* Financial disclosures share a clear hierarchy while keeping native keyboard controls. */
#household-card [hidden] { display: none !important; }
.finance-section, .finance-subsection {
    min-width: 0;
    border: 1px solid #34343f;
    border-radius: 7px;
    background: #19191f;
}
.finance-section > summary, .finance-subsection > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #d7d7df;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    list-style: none;
    cursor: pointer;
    overflow-wrap: anywhere;
    transition: background-color .15s, color .15s;
}
.finance-section > summary::-webkit-details-marker, .finance-subsection > summary::-webkit-details-marker { display: none; }
.finance-section > summary::after, .finance-subsection > summary::after {
    content: '';
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin-right: 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s;
}
.finance-section > summary:hover, .finance-subsection > summary:hover { background: #24242d; color: #fbbf24; }
.finance-section[open], .finance-subsection[open] { border-color: #62502d; }
.finance-section[open] > summary, .finance-subsection[open] > summary {
    color: #fbbf24;
    background: #282319;
    border-bottom: 1px solid #443a28;
    border-radius: 6px 6px 0 0;
}
.finance-section[open] > summary::after, .finance-subsection[open] > summary::after { transform: rotate(45deg); }
.finance-section > :not(summary), .finance-subsection > :not(summary) { margin: 10px 10px 12px; }
.finance-subsection { background: #17171c; }
.finance-subsection > summary { min-height: 38px; }
#household-card .finance-ledger > * + * { margin-top: 0; }
.finance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 12px;
    padding: 8px;
    border-bottom: 1px solid #2b2b35;
    font-size: 11px;
    line-height: 1.5;
}
.finance-row:nth-child(odd) { background: #ffffff03; }
.finance-row dt { min-width: 0; color: #b2b2c0; overflow-wrap: anywhere; }
.finance-row dd { margin: 0; color: #ededf3; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.finance-row:last-child { border-bottom: 0; }
#household-card .finance-total {
    margin-top: 8px;
    padding: 10px 8px;
    border-top: 1px solid #62502d;
    border-bottom: 0;
    border-radius: 4px;
    background: #f59e0b0d;
    font-weight: 600;
}
.finance-total dt { color: #ededf3; }
.finance-total dd { color: #fbbf24; font-size: 12px; }
#financial-forecast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#financial-forecast .finance-row { grid-column: 1 / -1; }
.finance-metric { min-width: 0; padding: 10px; border: 1px solid #35353f; border-radius: 5px; background: #131318; }
.finance-metric dt { min-height: 3em; color: #b2b2c0; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.finance-metric dd { margin: 8px 0 0; font: 600 15px/1.4 'JetBrains Mono', monospace; overflow-wrap: anywhere; }
.finance-row .finance-credit, .finance-metric .finance-credit { color: #34d399; }
.finance-row .finance-negative, .finance-metric .finance-negative { color: #fb7185; }
#financial-warning.finance-notice { padding: 10px; border: 1px solid #383842; border-radius: 5px; color: #b2b2c0; background: #202027; font-size: 11px; line-height: 1.6; }
#financial-warning.finance-notice-danger { border-color: #75404a; color: #fda4af; background: #fb71850a; }

/* Links use the same compact badge treatment throughout the guide and finances. */
.reference-link, .guide-references a, #household-card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid #574525;
    border-radius: 4px;
    background: #17171c;
    color: #fbbf24;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.reference-link:hover:not(:disabled), .guide-references a:hover, #household-card button:hover:not(:disabled) { border-color: #f59e0b; background: #2b2418; color: #fde68a; text-decoration: none; }
.reference-link:focus-visible, .guide-references a:focus-visible, #household-card button:focus-visible,
.finance-section > summary:focus-visible, .finance-subsection > summary:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.reference-link[hidden] { display: none !important; }
.reference-link:disabled, #household-card button:disabled { opacity: .4; cursor: not-allowed; }
.journal-tag { letter-spacing: .02em; }

/* Player guide stays separate from the live dashboard. */
.guide-shell { max-height: 90dvh; min-height: 0; }
#guide-content { min-height: 0; user-select: text; overflow-wrap: anywhere; }
.guide-question { border-bottom: 1px solid #2e2e38; padding: .75rem 0; }
.guide-question summary { color: #f1f1f4; cursor: pointer; font-weight: 600; }
.guide-question p { color: #a0a0af; margin: .75rem 0; white-space: pre-line; }
.guide-references { color: #a0a0af; margin-top: 1rem; font-size: .75rem; }
.guide-references, #financial-tax-sources { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.guide-references > p { flex-basis: 100%; }
#household-actions button { white-space: normal; }

/* Life priorities use the same two-column rhythm as the action tabs. */
.priority-tile { min-width: 0; min-height: 42px; line-height: 1.35; }
.priority-tile > span:first-child { overflow-wrap: anywhere; }
.priority-status { flex-shrink: 0; }

.market-shell { width: min(1120px, 100%); max-height: 92dvh; display: flex; flex-direction: column; background: #17171c; font-size: 12px; }
.market-header { padding: 1rem; border-bottom: 1px solid #3a3a45; display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.market-body { overflow-y: auto; min-height: 0; padding: 1rem; display: grid; gap: .85rem; }
.market-columns { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 1rem; }
.market-catalog, .market-detail { min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.market-filters, .market-orders { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
.market-shell input:not([type=range]), .market-shell select { width: 100%; min-width: 0; padding: .45rem; background: #121215; color: #f1f1f4; border: 1px solid #3a3a45; border-radius: 4px; }
.market-shell input[type=range] { width: 100%; accent-color: #f59e0b; }
#market-list { max-height: 560px; overflow-y: auto; display: grid; gap: .35rem; align-content: start; }
.market-asset { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem; border: 1px solid #2e2e38; background: #202026; border-radius: 4px; text-align: left; }
.market-asset > span { min-width: 0; }
.market-asset > span:last-child { flex-shrink: 0; text-align: right; }
.market-asset strong, .market-asset small { display: block; overflow-wrap: anywhere; }
.market-asset small { font-size: 10px; color: #a0a0b0; }
.market-asset.is-selected, [data-market-period][aria-pressed=true] { border-color: #f59e0b; color: #fbbf24; }
#market-chart { width: 100%; background: #121215; border: 1px solid #2e2e38; border-radius: 4px; }
#market-chart svg { width: 100%; display: block; touch-action: pan-y; }
.market-panel { min-width: 0; padding: .75rem; background: #202026; border: 1px solid #2e2e38; border-radius: 4px; }
.market-panel[hidden] { display: none; }
.market-orders form { display: flex; flex-direction: column; gap: .45rem; }
.market-orders button:disabled { opacity: .4; }
.market-orders p { min-height: 2rem; overflow-wrap: anywhere; }
.market-holding { width: 100%; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: .5rem; text-align: left; border-bottom: 1px solid #3a3a45; padding: .6rem 0; }
.market-holding > * { min-width: 0; overflow-wrap: anywhere; }
@media(max-width: 760px) {
    .market-columns { grid-template-columns: minmax(0,1fr); }
    #market-list { max-height: 170px; }
    .market-header, .market-body { padding: .75rem; }
    .market-holding { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width: 440px) { .market-orders { grid-template-columns: minmax(0,1fr); } }

/* News cards share one preview and one detail level in both list sizes. */
#right-sidebar { scrollbar-gutter: stable; }
.news-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.news-section-heading h2 { color: #fbbf24; font: 700 11px/1.4 'JetBrains Mono', monospace; text-transform: uppercase; }
#news-home-country { min-width: 0; max-width: 48%; color: #b4b4bf; font-size: 10px; text-align: right; overflow-wrap: anywhere; }
.news-viewport { max-height: min(26rem,45dvh); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding: 0 4px; margin: 0 -4px; }
.news-viewport[data-expanded="true"][data-empty="false"] { height: min(26rem,45dvh); }
.news-viewport:focus-visible, .news-card h3:focus { outline: 2px solid #fbbf24; outline-offset: -2px; border-radius: 2px; }
#world-news [data-world-list] { list-style: none; padding: 0; margin: 0; }
.news-card { min-width: 0; padding: 8px 0 8px 8px; border-left: 2px solid #363641; border-bottom: 1px solid #2b2b33; overflow-wrap: anywhere; }
.news-card + .news-card { margin-top: 6px; }
.news-card[data-world-priority="0"] { border-left-color: #b58736; }
.news-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.news-card-heading h3 { min-width: 0; margin: 0; color: #e7e7eb; font-size: 11px; font-weight: 700; line-height: 1.4; }
.news-status { flex: none; color: #9696a3; font-size: 10px; }
.news-location { margin-top: 2px; color: #a4a4af; font-size: 10px; line-height: 1.4; }
.news-card [data-world-description] { margin: 5px 0; color: #c4c4cd; font-size: 11px; line-height: 1.45; }
.news-card [data-world-impacts] { display: flex; flex-wrap: wrap; gap: 3px 10px; list-style: none; margin: 0; padding: 0; color: #b7b7c3; font-size: 10px; line-height: 1.5; }
.news-card [data-world-impacts] span { color: #d8d8df; }
.news-recorded { color: #90909c; }
.news-card-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 24px; gap: 6px; margin-top: 1px; color: #90909c; font-size: 10px; line-height: 1.4; cursor: pointer; list-style: none; }
.news-card-details > summary::-webkit-details-marker { display: none; }
.news-dates { display: grid; gap: 2px; min-width: 0; }
.news-details-label { flex: none; color: #d5bb83; }
.news-details-label::after { content: ' ▾'; }
.news-card-details[open] .news-details-label::after { content: ' ▴'; }
.news-card-details > summary:focus-visible, #world-news summary:focus-visible { outline: 2px solid #fbbf24; outline-offset: 3px; border-radius: 2px; }
.news-card-deep { padding-top: 8px; font-size: 10px; line-height: 1.5; color: #aaaab7; }
.news-card-deep section + section, .news-exposure { margin-top: 9px; }
.news-card-deep h4 { color: #d1d1db; font-weight: 600; margin: 0 0 4px; }
.news-card-deep [data-world-numbers] { margin: 0; }
.news-card-deep [data-world-numbers] > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 2px 0; }
.news-card-deep dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.news-card-deep [data-world-history] { list-style: none; padding: 0; margin: 0; }
.news-card-deep [data-world-history] li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; }
.news-card-deep [data-world-countries] { list-style: none; padding: 0; margin: 0; }
.news-card-deep [data-world-countries] li { display: inline; }
.news-card-deep [data-world-countries] li:not(:last-child)::after { content: ', '; }
.news-card-deep [data-world-observations] { padding-left: 13px; margin: 0; }
.news-expand { padding: 6px 0; font-size: 10px; color: #d5bb83; cursor: pointer; }
.news-tools { padding: 5px 0 9px; font-size: 10px; }
.news-tools [data-world-views] { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.news-tools button { min-height: 24px; padding: 4px 7px; font-size: 10px; }
.news-tools > details > summary { min-height: 24px; padding: 4px 0; }
.news-tools button[aria-pressed="true"] { color: #fbbf24; border-color: #65502c; }
.news-tools [data-world-filter-fields] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 7px 0; }
.news-tools label { min-width: 0; }
.news-tools input, .news-tools select { width: 100%; min-width: 0; padding: 5px; background: #121215; border: 1px solid #363641; border-radius: 3px; }
.news-tools [data-world-count], #world-news [data-world-empty] { color: #90909c; font-size: 10px; margin: 6px 0 0; }
#world-news [data-world-more] { margin-top: 8px; padding: 5px 8px; font-size: 10px; }

/* One information popup, outside clipping/stacking contexts of the header. */
.stat-gauge { min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: default; }
.stat-gauge:focus-visible, .timeline-node:focus-visible, .timeline-expectancy:focus-visible { outline: 2px solid #fbbf24; outline-offset: 4px; border-radius: 3px; }
#context-tooltip { position: fixed; z-index: 110; padding: 11px 12px; border: 1px solid #65502c; border-radius: 6px; background: #202026; box-shadow: 0 8px 28px #0008; color: #dddde5; font-size: 11px; line-height: 1.6; overflow-y: auto; overflow-wrap: anywhere; cursor: default; }
#context-tooltip strong { color: #fbbf24; font-size: 12px; }
#context-tooltip p { margin: 5px 0 0; }
.timeline-track { padding: 12px 0; }
#lifespan-track { overflow: visible; }
#timeline-markers { height: 28px; top: -12px; }
.timeline-node, .timeline-expectancy { position: absolute; top: 0; width: 24px; height: 28px; transform: translateX(-50%); border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.timeline-node { z-index: 2; cursor: pointer; }
.timeline-node span { min-width: 10px; height: 12px; padding: 0 2px; border-radius: 8px; border: 1px solid #121215; background: #fbbf24; color: #121215; font: 700 9px/11px monospace; }
.timeline-expectancy { cursor: default; z-index: 1; }
.timeline-expectancy::after { content: ''; width: 2px; height: 15px; background: #f43f5e; }
#timeline-detail { max-height: 12rem; overflow-y: auto; margin-top: 8px; padding: 8px; border: 1px solid #65502c; border-radius: 5px; font-size: 11px; line-height: 1.5; background: #202026; }
#timeline-detail button { display: block; margin-top: 5px; max-width: 100%; }
.journal-highlight { outline: 2px solid #f59e0b; outline-offset: 5px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { #journal-feed { scroll-behavior: auto; } }
