/* Short, purposeful feedback. All motion has a static equivalent. */
:root { --ease-game:cubic-bezier(.2,.75,.25,1); }
button { touch-action:manipulation; }
.btn,.icon-btn,.nav-btn,.operation-task,.map-tools button,.choice,.project-card,.metric { transition:background-color .15s,border-color .15s,box-shadow .15s,transform .15s var(--ease-game); }
.btn:not(:disabled):active,.icon-btn:not(:disabled):active,.operation-task:active,.map-tools button:not(:disabled):active { transform:translateY(1px); }
.btn-primary { box-shadow:inset 0 1px 0 #ffffff36,0 2px 0 #192b2526; }
.btn-primary:hover:not(:disabled) { box-shadow:inset 0 1px 0 #ffffff60,0 3px 12px #b4955535; }
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible { outline:2px solid #bc8b3f; outline-offset:3px; }
.world-shell button:focus-visible { outline-color:#f2d18c; }
.project-card:hover { border-color:#9b925f; box-shadow:0 3px 13px #313e2810; }
.screen-enter { animation:screen-arrival .19s var(--ease-game) both; }
@keyframes screen-arrival { from{opacity:.45;transform:translateY(4px)}to{opacity:1;transform:none} }
.modal-backdrop { animation:backdrop-arrival .14s ease-out both; }
.modal { animation:decision-arrival .18s var(--ease-game) both; overscroll-behavior:contain; scrollbar-width:thin; }
.modal-head { position:sticky; top:0; background:#f6f3e7; z-index:2; padding-bottom:15px; border-bottom:1px solid #d8d3bf; }
.modal-actions { position:sticky; bottom:0; background:#f6f3e7; z-index:2; flex-wrap:wrap; box-shadow:0 -5px 15px #f6f3e7bb; }
.modal-actions .btn { min-height:40px; }
@keyframes backdrop-arrival { from{opacity:0}to{opacity:1} }
@keyframes decision-arrival { from{opacity:.5;transform:translateY(6px) scale(.99)}to{opacity:1;transform:none} }
.interaction-spark { position:fixed; width:26px; height:26px; margin:-13px; border:1px solid #d2b577; border-radius:50%; z-index:250; pointer-events:none; animation:click-spark .4s ease-out both; }
@keyframes click-spark { from{opacity:.7;transform:scale(.25)}to{opacity:0;transform:scale(1.8)} }
.theater-map .map-land { transition:fill .2s ease-out,stroke .18s; }
.theater-map .map-node { cursor:pointer; }
.theater-map .map-node:hover>circle:not(.halo) { stroke:#fff2cb; stroke-width:2.5; }
.theater-map .map-node.selected>circle:not(.halo) { filter:drop-shadow(0 0 5px #e2bd6d75); }
.theater-map[data-network=research] .map-route.bright { stroke-dasharray:3 12; animation-duration:18s; }
.campus-art path[stroke="#e4b862"] { animation:campus-link 9s linear infinite; }
@keyframes campus-link { to{stroke-dashoffset:-36} }
.week-arrived .date { animation:date-confirm .65s ease-out; }
.week-arrived .theater-map:before { content:''; position:absolute; inset:42px 0 37px; z-index:1; border:1px solid #d9c08a; opacity:0; pointer-events:none; animation:map-confirm .65s ease-out; }
.week-arrived .operation-task>i em { transform-origin:left; animation:progress-confirm .55s var(--ease-game); }
@keyframes map-confirm { from{opacity:.6;box-shadow:inset 0 0 30px #e3c27d20}to{opacity:0;box-shadow:inset 0 0 0 transparent} }
@keyframes date-confirm { from{color:#e0bc75;text-shadow:0 0 12px #d8b37466}to{text-shadow:none} }
@keyframes progress-confirm { from{opacity:.35}to{opacity:1} }
.metric { position:relative; }
.metric.value-up { animation:metric-up .9s ease-out; }
.metric.value-down { animation:metric-down .9s ease-out; }
.metric-change { position:absolute; right:9px; top:14px; color:#84c4ac; font-size:13px; animation:indicator-rise 1.5s ease-out both; pointer-events:none; }
.value-down .metric-change { color:#e6b180; }
@keyframes metric-up { from{box-shadow:inset 0 -3px #7dc8aa;background-color:#71a98a30}to{box-shadow:inset 0 0 transparent} }
@keyframes metric-down { from{box-shadow:inset 0 -3px #d2a47a;background-color:#c48d5e20}to{box-shadow:inset 0 0 transparent} }
@keyframes indicator-rise { 0%{opacity:0;transform:translateY(8px)}20%,60%{opacity:1}100%{opacity:0;transform:translateY(-6px)} }
.starter-path { display:flex; gap:5px; list-style:none; margin:0; padding:11px 12px; background:#102230; border-bottom:1px solid #3e5360; }
.starter-path li { flex:1; display:flex; align-items:center; gap:4px; color:#98afb9; min-width:0; }
.starter-path li+li:before { content:'›'; font-size:11px; color:#6c8491; margin-right:1px; }
.starter-path li>span { display:inline-grid; place-items:center; border:1px solid #536d79; width:17px; height:17px; font-size:10px; flex-shrink:0; }
.starter-path small { font-size:10px; line-height:1.35; }
.starter-path .current { color:#f5d28c; }
.starter-path .current>span { border-color:#d5b477; background:#544b35; }
.starter-path .done { color:#9ecab8; }
.starter-path .done>span { color:#a9d5be; border-color:#557d70; }
.map-mission:has(.starter-path) { width:300px; }
.turn-receipt { padding:4px 9px!important; max-width:55%!important; border:1px solid #5b6f72!important; background:#243a4555!important; white-space:nowrap; }
.world-news .turn-receipt span { font-size:10px; overflow:hidden; text-overflow:ellipsis; }
.world-news .turn-receipt small { color:#cbd4cb; font-size:10px; }
.world-news .turn-receipt.breakthrough { border-color:#c8a667!important; background:#66513255!important; animation:breakthrough-arrival .7s ease-out; }
.world-news:has(.turn-receipt) button:last-child { display:none; }
@keyframes breakthrough-arrival { from{box-shadow:0 0 16px #e4c27d77;transform:translateY(3px)}to{box-shadow:0 0 0 transparent;transform:none} }
.turn-result-button { margin-left:12px; white-space:nowrap; background:transparent; border:1px solid #adb8a0; color:#485e49; padding:6px 9px; font:inherit; font-size:11px; }
.world-shell .turn-result-button { color:#dfc38e; border-color:#63736e; background:#263d4555; }
.turn-status { min-width:0; }
.toast.visible { pointer-events:auto; }
.toast-action { display:inline-block; margin-left:12px; padding:5px 8px; border:1px solid #bdb890; background:#ffffff10; color:#f5dfab; font:inherit; font-size:11px; }
.experience-settings { padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid #cec8b3; }
.experience-options { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; margin:12px 0; }
.experience-options label { display:flex; flex-direction:column; gap:6px; font-size:12px; }
.experience-options select { min-height:38px; }
.experience-options .btn { min-height:38px; }
.experience-options [aria-pressed=true] { background:#dce7d9; border-color:#6b906d; }
.receipt-hero { padding:16px 18px; background:#e5e8dc; border-left:3px solid #73856b; margin-bottom:16px; }
.receipt-hero.milestone { background:#eee3c9; border-left-color:#b18b45; }
.receipt-hero small { color:#6e795e; font-size:11px; }
.receipt-hero h3 { margin:5px 0; font-size:23px; letter-spacing:-.7px; }
.receipt-hero p { margin:0; font-size:13px; }
.receipt-stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.receipt-stats>div { border:1px solid #c7c8b4; padding:12px; display:flex; flex-direction:column; gap:6px; }
.receipt-stats small { font-size:11px; color:#67745f; }
.receipt-stats strong { font-size:21px; font-family:ui-monospace,monospace; letter-spacing:-.6px; }
.receipt-changes { margin:18px 0; padding:0; list-style:none; }
.receipt-changes li { padding:10px 0; border-bottom:1px solid #d6d2c0; font-size:12px; line-height:1.7; }
.receipt-changes b { display:inline-block; margin-right:9px; color:#6e7452; font-size:10px; }
.receipt-next { font-size:12px; line-height:1.8; padding:12px 15px; border:1px solid #c1c6b0; }
.receipt-next strong { display:block; color:#496449; font-size:11px; margin-bottom:4px; }
.game-glossary { margin:0; }
.game-glossary>div { padding:12px 0; border-bottom:1px solid #d6d2c0; }
.game-glossary dt { font-weight:700; font-size:14px; margin-bottom:6px; }
.game-glossary dd { margin:0; font-size:13px; line-height:1.8; color:#58634e; }
html[data-reading=large] .beginner-guide>p,html[data-reading=large] .map-mission .beginner-guide>p,html[data-reading=large] .helper,html[data-reading=large] .modal-intro,html[data-reading=large] .choice p,html[data-reading=large] .game-glossary dd,html[data-reading=large] .coach-card>p { font-size:14px; line-height:1.85; }
html[data-reading=large] .operation-task>small,html[data-reading=large] .metric-note { font-size:11px; }
html[data-reading=large] .map-mission:has(.starter-path) { width:320px; }
@media(max-width:1230px) { .map-mission:has(.starter-path),html[data-reading=large] .map-mission:has(.starter-path) { width:268px; }.starter-path { padding-inline:9px;gap:3px; }.starter-path small{font-size:10px}.starter-path li+li:before{display:none}.turn-status .turn-detail{display:none} }
@media(max-width:820px) { .turnbar .save-hint { display:none; }.turn-result-button{font-size:10px;padding:5px;margin-left:6px}.world-news .turn-receipt{max-width:100%!important;}.world-news:has(.turn-receipt) button:not(.turn-receipt){display:none} }
@media(max-width:580px) { .map-mission:has(.starter-path),html[data-reading=large] .map-mission:has(.starter-path) { width:auto; }.starter-path small { font-size:10px; }.starter-path { padding:12px;gap:6px; }.starter-path li>span { width:19px;height:19px;font-size:10px; }.turn-result-button{font-size:10px;}.turn-status>div{min-width:0}.turn-status strong{font-size:10px}.turnbar:has(.turn-result-button){gap:6px}.turnbar:has(.turn-result-button) .turn-status{flex-basis:100%;justify-content:space-between}.turnbar:has(.turn-result-button) .turn-actions{width:100%;justify-content:flex-end}.content[data-page=world]{padding-bottom:130px}.toast{bottom:135px}.toast-action{margin:7px 0 0;display:block}.modal-actions .btn { min-height:44px; }.map-tools button { height:36px;min-width:36px; }.world-news:has(.turn-receipt){gap:8px}.world-news .turn-receipt{width:100%;justify-content:space-between;flex-wrap:wrap;text-align:left}.receipt-stats strong { font-size:18px; }.experience-options label{flex:1;min-width:125px}.map-mission .guide-actions .btn { min-height:42px; } }
html[data-motion=reduced] *,html[data-motion=reduced] *:before,html[data-motion=reduced] *:after { animation:none!important;transition:none!important;scroll-behavior:auto!important; }
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { animation:none!important;transition:none!important;scroll-behavior:auto!important; } }
.modal-head h2 { color:#29392e; }
.modal-head .eyebrow { color:#687559; }
.modal-head .icon-btn { color:#4c5c48; background:#efeddf; border-color:#a4ac96; }
body:has(.modal-backdrop) .toast:not(.error):not(.over) { opacity:0; pointer-events:none; }
.metric.value-new { animation:metric-up .9s ease-out; }
.operation-task[data-urgency=soon] { box-shadow:inset 0 3px #df9e73; background:#49352966; }
.operation-task[data-urgency=soon]>span b { color:#f4bc8e; }
.milestone-arrived .org-avatar { animation:milestone-seal 1.1s ease-out; }
@keyframes milestone-seal { 0%{box-shadow:0 0 0 0 #e1bd7e77;border-color:#f2d393}75%{box-shadow:0 0 0 12px #e1bd7e00}100%{box-shadow:0 0 0 0 transparent} }
.turn-status>div { overflow:hidden; }
.turn-status strong { max-width:450px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; vertical-align:middle; }
@media(max-width:580px) { .turn-status strong { max-width:220px; }.turnbar:has(.turn-result-button) .turn-status>div { max-width:calc(100vw - 130px); } }
body:has(.modal-backdrop) .coach-resume { display:none; }
.toast:not(.visible),body:has(.modal-backdrop) .toast:not(.error):not(.over) { visibility:hidden; }
/* Above the coach layer (160) and dialogs; on phones it moves clear of a dialog's action buttons. */
.toast { z-index:170; }
@media(max-width:580px) { body:has(.modal-backdrop) .toast { top:12px; bottom:auto; } }
.observation-progress { padding:22px; border:1px solid #b8c4ac; background:#e8ebdd; color:#415d46; }.observation-progress>strong { display:block; font-size:17px; font-weight:500; }.observation-progress progress { width:100%; height:13px; margin:19px 0 8px; accent-color:#658674; }.observation-progress p { margin:9px 0 0; font-size:12px; line-height:1.8; color:#738268; }

/* One stack for this week's notices: the open one keeps its own layout, the rest fold to a single line. */
.notice-stack { display: grid; gap: 6px; margin-bottom: 18px; }
.notice-stack > .notice-open > * { margin-bottom: 0; }
.notice-fold { border: 1px solid #d8d2bf; border-radius: 2px; background: #f7f3e8; }
.notice-fold > summary { cursor: pointer; padding: 7px 12px; font-size: 13px; font-weight: 600; color: #3d4a40; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 32px; }
.notice-fold > summary::-webkit-details-marker { display: none; }
.notice-fold > summary::before { content: '▸'; color: #6b7a62; }
.notice-fold[open] > summary::before { content: '▾'; }
.notice-fold[open] > summary { border-bottom: 1px solid #e3dccb; }
.notice-fold > :not(summary) { margin: 10px 12px 12px; }
.notice-fold > summary:focus-visible { outline: 2px solid var(--mint, #386451); outline-offset: 2px; }

/* Accessibility floor: focus is never hidden under the sticky header or turn bar, rings keep 4.5:1 on light cards, and no text drops below 10px. */
html { scroll-padding-top: calc(var(--topbar-h, 127px) + 12px); scroll-padding-bottom: calc(var(--turnbar-h, 67px) + 12px); }
.coach-target { scroll-margin-block: 24px; }
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible { outline:2px solid #386451; outline-offset:3px; }
.world-shell :is(.sidebar,.topbar,.turnbar,.world-command) :is(button,summary,a,select):focus-visible { outline-color:#f2d18c; }
.world-shell :is(.turn-result,.feature-lesson,.atlas-dossier[open],.selected-region) :is(button,summary,a,select):focus-visible { outline-color:#386451; }
.world-reports .turn-result { color:#29352e; }
.company-barometer .metric-note,.nav-new,.starter-path li>span { font-size:10px; }
.nav-index,.topbar .org-context,.barometer-caption,.company-barometer .metric-label,.nav-locked small,.coach-card>small,.starter-path small,.world-news .turn-receipt small,.discovery-footnote,.tmap-legend>span:last-child,.tmap-era small,.tmap-era>span,.tmap-lane small,.tmap-inspector-actions .tmap-footnote,.brand-note { font-size:10px; }
.tmap-legend>span:last-child { opacity:1; }
@media(min-width:581px) and (max-width:1040px) { .nav-btn span,.sidebar-bottom .sidebar-button span { display:inline; } }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
/* Narrow tables scroll sideways instead of breaking numbers mid-value. */
.table-scroll td { overflow-wrap:normal; }
.table-scroll td.num,.table-scroll td.mono,.data-table td:has(> .mono) { white-space:nowrap; }
@media(max-width:580px) { .modal .table-scroll .data-table { min-width:0; } }
.table-scroll { position:relative; }
@media(pointer:coarse) { input[type=range] { min-height:24px; } .timeline-detail,.barometer-more,.coach-card button,.notice-fold>summary { min-height:44px; } }
@media(max-width:580px),(max-height:600px) { .topbar { position:static; } }

/* Two-tone focus ring: a cream inner ring plus a coloured outline stays visible on both the light cards and the dark world/sidebar panels. */
:is(button,a,summary,select,input,textarea,[tabindex]):focus-visible { outline-offset:2px; box-shadow:0 0 0 2px #fbf6e8; }
:is(.sidebar,.coach-resume,.theater-sidebar,.world-command,.atlas-dossier,.selected-region,.industry-art,.tmap-open) :is(button,a,summary,select,input):focus-visible,.sidebar .brand:focus-visible,.org-avatar:focus-visible { outline-color:#f2d18c; box-shadow:0 0 0 2px #13241c; }

/* Small text keeps at least 4.5:1 on the light panels; the dark world screen keeps its own lighter tones. */
.data-table th { color:#5b6149; }
.event-date { color:#58614b; }
.filter { color:#545b48; }
:not(.world-shell)>.workspace .save-hint,.turn-detail { color:#555c4a; }
.section-navigation>span { color:#4d5641; }
.selected-region .subtle { color:#c5d3d8; }
/* The coach resume chip sits above the turn bar; keep focused controls clear of it too. */
html { scroll-padding-bottom:calc(var(--turnbar-h, 67px) + 64px); }
/* Touch targets on phones. */
@media(pointer:coarse),(max-width:580px) { [data-action=agi-help],[data-action=guide-help],.menu-notice-actions button,.locked-navigation summary,.fold-panel>summary,.notice-fold>summary { min-height:44px; min-width:44px; } }
/* Wide market table on tablets scrolls instead of breaking names and week counts. */
@media(max-width:1040px) { .exchange-table,.market-table { min-width:760px; } .table-scroll td,.table-scroll th { white-space:nowrap; } }
/* Sidebar menu names stay on one line even with NEW and count badges. */
.nav-btn>span:not(.nav-count) { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
