/* Кровь и сталь — PORTAL 2.8 | global illustrated style
   Based on approved art direction: dark engraved stone, medieval city, gold ink.
   This stylesheet changes visual presentation only; no change to app state, OAuth or reader text.
   Deliberately preserve :root reader theming and its editable typography. */
:root{
  --ks27-dark:#061017;--ks27-ink:#08151c;--ks27-gold:#cba06a;
  --ks27-gold-hi:#edc58d;--ks27-gold-low:#71563a;--ks27-cream:#f1e5d1;
  --ks27-muted:#b6b7b1;--ks27-rule:rgba(202,156,92,.42);
  --ks27-castle:url('/ks-media/heraldry/aldmer-castle-v26.webp');
  --ks27-stone:url('/ks-media/heraldry/aldmer-ink-texture-v26.webp');
  --ks27-rock:url('/ks-media/heraldry/aldmer-rock-v26.webp');
  --ks27-frame:url('/ks-media/heraldry/aldmer-frame-v26.svg');
  --ks27-crest:url('/icons/ks-tree-emblem.webp');
}
html{background:#061017}
body{background:#061017!important;color:var(--ks27-cream)!important}
body:before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;
 background:linear-gradient(90deg,rgba(1,6,9,.6),rgba(3,11,16,.18)),var(--ks27-stone) center / 900px auto repeat;opacity:.56}
/* Site frame, logo and the authoritative navigational chrome */
body .shell{background:transparent!important}
body .sidebar{
  background-image:linear-gradient(180deg,rgba(4,13,19,.86),rgba(4,12,17,.96)),var(--ks27-stone)!important;
  background-position:center!important;background-size:100% 100%,950px auto!important;
  background-color:#061018!important;border-right:1px solid rgba(208,164,95,.44)!important;
  box-shadow:inset -11px 0 24px rgba(0,0,0,.22),4px 0 26px rgba(0,0,0,.23);
}
body .sidebar::before{content:'';position:absolute;inset:8px 6px 8px 6px;
 border-left:1px solid rgba(217,165,95,.11);border-top:1px solid rgba(217,165,95,.18);border-bottom:1px solid rgba(217,165,95,.14);
 pointer-events:none;opacity:.68}
body .sidebar .brand{position:relative;z-index:1}
body .sidebar .brand-symbol,body .sidebar .brand-symbol img{filter:drop-shadow(0 0 15px rgba(186,127,64,.16))}
body .sidebar .brand-copy strong{color:#ead4ab!important;font-family:Georgia,'Times New Roman',serif!important;letter-spacing:.09em!important}
body .sidebar .brand-top,body .sidebar .brand-bottom,body .side-label{color:#d5ac72!important;letter-spacing:.22em!important}
body .sidebar .side-nav a{
 border-bottom:1px solid rgba(210,169,100,.13)!important;transition:color .25s ease,background-color .25s ease,border-color .25s ease;
}
body .sidebar .side-nav a:hover,body .sidebar .side-nav a:focus-visible{background:rgba(211,162,96,.085)!important;color:#f6e4c7!important}
body .sidebar .side-nav a.active,body .sidebar .side-nav a[aria-current="page"]{
 color:#f1d1a0!important;background:linear-gradient(100deg,rgba(169,116,67,.2),rgba(12,23,28,.4))!important;
 box-shadow:inset 3px 0 0 #d2a568,inset 0 0 0 1px rgba(213,164,92,.3)!important;
}
body .sidebar .nav-icon{color:#d8ac73!important}
body .sidebar .ks-offline-side-link,body .sidebar .ks-contact-link{
 background:rgba(5,13,19,.48)!important;border:1px solid rgba(212,161,96,.32)!important;color:#e0bb8c!important;
}
body .sidebar .ks-offline-side-link:hover,body .sidebar .ks-contact-link:hover{background:rgba(215,161,96,.1)!important;border-color:#d3a56c!important}
body .main-column{background:transparent!important;min-width:0}
body .topbar{
 background:linear-gradient(93deg,rgba(3,11,16,.97),rgba(5,17,24,.91)),var(--ks27-stone) center/900px!important;
 border-bottom:1px solid rgba(206,161,90,.47)!important;box-shadow:0 4px 20px rgba(0,0,0,.15)!important;
}
body .topbar .breadcrumb,body .topbar .topbar-breadcrumb{color:#cfbfaa!important}
body .topbar .topbar-actions button,body .topbar button,body .topbar a{
 border-color:rgba(208,168,105,.33)!important;
}
body .topbar button:hover,body .topbar a:hover{border-color:rgba(236,189,115,.65)!important}
body .ks-spoiler-strip,body #ks-spoiler-strip{
 background:linear-gradient(90deg,rgba(16,25,30,.86),rgba(6,17,24,.9))!important;
 border-bottom:1px solid rgba(197,155,87,.26)!important;color:#c6c1b6!important;
}
/* All main routes: background extracted as a continuous scene from the approved visual direction. */
#view{background:#061119;min-height:calc(100vh - 90px)}
#view>.page:not(.reader-v07),#view>.hero-page{
 position:relative;isolation:isolate;overflow:hidden;min-height:calc(100vh - 92px);
 background-color:#061119!important;
 background-image:
  linear-gradient(90deg,rgba(5,14,20,.16) 0%,rgba(4,14,20,.12) 58%,rgba(3,11,16,.2) 100%),
  linear-gradient(180deg,rgba(7,18,24,.05) 0%,rgba(6,16,23,.55) 550px,rgba(6,16,23,.92) 100%),
  var(--ks27-castle),var(--ks27-stone)!important;
 background-position:center,center,right 0 top 0,center!important;
 background-size:100% 100%,100% 100%,min(78vw,1000px) auto,1000px auto!important;
 background-repeat:no-repeat,no-repeat,no-repeat,repeat!important;
}
#view>.page:not(.reader-v07):before{content:'';position:absolute;inset:0;z-index:0;pointer-events:none;
 background-image:var(--ks27-frame);background-position:center top;
 background-size:100% min(100vh,1100px);background-repeat:no-repeat;
 opacity:.52;}
#view>.page:not(.reader-v07):after{content:'';position:absolute;bottom:0;right:0;width:min(29vw,390px);height:310px;z-index:0;pointer-events:none;
 background:var(--ks27-rock) bottom right/contain no-repeat;opacity:.46;mask-image:linear-gradient(to top,#000 0%,transparent 98%);}
#view>.page:not(.reader-v07)>*,#view>.hero-page>*{position:relative;z-index:1}
/* Page headings styled as a monumental page of a medieval chronicle. */
#view>.page:not(.reader-v07) .page-heading{
 position:relative;text-align:center!important;margin-inline:auto!important;
 padding:clamp(38px,5vw,67px) 16px clamp(25px,3vw,37px)!important;
 max-width:1130px!important;
}
#view>.page:not(.reader-v07) .page-heading:before{
 content:'✧ ─────── ◈ ─────── ✧';display:block;pointer-events:none;
 font:400 clamp(11px,1.5vw,17px)/1.4 Georgia,serif;letter-spacing:.17em;
 color:#d0a367;opacity:.86;margin:0 auto 18px;
}
#view>.page:not(.reader-v07) .page-heading .overline, #view>.page:not(.reader-v07) .eyebrow,
#view>.page:not(.reader-v07) .small-meta{
 color:#d6ab71!important;letter-spacing:.17em!important;
}
#view>.page:not(.reader-v07) .page-heading h1{
 font:400 clamp(42px,5.7vw,93px)/1.04 Georgia,'Times New Roman',serif!important;
 text-align:center!important;letter-spacing:-.035em!important;
 margin:10px auto 13px!important;max-width:100%!important;
 background:linear-gradient(170deg,#fff5de 15%,#e8c79a 67%,#c99a62 98%);
 -webkit-background-clip:text;background-clip:text;color:transparent!important;
 text-shadow:0 7px 40px rgba(0,0,0,.34)!important;
}
#view>.page:not(.reader-v07) .page-heading .subtitle{
 color:#dbad6e!important;font:italic 400 clamp(18px,2.4vw,31px)/1.25 Georgia,serif!important;
 text-align:center!important;margin:8px auto 12px!important;
}
#view>.page:not(.reader-v07) .page-heading p{
 font:400 clamp(14px,1.25vw,17px)/1.6 Georgia,'Times New Roman',serif!important;
 text-align:center!important;color:#d0c7b7!important;max-width:760px!important;margin:0 auto!important;
 text-shadow:0 2px 10px rgba(0,0,0,.72);
}
/* Fine gilt edge, cards feel like illustrated folios, not dashboard widgets. */
#view .section-head h2,#view .portal-book-feature h2,#view .people-intro strong,
#view .chronicle-intro h2,#view .chronicle-dossier h2,#view .atlas-detail h2{
 font-family:Georgia,'Times New Roman',serif!important;color:#f1dfc2!important;
}
#view .section-head{border-color:var(--ks27-rule)!important}
#view .section-head:after{color:#cda16c!important}
#view .feature-card,#view .location-card,#view .person-card,
#view .chronicle-dossier,#view .chronicle-intro,#view .portal-book-feature,
#view .book-cover,#view .book-card,#view .chronicle-summary,#view .people-intro,
#view .atlas-detail,#view .network-diagram,#view .politics-info,
#view .house-dossier,#view .portal-entrance-band,#view .portal-feature-grid .feature-card,
#view .book-chapters-preview,#view .library-chapter-grid>button{
 border-color:rgba(203,156,92,.36)!important;
 background-color:rgba(5,14,20,.62)!important;
 background-image:linear-gradient(135deg,rgba(194,137,69,.06),transparent 52%),var(--ks27-stone)!important;
 background-size:100% 100%,1200px auto!important;
 box-shadow:inset 0 0 0 1px rgba(6,13,17,.3),0 12px 26px rgba(0,0,0,.16);
}
#view .feature-card:hover,#view .location-card:hover,#view .person-card:hover,
#view .library-chapter-grid>button:hover{
 border-color:rgba(239,188,111,.8)!important;
 box-shadow:0 0 26px rgba(191,124,51,.12),0 16px 32px rgba(0,0,0,.22)!important;
}
#view .btn.primary,#view .portal-book-open,#view button.filter-pill.active,
#view .realm-switch button.active,#view .dynasty-tabs button.active{
 background:linear-gradient(155deg,#f0ca93,#b78b56)!important;color:#111b20!important;
 border:1px solid #eac58f!important;box-shadow:0 5px 17px rgba(0,0,0,.22)!important;
}
#view .btn.ghost,#view .text-link,#view .portal-book-qualities span{
 border-color:rgba(220,167,98,.37)!important;color:#e3bc85!important;
}
#view .filter-pill,#view .realm-switch button,#view .dynasty-tabs button,
#view .chronicle-control-label,#view .chronicle-arc-tabs button,#view .atlas-map-tabs button,
#view .atlas-layers button,#view .reader-back{
 border-color:rgba(209,163,97,.4)!important;
}
#view button:focus-visible,#view a:focus-visible, body button:focus-visible,body a:focus-visible{
 outline:2px solid #f0c58c!important;outline-offset:3px;
}
/* Routes: home stays cinematic; large hero artwork of Edgar and Arthur is not replaced. */
#view>.hero-page.portal-home{background-image:linear-gradient(180deg,rgba(4,11,17,.24),#061119 940px),var(--ks27-stone)!important;
 background-size:100% 100%,1000px auto!important;
}
#view .portal-home .hero{border:1px solid rgba(224,174,104,.43)!important;
 box-shadow:0 0 0 7px rgba(5,12,17,.26),0 18px 38px rgba(0,0,0,.42)!important;
}
#view .portal-home .hero:before{pointer-events:none;content:'';position:absolute!important;inset:11px;
 border:1px solid rgba(216,163,93,.18);z-index:6;}
