/* ImageGen materials, shared by the chronicle and the field guide.
   Nine-slice corners retain their scale; text and controls remain native.
   Material grain uses the header textures at their fixed CSS scale.
   Resizing or expanding a card never enlarges the grain; no blur or blend pass. */
html[data-uo-theme]{--ue-panel:url('/static/uo-editorial-northern-panel-v1.webp');--ue-grain:url('/static/uo-v2-leather.webp');--ue-grain-size:460px 460px;--ue-surface-wash:linear-gradient(#273748a8,#101b29c7);--ue-base:#223246;--ue-shade:#07132155;--ue-nav:url('/static/uo-editorial-northern-nav-v1.webp');--ue-ink:#dde6ed;--ue-title:#f1d6a2;--ue-muted:#b0c3d2;--ue-edge:#8599a84d;--ue-wash:#10202be8;--ue-row:#a1c3dd0a;--ue-accent:#dfbd78}
html[data-uo-theme='night']{--ue-surface-wash:linear-gradient(#030506e3,#0a0b0de8);--ue-panel:url('/static/uo-editorial-night-panel-v1.webp');--ue-base:#25241e;--ue-shade:#0b0a0855;--ue-nav:url('/static/uo-editorial-night-nav-v1.webp');--ue-ink:#e2ddd0;--ue-title:#ead3a7;--ue-muted:#bab4a6;--ue-edge:#b39a6547;--ue-wash:#181713ed;--ue-row:#d3bc7d0a;--ue-accent:#d8b779}
html[data-uo-theme='light']{--ue-grain:url('/static/uo-editorial-light-grain-v1.webp');--ue-grain-size:96px 96px;--ue-surface-wash:linear-gradient(#f5e8d1d9,#ebdec5e0);--ue-panel:url('/static/uo-editorial-light-panel-v1.webp');--ue-base:#e9dbba;--ue-shade:#f2e9d440;--ue-nav:url('/static/uo-editorial-light-nav-v1.webp');--ue-ink:#3d3528;--ue-title:#60441e;--ue-muted:#685940;--ue-edge:#80633855;--ue-wash:#efe6cefa;--ue-row:#95733c0c;--ue-accent:#75501d}

/* A carved navigation rail and substantial corner fittings on the main banner. */
html[data-uo-theme] body #crm .uo-portal-nav{isolation:isolate;background:none!important;border:0!important;box-shadow:none!important;padding-inline:28px}
html[data-uo-theme] body #crm .uo-portal-nav::before{content:''!important;inset:0;z-index:-1;opacity:1;filter:none!important;background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base)!important;background-blend-mode:normal,normal!important;background-clip:padding-box!important;border-width:7px 15px!important;border-style:solid!important;border-color:transparent!important;border-image:var(--ue-nav) 44 84 / 12px 30px / 0 round!important}
html[data-uo-theme] body #crm .uo-portal-nav button{border:0!important;box-shadow:none!important;text-shadow:0 1px 2px #0006}
html[data-uo-theme='light'] body #crm .uo-portal-nav button{color:var(--ue-ink)!important;text-shadow:none!important}
html[data-uo-theme] body #crm .uo-chronicle-hero::after{border:1px solid transparent!important;border-image:var(--ue-panel) 92 / 23px / 0 round!important;inset:0!important;filter:none!important}

/* A folio page, not an image crossing a wire frame. */
html[data-uo-theme] body #crm #news-articles .hn-card[data-news-id]{background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base)!important;background-blend-mode:normal,normal!important;background-clip:padding-box!important;border:5px solid transparent!important;border-image:var(--ue-panel) 92 / 28px / 0 round!important;border-radius:0!important;box-shadow:none!important;overflow:hidden;isolation:isolate;color:var(--ue-ink)}
html[data-uo-theme] body #crm #tab-news .hn-list{gap:23px}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-intro{padding:28px 31px 19px}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-title{color:var(--ue-title)!important;font-size:26px;line-height:1.28;text-shadow:none!important}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-excerpt{color:var(--ue-ink)!important;line-height:1.8}
html[data-uo-theme] body #crm #tab-news .hn-card :is(.hn-date,.hn-author){color:var(--ue-muted)!important}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-pin{background:transparent!important;color:var(--ue-accent)!important;border:0!important;border-bottom:1px solid var(--ue-edge)!important;border-radius:0;padding:3px 0;font-size:10px;letter-spacing:.035em}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-details{padding:0 31px 23px!important;background:none!important}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-read{color:var(--ue-accent)!important;min-height:42px}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-full{border-color:var(--ue-edge)!important;color:var(--ue-ink)!important}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-art{position:relative;box-sizing:border-box;width:calc(100% - 48px)!important;margin:0 24px 8px;height:220px;border:0!important;overflow:hidden;flex:none;isolation:isolate;background:transparent!important;clip-path:polygon(.4% 1.5%,12% 0,23% 1%,39% 0,54% .8%,72% 0,86% 1%,99.6% 0,100% 23%,99.7% 48%,100% 76%,99.5% 99%,85% 100%,67% 99%,49% 100%,32% 99.2%,18% 100%,.3% 99%,0 74%,.3% 49%,0 22%);mask-image:linear-gradient(to bottom,transparent,#000 10px,#000 calc(100% - 10px),transparent);-webkit-mask-image:linear-gradient(to bottom,transparent,#000 10px,#000 calc(100% - 10px),transparent)}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-art::after{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;box-shadow:inset 0 0 0 1px var(--ue-edge),inset 0 0 13px #0006}
html[data-uo-theme] body #crm #tab-news .hn-card .hn-art>img{max-width:100%;filter:none!important}

/* Wiki catalogues keep their original content and accessible table relationships. */
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards{display:block!important;width:100%!important;margin:20px 0 28px!important;background:none!important;border:0!important;border-image:none!important;box-shadow:none!important;color:var(--ue-ink)!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards :is(thead,tbody,tfoot){display:contents}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards tbody{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:16px}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-gallery tbody{grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr))}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-table-head{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry{display:flex!important;flex-direction:column;gap:11px;padding:24px!important;min-width:0;margin:0!important;box-sizing:border-box;background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base)!important;background-blend-mode:normal,normal!important;background-clip:padding-box!important;border:4px solid transparent!important;border-image:var(--ue-panel) 92 / 23px / 0 round!important;box-shadow:none!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry>td{display:block;width:auto!important;min-width:0!important;padding:0!important;margin:0!important;border:0!important;border-image:none!important;background:none!important;color:var(--ue-ink)!important;text-shadow:none!important;overflow-wrap:anywhere}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry>.uo-wiki-entry-title{order:1;font:600 19px/1.35 Georgia,'Times New Roman',serif!important;color:var(--ue-title)!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry-title :is(b,strong,a){font:inherit!important;color:inherit!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry>.uo-wiki-entry-picture{order:2;text-align:center}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry>.uo-wiki-entry-copy{order:3;font-size:13px;line-height:1.75}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry>.uo-wiki-entry-number{order:0;font:600 11px/1.2 Georgia,serif;color:var(--ue-muted)!important;letter-spacing:.1em}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry-picture img{display:block;max-width:100%!important;width:auto!important;height:auto!important;max-height:260px!important;object-fit:contain;margin:3px auto!important;border:1px solid var(--ue-edge)!important;border-radius:3px!important;padding:3px;box-sizing:border-box;background:#0002}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry-title img{max-width:100%!important;height:auto!important}

/* Comparisons stay readable as comparisons, with ruled rows and a material surround. */
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-ledger-scroll{max-width:100%;overflow:auto;margin:20px 0 28px;padding:15px;box-sizing:border-box;background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base);background-blend-mode:normal,normal;background-clip:padding-box;border:4px solid transparent;border-image:var(--ue-panel) 92 / 23px / 0 round;scrollbar-width:thin}
html[data-uo-theme] body #crm #wiki-art-content table.uo-wiki-ledger{width:100%!important;min-width:540px;margin:0!important;background:var(--ue-wash)!important;border:0!important;border-collapse:collapse;color:var(--ue-ink)!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-ledger :is(th,td){border:0!important;border-bottom:1px solid var(--ue-edge)!important;padding:13px 15px!important;background:transparent!important;color:var(--ue-ink)!important;line-height:1.6;text-shadow:none!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-ledger th{font:600 14px/1.45 Georgia,serif!important;color:var(--ue-title)!important;text-align:left;background:var(--ue-row)!important}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-ledger tr:nth-child(even)>td{background:var(--ue-row)!important}
html[data-uo-theme] body #crm #wiki-art-content [data-craft-item][data-skill]{border:4px solid transparent!important;border-image:var(--ue-panel) 92 / 19px / 0 round!important;border-radius:0!important;background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base)!important;background-blend-mode:normal,normal!important;background-clip:padding-box!important;padding:20px!important;box-shadow:none!important;color:var(--ue-ink)!important}

@media(max-width:600px){
 html[data-uo-theme] body #crm .uo-portal-nav{padding-inline:15px!important}
 html[data-uo-theme] body #crm .uo-portal-nav::before{border-image-width:10px 19px!important}
 html[data-uo-theme] body #crm #news-articles .hn-card[data-news-id]{border-image-width:22px!important}
 html[data-uo-theme] body #crm #tab-news .hn-card .hn-intro{padding:23px 23px 16px}
 html[data-uo-theme] body #crm #tab-news .hn-card .hn-title{font-size:23px}
 html[data-uo-theme] body #crm #tab-news .hn-card .hn-details{padding:0 23px 18px!important}
 html[data-uo-theme] body #crm #tab-news .hn-card .hn-art{width:calc(100% - 34px)!important;margin:0 17px 5px;height:185px}
 html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards tbody{grid-template-columns:1fr;gap:13px}
 html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-cards .uo-wiki-entry{padding:23px!important}
 html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-ledger-scroll{padding:11px}
 html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-ledger :is(th,td){padding:11px!important}
}

html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-entry-copy::before{content:attr(data-label);display:block;margin:0 0 4px;font-size:10px;letter-spacing:.04em;color:var(--ue-muted)}
html[data-uo-theme] body #crm #wiki-art-content .uo-wiki-entry-copy:is([data-label='Описание'],[data-label='Description'])::before{display:none}

/* Feather only the inner material of the sliced frame. The hardware stays sharp. */
html[data-uo-theme] body #crm :is(#news-articles .hn-card[data-news-id],#wiki-art-content .uo-wiki-entry,#wiki-art-content .uo-wiki-ledger-scroll,#wiki-art-content [data-craft-item][data-skill]){position:relative;isolation:isolate;border-image:none!important;--ue-frame-inset:0px;--ue-frame-depth:23px}
html[data-uo-theme] body #crm #news-articles .hn-card[data-news-id]{--ue-frame-inset:0px;--ue-frame-depth:28px}
html[data-uo-theme] body #crm #wiki-art-content [data-craft-item][data-skill]{--ue-frame-depth:19px}
html[data-uo-theme] body #crm :is(#news-articles .hn-card[data-news-id],#wiki-art-content .uo-wiki-entry,#wiki-art-content .uo-wiki-ledger-scroll,#wiki-art-content [data-craft-item][data-skill])::before{content:'';position:absolute;inset:var(--ue-frame-inset);z-index:-1;pointer-events:none;background:none!important;opacity:1;filter:none!important;border:1px solid transparent;border-image:var(--ue-panel) 92 / var(--ue-frame-depth) / 0 round;-webkit-mask-image:linear-gradient(90deg,#000 calc(var(--ue-frame-depth) - 13px),transparent var(--ue-frame-depth),transparent calc(100% - var(--ue-frame-depth)),#000 calc(100% - var(--ue-frame-depth) + 13px)),linear-gradient(0deg,#000 calc(var(--ue-frame-depth) - 13px),transparent var(--ue-frame-depth),transparent calc(100% - var(--ue-frame-depth)),#000 calc(100% - var(--ue-frame-depth) + 13px));mask-image:linear-gradient(90deg,#000 calc(var(--ue-frame-depth) - 13px),transparent var(--ue-frame-depth),transparent calc(100% - var(--ue-frame-depth)),#000 calc(100% - var(--ue-frame-depth) + 13px)),linear-gradient(0deg,#000 calc(var(--ue-frame-depth) - 13px),transparent var(--ue-frame-depth),transparent calc(100% - var(--ue-frame-depth)),#000 calc(100% - var(--ue-frame-depth) + 13px));-webkit-mask-composite:source-over;mask-composite:add}
@media(max-width:600px){html[data-uo-theme] body #crm #news-articles .hn-card[data-news-id]{--ue-frame-depth:22px}}

/* A painted folio panorama: scenery dissolves into the material beneath the title. */
html[data-uo-theme]{--ue-hero:url('/static/uo-hero-northern-v2.webp');--ue-hero-mobile:linear-gradient(90deg,#0b192be8,#0b192bb8 54%,#0b192b48)}
html[data-uo-theme='night']{--ue-hero:url('/static/uo-hero-night-v2.webp');--ue-hero-mobile:linear-gradient(90deg,#14110fed,#14110fb8 54%,#14110f38)}
html[data-uo-theme='light']{--ue-hero:url('/static/uo-hero-light-v2.webp');--ue-hero-mobile:linear-gradient(90deg,#ecdbb9ed,#ecdbb9c4 54%,#ecdbb94d)}
html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero{--ue-feather-x:46px;--ue-feather-y:28px;background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base)!important;background-blend-mode:normal,normal!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:29px 40px;min-height:224px}
/* Fade the painting itself into the shared material; keep text and controls crisp.
   Both masks are static, with no blur or extra image downloads. */
html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero::before{content:'';position:absolute;inset:0;z-index:0;pointer-events:none;opacity:1;filter:none!important;transform:none;border:0;background:var(--ue-hero) center/cover no-repeat!important;-webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--ue-feather-x),#000 calc(100% - var(--ue-feather-x)),transparent),linear-gradient(0deg,transparent,#000 var(--ue-feather-y),#000 calc(100% - var(--ue-feather-y)),transparent);mask-image:linear-gradient(90deg,transparent,#000 var(--ue-feather-x),#000 calc(100% - var(--ue-feather-x)),transparent),linear-gradient(0deg,transparent,#000 var(--ue-feather-y),#000 calc(100% - var(--ue-feather-y)),transparent);-webkit-mask-composite:source-in;mask-composite:intersect}
html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero::after{border-image-width:11px!important;border-image-repeat:round!important}
html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero .hn-heading{background:none!important}
html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero .uo-hero-intro{color:#dce3e7!important}
html[data-uo-theme='light'] body #crm #tab-news .uo-chronicle-hero .uo-hero-intro{color:#51422b!important}
@media(max-width:600px){
 html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero{--ue-feather-x:28px;--ue-feather-y:22px;padding:26px 23px;min-height:242px}
 html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero::before{background-image:var(--ue-hero-mobile),var(--ue-hero)!important;background-position:82% center!important}
 html[data-uo-theme] body #crm #tab-news .uo-chronicle-hero::after{border-image-width:9px!important}
}


/* Night news: match the warm charcoal inside the existing leather frame.
   Fixed-scale grain stays sharp; scoped variables leave other surfaces intact. */
html[data-uo-theme='night'] body #crm #news-articles .hn-card[data-news-id]{
 --ue-surface-wash:linear-gradient(#302d27b8,#2b2823b8);
 --ue-base:#292823;
}


/* Night Wiki: one warm material for catalogues, recipes and authored panels.
   Keep grain at its native CSS scale and preserve item/rarity colors. */
html[data-uo-theme='night'] body #crm #tab-wiki{
 --ue-surface-wash:linear-gradient(#302d27b8,#2b2823b8);
 --ue-base:#292823;--ue-wash:#292823ed;
 --uc-panel:#292823;--uc-raised:#343129;--uc-line:#645b49;
 --uc-ink:#e2ddd0;--uc-muted:#bab4a6;
 --card:#292823;--brd:#645b4980;
}
html[data-uo-theme='night'] body #crm #wiki-art-content .uo-finish-frame{
 background:var(--ue-surface-wash),var(--ue-grain) left top/var(--ue-grain-size) repeat var(--ue-base)!important;
 background-clip:padding-box!important;
}
html[data-uo-theme='night'] body #crm #tab-wiki :is(#wiki-nav,.wiki-mob-panel,#craft-bar){background:#24221e!important;border-color:#645b49!important;backdrop-filter:none!important}
html[data-uo-theme='night'] body #crm #wiki-art-content :is(details,blockquote,pre){background:#292823!important;border-color:#645b49!important}
html[data-uo-theme='night'] body #crm #wiki-art-content table:not(.uo-wiki-cards):not(.uo-wiki-ledger){background:#292823!important;border-color:#645b49!important}
html[data-uo-theme='night'] body #crm #tab-wiki :is(input:not([type='checkbox']):not([type='radio']),select,textarea){background:#1e1d19!important;color:#e2ddd0!important;border-color:#645b49!important;caret-color:#e2ddd0}
html[data-uo-theme='night'] body #crm #tab-wiki :is(input,textarea)::placeholder{color:#bab4a6!important;opacity:1}
html[data-uo-theme='night'] body #crm #tab-wiki select option{background:#1e1d19;color:#e2ddd0}
html[data-uo-theme='night'] body #crm #tab-wiki :is(input,select,textarea):focus-visible{outline:2px solid #d8b779!important;outline-offset:2px}
html[data-uo-theme='night'] body #crm #wiki-art-content [data-craft-item][data-skill]>div:nth-child(2){color:#bab4a6!important}
html[data-uo-theme='night'] body #crm #wiki-art-content #craft-bar span{color:#bab4a6!important}
/* Shared item popovers are outside the Wiki DOM: tint only while Wiki is active. */
html[data-uo-theme='night'] body:has(#tab-wiki.active) :is(.uo-item-popover,#wiki-item-tip){background:#292823!important;color:#e2ddd0!important;backdrop-filter:none!important}

/* Night navigation: reveal the artwork's carved interior, without a black wash. */
html[data-uo-theme='night'] body #crm .uo-portal-nav::before{
 background:none!important;
 border-image-slice:44 84 fill!important;
}
html[data-uo-theme='night'] body #crm .uo-portal-nav button[data-portal-tab]{
 color:#dfc99e!important;background:transparent!important;
 text-shadow:0 1px 2px #17140e!important;
}
html[data-uo-theme='night'] body #crm .uo-portal-nav button[data-portal-tab]:is(:hover,.is-active){color:#f3dda9!important}
html[data-uo-theme='night'] body #crm .uo-portal-nav button[data-portal-tab]:focus-visible{outline:2px solid #dfc99e;outline-offset:-7px}
