/* ---- глоссарий ---- */
abbr.gl{text-decoration:none;border-bottom:1px dotted var(--led-a);cursor:help}
.gltip{position:absolute;z-index:200;background:#101010;color:#e6e6e0;border:1px solid #3a2c0c;border-radius:8px;padding:10px 12px;font-size:14px;line-height:1.5;box-shadow:0 10px 30px #000}
.gltip b{display:block;color:var(--led-a);font-family:"Russo One",sans-serif;font-weight:400;margin-bottom:4px;text-transform:uppercase;letter-spacing:.06em;font-size:12px}
:root[data-theme="light"] .gltip{background:#fffaf0;color:#2b2218;border-color:#d7b26b}
/* ---- статистика ---- */
.stath{font:400 22px "Russo One",sans-serif;display:flex;gap:10px;align-items:center;margin-bottom:12px;color:#ecece6}
:root[data-theme="light"] .stath{color:#3b2410}
.statgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.stat{padding:12px 14px}.stat .led{font-size:24px!important;margin-top:6px}.stat small{display:block;color:var(--silk2);font-size:12px;margin-top:4px}
.statrow{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.lnkbtn{background:none;border:0;color:var(--led-a);font:inherit;cursor:pointer;padding:0;text-decoration:underline dotted}
.ebars{display:grid;gap:6px;max-width:900px}
.ebar{display:grid;grid-template-columns:240px 1fr 40px;gap:10px;align-items:center;font-size:14px}
.ebar>div{height:12px;background:#111;border-radius:2px;overflow:hidden}.ebar i{display:block;height:100%}
:root[data-theme="light"] .ebar>div{background:#e2d3b3}
.more{margin-top:10px}
.utils{display:flex;gap:6px}

:root[data-theme="light"] .cpick b{color:#3b2410}
.utils{border-left:1px solid #2a2a2a;padding-left:10px}
:root[data-theme="light"] .utils{border-color:#cdb994}
/* ===== ПЕРГАМЕНТ v2 ===== */
:root[data-theme="light"]{--ink:#2a1d12;--ink2:#6b5842;--burg:#7a2418;--gold:#8f6414;--paper:#f4ead3;--paper2:#fbf6e9;--rule:#d6c39d;--silk:#5a4630;--silk2:#7c6850}
:root[data-theme="light"] body{background:#e8dbbd;background-image:radial-gradient(ellipse at 50% -10%,#f7efd9 0,transparent 60%),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");color:var(--ink);font-family:"Literata",Georgia,serif}
:root[data-theme="light"] .panel{background:var(--paper);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");border:1px solid var(--rule);border-radius:4px;box-shadow:0 1px 0 #fffaf0 inset,0 0 0 4px var(--paper),0 0 0 5px var(--rule),0 8px 22px rgba(90,60,20,.14)}
:root[data-theme="light"] .screw{display:none}
:root[data-theme="light"] .glass{background:var(--paper2);border-radius:3px;box-shadow:inset 0 0 0 1px var(--rule),inset 0 0 0 3px var(--paper2),inset 0 0 0 4px #eadcbc}
:root[data-theme="light"] .led{font-family:"Literata",Georgia,serif!important;text-transform:none;letter-spacing:0;font-weight:700;text-shadow:none!important}
:root[data-theme="light"] .led.g{color:var(--ink)!important}:root[data-theme="light"] .led.a{color:var(--burg)!important}:root[data-theme="light"] .led.r{color:var(--burg)!important}
:root[data-theme="light"] .glass.name .led{font-family:"Cormorant Garamond",Georgia,serif!important;font-weight:400;font-size:clamp(26px,2.6vw,42px)!important;color:var(--burg)!important}
:root[data-theme="light"] .silk{font-family:"Literata",Georgia,serif;letter-spacing:.12em;color:var(--ink2);font-variant:small-caps;text-transform:lowercase;font-size:12px}
:root[data-theme="light"] h1,:root[data-theme="light"] .fbrand,:root[data-theme="light"] .stath,:root[data-theme="light"] .cvs{font-family:"Cormorant Garamond",Georgia,serif!important;color:var(--burg);text-shadow:none}
:root[data-theme="light"] .hero h1{font-size:clamp(30px,3.2vw,48px)}
:root[data-theme="light"] .sled{background:#d9c8a4!important;box-shadow:none!important;border-radius:50%;width:8px;height:8px}
:root[data-theme="light"] .sled.on.g{background:#5f7d3b!important}:root[data-theme="light"] .sled.on.a{background:var(--gold)!important}:root[data-theme="light"] .sled.on.r{background:var(--burg)!important}
:root[data-theme="light"] .sled.blink{animation:none}
:root[data-theme="light"] .key,:root[data-theme="light"] .ctile,:root[data-theme="light"] .dn,:root[data-theme="light"] .tdi,:root[data-theme="light"] .pcell,:root[data-theme="light"] .era,:root[data-theme="light"] .chip{background:var(--paper2)!important;color:var(--ink)!important;border:1px solid var(--rule)!important;box-shadow:0 1px 0 #fff inset,0 1px 2px rgba(90,60,20,.12)!important;border-radius:3px;font-family:"Literata",Georgia,serif}
:root[data-theme="light"] .key:hover,:root[data-theme="light"] .ctile:hover,:root[data-theme="light"] .dn:hover{background:#f1e4c6!important;border-color:var(--gold)!important}
:root[data-theme="light"] .key[aria-pressed="true"],:root[data-theme="light"] .ctile[aria-pressed="true"],:root[data-theme="light"] .era[aria-pressed="true"]{background:#ecdcb6!important;border-color:var(--burg)!important;color:var(--burg)!important}
:root[data-theme="light"] .era small{color:var(--gold)!important}
:root[data-theme="light"] .item{font-family:"Literata",Georgia,serif;border-bottom:1px solid #e6d7b6}
:root[data-theme="light"] .item .y{color:var(--ink2)}
:root[data-theme="light"] .item[aria-current="true"]{background:#efe1c1;box-shadow:inset 3px 0 0 var(--burg)}
:root[data-theme="light"] .list h3,:root[data-theme="light"] .shead{background:#efe3c8;color:var(--burg);font-family:"Literata",Georgia,serif;font-variant:small-caps;letter-spacing:.08em;border-bottom:1px solid var(--rule)}
:root[data-theme="light"] .folio p,:root[data-theme="light"] .gmain .lead{font-family:"Literata",Georgia,serif;font-size:18px;line-height:1.75;color:var(--ink)}
:root[data-theme="light"] .gmain .lead::first-letter{font-family:"Cormorant Garamond",Georgia,serif;float:left;font-size:3.4em;line-height:.85;margin:.06em .1em 0 0;color:var(--burg)}
:root[data-theme="light"] .folio h3,:root[data-theme="light"] .mpanel h3{font-family:"Literata",Georgia,serif;font-variant:small-caps;letter-spacing:.1em;color:var(--burg);border-bottom:1px solid var(--rule);padding-bottom:4px}
:root[data-theme="light"] .deeds li::before{background:var(--gold);box-shadow:none;width:6px;height:6px;border-radius:50%;top:16px}
:root[data-theme="light"] .log{border-left-color:var(--rule)}
:root[data-theme="light"] .log li::before{background:var(--burg);box-shadow:none;border-radius:50%}
:root[data-theme="light"] .log .led{color:var(--burg)!important;font-size:14px!important}
:root[data-theme="light"] .bezel{background:linear-gradient(145deg,#b8934f,#7d5a26 55%,#a9853f);padding:8px;box-shadow:inset 0 0 0 2px #e6c77f,inset 0 0 0 4px #6d4c1d,0 8px 20px rgba(60,40,10,.35)}
:root[data-theme="light"] .bezel .screen{background:var(--paper2);box-shadow:inset 0 0 12px rgba(90,60,20,.25)}
:root[data-theme="light"] .bezel .screen::before{display:none}
:root[data-theme="light"] .crn{border-color:var(--gold)}
:root[data-theme="light"] .ph{background-image:none}:root[data-theme="light"] .ph .mono{font-family:"Cormorant Garamond",Georgia,serif;color:#c2a877;text-shadow:none;font-size:48px}
:root[data-theme="light"] .qt{background:transparent;border-left:3px double var(--burg);font-family:"Literata",Georgia,serif}
:root[data-theme="light"] .qt p{color:var(--ink)}
:root[data-theme="light"] .controls input,:root[data-theme="light"] .picker input,:root[data-theme="light"] .csel{background:var(--paper2)!important;color:var(--ink)!important;font-family:"Literata",Georgia,serif!important;text-transform:none!important;letter-spacing:0!important;box-shadow:inset 0 0 0 1px var(--rule)!important}
:root[data-theme="light"] .controls input::placeholder,:root[data-theme="light"] .picker input::placeholder{color:#a8916a}
:root[data-theme="light"] .tag{background:#f3e3bd;border-color:#d7b26b;color:var(--burg);font-family:"Literata",Georgia,serif;text-transform:none;letter-spacing:0;font-size:12px}
:root[data-theme="light"] abbr.gl{border-bottom-color:var(--burg)}
:root[data-theme="light"] .mapwrap,:root[data-theme="light"] .terr{background:#efe3c6!important}
:root[data-theme="light"] .mapwrap::before,:root[data-theme="light"] .mapwrap::after{display:none}
:root[data-theme="light"] #worldmap .land,:root[data-theme="light"] .terrsvg .land{fill:#e4d4b0;stroke:#c7b089}
:root[data-theme="light"] #worldmap .act{fill:#cdbb8e;stroke:#8f6414}
:root[data-theme="light"] #worldmap .cur,:root[data-theme="light"] .terrsvg .on{fill:#b4553f;stroke:#7a2418}
:root[data-theme="light"] #worldmap .dot{fill:#7a2418;filter:none}:root[data-theme="light"] #worldmap .ring{stroke:#7a2418}
:root[data-theme="light"] .terrsvg .cap{fill:#2a1d12;filter:none}
:root[data-theme="light"] .bt path{stroke:#7a2418}:root[data-theme="light"] .bt text{fill:#2a1d12;stroke:#f4ead3}
:root[data-theme="light"] .grat{stroke:#dccaa4!important}
:root[data-theme="light"] .ttrack,:root[data-theme="light"] .tlscroll{background:var(--paper2)}
:root[data-theme="light"] .tick{color:var(--gold)!important;border-color:var(--rule)}
:root[data-theme="light"] .bar{background:color-mix(in srgb,var(--c) 22%,#f3e7cf)!important;border-left-color:color-mix(in srgb,var(--c) 60%,#5a4630)!important}
:root[data-theme="light"] .tree ul>li::before,:root[data-theme="light"] .tree ul>li::after{border-color:#b8a07a}
:root[data-theme="light"] .dn.ghost{background:transparent!important;border-style:dashed!important;color:#9a8666!important;box-shadow:none!important}
:root[data-theme="light"] .pbar{background:#e6d7b6;box-shadow:inset 0 0 0 1px var(--rule)}:root[data-theme="light"] .pbar i{background:var(--burg);box-shadow:none}
:root[data-theme="light"] .gltip{background:var(--paper2);color:var(--ink);border-color:var(--gold);font-family:"Literata",Georgia,serif}
:root[data-theme="light"] .gltip b{color:var(--burg)}
:root[data-theme="light"] .flag{box-shadow:0 0 0 1px rgba(90,60,20,.35)}
:root[data-theme="light"] .ctile .cnt,:root[data-theme="light"] .cnt{color:var(--ink2)}
.shead{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;position:sticky;top:0;z-index:2;background:#101010;border-bottom:1px solid #000}

/* ---- пергамент v3: шрифты везде, волокна ---- */
:root[data-theme="light"]{--serif:"Literata",Georgia,"Times New Roman",serif;--disp:"Cormorant Garamond",Georgia,serif}
:root[data-theme="light"] body *:not(.flag):not(.flag.code){font-family:var(--serif)!important}
:root[data-theme="light"] .hero h1,:root[data-theme="light"] .fbrand,:root[data-theme="light"] .stath,:root[data-theme="light"] .cvs,:root[data-theme="light"] .glass.name .led,:root[data-theme="light"] .ph .mono,:root[data-theme="light"] .gmain .lead::first-letter,:root[data-theme="light"] .fcount .led,:root[data-theme="light"] .hero .glass .led{font-family:var(--disp)!important;font-weight:600!important}
:root[data-theme="light"] .glass.name .led{font-size:clamp(30px,3vw,48px)!important;letter-spacing:.01em}
:root[data-theme="light"] .hero h1{font-size:clamp(34px,3.4vw,54px)!important;font-weight:700!important}
:root[data-theme="light"] .fcount .led{font-size:28px!important;color:var(--burg)!important}
:root[data-theme="light"] .svc{color:var(--ink2);font-size:13px;letter-spacing:.06em;font-variant:small-caps;text-transform:lowercase}
:root[data-theme="light"] .svc b{color:var(--ink)!important;font-variant:normal}
:root[data-theme="light"] .led.g,:root[data-theme="light"] .svc b,:root[data-theme="light"] .progress .led{color:var(--ink)!important}
:root[data-theme="light"] .modekey,:root[data-theme="light"] .key{font-size:14px}
:root[data-theme="light"] .gmain .lead{font-size:18px;line-height:1.8}
/* горизонтальные волокна пергамента */
:root[data-theme="light"] .panel{background-color:#f3e8cf!important;background-image:
 radial-gradient(ellipse at center,rgba(255,250,235,.55) 0%,rgba(255,250,235,0) 60%),
 radial-gradient(ellipse at 0% 0%,rgba(160,120,60,.14),transparent 35%),radial-gradient(ellipse at 100% 100%,rgba(160,120,60,.14),transparent 35%),
 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.003 .22' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .16 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23f)'/%3E%3C/svg%3E"),
 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E")!important;
 background-size:auto,auto,auto,600px 300px,200px 200px!important}
:root[data-theme="light"] body{background-color:#e3d3b0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.003 .25' numOctaves='4' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .28 0 0 0 0 .12 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23f)'/%3E%3C/svg%3E")!important}
:root[data-theme="light"] .glass{background-color:rgba(252,247,234,.8)}

/* ---- список слева: липкий, во всю высоту экрана; заголовки без просвета ---- */
.list{padding:0 10px 10px!important;position:sticky;top:12px;align-self:start;max-height:calc(100vh - 24px)!important;overscroll-behavior:contain}
@media (max-width:820px){.list{position:static;max-height:45vh!important}}
.list h3{top:0!important;margin:0 -10px!important;padding:9px 20px!important;z-index:3!important;box-shadow:0 6px 8px -6px rgba(0,0,0,.8)}
.list .shead{margin:0 -10px;padding:9px 20px}
:root[data-theme="light"] .list h3{background:#efe3c8!important;box-shadow:0 6px 8px -6px rgba(90,60,20,.35)}
:root[data-theme="light"] .shead{background:#efe3c8!important}
/* ---- полосы прокрутки в цвет темы ---- */
*{scrollbar-width:thin;scrollbar-color:#3a3a3a #0c0c0c}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#0c0c0c}
::-webkit-scrollbar-thumb{background:#333;border-radius:6px;border:2px solid #0c0c0c}
::-webkit-scrollbar-thumb:hover{background:#4a4a4a}
::-webkit-scrollbar-corner{background:#0c0c0c}
:root[data-theme="light"] *{scrollbar-color:#bfa575 #efe3c6}
:root[data-theme="light"] ::-webkit-scrollbar-track{background:#efe3c6}
:root[data-theme="light"] ::-webkit-scrollbar-thumb{background:#c8ae7c;border-color:#efe3c6}
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover{background:#a88b55}
:root[data-theme="light"] ::-webkit-scrollbar-corner{background:#efe3c6}