#view .portal-home .hero h1{color:#f9e8cb!important;text-shadow:0 5px 22px rgba(0,0,0,.7)!important}
#view .portal-home .hero-inner{position:relative;z-index:8!important}
#view .portal-home .below-hero{position:relative;z-index:1}
#view .portal-home .section-head h2{font-size:clamp(29px,4vw,53px)!important}
/* Atlas: maps and controls remain usable, only the surrounding folio changes. */
#view .atlas-new .atlas-map-layout,#view .atlas-new .atlas-map-stage,
#view .atlas-new .atlas-image-stage{border:1px solid rgba(195,150,85,.4)!important;
 box-shadow:0 13px 32px rgba(0,0,0,.24)!important;}
#view .atlas-new .atlas-detail{background:rgba(6,17,24,.87)!important}
#view .atlas-paused-scene{border:1px solid rgba(218,173,108,.4)!important;
 background-image:linear-gradient(180deg,rgba(4,13,18,.48),rgba(4,12,17,.92)),var(--ks27-castle)!important;
 background-size:cover!important;background-position:center,right top!important;}
/* Chronicle timelines: inked paper, elegant nodes, fine metallic dividers. */
#view .chronicles-v06 .chronicle-summary{border-top:1px solid rgba(225,177,109,.48)!important;
 border-bottom:1px solid rgba(225,177,109,.45)!important}
