:root{--tour-paper:#fff4d6;--tour-ink:#102b43}
html[data-theme=night]{--paper:#123d4c;--tour-paper:#123d4c;--tour-ink:#fff0cf;color-scheme:dark}
html[data-theme=night] body{background:#082734;color:#fff0cf}
html[data-theme=night] .ocean{background:linear-gradient(#061d30,#103947 50%,#075167)}
html[data-theme=night] .cloud{opacity:.15}
html[data-theme=night] :is(.companion-card,.pace,.episode-entry,.arc-card,.character-card,.discovery-card,.journey-stat,.note-card,.rank-row,.dex-result,.portrait-card,.cast-spotlight,.account-dialog,.quiz-card,.stats,.departure,.route-bottom,.time-box,.card,.crew-slot,.rules,.identity,dialog){background:#123d4c;color:#fff0cf;border-color:#7499a4}
html[data-theme=night] :is(.small,.back,.steps button,.dashboard-tabs button,.quiz-level,.quiz-answer,.mode-switch button,.portrait-card button,.main-crew-link){color:#fff0cf}
html[data-theme=night] :is(.header-actions,.dex-search-bar,.logbook-backup){background:#0d3140;border-color:#456b79}
html[data-theme=night] :is(.header-actions>a.small,.harbour-tab,.dashboard-tabs button){background:#123d4c;color:#fff0cf;border-color:#7499a4}
html[data-theme=night] :is(.primary,.latest){background:#f6c548;color:#102b43;border-color:#061d30}
/* Give small controls a real target and keep ink paired with its surface. */
.episode-entry .latest{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 12px;border:1px solid #527a87;border-radius:6px;background:#e5f0e8;color:#153b50}
html[data-theme=night] .episode-entry .latest{background:#285765;color:#fff0cf;border-color:#7499a4}
html[data-theme=night] .mode-switch button{background:#123d4c;color:#fff0cf;border-color:#7499a4}
html[data-theme=night] .mode-switch button.selected{background:#f6c548;color:#102b43;border-color:#f6c548}
html[data-theme=night] .luffy-welcome{background:#fff0d5;color:#102b43}
html[data-theme=night] .badge{background:#285765;color:#fff0cf;border-color:#7499a4}
html[data-theme=night] .badge.basic{background:#594630;color:#fff0cf}
html[data-theme=night] #latest-status{color:#bdd3d6}
html[data-theme=night] :is(.account-note,.sync-status){background:#123d4c;color:#bdd3d6;border-color:#7499a4}
html[data-theme=night] :is(.map,.number){color:#102b43}
html[data-theme=night] footer{color:#bdd3d6}
html[data-theme=night] .crew-slot .crew-points{color:#fff0cf}
.crew-score-help{margin:8px 0 20px;font-size:13px;line-height:1.6;max-width:650px}
.crew-score-help summary{cursor:pointer;text-decoration:underline;text-underline-offset:3px;padding:8px 0;font-weight:700}
.crew-score-help summary:focus-visible{outline:3px solid #e99022;outline-offset:4px}
.crew-score-help p{margin:8px 0}
html[data-theme=night] :is(.fine,.meta,.episode-meta,.account-note,#episode-hint){color:#bdd3d6}
html[data-theme=night] :is(.eyebrow,h1 em,.score){color:#ffc478;text-shadow:none}
html[data-theme=night] :is(input,select,textarea){background:#092d3d;color:#fff0cf;border-color:#7499a4}
html[data-theme=night] #current{color:#fff0cf;border-color:#adc7c8}
html[data-theme=night] .hero-art{background-image:linear-gradient(90deg,#082734f5 0%,#082734dd 35%,#08273418 75%),url('/assets/crew-voyage.png')}
html[data-theme=night] #step-0{background:#082734;border-color:#7499a4}
html[data-theme=night] :is(.dashboard-tabs button.selected,.quiz-level.selected,.pace.selected){background:#285765;color:#fff0cf}
html[data-theme=night] .spin-reel{background:repeating-linear-gradient(0deg,#123d4c 0 24px,#345d67 24px 26px);color:#ffc478}
.tour-dialog{width:min(490px,calc(100vw - 28px));max-height:85vh;overflow:auto;padding:28px;border:2px solid #809a9f;border-radius:16px;background:var(--tour-paper);color:var(--tour-ink);box-shadow:0 20px 90px #00192380;font:15px/1.6 'DM Sans',system-ui}
.tour-dialog h2{font:32px Bangers,Impact,system-ui;margin:8px 0 14px;letter-spacing:1px}.tour-dialog p{margin:12px 0}.tour-dialog::backdrop{background:#031c2d88}.tour-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;margin-top:22px}.tour-dialog .back{color:inherit}.tour-progress{font-size:11px;font-weight:800;letter-spacing:2px}.tour-highlight{outline:4px solid #ffc748!important;outline-offset:5px;box-shadow:0 0 0 8px #ffc74855!important;border-radius:8px}.tour-launch{white-space:nowrap}html[data-theme=night] .tour-dialog{background:var(--tour-paper);color:var(--tour-ink)}
@media(max-width:600px){.tour-dialog{padding:22px}.tour-actions button{flex:1}.header-actions{justify-content:flex-end}}
@media(prefers-reduced-motion:no-preference){.tour-dialog[open]{animation:tour-appear .18s ease-out}@keyframes tour-appear{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}}

html[data-theme=night] #report{background:#092d3d!important;color:#fff0cf!important}
/* One consistent navigation surface, with secondary controls in Tools. */
header .header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px;margin-left:auto;border:1px solid #284e6240;border-radius:14px;background:#e7f2ee}
header .header-actions> :is(a,button),header .header-tools>summary{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:10px 14px;margin:0;border:0;border-radius:9px;background:transparent;color:#153b50;font:700 12px/1.25 'DM Sans',system-ui;text-decoration:none;white-space:nowrap;box-shadow:none;cursor:pointer}
header .header-actions> :is(a,button):hover,header .header-tools>summary:hover,header .header-tools[open]>summary{background:#cce2e4}
header .header-actions>#account-link{background:#153b50;color:#fff5d9}
header .header-tools{position:relative}.header-tools summary{list-style:none}.header-tools summary::-webkit-details-marker{display:none}.header-tools summary::after{content:'⌄';margin-left:8px}
.header-tools-menu{position:absolute;right:0;top:calc(100% + 10px);width:200px;padding:7px;z-index:90;background:#edf5ed;color:#153b50;border:1px solid #71929b;border-radius:12px;box-shadow:0 12px 32px #102b4330}
header .header-tools-menu button{display:block;width:100%;text-align:left;padding:12px;border:0;border-radius:7px;background:transparent;color:inherit;font:700 12px 'DM Sans',system-ui}.header-tools-menu button:hover{background:#cce2e4}
html[data-theme=night] header .header-actions{background:#0d3140;border-color:#456b79}html[data-theme=night] header .header-actions> :is(a,button),html[data-theme=night] header .header-tools>summary{background:transparent;color:#f5eacf;border:0}html[data-theme=night] header .header-actions>#account-link{background:#f6c548;color:#102b43}html[data-theme=night] header .header-actions> :is(a,button):hover,html[data-theme=night] header .header-tools[open]>summary{background:#285765}html[data-theme=night] .header-tools-menu{background:#123d4c;color:#f5eacf}html[data-theme=night] .header-tools-menu button{color:#f5eacf}html[data-theme=night] .header-tools-menu button:hover{background:#285765}
.guided-tour{position:fixed;inset:auto 24px 24px auto;margin:0;width:min(420px,calc(100vw - 32px));padding:24px}.guided-tour::backdrop{background:#031c2d30}.guided-tour h2{font-size:28px}.username-dialog input{display:block;width:100%;margin-top:8px;padding:12px;border:1px solid #71929b;border-radius:8px;font:inherit}.username-dialog label{font-weight:700}.username-dialog #username-help{font-size:12px}.username-dialog [role=status]{color:#ad3227;min-height:1em}html[data-theme=night] .username-dialog [role=status]{color:#ffb4a4}
@media(max-width:700px){header .header-actions{width:auto;max-width:100%;justify-content:flex-end}header .header-actions> :is(a,button),header .header-tools>summary{padding:9px 11px;font-size:11px}.guided-tour{right:16px;bottom:16px;max-height:55vh}header{flex-wrap:wrap}}
header .header-actions>a.small{min-height:40px;padding:10px 14px;border:0;border-radius:9px;background:transparent;color:#153b50;font:700 12px/1.25 'DM Sans',system-ui;box-shadow:none}header .header-actions>a.small:hover{background:#cce2e4}html[data-theme=night] header .header-actions>a.small{background:transparent;color:#f5eacf;border:0}html[data-theme=night] header .header-actions>a.small:hover{background:#285765}
@media(max-width:600px){header .header-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:5px}header .header-actions> :is(a,button),header .header-tools>summary{width:100%;min-height:44px;font-size:12px}header .header-tools-menu{width:min(250px,calc(100vw - 40px))}}
