.kbook .journal-tabs button{font-size:20px}
.kbook .journal-leaf{color:#e6d9b6}
.kbook .journal-left h3,.kbook .journal-right h3,.kbook h4{color:#ebd391;text-align:center;margin:0 0 8px;font:700 18.5px Grenze Gotisch,Georgia,serif}
.kbook .journal-title{color:#ebd391;margin:0;font:700 24px Grenze Gotisch,Georgia,serif}
.kbook .journal-reward,.kbook .journal-meta{color:#b9954f;text-align:center;margin:2px 0 8px}
.kbook .journal-story{color:#d6c79f;line-height:1.45}
.kbook .journal-group{display:block;color:#ebd391;border-bottom:1px solid #6e5a35;margin:8px 0 2px;padding:4px 8px;font:700 16.5px Grenze Gotisch,Georgia,serif}
.kbook .journal-toc-item{color:#e6d9b6}
.kbook .journal-toc-item:hover{background:#22382d}
.kbook .journal-toc-item[aria-current="true"]{background:#2c4636;box-shadow:inset 3px 0 #b9954f}
.kbook-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;font-size:22px;color:#ebd391}
.kbook-icon img,.kbook-icon-image{display:block;width:100%;height:100%;object-fit:contain;object-position:center}
.kbook-head{display:flex;align-items:center;gap:10px;margin-bottom:4px}
.kbook-head .kbook-icon{width:48px;height:48px;font-size:33px}
.kbook-lv{margin-left:auto;color:#b9954f;font-size:14.5px}
.kbook-bar{position:relative;height:20px;margin:6px 0;border:1px solid #6e5a35;border-radius:4px;background:#07100c;overflow:hidden}
.kbook-bar i{position:absolute;inset:0 auto 0 0;background:#3f8a39}
.kbook-bar.hp i{background:#a63a32}.kbook-bar.mp i{background:#3a63a6}.kbook-bar.sp i{background:#b9954f}.kbook-bar.xp i{background:#4f8f5a}
.kbook-bar span{position:relative;display:block;text-align:center;font:13px/20px Grenze Gotisch,Georgia,serif;color:#f6e7c0;text-shadow:0 1px 2px #000}
.kbook-gold{display:flex;align-items:center;gap:8px;margin:10px 0;color:#ebd391}
.kbook-info{margin:8px 0}
.kbook-row{display:flex;justify-content:space-between;padding:3px 4px;border-bottom:1px solid #2d4033}
.kbook-row b{color:#ebd391}
.kbook-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:6px}
.kbook-stat{display:flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid #3a4a3c;border-radius:4px;background:#0f1a15}
.kbook-stat span:not(.kbook-icon){flex:1}.kbook-stat b{color:#ebd391}
.kbook select{margin:0 0 0 8px;padding:4px 6px;font:14.5px Grenze Gotisch,Georgia,serif;border:1px solid #6e5a35;border-radius:3px;background:#0f1a15;color:#e6d9b6}

/* Bank box: a floating vault window opened at the bank door (no interior screen). */
html body #bankPanel.k-bankbox{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:var(--z-window-base,1000);width:min(520px,calc(100vw - 24px));max-height:80vh;overflow:auto;padding:16px 18px;border:1px solid #b9954f;border-radius:10px;background:linear-gradient(180deg,#14231c,#0a120e);box-shadow:0 18px 50px #000c,inset 0 0 0 1px #000,inset 0 0 0 2px #ebd39122;color:#e6d9b6}
html body #bankPanel.k-bankbox h2{margin:0 0 8px;font:700 22px Grenze Gotisch,Georgia,serif;color:#ebd391}
html body #bankPanel .k-bank-close{position:absolute;top:8px;right:8px;width:30px;height:30px;padding:0;border:1px solid #8a2a24;border-radius:6px;background:#4a1416;color:#ffd9d4;font:700 15.5px Grenze Gotisch,Georgia,serif;cursor:pointer}

/* Skill group pages */
.kbook-pager{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 8px}
html body #mmorpgOverlay .kbook .kbook-pager button{margin:0;padding:3px 9px;border:1px solid #6e5a35!important;border-radius:11px;background:#0e1613!important;color:#d9ccaa!important;font:700 13px Grenze Gotisch,Georgia,serif!important;cursor:pointer;min-height:0}
html body #mmorpgOverlay .kbook .kbook-pager .kbook-page-tab[aria-selected="true"]{background:linear-gradient(#d7b36a,#a9803f)!important;color:#1a1208!important;border-color:#6e5a35!important}
html body #mmorpgOverlay .kbook .kbook-pager .kbook-page-nav{margin-left:auto;display:flex;align-items:center;gap:4px;color:#9d9680}
html body #mmorpgOverlay .kbook .kbook-pager .kbook-page-nav button{padding:1px 8px}
html body #mmorpgOverlay .kbook .kbook-pager .kbook-page-nav button:disabled{opacity:.35;cursor:default}

/* Character portrait with equipment slots */
.kbook-doll{position:relative;height:210px;margin:0 0 10px;border:1px solid #6e5a35;border-radius:10px;background:radial-gradient(ellipse at 50% 40%,#2c4237,#0b140f 75%);overflow:hidden}
.kbook-doll-art{position:absolute;left:50%;bottom:6px;height:92%;max-width:60%;transform:translateX(-50%);object-fit:contain;filter:drop-shadow(0 6px 8px #000a)}
.kbook-slot{position:absolute;width:40px;height:40px;border:1px solid #6e5a35;border-radius:8px;background:#0b1410cc;display:grid;place-items:center;overflow:hidden}
.kbook-slot .kbook-icon{width:32px;height:32px}
.kbook-slot-empty{color:#6e5a35;font:700 15.5px Grenze Gotisch,Georgia,serif}
.kbook-slot-head{left:8px;top:8px}.kbook-slot-chest{left:8px;top:54px}.kbook-slot-legs{left:8px;top:100px}.kbook-slot-feet{left:8px;top:146px}
.kbook-slot-mainHand{right:8px;top:8px}.kbook-slot-offHand{right:8px;top:54px}.kbook-slot-projectile{right:8px;top:100px}
/* Slim, compact windows: smaller frame, tighter padding, content fills the space. */
html body #mmorpgOverlay[data-open="true"] #mmorpgWindow{width:min(700px,calc(100vw - 16px));height:min(600px,calc(100dvh - 100px))}   /* the one height rule; no !important so the native resize handle works */
html body #mmorpgWindow #mmorpgWindowHeader{min-height:0;height:34px;padding:0 10px}
html body #mmorpgWindow #mmorpgWindowTitle{font-size:16.5px}
html body #mmorpgWindow #mmorpgClose{width:26px;height:26px}
html body #mmorpgWindow[data-subpanel="journal"] #mmorpgCharacterPanel{padding:8px 10px!important}
html body .journal-tabs{padding-bottom:3px}
html body .journal-tabs button{font-size:17.5px!important;padding:1px 16px!important}
html body #mmorpgWindow #mmorpgCharacterPanel{flex:1 1 auto;min-height:0;overflow:auto}
html body #mmorpgWindow[data-subpanel="journal"] #mmorpgCharacterPanel{display:flex;flex-direction:column}
html body .journal-book{flex:1 1 auto;min-height:0}
html body .journal-spread{flex:1 1 auto;height:auto!important;min-height:0;max-height:none!important}
html body .journal-leaf{padding:10px 14px}
html body .journal-left .journal-list{flex:1 1 auto}
/* Floating HUD pieces step aside while a full-size window is open. */
body:has(#mmorpgOverlay[data-open="true"]) #kTracker,body:has(#mmorpgOverlay[data-open="true"]) #kDockToggle{display:none!important}
html body .journal-controls{gap:4px;margin-bottom:5px}
html body .journal-toc-item{padding-top:3px!important;padding-bottom:3px!important;font-size:15.5px!important}
html body #mmorpgOverlay .journal-left .journal-list>*{min-height:26px}
html body .journal-title{font-size:23px!important}
html body .kbook-doll{height:170px}
html body #mmorpgOverlay .kbook .klevel{margin:0 0 6px;padding:3px 8px;border:1px solid #6e5a35;border-radius:5px;background:#0e1613;color:#ebd391;font:700 13px Grenze Gotisch,Georgia,serif}
html body #mmorpgUtilities #mmorpgAchievementsButton{font-size:10px;letter-spacing:-.03em;padding-left:0;padding-right:0;overflow-wrap:anywhere}
/* Phone width: windows keep their fixed size; the resize corner is only for desktop pointers. */
@media (max-width:700px){html body #mmorpgWindow{resize:none}}

.kbook-attr button{min-height:30px;padding:2px 10px;margin:2px;border:1px solid #b99a5b;background:#3a2f1a;color:#f2e2b8;border-radius:5px;cursor:pointer}.kbook-attr button:disabled{opacity:.45;cursor:default}.kbook-attr-banner{margin:6px 0;padding:6px 10px;border:1px solid #b99a5b;border-radius:6px;background:#2f2813;color:#f2e2b8}.kbook-attr-banner[hidden]{display:none}

/* Stat names in the Character window spend panel (attributes-ui.js): keep each name on one line and keep the +1/+5 buttons whole. */
html body .kbook-attr .attr-name-wrap{flex:1 0 auto;min-width:max-content}
html body .kbook-attr .attr-name{white-space:nowrap;overflow-wrap:normal;word-break:normal}
html body .kbook-attr .kbook-row>button{flex:none;white-space:nowrap}

/* Character sheet (Stats page). Dark plate and text colours come from tokens.css; colour is an accent only (left border, bar fill), never text. */
html body #mmorpgWindow #mmorpgCharacterPanel.kchar-host{background:var(--bg-1,#14231c);color:var(--ink,#e6d9b6);border:1px solid var(--gold-lo,#8a7448);border-image:none;box-shadow:none;padding:12px 16px;overflow:auto}
.kchar{container-type:inline-size;display:flex;flex-direction:column;gap:12px;min-width:0;color:var(--ink,#e6d9b6);font:16px/1.35 Grenze Gotisch,Georgia,serif}
.kchar-head{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:center;justify-content:space-between;padding:12px 14px;border:1px solid var(--gold-lo,#8a7448);border-radius:var(--r-3,8px);background:var(--bg-2,#1d3328)}
.kchar-name{margin:0;color:var(--gold-hi,#ebd391);font:700 26px/1.1 Grenze Gotisch,Georgia,serif}
.kchar-sub,.kchar-gold{margin:2px 0 0;color:var(--ink,#e6d9b6)}
.kchar-gold{color:var(--gold-hi,#ebd391);font-weight:700}
.kchar-bars{flex:1 1 280px;display:grid;gap:6px;min-width:0}
.kchar-bar{position:relative;height:26px;border:1px solid var(--gold-lo,#8a7448);border-radius:var(--r-1,4px);background:#07100c;overflow:hidden}
.kchar-bar i{position:absolute;top:0;bottom:0;left:0;display:block}
.kchar-bar.hp i{background:#a63a32}.kchar-bar.mp i{background:#3a63a6}.kchar-bar.sp i{background:#b9954f}.kchar-bar.xp i{background:#4f8f5a}
.kchar-bar span{position:absolute;left:6px;top:50%;transform:translateY(-50%);padding:0 8px;border-radius:var(--r-1,4px);background:#07100c;color:var(--ink-hi,#f4efde);font:700 14px/20px Grenze Gotisch,Georgia,serif;white-space:nowrap}
.kchar-sections{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:start}
@container (min-width:760px){.kchar-sections{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.kchar-sec[data-section=skills]{grid-column:1/-1}}
.kchar-sec{min-width:0;border:1px solid #3a4a3c;border-radius:var(--r-3,8px);background:var(--bg-1,#14231c)}
.kchar-sec-head{position:sticky;top:0;z-index:2;margin:0;background:var(--bg-1,#14231c);border-radius:var(--r-3,8px) var(--r-3,8px) 0 0}
.kchar-toggle{display:flex;align-items:center;width:100%;min-height:44px;padding:8px 12px;border:0;background:transparent;color:var(--gold-hi,#ebd391);font:700 20px/1.2 Grenze Gotisch,Georgia,serif;text-align:left;cursor:pointer}
.kchar-toggle::after{content:"\25BE";margin-left:auto;padding-left:12px;transition:transform .15s}
.kchar-toggle[aria-expanded=false]::after{transform:rotate(-90deg)}
.kchar-toggle:focus-visible{outline:2px solid var(--focus,#e6c88d);outline-offset:-2px}
.kchar-body{padding:0 12px 12px}
.kchar-body[hidden]{display:none}
.kchar-table{width:100%;border-collapse:collapse;margin:4px 0 8px;font:16px/1.35 Grenze Gotisch,Georgia,serif}
.kchar-table th,.kchar-table td{height:38px;padding:6px 10px;text-align:left;vertical-align:middle;border-bottom:1px solid #2d4033;color:var(--ink,#e6d9b6);overflow-wrap:anywhere}
.kchar-table thead th{height:auto;padding:4px 10px;color:var(--gold-hi,#ebd391);font-size:14px;font-weight:700;letter-spacing:.04em;border-bottom:2px solid var(--gold-lo,#8a7448)}
.kchar-table tbody tr:nth-child(even){background:var(--bg-2,#1d3328)}
.kchar-table tbody th{font-weight:400}
.kchar-table .kchar-num{text-align:right;white-space:nowrap}
.kchar-table .kchar-val{color:var(--ink-hi,#f4efde);font-weight:700}
.kchar-table .kchar-note{color:var(--ink,#e6d9b6)}
.kchar-table .is-over{color:var(--danger,#e5a09a)}
.kchar-table td:has(.kchar-bar){width:44%;min-width:150px}
.kchar-table tr[data-accent] > :first-child{border-left:3px solid var(--acc,#776d4f);padding-left:9px}
.kchar-table tr[data-accent=combat]{--acc:#c0584d}
.kchar-table tr[data-accent=magic]{--acc:#5b82c4}
.kchar-table tr[data-accent=gather]{--acc:#5f9a5e}
.kchar-table tr[data-accent=craft]{--acc:#b9954f}
.kchar-table tr[data-accent=other]{--acc:#776d4f}
.kchar-group-title{margin:12px 0 0;color:var(--gold-hi,#ebd391);font:700 17px/1.2 Grenze Gotisch,Georgia,serif}
.kchar-empty{margin:8px 0;color:var(--ink,#e6d9b6)}
.kchar .journal-tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--gold-lo,#8a7448)}
.kchar .journal-tabs button{min-height:44px;padding:4px 14px;border:0;border-bottom:3px solid transparent;background:transparent;color:var(--ink,#e6d9b6);font:400 20px Grenze Gotisch,Georgia,serif;cursor:pointer}
.kchar .journal-tabs button[aria-selected=true]{color:var(--gold-hi,#ebd391);border-bottom-color:var(--gold,#b9954f);font-weight:700}
.kchar .journal-tabs button:focus-visible{outline:2px solid var(--focus,#e6c88d)}
.kchar .kbook-attr{margin-top:4px}
.kchar .kbook-attr .journal-meta,.kchar .kbook-attr h4{color:var(--ink,#e6d9b6);text-align:left;font:16px/1.35 Grenze Gotisch,Georgia,serif}
.kchar .kbook-attr h4{color:var(--gold-hi,#ebd391);font-weight:700}
.kchar .kbook-attr .kbook-row{color:var(--ink,#e6d9b6);border-bottom:1px solid #2d4033}