#view .chronicles-v06 .chronicle-event{
 background:linear-gradient(105deg,rgba(14,26,33,.95),rgba(7,17,23,.86))!important;
 border:1px solid rgba(185,146,94,.23)!important;
}
#view .chronicles-v06 .chronicle-event:hover,#view .chronicles-v06 .chronicle-event.selected{
 border-color:rgba(223,176,106,.67)!important;
 background:linear-gradient(105deg,rgba(76,54,37,.62),rgba(10,23,29,.9))!important;
}
#view .chronicles-v06 .chronicle-track:before,#view .chronicles-v06 .chronicle-separator{
 background:#b78e5b!important;}
#view .chronicles-v06 .chronicle-dossier{background:rgba(4,15,21,.8)!important}
#view .chronicles-v06 .chronicle-intro{background:linear-gradient(115deg,rgba(9,20,27,.91),rgba(17,32,38,.72)),var(--ks27-stone)!important}
/* Portrait gallery: pronounced ceremonial portraits, no cropping or canon change. */
#view .people-page .person-grid,#view .people-page .people-grid{position:relative;z-index:1}
#view .people-page .person-card{overflow:hidden}
#view .people-page .person-image{border-bottom:1px solid rgba(210,170,100,.3)!important}
#view .people-page .person-card h3{font-family:Georgia,'Times New Roman',serif!important;
 font-size:clamp(23px,2vw,35px)!important;color:#f1dfc3!important}
