:root {
  color-scheme: dark;
  --bg: #0d191e; --surface: #14252b; --raised: #1a3036; --edge: #365057;
  --gold: #f0c382; --cream: #fff0d8; --ink: #eef4f3; --muted: #b5c8c9; --aqua: #a1e1d9;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
a { color: var(--aqua); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .55rem .95rem; border: 1px solid #526b6e; border-radius: 5px; color: var(--ink); background: var(--raised); font-size: .91rem; font-weight: 650; line-height: 1.3; cursor: pointer; text-decoration: none; }
button:hover, .button-link:hover { background: #264147; border-color: #86a4a5; }
.primary, .search button { background: var(--gold); color: #292015; border-color: var(--gold); }
.primary:hover, .search button:hover { background: #ffda9f; border-color: #ffda9f; }
button:disabled { opacity: .65; cursor: progress; }
.text-button { background: transparent; color: var(--aqua); border-color: transparent; padding-inline: .45rem; }
.text-button:hover { border-color: transparent; }
:focus-visible { outline: 3px solid #9af2e4; outline-offset: 3px; }
#main:focus, #player-title:focus:not(:focus-visible) { outline: none; }
.skip { position: fixed; top: -80px; left: 12px; z-index: 4; padding: .65rem 1rem; background: var(--surface); }.skip:focus { top: 8px; }
.mast { background: #101e24; border-bottom: 1px solid #435451; }
.mast-inner, main { width: min(1192px, calc(100% - 64px)); margin-inline: auto; }
.mast-inner { min-height: 75px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--cream); font: 600 1.2rem/1.15 Georgia, serif; text-decoration: none; }
.brand img { border: 1px solid #74624a; border-radius: 8px; }
.guide-link { margin-left: auto; color: var(--muted); font-size: .9rem; text-decoration: none; }
.guide-link:hover { color: var(--cream); text-decoration: underline; }
#identity { display: flex; align-items: center; gap: .75rem; padding-left: 1.1rem; border-left: 1px solid var(--edge); }
#identity-name { font-size: .9rem; overflow-wrap: anywhere; }
main { margin-block: clamp(24px,4vw,54px) 64px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { color: var(--cream); font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.1; }
h1 { font-size: clamp(2.2rem, 4.3vw, 3.8rem); letter-spacing: -.038em; }
h2 { font-size: clamp(1.55rem, 2.2vw, 2.05rem); letter-spacing: -.025em; }
h3 { font-size: 1.13rem; font-weight: 650; }
.sub, .fine, .help p, .entry-body > p { color: var(--muted); }
.sub { margin-top: .42rem; max-width: 67ch; }
.fine { font-size: .87rem; }
.context { color: var(--gold); font-size: .79rem; font-weight: 700; letter-spacing: .04em; }
.entry { display: grid; grid-template-columns: 1fr 1fr; margin: clamp(34px, 8vh, 88px) auto; max-width: 1056px; overflow: hidden; border: 1px solid #52605a; border-radius: 12px; background: var(--surface); }
.scene { position: relative; min-height: 472px; isolation: isolate; display: flex; align-items: end; padding: clamp(24px,3.8vw,54px); color: white; }
.scene img, .scene::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene img { z-index: -2; object-fit: cover; object-position: 56% 50%; }
.scene::before { content: ""; background: linear-gradient(180deg,transparent 25%,rgba(11,20,21,.25) 51%,#101a1e 100%); z-index: -1; }
.scene h1 { font-size: clamp(2.6rem,4.4vw,4.3rem); }
.scene p { margin-top: .6rem; color: #f4e5ce; }
.entry-body { display: flex; flex-direction: column; align-items: start; justify-content: center; padding: clamp(25px,4.45vw,65px); }
.passkey-mark { width: 45px; height: 45px; margin-bottom: 18px; display: grid; place-items: center; border: 1px solid #536866; border-radius: 10px; background: #213538; position: relative; font-size: 0; }
.passkey-mark::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--gold); border-radius: 50%; position: absolute; left: 10px; top: 13px; }
.passkey-mark::after { content: ""; width: 15px; height: 7px; border-top: 2px solid var(--gold); border-right: 3px solid var(--gold); position: absolute; left: 20px; top: 18px; transform: rotate(25deg); transform-origin: left top; }
.entry-body h2 { font-size: clamp(1.8rem,2.5vw,2.4rem); }
.entry-body > p { margin-top: .7rem; }
.entry-body .context { color: var(--gold); }
.wide { width: 100%; margin-top: 1.5rem; min-height: 46px; }
.help { width: 100%; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--edge); }
summary { cursor: pointer; color: var(--aqua); font-size: .94rem; font-weight: 650; }
.help p { font-size: .9rem; margin-top: .75rem; }
#normal-signin { margin-top: 1rem; }
.workspace-head { margin-bottom: 1.2rem; }
.main-nav, .work-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.main-nav { border-bottom: 1px solid var(--edge); margin-bottom: 1.6rem; }
.main-nav button, .work-nav button { border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.main-nav button { padding: .7rem 1rem; border-bottom: 3px solid transparent; min-height: 46px; }
.main-nav button[aria-pressed=true] { color: var(--gold); border-color: var(--gold); }
.main-nav button:hover, .work-nav button:hover { background: var(--raised); }
.desk { display: grid; grid-template-columns: minmax(270px,.9fr) minmax(0,2fr); gap: 20px; align-items: start; }
.panel, dialog { border: 1px solid var(--edge); border-radius: 9px; background: var(--surface); padding: clamp(18px,2.4vw,32px); min-width: 0; }
.panel-head, .profile-head, .backup-box, .actions, .filter-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.panel-head { margin-bottom: 1.15rem; }
.player-panel { min-height: 315px; }
.directory { padding: 20px; }
.directory .panel-head { margin-bottom: .7rem; }
label { display: block; color: var(--muted); font-size: .9rem; font-weight: 600; }
input:not([type=checkbox]), select { display: block; width: 100%; min-width: 0; border: 1px solid #566e73; border-radius: 5px; min-height: 44px; padding: .53rem .7rem; background: #0e1d22; color: var(--ink); margin-top: 4px; }
input::placeholder { color: #9cb0b3; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--gold); }
.input-row { display: flex; gap: .45rem; margin-top: 4px; }
.input-row input { flex: 1; margin: 0; }
.filter-bar { padding: .75rem 0; color: var(--muted); font-size: .8rem; }
.filter-bar label { display: flex; align-items: center; min-height: 31px; gap: .4rem; font-weight: 400; }
.directory-list, .records, .ledger { list-style: none; padding: 0; margin: 0; overflow-wrap: anywhere; }
.directory-list { max-height: 55vh; overflow-y: auto; }
.directory-list li + li, .records li + li, .ledger li + li { border-top: 1px solid var(--edge); }
.row-button { width: 100%; text-align: left; justify-content: space-between; gap: .75rem; border: 1px solid transparent; background: transparent; padding: .8rem .65rem; }
.row-button[aria-current=true] { border-color: #6d827e; background: #263d41; }
.row-button small, .ledger small, .records small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: .15rem; }
.row-button .chevron { color: var(--aqua); font-size: 1.1rem; }
.badge { display: inline-flex; align-items: center; gap: .32rem; border-radius: 20px; background: #24383e; color: #c8d7d7; white-space: nowrap; padding: .2rem .56rem; font-size: .76rem; font-weight: 600; }
.badge.good { color: #bbf2d9; background: #1d433a; }
.badge.warm { color: #ffdb9e; background: #443924; }
.empty-workspace { min-height: 255px; display: grid; align-content: center; justify-items: start; max-width: 52ch; margin: auto; }
.empty-workspace p { margin-top: .65rem; color: var(--muted); }
.satchel { display: block; width: 50px; height: 50px; background: #e8d3ac url('/recipe-satchel.webp') center/76% auto no-repeat; border-radius: 10px; margin-bottom: 16px; }
.back { display: none; }
.profile-head { align-items: start; }
.profile-head h2 { overflow-wrap: anywhere; }
#player-meta { margin-top: .45rem; }
.work-nav { margin: 1.25rem 0; padding: 4px; background: #0d1c21; border: 1px solid var(--edge); border-radius: 6px; width: fit-content; }
.work-nav button { min-height: 36px; border-radius: 3px; padding: .4rem .8rem; }
.work-nav button[aria-pressed=true] { background: #30474a; color: var(--cream); }
.search { margin-block: 1rem; }
.directory .search { margin: 0; }
#saved-count { margin-block: .5rem; }
#snapshots { max-height: 55vh; overflow-y: auto; }
#live-inventory .records > li, .fold li { padding: .65rem 0; }
.blank { color: var(--muted); margin-block: .6rem; padding: .75rem; background: #102027; border-radius: 5px; font-size: .9rem; }
.ledger { margin-top: 1.1rem; }
.ledger > li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem 0; flex-wrap: wrap; }
.ledger .actions { justify-content: flex-end; flex-wrap: wrap; }
.compact-select { max-width: 260px; }
.backup-box { margin-top: 1.2rem; padding-top: 1.3rem; border-top: 1px solid #647069; flex-wrap: wrap; }
.notice:not(:empty) { border-inline-start: 3px solid var(--aqua); padding: .7rem .9rem; background: #1b353a; color: var(--ink); margin-block: 1rem; overflow-wrap: anywhere; }
.notice[data-error=true]:not(:empty) { background: #3a3027; border-color: var(--gold); }
.notice:empty { display: none; }
dialog { color: var(--ink); width: min(560px,calc(100% - 22px)); max-height: calc(100dvh - 26px); overflow: auto; box-shadow: 0 18px 70px #06101488; }
dialog::backdrop { background: #060e14d9; }
dialog p + label, dialog select + label, dialog form h3 { margin-top: 1rem; }
dialog form .primary, dialog > .primary, #invite-output .actions { margin-top: 1rem; }
dialog .actions { justify-content: start; flex-wrap: wrap; }
dialog .fine { margin: .55rem 0; }
.fold { border-block-start: 1px solid var(--edge); padding: .7rem 0; }
.fold:last-of-type { border-block-end: 1px solid var(--edge); }
#snapshot-facts p { margin-block: .5rem; }
#snapshot-facts { margin-bottom: .85rem; }
dl { margin: 1rem 0; }
dl > div { display: grid; grid-template-columns: minmax(85px,.7fr) 1.6fr; gap: .65rem; border-top: 1px solid var(--edge); padding: .6rem 0; }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
@media(max-width: 760px) {
  .mast-inner, main { width: calc(100% - 32px); }
  .mast-inner { min-height: 62px; flex-wrap: wrap; gap: .6rem; padding-block: .5rem; }
  #identity { margin-left: auto; padding: 0; border: 0; flex-wrap: wrap; gap: .3rem; }
  body.signed-in .guide-link { display: none; }
  .entry { grid-template-columns: 1fr; max-width: 480px; margin: 1.25rem auto; }
  .scene { min-height: 190px; padding: 24px; }
  .scene img { object-position: 50% 43%; }
  .scene-caption p { font-size: .9rem; margin-top: .3rem; }
  .entry-body { padding: 25px; }
  .passkey-mark { display: none; }
  .desk { grid-template-columns: minmax(0,1fr); }
  .desk:not(.selected) .player-panel, .desk.selected .directory { display: none; }
  .back { display: inline-flex; margin: -.5rem 0 .6rem -.45rem; }
  .directory-list, #snapshots { max-height: none; }
  .main-nav { margin-bottom: 1rem; }
  .main-nav button { padding-inline: .7rem; }
  .entry-body .help { margin-top: 1rem; }
  .brand { font-size: 1.03rem; gap: 8px; } .brand img { width: 35px; height: 35px; }
  .work-nav { width: 100%; gap: .1rem; } .work-nav button { flex: 1; padding-inline: .35rem; }
  .panel-head { flex-wrap: wrap; }
}
@media(max-width: 420px) {
  .signed-in .mast-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 .5rem; padding-block: .6rem; }
  .signed-in .brand { grid-column: 1; grid-row: 1; }
  #identity { display: contents; }
  #identity-name { grid-column: 1; grid-row: 2; padding-left: 43px; color: var(--muted); font-size: .79rem; }
  #logout { grid-column: 2; grid-row: 1 / span 2; }
  .directory, .panel, dialog { padding: 16px; }
  .entry-body { padding: 22px; }
  .input-row button { padding-inline: .65rem; }
}
