
:root{--bg:#071522;--panel:#0d202e;--panel2:#102a39;--line:#98764d;--gold:#d5b177;--cream:#f3e6d0;--muted:#a9b8bb;--teal:#64cad2;--amber:#e0a75a;--danger:#f7bd8e;--serif:Georgia,'Times New Roman',serif;--sans:system-ui,'Segoe UI',sans-serif}
*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:radial-gradient(circle at 53% -30%,#254b59 0,#071522 56%);color:#f3e9d4;font-family:var(--sans);font-size:14px;line-height:1.5}button,select,input,textarea{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #76d1df;outline-offset:3px}a{color:#edcb93}
.shell{min-height:100%;display:grid;grid-template-columns:270px minmax(0,1fr) 330px;grid-template-rows:auto minmax(610px,1fr) auto;grid-template-areas:'head head head' 'side center info' 'foot foot foot';max-width:2200px;margin:auto;box-shadow:0 0 180px #0009}
header{grid-area:head;display:flex;gap:12px;align-items:center;padding:15px 24px;background:linear-gradient(115deg,#132534,#081723 75%);border-bottom:2px solid #9a794e;position:relative;z-index:8;flex-wrap:wrap}
.logo{font-family:var(--serif);font-size:29px;letter-spacing:.22em;color:#f3d7a5;text-shadow:0 2px 10px #ae8b5688}.edition{color:var(--muted);font-size:11px;letter-spacing:.15em;text-transform:uppercase}.brand{margin-right:auto;min-width:220px}header .actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.tabbtn{color:#eee1cc;background:#122837;border:1px solid #665943;border-radius:8px;padding:9px 12px;white-space:nowrap}.tabbtn[aria-selected=true]{background:#866b45;color:#091725;border-color:#e8cb99;font-weight:700}.history{color:#bed9db;font-size:12px}
.sidebar{grid-area:side;background:linear-gradient(180deg,#0a1e2a,#0c2433);border-right:1px solid #7d664d;padding:17px 16px 20px;overflow-y:auto}.inspector{grid-area:info;background:linear-gradient(180deg,#102b39,#081b29);border-left:1px solid #91714c;overflow-y:auto;padding:17px 18px 23px}.side-title{font-family:var(--serif);color:#daba7e;letter-spacing:.11em;font-size:17px;margin:0 0 10px}.section{border-top:1px solid #4d534c;padding-top:15px;margin-top:15px}.input{width:100%;border:1px solid #65736c;background:#08202d;color:white;border-radius:8px;padding:10px}.small{font-size:12px;color:var(--muted)}.kicker{color:#efc887;letter-spacing:.15em;font-size:11px;text-transform:uppercase}.warning{padding:11px 12px;background:#241f1c;border:1px solid #94724d;color:#f3d3a5;border-radius:8px;font-size:12px;margin:11px 0}.neutral{padding:11px 12px;background:#133342;border:1px solid #426c74;border-radius:8px;font-size:12px}
.place-list{margin:9px -5px 0;display:flex;flex-direction:column;max-height:47vh;overflow-y:auto;gap:3px;padding-right:2px}.placebtn{display:flex;text-align:left;gap:8px;align-items:flex-start;width:100%;border:1px solid transparent;padding:8px;border-radius:7px;background:transparent;color:#eae1d1}.placebtn:hover,.placebtn[aria-selected=true]{border-color:#97764c;background:#21394a}.placebtn .dot{border:2px solid #e4cd91;border-radius:50%;width:10px;height:10px;flex-shrink:0;margin-top:5px}.placebtn .dot.uncertain{border-style:dashed;border-color:#df9a4a}.placebtn strong{font-size:13px}.placebtn small{display:block;color:#9cb9bf;font-size:11px}
.checkbox{display:flex;gap:9px;align-items:center;margin:9px 0;font-size:12px;color:#d8dfd9}.checkbox input{accent-color:#bc9155;width:16px;height:16px}.mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn{background:#1b3d4c;color:#f8e9cd;border:1px solid #968052;border-radius:8px;padding:10px 11px;font-weight:600}.btn:hover{background:#274e5c}.btn.primary{background:#bc995f;color:#081523;border-color:#efc997}.btn.ghost{background:transparent}.btn[disabled]{opacity:.45;cursor:not-allowed}
.center{grid-area:center;min-width:0;display:flex;flex-direction:column;position:relative;background:#132c33}.topline{background:#0a202c;border-bottom:1px solid #9b7b51;padding:10px 13px;display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;min-height:51px}.topline strong{font-family:var(--serif);letter-spacing:.05em;color:#eed4a9;font-size:15px}.topline .tools{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.tool{background:#092634;border:1px solid #607278;color:#e6e5d9;padding:6px 10px;border-radius:7px;font-size:12px}.tool.active{background:#725737;color:#fff0d2;border-color:#e6bd81}.tool .key{color:#b0b8ba;font-size:11px}
.viewport{height:calc(100vh - 215px);min-height:570px;position:relative;overflow:hidden;background:#24343b;display:flex;align-items:center;justify-content:center}.map-svg{width:100%;height:100%;display:block;touch-action:none;user-select:none;cursor:grab}.map-svg.dragging{cursor:grabbing}.map-svg.placing{cursor:crosshair}.map-svg[hidden]{display:none}.tool:disabled{opacity:.42;cursor:not-allowed}.epoch-overlay{position:absolute;inset:0;background:#071827ef;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;color:#f3d9a8;gap:12px}.epoch-overlay[hidden]{display:none}.epoch-overlay strong{font-family:Georgia,serif;letter-spacing:.08em;font-size:clamp(23px,3vw,44px)}.epoch-overlay p{max-width:610px;line-height:1.6}.map-svg .hidden-layer{display:none}.map-svg .point-marker{cursor:pointer}.map-svg .point-marker .pin-shell{fill:#11212b;stroke:#ffe1a5;stroke-width:7}.map-svg .point-marker.uncertain .pin-shell{fill:#513a2c;stroke:#f1b266;stroke-dasharray:9 7}.map-svg .point-marker.relocated .pin-shell{stroke:#6fe3dc}.map-svg .point-marker .pin-text{font-family:Georgia,serif;font-size:28px;fill:#fce4b1;paint-order:stroke;stroke:#0d2630;stroke-width:6}.map-svg .point-marker .pin-label{font-family:Georgia,serif;font-weight:bold;font-size:31px;fill:#302724;paint-order:stroke;stroke:#f7e5b9;stroke-width:7;stroke-linejoin:round}.map-svg .point-marker.selected .pin-shell{fill:#dba65e;stroke:#fffce8}.map-svg .point-marker.selected .pin-text{fill:#101e2d}
.overlay-note{position:absolute;bottom:18px;left:17px;max-width:530px;border:1px solid #d1b37a;background:#071c2bdf;backdrop-filter:blur(6px);padding:10px 13px;border-radius:8px;color:#f9e4c3;font-size:12px;pointer-events:none}.viewstatus{background:#091f2a;border-top:1px solid #5b665b;padding:8px 13px;display:flex;justify-content:space-between;align-items:center;gap:10px;color:#b6c9c8;font-size:12px;flex-wrap:wrap}
.card{border:1px solid #67716a;background:#0a2432;border-radius:10px;overflow:hidden;margin-bottom:16px}.card .top{padding:14px 13px 12px;border-bottom:1px solid #60716a;background:linear-gradient(150deg,#25465a,#0e2836)}.card h2{font-family:var(--serif);font-size:23px;line-height:1.2;margin:4px 0;color:#f5dfb4}.pill{display:inline-flex;align-items:center;border:1px solid #ab8755;border-radius:20px;padding:3px 8px;font-size:11px;color:#ffdf9d;margin:3px 4px 0 0}.pill.orange{border-style:dashed;color:#f0b977}.data-field{margin:8px 0}.data-label{color:#a9bdba;font-size:11px;text-transform:uppercase;letter-spacing:.09em}.data-value{color:#faf0dc;font-size:13px;margin-top:3px}.card-inner{padding:13px}.seg{display:flex;gap:5px;margin:12px 0}.seg button{flex:1;font-size:11px;padding:7px;border:1px solid #566976;border-radius:6px;background:#102b3a;color:#e5ddc9}.seg button[aria-selected=true]{background:#685437;color:#fff1d6;border-color:#cba670}.evidence{border-left:3px solid #ccaa70;padding:4px 0 4px 11px;color:#e0d8c8;line-height:1.55}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pair label{font-size:11px;color:#a9bec0}.pair input{width:100%;margin-top:3px;background:#081b28;border:1px solid #66756c;color:#e6e5dd;border-radius:6px;padding:6px 7px}.copyright{grid-area:foot;border-top:1px solid #92714a;background:#071723;padding:10px 19px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;color:#afc1c2;font-size:11px}
.epochSelect{color:#e9d5ab;background:#071c2a;border:1px solid #9b7954;border-radius:8px;padding:9px;font-size:12px;max-width:100%}#histWarning[hidden]{display:none}#heritageBlock[hidden]{display:none}
@media(max-width:1200px){.shell{grid-template-columns:235px minmax(0,1fr) 290px}.sidebar,.inspector{padding:14px 12px}.card h2{font-size:20px}.viewport{min-height:510px}}
@media(max-width:950px){.shell{grid-template-columns:minmax(0,1fr) minmax(270px,.4fr);grid-template-rows:auto auto auto auto;grid-template-areas:'head head' 'center center' 'side info' 'foot foot'}.sidebar,.inspector{max-height:none;overflow:visible;border-top:1px solid #66746c}.viewport{height:68vh;min-height:360px}.place-list{max-height:330px}.overlay-note{font-size:10px}}
@media(max-width:600px){header{padding:12px 14px}.brand{min-width:150px}.logo{font-size:22px}.actions{width:100%;overflow-x:auto;flex-wrap:nowrap}.tabbtn{font-size:11px;padding:8px}.shell{display:flex;flex-direction:column}.center{order:2}.sidebar{order:3;border-right:0}.inspector{order:4;border-left:0}.copyright{order:5}.viewport{height:min(68vh,77vw);min-height:245px}.overlay-note{left:8px;right:8px;bottom:9px;max-width:none;padding:7px}.place-list{max-height:220px}.card h2{font-size:23px}.mini-grid{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Site adaptation: navigation, spoilers, narrow-screen controls. */
h1.logo{margin:0}.nelya-nav{display:flex;flex-wrap:wrap;gap:8px 18px;width:100%;font-size:12px}.nelya-nav a{padding:7px 0;text-underline-offset:4px}.spoiler-choice{align-items:flex-start}.spoiler-choice input{flex-shrink:0}#sourceDetails[hidden],#novelChronology[hidden],[hidden]{display:none!important}.copyright{padding-bottom:85px}.shell>*{min-width:0}button,a,input,select{touch-action:manipulation}.btn,.tool{min-height:42px}.placebtn{min-height:44px}#epochOverlay{z-index:5}@media(max-width:600px){header{padding:14px}header .actions{gap:5px}.tabbtn{padding:9px 8px;font-size:12px}.nelya-nav{gap:4px 12px}.topline{flex-wrap:wrap}.tools{flex-wrap:wrap}.logo{font-size:25px}.copyright{overflow-wrap:anywhere}}