#view .people-page .person-role{color:#cda36d!important}
#view .people-page .people-intro{
 border:1px solid rgba(217,160,90,.42)!important;
 background:linear-gradient(112deg,rgba(9,24,32,.94),rgba(31,32,32,.66)),var(--ks27-stone)!important;
}
/* Library: a bookroom rather than a dashboard. Cover and read CTA retain semantics. */
#view .library-v07 .library-hero,#view .library-v07 .library-books,
#view .library-v07 .library-book,#view .library-v07 .library-book-card{
 border-color:rgba(215,168,100,.4)!important;background-color:rgba(5,14,19,.66)!important;
}
#view .library-v07 .library-hero h1,#view .library-v07 .library-hero h2,
#view .library-v07 .library-hero .library-heading{
 color:#f3e3c9!important;font-family:Georgia,serif!important;
}
#view .library-v07 .book-chapters-preview{
 border:1px solid rgba(221,173,109,.35)!important;padding:clamp(18px,3vw,36px)!important;
}
#view #ks-offline-entry{background:linear-gradient(110deg,rgba(20,30,35,.93),rgba(9,22,29,.91)),var(--ks27-stone)!important;
 border-color:rgba(220,166,91,.57)!important;border-left:3px solid #d3a66f!important;}
/* Aldmer gallery now has a consolidated v28 stylesheet. */
/* Interactive dossiers and account/search windows: stone folios, strong readability. */
body #drawer,body #search-modal,body #overlay{--ks27-gold:#d0a36e}
body .drawer-panel,body .drawer-content,body .drawer-inner,
body .search-panel,body .account-modal,body .account-panel,
body .modal-panel,body .ks-account-modal{
 background-color:#07141c!important;
 background-image:linear-gradient(130deg,rgba(6,18,24,.95),rgba(7,18,24,.96)),var(--ks27-stone)!important;
 border-color:rgba(216,168,98,.58)!important;color:#e6d9c3!important;
}
/* Reader deliberately preserves content typography, paper/sepia/night, scroll and font controls. */
#view>.reader-v07{background:#08151b!important;color:inherit}
#view .reader-v07 .reader-progress-head,#view .reader-v07 .reader-toolbar,
#view .reader-v07 .reader-toc,#view .reader-v07 .reader-context{
 border-color:rgba(215,168,104,.35)!important;
}
#view .reader-v07 .reader-progress-head{
 background:linear-gradient(90deg,rgba(8,20,27,.96),rgba(17,27,29,.95)),var(--ks27-stone)!important;
}
#view .reader-v07 .reader-chapter-kicker,#view .reader-v07 .reader-progress-head strong{color:#c49a63!important}
/* Decorative ornaments on non-reader content without interfering with controls. */
#view .people-page .people-intro:after,#view .chronicles-v06 .chronicle-intro:after,
#view .library-v07 .library-intro:after{pointer-events:none}
/* Responsive: scene visible, typography scaled; no desktop fixed widths on mobile. */
@media(max-width:1180px){
 #view>.page:not(.reader-v07),#view>.hero-page{background-size:100% 100%,100% 100%,min(88vw,950px) auto,950px auto!important}
 #view>.page:not(.reader-v07) .page-heading h1{font-size:clamp(42px,6vw,74px)!important}
}
@media(max-width:800px){
 #view>.page:not(.reader-v07),#view>.hero-page{
  background-size:100% 100%,100% 100%,min(112vw,780px) auto,800px auto!important;
  background-position:center,center,right -70px top,center!important;
 }
 #view>.page:not(.reader-v07):before{background-size:190% auto;opacity:.3}
 #view>.page:not(.reader-v07):after{width:220px;height:180px;opacity:.24}
 #view>.page:not(.reader-v07) .page-heading{padding-top:40px!important}
 #view>.page:not(.reader-v07) .page-heading h1{font-size:clamp(38px,7.5vw,62px)!important}
 body .sidebar::before{display:none}
}
@media(max-width:580px){
 #view>.page:not(.reader-v07){background-size:100% 100%,100% 100%,120vw auto,750px auto!important;
 background-position:center,center,right -115px top 0,center!important;}
 #view>.page:not(.reader-v07) .page-heading{padding:26px 8px 20px!important}
 #view>.page:not(.reader-v07) .page-heading:before{font-size:10px;letter-spacing:.06em;margin-bottom:10px}
 #view>.page:not(.reader-v07) .page-heading h1{font-size:clamp(34px,10vw,55px)!important}
 #view>.page:not(.reader-v07) .page-heading .subtitle{font-size:clamp(18px,5vw,24px)!important}
 #view>.page:not(.reader-v07) .page-heading p{font-size:14px!important;line-height:1.55!important}
 #view .portal-home .hero:before{inset:5px}
 #view .library-v07 .book-chapters-preview{padding:14px!important}
}
@media(prefers-reduced-motion:reduce){
 body .sidebar .side-nav a,#view .feature-card,#view .location-card,#view .person-card{transition:none!important}
}
