/* YH shared space. World-specific materials belong to hero records only. */
:root {
 color-scheme: light;
 --desk: #e7e7df; --paper: #f4f3eb; --field: #fffef8;
 --ink: #232d2c; --muted: #626b65; --line: #cfD2c7;
 --accent: #a34431; --rail: 0px; --header: 88px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 15px/1.8 'Malgun Gothic',system-ui,sans-serif; }
button,input,textarea,select { font: inherit; }
button { min-height: 44px; padding: 10px 17px; border: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); cursor: pointer; line-height: 1.45; transition: background .16s,border-color .16s,color .16s; }
button:hover { background: color-mix(in srgb,var(--accent) 7%,transparent); border-color: var(--accent); }
button.primary,#battle-start:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff9ef; font-weight: 700; }
button:disabled { opacity: .4; cursor: default; }
button.secondary,.chapter-link { border-color: transparent; color: var(--muted); }
input,textarea,select { width: 100%; min-width: 0; min-height: 46px; padding: 12px 14px; background: var(--field); color: var(--ink); border: 1px solid var(--line); border-radius: 0; }
input::placeholder,textarea::placeholder { color: #7c837d; }
input:focus,textarea:focus,select:focus { border-color: var(--accent); }
textarea { min-height: 130px; line-height: 1.9; resize: vertical; }
input[type=checkbox] { width: 18px!important; height: 18px; min-height: 18px; accent-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 600; margin: 22px 0 8px; }
h1,h2,h3,h4,h5,p { margin: 0; }
h1,h2,h3,h4,h5 { line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
h2 { font-size: 30px; letter-spacing: -.045em; }
h3 { font-size: 23px; letter-spacing: -.03em; }
a { color: var(--accent); text-underline-offset: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.hidden,[hidden],.flow-ready .flow-inactive,.flow-legacy { display: none!important; }
.muted,.record-note { color: var(--muted); font-size: 12px; line-height: 1.85; }
.eyebrow,.chapter-label { font: 10px/1.6 system-ui,sans-serif; letter-spacing: .17em; color: var(--accent); margin-bottom: 15px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2.05; }
.prose:empty { display: none; }
pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.85 ui-monospace,monospace; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 12px; }
details { margin-top: 12px; }
details[open]>summary { color: var(--ink); }

/* Locations open from the hall. Navigation is a pocket map, not a fixed rail. */
.studio-header {
 --ink: #e9ece2; --muted: #a4b0a4; --line: #46544b; --accent: #e5ac88; --field: #14261c;
 position: relative; z-index: 30; width: 100%; min-height: var(--header);
 display: flex; align-items: center; gap: 18px;
 padding: 18px clamp(20px,4vw,60px); background: #16282d; color: var(--ink);
 border-bottom: 1px solid #9aab9233; overflow: visible;
}
.brand-lockup { display: flex; align-items: center; gap: 14px; padding: 0; margin-right:auto; }
.brand-mark { display: grid; place-items: center; width: 55px; height: 52px; border-left: 3px solid #e5ac88; color: #f3eadd; font: italic 35px/1 Georgia,serif; letter-spacing: -.12em; }
.brand { font: 9px/1.6 system-ui,sans-serif; letter-spacing: .22em; color: #acb8ab; }
.studio-header h1 { font: 500 19px/1.5 'Malgun Gothic',sans-serif; letter-spacing: -.055em; color: #f3f0e5; margin-top: 4px; }
.studio-header>a { display:none; }
.studio-header>button { text-align: left; font-size: 12px; border-color: transparent; }
#guild-open { order: 1; padding: 10px 12px; }
#guild-open:before {content:'←';margin-right:8px;color:#c7b48c}
#flow-account-button { order: 4; margin: 0; padding: 10px 12px; }
.studio-header>.bgm-player { order: 5; margin: 0; position: static; }
.studio-header>.bgm-player>summary { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 12px 0; color: var(--muted); font-size: 12px; }
.studio-header .bgm-controls { position: absolute; left: auto; right: 20px; top: calc(100% + 6px); bottom: auto; width: min(320px,calc(100vw - 32px)); }
#flow-place-menu {order:2;margin:0;position:relative}
#flow-place-menu>summary {padding:10px 12px;color:#d4d9c9;list-style:none;gap:12px}
#flow-place-menu>summary:after {content:'⌄';color:#c7b48c}
#flow-place-menu[open]>summary:after {content:'⌃'}
#flow-place-menu:not([open])>.book-tabs {display:none}
.book-tabs { position:absolute;right:0;top:100%;display:grid;gap:0;width:200px;margin:8px 0 0;padding:10px;background:#182e32;border:1px solid #80918a;box-shadow:0 18px 35px #0006; }
.book-tabs button { position:relative;display:block;min-height:48px;padding:12px 18px;border:0;border-left:2px solid transparent;color:#b9c7bd;font-size:13px;text-align:left;background:transparent; }
.book-tabs button:before { content:none; }
.book-tabs button[aria-selected=true] { border-left-color: #e5ac88; color: #fff4e4; background: #314038; }
.book-tabs button[aria-selected=true]:before { color: #e5ac88; }
.studio-header>.access-card { position: absolute; z-index: 50; top: calc(100% + 6px); right: 20px; width: min(460px,calc(100vw - 40px)); padding: 22px 25px; background: #25352d; border: 1px solid #617064; max-height: calc(100dvh - 100px); overflow: auto; box-shadow: 0 18px 55px #0005; color-scheme: dark; }
.studio-header>.access-card:not(:has(details[open])) { display: none; }
.access-fields { display: block; }

/* Shared work surface: no page spread, gilt frame, or global world theme. */
.book { width: auto; min-width: 0; margin: 0 0 0 var(--rail); padding: 0 clamp(24px,3.5vw,60px) 40px; min-height: 100dvh; background: var(--desk); }
.book:before,.book:after { display: none!important; }
.book-content { max-width: 1440px; margin: auto; min-width: 0; }
.running-head { min-height: 126px; padding: 28px 0 24px; border-bottom: 1px solid #bdc4b8; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 25px; align-items: center; }
.running-head>.eyebrow { display: block; grid-column: 1; margin: 0; font-size: 9px; color: #737d70; }
.running-head h2 { grid-column: 1; grid-row: 2; font-size: clamp(23px,2.4vw,35px); font-weight: 500; letter-spacing: -.06em; color: #26382d; }
.running-head #flow-current-help { grid-column: 1; grid-row: 3; font-size: 12px; color: #687466; }
.flow-job-status { grid-column: 2; grid-row: 1 / 4; max-width: 235px; padding-left: 20px; border-left: 1px solid #bdc4b8; color: #64705f; font-size: 10px; text-align: right; overflow-wrap: anywhere; }
.book-spread,.hero-dashboard { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); min-width: 0; align-items: start; }
.book-page,.book-page:first-child,.book-page:last-child { min-width: 0; min-height: 0; padding: 36px; }
/* Creation is one authoring surface, rather than another illustrated spread. */
body[data-flow-stage=create][data-studio-space=book] .workspace-heading{display:none}
#flow-create{display:block;max-width:920px;margin:0 auto;padding:34px 0 28px}
.creation-heading{padding-bottom:26px;border-bottom:1px solid var(--line)}
.creation-heading>p{font-size:12px;color:var(--muted);margin:0 0 6px}
.creation-heading h2{font-size:clamp(29px,3.5vw,43px);font-weight:500;line-height:1.4;letter-spacing:-.06em;margin:0}
.creation-draft{padding-top:24px}
.creation-origin{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,.7fr);gap:12px 30px;align-items:center;padding:0 0 26px;border-bottom:1px solid var(--line)}
.creation-origin label{margin:0 0 8px;font-size:12px}
.creation-origin select{background:transparent;border:0;border-bottom:1px solid var(--ink);padding:12px 0;font-size:19px}
.creation-origin #world-help{grid-column:1/-1;font-size:11px;line-height:1.9;margin:4px 0 0;max-width:660px}
.creation-record-medium{font-size:12px;line-height:1.8;color:var(--muted);border-left:1px solid var(--line);padding-left:24px;margin:0;overflow-wrap:anywhere}
.creation-record-medium:not([data-medium=unselected]){color:#37584d}
.creation-field{margin-top:32px}
.creation-label{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:10px}
.creation-label label{font-size:13px;font-weight:500;margin:0}
.creation-label output{font:11px/1.5 ui-monospace,monospace;color:var(--muted);white-space:nowrap}
.creation-name input{padding:8px 0 14px;border:0;border-bottom:1px solid var(--line);background:transparent;font-size:28px;line-height:1.5;letter-spacing:-.04em}
.creation-name input::placeholder{font-size:18px;font-weight:400;letter-spacing:0;color:#8b9189}
.creation-field textarea{padding:16px 18px;border:0;border-left:2px solid #bcc7b8;background:#fffef880;min-height:170px;line-height:2}
.creation-field textarea:focus{outline:1px solid #7a8e75;outline-offset:2px;background:#fffef8}
.creation-settings textarea{min-height:300px}
.creation-field [aria-invalid=true]{border-color:#a34431}
.creation-field .prompt-help{font-size:12px;line-height:1.8;color:#963f2f}
.creation-finish{margin-top:32px;padding-top:22px;border-top:1px solid var(--line)}
.creation-finish .aside-intro{font-size:12px;line-height:1.8;margin:0;color:var(--muted)}
.creation-finish .actions{margin-top:20px;align-items:center;gap:15px}
.creation-finish .actions button{font-size:14px;padding:13px 24px}
#creation-status-slot>.flow-job-status{max-width:none;grid-column:auto;grid-row:auto;padding:18px 0 0;border:0;font-size:13px;line-height:1.8;text-align:left;color:var(--ink);margin:0}
.manuscript-page { background: #f8f8f0; border-top: 3px solid #566a53; }
.aside-title { font-size: 21px; margin-bottom: 12px; }
.aside-intro { display: block; font-size: 13px; line-height: 1.9; color: var(--muted); margin-bottom: 22px; }
#create-form>.muted { margin-top: 10px; font-size: 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions button { font-size: 12px; flex: 0 1 auto; }
.section-head,.card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-bottom: 20px; }
.card-note,.badge { color: var(--muted); font-size: 11px; }
#flow-hero,#combat-panel { grid-template-columns: minmax(0,.92fr) minmax(0,1fr); }
#flow-hero>.illustration-page,#combat-panel>.battle-identity { position: sticky; top: 24px; padding: 0; min-height: 0; background: #202d29; border-right: 1px solid var(--line); }
.hero-portrait,.battle-portrait { height: calc(100dvh - 50px); min-height: 480px; max-height: 1000px; position: relative; display: grid; place-items: center; background: #202d29; overflow: hidden; margin: 0; }

.candidate-image{display:block;max-width:100%;max-height:720px;width:auto;height:auto;object-fit:contain;margin:20px auto}
.hero-portrait>.candidate-image,.battle-portrait>.candidate-image{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;margin:0}
.art-empty{display:grid;place-content:center;text-align:center;gap:14px;padding:36px;color:var(--muted);width:100%;height:100%}
.art-empty strong{font-size:15px;font-weight:400}.art-empty p{font-size:12px}.portrait-monogram{font:54px/1.4 Georgia,serif;color:var(--accent);letter-spacing:.12em}
.hero-record,.hero-record.card{padding:0 0 30px;margin:0 0 36px;border:0;border-bottom:1px solid var(--line);background:transparent}
.hero-record>.eyebrow{font-size:9px;color:var(--accent)}
.hero-record h2,.battle-identity-copy h3{font-size:clamp(32px,3.7vw,57px);font-weight:500;line-height:1.2;letter-spacing:-.055em}
#flow-hero-description{display:none}#flow-world-label{font-size:11px;color:var(--accent);margin:14px 0 22px}
.hero-record .prose,.battle-introduction{font:15px/1.95 'Malgun Gothic',sans-serif;color:var(--muted)}
.hero-record .actions button{padding:10px 16px;font-size:12px}.hero-record .actions .primary{background:var(--accent);color:var(--on-accent,#fffaf1)}
#account-image-history{margin-top:15px}#account-image-history button{font-size:10px;min-height:40px;padding:6px 9px;color:var(--muted)}
.chapter-story{padding:0;margin:0;border:0;background:transparent}.chapter-story>.eyebrow{font-size:9px;margin-bottom:12px;color:var(--muted)}
.chapter-story h2,.chapter-story h3{font-size:24px;line-height:1.55;margin-bottom:28px;font-weight:500;letter-spacing:-.045em}
.reading-page .prose{font:16px/2.1 'Malgun Gothic',sans-serif;color:var(--ink)}.reading-page .prose:not(:empty):first-letter{font-size:inherit}
.roster-pane{padding:16px 22px 24px;margin:0;border:0;background:#f4f3eb}.roster-pane h3{font-size:16px}.roster-pane>.eyebrow{display:none}
.roster-pane>.muted{font-size:11px;margin-top:8px}.list{display:grid;gap:0;margin-top:15px}
.saved{text-align:left;padding:13px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;font-size:12px;color:var(--ink);overflow-wrap:anywhere}
.saved:hover{padding-left:8px;background:#ffffff05}.saved:focus-visible{outline-offset:-2px}
.book-traits,.book-skills{margin-top:34px;padding-top:26px;border-top:1px solid var(--line)}
.book-traits h3,.book-skills h3{font-size:16px;margin-bottom:15px}.book-traits h4{font-size:11px;color:var(--muted);margin-top:12px}.book-traits p{font-size:13px;margin-top:4px}
.book-skills ol{list-style:none;padding:0;counter-reset:skill}.book-skills li{counter-increment:skill;position:relative;padding:20px 0 20px 35px;border-bottom:1px solid var(--line);font-size:12px;line-height:1.9}
.book-skills li:before{content:counter(skill,decimal-leading-zero);position:absolute;left:0;top:23px;font:10px ui-monospace,monospace;color:var(--accent)}
.book-skills strong{display:block;font-size:18px;font-weight:500;margin-bottom:9px;color:var(--ink)}
.book-notes{padding:28px 0;border-top:1px solid var(--line);background:#f0f0e7}.book-notes h2{font-size:18px}.book-notes .actions{margin-top:15px}.book-notes .actions button{font-size:11px}
.book-notes>p{margin-top:12px}.evidence-fold{margin-top:22px;border-top:1px solid var(--line)}.evidence-fold pre{max-height:420px;overflow:auto;padding:12px 0}
.battle-identity-copy{margin-bottom:30px;padding-bottom:25px;border-bottom:1px solid var(--line)}.battle-identity-copy>.eyebrow{font-size:9px;margin-bottom:12px}
.battle-identity-copy .battle-introduction{margin-top:18px}.battle-identity-copy button{margin-top:15px;min-height:36px;font-size:11px;padding:7px 12px}
.battle-loadout h3{font-size:23px}.battle-loadout .section-head{display:block}.battle-loadout #combat-count{font-size:11px;color:var(--accent);margin-top:10px}
.selected-loadout{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0 18px;padding:0;border:0}.loadout-slot{flex:1 1 90px;min-height:62px;padding:10px 11px;border-top:2px solid var(--line);background:#f5f4ec;color:var(--muted);font-size:11px;overflow-wrap:anywhere}
.loadout-slot b{display:block;font:9px ui-monospace,monospace;color:var(--muted);margin-bottom:7px}.loadout-slot.filled{border-color:var(--accent);color:var(--ink)}
.core-opponent-portrait{display:block;width:100%;height:200px;object-fit:contain;margin:18px auto}
.core-loadouts fieldset{margin:26px 0;padding:0;border:0;min-width:0}.core-loadouts legend{width:100%;padding:0 0 13px;border-bottom:1px solid var(--line);color:var(--muted);font-size:12px}
.core-skill-option{display:grid;grid-template-columns:18px minmax(0,1fr);column-gap:12px;row-gap:8px;align-items:start;margin:0;padding:18px 0;border-bottom:1px solid var(--line);cursor:pointer}
.core-skill-option input{grid-column:1;grid-row:1;margin:5px 0 0}.core-skill-option strong{grid-column:2;font-size:18px;line-height:1.6;font-weight:500}.core-skill-option span{grid-column:2;font-size:12px;line-height:1.95;font-weight:400;color:var(--muted)}.core-skill-option:has(input:checked) strong{color:var(--accent)}
/* The practice room owns its composition, outside the record-reading desk. */
body[data-flow-stage=battle][data-studio-space=book] {--ink:#e6e3d6;--muted:#a0b0ac;--line:#74807855;--accent:#d2b67d;--field:#13262a;background:#101f25;color:var(--ink);color-scheme:dark}
body[data-flow-stage=battle][data-studio-space=book] .book {background:transparent;padding:0 clamp(16px,4vw,64px) 40px}
body[data-flow-stage=battle][data-studio-space=book] .book-content {max-width:1400px}
body[data-flow-stage=battle]:has(#combat-panel.core-duel-stage) .workspace-heading {display:none}
#combat-panel.core-duel-stage {display:block;margin:0;border:0;background:transparent;box-shadow:none}
#combat-panel.core-duel-stage>.battle-loadout {display:block;padding:0!important;background:transparent;border:0}
#core-battle-panel {margin:0;padding:0;border:0;position:relative}
.duel-heading {display:flex;justify-content:space-between;align-items:center;gap:18px;padding:28px 0 10px}
.duel-heading>div>p {font-size:10px;letter-spacing:.13em;color:#92a29d;margin:0 0 5px}
.battle-loadout .duel-heading h2 {font:500 clamp(30px,4vw,46px)/1.3 Batang,serif;margin:0;letter-spacing:-.04em;color:#e3ddc6}
.duel-heading>button {padding:10px 16px;min-height:44px;border:1px solid #7b8b7c77;background:transparent;color:#d5d6bf;font-size:12px;white-space:nowrap}
#core-battle-panel>.duel-practice-note {font-size:11px;line-height:1.8;color:#9aa9a4;margin:0;max-width:75ch}
#core-battle-energy {position:absolute;right:0;top:108px;font-size:11px;color:#b4b8a3;margin:0}
.duel-arena {display:grid;grid-template-columns:minmax(0,1fr) 72px minmax(0,1fr);padding:38px 5% 20px;color:#ede7d8;position:relative;isolation:isolate;margin:18px -3% 0;min-height:480px}
.duel-scenery {position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden;background:radial-gradient(ellipse at 25% 55%,#38535633,transparent 35%),radial-gradient(ellipse at 75% 55%,#38535633,transparent 35%),#101f25}
.duel-scenery>canvas {display:block;width:100%;height:100%}
.duel-combatant {min-width:0;position:relative}
.duel-picker {min-width:0;margin:0 auto 18px;max-width:340px}
.duel-picker>label {font-size:9px;letter-spacing:.1em;color:#a9b4a8;margin:0 0 4px}
.duel-picker>select {width:100%;min-width:0;max-width:100%;min-height:44px;padding:8px 28px 8px 10px;border:1px solid #7d8e7c66;background:#0b1c25bb;color:#e1decc;font-size:13px}
.duel-seal {align-self:center;justify-self:center;display:grid;place-items:center;width:58px;height:58px;transform:rotate(45deg);border:1px solid #a99a7344;color:transparent;position:relative;font-size:0}
.duel-seal:before {content:'VS';color:#c9bb92;transform:rotate(-45deg);font:italic 20px/1 Georgia,serif}
#combat-panel .duel-arena .battle-identity {position:static;padding:0;background:transparent;border:0;min-width:0}
.duel-arena :is(.battle-portrait,.duel-second-portrait) {position:relative;display:flex;align-items:center;justify-content:center;height:clamp(250px,34vw,420px);min-height:0;border:0;background:transparent;margin:0}
.duel-arena :is(#flow-battle-image,.core-opponent-portrait) {position:static;width:100%;height:100%;max-height:none;object-fit:contain;margin:0;padding:0;filter:drop-shadow(0 15px 20px #0007)}
.duel-arena .core-opponent-portrait[hidden] {display:none}
.duel-portrait-empty {font-size:12px;color:#a4b2a7;text-align:center}
.duel-second-portrait:has(img:not([hidden]))>.duel-portrait-empty {display:none}
.duel-arena .battle-identity-copy,.duel-identity {margin:16px 0 0;padding:0;border:0;min-width:0;text-align:center}
.duel-arena .battle-identity-copy>.eyebrow {display:none}
.duel-arena :is(.battle-identity-copy,.duel-identity)>h3 {font:500 clamp(20px,2.2vw,30px)/1.55 Batang,serif;color:#f1eadc;overflow-wrap:anywhere;margin:0 0 2px}
.duel-profile {font-size:12px;line-height:1.9;color:#c8d0c7;margin:0}
.duel-profile>summary {cursor:pointer;min-height:40px;padding:4px 0;color:#a1b1aa;justify-content:center}
.duel-profile>p {margin:8px 0 0;padding:14px;text-align:left;font-size:13px;line-height:1.9;color:#e0e5dc;background:#0b1921cc;border-top:1px solid #80918a55}
.duel-profile button {background:transparent;border:1px solid #7a8b7d;color:#e0e5dc}
.core-loadouts {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 100px;padding:12px 2% 0}
.core-loadouts fieldset {margin:0;padding:0;border:0;min-width:0}
.core-loadouts legend {width:100%;font-size:11px;line-height:1.7;color:#8eaaa4;padding:14px 0;border-bottom:1px solid #9eab8a44}
.core-skill-row {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 14px;align-items:start;border-bottom:1px solid #9eab8a22}
.core-loadouts .core-skill-row>.core-skill-option {grid-template-columns:18px minmax(0,1fr);gap:10px;padding:12px 0;border:0;min-height:58px;margin:0;align-items:center}
.core-loadouts .core-skill-option input {width:16px;height:16px;accent-color:#c4ad7a;margin:0}
.core-loadouts .core-skill-option strong {font-size:18px;color:#83918a;font-weight:400}
.core-loadouts .core-skill-option:has(input:checked) strong {color:#e8dab9}
.core-skill-detail {margin:0;padding:7px 0}
.core-skill-detail>summary {min-height:44px;font-size:10px;color:#a7b1a5;white-space:nowrap}
.core-skill-detail>span {display:block;font-size:13px;line-height:1.9;color:#b8c4b9;padding:8px 0 14px;white-space:pre-line}
.core-skill-detail[open] {grid-column:1/-1;padding-top:0;margin-top:-6px}
.core-skill-detail[open]>summary {color:#dbc596}
.duel-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:12px;padding:28px 0 12px;margin-top:16px;border:0}
.duel-actions>button {min-height:50px;padding:12px 26px;font-size:13px;border-color:#87947a55;color:#a4b3a5}
.duel-actions>button:first-child {background:#d8c59b;color:#14262b;border:1px solid #e8d2a0;min-width:250px;font-weight:600;box-shadow:0 8px 35px #0004}
.duel-actions>button:disabled {opacity:.4}
#core-battle-panel>.duel-actions+p {text-align:center;font-size:12px;line-height:1.8;color:#a0b1a5;margin:8px 0 24px}
#combat-panel.core-duel-stage .chapter-link {display:none}
body[data-flow-stage=battle][data-studio-space=book] .studio-footer {color:#82988b;border-color:#9eab8a22}
@media(max-width:760px) {
 .duel-heading {padding-top:22px}.duel-heading>button {padding-inline:11px}
 #core-battle-energy {position:static;margin:10px 0 0;font-size:10px}
 .duel-arena {grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);padding:24px 0 20px;margin:4px -8px 0;min-height:0}
 .duel-picker>select {font-size:11px;padding-left:5px;padding-right:18px}
 .duel-seal {width:24px;height:24px}.duel-seal:before {font-size:12px}
 .duel-arena :is(.battle-portrait,.duel-second-portrait) {height:clamp(200px,45vw,340px)}
 .duel-arena :is(.battle-identity-copy,.duel-identity)>h3 {font-size:16px;line-height:1.6}
 .duel-profile>p {font-size:12px;padding:10px}.duel-profile>summary {font-size:10px}
 .core-loadouts {gap:0 28px;padding:0}.core-loadouts legend {font-size:10px}
 .core-skill-row {grid-template-columns:1fr;gap:0}
 .core-loadouts .core-skill-row>.core-skill-option {min-height:50px;padding:10px 0;gap:7px}
 .core-loadouts .core-skill-option strong {font-size:15px;line-height:1.6}
 .core-skill-detail {padding:0;margin:-3px 0 0 25px}
 .core-skill-detail>summary {min-height:32px;font-size:10px}
 .core-skill-detail[open] {margin-top:0}.core-skill-detail>span {font-size:12px}
 .duel-actions>button {flex:1 1 100%}.duel-actions>button:first-child {min-width:0}
}
.skill-fact{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;margin-top:8px;font-size:12px;line-height:1.9;overflow-wrap:anywhere}.skill-fact>b{font-size:10px;font-weight:500;color:var(--accent)}.skill-fact>span{color:var(--muted)}
.skills{display:block;counter-reset:skill}#combat-skills>label{position:relative;counter-increment:skill;margin:0;padding:20px 28px 18px 32px;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;font-size:0;cursor:pointer}
#combat-skills>label:before{content:counter(skill,decimal-leading-zero);position:absolute;left:0;top:25px;font:10px ui-monospace,monospace;color:var(--muted)}
#combat-skills>label>input{position:absolute;right:0;top:23px;margin:0}#combat-skills>label>pre{display:none}
.flow-skill-summary{display:block}.flow-skill-summary strong{display:block;font-size:18px;font-weight:500;line-height:1.65;overflow-wrap:anywhere}
.flow-skill-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:12px;line-height:1.9;font-weight:400;color:var(--muted);margin-top:8px;overflow-wrap:anywhere}
.skill-expanded .flow-skill-description{display:block}.flow-skill-more{display:block;min-height:36px;padding:5px 0;border:0;font-size:10px;color:var(--accent)}
.skill-selected-state{display:none;font-size:10px;color:var(--accent);font-weight:400}label:has(input:checked) .skill-selected-state{display:block}label:has(input:checked) .flow-skill-summary strong{color:var(--accent)}
.ownership-check{display:flex;gap:9px;align-items:flex-start;font-size:11px;line-height:1.9;margin-top:25px}.ownership-check input{flex:0 0 18px;margin-top:3px}.rule-note{font-size:11px!important;margin-top:15px}
.chapter-extra{border-top:1px solid var(--line);padding-top:26px;margin-top:30px}.chapter-extra h3{font-size:19px}.chapter-extra .muted{font-size:12px;margin:12px 0}
#battle-status,#combat-status,#battle-highlight-status,#direct-image-status{font-size:12px;color:var(--muted);margin-top:14px;overflow-wrap:anywhere}
.image-original-page h2{font-size:30px}.unfilled-plate{display:grid;place-content:center;min-height:380px;text-align:center;color:var(--muted);font-size:13px}.unfilled-plate>span{font:54px Georgia,serif;color:var(--accent);margin-bottom:20px}
.image-original-page:has(#direct-image-result:not(.hidden)) .unfilled-plate{display:none}#direct-image-prompt{min-height:240px}.prompt-help{font-size:11px;line-height:1.9;color:var(--muted);margin-top:12px}
.operator-budget{border-top:1px solid var(--line);margin-top:24px}.operator-budget p{font-size:12px}
.notice,#busy{margin:20px 0;padding:14px 0;border-block:1px solid var(--line);font-size:13px;overflow-wrap:anywhere}.notice.error{color:#f2a18c}#busy{display:flex;flex-wrap:wrap;gap:12px}.empty{padding:70px 34px;text-align:center;color:var(--muted)}
.card{padding:25px 0;border:0;border-top:1px solid var(--line)}.studio-footer{text-align:left;padding:24px 0;font:9px/1.6 system-ui,sans-serif;letter-spacing:.16em;color:#697178;border-top:1px solid var(--line)}
.book-pager{display:none} /* All pages read continuously; stage tabs keep navigation. */
.book-page.book-enter{animation:archive-arrive .23s ease-out}@keyframes archive-arrive{from{opacity:.5;transform:translateY(7px)}to{opacity:1;transform:none}}
.battle-worlds{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line)}.battle-worlds>div{padding:15px 30px;min-width:0;overflow-wrap:anywhere}.battle-worlds p{font-size:10px;color:var(--muted)}.battle-worlds strong{font-size:13px}
/* Battle records own an article surface, independent of the hero record medium. */
body[data-flow-stage=chronicle][data-studio-space=book]{--desk:#f2f0e9;--paper:#f2f0e9;--ink:#263330;--muted:#69716a;--line:#d1d3c7;--accent:#864a38;background:var(--desk)}
body[data-flow-stage=chronicle][data-studio-space=book] .workspace-heading{display:none}
body[data-flow-stage=chronicle][data-studio-space=book] .book-content{max-width:1200px}
#flow-chronicle{display:block;min-width:0;margin:0;background:transparent;border:0}
.chronicle-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:40px 0 25px;border-bottom:1px solid var(--line)}
.chronicle-kicker{margin:0 0 5px;color:var(--muted);font-size:11px;letter-spacing:.07em}
.chronicle-heading h2{margin:0;font-size:clamp(25px,3vw,34px);font-weight:500;letter-spacing:-.06em}
.chronicle-actions{display:flex;gap:20px;align-items:center}
.chronicle-actions>button,#chronicle-records>summary{border:0;border-bottom:1px solid var(--line);padding:11px 0;min-height:44px;background:transparent;list-style:none;font-size:13px;cursor:pointer;color:var(--ink)}
.chronicle-actions>button span,#chronicle-records>summary span{margin-left:18px;color:var(--accent)}
#chronicle-records{position:relative}
#chronicle-records[open]>summary{border-color:var(--accent)}
#chronicle-records:not([open])>.chronicle-catalogue{display:none}
.chronicle-catalogue{position:absolute;z-index:12;top:calc(100% + 13px);right:0;width:min(420px,calc(100vw - 40px));max-height:min(70dvh,650px);overflow:auto;overscroll-behavior:contain;padding:24px;background:#fffef8;border:1px solid var(--line);box-shadow:0 18px 40px #14221f18}
.chronicle-catalogue .chapter-extra{margin-top:0;padding-top:0;border-top:0}
.chronicle-catalogue .chapter-extra>h3{margin:0 0 10px;font-size:16px}
.chronicle-catalogue button{font-size:12px;min-height:44px}
.chronicle-catalogue p[role=status]{font-size:11px;color:var(--muted);margin:10px 0}
.chronicle-catalogue>.evidence-fold{margin-top:18px}
#core-battle-history{display:grid;gap:0;max-height:360px;overflow:auto}
#core-battle-history button{padding:16px 8px;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;font-size:14px;line-height:1.7;background:transparent;width:100%}
#core-battle-history button:hover,#core-battle-history button:focus-visible{background:#eee8dc;color:var(--accent)}
#core-battle-history button > :is(strong,small){display:block}
#core-battle-history button > small{color:#675846;line-height:1.5}
.chronicle-reading{padding:38px 0 0;min-width:0}
.chronicle-manuscript{max-width:740px;margin:auto;min-width:0}
.chronicle-empty{padding:90px 0 130px;margin:0;color:var(--muted);font-size:17px}
.chronicle-participants{margin:0 0 40px;border-block:1px solid var(--line)}
.chronicle-participants:has(#battle-skills-panel[hidden]){display:none}
.chronicle-participants>summary{justify-content:space-between;list-style:none;cursor:pointer;padding:16px 0;min-height:52px;font-size:13px;color:var(--muted)}
.chronicle-participants>summary span{margin-left:auto;color:var(--accent)}
.chronicle-participants[open]>summary{border-bottom:1px solid var(--line)}
.chronicle-participants .battle-skills-panel{margin:0;padding:0 0 24px;border-top:0;gap:32px}
.chronicle-participants .battle-character-portrait{height:220px;background:transparent}
.chronicle-participants .battle-character-introduction{font-size:13px;line-height:1.9}
.chronicle-participants .battle-skills-side>h4{font-size:20px;margin-top:20px}
.chronicle-participants .battle-skill-card>p{font-size:13px;line-height:1.9}
#flow-battle-summary{white-space:pre-wrap;overflow-wrap:anywhere;font:17px/2.15 'Malgun Gothic',sans-serif;scroll-margin-top:32px;outline:none}
.chronicle-original{margin:44px 0;color:var(--muted);font-size:12px}
.chronicle-original:has(#battle-log:empty){display:none}
#flow-chronicle #battle-highlight-panel{max-width:1080px;margin:60px auto 0;padding:28px 0 0;border-top:1px solid var(--line)}
#flow-chronicle:has(#flow-battle-summary:empty) #battle-highlight-panel{display:none}
#flow-chronicle #battle-highlight-panel>h3{font-size:21px;font-weight:500}
#flow-chronicle #battle-highlight-panel:has(#battle-highlight-image:not([hidden]):not(.hidden))>.muted{display:none}
#flow-chronicle .battle-highlight-open{border:0;background:transparent;margin-top:28px}
#flow-chronicle .battle-highlight-zoom-label{text-align:right;padding-inline:0}
#flow-battle-summary>h3{font-size:32px;line-height:1.5;margin-bottom:30px;letter-spacing:-.05em}
#flow-battle-summary p{margin:0 0 1.4em}#flow-battle-summary .battle-reading-scene{margin-bottom:2em}.battle-expression{border:0;padding:16px 22px;margin:1.5em 0;background:#e2dbcc}.battle-speaker{font-size:11px;color:var(--accent);margin-bottom:6px}.battle-expression-text{margin:0;border:0;padding:0}.battle-gesture{font-style:italic}.battle-ending{padding-top:24px;border-top:1px solid var(--line)}
.battle-skills-panel{scroll-margin-top:110px;margin-top:30px;padding-top:24px;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px}.battle-skills-panel>h4{font-size:17px}.battle-skills-side{min-width:0;margin-top:12px}.battle-character-portrait{display:block;width:100%;height:340px;object-fit:contain;background:#0c1013;margin:18px 0}.battle-character-portrait[hidden]{display:none}.battle-portrait-notice{font-size:12px;color:var(--muted)}.battle-character-introduction{font-size:15px;line-height:1.8;white-space:pre-line}.battle-character-facts{font-size:13px;color:var(--accent)}.battle-skills-side>h5{font-size:14px;margin-bottom:12px}
@media(max-width:600px){.battle-skills-panel{grid-template-columns:1fr;gap:20px}.battle-character-portrait{height:min(70dvh,440px)}}
.battle-skill-card{border-top:1px solid var(--line);margin-top:10px}.battle-skill-card>summary{font-size:14px;padding:12px 0;display:list-item;color:var(--ink)}.reading-page .battle-skill-card>.prose{font-size:12px;line-height:1.95;margin-bottom:15px}
.battle-skill-use{color:var(--accent);font-size:11px}.battle-skill-evidence,.battle-saved-scene{border-left:1px solid var(--line);padding-left:16px;margin:15px 0;font-size:12px}.battle-skill-evidence button{border:0;padding:6px 0;font-size:11px;color:var(--accent)}.battle-saved-scenes{border-top:1px solid var(--line);padding-top:15px;margin-top:24px}
.battle-highlight-open{display:block;width:100%;margin:25px 0 0;padding:0;border:1px solid var(--line);background:#090c0f;cursor:zoom-in}.battle-highlight-open>img,#battle-highlight-image{width:100%;height:auto;max-height:none;object-fit:contain;margin:0}.battle-highlight-zoom-label{display:block;font-size:11px;color:var(--muted);padding:12px}
.battle-highlight-dialog{width:min(1500px,96vw);max-width:96vw;max-height:94dvh;padding:16px;border:1px solid var(--line);background:var(--paper);color:var(--ink);overflow:auto}.battle-highlight-dialog::backdrop{background:#080a0de8}.battle-highlight-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.battle-highlight-dialog h2{font-size:17px}.battle-highlight-dialog button{min-width:90px;flex-shrink:0}#battle-highlight-large{display:block;max-width:100%;width:auto;height:auto;max-height:calc(94dvh - 110px);object-fit:contain;margin:auto}
/* Shared furniture stays in one place; only the hero record has a home-world medium. */
.manuscript-page{--paper:#eee8dc;--ink:#2c3437;--muted:#65706d;--line:#c9c0ad;--field:#fbf8f0;--accent:#8b4934;color:var(--ink);background:var(--paper);color-scheme:light}
.manuscript-page input:focus,.manuscript-page textarea:focus,.manuscript-page select:focus{border-color:#8c713f;background:#fffdf7}
#hero-roster{margin:24px 0;border:0;border-bottom:1px solid #b9c2b3;background:transparent}
#hero-roster>summary{justify-content:space-between;padding:12px 0;color:#2d4434;font-size:14px;list-style:none}
#hero-roster>summary:after{content:'+';margin-left:18px;font:20px Georgia,serif}#hero-roster[open]>summary:after{content:'−'}#hero-roster>summary small{margin-left:auto;font-size:11px;color:#65745d}
#hero-roster .list{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 22px;max-height:290px;overflow:auto}
/* The complete, medium-specific record component is defined below. */
/* Catalog markers belong to the record, never to the source illustration. */
[data-world-theme=baekmuncheon]{--accent:#d6967f}[data-world-theme=ulterra]{--accent:#c9b18c}[data-world-theme=regnumen]{--accent:#d5ac66}[data-world-theme=velsium]{--accent:#7cb8c2}[data-world-theme=terrabor]{--accent:#a0b89a}[data-world-theme=peremus]{--accent:#baa5ce}[data-world-theme=aperion]{--accent:#8faacb}[data-world-theme=marevis]{--accent:#7eb7b4}[data-world-theme=misania]{--accent:#d6a5ab}

/* Supporting work areas share the same furniture, regardless of hero world. */
#direct-image-panel { margin: 32px 0; gap: 24px; }
#direct-image-panel>.illustration-page { background: #dde0d4; border-top: 3px solid #566a53; }
#combat-panel { margin: 32px 0; border-top: 3px solid #566a53; background: #f5f5ec; }
#combat-panel>.battle-identity { background: #263b30; }
.battle-loadout { padding: 36px!important; }
.battle-loadout>.battle-identity-copy h3 { font-size: clamp(28px,3.2vw,45px); }
.story-dialogue { margin: 20px 0; padding: 15px 20px; border: 0; border-radius: 0; background: color-mix(in srgb,var(--ink) 5%,transparent); }
body>#guild-room { width: auto; max-width: 1320px; margin: 32px 32px 48px calc(var(--rail) + 32px); }
@media(min-width:1600px) {
 .book { padding-inline: 5vw; }
 .reading-page .prose { font-size: 17px; }
}
@media(max-width:1180px) and (min-width:901px) {
 .studio-header h1 { font-size: 17px; }
 .book { padding-inline: 24px; }
 .running-head { grid-template-columns: 1fr; }
 .flow-job-status { grid-column: 1; grid-row: 4; max-width: none; text-align: left; border: 0; padding: 5px 0 0; }
 #flow-create { gap: 28px; }
 .book-page,.book-page:first-child,.book-page:last-child { padding: 28px; }
 #flow-hero .reading-page { padding: 30px 26px; }
 #flow-chronicle { grid-template-columns: 200px minmax(0,1fr); }
}
@media(max-height:760px) and (min-width:901px) {
 :root {--header:76px}
 .studio-header {padding-block:12px}
}
@media(max-width:900px) {
 :root { --header: 76px; }
 body { padding-bottom: 0; }
 .studio-header {min-height:76px;padding:12px 20px;gap:10px}
 .brand-lockup { flex-direction: row; align-items: center; flex-shrink: 0; gap: 11px; padding: 0; border: 0; }
 .brand-mark { width: 34px; height: 35px; font-size: 26px; }
 .studio-header h1 { font-size: 16px; margin: 0; }
 .brand { font-size: 7px; letter-spacing: .17em; }
 .studio-header>a { display: none; }
 #flow-account-button { margin:0;padding:9px 8px;font-size:11px;order:4; }
 #guild-open {order:1;padding:9px 6px;font-size:11px}
 #flow-place-menu>summary {padding:9px 6px;font-size:11px}
 .studio-header>.bgm-player { margin: 0; min-width: 0; }
 .studio-header>.bgm-player>summary { border: 0; padding: 9px 4px; font-size: 0; min-height: 44px; min-width: 30px; }
 .studio-header>.bgm-player>summary:before { content: '♫'; font-size: 19px; }
 .studio-header .bgm-controls {right:12px}
 .studio-header>.access-card {right:12px;width:calc(100vw - 24px)}
 .book {margin:0;padding:0 22px 30px}
 .running-head { min-height: 112px; padding: 22px 0 18px; gap: 3px; grid-template-columns: 1fr; }
 .running-head h2 { font-size: 27px; }
 .running-head #flow-current-help { font-size: 11px; }
 .flow-job-status { grid-column: 1; grid-row: 4; max-width: 100%; padding: 6px 0 0; border: 0; font-size: 9px; text-align: left; }
 .book-spread,.hero-dashboard,#flow-hero,#combat-panel,#flow-chronicle { display: block; }
 .book-page,.book-page:first-child,.book-page:last-child { padding: 28px 24px; }
 #hero-roster { margin: 18px 0; }
 #hero-roster .list { grid-template-columns: repeat(2,minmax(0,1fr)); }
 #flow-hero { margin: 26px 0; }
 #flow-hero>.illustration-page,#combat-panel>.battle-identity { position: relative; top: auto; border-right: 0; border-bottom: 1px solid var(--line); }
 #flow-hero>.illustration-page { padding: 10px; }
 .hero-portrait,.battle-portrait,#flow-hero .hero-portrait { height: 68dvh; min-height: 350px; max-height: 760px; }
 #flow-hero .reading-page { padding: 30px 24px; }
 #flow-hero .hero-record h2,.hero-record h2,.battle-identity-copy h3 { font-size: 36px; }
 .reading-page .prose { font-size: 15px; line-height: 2.05; }
 .hero-record .prose { font-size: 14px; }
 .book-notes { padding: 24px 0; }
 #direct-image-panel { margin-top: 26px; }
 #direct-image-panel>.manuscript-page { margin-top: 18px; }
 .battle-loadout { padding: 28px 24px!important; }
 #flow-battle-summary>h3 { font-size: 26px; }
 .battle-worlds>div { padding: 14px 18px; }
 .battle-expression { padding: 14px 17px; }
 .battle-highlight-dialog { padding: 10px; }
 .battle-highlight-dialog h2 { font-size: 14px; }
 body>#guild-room { margin: 98px 20px 30px; }
}
@media(max-width:540px) {
 .studio-header { padding-inline: 12px; gap: 5px; }
 .studio-header>.access-card,.studio-header .bgm-controls {max-height:calc(100dvh - 140px)}
 .brand-lockup { gap: 7px; }
 .studio-header h1 { font-size: 12px; }
 .brand {display:none}
 .brand-mark {width:28px;font-size:23px}
 #guild-open {padding-inline:4px;font-size:10px}
 #guild-open:before {display:none}
 #flow-place-menu>summary {font-size:10px;gap:5px;padding-inline:4px}
 #flow-place-menu>.book-tabs {position:fixed;top:70px;right:12px}
 #flow-account-button { margin-left: 0; padding-inline: 4px; }
 .book { padding-inline: 16px; }
 .running-head h2 { font-size: 25px; }
 #hero-roster .list { grid-template-columns: 1fr; }
 #flow-hero .reading-page { padding: 26px 20px; }
 #flow-hero .hero-record h2 { font-size: 33px; }
 #flow-hero .hero-portrait { height: 60dvh; min-height: 320px; }
 .book-page,.book-page:first-child,.book-page:last-child { padding: 26px 20px; }
 body>#guild-room { margin-inline: 16px; }
}
@media(prefers-reduced-motion:reduce) {
 *,*::before,*::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
}

/* Saved-world records. Their original content and portrait remain intact;
   furniture and navigation are common to every world. */
#flow-hero {
 --ink:#302e29;--muted:#68635b;--line:#bcb4a2;--accent:var(--world-color,#64717b);
 position:relative;display:grid;grid-template-columns:minmax(250px,.85fr) minmax(0,1.15fr);
 grid-template-areas:'identity identity' 'portrait story';grid-template-rows:auto minmax(0,1fr);align-items:stretch;
 height:clamp(570px,calc(100dvh - 210px),860px);margin:20px auto 24px;max-width:1180px;border:1px solid var(--line);
 background:var(--record-paper,#eee6d7);color:var(--ink);color-scheme:light;
 box-shadow:0 12px 34px #18201c25;
}
#flow-hero[data-medium=grimoire] {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#flow-hero>.reading-page {display:contents}
#flow-hero>.illustration-page {grid-area:portrait;position:relative;top:auto;min-height:0;padding:24px;background:transparent;border:0}
#flow-hero .hero-record {grid-area:identity;padding:24px 30px;background:transparent;border:0;border-bottom:1px solid var(--line);margin:0;min-width:0;min-height:0}
#flow-hero .hero-record h2 {font:600 clamp(28px,3.1vw,44px)/1.45 Batang,serif;letter-spacing:-.045em}
#flow-hero #flow-world-label {display:block;margin:10px 0 18px;padding:0;border:0;font-size:12px;color:var(--accent)}
#flow-hero #flow-record-preview {max-width:70ch;font-size:13px;line-height:1.85}
#flow-hero .hero-record .actions {margin-top:16px}
#flow-hero .chapter-story {grid-area:story;padding:30px 36px 38px;margin:0;min-width:0;min-height:0;border:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--accent) transparent;scroll-padding:24px}
#flow-hero .chapter-story>h3 {font:600 clamp(22px,2.2vw,30px)/1.5 Batang,serif;margin:8px 0 28px}
#flow-hero .reading-page .prose {font-size:16px;line-height:2.05}
#flow-hero .hero-portrait {height:100%;min-height:0;max-height:none;background:transparent}
#flow-hero .hero-portrait>.candidate-image {inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 8px 13px #0003)}
#flow-hero .book-traits,#flow-hero .book-skills {padding-top:24px;margin-top:28px;border-top:1px solid var(--line)}
#flow-hero .book-skills li {padding:18px 0;border-bottom:1px solid var(--line)}
#flow-hero .book-skills li>strong {display:block;font:600 19px/1.5 Batang,serif;margin-bottom:8px}
#flow-hero .book-skills li>div {font-size:14px;line-height:1.9}

/* A single hanging scroll is read from the illustration downwards. */
#flow-hero[data-medium=scroll] {
 height:auto;max-width:800px;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:'portrait' 'identity' 'story';
 margin-block:42px 50px;border-inline:14px solid #c6b58b;
 background:repeating-linear-gradient(0deg,#98856306 0 1px,transparent 1px 6px),#eee6ce;
}
#flow-hero[data-medium=scroll]::before,#flow-hero[data-medium=scroll]::after {
 content:'';position:absolute;z-index:2;left:-24px;right:-24px;height:20px;border-radius:10px;
 background:linear-gradient(#6b4e2d,#b39a6b 42%,#654a2e);box-shadow:0 3px 7px #0004;pointer-events:none;
}
#flow-hero[data-medium=scroll]::before {top:-12px}
#flow-hero[data-medium=scroll]::after {bottom:-12px}
#flow-hero[data-medium=scroll]>.illustration-page {position:relative;top:auto;padding:26px 26px 0}
#flow-hero[data-medium=scroll] .hero-portrait {height:min(65dvh,640px)}
#flow-hero[data-medium=scroll] .hero-record {border-bottom:0;text-align:center}
#flow-hero[data-medium=scroll] #flow-record-preview {margin:auto}
#flow-hero[data-medium=scroll] .actions {justify-content:center}
#flow-hero[data-medium=scroll] .chapter-story {overflow:visible}
#flow-hero[data-medium=scroll] .reading-page .prose {font-family:Batang,serif}
#flow-hero[data-medium=scroll]:has(.scroll-reader:not([hidden])) {grid-template-areas:'portrait' 'identity' 'seal' 'story'}
#flow-hero .scroll-reader[hidden] {display:none!important}
#flow-hero .scroll-reader {grid-area:seal;text-align:center;padding:8px 24px 24px;scroll-margin-top:82px}
#flow-hero .scroll-reader button {min-height:48px;border:1px solid #80683f;border-radius:2px;background:#e2d3ad;color:#493b27;padding:10px 28px;font:600 15px/1.5 Batang,serif;box-shadow:0 2px 0 #80683f35}
#flow-hero .scroll-reader button:focus-visible {outline:2px solid #9f4231;outline-offset:4px}
#flow-hero .scroll-reader p {font:12px/1.8 Batang,serif;color:#79694e;margin:10px 0 0}
#flow-hero[data-medium=scroll][data-scroll-open=false] .chapter-story {display:none}
#flow-hero[data-medium=scroll][data-scroll-open=true] .chapter-story {animation:scroll-unfurl .22s ease-out}
@keyframes scroll-unfurl {from{opacity:.35;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#flow-hero[data-medium=scroll][data-scroll-open=true] .chapter-story{animation:none}}

/* The expedition map has a portrait inset and full-width field notes. */
#flow-hero[data-medium=map] {
 grid-template-columns:1.1fr .9fr;grid-template-rows:minmax(0,.9fr) minmax(0,1.1fr);grid-template-areas:'identity portrait' 'story story';
 border:10px solid #be9b66;background:repeating-linear-gradient(0deg,transparent 0 47px,#937a4520 47px 48px),repeating-linear-gradient(90deg,transparent 0 47px,#937a4517 47px 48px),#efdfbe;
}
#flow-hero[data-medium=map]>.illustration-page {position:relative;top:auto;transform:rotate(1.2deg);padding:24px}
#flow-hero[data-medium=map] .hero-portrait {height:100%;min-height:0}
#flow-hero[data-medium=map] .hero-record {align-self:center;border:0}
#flow-hero[data-medium=map] .chapter-story {border-top:1px dashed #a78b59;background:#f8f0dbb8}
#flow-hero .map-fold-controls[hidden] {display:none!important}
#flow-hero[data-medium=map]:has(.map-fold-controls:not([hidden])) {
 height:auto;grid-template-rows:auto auto auto;grid-template-areas:'identity portrait' 'folds folds' 'story story';
}
#flow-hero[data-medium=map]:has(.map-fold-controls:not([hidden])) .hero-portrait {height:min(54dvh,540px);min-height:280px}
#flow-hero .map-fold-controls {grid-area:folds;display:grid;grid-template-columns:1fr 1fr;gap:0;padding:0 28px 18px;min-width:0}
#flow-hero .map-fold-controls button {min-height:64px;padding:14px 18px;border:1px dashed #a78b59;border-radius:0;background:linear-gradient(100deg,#b7945030,transparent 9%,#fff9e945);color:#594321;font:600 15px/1.5 Batang,serif;box-shadow:inset 4px 0 #ac8b4730}
#flow-hero .map-fold-controls button+button {border-left:0;background:linear-gradient(260deg,#b7945030,transparent 9%,#fff9e945);box-shadow:inset -4px 0 #ac8b4730}
#flow-hero .map-fold-controls button[aria-expanded=true] {background:#f8efda;box-shadow:inset 0 -3px #9a6427}
#flow-hero .map-fold-controls button:focus-visible {outline:3px solid #69451a;outline-offset:3px;z-index:1}
#flow-hero .map-fold-controls p {grid-column:1/-1;text-align:center;margin:12px 0 0;font-size:12px;color:#7c694b}
#flow-hero[data-medium=map][data-map-story-open=false] .chapter-story>:is(.eyebrow,#flow-story-title,#flow-story) {display:none}
#flow-hero[data-medium=map][data-map-skills-open=false] #book-skills {display:none}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] .chapter-story {
 display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);grid-template-rows:auto auto 1fr auto;grid-template-areas:'label skills' 'title skills' 'story skills' 'traits traits';column-gap:38px;
}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] .chapter-story>.eyebrow {grid-area:label}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] #flow-story-title {grid-area:title}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] #flow-story {grid-area:story}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] #book-skills {grid-area:skills;margin:0;padding:0 0 0 28px;border-top:0;border-left:1px dashed #a78b59}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] #book-traits {grid-area:traits}
#flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] .chapter-story>p.muted:empty {display:none}

/* The grimoire keeps a portrait leaf beside the written leaf. */
#flow-hero[data-medium=grimoire] {
 grid-template-areas:'portrait story' 'identity story';grid-template-rows:minmax(0,1fr) auto;border:12px solid #514133;border-left-width:21px;border-radius:3px 12px 12px 3px;
 background:linear-gradient(90deg,#d6c49d 0,#f4e7ca 4% 47%,#e2d3b0 49%,#b9a279 50%,#e2d3b0 51%,#f4e7ca 53% 96%,#d6c49d 100%);
 box-shadow:inset 0 0 0 1px #b39b6f,0 14px 35px #0004;
}
#flow-hero[data-medium=grimoire]>.illustration-page {padding:24px 24px 0}
#flow-hero[data-medium=grimoire] .hero-record {padding:18px 24px 24px;border:0}
#flow-hero[data-medium=grimoire] .hero-record>.eyebrow {display:none}
#flow-hero[data-medium=grimoire] .hero-record h2 {font-size:27px}
#flow-hero[data-medium=grimoire] #flow-world-label {margin:4px 0 10px}
#flow-hero[data-medium=grimoire] .hero-record .actions button {padding:8px 10px;font-size:11px}
#flow-hero[data-medium=grimoire] .reading-page .prose {font-family:Batang,serif}
#flow-hero[data-medium=grimoire] .chapter-story {display:flex;flex-direction:column;position:relative;overflow:hidden;padding-top:58px;scroll-margin-top:78px}
#flow-hero[data-medium=grimoire] .chapter-story>.eyebrow {display:none}
#flow-hero[data-medium=grimoire] #flow-story-title {font:600 22px/1.6 Batang,serif;margin:0 0 18px;padding-bottom:14px;border-bottom:1px solid #bca97c}
#flow-hero[data-medium=grimoire] #flow-story {flex:1;min-height:0;overflow:auto;padding-right:12px;scrollbar-width:thin;scrollbar-color:#b39b6f transparent}
#flow-hero[data-medium=grimoire] .grimoire-leaf {animation:grimoire-ink .18s ease-out}
#flow-hero[data-medium=grimoire] .grimoire-leaf[hidden],#flow-hero[data-medium=grimoire] #book-skills-content>li[hidden] {display:none}
#flow-hero[data-medium=grimoire][data-grimoire-kind=story] :is(#book-traits,#book-skills),
#flow-hero[data-medium=grimoire][data-grimoire-kind=skills] :is(#flow-story-title,#flow-story) {display:none}
#flow-hero[data-medium=grimoire] #book-traits {margin:0 0 10px;padding:0;border:0}
#flow-hero[data-medium=grimoire] #book-traits>h3 {display:none}
#flow-hero[data-medium=grimoire] #book-skills {flex:1;min-height:0;overflow:auto;margin:0;padding:0;border:0}
#flow-hero[data-medium=grimoire] #book-skills>h3 {font:600 22px/1.6 Batang,serif;margin:0 0 10px}
#flow-hero .grimoire-reader[hidden],#flow-hero .grimoire-ribbons[hidden] {display:none!important}
#flow-hero .grimoire-reader {display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;margin-top:20px;padding-top:15px;border-top:1px solid #bca97c;font:12px/1.5 Batang,serif}
#flow-hero .grimoire-reader button {min-height:44px;padding:6px 8px;background:transparent;border:0;color:#65533a;font:inherit;white-space:nowrap}
#flow-hero .grimoire-reader button:disabled {opacity:.35}
#flow-hero .grimoire-reader output {text-align:center;color:#807256}
#flow-hero .grimoire-ribbons {display:flex;gap:7px;position:absolute;top:0;right:22px;margin:0}
#flow-hero .grimoire-ribbons button {min-height:42px;padding:10px 14px 15px;border:0;border-radius:0;background:#705040;color:#faecd2;font:12px/1.4 Batang,serif;clip-path:polygon(0 0,100% 0,100% 100%,50% 87%,0 100%)}
#flow-hero .grimoire-ribbons button[aria-current=page] {background:#a13f36;padding-bottom:21px}
#flow-hero .grimoire-reader button:focus-visible,#flow-hero .grimoire-ribbons button:focus-visible {outline:2px solid #a13f36;outline-offset:3px;clip-path:none}
@keyframes grimoire-ink {from{opacity:.4;transform:translateX(8px)}to{opacity:1;transform:none}}

/* A field record case keeps the portrait on its lid and papers inside. */
#flow-hero[data-medium=plate]>.illustration-page {position:relative;top:auto;background:#3e493f}
#flow-hero[data-medium=plate] .hero-portrait {height:100%;min-height:0}
#flow-hero[data-medium=plate] .hero-record {align-self:center;border:0;background:#e8e0cc}
#flow-hero .plate-reader[hidden] {display:none!important}
#flow-hero[data-medium=plate]:has(.plate-reader:not([hidden])) {height:auto;grid-template-rows:auto auto;grid-template-areas:'portrait identity' 'turn turn'}
#flow-hero[data-medium=plate]:has(.plate-reader:not([hidden])) .hero-portrait {height:min(65dvh,640px);min-height:300px}
#flow-hero .plate-reader {grid-area:turn;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 24px;border-block:3px solid #90866a;background:#555e4c;color:#f3ead5;scroll-margin-top:82px}
#flow-hero .plate-reader p {margin:0;color:#f3ead5;font-size:12px;letter-spacing:.05em}
#flow-hero .plate-reader button {min-height:48px;padding:12px 20px;background:#d8d2c6;border:1px solid #756f65;border-radius:2px;box-shadow:inset 0 1px #fff8,0 2px 0 #756f6540;color:#302d29;font:600 14px/1.5 'Malgun Gothic',sans-serif}
#flow-hero .plate-reader button:focus-visible {outline:3px solid #8d393d;outline-offset:3px}
#flow-hero[data-medium=plate][data-plate-face=front] .chapter-story {display:none}
#flow-hero[data-medium=plate][data-plate-face=back]:has(.plate-reader:not([hidden])) {grid-template-columns:1fr;grid-template-areas:'identity' 'turn' 'story'}
#flow-hero[data-medium=plate][data-plate-face=back]>.illustration-page,
#flow-hero[data-medium=plate][data-plate-face=back] #account-image-history,
#flow-hero[data-medium=plate][data-plate-face=back] .hero-record>:not(h2):not(#flow-world-label) {display:none}
#flow-hero[data-medium=plate][data-plate-face=back] .hero-record {padding:22px 28px 12px}
#flow-hero[data-medium=plate][data-plate-face=back] .hero-record h2 {font-size:28px}
#flow-hero[data-medium=plate][data-plate-face=back] .chapter-story {padding-block:30px 40px;animation:plate-face-reveal .18s ease-out}
#flow-hero[data-medium=plate][data-plate-face=back] #flow-story {max-width:76ch;margin-inline:auto}
@keyframes plate-face-reveal {from{opacity:.65;transform:translateX(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#flow-hero[data-medium=plate][data-plate-face=back] .chapter-story{animation:none}}

/* The terminal separates its fixed identity band from image and transcript. */
#flow-hero[data-medium=terminal] {
 --ink:#dcf7fb;--muted:#a6c7ce;--line:#427382;--accent:#9ce4ee;--on-accent:#102c35;
 color-scheme:dark;border:12px solid #35454a;outline:1px solid #78949b;background:linear-gradient(90deg,#122c35,#193e48);
 box-shadow:inset 0 0 0 1px #6d9aa6,0 14px 35px #0004;
}
#flow-hero[data-medium=terminal] .hero-record {background:#0e232c;border-bottom:1px solid #5c8c98}
#flow-hero[data-medium=terminal] .hero-record h2,#flow-hero[data-medium=terminal] .eyebrow {font-family:ui-monospace,'Malgun Gothic',monospace}
#flow-hero[data-medium=terminal] .chapter-story>h3 {font-family:'Malgun Gothic',system-ui,sans-serif;letter-spacing:-.03em}
#flow-hero[data-medium=terminal]>.illustration-page {border-right:1px solid #42738255}
#flow-hero[data-medium=terminal] .chapter-story {background:#0a20272b}
#flow-hero[data-medium=terminal] .story-dialogue {background:#8bd9e511}

/* A terminal retrieves a record; it does not imitate the book's two leaves. */
#flow-hero[data-medium=terminal][data-terminal-view] {
 height:auto;min-height:470px;
 grid-template-columns:1.1fr .9fr;grid-template-rows:auto auto minmax(0,1fr);
 grid-template-areas:'identity portrait' 'console portrait' 'story portrait';
 border:10px solid #343d40;border-bottom-width:24px;border-radius:14px 14px 22px 22px;
 background:#0d2027;box-shadow:inset 0 0 0 1px #83adb1,0 20px 36px #14211e50;
}
#flow-hero[data-medium=terminal][data-terminal-view]>.illustration-page {padding:20px 20px 20px 0;border:0}
#flow-hero[data-medium=terminal][data-terminal-view] .hero-portrait {height:min(65dvh,640px);min-height:360px;max-height:640px;border:1px solid #64858c;background:#07171e;box-shadow:inset 0 0 45px #51919a12}
#flow-hero[data-medium=terminal][data-terminal-view] .hero-portrait>.candidate-image {filter:none}
#flow-hero[data-medium=terminal][data-terminal-view] .hero-record {padding:28px 28px 18px;background:transparent;border:0}
#flow-hero[data-medium=terminal][data-terminal-view] .hero-record>.eyebrow {display:none}
#flow-hero[data-medium=terminal][data-terminal-view] .hero-record h2 {font-size:clamp(25px,3vw,38px);line-height:1.35}
#flow-hero[data-medium=terminal][data-terminal-view] #flow-record-preview {color:#bad1d5}
#flow-hero .terminal-console {grid-area:console;padding:0 28px;color:#a9ccd0;min-width:0}
#flow-hero .terminal-record-caption {font-size:10px;letter-spacing:.18em;margin:4px 0 10px;color:#729ba2}
#flow-hero .terminal-record-tabs {display:flex;gap:0;border:1px solid #557c83}
#flow-hero .terminal-record-tabs button {flex:1;min-width:0;min-height:44px;border:0;border-right:1px solid #557c83;background:transparent;color:#b9d4d8;font-size:13px;padding:9px 12px;border-radius:0}
#flow-hero .terminal-record-tabs button:last-child {border-right:0}
#flow-hero .terminal-record-tabs button[aria-selected=true] {background:#bbddd9;color:#102b32;font-weight:700;box-shadow:inset 0 -3px #e2faf1}
#flow-hero .terminal-record-tabs button:focus-visible {outline:2px solid #fff4bc;outline-offset:4px;z-index:1}
#flow-hero .terminal-record-location {font-size:11px;margin:12px 0 0;color:#729ba2}
#flow-hero[data-medium=terminal][data-terminal-view] .chapter-story {padding:18px 28px 28px;background:transparent}
#flow-hero[data-medium=terminal][data-terminal-view=overview] .chapter-story>:not(#book-traits) {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=overview] #book-traits {margin:0;padding:0;border:0}
#flow-hero[data-medium=terminal][data-terminal-view=overview] #book-traits>h3 {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=story],
#flow-hero[data-medium=terminal][data-terminal-view=skills] {height:clamp(470px,calc(100dvh - 240px),900px);grid-template-columns:1fr;grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:'identity' 'console' 'story'}
#flow-hero[data-medium=terminal][data-terminal-view=story]>.illustration-page,
#flow-hero[data-medium=terminal][data-terminal-view=skills]>.illustration-page,
#flow-hero[data-medium=terminal][data-terminal-view=story] #flow-record-preview,
#flow-hero[data-medium=terminal][data-terminal-view=skills] #flow-record-preview,
#flow-hero[data-medium=terminal][data-terminal-view=story] .hero-record>.actions,
#flow-hero[data-medium=terminal][data-terminal-view=skills] .hero-record>.actions {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=story] #account-image-history,
#flow-hero[data-medium=terminal][data-terminal-view=skills] #account-image-history {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=story] .hero-record,
#flow-hero[data-medium=terminal][data-terminal-view=skills] .hero-record {padding:18px 28px 14px}
#flow-hero[data-medium=terminal][data-terminal-view=story] .hero-record h2,
#flow-hero[data-medium=terminal][data-terminal-view=skills] .hero-record h2 {font-size:28px}
#flow-hero[data-medium=terminal][data-terminal-view=story] .terminal-record-caption,
#flow-hero[data-medium=terminal][data-terminal-view=skills] .terminal-record-caption,
#flow-hero[data-medium=terminal][data-terminal-view=story] .terminal-record-location,
#flow-hero[data-medium=terminal][data-terminal-view=skills] .terminal-record-location {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=story] .hero-record>p:not(#flow-world-label),
#flow-hero[data-medium=terminal][data-terminal-view=skills] .hero-record>p:not(#flow-world-label) {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=story] #flow-world-label,
#flow-hero[data-medium=terminal][data-terminal-view=skills] #flow-world-label {margin-bottom:0}
#flow-hero[data-medium=terminal][data-terminal-view=story] #book-traits,
#flow-hero[data-medium=terminal][data-terminal-view=story] #book-skills {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=story] #flow-story,
#flow-hero[data-medium=terminal][data-terminal-view=skills] #book-skills {max-width:74ch;margin-inline:auto}
#flow-hero[data-medium=terminal][data-terminal-view=skills] .chapter-story>:not(#book-skills) {display:none}
#flow-hero[data-medium=terminal][data-terminal-view=skills] #book-skills {padding:0;margin:0;border:0}
#flow-hero[data-medium=terminal][data-terminal-view=skills] #book-skills>h3 {display:none}
#flow-hero[data-medium=terminal][data-terminal-view] .book-skills li {counter-increment:terminal-skill;position:relative;padding:20px 0 20px 46px}
#flow-hero[data-medium=terminal][data-terminal-view] .book-skills ol {counter-reset:terminal-skill}
#flow-hero[data-medium=terminal][data-terminal-view] .book-skills li::before {content:counter(terminal-skill,decimal-leading-zero);position:absolute;top:22px;left:0;color:#7fabb1;font:12px/1.7 ui-monospace,monospace}
#flow-hero[data-medium=terminal][data-terminal-view] .book-skills li>strong {font:600 19px/1.5 'Malgun Gothic',sans-serif}
@media(max-width:620px) {
 #flow-hero[data-medium=terminal][data-terminal-view] {display:grid;height:auto;min-height:0;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:'identity' 'console' 'portrait' 'story';border-width:7px;border-bottom-width:17px}
 #flow-hero[data-medium=terminal][data-terminal-view] .hero-record {padding:24px 20px 18px}
 #flow-hero[data-medium=terminal][data-terminal-view] .terminal-console {padding:0 20px}
 #flow-hero[data-medium=terminal][data-terminal-view]>.illustration-page {padding:18px 20px 0}
 #flow-hero[data-medium=terminal][data-terminal-view] .hero-portrait {height:58dvh;min-height:280px;max-height:650px}
 #flow-hero[data-medium=terminal][data-terminal-view] .chapter-story {padding:20px;max-height:none;overflow:visible}
 #flow-hero[data-medium=terminal][data-terminal-view=story],#flow-hero[data-medium=terminal][data-terminal-view=skills] {grid-template-areas:'identity' 'console' 'story'}
}

/* A common navigation strip and desk surround every opened hero record. */
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive))>.studio-header {
 inset:0 0 auto;width:100%;height:68px;padding:10px 24px;flex-direction:row;align-items:center;gap:14px;border:0;
}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .brand-lockup {flex-direction:row;align-items:center;gap:12px;padding:0;border:0;margin-right:auto}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .brand-mark {width:35px;height:39px;font-size:28px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .brand {font-size:7px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header h1 {font-size:15px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header>a {display:none}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #guild-open {order:1;margin:0;border:1px solid #647164;padding:9px 12px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #flow-account-button {order:2;margin:0;padding:9px 12px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header>.bgm-player {order:3}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header>.bgm-player>summary {padding:9px 12px;border:0}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header>.access-card {right:24px;width:min(460px,calc(100vw - 48px))}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header .bgm-controls {right:24px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book {margin:86px auto 100px;padding:0 30px 30px;max-width:1380px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .running-head {min-height:0;padding:0;border:0;display:block}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .running-head>.eyebrow {display:none}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .flow-job-status {max-width:none;padding:0;border:0;text-align:left}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .running-head>h2,
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #flow-current-help {display:none}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book-tabs {position:fixed;inset:auto 18px 14px;margin:0;padding:4px;display:flex;justify-content:center;gap:4px;background:#202d29f5;border:1px solid #778374;z-index:40}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book-tabs button {min-height:44px;padding:10px 20px;border:0;border-bottom:2px solid transparent;font-size:12px;flex:0 1 180px;text-align:center;justify-content:center}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book-tabs button::before {display:none}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book-tabs button[aria-selected=true] {border-bottom-color:#e5ac88;background:#314038}
.hero-tools {border:0;border-top:1px solid #aeb7a7;margin:0 auto;max-width:1180px;padding:0}
.hero-tools>summary {padding:16px 4px;gap:18px;color:#33483b;font-size:14px}
.hero-tools>summary::after {content:'+';margin-left:auto;font:22px Georgia,serif}
.hero-tools[open]>summary::after {content:'−'}
.hero-tools>summary small {font-size:11px;color:#65715f}
.hero-tools>.book-notes {border:0;margin:0;padding:20px 4px 28px}
.hero-tools:has(>#account-panel.hidden) {display:none}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #hero-roster {margin:14px auto 0;max-width:1180px}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #owner-requests-panel,
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #owner-cost-panel {max-width:1180px;margin:0 auto;padding:0 4px;border:0;border-top:1px solid #c1c7b9}
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #owner-requests-panel>summary,
body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #owner-cost-panel>summary {padding-block:15px}

@media(min-width:761px) and (max-height:850px) {
 /* Keep a usable written face when a laptop window is short. */
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book {margin-top:78px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #hero-roster {margin-top:6px}
 #flow-hero {margin-top:12px;height:680px}
 #flow-hero[data-medium=scroll] {height:auto}
 #flow-hero[data-medium] .hero-record {padding:16px 24px}
 #flow-hero[data-medium] .hero-record>.eyebrow {display:none}
 #flow-hero[data-medium] .hero-record h2 {font-size:28px}
 #flow-hero[data-medium] #flow-world-label {margin:4px 0 10px}
 #flow-hero[data-medium] #flow-record-preview {font-size:13px;line-height:1.75}
 #flow-hero[data-medium] .hero-record .actions {margin-top:12px}
 #flow-hero[data-medium] .chapter-story {padding:22px 28px 30px}
 #flow-hero[data-medium=grimoire] .chapter-story {padding-top:62px}
}

@media(max-width:760px) {
 #flow-hero {height:auto;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:'identity' 'portrait' 'story';margin-block:18px 28px}
 #flow-hero:is([data-medium=map],[data-medium=grimoire],[data-medium=plate]) {grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:'identity' 'portrait' 'story'}
 #flow-hero>.illustration-page {position:relative;top:auto;padding:18px;border:0!important;transform:none!important}
 #flow-hero .hero-portrait {height:65dvh;min-height:300px}
 #flow-hero .hero-record,#flow-hero .chapter-story {padding:24px 22px}
 #flow-hero .chapter-story {overflow:visible;overscroll-behavior:auto}
 #flow-hero .hero-record h2 {font-size:30px}
 #flow-hero .reading-page .prose {font-size:15px;line-height:2}
 #flow-hero[data-medium=grimoire] {border-width:8px;background:#f4e7ca}
 #flow-hero[data-medium=grimoire] .hero-record {padding:24px 22px}
 #flow-hero[data-medium=grimoire]>.illustration-page {padding:0 18px 18px}
 #flow-hero[data-medium=grimoire] .chapter-story {height:auto;min-height:0;padding-top:62px}
 #flow-hero[data-medium=grimoire] .grimoire-ribbons {right:16px}
 #flow-hero:is([data-medium=map],[data-medium=plate]) .hero-portrait {height:65dvh}
 #flow-hero[data-medium=plate]:has(.plate-reader:not([hidden])) {grid-template-columns:1fr;grid-template-areas:'identity' 'portrait' 'turn'}
 #flow-hero[data-medium=plate][data-plate-face=back]:has(.plate-reader:not([hidden])) {grid-template-areas:'identity' 'turn' 'story'}
 #flow-hero .plate-reader {padding:16px 18px;gap:12px;flex-wrap:wrap}
 #flow-hero .plate-reader button {padding:12px 16px}
 #flow-hero[data-medium=map]:has(.map-fold-controls:not([hidden])) {grid-template-columns:1fr;grid-template-areas:'identity' 'portrait' 'folds' 'story'}
 #flow-hero[data-medium=map]:has(.map-fold-controls:not([hidden])) .hero-portrait {height:58dvh;min-height:300px}
 #flow-hero .map-fold-controls {padding:0 18px 18px}
 #flow-hero .map-fold-controls button {padding:12px 8px;font-size:14px}
 #flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] .chapter-story {grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:'label' 'title' 'story' 'skills' 'traits'}
 #flow-hero[data-medium=map][data-map-story-open=true][data-map-skills-open=true] #book-skills {border-left:0;border-top:1px dashed #a78b59;padding:24px 0 0;margin-top:28px}
 #flow-hero[data-medium=scroll] {grid-template-areas:'portrait' 'identity' 'story';border-inline-width:9px;margin-block:30px 40px}
 #flow-hero[data-medium=scroll]::before,#flow-hero[data-medium=scroll]::after {left:-15px;right:-15px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book {margin-top:82px;padding-inline:14px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive))>.studio-header {height:auto;padding:9px 12px;gap:6px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .brand-lockup {gap:7px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .brand {display:none}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .studio-header h1 {font-size:11px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #guild-open,
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #flow-account-button {padding:9px 7px;font-size:10px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) #guild-open {max-width:none;white-space:nowrap}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book-tabs {inset:auto 8px 8px;height:auto;padding:3px}
 body[data-studio-space=book]:has(#flow-hero:not(.flow-inactive)) .book-tabs button {font-size:10px;padding:9px 5px;min-width:0;min-height:44px}
}

@media(max-width:760px){
 .chronicle-heading{align-items:flex-start;gap:18px;padding:28px 0 22px;flex-wrap:wrap}
 .chronicle-actions{gap:24px;width:100%;justify-content:space-between}
 #chronicle-records{position:static}
 .chronicle-heading{position:relative}
 .chronicle-catalogue{left:0;right:auto;top:100%;width:100%;max-height:65dvh;padding:20px}
 .chronicle-reading{padding-top:26px}
 #flow-battle-summary{font-size:16px;line-height:2.05}
 #flow-battle-summary>h3{font-size:29px;margin-bottom:24px}
 #flow-chronicle #battle-highlight-panel{margin-top:40px}
 .chronicle-empty{padding:70px 0 100px;font-size:15px}
 .chronicle-participants .battle-character-portrait{height:260px}
}

@media(max-width:600px){
 #flow-create{padding-top:26px}
 .creation-heading{padding-bottom:22px}
 .creation-heading h2{font-size:30px}
 .creation-origin{display:block;padding-bottom:22px}
 .creation-record-medium{padding:13px 0 0;border-left:0;font-size:11px}
 .creation-origin #world-help{margin-top:12px}
 .creation-field{margin-top:27px}
 .creation-name input{font-size:25px}
 .creation-field textarea{padding:14px;min-height:180px;font-size:15px}
 .creation-settings textarea{min-height:300px}
 .creation-finish .actions button{font-size:13px;padding:12px 20px}
}

/* Record devices share stored prose, not a page-turning presentation. */
#flow-hero .artifact-reader[hidden]{display:none!important}
#flow-hero .artifact-reader{grid-area:seal;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:22px 28px;min-width:0;text-align:center}
#flow-hero .artifact-reader p{margin:0;font:13px/1.7 sans-serif;letter-spacing:.04em}
#flow-hero .artifact-reader button{min-height:44px;max-width:100%;padding:10px 22px;border:1px solid #8c7954;border-radius:3px;background:#f0e7d3;color:#302d26;font:14px/1.6 sans-serif;white-space:normal}
#flow-hero .artifact-reader button:focus-visible,#flow-hero .artifact-reader input:focus-visible{outline:3px solid #936727;outline-offset:4px}
#flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil]){height:auto;grid-template-columns:.9fr 1.1fr;grid-template-areas:'portrait identity' 'portrait seal' 'story story';color:#30312e;overflow:visible}
#flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil])>.illustration-page{position:relative;top:auto;align-self:start;padding:26px}
#flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil]) .hero-portrait{height:min(62dvh,640px);min-height:280px}
#flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil]) .chapter-story{min-width:0;max-height:none;overflow:visible;overflow-wrap:anywhere;padding:30px clamp(20px,5vw,64px);margin:0;border-radius:0}
#flow-hero[data-medium=folio][data-rubbing-state=closed] .chapter-story,
#flow-hero[data-medium=gate][data-gate-state=closed] .chapter-story,
#flow-hero[data-medium=chart][data-astrolabe-view=closed] .chapter-story,
#flow-hero[data-medium=veil][data-sphere-view=closed] .chapter-story{display:none}
#flow-hero[data-medium=chart][data-astrolabe-view=story] #book-skills,
#flow-hero[data-medium=chart][data-astrolabe-view=story] #book-traits,
#flow-hero[data-medium=veil][data-sphere-view=story] #book-skills,
#flow-hero[data-medium=veil][data-sphere-view=story] #book-traits{display:none}
#flow-hero[data-medium=chart][data-astrolabe-view=skills] .chapter-story>:not(#book-skills),
#flow-hero[data-medium=veil][data-sphere-view=skills] .chapter-story>:not(#book-skills){display:none}
#flow-hero[data-medium=folio]{border:12px ridge #6a6050;border-radius:5px;background:repeating-linear-gradient(96deg,#82756514 0 2px,transparent 2px 16px),#d2c6ac;box-shadow:0 16px 28px #2e2a2433,inset 0 0 0 3px #b0a189}
#flow-hero[data-medium=folio]::before,#flow-hero[data-medium=folio]::after{content:none}
#flow-hero[data-medium=folio] .hero-record{border:0;border-radius:0;background:none;padding-bottom:0}
#flow-hero[data-medium=folio] .chapter-story{background:linear-gradient(92deg,#ded3b9,#f1ead7 9%,#ede4cc 94%,#d9cbae);border-top:1px solid #86765b;box-shadow:inset 6px 0 12px #756c5120}
.rubbing-relief{display:block;position:relative;width:min(100%,260px);height:90px;overflow:hidden;border:5px ridge #90816a;border-radius:3px;background:repeating-radial-gradient(ellipse at 0 50%,#928169 0 2px,#5a5144 3px 8px,#76664e 9px 13px);box-shadow:inset 0 0 20px #17171288}
.rubbing-relief::before{content:'';position:absolute;inset:16px 28px;border-block:1px solid #d4c9b18c;transform:skewX(-17deg);box-shadow:0 7px #cbbd9b33,0 -7px #cbbd9b33}
.rubbing-relief::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,#f0e6ca 14% 90%,#8b7c61);transform:translateX(-105%);transition:transform .24s ease-out}
#flow-hero[data-rubbing-state=open] .rubbing-relief::after{transform:translateX(105%)}
#flow-hero[data-rubbing-state=open] .chapter-story{animation:record-transfer .2s ease-out}
@keyframes record-transfer{from{opacity:.3;transform:translateY(7px)}to{opacity:1;transform:none}}
#flow-hero[data-medium=gate]{border:8px double #8c7958;border-radius:100px 100px 4px 4px;background:linear-gradient(115deg,#e1dae8,#f3ece5 50%,#ded4e6)}
#flow-hero[data-medium=gate] .hero-record{padding-top:45px;text-align:center;background:none}
#flow-hero[data-medium=gate] #flow-record-preview{margin:auto}
#flow-hero[data-medium=gate] .actions{justify-content:center}
#flow-hero[data-medium=gate] .chapter-story{border-top:5px double #a38b63;background:#f5efe5}
.record-gate-doors{display:block;position:relative;width:145px;height:135px;perspective:500px;overflow:hidden;border:5px double #a28d65;border-radius:76px 76px 0 0;background:radial-gradient(ellipse at 50% 80%,#f3e9c8,#b7a4c5 55%,#493d58);box-shadow:0 0 0 5px #5a4c6722}
.record-gate-doors::before,.record-gate-doors::after{content:'';position:absolute;inset:0 50% 0 0;border:1px solid #9b8358;background:repeating-linear-gradient(0deg,#bea67b 0 1px,transparent 1px 35px),linear-gradient(90deg,#4e4558,#76657a);transform-origin:left;transition:transform .23s ease-out}
.record-gate-doors::after{inset:0 0 0 50%;transform-origin:right;background:repeating-linear-gradient(0deg,#bea67b 0 1px,transparent 1px 35px),linear-gradient(90deg,#76657a,#4e4558)}
#flow-hero[data-gate-state=open] .record-gate-doors::before{transform:rotateY(73deg)}
#flow-hero[data-gate-state=open] .record-gate-doors::after{transform:rotateY(-73deg)}
#flow-hero[data-medium=chart]{grid-template-columns:1fr 1fr;grid-template-areas:'identity portrait' 'seal portrait' 'story story';border:10px double #a58c52;border-radius:16px;background:radial-gradient(circle at 18% 30%,#c5b07833 0 1px,transparent 2px) 0 0/29px 37px,#dce1db;box-shadow:inset 0 0 0 4px #243f4b55,0 14px 28px #1c304433}
#flow-hero[data-medium=chart] .hero-record{border:0;background:none;padding-bottom:0}
#flow-hero[data-medium=chart]>.illustration-page::after{content:none}
#flow-hero[data-medium=chart] .chapter-story{border-top:4px double #a89159;background:#f0ead9}
.record-orbit{display:block;position:relative;width:150px;height:150px;box-sizing:border-box;border:9px double #bca46c;border-radius:50%;background:radial-gradient(circle at 30% 30%,#e4d9ad 0 1px,transparent 2px),radial-gradient(circle at 70% 65%,#b6c5bf 0 1px,transparent 2px),repeating-conic-gradient(from 0deg,#dac591 0deg 1deg,transparent 1deg 30deg),#254653;box-shadow:inset 0 0 0 11px #23404b,0 4px 9px #24374044;transform:rotate(var(--record-orbit,0deg));transition:transform .24s ease-out}
.record-orbit::before{content:'';position:absolute;inset:20px 5px;border:3px solid #c6ad6c;border-radius:50%;transform:rotate(-35deg)}
.record-orbit::after{content:'';position:absolute;inset:7px 44%;background:linear-gradient(#e9d59d 0 45%,#a88a50 46% 55%,#6c8790 56%);clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
#flow-hero[data-medium=veil]{border:3px solid #93bdc3;border-radius:70px 14px 70px 14px;background:radial-gradient(ellipse at 45% 0,#f1ffff,#b9d0d6 55%,#88aebc);box-shadow:inset 0 0 0 8px #e2fcff66,0 12px 30px #163b4d33}
#flow-hero[data-medium=veil] .hero-record{margin:0;padding-top:36px;border-radius:0;background:none}
#flow-hero[data-medium=veil] .chapter-story{background:#edf5f3;border-top:1px solid #779da8}
.record-sphere{display:block;position:relative;width:154px;height:154px;box-sizing:border-box;overflow:hidden;border:3px double #b9e9eb;border-radius:50%;background:radial-gradient(circle at 30% 25%,#fbffffc9,transparent 20%),radial-gradient(circle at 45% 50%,#719baa 0,#23556c 60%,#123541);box-shadow:inset -15px -14px 20px #092d44aa,inset 6px 5px 9px #e1ffff9c,0 4px 10px #1b465644}
.record-sphere::before{content:'';position:absolute;inset:30% -10% -35%;border-top:2px solid #c3eff377;border-radius:44%;background:linear-gradient(#78bec45c,#143e64);transform:rotate(-12deg);transition:transform .2s ease-out}
.record-sphere::after{content:'';position:absolute;inset:17px 25px 36px 17px;border-left:2px solid #e7ffff99;border-top:1px solid #e7ffff99;border-radius:50%;transform:rotate(22deg)}
#flow-hero[data-sphere-view=skills] .record-sphere::before{transform:translateY(-28%) rotate(12deg)}
#flow-hero .artifact-veil input[type=range]{appearance:auto;box-sizing:border-box;width:220px;max-width:100%;height:36px;min-height:36px;padding:0;border:0;background:transparent;box-shadow:none;accent-color:#28677e}
#flow-hero .record-layer-labels{display:flex;justify-content:space-between;width:220px;max-width:100%;margin-top:0;font:13px/1.7 sans-serif;color:#315a65}
#flow-hero .artifact-veil input[hidden],#flow-hero .record-layer-labels[hidden]{display:none!important}
#flow-hero[data-medium=plate]{grid-template-columns:.8fr 1.2fr;grid-template-rows:minmax(0,.9fr) minmax(0,1.1fr);grid-template-areas:'portrait identity' 'story story';border:12px ridge #5b6152;border-radius:8px;background:#4c5448;box-shadow:inset 0 0 0 3px #999071,0 15px 28px #252c283d;color:#302e28}
#flow-hero[data-medium=plate] .chapter-story{background:#efe6d2;border-top:5px double #90825f}
#flow-hero[data-medium=plate]::after{content:'';position:absolute;pointer-events:none;inset:3px;border:1px solid #b5a581;border-radius:3px;background:linear-gradient(90deg,transparent 45%,#1b2527 45% 55%,transparent 55%) center top/100% 8px no-repeat}
@media(max-width:720px){
 #flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil]){grid-template-columns:minmax(0,1fr);grid-template-areas:'identity' 'portrait' 'seal' 'story';border-width:5px}
 #flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil])>.illustration-page{padding:18px 20px}
 #flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil]) .hero-record{padding:24px 20px 6px}
 #flow-hero:is([data-medium=folio],[data-medium=gate],[data-medium=chart],[data-medium=veil]) .hero-portrait{height:62dvh;min-height:260px;max-height:640px}
 #flow-hero .artifact-reader{padding:18px 20px 24px}
 #flow-hero[data-medium=gate]{border-radius:65px 65px 4px 4px}
 #flow-hero[data-medium=veil]{border-radius:45px 10px}
 #flow-hero[data-medium=plate]{border-width:7px}
}
@media(prefers-reduced-motion:reduce){
 #flow-hero .artifact-reader *,#flow-hero:is([data-rubbing-state],[data-gate-state],[data-astrolabe-view],[data-sphere-view]) .chapter-story{animation:none!important;transition:none!important}
 #flow-hero .artifact-reader ::before,#flow-hero .artifact-reader ::after{transition:none!important}
}

/* 공통 로고와 상단 높이에 맞춘 계정·소리창 */
.brand-lockup > .brand-logo {display:block;width:246px;height:auto;flex:none;}
.brand-lockup > .brand-copy {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;}
.studio-header > .bgm-player {position:static;}
.studio-header .bgm-controls,.studio-header > .access-card {top:calc(100% + 6px);}
@media (max-width:760px) {.brand-lockup > .brand-logo {width:160px;}}
