@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600&family=UnifrakturMaguntia&display=swap');
:root{color-scheme:dark;--bg:#100d11;--panel:#1b151b;--raised:#281c24;--line:#51404a;--text:#f1e7d8;--muted:#bcafb3;--accent:#983951;--bright:#eca9b5;--gold:#b79b73;--gothic:UnifrakturMaguntia,Georgia,serif;--serif:'Cormorant Garamond',Georgia,serif;--sans:Inter,system-ui,sans-serif;font-family:var(--sans);font-size:16px;background:var(--bg);color:var(--text)}
*{box-sizing:border-box}body{margin:0}a{color:inherit;text-underline-offset:4px}button,input,textarea,select{font:inherit}button,a,input,textarea,select{touch-action:manipulation}button,.button{border:1px solid var(--line);border-radius:3px;color:var(--text);background:var(--raised);padding:.65rem .9rem;cursor:pointer;font-size:.875rem;min-height:42px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:.4rem}button:hover,.button:hover{background:#33272e;border-color:#956572}button:disabled{opacity:.45;cursor:default}button.primary,.button.primary{background:#832c40;border-color:#a3495d;color:#fff}button.danger{color:#f6a6b6}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--bright);outline-offset:3px}input,textarea,select{width:100%;border:1px solid var(--line);border-radius:3px;background:#100f12;color:var(--text);padding:.7rem;min-height:44px}textarea{resize:vertical;line-height:1.6}label{display:block;font-size:.875rem;color:var(--muted);line-height:1.5}label>input,label>select,label>textarea{margin-top:.4rem}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:var(--serif);font-weight:500}h1{font-size:clamp(2.5rem,4vw,3.7rem);line-height:1.07;letter-spacing:-.025em}h2{font-size:2rem;line-height:1.15}h3{font-size:1.65rem}p{line-height:1.7}small{font-size:.8125rem}.muted{color:var(--muted)}.eyebrow{font:500 .75rem/1.7 var(--sans);letter-spacing:.17em;text-transform:uppercase;color:var(--muted)}.shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh}.sidebar{background:#151216;border-right:1px solid var(--line);position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:38px 24px 24px;overflow:auto}.brand{text-decoration:none;display:block;padding:0 6px 32px;border-bottom:1px solid var(--line)}.wordmark{display:block;font-family:var(--serif);font-size:3.3rem;line-height:.95;margin:22px 0 22px;letter-spacing:-.035em}.wordmark em{color:#cb8490;font-weight:400}.edition{font-size:.75rem;letter-spacing:.055em;color:#b4a6ae;line-height:1.7;display:block}.mode-label{font-size:.8125rem;color:#d08b98;margin:27px 10px 13px}.sidebar nav{display:grid;gap:4px}.sidebar nav button{justify-content:flex-start;background:transparent;border-color:transparent;padding:.65rem .7rem;gap:12px;font-size:.9375rem;color:#b9afb5}.sidebar nav button.active{background:#302027;color:#f5e8eb;border-left:2px solid var(--bright)}.nav-num{font-size:.75rem;opacity:.5;width:20px;font-variant-numeric:tabular-nums}.sidebar-foot{margin-top:auto;padding:32px 8px 0;display:grid;gap:10px;color:var(--muted);font-size:.8125rem}.workspace{min-width:0}.topbar{min-height:76px;padding:16px 38px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:18px}#breadcrumb{font-size:.75rem;letter-spacing:.13em;color:var(--muted)}.actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.actions a{font-size:.875rem}#saveStatus{font-size:.8125rem;color:var(--muted)}main{max-width:1580px;margin:auto;padding:38px}footer{padding:22px 38px;border-top:1px solid var(--line);font-size:.75rem;color:#8a7d87;letter-spacing:.12em;display:flex;justify-content:space-between}.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:30px}.page-head h1{margin-top:9px}.page-head p:not(.eyebrow){margin-top:12px;color:var(--muted);max-width:60ch}.panel{border:1px solid var(--line);background:var(--panel);border-radius:3px;padding:26px;min-width:0}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:22px}.panel-head h2{font-size:1.8rem}.grid{display:grid;gap:22px}.two{grid-template-columns:repeat(2,minmax(0,1fr))}.three{grid-template-columns:repeat(3,minmax(0,1fr))}.runner{grid-template-columns:minmax(0,1fr) 310px}.stack{display:grid;gap:22px;align-content:start}.empty{border:1px dashed #51404a;padding:54px 30px;text-align:center;color:var(--muted);display:grid;justify-items:center;gap:18px;min-height:220px}.empty h2{color:var(--text)}.empty p{max-width:50ch}.empty.compact{padding:28px 18px;min-height:140px}.scene-stage{min-height:300px;display:flex;flex-direction:column;justify-content:center;border-top:2px solid #91384c}.scene-stage blockquote{font:400 clamp(1.5rem,2.5vw,2.2rem)/1.5 var(--serif);margin:22px 0;white-space:pre-wrap}.scene-stage img{width:100%;max-height:450px;object-fit:contain;margin-top:18px}.section-gap{margin-top:26px}.section-title{display:flex;align-items:center;justify-content:space-between;margin:32px 0 18px;gap:16px}.card-list{display:grid;gap:14px}.record-card{border:1px solid var(--line);padding:22px;background:var(--panel);border-left:2px solid #79505a}.record-card header{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.record-card p{margin-top:12px;white-space:pre-wrap;overflow-wrap:anywhere}.record-card .meta{font-size:.8125rem;color:var(--muted);margin-top:7px}.record-card img{max-width:100%;max-height:400px;object-fit:contain;margin-top:16px}.record-card .actions{margin-top:18px}.pill{font-size:.75rem;letter-spacing:.04em;white-space:nowrap;padding:5px 9px;border:1px solid #624450;color:#dfa6b1;border-radius:2px}.body-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.full{grid-column:1/-1}.sheet-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:24px}.portrait{width:100%;height:270px;object-fit:contain;background:#100f12;border:1px solid var(--line)}.portrait-empty{height:270px;border:1px solid var(--line);display:grid;place-items:center;font:italic 1.5rem var(--serif);color:#846c7b}.traits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}.trait-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #2b252c;font-size:.875rem}.trait-row>button{background:transparent;border:0;padding:0;text-align:left;min-height:32px;justify-content:flex-start}.dots{display:flex;gap:4px;flex-shrink:0}.dot{padding:0;width:22px;min-height:30px;background:transparent;border:0;position:relative}.dot:before{content:'';width:12px;height:12px;border:1px solid #9d7c88;border-radius:50%}.dot.on:before{background:#d08d9a;border-color:#d08d9a}.dot:hover{background:#39252e}.track{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}.box{width:34px;height:36px;padding:0;border-color:#88606d;font-size:1.3rem}.box.superficial{color:#f1d3ae}.box.aggravated{color:#f399ae;background:#522032}.status-number{font:3rem var(--serif);color:#e2b8c1}.track-note{font-size:.8125rem;color:var(--muted);line-height:1.6}.save-bar{position:sticky;bottom:14px;z-index:5;display:flex;justify-content:space-between;align-items:center;gap:16px;background:#2b1c23eF;backdrop-filter:blur(10px);border:1px solid #895261;padding:14px 18px;margin-top:26px}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.tabs button.active{background:#562635;border-color:#b26277}.search{max-width:420px}.dice{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.die{width:54px;height:58px;font-size:1.4rem;background:#302b32;border-color:#63515d}.die.hunger{background:#7a263b;border-color:#c46479}.die.selected{outline:2px solid #fff;outline-offset:3px}.roll-result{border-top:1px solid var(--line);padding-top:20px;margin-top:24px}.roll-result strong{font:2.1rem var(--serif)}.roll-result p{margin-top:8px}.timer{font:2.6rem var(--serif);font-variant-numeric:tabular-nums;margin:12px 0}.tension{display:flex;gap:7px;margin-top:12px}.tension button{width:36px;padding:0}.tension button.on{background:#7c3041}.roster-row{display:flex;align-items:center;gap:13px;padding:13px 0;border-bottom:1px solid var(--line)}.roster-row img{width:48px;height:54px;object-fit:contain}.roster-row>div{flex:1}.roster-row strong{font-weight:500}.roster-row p{font-size:.8125rem;color:var(--muted)}.scene-list{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:22px}.scene-list button.active{background:#67293b;border-color:#be7184}dialog{background:#19161b;color:var(--text);border:1px solid #7a4d5e;border-radius:4px;max-width:800px;width:calc(100% - 32px);max-height:90vh;padding:28px}dialog::backdrop{background:#070509cc;backdrop-filter:blur(4px)}dialog header{display:flex;justify-content:space-between;gap:20px;margin-bottom:26px}#editorFields{display:grid;gap:18px;grid-template-columns:1fr 1fr}.form-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}#editorError{color:#ffa7b9;margin-top:12px}#reader{max-width:880px;padding:40px}#readBody{white-space:pre-wrap;font:1.8rem/1.6 var(--serif);margin-top:24px}#closeReader{float:right}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 40px);background:#3c2731;border:1px solid #a6637b;padding:16px 24px;z-index:20;display:none;font-size:.9375rem;box-shadow:0 12px 50px #0008}.skip{position:fixed;top:-100px;left:20px;z-index:100;background:#71384e;padding:12px}.skip:focus{top:12px}.mobile-only{display:none}[hidden]{display:none!important}#sheetMessage{font-size:.875rem}.check-label{display:flex;gap:10px;align-items:center}.check-label input{width:20px;min-height:20px}.divider{border:0;border-top:1px solid var(--line);margin:24px 0}.accent{color:var(--bright)}.member-row{display:flex;justify-content:space-between;gap:16px;padding:18px 0;border-bottom:1px solid var(--line)}.member-row p{font-size:.875rem;color:var(--muted)}
@media(min-width:1600px){main{padding:48px}.runner{grid-template-columns:minmax(0,1fr) 350px}}@media(max-width:1200px){.shell{grid-template-columns:220px minmax(0,1fr)}.sidebar{padding:28px 16px}.wordmark{font-size:2.8rem}.runner{grid-template-columns:1fr}.traits{grid-template-columns:1fr}.trait-row{max-width:520px}.sheet-layout{grid-template-columns:180px minmax(0,1fr)}.three{grid-template-columns:1fr}.topbar,main{padding:24px}}@media(max-width:760px){.shell{display:block}.sidebar{display:none;position:fixed;top:70px;bottom:0;height:auto;width:270px;z-index:12;box-shadow:30px 0 80px #000a}.sidebar.open{display:flex}.mobile-only{display:inline-flex}.topbar{padding:12px 16px;min-height:70px;position:sticky;top:0;background:#151216f5;z-index:11;flex-wrap:wrap}#breadcrumb{display:none}.actions{gap:8px}.actions #saveStatus{max-width:105px;font-size:.75rem}.topbar button{padding:.55rem .65rem}.topbar a{font-size:.8125rem}main{padding:26px 16px}.page-head{align-items:flex-start;flex-direction:column;gap:18px}.two,.field-grid,.sheet-layout{grid-template-columns:1fr}.panel{padding:20px}.sheet-layout>aside{display:grid;grid-template-columns:120px minmax(0,1fr);gap:16px;align-items:center}.portrait,.portrait-empty{height:155px}.traits{gap:24px}.dots{gap:2px}.dot{width:21px;min-height:34px}.trait-row{font-size:.9375rem}.save-bar{bottom:8px;flex-wrap:wrap}.empty{padding:34px 20px}footer{padding:20px 16px;font-size:.75rem;letter-spacing:0;gap:16px}#editorFields{grid-template-columns:1fr}dialog{padding:20px}#reader{padding:25px}.section-title{align-items:flex-start;flex-wrap:wrap}.member-row{flex-wrap:wrap}.wordmark{font-size:3rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Gothic folio: architectural ornament belongs to the frame, never the fields. */
body{background:radial-gradient(ellipse at 88% 0,#3e202e55,transparent 48%),var(--bg)}
::selection{background:#773047;color:#fff4e8}
.shell{grid-template-columns:280px minmax(0,1fr)}
.sidebar{background:linear-gradient(180deg,#241720,#140f15 64%);padding:24px 22px;border-right-color:#806448;box-shadow:inset -5px 0 0 #100d11,inset -6px 0 0 #51404a}
.brand{position:relative;text-align:center;padding:0 0 28px;border-bottom:1px solid #806448}
.brand:before{content:'';display:block;width:76px;height:94px;margin:0 auto 14px;background:url('/by-night/tracery.svg') center/contain no-repeat}
.brand:after{content:'◆';position:absolute;bottom:-9px;left:calc(50% - 13px);width:26px;background:#20151d;color:var(--gold);font-size:14px;line-height:18px}
.brand .eyebrow{font-size:.875rem;letter-spacing:.14em;color:#c8b391}
.wordmark{font-family:var(--gothic);font-size:3.65rem;line-height:1.04;letter-spacing:0;margin:17px 0 20px;color:#f4e7d1;text-shadow:0 2px 20px #d08d9a15}
.wordmark em{font-family:var(--serif);display:inline-block;font-size:1.06em;color:#dd9eab;font-style:italic;letter-spacing:-.05em;line-height:.95}
.edition{font-size:.875rem;letter-spacing:.035em;line-height:1.65;color:#c5b6b5}
.mode-label{font-family:var(--serif);font-size:1.2rem;font-style:italic;color:#d5b898;margin:27px 10px 12px}
.sidebar nav{gap:5px}
.sidebar nav button{padding:11px 10px;border-radius:0;color:#cbbec2;position:relative;transition:background .18s,color .18s}
.sidebar nav button:hover{background:#39222d;color:#fff0e0}
.sidebar nav button.active{background:linear-gradient(90deg,#642b3f,#351c28);border:1px solid #825065;border-left:3px solid #d1ae78;color:#fff0df;box-shadow:inset 0 1px #ffffff06}
.nav-num{font-family:var(--serif);font-size:1rem;color:#d8ba95;opacity:.8}
.sidebar-foot{font-size:.875rem;padding-top:30px;line-height:1.5}
.sidebar-foot>span{font-family:var(--serif);font-size:1.1rem;font-style:italic;text-align:center}
.topbar{min-height:78px;border-bottom:1px solid #65503d;background:#120e13d9;padding:18px 40px}
#breadcrumb{font-size:.875rem;letter-spacing:.14em;color:#ccb598}
#saveStatus{font-size:.875rem;color:#c6b8be}
main{padding:40px;max-width:1600px}
.page-head{position:relative;isolation:isolate;min-height:190px;padding:24px 0 30px;margin-bottom:32px;border-bottom:1px solid #806448;align-items:center}
.page-head:before{content:'';position:absolute;inset:0 0 7px;z-index:-2;background:linear-gradient(90deg,#39212b55,transparent 85%);border-top:1px solid #5c443a}
.page-head:after{content:'';position:absolute;right:20px;top:5px;bottom:10px;width:145px;background:url('/by-night/tracery.svg') center/contain no-repeat;opacity:.19;z-index:-1;pointer-events:none}
.page-head>div{padding-left:22px;max-width:100%;min-width:0}
.page-head>button{flex-shrink:0;margin-right:22px}
.page-head h1{font-size:clamp(2.65rem,4.4vw,4.5rem);line-height:1.06;max-width:20ch;text-wrap:balance;color:#f4e8d6}
.page-head .eyebrow{color:#d2b791;font-size:.875rem;letter-spacing:.15em}
.page-head p:not(.eyebrow){font-family:var(--serif);font-style:italic;font-size:1.35rem;color:#cbbac1;line-height:1.45}
h2{color:#ead7ba;letter-spacing:-.015em}h3{color:#e6ccb1}
.panel,.record-card{background:linear-gradient(135deg,#231b2255,transparent 55%),var(--panel);border-radius:0;box-shadow:0 8px 28px #0002}
.panel{border-color:#594550;border-top-color:#9a7858;padding:28px;position:relative}
.panel:before{content:'';position:absolute;left:7px;top:7px;width:13px;height:13px;border-left:1px solid #b79b7366;border-top:1px solid #b79b7366;pointer-events:none}
.panel-head{align-items:flex-start}.panel-head h2{font-size:1.9rem}
.record-card{border-left-color:#b28a64;padding:24px}
.record-card .meta,.track-note,.roster-row p,small{font-size:.875rem;color:var(--muted)}
.eyebrow{font-size:.875rem;color:#c3ad92;letter-spacing:.12em}
.empty{border:1px solid #74564e;outline:1px solid #59403755;outline-offset:-7px;background:radial-gradient(ellipse at top,#50263944,transparent 75%),#171117;min-height:260px;padding:34px 30px 40px;gap:16px}
.empty:before{content:'';display:block;width:62px;height:78px;background:url('/by-night/tracery.svg') center/contain no-repeat;opacity:.82}
.empty h2{font-size:2.25rem;color:#efdcbe}.empty p{color:#c4b5be}
.empty.compact{min-height:160px;padding:28px}.empty.compact:before{display:none}
.scene-stage{border-top:2px solid #b06878;background:radial-gradient(ellipse at top right,#52293c44,transparent 70%),#1c151c}
.scene-stage blockquote{border-left:1px solid #ac8762;padding:4px 0 4px 24px;font-size:clamp(1.65rem,2.5vw,2.3rem);color:#f0e0c9}
.section-title{padding-bottom:12px;border-bottom:1px solid #765b47}
.section-title h2:before{content:'◇';color:#b79b73;font-family:var(--serif);font-size:1.35rem;margin-right:12px}
button,.button{border-radius:1px;border-color:#705662;background:#2c2029;box-shadow:inset 0 1px #ffffff05;transition:background .16s,border-color .16s;color:#f4e7da}
button:hover,.button:hover{background:#47303c;border-color:#b18b81}
button.primary,.button.primary{background:linear-gradient(#85354c,#662339);border-color:#b96879;box-shadow:inset 0 1px #eaa0af30,0 3px 12px #0003;color:#fff3e8}
button.primary:hover,.button.primary:hover{background:#93435a;border-color:#e0a3b0}
input,textarea,select{border-radius:0;border-color:#654b59;background:#100d12;color:#f3e9df;line-height:1.5}
input::placeholder,textarea::placeholder{color:#a08e9c}
label{color:#c9b9c0;font-size:.9375rem}
.pill{border-radius:0;font-size:.875rem;color:#e3c59e;border-color:#8a6951;background:#32232a}
.portrait,.portrait-empty{border:1px solid #9b7859;outline:1px solid #9b785944;outline-offset:-7px;background:#130e14}
.portrait-empty{color:#c3a7b4;border-radius:48% 48% 0 0}
.trait-row{border-bottom-color:#45303f}.trait-row>button{box-shadow:none}
.dot{box-shadow:none}.dot:before{border-color:#b99ba4}.dot.on:before{background:#e0b89c;border-color:#e0b89c;box-shadow:0 0 7px #d5a68a22}
.box{border-color:#ab8291}.box.superficial{color:#f4d3a2}.box.aggravated{background:#68263e;color:#ffc0ce}
.timer,.status-number{color:#e8c99f;font-variant-numeric:tabular-nums}
.tabs button.active,.scene-list button.active{background:#60283e;border-color:#c89984;color:#fff0dc}
.die{background:#30212e;border-color:#a17f92;color:#f8e4c5}.die.hunger{background:#82243f;border-color:#eaa0b3;color:#fff4e9}
.save-bar{background:#2e1c29f5;border-color:#b48b69;box-shadow:0 6px 30px #0008}
.divider{border-top-color:#6c5045}
dialog{border-radius:0;border:1px solid #b08b65;background:radial-gradient(ellipse at top right,#4e283c66,transparent 65%),#1c151c;box-shadow:0 25px 100px #000b;outline:1px solid #b08b6544;outline-offset:-7px}
dialog header{border-bottom:1px solid #6f5147;padding-bottom:22px}
dialog::backdrop{background:#09060bdf;backdrop-filter:blur(5px)}
#readBody{color:#ecdcc4}#toast{background:#342031;border-color:#c49e76}
footer{border-top:1px solid #705440;color:#bca5ad;font-size:.875rem;letter-spacing:.09em;line-height:1.6;gap:20px;background:#130e14}
footer span{font-family:var(--serif);font-style:italic;font-size:1.1rem;letter-spacing:.04em;color:#c5ac8e}
@media(min-width:1600px){main{padding:48px}.runner{grid-template-columns:minmax(0,1fr) 350px}}
@media(max-width:1200px){.shell{grid-template-columns:244px minmax(0,1fr)}.sidebar{padding:24px 16px}.wordmark{font-size:3.2rem}.brand .eyebrow{letter-spacing:.07em}.topbar,main{padding:26px}.page-head{min-height:175px}.page-head h1{font-size:3.3rem}.page-head>div{padding-left:18px}.page-head>button{margin-right:12px}.panel{padding:24px}}
@media(max-height:850px) and (min-width:761px){.brand:before{width:48px;height:58px;margin-bottom:10px}.brand{padding-bottom:22px}.wordmark{margin:12px 0 16px;font-size:3.1rem}.sidebar{padding-top:18px}.sidebar nav button{padding-top:9px;padding-bottom:9px}.mode-label{margin-top:22px}}
@media(max-width:760px){.shell{display:block}.sidebar{width:280px;top:70px;padding:24px 22px}.brand:before{width:50px;height:62px}.wordmark{font-size:3.4rem}.topbar{padding:12px 16px;background:#170f18f5;min-height:70px}.actions #saveStatus{font-size:.875rem;max-width:115px}.topbar a{font-size:.875rem}main{padding:22px 16px}.page-head{min-height:180px;padding:22px 18px 28px;gap:20px;align-items:flex-start}.page-head>div{padding:0}.page-head>button{margin:0}.page-head:after{right:5px;width:110px;opacity:.13}.page-head h1{font-size:clamp(2.55rem,9vw,3.5rem)}.page-head .eyebrow{font-size:.875rem;letter-spacing:.07em}.page-head p:not(.eyebrow){font-size:1.2rem}.panel{padding:22px}.panel-head{flex-wrap:wrap;gap:12px}.empty{padding:28px 22px 34px;min-height:240px}.empty h2{font-size:2rem}.empty:before{width:52px;height:65px}.scene-stage blockquote{padding-left:16px}.record-card{padding:20px}.record-card header{flex-wrap:wrap}.section-title{gap:10px}.sheet-layout>aside{grid-template-columns:110px minmax(0,1fr)}.portrait,.portrait-empty{height:155px}footer{font-size:.875rem;padding:20px 16px;letter-spacing:.04em;flex-wrap:wrap}footer span{font-size:1rem}.form-actions{flex-wrap:wrap}.tension{gap:6px}.tension button{width:34px}.trait-row{gap:6px}.trait-row>button{font-size:.875rem}.dots{gap:2px}.dot{width:21px}}
@media(prefers-reduced-motion:reduce){button,.button,.sidebar nav button{transition:none}}

/* ==========================================================================
   CHRONICLE FOLIO — PASS 4
   Information-first V5 sheet rhythm with romantic Dracula atmosphere.
   ========================================================================== */

:root{
  --bg:#0b0809;
  --panel:#120d0f;
  --raised:#1b1115;
  --line:#49363a;
  --line-soft:#2b2023;
  --text:#e8dfd4;
  --muted:#9b8f90;
  --accent:#86162e;
  --bright:#bd2744;
  --blood:#741125;
  --bone:#ddcfb9;
  --paper:#c7b598;
  --gold:#9e815e;
  --serif:'Cormorant Garamond',Georgia,serif;
  --sans:Inter,system-ui,sans-serif;
}

html{background:var(--bg)}
body{
  background:
    radial-gradient(circle at 82% -10%,#5c17282c,transparent 34%),
    linear-gradient(180deg,#0d090b,#090708 75%);
  color:var(--text);
}
body:before{
  content:'';
  position:fixed;
  inset:0;
  z-index:100;
  pointer-events:none;
  opacity:.08;
  background:
    repeating-linear-gradient(0deg,transparent 0 6px,#fff 7px,transparent 8px 18px);
  mix-blend-mode:soft-light;
}
::selection{background:#741125;color:#fff8ed}

.shell{grid-template-columns:236px minmax(0,1fr)}

.sidebar{
  padding:30px 18px 22px;
  background:linear-gradient(180deg,#160b10 0%,#0d090b 58%,#090708 100%);
  border-right:1px solid #3b2b30;
  box-shadow:6px 0 24px #0006;
}
.brand{
  padding:0 6px 27px;
  text-align:left;
  border-bottom:1px solid #3e2e33;
}
.brand:before{display:none}
.brand:after{
  content:'';
  left:6px;
  right:auto;
  bottom:-1px;
  width:54px;
  height:2px;
  background:#8e1932;
}
.brand .eyebrow{
  font:600 .64rem/1.4 var(--sans);
  letter-spacing:.18em;
  color:#8d7979;
}
.wordmark{
  margin:15px 0 15px;
  font-family:var(--serif);
  font-size:2.8rem;
  font-weight:500;
  line-height:.87;
  letter-spacing:-.055em;
  color:#e9ddce;
  text-shadow:none;
}
.wordmark em{
  display:inline;
  font-family:var(--gothic);
  color:#a92a43;
  font-size:.88em;
  font-style:normal;
  letter-spacing:0;
}
.edition{
  max-width:18ch;
  font:500 .64rem/1.55 var(--sans);
  letter-spacing:.1em;
  color:#766d6f;
}
.mode-label{
  margin:27px 8px 10px;
  font:italic 1rem/1 var(--serif);
  color:#af937d;
}
.sidebar nav{
  gap:0;
  border-top:1px solid #251b1e;
}
.sidebar nav button{
  min-height:43px;
  padding:9px 8px;
  border:0;
  border-bottom:1px solid #251b1e;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  clip-path:none;
  color:#9f9495;
  font:500 .8rem/1.2 var(--sans);
  letter-spacing:.025em;
  text-transform:none;
}
.sidebar nav button:before{display:none}
.sidebar nav button:hover{
  background:#1c1015;
  color:#e6dcd2;
}
.sidebar nav button.active{
  background:linear-gradient(90deg,#68132830,transparent 90%);
  border-left:2px solid #9d1f39;
  color:#eee1d3;
  box-shadow:none;
}
.nav-num{
  width:24px;
  font:600 .61rem/1 var(--sans);
  color:#7f6d6e;
  opacity:1;
}
.sidebar nav button.active .nav-num{color:#ba3c53}
.sidebar-foot{
  padding:25px 7px 0;
  border:0;
  color:#665b5e;
  text-align:left;
}
.sidebar-foot>span{
  font:italic .87rem/1.45 var(--serif);
  color:#75686a;
  text-align:left;
}

.topbar{
  min-height:64px;
  padding:12px 34px;
  border-bottom:1px solid #302327;
  background:#0b0809ec;
  box-shadow:none;
}
#breadcrumb{
  color:#887a7c;
  font:600 .63rem/1 var(--sans);
  letter-spacing:.17em;
}
#breadcrumb:before{
  content:'';
  display:inline-block;
  width:17px;
  height:1px;
  margin:0 10px 3px 0;
  background:#7d1930;
}
#saveStatus{
  font:500 .7rem/1 var(--sans);
  color:#756b6d;
}

main{
  width:min(100%,1360px);
  max-width:none;
  margin:0 auto;
  padding:44px 48px 70px;
}

.page-head{
  min-height:0;
  margin:0 0 44px;
  padding:0 0 22px;
  overflow:visible;
  align-items:flex-end;
  border:0;
  border-bottom:1px solid #4d393d;
  background:none;
  box-shadow:none;
}
.page-head:before{
  content:'';
  position:absolute;
  left:0;
  bottom:-1px;
  width:94px;
  height:2px;
  border:0;
  background:#8c1730;
}
.page-head:after{display:none}
.page-head-copy{
  max-width:900px;
  padding:0;
}
.page-head-action{
  flex-shrink:0;
  padding-bottom:3px;
}
.page-head h1{
  max-width:none;
  margin:4px 0 0;
  font-family:var(--serif);
  font-size:clamp(3.1rem,5vw,5.35rem);
  font-weight:500;
  line-height:.9;
  letter-spacing:-.05em;
  text-transform:none;
  color:#eee1d0;
  text-shadow:none;
}
.page-head .eyebrow,
.eyebrow{
  color:#a48a74;
  font:600 .65rem/1.5 var(--sans);
  letter-spacing:.17em;
  text-transform:uppercase;
}
.page-head p:not(.eyebrow){
  margin-top:12px;
  padding:0;
  border:0;
  color:#95898b;
  font:italic 1.08rem/1.45 var(--serif);
}
.page-head p:not(.eyebrow):before{display:none}

h1,h2,h3{
  font-family:var(--serif);
  font-weight:500;
  color:#ded0bd;
}
h2{font-size:2rem;letter-spacing:-.025em}
h3{font-size:1.45rem;letter-spacing:-.015em}

button,.button{
  min-height:38px;
  padding:.58rem .82rem;
  border:1px solid #584047;
  border-radius:0;
  clip-path:none;
  background:#171014;
  box-shadow:none;
  color:#d6c8bd;
  font:600 .67rem/1 var(--sans);
  letter-spacing:.08em;
  text-transform:uppercase;
}
button:hover,.button:hover{
  background:#24141a;
  border-color:#803146;
  color:#f5e9dc;
}
button.primary,.button.primary{
  border-color:#9d3148;
  background:#76142b;
  box-shadow:none;
  color:#fff0df;
}
button.primary:hover,.button.primary:hover{
  border-color:#bf4b62;
  background:#8a1831;
}
button.danger{background:#1c0d12;border-color:#5f2b39;color:#d88191}

input,textarea,select{
  border:0;
  border-bottom:1px solid #544047;
  border-radius:0;
  background:#0d090b;
  box-shadow:none;
  color:#e5dbd0;
  padding:.67rem .25rem .58rem;
  font-family:var(--serif);
  font-size:1rem;
}
input:focus,textarea:focus,select:focus{
  border-color:#a42e48;
  box-shadow:none;
  background:#100a0d;
}
textarea{
  border:1px solid #49363b;
  padding:.75rem .8rem;
}
label{
  color:#9b8f90;
  font:600 .67rem/1.45 var(--sans);
  letter-spacing:.055em;
  text-transform:uppercase;
}
label>input,label>select,label>textarea{margin-top:.35rem}

.panel,.record-card{
  border-radius:0;
  clip-path:none;
  background:none;
  box-shadow:none;
}
.panel{
  padding:24px 0;
  border:0;
  border-top:1px solid #49363b;
}
.panel:before,.panel:after,.record-card:before{display:none}
.panel-head{
  margin-bottom:19px;
  padding:0 0 11px;
  border-bottom:1px solid #2d2225;
}
.panel-head:after{display:none}
.panel-head h2{font-size:1.8rem}

.grid{gap:30px}
.stack{gap:30px}

.folio-section{
  padding:26px 0 4px;
  border-top:1px solid #4a373b;
}
.folio-heading,
.sheet-section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
  margin-bottom:22px;
}
.folio-heading h2,
.sheet-section-head h2{margin-top:2px}
.folio-heading.compact{margin-bottom:12px}

.record-card{
  padding:19px 0 21px;
  border:0;
  border-bottom:1px solid #33272a;
}
.record-card:hover{
  border-color:#51343d;
  background:none;
}
.record-card header{
  padding:0;
  border:0;
  align-items:flex-start;
}
.record-kicker{
  margin-bottom:3px;
  color:#856f6b;
  font:600 .61rem/1.4 var(--sans);
  letter-spacing:.11em;
  text-transform:uppercase;
}
.record-card h3{
  color:#d9cbb8;
  font-size:1.6rem;
}
.record-card p{
  margin-top:10px;
  max-width:76ch;
  color:#b8acad;
}
.record-card .meta{display:none}
.record-card .record-detail{
  padding-left:14px;
  border-left:1px solid #603345;
}
.record-card img{
  margin-top:17px;
  max-height:460px;
  border:1px solid #47353a;
}
.record-card .actions{margin-top:14px}

.card-list{gap:0}
.section-title{
  margin:42px 0 12px;
  padding:0 0 10px;
  border-bottom:1px solid #4b373c;
}
.section-title:before{display:none}
.section-title:after{
  width:54px;
  height:1px;
  background:#84223a;
}
.section-title h2:before{display:none}

.empty{
  min-height:170px;
  padding:34px 0;
  justify-items:start;
  text-align:left;
  border:0;
  border-top:1px solid #453338;
  border-bottom:1px solid #2d2225;
  background:none;
  box-shadow:none;
}
.empty:before{
  content:'—';
  width:auto;
  height:auto;
  margin:0;
  background:none;
  color:#7e1a31;
  font:400 1.2rem/1 var(--serif);
}
.empty:after{display:none}
.empty h2{
  font-size:2rem;
  color:#cdbda8;
}
.empty p{color:#8e8385}
.empty.compact{min-height:125px;padding:25px 0}

.night-layout{
  display:grid;
  grid-template-columns:minmax(0,1.75fr) minmax(270px,.75fr);
  gap:52px;
}
.night-main,.night-rail{min-width:0}
.night-rail{
  padding-left:28px;
  border-left:1px solid #392a2e;
}
.feature-scene{
  padding:0 0 40px;
  border-bottom:1px solid #4a373c;
}
.feature-scene-label{
  color:#a98f75;
  font:600 .65rem/1 var(--sans);
  letter-spacing:.18em;
  text-transform:uppercase;
}
.feature-scene-rule{
  width:58px;
  height:2px;
  margin:13px 0 22px;
  background:#8e1731;
}
.feature-scene h2{
  font-size:clamp(2.5rem,4.4vw,4.7rem);
  line-height:.91;
  max-width:16ch;
  color:#e6d6c0;
}
.feature-scene blockquote{
  max-width:33ch;
  margin:24px 0 0;
  padding-left:20px;
  border-left:1px solid #795a48;
  color:#c8b7aa;
  font:italic 1.42rem/1.5 var(--serif);
  white-space:pre-wrap;
}
.feature-scene img{
  width:100%;
  max-height:540px;
  margin-top:25px;
  object-fit:cover;
  object-position:center;
  filter:saturate(.8) contrast(1.04);
}
.character-glance{
  padding:0 0 28px;
  border-bottom:1px solid #463338;
}
.character-glance h2{
  margin-top:5px;
  font-size:2.2rem;
  line-height:.96;
}
.character-glance>p:not(.eyebrow){
  margin-top:9px;
  color:#8f8385;
  font:italic 1.04rem/1.4 var(--serif);
}
.character-glance .actions{margin-top:19px}
.notice-ledger{border-top:0;padding-top:28px}

.coterie-layout{
  display:grid;
  grid-template-columns:minmax(320px,.85fr) minmax(0,1.35fr);
  gap:54px;
}
.coterie-roster{border-top:1px solid #4a373b}
.coterie-records .record-card:first-child{padding-top:0}

.roster-row{
  padding:13px 0;
  border-bottom:1px solid #302428;
}
.roster-row img{
  width:50px;
  height:58px;
  border:1px solid #4b383d;
  object-fit:cover;
}
.roster-row strong{
  color:#d5c6b3;
  font-family:var(--serif);
  font-size:1.08rem;
  font-weight:500;
}
.roster-row p{
  color:#827779;
  font:italic .86rem/1.3 var(--serif);
}

/* Character sheet */
.character-sheet{
  display:grid;
  gap:0;
}
.sheet-identity{
  display:grid;
  grid-template-columns:minmax(230px,300px) minmax(0,1fr);
  gap:42px;
  padding:0 0 38px;
  border-bottom:1px solid #513b40;
}
.sheet-portrait-column{min-width:0}
.portrait,.portrait-empty{
  width:100%;
  height:390px;
  border:1px solid #4b373c;
  border-radius:0;
  outline:0;
  clip-path:none;
  background:#0a0708;
  box-shadow:none;
}
.portrait{object-fit:cover;object-position:center top}
.portrait-empty{
  display:grid;
  place-items:end start;
  padding:20px;
  color:#715f62;
  font:italic 1.25rem/1.2 var(--serif);
}
.portrait-tools{
  margin-top:14px;
}
.portrait-tools input[type=file]{
  font-family:var(--sans);
  font-size:.7rem;
}
.identity-intro{
  margin-bottom:25px;
  padding-bottom:16px;
  border-bottom:1px solid #33262a;
}
.identity-intro h2{
  margin-top:2px;
  font-size:clamp(2.65rem,4.3vw,4.5rem);
  line-height:.9;
  color:#e7d8c3;
}
.identity-intro .muted{
  margin-top:7px;
  font:italic 1rem/1.4 var(--serif);
}
.identity-grid{gap:18px 24px}
.identity-grid textarea{min-height:90px}

.sheet-vitals{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:0;
  margin:0;
  border-bottom:1px solid #513b40;
}
.vital-control{
  min-width:0;
  padding:20px 18px 19px;
  border-right:1px solid #302428;
}
.vital-control:first-child{padding-left:0}
.vital-control:last-child{padding-right:0;border-right:0}
.vital-control>span,
.vital-control>label{
  display:block;
  color:#8f7d7e;
  font:600 .62rem/1.35 var(--sans);
  letter-spacing:.08em;
  text-transform:uppercase;
}
.vital-control select,
.vital-control input{
  margin-top:5px;
  padding:.15rem 0 .25rem;
  color:#d9c7ae;
  font:500 1.8rem/1 var(--serif);
  border-bottom:0;
  background:transparent;
}
.vital-control label input{font-size:1.8rem}

.sheet-tracks{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:50px;
  padding:30px 0 33px;
  border-bottom:1px solid #513b40;
}
.track-block{min-width:0}
.sheet-tracks h2{font-size:1.75rem}
.track{
  margin:8px 0 0;
}
.box{
  width:31px;
  height:31px;
  border:1px solid #71535e;
  background:transparent;
  box-shadow:none;
  font-family:var(--serif);
}
.box.superficial{color:#d9bd93}
.box.aggravated{background:#64152a;color:#f5b8c1}
.track-note{
  margin-top:7px;
  color:#756b6d;
  font:italic .8rem/1.35 var(--serif);
}

.sheet-section{
  padding:38px 0 42px;
  border-bottom:1px solid #513b40;
}
.sheet-section:last-of-type{border-bottom:0}
.sheet-section-head{
  margin-bottom:24px;
}
.sheet-section-head .muted{
  max-width:300px;
  color:#796f71;
  font:italic .85rem/1.35 var(--serif);
  text-align:right;
}
.sheet-ratings .traits{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:42px;
}
.traits section h3{
  margin-bottom:7px;
  padding-bottom:8px;
  border-bottom:1px solid #49363b;
  color:#ad8e76;
  font-size:1rem;
  font-style:italic;
}
.trait-row{
  padding:8px 0;
  border-bottom:1px solid #261d20;
}
.trait-row>button{
  min-height:28px;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
  color:#bfb3aa;
  font:500 .82rem/1 var(--sans);
  letter-spacing:0;
  text-transform:none;
}
.trait-row>button:hover{color:#e5d9cf}
.dots{gap:5px}
.dot{
  width:17px;
  min-height:28px;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
.dot:before{
  width:10px;
  height:10px;
  border:1px solid #776269;
  background:#0c090a;
}
.dot.on:before{
  background:#9a1b35;
  border-color:#b64b5f;
  box-shadow:none;
}
.dot:hover{background:transparent}
.dot:hover:before{border-color:#bd6a79}
.details-grid{gap:24px 28px}
.details-grid textarea{min-height:115px}

.save-bar{
  position:sticky;
  bottom:10px;
  margin-top:24px;
  padding:13px 16px;
  border:1px solid #4f3940;
  border-left:2px solid #8c1b34;
  background:#0d090bea;
  box-shadow:0 10px 30px #0008;
  clip-path:none;
  backdrop-filter:blur(12px);
}
#sheetMessage{
  color:#7e7375;
  font:italic .85rem/1 var(--serif);
}

/* Shared table dice */
.dice-table-layout{
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(420px,1.1fr);
  gap:54px;
  align-items:start;
}
.dice-roller{
  min-width:0;
  padding-top:3px;
}
.dice-controls{
  gap:18px 24px;
}
.dice-roller .roll-result{
  margin-top:30px;
  padding-top:24px;
  border-top:1px solid #4a373c;
}
.dice{
  gap:8px;
  margin:17px 0;
}
.die{
  width:50px;
  height:52px;
  border:1px solid #5e4850;
  border-radius:0;
  clip-path:none;
  background:#181115;
  box-shadow:none;
  color:#e2d5c5;
  font:500 1.35rem/1 var(--serif);
}
.die.hunger{
  border-color:#913047;
  background:#71142b;
  color:#fff1e1;
}
.die.selected{outline:1px solid #c4a47a}
.willpower-note{
  margin-top:32px;
  padding:22px 0 0;
  border-top:1px solid #33262a;
}
.willpower-note h3{font-size:1.35rem}
.willpower-note p{
  margin-top:6px;
  color:#887d7f;
  font:italic .9rem/1.45 var(--serif);
}
.table-ledger{
  min-width:0;
  padding-left:30px;
  border-left:1px solid #3d2e32;
}
.live-mark{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#a95364;
  font:600 .61rem/1 var(--sans);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.live-mark:before{
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:#a9233e;
  box-shadow:0 0 0 3px #6a18282b;
}
.table-roll{
  padding:17px 0 20px;
  border-top:1px solid #302428;
}
.table-roll:first-child{border-top:1px solid #4a373c}
.table-roll-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  color:#8a7d7f;
  font:500 .72rem/1.2 var(--sans);
}
.table-roll-head strong{
  color:#cdbca9;
  font-family:var(--serif);
  font-size:1.05rem;
  font-weight:500;
}
.table-roll-head span{color:#776c6e}
.table-roll-head time{
  color:#655c5e;
  font-size:.65rem;
  white-space:nowrap;
}
.table-roll-label{
  margin-top:5px;
  color:#9e8c83;
  font:italic .92rem/1.3 var(--serif);
}
.mini-dice{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin:12px 0 10px;
}
.mini-die{
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border:1px solid #514047;
  color:#cfc2b6;
  font:500 .9rem/1 var(--serif);
}
.mini-die.hunger{
  border-color:#8e2b42;
  background:#5d1225;
  color:#f5d9d8;
}
.table-roll-result{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:baseline;
}
.table-roll-result strong{
  color:#c7b7a6;
  font:500 1rem/1.25 var(--serif);
}
.table-roll-result span{
  color:#766c6e;
  font-size:.72rem;
}
.roll-empty{
  padding:30px 0;
  border-top:1px solid #423136;
}
.roll-empty h3{
  margin-top:4px;
  color:#b7a690;
}
.roll-empty p:not(.eyebrow){
  margin-top:6px;
  color:#766c6e;
  font:italic .9rem/1.4 var(--serif);
}

/* Existing storyteller and utility surfaces stay functional but quieter. */
.scene-stage{
  border-top:1px solid #5a4248;
  background:none;
  box-shadow:none;
}
.scene-stage blockquote{
  border-left:1px solid #755647;
  color:#c9b8ab;
}
.scene-list{
  gap:5px;
  margin-bottom:28px;
  padding-bottom:12px;
  border-bottom:1px solid #35282c;
}
.scene-list button.active{
  background:#5e1327;
  border-color:#873248;
}
.tabs{
  gap:4px;
  padding-bottom:9px;
  border-bottom:1px solid #403035;
}
.tabs button{
  background:transparent;
  border-color:#392b30;
}
.tabs button.active{
  background:#3a1520;
  border-color:#6b3545;
  box-shadow:none;
}
.search{margin-top:20px}
.member-row{border-bottom:1px solid #302428}
dialog{
  border:1px solid #654c43;
  border-radius:0;
  outline:0;
  clip-path:none;
  background:#120d0f;
  box-shadow:0 30px 110px #000d;
}
dialog:before{display:none}
dialog header{border-bottom:1px solid #463338}
dialog::backdrop{background:#050304e8;backdrop-filter:blur(3px)}
#toast{
  border:1px solid #67434c;
  background:#1a1014;
  box-shadow:0 12px 45px #000a;
  clip-path:none;
}
footer{
  padding:18px 34px;
  border-top:1px solid #2f2327;
  background:#090708;
  color:#60575a;
  font:500 .62rem/1.4 var(--sans);
  letter-spacing:.11em;
}
footer:before{
  content:'';
  width:18px;
  height:1px;
  margin-right:8px;
  background:#73162b;
}
footer span{
  color:#695e60;
  font:italic .82rem/1.4 var(--serif);
  text-transform:none;
}

@media(max-width:1200px){
  .shell{grid-template-columns:218px minmax(0,1fr)}
  main{padding:36px 30px 60px}
  .night-layout{gap:36px}
  .night-rail{padding-left:22px}
  .coterie-layout{gap:38px}
  .sheet-identity{grid-template-columns:220px minmax(0,1fr);gap:30px}
  .portrait,.portrait-empty{height:340px}
  .sheet-vitals{grid-template-columns:repeat(3,1fr)}
  .vital-control:nth-child(3){border-right:0}
  .vital-control:nth-child(-n+3){border-bottom:1px solid #302428}
  .vital-control:nth-child(4){padding-left:0}
  .dice-table-layout{grid-template-columns:1fr 1fr;gap:34px}
}

@media(max-width:860px){
  .night-layout,.coterie-layout,.dice-table-layout{grid-template-columns:1fr}
  .night-rail,.table-ledger{
    padding-left:0;
    border-left:0;
    padding-top:30px;
    border-top:1px solid #443338;
  }
  .sheet-identity{grid-template-columns:180px minmax(0,1fr);gap:24px}
  .portrait,.portrait-empty{height:280px}
  .sheet-ratings .traits{grid-template-columns:1fr;gap:30px}
  .sheet-tracks{gap:28px}
}

@media(max-width:760px){
  .shell{display:block}
  .sidebar{
    width:276px;
    top:64px;
    padding:23px 18px;
    box-shadow:22px 0 60px #000d;
  }
  .wordmark{font-size:2.7rem}
  .topbar{min-height:64px;padding:10px 14px}
  main{padding:28px 16px 52px}
  .page-head{
    margin-bottom:32px;
    padding-bottom:18px;
    align-items:flex-start;
  }
  .page-head h1{font-size:clamp(2.8rem,13vw,4.5rem)}
  .page-head-action{padding-top:12px}
  .sheet-identity{grid-template-columns:1fr}
  .sheet-portrait-column{
    display:grid;
    grid-template-columns:130px minmax(0,1fr);
    gap:16px;
    align-items:start;
  }
  .portrait,.portrait-empty{height:180px}
  .portrait-tools{margin-top:0}
  .identity-intro h2{font-size:3rem}
  .sheet-vitals{grid-template-columns:repeat(2,1fr)}
  .vital-control{border-bottom:1px solid #302428}
  .vital-control:nth-child(odd){padding-left:0}
  .vital-control:nth-child(even){border-right:0}
  .vital-control:nth-last-child(-n+2){border-bottom:0}
  .sheet-tracks{grid-template-columns:1fr;gap:25px}
  .sheet-section-head{align-items:flex-start;flex-direction:column;gap:7px}
  .sheet-section-head .muted{text-align:left}
  .folio-heading{align-items:flex-start}
  .dice-table-layout{gap:28px}
  .table-roll-result{align-items:flex-start;flex-direction:column;gap:3px}
  footer{padding:17px 16px}
}

@media(prefers-reduced-motion:reduce){*{transition:none!important}}


/* Storyteller runner — continuous manuscript, not dashboard cards */
.scene-tabs{
  margin:0 0 28px;
  padding:0 0 12px;
  border-bottom:1px solid #32262a;
}
.scene-tabs:empty{
  min-height:1px;
  margin-bottom:22px;
}
.scene-tabs button{
  min-height:32px;
  padding:.42rem .68rem;
  border:0;
  border-bottom:1px solid transparent;
  background:transparent;
  color:#766b6d;
  font-size:.62rem;
}
.scene-tabs button:hover{
  background:transparent;
  border-bottom-color:#65404b;
  color:#c9bdb3;
}
.scene-tabs button.active{
  background:transparent;
  border:0;
  border-bottom:1px solid #a4243e;
  color:#e5d8cb;
}

.runner-tools{
  display:grid;
  grid-template-columns:1.05fr .9fr 1.45fr .95fr;
  gap:0;
  margin-bottom:46px;
  padding:15px 0 17px;
  border-top:1px solid #4b373c;
  border-bottom:1px solid #312529;
}
.runner-tool{
  min-width:0;
  padding:4px 22px;
  border-right:1px solid #2e2326;
}
.runner-tool:first-child{padding-left:0}
.runner-tool:last-child{padding-right:0;border-right:0}
.runner-tool .eyebrow{margin-bottom:10px}
.runner-tool .timer{
  margin:0;
  color:#d7c5aa;
  font-size:2rem;
  line-height:1;
}
.runner-tool p:not(.eyebrow){
  color:#8d8182;
  font:italic .9rem/1.35 var(--serif);
}
.compact-actions{
  margin-top:11px;
  gap:6px;
}
.compact-actions button,
.compact-actions .button{
  min-height:29px;
  padding:.4rem .58rem;
  font-size:.58rem;
}
.runner-tension .tension{
  margin:0;
  gap:4px;
}
.runner-tension .tension button{
  width:31px;
  min-height:31px;
  padding:0;
  color:#9c8f90;
}
.runner-tension .tension button.on{
  background:#702036;
  border-color:#84344a;
  color:#f0ddd4;
}
.text-link{
  display:inline-block;
  margin-top:8px;
  color:#af8290;
  font:500 .68rem/1 var(--sans);
  letter-spacing:.06em;
  text-transform:uppercase;
  text-decoration:none;
  border-bottom:1px solid #6e3344;
}

.runner-workspace{
  display:grid;
  grid-template-columns:minmax(0,1.8fr) minmax(250px,.62fr);
  gap:64px;
  align-items:start;
}
.runner-main{min-width:0}
.runner-ledger{
  min-width:0;
  padding-left:29px;
  border-left:1px solid #35282c;
}
.scene-opening{
  min-height:390px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  padding:44px 0 56px;
  border-top:1px solid #4a373c;
  border-bottom:1px solid #302428;
}
.scene-opening h2{
  max-width:12ch;
  margin-top:8px;
  color:#e6d5bd;
  font-size:clamp(2.8rem,5vw,5rem);
  line-height:.9;
}
.scene-opening>p:not(.eyebrow){
  max-width:43ch;
  margin-top:20px;
  color:#938789;
  font:italic 1.08rem/1.5 var(--serif);
}
.scene-opening .actions{margin-top:25px}

.scene-manuscript{
  position:relative;
  padding:2px 0 8px;
}
.scene-manuscript:before{
  content:'';
  position:absolute;
  left:-22px;
  top:4px;
  bottom:0;
  width:1px;
  background:linear-gradient(#7a1b31 0 90px,#3a2a2e 90px 72%,transparent);
}
.scene-manuscript-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:28px;
  margin-bottom:25px;
  padding-bottom:20px;
  border-bottom:1px solid #453338;
}
.scene-manuscript-head h2{
  max-width:15ch;
  margin-top:5px;
  color:#eadac4;
  font-size:clamp(3rem,5.2vw,5.4rem);
  line-height:.88;
}
.scene-purpose{
  margin-top:13px;
  max-width:54ch;
  color:#8f8184;
  font:italic 1.04rem/1.45 var(--serif);
}
.read-aloud{
  max-width:37ch;
  margin:0;
  padding:5px 0 5px 24px;
  border-left:1px solid #7b5a47;
  color:#cdbcae;
  font:italic 1.5rem/1.48 var(--serif);
  white-space:pre-wrap;
}
.scene-actions{
  margin-top:22px;
  padding-bottom:26px;
  border-bottom:1px solid #2f2427;
}
.scene-copy{
  padding:27px 0 30px;
  border-bottom:1px solid #2f2427;
}
.scene-copy .eyebrow{margin-bottom:10px}
.scene-copy .body-text{
  max-width:75ch;
  color:#aaa0a0;
  line-height:1.72;
}
.storyteller-copy{
  position:relative;
  padding-left:20px;
}
.storyteller-copy:before{
  content:'';
  position:absolute;
  left:0;
  top:27px;
  bottom:30px;
  width:2px;
  background:#6f152a;
}
.scene-pager{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding-top:24px;
}

.ledger-section{
  padding:0 0 31px;
  margin-bottom:31px;
  border-bottom:1px solid #302428;
}
.ledger-section:last-child{
  margin-bottom:0;
  border-bottom:0;
}
.ledger-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  margin-bottom:15px;
}
.ledger-heading h3{
  margin-top:2px;
  color:#cdbba5;
  font-size:1.55rem;
}
.ledger-heading button{
  min-height:28px;
  padding:.38rem .54rem;
  font-size:.56rem;
}
.runner-ledger .roster-row{
  padding:11px 0;
}
.runner-ledger textarea{
  min-height:160px;
  margin-top:11px;
  border:0;
  border-top:1px solid #3c2d31;
  border-bottom:1px solid #3c2d31;
  background:transparent;
}
.visually-soft{
  color:#7f7476;
  font-size:.61rem;
}
.runner-ledger .actions{margin-top:13px}

.runner-after{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:56px;
  margin-top:56px;
  padding-top:38px;
  border-top:1px solid #4a373c;
}
.runner-after-block{min-width:0}
.runner-after .folio-heading{
  margin-bottom:12px;
}
.runner-after .record-card:first-child{
  padding-top:8px;
}
.runner-after .feature-scene{
  padding-top:8px;
  border-bottom:0;
}
.runner-after .feature-scene h2{
  font-size:2.6rem;
}
.runner-after .feature-scene blockquote{
  font-size:1.12rem;
}
.runner-after .empty{
  min-height:125px;
  padding:22px 0;
}

@media(max-width:1200px){
  .runner-tools{grid-template-columns:1fr 1fr}
  .runner-tool:nth-child(2){border-right:0}
  .runner-tool:nth-child(-n+2){
    padding-bottom:17px;
    margin-bottom:15px;
    border-bottom:1px solid #2e2326;
  }
  .runner-tool:nth-child(3){padding-left:0}
  .runner-workspace{gap:42px}
}
@media(max-width:900px){
  .runner-workspace{grid-template-columns:1fr}
  .runner-ledger{
    padding-left:0;
    padding-top:30px;
    border-left:0;
    border-top:1px solid #3b2c30;
  }
  .runner-after{grid-template-columns:1fr;gap:38px}
}
@media(max-width:760px){
  .runner-tools{grid-template-columns:1fr}
  .runner-tool,
  .runner-tool:first-child,
  .runner-tool:nth-child(3){
    padding:13px 0;
    margin:0;
    border-right:0;
    border-bottom:1px solid #2e2326;
  }
  .runner-tool:last-child{border-bottom:0}
  .scene-manuscript:before{display:none}
  .scene-manuscript-head{flex-direction:column}
  .scene-opening{min-height:310px}
}


/* Heavy Gothic embellishment — preserve folio structure, deepen the architecture */
:root{
  --display:UnifrakturMaguntia,Georgia,serif;
  --serif:'Cormorant Garamond',Georgia,serif;
  --sans:Inter,system-ui,sans-serif;
  --ivory:#efe2cf;
  --ivory-dim:#cdbda7;
  --oxblood:#6f1024;
  --blood-bright:#b62948;
  --brass:#a88962;
  --brass-dark:#6f573f;
}

body{
  background:
    radial-gradient(circle at 80% 0,#4b102026,transparent 30%),
    radial-gradient(circle at 0 72%,#2f0c1620,transparent 30%),
    linear-gradient(180deg,#0d090a 0%,#090607 65%,#070506 100%);
}

body:after{
  content:'';
  position:fixed;
  right:-76px;
  top:7vh;
  width:220px;
  height:78vh;
  background:url('/by-night/tracery.svg') top center/contain no-repeat;
  opacity:.035;
  pointer-events:none;
  filter:sepia(.7) saturate(.8);
}

/* Three-font system */
.wordmark{
  font-family:var(--display);
  font-size:3.1rem;
  line-height:.88;
  letter-spacing:0;
  color:var(--ivory);
}
.wordmark em{
  font-family:var(--serif);
  font-style:italic;
  color:#c55b6b;
}
.page-head h1,
.feature-scene h2,
.gothic-window h2,
.scene-manuscript-head h2,
.identity-intro h2,
.folio-heading h2,
.sheet-section-head h2,
.character-glance h2,
.ledger-heading h3,
.record-card h3{
  font-family:var(--serif);
}
.page-head h1::first-letter,
.feature-scene h2::first-letter,
.gothic-window h2::first-letter,
.scene-manuscript-head h2::first-letter{
  font-family:var(--display);
  color:#d4b58e;
  font-size:1.12em;
  line-height:.72;
}
.eyebrow,
button,.button,
label,
.nav-num,
.sidebar nav button,
#breadcrumb,
#saveStatus,
.record-kicker,
.feature-scene-label,
.live-mark{
  font-family:var(--sans);
}

/* Header becomes a ceremonial threshold, not another card */
.page-head{
  position:relative;
  padding-bottom:28px;
  border-bottom:1px solid #6f5548;
}
.page-head:before{
  width:130px;
  height:2px;
  background:linear-gradient(90deg,#a5203d,#5e1427 65%,transparent);
}
.page-head-copy:before{
  content:'';
  position:absolute;
  right:12px;
  bottom:9px;
  width:118px;
  height:148px;
  background:url('/by-night/tracery.svg') center/contain no-repeat;
  opacity:.10;
  filter:sepia(.8) saturate(.75);
  pointer-events:none;
}
.page-head .eyebrow{
  color:#b29170;
  letter-spacing:.2em;
}
.page-head h1{
  color:var(--ivory);
  text-shadow:0 2px 18px #0008;
}
.page-head p:not(.eyebrow){
  color:#a28d88;
}

/* Sidebar gets the strongest blackletter so the display face has a real home */
.brand{
  position:relative;
  padding-top:6px;
}
.brand:before{
  display:block;
  content:'';
  width:50px;
  height:62px;
  margin:0 0 12px;
  background:url('/by-night/tracery.svg') center/contain no-repeat;
  opacity:.68;
  filter:sepia(.7) saturate(.8);
}
.brand .eyebrow{color:#9d8069}
.mode-label{
  color:#b6977d;
  font-family:var(--serif);
}

/* Gothic window: one major ornamental object, not lots of cards */
.gothic-window{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  min-height:310px;
  padding:44px 46px 40px;
  border:1px solid #725548;
  background:
    radial-gradient(ellipse at 82% 12%,#65182b38,transparent 34%),
    linear-gradient(180deg,#160d11 0%,#0d090b 100%);
  box-shadow:
    inset 0 0 0 7px #0c080a,
    inset 0 0 0 8px #4e3933,
    0 18px 44px #0004;
}
.gothic-window:before{
  content:'';
  position:absolute;
  z-index:-1;
  right:20px;
  top:14px;
  width:210px;
  height:265px;
  background:url('/by-night/tracery.svg') center/contain no-repeat;
  opacity:.22;
  filter:sepia(.8) saturate(.8);
}
.gothic-window:after{
  content:'';
  position:absolute;
  inset:15px;
  z-index:-1;
  border:1px solid #8b6a5133;
  pointer-events:none;
}
.gothic-window-empty{
  display:grid;
  grid-template-columns:90px minmax(0,1fr);
  align-items:center;
  gap:24px;
}
.gothic-window-mark{
  position:relative;
  z-index:1;
  color:#ae2844;
  font:400 5.4rem/.8 var(--display);
  text-align:center;
  text-shadow:0 3px 22px #000b;
}
.gothic-window-mark:before,
.gothic-window-mark:after{
  content:'';
  display:block;
  width:1px;
  height:44px;
  margin:0 auto 11px;
  background:linear-gradient(transparent,#957657);
}
.gothic-window-mark:after{
  margin:12px auto 0;
  background:linear-gradient(#957657,transparent);
}
.gothic-window-copy{
  position:relative;
  z-index:1;
  max-width:550px;
}
.gothic-window-copy h2{
  margin-top:5px;
  max-width:12ch;
  color:#ead8bf;
  font-size:clamp(2.5rem,4vw,4rem);
  line-height:.9;
}
.gothic-window-copy>p:not(.eyebrow){
  max-width:44ch;
  margin-top:17px;
  color:#a49591;
  font:italic 1.05rem/1.5 var(--serif);
}

.feature-scene{
  border-bottom:0;
}
.feature-scene .feature-scene-label,
.feature-scene .feature-scene-rule,
.feature-scene h2,
.feature-scene blockquote,
.feature-scene img{
  position:relative;
  z-index:1;
}
.feature-scene-rule{
  background:linear-gradient(90deg,#a9213e,#704329,transparent);
}
.feature-scene h2{
  color:#ead7bd;
}
.feature-scene blockquote{
  color:#c9b8a8;
  border-left-color:#9a7656;
}

/* Editorial sections pick up ornament through rules and initials, not containers */
.folio-section,
.character-glance,
.runner-after,
.sheet-section,
.sheet-identity,
.sheet-tracks,
.sheet-vitals{
  border-color:#654d43;
}
.folio-heading,
.sheet-section-head,
.panel-head{
  position:relative;
}
.folio-heading:after,
.sheet-section-head:after,
.panel-head:after{
  content:'';
  position:absolute;
  left:0;
  bottom:-9px;
  width:56px;
  height:1px;
  background:#8d1c35;
}
.folio-heading h2::first-letter,
.sheet-section-head h2::first-letter,
.character-glance h2::first-letter,
.ledger-heading h3::first-letter{
  font-family:var(--display);
  color:#c4a27d;
  font-size:1.1em;
}
.character-glance{
  position:relative;
}
.character-glance:before{
  content:'✦';
  position:absolute;
  right:0;
  top:-3px;
  color:#7d6247;
  font-size:.8rem;
}

/* Buttons get an engraved edge without becoming chunky boxes */
button,.button{
  position:relative;
  border-color:#684953;
  background:linear-gradient(180deg,#1b1014,#130c0f);
  box-shadow:inset 0 0 0 1px #0d080a;
}
button:after,.button:after{
  content:'';
  position:absolute;
  left:7px;
  right:7px;
  bottom:3px;
  height:1px;
  background:#7b5b4d33;
  pointer-events:none;
}
button.primary,.button.primary{
  background:linear-gradient(180deg,#8a1732,#5f1023);
  border-color:#a94a5e;
}

/* Narrative copy becomes warmer and more literary; utility remains sans */
.record-card p,
.feature-scene blockquote,
.scene-purpose,
.scene-copy .body-text,
.character-glance>p:not(.eyebrow),
.track-note,
.runner-tool p:not(.eyebrow),
.roll-empty p:not(.eyebrow){
  font-family:var(--serif);
}
.record-card p,
.scene-copy .body-text{
  font-size:1rem;
}
.record-card{
  border-bottom-color:#463238;
}
.record-card h3{color:#ddcbb2}
.record-kicker{color:#a08772}

/* Inputs remain functional but feel like annotations in a folio */
input,textarea,select{
  color:#eadfce;
  border-color:#654a51;
}
textarea{
  background:
    linear-gradient(180deg,#0d090b,#0a0708);
}
input:focus,textarea:focus,select:focus{
  border-color:#9d5d6c;
}

/* Storyteller manuscript embellishment */
.scene-manuscript:before{
  width:2px;
  background:linear-gradient(#9d1d39 0 100px,#6e503f 100px 72%,transparent);
}
.scene-manuscript-head{
  border-bottom-color:#60473f;
}
.scene-manuscript-head:after{
  content:'';
  display:block;
  position:absolute;
  right:0;
  bottom:-1px;
  width:70px;
  height:1px;
  background:#8d1d35;
}
.read-aloud{
  position:relative;
  border-left-color:#9e7a5b;
}
.read-aloud:before{
  content:'“';
  position:absolute;
  left:-4px;
  top:-24px;
  color:#6e1b30;
  font:400 3rem/1 var(--display);
}
.storyteller-copy:before{
  background:linear-gradient(#8e1731,#684837);
}
.runner-ledger{
  border-left-color:#5a433b;
}
.ledger-section{
  border-bottom-color:#49353a;
}

/* Character sheet: make portrait and section breaks feel ecclesiastical */
.portrait,.portrait-empty{
  border-color:#80614f;
  box-shadow:
    inset 0 0 0 6px #0d090a,
    inset 0 0 0 7px #4d3831;
}
.sheet-portrait-column:before{
  content:'';
  display:block;
  width:34px;
  height:42px;
  margin:0 auto -11px;
  position:relative;
  z-index:2;
  background:url('/by-night/tracery.svg') center/contain no-repeat;
  opacity:.5;
  filter:sepia(.8);
}
.traits section h3{
  color:#b99a79;
  font-family:var(--serif);
  font-size:1.06rem;
}
.dot.on:before{
  background:#a91f3c;
  border-color:#c36072;
}

/* Fine ornamental details in the rails */
.night-rail,
.table-ledger{
  border-left-color:#594139;
}
.night-rail:before,
.table-ledger:before,
.runner-ledger:before{
  content:'✦';
  display:block;
  width:20px;
  margin:0 0 18px -39px;
  color:#826547;
  text-align:center;
  font-size:.7rem;
}
.table-ledger:before{margin-left:-40px}
.runner-ledger:before{margin-left:-40px}

footer:before{
  width:28px;
  background:linear-gradient(90deg,#8d1933,#795c44);
}

@media(max-width:900px){
  .night-rail:before,
  .table-ledger:before,
  .runner-ledger:before{display:none}
  .gothic-window{padding:36px 30px}
  .gothic-window-empty{grid-template-columns:70px minmax(0,1fr)}
  .gothic-window-mark{font-size:4.4rem}
}
@media(max-width:760px){
  body:after{display:none}
  .page-head-copy:before{width:82px;height:103px;opacity:.07}
  .brand:before{width:38px;height:48px}
  .wordmark{font-size:2.7rem}
  .gothic-window{
    min-height:280px;
    padding:31px 23px;
  }
  .gothic-window:before{
    right:-12px;
    width:150px;
    height:190px;
    opacity:.14;
  }
  .gothic-window-empty{
    grid-template-columns:1fr;
    gap:10px;
  }
  .gothic-window-mark{
    display:none;
  }
  .gothic-window-copy h2{font-size:2.6rem}
}


/* ==========================================================================
   GLOBAL FOLIO RHYTHM — PASS 7
   Normalize spacing, padding, gutters, and empty states across every section.
   ========================================================================== */

:root{
  --space-1:.5rem;
  --space-2:.75rem;
  --space-3:1rem;
  --space-4:1.5rem;
  --space-5:2rem;
  --space-6:2.75rem;
  --space-7:3.5rem;
  --content-pad:clamp(1rem,3vw,3rem);
  --section-rule:#4f393f;
}

/* One content edge and one page rhythm */
main{
  width:min(100%,1360px);
  max-width:none;
  margin:0 auto;
  padding:var(--space-6) var(--content-pad) var(--space-7);
}

.page-head{
  min-height:0;
  margin:0 0 var(--space-6);
  padding:0 0 var(--space-4);
  gap:var(--space-4);
  align-items:flex-end;
}
.page-head>div,
.page-head>.page-head-copy,
.page-head-copy{
  padding-left:0;
  margin-left:0;
}
.page-head>button,
.page-head-action{
  margin-right:0;
}
.page-head h1{margin:.2rem 0 0}
.page-head p:not(.eyebrow){margin-top:.65rem}
.page-head-copy:before{bottom:0}

/* Universal section cadence */
.folio-section,
.sheet-section{
  padding:var(--space-5) 0;
}
.folio-heading,
.sheet-section-head,
.panel-head{
  margin-bottom:var(--space-4);
}
.section-title{
  margin:var(--space-6) 0 var(--space-3);
  padding:0 0 .7rem;
}
.section-gap{margin-top:var(--space-4)}
.stack{gap:var(--space-5)}
.grid{gap:var(--space-5)}
.actions{gap:.65rem}
.card-list{gap:0}

.panel{
  padding:var(--space-4) 0;
}
.panel-head{
  padding:0 0 .65rem;
}
.record-card{
  padding:var(--space-4) 0;
}
.record-card header{margin:0}
.record-card p{margin-top:.65rem}

/* Compact empty states everywhere except the dedicated Gothic scene window */
.empty,
.empty.compact{
  min-height:0;
  padding:var(--space-5) 0;
  gap:.75rem;
  justify-items:start;
  text-align:left;
  border:0;
  border-top:1px solid var(--section-rule);
  border-bottom:1px solid #2e2226;
  outline:0;
  background:none;
  box-shadow:none;
}
.empty:before{
  content:'—';
  display:block;
  width:auto;
  height:auto;
  margin:0;
  background:none;
  color:#8f1c35;
  font:400 1.15rem/1 var(--serif);
  opacity:1;
}
.empty:after{display:none}
.empty h2{
  margin:0;
  font-size:1.85rem;
  line-height:1.05;
}
.empty p{
  margin:0;
  max-width:55ch;
}

/* Global layout gutters */
.night-layout,
.coterie-layout,
.dice-table-layout{
  gap:clamp(2rem,4vw,3.5rem);
}
.runner-workspace{
  gap:clamp(2rem,4vw,4rem);
}
.night-rail,
.table-ledger,
.runner-ledger{
  padding-left:clamp(1.4rem,2.4vw,2rem);
}

/* Tonight */
.feature-scene{padding-bottom:var(--space-5)}
.character-glance{padding-bottom:var(--space-4)}
.notice-ledger{padding-top:var(--space-4)}

/* Chronicle, Reference, Handouts, Decisions */
.tabs{
  margin:0 0 var(--space-3);
  padding-bottom:.6rem;
}
.search{
  margin-top:var(--space-3);
  margin-bottom:var(--space-4);
}
.search input{margin-top:.35rem}
.member-row,
.roster-row{
  padding:.8rem 0;
}
.member-row:first-child,
.roster-row:first-child{
  padding-top:.45rem;
}

/* Character sheet */
.sheet-identity{
  gap:clamp(1.5rem,3vw,2.6rem);
  padding-bottom:var(--space-5);
}
.identity-intro{
  margin-bottom:var(--space-4);
  padding-bottom:var(--space-3);
}
.identity-grid,
.details-grid{
  gap:var(--space-3) var(--space-4);
}
.sheet-vitals{margin:0}
.vital-control{padding:var(--space-3)}
.sheet-tracks{
  gap:clamp(1.5rem,4vw,3rem);
  padding:var(--space-5) 0;
}
.sheet-ratings .traits{
  gap:clamp(1.5rem,3vw,2.5rem);
}
.save-bar{margin-top:var(--space-4)}

/* Dice */
.dice-controls{gap:var(--space-3) var(--space-4)}
.dice-roller .roll-result{
  margin-top:var(--space-5);
  padding-top:var(--space-4);
}
.willpower-note{
  margin-top:var(--space-5);
  padding-top:var(--space-4);
}
.table-roll{padding:var(--space-3) 0 var(--space-4)}

/* Storyteller runner */
.scene-tabs{margin-bottom:var(--space-4)}
.runner-tools{margin-bottom:var(--space-6)}
.runner-after{
  margin-top:var(--space-7);
  padding-top:var(--space-5);
  gap:clamp(2rem,4vw,3.5rem);
}
.ledger-section{
  padding-bottom:var(--space-5);
  margin-bottom:var(--space-5);
}
.scene-copy{padding:var(--space-5) 0}
.scene-actions{
  margin-top:var(--space-4);
  padding-bottom:var(--space-5);
}
.scene-opening{
  padding:var(--space-6) 0;
}

/* Gothic window stays ornate while obeying the same outer rhythm */
.gothic-window{
  min-height:280px;
  padding:clamp(1.75rem,4vw,2.75rem);
}
.gothic-window-copy>p:not(.eyebrow){margin-top:var(--space-3)}

/* Decorative offsets track the normalized rail gutter */
.night-rail:before,
.table-ledger:before,
.runner-ledger:before{
  margin-left:calc(-1 * clamp(1.75rem,2.9vw,2.4rem));
}

/* Forms/editors */
.field-grid{
  gap:var(--space-3) var(--space-4);
}
.form-actions{
  margin-top:var(--space-5);
}
#editorFields{
  gap:var(--space-3) var(--space-4);
}
dialog header{
  margin-bottom:var(--space-4);
}
dialog form{
  display:grid;
  gap:var(--space-4);
}

/* Responsive rhythm */
@media(max-width:1200px){
  main{
    padding:var(--space-5) clamp(1.25rem,3vw,2rem) var(--space-7);
  }
  .page-head{margin-bottom:var(--space-5)}
}
@media(max-width:900px){
  .night-rail,
  .table-ledger,
  .runner-ledger{
    padding-left:0;
    padding-top:var(--space-5);
  }
}
@media(max-width:760px){
  main{padding:var(--space-5) 1rem var(--space-7)}
  .page-head{
    margin-bottom:var(--space-5);
    padding-bottom:var(--space-3);
  }
  .folio-section,
  .sheet-section{padding:var(--space-4) 0}
  .empty,
  .empty.compact{padding:var(--space-4) 0}
  .gothic-window{padding:var(--space-5) var(--space-4)}
  .section-title{margin-top:var(--space-5)}
}


/* ==========================================================================
   WOW VAMPIRES — PASS 8
   Three-second clarity + one unmistakably vampiric focal moment per page.
   ========================================================================== */

main{
  position:relative;
  isolation:isolate;
}
main::before{
  content:'';
  position:absolute;
  z-index:-1;
  pointer-events:none;
  opacity:0;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  transition:opacity .5s ease;
}

/* Haunted page arrival: cinematic, brief, and restrained. */
#main>*{
  animation:page-reveal .46s cubic-bezier(.2,.72,.22,1) both;
}
@keyframes page-reveal{
  from{opacity:0;transform:translateY(7px);filter:blur(2px)}
  to{opacity:1;transform:translateY(0);filter:blur(0)}
}
@keyframes reliquary-drift{
  from{transform:translate3d(0,0,0) scale(1)}
  to{transform:translate3d(0,10px,0) scale(1.015)}
}
@keyframes roll-reveal{
  0%{opacity:0;transform:translateY(10px) scale(.985);filter:blur(4px)}
  62%{opacity:1;transform:translateY(-2px) scale(1.006);filter:blur(0)}
  100%{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes hunger-breathe{
  0%,100%{box-shadow:inset 0 0 0 1px #2d070f,0 0 0 #7b153000}
  50%{box-shadow:inset 0 0 0 1px #2d070f,0 0 24px #7b153044}
}
@keyframes omen-flicker{
  0%,100%{opacity:.16}
  47%{opacity:.23}
  51%{opacity:.10}
  55%{opacity:.21}
}

/* Each page gets one background relic. */
body[data-section="character"] main::before{
  right:-75px;
  top:70px;
  width:430px;
  height:690px;
  opacity:.075;
  background-image:url('/by-night/reliquary.svg');
  animation:reliquary-drift 18s ease-in-out infinite alternate;
}
body[data-section="dice"] main::before{
  left:39%;
  top:68px;
  width:390px;
  height:620px;
  opacity:.05;
  background-image:url('/by-night/reliquary.svg');
  animation:reliquary-drift 22s ease-in-out infinite alternate-reverse;
}
body[data-section="journal"] main::before{
  left:-115px;
  top:155px;
  width:315px;
  height:510px;
  opacity:.045;
  background-image:url('/by-night/reliquary.svg');
}
body[data-section="coterie"] main::before{
  right:-115px;
  top:180px;
  width:330px;
  height:520px;
  opacity:.045;
  background-image:url('/by-night/reliquary.svg');
}
body[data-section="notes"] main::before,
body[data-section="relationships"] main::before{
  right:-85px;
  top:150px;
  width:300px;
  height:490px;
  opacity:.035;
  background-image:url('/by-night/reliquary.svg');
}

/* ==========================================================================
   TONIGHT — the haven threshold
   ========================================================================== */

body[data-section="tonight"] .gothic-window{
  border-color:#876553;
  background:
    radial-gradient(circle at 14% 30%,#7d15302b,transparent 23%),
    radial-gradient(ellipse at 82% 12%,#65182b44,transparent 34%),
    linear-gradient(180deg,#170d11 0%,#0b0809 100%);
  box-shadow:
    inset 0 0 0 7px #0b0708,
    inset 0 0 0 8px #5f4438,
    0 24px 70px #0006;
}
body[data-section="tonight"] .gothic-window-copy:after{
  content:'';
  position:absolute;
  right:-12px;
  bottom:-8px;
  width:54px;
  height:54px;
  border-radius:50%;
  background:
    radial-gradient(circle at 36% 32%,#b13a50 0 7%,transparent 8%),
    radial-gradient(circle,#8a1831 0 45%,#5e0d20 46% 62%,#2c0911 63% 100%);
  box-shadow:
    inset 0 0 0 2px #c1677544,
    0 8px 24px #0007;
  opacity:.88;
}
body[data-section="tonight"] .gothic-window-copy:before{
  content:'†';
  position:absolute;
  right:4px;
  bottom:2px;
  z-index:1;
  width:22px;
  height:22px;
  color:#d1a47f;
  font:400 1.15rem/22px var(--display);
  text-align:center;
  opacity:.8;
}

.glance-portrait{
  width:92px;
  height:112px;
  margin:12px 0 16px;
  object-fit:cover;
  object-position:center top;
  clip-path:polygon(50% 0,100% 15%,100% 100%,0 100%,0 15%);
  border:1px solid #8b6a55;
  box-shadow:
    0 0 0 5px #0b0809,
    0 0 0 6px #5d4438,
    0 14px 28px #0005;
  filter:saturate(.82) contrast(1.04);
}
.character-glance h2{
  color:#ead8bf;
}

/* ==========================================================================
   CHARACTER — portrait, blood, identity
   ========================================================================== */

body[data-section="character"] .page-head{
  margin-bottom:2rem;
}
.vampire-identity{
  display:grid;
  grid-template-columns:96px minmax(0,1fr);
  gap:20px;
  align-items:center;
}
.identity-seal{
  position:relative;
  display:grid;
  place-items:center;
  width:88px;
  height:106px;
  isolation:isolate;
  clip-path:polygon(50% 0,100% 18%,100% 100%,0 100%,0 18%);
  background:
    radial-gradient(circle at 50% 52%,#77132966,transparent 48%),
    linear-gradient(180deg,#1b1014,#0c0809);
  border:1px solid #8a6a54;
  box-shadow:0 12px 32px #0007;
}
.identity-seal:before{
  content:'';
  position:absolute;
  inset:7px;
  z-index:-1;
  background:url('/by-night/reliquary.svg') center 13%/140% auto no-repeat;
  opacity:.27;
}
.identity-seal:after{
  content:'';
  position:absolute;
  left:17px;
  right:17px;
  bottom:11px;
  height:1px;
  background:linear-gradient(90deg,transparent,#a88962,transparent);
}
.identity-seal span{
  margin-top:8px;
  color:#d8b590;
  font:400 3.2rem/.8 var(--display);
  text-shadow:0 2px 16px #000a;
}
.identity-copy{min-width:0}
.identity-copy h2{
  text-wrap:balance;
}
body[data-section="character"] .sheet-portrait-column{
  position:relative;
}
body[data-section="character"] .sheet-portrait-column:before{
  width:52px;
  height:62px;
  margin-bottom:-15px;
  opacity:.72;
}
body[data-section="character"] .portrait,
body[data-section="character"] .portrait-empty{
  height:420px;
  clip-path:polygon(50% 0,100% 11%,100% 100%,0 100%,0 11%);
  border-color:#8c6a53;
  box-shadow:
    inset 0 0 0 6px #0c0809,
    inset 0 0 0 7px #604638,
    0 18px 48px #0007;
}
body[data-section="character"] .portrait{
  filter:saturate(.88) contrast(1.045);
}
body[data-section="character"] .sheet-vitals{
  position:relative;
}
body[data-section="character"] .sheet-vitals:before{
  content:'BLOOD & CONSCIENCE';
  position:absolute;
  left:0;
  top:-.72rem;
  padding-right:.75rem;
  background:#090607;
  color:#9f806b;
  font:600 .58rem/1 var(--sans);
  letter-spacing:.16em;
}
body[data-section="character"] .vital-control:first-child select{
  color:#d94a64;
  text-shadow:0 0 18px #85172e55;
}
body[data-section="character"] .vital-control:nth-child(4) select{
  color:#c9a579;
}
body[data-section="character"] .sheet-section{
  position:relative;
}
body[data-section="character"] .sheet-section:before{
  content:'';
  position:absolute;
  left:0;
  top:-1px;
  width:78px;
  height:1px;
  background:linear-gradient(90deg,#9b1d38,#8f6c51,transparent);
}

/* ==========================================================================
   COTERIE — bound by blood
   ========================================================================== */

body[data-section="coterie"] .coterie-roster{
  position:relative;
  padding-left:14px;
}
body[data-section="coterie"] .coterie-roster:before{
  content:'BOUND BY BLOOD';
  display:block;
  margin:0 0 18px;
  color:#9f806b;
  font:600 .58rem/1 var(--sans);
  letter-spacing:.18em;
}
body[data-section="coterie"] .coterie-roster:after{
  content:'';
  position:absolute;
  left:38px;
  top:86px;
  bottom:12px;
  width:1px;
  background:linear-gradient(#7e1730,#57383d 80%,transparent);
}
body[data-section="coterie"] .coterie-roster .roster-row{
  position:relative;
  z-index:1;
  min-height:76px;
  padding-left:0;
}
body[data-section="coterie"] .coterie-roster .roster-row:before{
  content:'';
  position:absolute;
  left:20px;
  top:35px;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#79162d;
  box-shadow:0 0 0 4px #0a0708,0 0 0 5px #68464c;
}
body[data-section="coterie"] .coterie-roster .roster-row img{
  position:relative;
  z-index:2;
  width:52px;
  height:64px;
  clip-path:polygon(50% 0,100% 15%,100% 100%,0 100%,0 15%);
  box-shadow:0 0 0 4px #0a0708;
}
body[data-section="coterie"] .coterie-records{
  position:relative;
}
body[data-section="coterie"] .coterie-records:before{
  content:'';
  display:block;
  width:68px;
  height:1px;
  margin:0 0 16px;
  background:linear-gradient(90deg,#9a1c37,#947255,transparent);
}

/* ==========================================================================
   CHRONICLE — private journal / blood manuscript
   ========================================================================== */

.chronicle-invocation{
  position:relative;
  display:flex;
  align-items:center;
  gap:18px;
  margin:-.25rem 0 1.8rem;
  color:#9e7f6e;
  font:italic 1rem/1.3 var(--serif);
}
.chronicle-invocation:before,
.chronicle-invocation:after{
  content:'';
  height:1px;
  flex:1;
  background:linear-gradient(90deg,transparent,#6e4f45);
}
.chronicle-invocation:after{
  background:linear-gradient(90deg,#6e4f45,transparent);
}
.chronicle-invocation span:before{
  content:'✦';
  margin-right:10px;
  color:#8b1b34;
  font-style:normal;
}
body[data-section="journal"] .card-list{
  position:relative;
  padding-left:34px;
}
body[data-section="journal"] .card-list:before{
  content:'';
  position:absolute;
  left:7px;
  top:0;
  bottom:0;
  width:1px;
  background:linear-gradient(#8b1b34,#5f413b 70%,transparent);
}
body[data-section="journal"] .record-journal{
  position:relative;
  padding:1.65rem 0 1.8rem;
}
body[data-section="journal"] .record-journal:before{
  content:'';
  position:absolute;
  left:-32px;
  top:2rem;
  width:15px;
  height:15px;
  border:1px solid #7b5d4c;
  transform:rotate(45deg);
  background:#130d10;
  box-shadow:inset 0 0 0 3px #0a0708;
}
body[data-section="journal"] .record-journal:first-child h3{
  font-size:2rem;
  color:#ecd8bb;
}
body[data-section="journal"] .record-journal:first-child h3::first-letter{
  font-family:var(--display);
  color:#c39f76;
  font-size:1.18em;
}

/* ==========================================================================
   TABLE DICE — blood ritual
   ========================================================================== */

.dice-roller{
  position:relative;
  isolation:isolate;
}
.dice-altar{
  position:absolute;
  z-index:-1;
  right:-22px;
  top:-48px;
  width:150px;
  height:235px;
  opacity:.16;
  background:url('/by-night/reliquary.svg') center/contain no-repeat;
}
.dice-altar span{
  position:absolute;
  left:50%;
  top:42%;
  transform:translate(-50%,-50%);
  color:#a12b43;
  font:400 3rem/1 var(--display);
}
body[data-section="dice"] .dice-roller>.folio-heading h2{
  font-size:2.65rem;
}
body[data-section="dice"] .dice-roller>.folio-heading h2::first-letter{
  font-family:var(--display);
  color:#c5a27b;
}
body[data-section="dice"] .table-ledger{
  position:relative;
}
body[data-section="dice"] .table-ledger:after{
  content:'';
  position:absolute;
  left:30px;
  right:0;
  top:59px;
  height:1px;
  background:linear-gradient(90deg,#77172e,#5e433e 42%,transparent);
  pointer-events:none;
}
.roll-result{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  margin-top:1.9rem;
  padding:2rem 1.75rem 1.7rem;
  border:1px solid #6e5049;
  background:
    radial-gradient(circle at 84% 22%,#5e15292f,transparent 31%),
    linear-gradient(180deg,#160d11,#0b0809);
  box-shadow:
    inset 0 0 0 7px #0b0708,
    inset 0 0 0 8px #49352f,
    0 20px 55px #0006;
  animation:roll-reveal .5s cubic-bezier(.2,.72,.22,1) both;
}
.roll-result:before{
  content:'';
  position:absolute;
  z-index:-2;
  right:-42px;
  top:-62px;
  width:220px;
  height:340px;
  background:url('/by-night/reliquary.svg') center/contain no-repeat;
  opacity:.11;
}
.roll-result:after{
  content:'';
  position:absolute;
  z-index:-1;
  inset:11px;
  border:1px solid #8a67473b;
  pointer-events:none;
}
.roll-omen{
  position:absolute;
  right:21px;
  top:18px;
  color:#7d1730;
  font:400 4.5rem/.85 var(--display);
  opacity:.17;
  animation:omen-flicker 6s ease-in-out infinite;
}
.roll-verdict{
  display:block;
  max-width:12ch;
  margin:.25rem 0 .2rem;
  color:#e8d4ba;
  font:400 clamp(2.3rem,4.5vw,4.4rem)/.88 var(--display);
  text-wrap:balance;
}
.roll-summary{
  margin-top:.45rem;
  color:#9f9190;
  font:italic 1rem/1.45 var(--serif);
}
.roll-result .dice{
  margin:1.25rem 0 .85rem;
}
.roll-result .die{
  position:relative;
  width:54px;
  height:57px;
  font-size:1.45rem;
  border-color:#6c555b;
  background:linear-gradient(180deg,#1b1417,#100b0d);
  box-shadow:0 7px 16px #0005;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.roll-result .die:nth-child(odd){transform:rotate(-1.2deg)}
.roll-result .die:nth-child(even){transform:rotate(1.1deg)}
.roll-result .die:hover:not(:disabled){
  transform:translateY(-2px) rotate(0);
  border-color:#a78379;
}
.roll-result .die.hunger{
  border-color:#a23c53;
  background:
    radial-gradient(circle at 35% 25%,#c44d5d33,transparent 32%),
    linear-gradient(180deg,#80162f,#4f0d1e);
  color:#ffe9df;
  animation:hunger-breathe 3.6s ease-in-out infinite;
}
.roll-result-messy{
  border-color:#98354a;
  background:
    radial-gradient(circle at 72% 18%,#a31d3f45,transparent 36%),
    radial-gradient(circle at 12% 85%,#6c102736,transparent 34%),
    #12090d;
}
.roll-result-messy .roll-verdict,
.roll-result-bestial .roll-verdict,
.roll-result-rouse-fail .roll-verdict{
  color:#d63a56;
  text-shadow:0 0 28px #8a142f55;
}
.roll-result-bestial{
  border-color:#7d283b;
  background:
    radial-gradient(circle at 82% 19%,#74172e52,transparent 34%),
    linear-gradient(180deg,#14090d,#080607);
}
.roll-result-critical .roll-verdict{
  color:#e1c09a;
  text-shadow:0 0 24px #a77d5238;
}
.roll-result-rouse-pass .roll-verdict{
  color:#d7c2a4;
}

/* ==========================================================================
   REFERENCE / HANDOUTS — occult archive
   ========================================================================== */

body[data-section="reference"] .tabs{
  position:relative;
}
body[data-section="reference"] .tabs:before{
  content:'INDEX OF THE NIGHT';
  display:block;
  width:100%;
  margin:0 0 10px;
  color:#8e7468;
  font:600 .56rem/1 var(--sans);
  letter-spacing:.18em;
}
body[data-section="reference"] .record-reference{
  position:relative;
  padding-left:24px;
}
body[data-section="reference"] .record-reference:before{
  content:'†';
  position:absolute;
  left:0;
  top:1.45rem;
  color:#87694f;
  font:400 1.1rem/1 var(--display);
}
body[data-section="handouts"] .section-title{
  position:relative;
}
body[data-section="handouts"] .section-title:before{
  content:'';
  display:block;
  width:24px;
  height:30px;
  margin-right:10px;
  background:url('/by-night/reliquary.svg') center 12%/120% auto no-repeat;
  opacity:.45;
}
body[data-section="handouts"] .record-card img{
  border-color:#84644f;
  box-shadow:
    0 0 0 6px #0a0708,
    0 0 0 7px #4e3931,
    0 16px 36px #0006;
}

/* ==========================================================================
   PRIVATE NOTES / RELATIONSHIPS — journal pages
   ========================================================================== */

body[data-section="notes"] .panel,
body[data-section="relationships"] .panel{
  position:relative;
  padding-top:1.2rem;
}
body[data-section="notes"] .panel:before,
body[data-section="relationships"] .panel:before{
  content:'PRIVATE';
  position:absolute;
  right:0;
  top:-.65rem;
  padding-left:.8rem;
  background:#090607;
  color:#7f655d;
  font:600 .55rem/1 var(--sans);
  letter-spacing:.2em;
}
body[data-section="notes"] textarea,
body[data-section="relationships"] textarea{
  min-height:56vh;
  padding:1.35rem 1.4rem;
  line-height:1.8;
  border:1px solid #59423f;
  background:
    repeating-linear-gradient(180deg,transparent 0 31px,#6d554419 32px,#6d554419 33px),
    radial-gradient(circle at 88% 4%,#68172a26,transparent 22%),
    #0d090b;
  color:#dbcdbf;
  font:400 1.08rem/1.8 var(--serif);
  box-shadow:inset 9px 0 0 #140b0f,inset 10px 0 0 #6b25375c;
}

/* ==========================================================================
   GENERAL DEPTH — interesting, never cluttered
   ========================================================================== */

.page-head h1{
  text-wrap:balance;
}
.page-head h1::after{
  content:'';
  display:inline-block;
  width:.32em;
  height:.06em;
  margin-left:.16em;
  vertical-align:.18em;
  background:#83182f;
  box-shadow:.4em 0 0 #75533f;
  opacity:.66;
}
.folio-heading h2,
.sheet-section-head h2,
.ledger-heading h3{
  text-wrap:balance;
}
.record-card{
  transition:transform .18s ease,border-color .18s ease;
}
.record-card:hover{
  transform:translateX(2px);
}
.sidebar nav button.active:after{
  background:linear-gradient(90deg,#8d1c35,#9e7c5c);
}
.topbar{
  backdrop-filter:blur(12px);
}
#saveStatus:before{
  content:'•';
  margin-right:.4rem;
  color:#8e1c35;
}

/* Mobile keeps the spectacle but prioritizes clarity. */
@media(max-width:900px){
  body[data-section="character"] main::before,
  body[data-section="dice"] main::before,
  body[data-section="journal"] main::before,
  body[data-section="coterie"] main::before,
  body[data-section="notes"] main::before,
  body[data-section="relationships"] main::before{
    opacity:.025;
    right:-130px;
    left:auto;
  }
  .vampire-identity{
    grid-template-columns:74px minmax(0,1fr);
    gap:14px;
  }
  .identity-seal{
    width:68px;
    height:82px;
  }
  .identity-seal span{font-size:2.5rem}
  body[data-section="character"] .portrait,
  body[data-section="character"] .portrait-empty{height:330px}
}
@media(max-width:760px){
  .page-head h1::after{display:none}
  .glance-portrait{
    width:78px;
    height:94px;
  }
  .dice-altar{opacity:.09;right:-50px}
  .roll-result{padding:1.55rem 1.25rem 1.35rem}
  .roll-verdict{font-size:2.55rem}
  .roll-omen{font-size:3.7rem}
  body[data-section="journal"] .card-list{padding-left:25px}
  body[data-section="journal"] .record-journal:before{left:-24px}
  body[data-section="coterie"] .coterie-roster{padding-left:0}
  body[data-section="coterie"] .coterie-roster:after{left:25px}
}

@media(prefers-reduced-motion:reduce){
  #main>*,
  body[data-section] main::before,
  .roll-result,
  .roll-result .die.hunger,
  .roll-omen{
    animation:none!important;
    transition:none!important;
  }
}


/* ==========================================================================
   VAMPIRE POLISH — PASS 9
   Better rhythm, more theatre, no modern title punctuation.
   ========================================================================== */

:root{
  --space-0:.35rem;
  --space-1:.55rem;
  --space-2:.85rem;
  --space-3:1.15rem;
  --space-4:1.65rem;
  --space-5:2.25rem;
  --space-6:3rem;
  --space-7:4rem;
}

/* Header: ceremonial, never colliding with its own type. */
.page-head{
  position:relative;
  min-height:0!important;
  margin:0 0 2.8rem!important;
  padding:.4rem 0 1.85rem!important;
  gap:1.75rem!important;
  align-items:flex-end!important;
  overflow:visible!important;
  border-top:0!important;
  border-bottom:1px solid #62493f!important;
  background:none!important;
}
.page-head:before{
  content:''!important;
  position:absolute!important;
  top:auto!important;
  right:auto!important;
  bottom:-1px!important;
  left:0!important;
  width:clamp(92px,11vw,144px)!important;
  height:2px!important;
  border:0!important;
  background:linear-gradient(90deg,#a6203d 0 42%,#8c694e 68%,transparent 100%)!important;
  transform-origin:left center;
  animation:blood-rule-draw .82s .18s cubic-bezier(.17,.75,.21,1) both;
}
.page-head:after{
  display:none!important;
  content:none!important;
}
.page-head-copy{
  position:relative;
  padding:0!important;
  margin:0!important;
}
.page-head-copy:before{
  right:0!important;
  top:auto!important;
  bottom:-.25rem!important;
  width:104px!important;
  height:130px!important;
  opacity:.07!important;
}
.page-head h1{
  margin:.22rem 0 0!important;
  padding:0!important;
  line-height:.91!important;
}
.page-head h1::after{
  display:none!important;
  content:none!important;
}
.page-head .eyebrow{
  display:flex;
  align-items:center;
  gap:.65rem;
  margin:0 0 .2rem!important;
  padding:0!important;
}
.page-head .eyebrow:before{
  content:'';
  display:block;
  flex:0 0 26px;
  width:26px;
  height:1px;
  background:linear-gradient(90deg,#8f1d37,#8a684e);
  opacity:.78;
}
.page-head p:not(.eyebrow){
  margin-top:.72rem!important;
}
.page-head-action{
  margin:0!important;
  padding:0 0 .15rem!important;
}

/* One polished spacing system across the folio. */
main{
  padding-top:clamp(2.35rem,4vw,3.35rem)!important;
  padding-bottom:clamp(4rem,7vw,6.2rem)!important;
}
.folio-section,
.sheet-section{
  padding-top:2.45rem!important;
  padding-bottom:2.6rem!important;
}
.folio-heading,
.sheet-section-head{
  margin-bottom:1.65rem!important;
}
.section-title{
  margin-top:2.85rem!important;
  margin-bottom:1rem!important;
}
.panel{
  padding-top:1.7rem!important;
  padding-bottom:1.8rem!important;
}
.panel-head{
  margin-bottom:1.35rem!important;
}
.record-card{
  padding-top:1.45rem!important;
  padding-bottom:1.55rem!important;
}
.record-card .actions{
  margin-top:1rem!important;
}
.empty,
.empty.compact{
  padding-top:1.85rem!important;
  padding-bottom:1.95rem!important;
}
.night-layout,
.coterie-layout,
.dice-table-layout{
  gap:clamp(2.7rem,4.8vw,4.25rem)!important;
}
.night-rail,
.table-ledger,
.runner-ledger{
  padding-left:clamp(1.9rem,3vw,2.55rem)!important;
}
.character-glance{
  padding-bottom:1.9rem!important;
}
.notice-ledger{
  padding-top:1.85rem!important;
}
.sheet-identity{
  gap:clamp(2.1rem,3.8vw,3.35rem)!important;
  padding-bottom:2.75rem!important;
}
.identity-intro{
  margin-bottom:1.7rem!important;
  padding-bottom:1.15rem!important;
}
.identity-grid,
.details-grid{
  gap:1.2rem 1.7rem!important;
}
.vital-control{
  padding-top:1.15rem!important;
  padding-bottom:1.25rem!important;
}
.sheet-tracks{
  gap:clamp(2rem,4vw,3.2rem)!important;
  padding-top:2.35rem!important;
  padding-bottom:2.5rem!important;
}
.sheet-ratings .traits{
  gap:clamp(2rem,3.5vw,3rem)!important;
}
.trait-row{
  padding-top:.58rem!important;
  padding-bottom:.58rem!important;
}
.dice-controls{
  gap:1.25rem 1.7rem!important;
}
.table-roll{
  padding-top:1.1rem!important;
  padding-bottom:1.4rem!important;
}
.runner-tools{
  margin-bottom:2.9rem!important;
  padding-top:1.1rem!important;
  padding-bottom:1.15rem!important;
}
.runner-workspace{
  gap:clamp(2.7rem,4.8vw,4.35rem)!important;
}
.ledger-section{
  padding-bottom:2rem!important;
  margin-bottom:2rem!important;
}
.runner-after{
  margin-top:4.35rem!important;
  padding-top:2.65rem!important;
}
.scene-copy{
  padding-top:2rem!important;
  padding-bottom:2.1rem!important;
}
.gothic-window{
  padding:clamp(2.05rem,4vw,3rem)!important;
}

/* Page arrival feels like a curtain lifting, not an app loading. */
@keyframes blood-rule-draw{
  from{transform:scaleX(0);opacity:0}
  to{transform:scaleX(1);opacity:1}
}
@keyframes header-enter{
  from{opacity:0;transform:translateY(10px);filter:blur(2px)}
  to{opacity:1;transform:translateY(0);filter:blur(0)}
}
@keyframes header-action-enter{
  from{opacity:0;transform:translateX(10px)}
  to{opacity:1;transform:translateX(0)}
}
@keyframes section-rise{
  from{opacity:0;transform:translateY(9px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes tracery-breathe{
  0%,100%{opacity:.14;transform:translate3d(0,0,0) scale(1)}
  50%{opacity:.20;transform:translate3d(0,4px,0) scale(1.012)}
}
@keyframes portrait-haunt{
  0%,100%{filter:saturate(.86) contrast(1.045) brightness(.98)}
  50%{filter:saturate(.9) contrast(1.055) brightness(1.015)}
}
@keyframes blood-glimmer{
  0%,100%{box-shadow:0 0 0 #7e173000}
  50%{box-shadow:0 0 18px #7e173036}
}
@keyframes nav-blood{
  from{transform:scaleY(0);opacity:0}
  to{transform:scaleY(1);opacity:1}
}

.page-head-copy{
  animation:header-enter .62s cubic-bezier(.16,.76,.18,1) both;
}
.page-head-action{
  animation:header-action-enter .56s .11s cubic-bezier(.16,.76,.18,1) both;
}
.folio-section,
.sheet-section,
.character-glance,
.table-ledger,
.runner-ledger,
.runner-tools,
.scene-manuscript,
.chronicle-invocation,
.coterie-records{
  animation:section-rise .52s .06s cubic-bezier(.2,.72,.22,1) both;
}

/* Stagger the two-column focal layouts very slightly. */
.night-rail,
.table-ledger,
.runner-ledger{
  animation-delay:.12s;
}

/* The Gothic window should feel faintly alive. */
.gothic-window:before{
  animation:tracery-breathe 9s ease-in-out infinite;
}
.gothic-window-copy:after{
  animation:blood-glimmer 5.4s ease-in-out infinite;
}

/* Portraits feel haunted, never zoomy or social-media-ish. */
.portrait,
.glance-portrait,
.roster-row img{
  transition:filter .7s ease,box-shadow .7s ease,transform .7s cubic-bezier(.2,.7,.2,1);
}
body[data-section="character"] .portrait{
  animation:portrait-haunt 10s ease-in-out infinite;
}
body[data-section="character"] .portrait:hover{
  transform:translateY(-2px);
  box-shadow:
    inset 0 0 0 6px #0c0809,
    inset 0 0 0 7px #604638,
    0 24px 58px #0009;
}
.glance-portrait:hover,
.roster-row img:hover{
  transform:translateY(-2px);
}

/* Navigation gets a vertical blood mark instead of modern UI emphasis. */
.sidebar nav button{
  position:relative;
  transition:color .22s ease,background .22s ease,padding-left .22s ease;
}
.sidebar nav button:after{
  content:'';
  position:absolute;
  left:0;
  top:24%;
  bottom:24%;
  width:1px;
  background:linear-gradient(#7d142c,#b38b68);
  opacity:0;
  transform:scaleY(0);
  transform-origin:center;
}
.sidebar nav button.active{
  padding-left:14px;
}
.sidebar nav button.active:after{
  opacity:1;
  animation:nav-blood .35s cubic-bezier(.2,.75,.25,1) both;
}

/* Buttons get a tiny ceremonial lift, never a bounce. */
button,.button{
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .25s ease;
}
button:hover,.button:hover{
  transform:translateY(-1px);
}
button:active,.button:active{
  transform:translateY(0);
}

/* Section rules reveal like ink spreading across paper. */
.folio-heading:after,
.sheet-section-head:after,
.panel-head:after{
  transform-origin:left center;
  animation:blood-rule-draw .7s .12s cubic-bezier(.17,.75,.21,1) both;
}

/* Table Dice remains the most overtly theatrical interaction. */
.roll-result{
  animation-duration:.62s!important;
}
.roll-result .die{
  animation:die-arrive .45s cubic-bezier(.17,.78,.21,1) both;
}
.roll-result .die:nth-child(2){animation-delay:.035s}
.roll-result .die:nth-child(3){animation-delay:.07s}
.roll-result .die:nth-child(4){animation-delay:.105s}
.roll-result .die:nth-child(5){animation-delay:.14s}
.roll-result .die:nth-child(6){animation-delay:.175s}
.roll-result .die:nth-child(7){animation-delay:.21s}
.roll-result .die:nth-child(8){animation-delay:.245s}
.roll-result .die:nth-child(n+9){animation-delay:.28s}
@keyframes die-arrive{
  from{opacity:0;transform:translateY(-7px) rotate(-4deg) scale(.93)}
  to{opacity:1;transform:translateY(0) rotate(0) scale(1)}
}

/* The manuscript timeline gets a very slow blood-line reveal. */
body[data-section="journal"] .card-list:before,
body[data-section="coterie"] .coterie-roster:after{
  transform-origin:top center;
  animation:journal-line 1.15s .18s cubic-bezier(.18,.72,.22,1) both;
}
@keyframes journal-line{
  from{transform:scaleY(0);opacity:0}
  to{transform:scaleY(1);opacity:1}
}

/* Storyteller scene copy feels like pages opening beneath the current scene. */
.scene-copy{
  transition:background .35s ease,padding-left .35s ease;
}
.scene-copy:hover{
  padding-left:.45rem!important;
  background:linear-gradient(90deg,#67152a12,transparent 32%);
}

/* Mobile gets tighter rhythm but keeps the theatre. */
@media(max-width:1200px){
  .page-head{
    margin-bottom:2.35rem!important;
  }
  .night-layout,
  .coterie-layout,
  .dice-table-layout,
  .runner-workspace{
    gap:2.6rem!important;
  }
}
@media(max-width:900px){
  .night-rail,
  .table-ledger,
  .runner-ledger{
    padding-left:0!important;
  }
}
@media(max-width:760px){
  main{
    padding-top:1.9rem!important;
  }
  .page-head{
    margin-bottom:2rem!important;
    padding-top:.1rem!important;
    padding-bottom:1.35rem!important;
  }
  .page-head .eyebrow:before{
    width:18px;
    flex-basis:18px;
  }
  .page-head-copy:before{
    width:76px!important;
    height:96px!important;
  }
  .folio-section,
  .sheet-section{
    padding-top:1.9rem!important;
    padding-bottom:2rem!important;
  }
  .gothic-window{
    padding:1.65rem 1.35rem!important;
  }
  .sheet-identity{
    gap:1.6rem!important;
  }
}

/* Accessibility: all theatre becomes still without losing the design. */
@media(prefers-reduced-motion:reduce){
  .page-head-copy,
  .page-head-action,
  .page-head:before,
  .folio-section,
  .sheet-section,
  .character-glance,
  .table-ledger,
  .runner-ledger,
  .runner-tools,
  .scene-manuscript,
  .chronicle-invocation,
  .coterie-records,
  .gothic-window:before,
  .gothic-window-copy:after,
  .portrait,
  .glance-portrait,
  .roster-row img,
  .sidebar nav button.active:after,
  .folio-heading:after,
  .sheet-section-head:after,
  .panel-head:after,
  .roll-result .die,
  body[data-section="journal"] .card-list:before,
  body[data-section="coterie"] .coterie-roster:after{
    animation:none!important;
    transition:none!important;
  }
  button:hover,.button:hover,
  .portrait:hover,
  .glance-portrait:hover,
  .roster-row img:hover{
    transform:none!important;
  }
}


/* ==========================================================================
   TABLE DICE — PHYSICAL D10 PASS
   ========================================================================== */

.dice{
  align-items:center;
  gap:12px;
}

/* Full-size V5 d10s */
.die{
  isolation:isolate;
  width:58px!important;
  height:66px!important;
  min-height:66px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  clip-path:polygon(50% 0,84% 14%,100% 48%,79% 85%,50% 100%,21% 85%,0 48%,16% 14%)!important;
  background:
    linear-gradient(158deg,transparent 0 24%,#fff8e918 25% 27%,transparent 28% 100%),
    linear-gradient(202deg,transparent 0 26%,#6b584944 27% 30%,transparent 31% 100%),
    linear-gradient(90deg,#bdae98 0 19%,#eadfcf 20% 49%,#cabaa5 50% 72%,#a89783 73% 100%)!important;
  box-shadow:
    inset 0 0 0 1px #fff8eb44,
    0 9px 18px #0008!important;
  color:#20171a!important;
  font:700 1.35rem/1 var(--sans)!important;
  text-shadow:0 1px 0 #fff7e477!important;
  overflow:hidden;
}
.die:before{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    linear-gradient(64deg,transparent 49%,#6b594a55 50% 51%,transparent 52%),
    linear-gradient(116deg,transparent 49%,#fff7e32b 50% 51%,transparent 52%),
    linear-gradient(180deg,transparent 48%,#6e5d4e55 49% 51%,transparent 52%);
  pointer-events:none;
}
.die:after{
  display:none!important;
  content:none!important;
}
.die.hunger{
  background:
    linear-gradient(158deg,transparent 0 24%,#ffafbc24 25% 27%,transparent 28% 100%),
    linear-gradient(202deg,transparent 0 26%,#2f050d66 27% 30%,transparent 31% 100%),
    linear-gradient(90deg,#591020 0 18%,#a21f3a 19% 49%,#751429 50% 72%,#450b18 73% 100%)!important;
  color:#fff1e4!important;
  text-shadow:0 1px 0 #2a050c,0 0 10px #fff1e42b!important;
  box-shadow:
    inset 0 0 0 1px #ffb7c241,
    0 9px 20px #0009!important;
}
.die.hunger:before{
  background:
    linear-gradient(64deg,transparent 49%,#26050b99 50% 51%,transparent 52%),
    linear-gradient(116deg,transparent 49%,#e7677a33 50% 51%,transparent 52%),
    linear-gradient(180deg,transparent 48%,#2d071066 49% 51%,transparent 52%);
}
.die.selected{
  outline:0!important;
  filter:drop-shadow(0 0 7px #d8b98c);
}
.die:disabled{
  opacity:1!important;
  cursor:default;
}
.roll-result .die{
  animation:d10-land .52s cubic-bezier(.18,.74,.2,1) both!important;
}
.roll-result .die:nth-child(2){animation-delay:.035s!important}
.roll-result .die:nth-child(3){animation-delay:.07s!important}
.roll-result .die:nth-child(4){animation-delay:.105s!important}
.roll-result .die:nth-child(5){animation-delay:.14s!important}
.roll-result .die:nth-child(6){animation-delay:.175s!important}
.roll-result .die:nth-child(7){animation-delay:.21s!important}
.roll-result .die:nth-child(8){animation-delay:.245s!important}
.roll-result .die:nth-child(n+9){animation-delay:.28s!important}

@keyframes d10-land{
  0%{opacity:0;transform:translateY(-16px) rotate(-14deg) scale(.84)}
  44%{opacity:1;transform:translateY(3px) rotate(5deg) scale(1.035)}
  70%{transform:translateY(-2px) rotate(-2deg) scale(.99)}
  100%{opacity:1;transform:translateY(0) rotate(0) scale(1)}
}

/* Miniature matching d10s in the shared ledger. */
.mini-dice{
  gap:7px!important;
  align-items:center;
}
.mini-die{
  position:relative;
  isolation:isolate;
  display:grid!important;
  place-items:center;
  width:31px!important;
  height:35px!important;
  border:0!important;
  clip-path:polygon(50% 0,84% 14%,100% 48%,79% 85%,50% 100%,21% 85%,0 48%,16% 14%);
  background:
    linear-gradient(90deg,#a99986 0 20%,#ddd1bf 21% 50%,#bbaa95 51% 73%,#93816e 74% 100%)!important;
  color:#21181a!important;
  font:700 .72rem/1 var(--sans)!important;
  text-shadow:0 1px 0 #fff8eb66;
  box-shadow:0 5px 10px #0007;
}
.mini-die:before{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    linear-gradient(64deg,transparent 49%,#5f4f4255 50% 51%,transparent 52%),
    linear-gradient(116deg,transparent 49%,#fff7e226 50% 51%,transparent 52%);
}
.mini-die.hunger{
  background:
    linear-gradient(90deg,#4c0b18 0 20%,#951c35 21% 50%,#691225 51% 73%,#3d0814 74% 100%)!important;
  color:#ffece2!important;
  text-shadow:0 1px 0 #24040a;
  box-shadow:0 5px 11px #0008;
}
.mini-die.hunger:before{
  background:
    linear-gradient(64deg,transparent 49%,#24040a99 50% 51%,transparent 52%),
    linear-gradient(116deg,transparent 49%,#e25d7130 50% 51%,transparent 52%);
}

/* A little more table presence without adding another box. */
.roll-result .dice{
  position:relative;
  padding:12px 0 15px;
}
.roll-result .dice:after{
  content:'';
  position:absolute;
  left:0;
  right:18%;
  bottom:0;
  height:1px;
  background:linear-gradient(90deg,#725649,transparent);
  opacity:.65;
}

@media(max-width:760px){
  .dice{gap:9px}
  .die{
    width:51px!important;
    height:58px!important;
    min-height:58px!important;
    font-size:1.18rem!important;
  }
  .mini-die{
    width:28px!important;
    height:32px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .roll-result .die{
    animation:none!important;
  }
}


/* ==========================================================================
   TRUE SVG D10 — PASS 11
   Actual d10 artwork replaces the CSS polygon approximation.
   ========================================================================== */

.die{
  width:62px!important;
  height:73px!important;
  min-height:73px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  clip-path:none!important;
  background-color:transparent!important;
  background-image:url('/by-night/d10-ivory.svg')!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  box-shadow:none!important;
  color:#21171a!important;
  font:800 1.32rem/1 var(--sans)!important;
  text-shadow:0 1px 0 #fff9eeaa!important;
  filter:drop-shadow(0 8px 7px #0008);
  overflow:visible!important;
}
.die:before,
.die:after{
  display:none!important;
  content:none!important;
}
.die.hunger{
  background-image:url('/by-night/d10-hunger.svg')!important;
  color:#fff2e8!important;
  text-shadow:0 1px 0 #2b050d,0 0 7px #fff2e833!important;
  box-shadow:none!important;
  filter:drop-shadow(0 8px 8px #0009);
}
.die.selected{
  outline:0!important;
  filter:drop-shadow(0 0 8px #d7b88d) drop-shadow(0 8px 7px #0008)!important;
}
.die.hunger.selected{
  filter:drop-shadow(0 0 9px #c13e58) drop-shadow(0 8px 8px #0009)!important;
}
.die:hover:not(:disabled){
  filter:drop-shadow(0 0 5px #d9b98a88) drop-shadow(0 10px 8px #0009)!important;
}
.die.hunger:hover:not(:disabled){
  filter:drop-shadow(0 0 6px #bb304d88) drop-shadow(0 10px 9px #0009)!important;
}

/* Matching SVG d10s in the communal ledger. */
.mini-die{
  width:33px!important;
  height:39px!important;
  display:grid!important;
  place-items:center!important;
  border:0!important;
  clip-path:none!important;
  background-color:transparent!important;
  background-image:url('/by-night/d10-ivory.svg')!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  box-shadow:none!important;
  color:#21171a!important;
  font:800 .69rem/1 var(--sans)!important;
  text-shadow:0 1px 0 #fff9ee99!important;
  filter:drop-shadow(0 4px 4px #0007);
}
.mini-die:before,
.mini-die:after{
  display:none!important;
  content:none!important;
}
.mini-die.hunger{
  background-image:url('/by-night/d10-hunger.svg')!important;
  color:#fff1e7!important;
  text-shadow:0 1px 0 #2b050c!important;
  filter:drop-shadow(0 4px 5px #0008);
}

/* A real die should tumble, not just pop into place. */
.roll-result .die{
  transform-origin:50% 52%;
  animation:true-d10-tumble .62s cubic-bezier(.18,.74,.2,1) both!important;
}
@keyframes true-d10-tumble{
  0%{opacity:0;transform:translate3d(-8px,-18px,0) rotate(-28deg) scale(.78)}
  38%{opacity:1;transform:translate3d(4px,5px,0) rotate(14deg) scale(1.05)}
  62%{transform:translate3d(-2px,-3px,0) rotate(-7deg) scale(.985)}
  82%{transform:translate3d(1px,1px,0) rotate(3deg) scale(1.01)}
  100%{opacity:1;transform:translate3d(0,0,0) rotate(0) scale(1)}
}

/* Slight individual variation so the handful doesn't land like synchronized icons. */
.roll-result .die:nth-child(3n+1){animation-duration:.56s!important}
.roll-result .die:nth-child(3n+2){animation-duration:.66s!important}
.roll-result .die:nth-child(3n){animation-duration:.61s!important}

@media(max-width:760px){
  .die{
    width:55px!important;
    height:65px!important;
    min-height:65px!important;
    font-size:1.15rem!important;
  }
  .mini-die{
    width:29px!important;
    height:35px!important;
    font-size:.63rem!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .roll-result .die{
    animation:none!important;
  }
}


/* Table Dice controls — Storyteller utility stays compact and secondary. */
.table-ledger-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.65rem;
  flex-wrap:wrap;
}
.table-ledger-controls .danger{
  min-height:30px;
  padding:.42rem .58rem;
  border-color:#7f2c3f;
  background:linear-gradient(180deg,#2a1017,#170b0f);
  color:#d9a5ae;
  font-size:.56rem;
}
.table-ledger-controls .danger:hover{
  border-color:#a64358;
  color:#f0c2c8;
  box-shadow:0 0 18px #7d17302f;
}
@media(max-width:760px){
  .table-ledger-controls{
    align-items:flex-end;
    flex-direction:column;
    gap:.45rem;
  }
}


/* Shared Table Dice pagination */
.roll-pager{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:.8rem;
  margin-top:1.2rem;
  padding-top:1rem;
  border-top:1px solid #47343a;
}
.roll-pager span{
  color:#8e7f7f;
  font:600 .58rem/1 var(--sans);
  letter-spacing:.12em;
  text-align:center;
  text-transform:uppercase;
}
.roll-pager button{
  min-height:30px;
  padding:.42rem .62rem;
  font-size:.56rem;
}
.roll-pager button:disabled{
  opacity:.32;
  cursor:default;
  transform:none;
}
@media(max-width:520px){
  .roll-pager{
    grid-template-columns:1fr 1fr;
  }
  .roll-pager span{
    grid-column:1/-1;
    grid-row:1;
  }
}


/* ==========================================================================
   SIDEBAR CANON + PLAYER TONIGHT LIFE — PASS 16
   Sidebar is a Gothic folio index; Tonight is the living threshold.
   ========================================================================== */

/* --- Sidebar canon ------------------------------------------------------ */
.sidebar{
  background:
    radial-gradient(circle at 50% 0,#4a172631,transparent 31%),
    linear-gradient(180deg,#1a1016 0%,#100b0f 72%,#0b080a 100%)!important;
  border-right:1px solid #6b4d43!important;
  box-shadow:
    inset -1px 0 #0b0709,
    inset -7px 0 18px #0005!important;
}

.brand{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  text-align:center!important;
  padding:0 0 1.8rem!important;
  border-bottom:1px solid #5b403a!important;
}
.brand:before{
  display:block!important;
  width:72px!important;
  height:88px!important;
  margin:0 auto 1rem!important;
  background:url('/by-night/tracery.svg') center/contain no-repeat!important;
  opacity:.78!important;
  filter:sepia(.8) saturate(.75) drop-shadow(0 7px 14px #0007)!important;
  transform-origin:center 62%;
  animation:sidebar-crest-breathe 8s ease-in-out infinite!important;
}
.brand:after{
  bottom:-8px!important;
  left:50%!important;
  transform:translateX(-50%)!important;
  width:24px!important;
  background:#120c10!important;
  color:#9a7557!important;
  opacity:.9!important;
}
.brand .eyebrow{
  width:100%;
  text-align:center!important;
}
.wordmark{
  width:100%;
  text-align:left!important;
  margin:1rem 0 1rem!important;
}
.edition{
  width:100%;
  text-align:left!important;
}

.mode-label{
  position:relative;
  margin:1.45rem 0 .45rem!important;
  padding:.65rem .3rem .78rem!important;
  color:#b99b7b!important;
  font:600 .61rem/1 var(--sans)!important;
  letter-spacing:.19em!important;
  text-transform:uppercase!important;
  font-style:normal!important;
}
.mode-label:after{
  content:'';
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:1px;
  background:
    linear-gradient(90deg,#8a1832 0 27%,#6e4e41 27% 58%,transparent 58% 100%);
  transform-origin:left center;
  animation:sidebar-rule-draw .7s .18s cubic-bezier(.2,.75,.2,1) both;
}

.sidebar nav{
  gap:0!important;
  counter-reset:sidebar-index;
}

.sidebar nav button{
  position:relative!important;
  isolation:isolate;
  min-height:42px!important;
  margin:0!important;
  padding:.76rem .45rem .76rem 2.95rem!important;
  justify-content:flex-start!important;
  gap:.6rem!important;
  border:0!important;
  border-bottom:1px solid #34262a!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#a99da0!important;
  font:500 .76rem/1.22 var(--sans)!important;
  letter-spacing:.015em!important;
  text-align:left!important;
  text-transform:none!important;
  transition:
    color .24s ease,
    padding-left .3s cubic-bezier(.2,.72,.2,1),
    background .28s ease!important;
}
.sidebar nav button:before{
  content:'';
  position:absolute;
  z-index:-1;
  inset:0;
  background:
    linear-gradient(90deg,#6f13292e 0,#6f132912 38%,transparent 78%);
  opacity:0;
  transform:scaleX(.74);
  transform-origin:left center;
  transition:opacity .26s ease,transform .32s cubic-bezier(.2,.72,.2,1);
}
.sidebar nav button:after{
  content:'';
  position:absolute!important;
  left:0!important;
  top:50%!important;
  bottom:auto!important;
  width:18px!important;
  height:1px!important;
  background:linear-gradient(90deg,#8f1a35,#ae8a63)!important;
  opacity:.28!important;
  transform:translateY(-50%) scaleX(.45)!important;
  transform-origin:left center!important;
  transition:opacity .24s ease,transform .3s cubic-bezier(.2,.72,.2,1)!important;
}

.sidebar nav button:hover{
  color:#eee0cf!important;
  padding-left:3.14rem!important;
  background:transparent!important;
}
.sidebar nav button:hover:before{
  opacity:1;
  transform:scaleX(1);
}
.sidebar nav button:hover:after{
  opacity:.72!important;
  transform:translateY(-50%) scaleX(1)!important;
}

.nav-num{
  position:absolute;
  left:.55rem;
  top:50%;
  width:1.7rem!important;
  transform:translateY(-50%);
  color:#7d6b68!important;
  font:600 .57rem/1 var(--sans)!important;
  letter-spacing:.08em!important;
  text-align:center;
  opacity:.8!important;
  transition:color .24s ease,transform .28s ease,opacity .24s ease;
}

.sidebar nav button.active{
  padding-left:3.22rem!important;
  color:#f2e3cf!important;
  background:
    linear-gradient(90deg,#72142b3d 0,#51132320 46%,transparent 92%)!important;
  border-left:0!important;
  box-shadow:inset 0 1px #9b77511b,inset 0 -1px #0a0708!important;
}
.sidebar nav button.active:before{
  opacity:1;
  transform:scaleX(1);
}
.sidebar nav button.active:after{
  left:0!important;
  top:18%!important;
  width:2px!important;
  height:64%!important;
  background:linear-gradient(180deg,transparent,#9b1c39 16%,#b32b49 58%,#9b775c 82%,transparent)!important;
  opacity:1!important;
  transform:scaleY(1)!important;
  box-shadow:0 0 12px #8d17334f!important;
}
.sidebar nav button.active .nav-num{
  color:#c29b76!important;
  opacity:1!important;
  transform:translateY(-50%) translateX(2px);
}

.sidebar-foot{
  position:relative;
  margin-top:auto!important;
  padding:2rem .3rem .2rem!important;
}
.sidebar-foot:before{
  content:'';
  display:block;
  width:34px;
  height:1px;
  margin:0 auto 1rem;
  background:linear-gradient(90deg,transparent,#745346,transparent);
}
.sidebar-foot>span{
  color:#6f6263!important;
  font-size:.76rem!important;
  letter-spacing:.01em;
}

/* --- Player Tonight: a living threshold -------------------------------- */
body[data-console="player"][data-section="tonight"] main{
  position:relative;
}
body[data-console="player"][data-section="tonight"] main:after{
  content:'';
  position:absolute;
  z-index:-2;
  pointer-events:none;
  left:16%;
  top:13rem;
  width:54%;
  height:46rem;
  background:
    radial-gradient(ellipse at 50% 35%,#6c15282a,transparent 54%),
    radial-gradient(ellipse at 30% 70%,#8e6a4420,transparent 52%);
  filter:blur(18px);
  animation:tonight-ambient-breathe 12s ease-in-out infinite alternate;
}

body[data-console="player"][data-section="tonight"] .page-head-copy{
  animation:tonight-title-arrive .72s cubic-bezier(.16,.78,.17,1) both!important;
}
body[data-console="player"][data-section="tonight"] .page-head:before{
  animation:blood-rule-draw .95s .15s cubic-bezier(.17,.75,.21,1) both!important;
}

body[data-console="player"][data-section="tonight"] .night-main{
  animation:tonight-main-arrive .68s .06s cubic-bezier(.18,.74,.2,1) both;
}
body[data-console="player"][data-section="tonight"] .night-rail{
  animation:tonight-rail-arrive .72s .12s cubic-bezier(.18,.74,.2,1) both;
}

/* The front-page window should feel illuminated from somewhere impossible. */
body[data-console="player"][data-section="tonight"] .gothic-window{
  position:relative;
  box-shadow:
    inset 0 0 0 7px #0b0708,
    inset 0 0 0 8px #62493c,
    inset 0 0 70px #78172a1c,
    0 28px 72px #0008!important;
  animation:window-shadow-breathe 10s ease-in-out infinite;
}
body[data-console="player"][data-section="tonight"] .gothic-window:before{
  animation:tonight-tracery-haunt 10s ease-in-out infinite!important;
}
body[data-console="player"][data-section="tonight"] .gothic-window:after{
  animation:window-inner-glint 8s ease-in-out infinite;
}
body[data-console="player"][data-section="tonight"] .gothic-window-mark{
  animation:window-mark-pulse 7s ease-in-out infinite;
}
body[data-console="player"][data-section="tonight"] .gothic-window-copy:after{
  animation:seal-breathe 5.8s ease-in-out infinite!important;
}

/* Revealed scenes get the same ambience without obscuring content. */
body[data-console="player"][data-section="tonight"] .feature-scene img{
  transition:filter 1.2s ease,transform 1.8s cubic-bezier(.18,.7,.2,1);
  filter:saturate(.75) contrast(1.06) brightness(.9);
}
body[data-console="player"][data-section="tonight"] .feature-scene:hover img{
  transform:scale(1.008);
  filter:saturate(.82) contrast(1.07) brightness(.96);
}
body[data-console="player"][data-section="tonight"] .feature-scene-rule{
  transform-origin:left center;
  animation:scene-rule-draw .82s .34s cubic-bezier(.17,.75,.21,1) both;
}

/* Character and notice rail wakes up in response to the viewer. */
body[data-console="player"][data-section="tonight"] .character-glance{
  position:relative;
  transition:padding-left .32s ease;
}
body[data-console="player"][data-section="tonight"] .character-glance:after{
  content:'';
  position:absolute;
  left:-1px;
  top:0;
  width:1px;
  height:0;
  background:linear-gradient(#ad2340,#8d6a4f,transparent);
  transition:height .5s cubic-bezier(.18,.7,.2,1);
}
body[data-console="player"][data-section="tonight"] .character-glance:hover{
  padding-left:.45rem!important;
}
body[data-console="player"][data-section="tonight"] .character-glance:hover:after{
  height:78%;
}
body[data-console="player"][data-section="tonight"] .glance-portrait{
  animation:glance-portrait-breathe 11s ease-in-out infinite;
}
body[data-console="player"][data-section="tonight"] .notice-ledger .record-card{
  transition:transform .28s ease,color .22s ease,border-color .22s ease;
}
body[data-console="player"][data-section="tonight"] .notice-ledger .record-card:hover{
  transform:translateX(4px);
  border-bottom-color:#6b3945;
}

/* Latest chronicle arrives like the next page being revealed. */
body[data-console="player"][data-section="tonight"] .latest-chronicle{
  animation:latest-chronicle-rise .58s .16s cubic-bezier(.18,.74,.2,1) both!important;
}

/* --- Motion language --------------------------------------------------- */
@keyframes sidebar-crest-breathe{
  0%,100%{opacity:.68;transform:translateY(0) scale(.985);filter:sepia(.8) saturate(.75) drop-shadow(0 7px 14px #0007)}
  50%{opacity:.84;transform:translateY(-2px) scale(1.008);filter:sepia(.85) saturate(.82) drop-shadow(0 10px 20px #6f17301f)}
}
@keyframes sidebar-rule-draw{
  from{transform:scaleX(0);opacity:0}
  to{transform:scaleX(1);opacity:1}
}
@keyframes tonight-ambient-breathe{
  from{opacity:.54;transform:translate3d(-1%,0,0) scale(.98)}
  to{opacity:.82;transform:translate3d(1.5%,8px,0) scale(1.025)}
}
@keyframes tonight-title-arrive{
  from{opacity:0;transform:translateY(12px);filter:blur(2px)}
  to{opacity:1;transform:translateY(0);filter:blur(0)}
}
@keyframes tonight-main-arrive{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes tonight-rail-arrive{
  from{opacity:0;transform:translateX(12px)}
  to{opacity:1;transform:translateX(0)}
}
@keyframes tonight-tracery-haunt{
  0%,100%{opacity:.16;transform:translate3d(0,0,0) scale(.99)}
  50%{opacity:.25;transform:translate3d(-3px,4px,0) scale(1.015)}
}
@keyframes window-shadow-breathe{
  0%,100%{filter:brightness(.97)}
  50%{filter:brightness(1.025)}
}
@keyframes window-inner-glint{
  0%,100%{border-color:#8b6a5126}
  50%{border-color:#a87f5d45}
}
@keyframes window-mark-pulse{
  0%,100%{color:#a72240;text-shadow:0 3px 22px #000b,0 0 0 #81152d00}
  50%{color:#bd2949;text-shadow:0 3px 22px #000b,0 0 20px #81152d42}
}
@keyframes seal-breathe{
  0%,100%{transform:scale(.985);filter:brightness(.95)}
  50%{transform:scale(1.025);filter:brightness(1.08)}
}
@keyframes scene-rule-draw{
  from{transform:scaleX(0);opacity:0}
  to{transform:scaleX(1);opacity:1}
}
@keyframes glance-portrait-breathe{
  0%,100%{filter:saturate(.80) contrast(1.04) brightness(.95)}
  50%{filter:saturate(.86) contrast(1.055) brightness(1.015)}
}
@keyframes latest-chronicle-rise{
  from{opacity:0;transform:translateY(9px)}
  to{opacity:1;transform:translateY(0)}
}

@media(max-width:900px){
  .brand:before{
    width:62px!important;
    height:76px!important;
  }
  .sidebar nav button{
    min-height:46px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .brand:before,
  .mode-label:after,
  body[data-console="player"][data-section="tonight"] main:after,
  body[data-console="player"][data-section="tonight"] .page-head-copy,
  body[data-console="player"][data-section="tonight"] .page-head:before,
  body[data-console="player"][data-section="tonight"] .night-main,
  body[data-console="player"][data-section="tonight"] .night-rail,
  body[data-console="player"][data-section="tonight"] .gothic-window,
  body[data-console="player"][data-section="tonight"] .gothic-window:before,
  body[data-console="player"][data-section="tonight"] .gothic-window:after,
  body[data-console="player"][data-section="tonight"] .gothic-window-mark,
  body[data-console="player"][data-section="tonight"] .gothic-window-copy:after,
  body[data-console="player"][data-section="tonight"] .feature-scene-rule,
  body[data-console="player"][data-section="tonight"] .glance-portrait,
  body[data-console="player"][data-section="tonight"] .latest-chronicle{
    animation:none!important;
  }
}


/* Sidebar folio labels are formal index entries. */
.sidebar nav button{
  text-transform:uppercase!important;
  letter-spacing:.055em!important;
}


/* Sidebar crest vocabulary: one window, surrounded by thorn-and-blood vectors. */
.brand:before{
  width:132px!important;
  height:92px!important;
  margin:0 auto 1rem!important;
  background:url('/by-night/sidebar-crest.svg') center/contain no-repeat!important;
  opacity:.9!important;
  filter:drop-shadow(0 8px 16px #0008)!important;
}


/* ==========================================================================
   PLAYER TONIGHT — ORNAMENT VOCABULARY
   Moon, bats, thorns, dagger and sigil. Each motif has one job.
   ========================================================================== */

body[data-console="player"][data-section="tonight"] .page-head:after{
  right:18px!important;
  top:12px!important;
  bottom:auto!important;
  width:220px!important;
  height:140px!important;
  background:url('/by-night/tonight-moon.svg') center/contain no-repeat!important;
  opacity:.62!important;
  filter:drop-shadow(0 10px 28px #0007)!important;
  animation:tonight-moon-haunt 12s ease-in-out infinite;
}

body[data-console="player"][data-section="tonight"] .night-main{
  position:relative;
  isolation:isolate;
}

body[data-console="player"][data-section="tonight"] .night-main:before{
  content:'';
  position:absolute;
  z-index:-1;
  left:-34px;
  right:-22px;
  top:86px;
  height:210px;
  background:url('/by-night/tonight-thorns.svg') center/100% 100% no-repeat;
  opacity:.26;
  pointer-events:none;
  filter:drop-shadow(0 8px 16px #0005);
  animation:tonight-thorns-breathe 11s ease-in-out infinite;
}

body[data-console="player"][data-section="tonight"] .night-main:after{
  content:'';
  position:absolute;
  z-index:2;
  pointer-events:none;
  right:2%;
  top:6px;
  width:290px;
  height:110px;
  background:url('/by-night/tonight-bats.svg') center/contain no-repeat;
  opacity:.28;
  transform-origin:65% 50%;
  animation:tonight-bats-drift 14s ease-in-out infinite;
}

body[data-console="player"][data-section="tonight"] .gothic-window{
  z-index:1;
}

/* Chronicle is marked by a ritual blade, not another architectural ornament. */
body[data-console="player"][data-section="tonight"] .latest-chronicle{
  position:relative;
}
body[data-console="player"][data-section="tonight"] .latest-chronicle:before{
  content:'';
  position:absolute;
  right:0;
  top:-9px;
  width:205px;
  height:42px;
  background:url('/by-night/tonight-dagger.svg') right center/contain no-repeat;
  opacity:.58;
  pointer-events:none;
  filter:drop-shadow(0 5px 10px #0006);
  animation:tonight-dagger-glint 9s ease-in-out infinite;
}
body[data-console="player"][data-section="tonight"] .latest-chronicle .folio-heading{
  padding-right:120px;
}

/* Domain notices get a heraldic blood-sigil rather than repeating the blade. */
body[data-console="player"][data-section="tonight"] .notice-ledger{
  position:relative;
}
body[data-console="player"][data-section="tonight"] .notice-ledger:before{
  content:'';
  position:absolute;
  right:0;
  top:23px;
  width:54px;
  height:54px;
  background:url('/by-night/tonight-sigil.svg') center/contain no-repeat;
  opacity:.46;
  pointer-events:none;
  filter:drop-shadow(0 7px 15px #0006);
}
body[data-console="player"][data-section="tonight"] .notice-ledger .folio-heading{
  padding-right:52px;
}

/* Character rail gets one tiny heraldic echo, then stops. */
body[data-console="player"][data-section="tonight"] .character-glance:before{
  content:'';
  position:absolute!important;
  right:2px!important;
  top:0!important;
  width:26px!important;
  height:26px!important;
  background:url('/by-night/tonight-sigil.svg') center/contain no-repeat!important;
  opacity:.34!important;
  font-size:0!important;
}

/* The hero's existing window remains architecture; the new motifs carry atmosphere. */
body[data-console="player"][data-section="tonight"] .gothic-window:before{
  opacity:.12!important;
}
body[data-console="player"][data-section="tonight"] .gothic-window-copy:before{
  opacity:.62!important;
}

@keyframes tonight-moon-haunt{
  0%,100%{opacity:.52;transform:translate3d(0,0,0) rotate(-.4deg)}
  50%{opacity:.68;transform:translate3d(-4px,3px,0) rotate(.5deg)}
}
@keyframes tonight-bats-drift{
  0%,100%{opacity:.20;transform:translate3d(0,0,0) scale(.985)}
  45%{opacity:.34;transform:translate3d(-10px,3px,0) scale(1.015)}
  70%{opacity:.29;transform:translate3d(-5px,-2px,0) scale(1.005)}
}
@keyframes tonight-thorns-breathe{
  0%,100%{opacity:.20;transform:scaleX(.992)}
  50%{opacity:.30;transform:scaleX(1.008)}
}
@keyframes tonight-dagger-glint{
  0%,100%{opacity:.48;filter:drop-shadow(0 5px 10px #0006) brightness(.92)}
  50%{opacity:.68;filter:drop-shadow(0 7px 15px #0007) brightness(1.08)}
}

@media(max-width:1050px){
  body[data-console="player"][data-section="tonight"] .page-head:after{
    width:170px!important;
    height:112px!important;
    opacity:.42!important;
  }
  body[data-console="player"][data-section="tonight"] .night-main:after{
    width:220px;
    opacity:.20;
  }
  body[data-console="player"][data-section="tonight"] .latest-chronicle:before{
    width:160px;
    opacity:.42;
  }
}

@media(max-width:720px){
  body[data-console="player"][data-section="tonight"] .page-head:after{
    width:118px!important;
    height:82px!important;
    right:0!important;
    opacity:.30!important;
  }
  body[data-console="player"][data-section="tonight"] .night-main:before{
    left:-10px;
    right:-10px;
    top:105px;
    opacity:.17;
  }
  body[data-console="player"][data-section="tonight"] .night-main:after{
    width:150px;
    height:72px;
    top:20px;
    opacity:.15;
  }
  body[data-console="player"][data-section="tonight"] .latest-chronicle:before{
    width:120px;
    height:30px;
    top:2px;
    opacity:.34;
  }
  body[data-console="player"][data-section="tonight"] .latest-chronicle .folio-heading{
    padding-right:60px;
  }
}

@media(prefers-reduced-motion:reduce){
  body[data-console="player"][data-section="tonight"] .page-head:after,
  body[data-console="player"][data-section="tonight"] .night-main:before,
  body[data-console="player"][data-section="tonight"] .night-main:after,
  body[data-console="player"][data-section="tonight"] .latest-chronicle:before{
    animation:none!important;
  }
}


/* Tonight spacing correction: keep the Chronicle ornament clear of the hero frame. */
body[data-console="player"][data-section="tonight"] .latest-chronicle{
  margin-top:1.35rem!important;
}
body[data-console="player"][data-section="tonight"] .latest-chronicle:before{
  top:.55rem!important;
}


/* Player Tonight header: give the blood/brass lead-in rule breathing room. */
body[data-console="player"][data-section="tonight"] .page-head .eyebrow{
  gap:1rem!important;
}


/* Footer readability: preserve the formal tone without microtype. */
footer{
  font-size:.95rem!important;
  line-height:1.45!important;
  letter-spacing:.085em!important;
}


/* Character rules-engine controls: functional only; full visual pass comes later. */
body[data-section="character"] .character-build-status{
  margin-bottom:2rem;
}
body[data-section="character"] .character-build-status p{
  line-height:1.65;
}
body[data-section="character"] .trait-label{
  display:flex;
  align-items:center;
  gap:.35rem;
  min-width:0;
}
body[data-section="character"] .trait-label>button{
  min-height:32px;
  padding:0;
  border:0;
  background:transparent;
  text-align:left;
  justify-content:flex-start;
}
body[data-section="character"] .trait-label .trait-help{
  width:24px;
  min-width:24px;
  min-height:24px;
  justify-content:center;
  border:1px solid #51424a;
  border-radius:50%;
  color:#9a8b91;
  font-size:.72rem;
}
body[data-section="character"] .trait-label .trait-help:hover{
  border-color:#956572;
  color:var(--text);
}
