/* Herstasia Dark Elegant diff CSS v3.0.34
   Target: Herstasia Online 3.0.3+
   Visual basis: dark, warm cultural-house identity from the Herstasia design manual.
   No fonts are bundled or fetched remotely. Preferred font names use local/system fallbacks. */
/* v3.0.34: Systemtest creates its terminal button dynamically without primary.
   Keep behaviour in System Audit and apply the standard theme primary palette. */
body.theme-dark-elegant .systemtest-v2-actions [data-systemtest-reload]{
  background:var(--de-rust-deep)!important;
  border:1px solid var(--de-rust-deep)!important;
  color:#FFF8ED!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  max-width:100%;
  padding:.65rem 1rem;
  border-radius:var(--de-radius);
  font:inherit;
  font-weight:700;
  line-height:1.35;
  white-space:normal;
  cursor:pointer;
}
body.theme-dark-elegant .systemtest-v2-actions [data-systemtest-reload]:is(:hover,:focus-visible){
  background:#7A3C1B!important;
  border-color:#7A3C1B!important;
  color:#FFF8ED!important;
}
body.theme-dark-elegant .systemtest-v2-actions [data-systemtest-reload]:focus-visible{
  outline:2px solid var(--de-amber);
  outline-offset:3px;
}
body.theme-dark-elegant .systemtest-v2-actions [data-systemtest-reload]:disabled{
  cursor:not-allowed;
  opacity:.6;
}
:root{
  --de-bg:#120F0B;
  --de-panel:#1C1710;
  --de-panel-2:#211B13;
  --de-cream:#F4EAD9;
  --de-cream-dim:rgba(244,234,217,.74);
  --de-cream-faint:rgba(244,234,217,.46);
  --de-rust:#C1653B;
  --de-rust-deep:#8B441F;
  --de-amber:#E7AD5C;
  --de-sage:#8A9573;
  --de-line:rgba(244,234,217,.14);
  --de-line-strong:rgba(231,173,92,.35);
  --de-shadow:0 18px 55px rgba(0,0,0,.34);
  --de-radius:4px;
  --de-serif:"Fraunces","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  --de-sans:"Work Sans","Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  --de-hand:"Caveat","Segoe Print","Bradley Hand",cursive;
}
html{background:var(--de-bg);color-scheme:dark}
body.theme-dark-elegant{
  --paper:#1C1710;--soft:#211B13;--ink:#F4EAD9;--muted:rgba(244,234,217,.72);--line:rgba(244,234,217,.16);--accent:#C1653B;--accent-dark:#E7AD5C;
  color:var(--de-cream);
  background:
    radial-gradient(circle at 85% -10%,rgba(193,101,59,.08),transparent 31rem),
    radial-gradient(circle at -5% 45%,rgba(231,173,92,.05),transparent 25rem),
    var(--de-bg);
  font-family:var(--de-sans);font-size:16px;line-height:1.7;-webkit-font-smoothing:antialiased;
}
body.theme-dark-elegant:after{content:"";position:fixed;right:-95px;bottom:-80px;width:300px;height:300px;background:url("botanical.png") center/contain no-repeat;opacity:.10;pointer-events:none;z-index:-1}
body.theme-dark-elegant h1,body.theme-dark-elegant h2,body.theme-dark-elegant h3,body.theme-dark-elegant h4,body.theme-dark-elegant .brand-wordmark,body.theme-dark-elegant .brand-copy strong{font-family:var(--de-serif);font-weight:500;color:var(--de-cream);letter-spacing:-.018em}
body.theme-dark-elegant h1{letter-spacing:-.032em}
body.theme-dark-elegant p,body.theme-dark-elegant li{color:var(--de-cream-dim)}
body.theme-dark-elegant a{color:var(--de-amber);text-underline-offset:.22em}
body.theme-dark-elegant a:hover{color:var(--de-cream)}
body.theme-dark-elegant .eyebrow{color:var(--de-amber);font:600 .72rem/1.3 var(--de-sans);letter-spacing:.18em;text-transform:uppercase}
body.theme-dark-elegant .lead{color:var(--de-cream-dim)}
body.theme-dark-elegant .muted{color:var(--de-cream-faint)}

/* Header and navigation */
body.theme-dark-elegant .site-header{padding:.8rem clamp(1rem,4vw,4rem);background:rgba(18,15,11,.92);border-bottom:1px solid var(--de-line);box-shadow:0 5px 28px rgba(0,0,0,.18);backdrop-filter:blur(10px)}
body.theme-dark-elegant .brand{gap:.8rem;color:var(--de-cream)}
body.theme-dark-elegant .brand img,body.theme-dark-elegant .brand-logo{width:50px;height:46px;object-fit:contain}
body.theme-dark-elegant .brand-wordmark{font-size:1.65rem}
body.theme-dark-elegant .site-nav{gap:clamp(.65rem,2vw,1.25rem);align-items:center}
body.theme-dark-elegant .site-nav a{position:relative;padding:.45rem .05rem;color:var(--de-cream-dim);font:600 .77rem/1.2 var(--de-sans);letter-spacing:.02em;text-decoration:none}
body.theme-dark-elegant .site-nav a:hover{color:var(--de-cream)}
body.theme-dark-elegant .site-nav a:after{content:"";position:absolute;left:50%;right:50%;bottom:.08rem;height:1px;background:var(--de-rust);transition:left .18s ease,right .18s ease}
body.theme-dark-elegant .site-nav a:hover:after{left:0;right:0}

/* Global layout and surfaces */
body.theme-dark-elegant .site-main{width:min(1240px,calc(100% - 2rem));margin:3rem auto 5rem}
body.theme-dark-elegant .hero-panel,body.theme-dark-elegant .narrow-panel,body.theme-dark-elegant .reading-page,body.theme-dark-elegant .admin-section,
body.theme-dark-elegant .story-card,body.theme-dark-elegant .profile-card,body.theme-dark-elegant .review-card,body.theme-dark-elegant .review-admin-card,
body.theme-dark-elegant .update-card,body.theme-dark-elegant .modal-card,body.theme-dark-elegant .consent-copy,body.theme-dark-elegant .legal-summary,
body.theme-dark-elegant .theme-card,body.theme-dark-elegant .person-card,body.theme-dark-elegant .public-reader-card{
  background:linear-gradient(145deg,rgba(28,23,16,.98),rgba(18,15,11,.96));border:1px solid var(--de-line);box-shadow:var(--de-shadow);border-radius:var(--de-radius)
}
body.theme-dark-elegant .hero-panel{position:relative;overflow:hidden;border-color:rgba(231,173,92,.20)}
body.theme-dark-elegant .hero-panel:after{content:"";position:absolute;right:-45px;top:-50px;width:250px;height:250px;background:url("botanical.png") center/contain no-repeat;opacity:.08;pointer-events:none}
body.theme-dark-elegant .rule{border:0;border-top:1px solid var(--de-line);margin:2rem 0}
body.theme-dark-elegant hr{border:0;border-top:1px solid var(--de-line)}

/* Buttons, form controls and chips */
body.theme-dark-elegant .button{min-height:44px;padding:.78rem 1.15rem;border-radius:3px;font:700 .75rem/1 var(--de-sans);letter-spacing:.08em;text-transform:uppercase;box-shadow:none;transition:background .18s,border-color .18s,color .18s,transform .18s}
body.theme-dark-elegant .button:hover{transform:translateY(-1px)}
body.theme-dark-elegant .button.primary{background:var(--de-rust);border-color:var(--de-rust);color:#FFF8ED}
body.theme-dark-elegant .button.primary:hover{background:var(--de-rust-deep);border-color:var(--de-rust-deep)}
body.theme-dark-elegant .button.secondary{background:transparent;border-color:rgba(231,173,92,.58);color:var(--de-cream)}
body.theme-dark-elegant .button.secondary:hover{border-color:var(--de-amber);background:rgba(231,173,92,.06)}
body.theme-dark-elegant input,body.theme-dark-elegant textarea,body.theme-dark-elegant select{border:1px solid var(--de-line);border-radius:3px;background:#17130E;color:var(--de-cream);padding:.7rem .78rem;font-family:var(--de-sans)}
body.theme-dark-elegant input::placeholder,body.theme-dark-elegant textarea::placeholder{color:var(--de-cream-faint)}
body.theme-dark-elegant input:focus,body.theme-dark-elegant textarea:focus,body.theme-dark-elegant select:focus{outline:2px solid rgba(231,173,92,.16);border-color:var(--de-amber)}
body.theme-dark-elegant label{font:600 .82rem/1.4 var(--de-sans);color:var(--de-cream-dim)}
body.theme-dark-elegant input[type="checkbox"],body.theme-dark-elegant input[type="radio"]{accent-color:var(--de-rust)}
body.theme-dark-elegant .check-row{background:rgba(33,27,19,.74);border-color:var(--de-line);border-radius:3px}
body.theme-dark-elegant .badge,body.theme-dark-elegant .pill,body.theme-dark-elegant .chip{border:1px solid var(--de-line);background:var(--de-panel-2);color:var(--de-cream-dim);border-radius:999px;font-family:var(--de-sans)}
body.theme-dark-elegant .badge.done{background:rgba(138,149,115,.14);color:#B8C4A5;border-color:rgba(138,149,115,.28)}
body.theme-dark-elegant .badge.new-version{background:rgba(193,101,59,.12);color:#DEA283;border-color:rgba(193,101,59,.28)}

/* Reading experience */
body.theme-dark-elegant .reading-page{overflow:hidden;border-color:rgba(231,173,92,.18)}
body.theme-dark-elegant .reading-header{background:linear-gradient(135deg,#17130E,#211B13);border-bottom:1px solid var(--de-line)}
body.theme-dark-elegant .story-content{max-width:760px;font-family:var(--de-serif);font-size:clamp(1.08rem,1.55vw,1.25rem);line-height:1.92;color:var(--de-cream)}
body.theme-dark-elegant .story-content p{margin-bottom:1.45em;color:rgba(244,234,217,.90)}
body.theme-dark-elegant .story-content em{color:#FFF5E6}
body.theme-dark-elegant .story-content a{font-family:var(--de-sans)}
body.theme-dark-elegant .story-image img{border-radius:3px;box-shadow:0 18px 48px rgba(0,0,0,.42);filter:saturate(.90) brightness(.90)}
body.theme-dark-elegant .reading-metrics span{border-radius:3px;background:rgba(33,27,19,.76);border-color:var(--de-line);font-family:var(--de-sans);color:var(--de-cream-dim)}
body.theme-dark-elegant .reading-footer{border-top:1px solid var(--de-line)}
body.theme-dark-elegant .reading-progress-track,body.theme-dark-elegant .row-progress{background:#30261B}
body.theme-dark-elegant .reading-progress-bar,body.theme-dark-elegant .row-progress i{background:linear-gradient(90deg,var(--de-rust),var(--de-amber))}
body.theme-dark-elegant blockquote,body.theme-dark-elegant .quote{font-family:var(--de-serif);font-style:italic;border-left:2px solid var(--de-rust);padding-left:1.15rem;color:var(--de-cream);background:rgba(193,101,59,.035)}

/* Cards, people, relations and galleries */
body.theme-dark-elegant .story-grid,body.theme-dark-elegant .people-grid{gap:1rem}
body.theme-dark-elegant .story-card,body.theme-dark-elegant .person-card{padding:1.25rem;transition:transform .16s,box-shadow .16s,border-color .16s}
body.theme-dark-elegant .story-card:hover,body.theme-dark-elegant .person-card:hover{transform:translateY(-2px);border-color:rgba(231,173,92,.28);box-shadow:0 20px 58px rgba(0,0,0,.38)}
body.theme-dark-elegant .card-topline,body.theme-dark-elegant .metric-row{color:var(--de-cream-faint);font-family:var(--de-sans)}
body.theme-dark-elegant .entity-facts>div{border:0;border-bottom:1px solid var(--de-line);border-radius:0;background:transparent;padding:.75rem .1rem}
body.theme-dark-elegant .entity-facts dt{color:var(--de-amber);font-family:var(--de-sans)}
body.theme-dark-elegant .entity-gallery{gap:.75rem}
body.theme-dark-elegant .entity-gallery img,body.theme-dark-elegant .gallery-grid img{border-radius:3px;filter:saturate(.88) brightness(.86) contrast(1.02);box-shadow:0 10px 30px rgba(0,0,0,.25)}
body.theme-dark-elegant .entity-gallery img:hover,body.theme-dark-elegant .gallery-grid img:hover{filter:saturate(.96) brightness(.96)}
body.theme-dark-elegant .relations-section,body.theme-dark-elegant .relation-row{border-color:var(--de-line)}

/* Profile */
body.theme-dark-elegant .profile-layout{gap:1.5rem}
body.theme-dark-elegant .profile-card{padding:1.4rem}
body.theme-dark-elegant .profile-avatar{border:3px solid #211B13;box-shadow:0 0 0 1px rgba(231,173,92,.26),0 12px 34px rgba(0,0,0,.32)}
body.theme-dark-elegant .profile-visibility{border:0;background:transparent;padding:0}
body.theme-dark-elegant .profile-visibility .check-row{border:0;border-bottom:1px solid var(--de-line);border-radius:0;background:transparent;padding:.78rem .05rem}
body.theme-dark-elegant .profile-visibility .check-row:last-child{border-bottom:0}
body.theme-dark-elegant .public-reader-card{display:grid;gap:1rem;padding:1.35rem}
body.theme-dark-elegant .reader-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:.65rem}
body.theme-dark-elegant .reader-metric{padding:.75rem 0;border-top:1px solid var(--de-line)}
body.theme-dark-elegant .reader-metric strong{display:block;color:var(--de-amber);font:500 1.65rem/1 var(--de-serif)}
body.theme-dark-elegant .visibility-list{list-style:none;padding:0;margin:0}
body.theme-dark-elegant .visibility-list li{display:flex;justify-content:space-between;gap:1rem;padding:.78rem 0;border-bottom:1px solid var(--de-line)}

/* Feedback, reviews, dialogs */
body.theme-dark-elegant .modal-shell,body.theme-dark-elegant .feedback-modal{background:rgba(4,3,2,.72);backdrop-filter:blur(5px)}
body.theme-dark-elegant .modal-card{border-color:rgba(231,173,92,.26)}
body.theme-dark-elegant .rating-hero{border-radius:3px;background:rgba(33,27,19,.78);border-color:var(--de-line)}
body.theme-dark-elegant .chapter-rating{color:var(--de-amber)}
body.theme-dark-elegant .review-card{border-radius:4px}

/* Admin */
body.theme-dark-elegant .admin-section{padding:clamp(1.35rem,3vw,2.1rem);margin-bottom:1.5rem;border-color:rgba(231,173,92,.18)}
body.theme-dark-elegant .admin-header{padding:.4rem 0 1rem}
body.theme-dark-elegant table{font-family:var(--de-sans);font-size:.88rem;color:var(--de-cream-dim)}
body.theme-dark-elegant th{background:#211B13;color:var(--de-cream);border-color:var(--de-line)}
body.theme-dark-elegant td{border-color:var(--de-line)}
body.theme-dark-elegant .floating-admin-toggle{background:var(--de-rust);color:#fff}
body.theme-dark-elegant .floating-admin-panel{background:#17130E;border-color:var(--de-line)}
body.theme-dark-elegant .update-step-list li{border-radius:3px;border-color:var(--de-line);background:rgba(33,27,19,.55)}
body.theme-dark-elegant .update-step-icon{background:rgba(193,101,59,.13);color:var(--de-amber)}
body.theme-dark-elegant .update-step-list li[data-state="running"]{background:rgba(231,173,92,.055);border-color:rgba(231,173,92,.42)}
body.theme-dark-elegant .theme-card{border-color:var(--de-line);background:#17130E}
body.theme-dark-elegant .theme-card.active{border-color:var(--de-rust);box-shadow:0 0 0 2px rgba(193,101,59,.12)}
body.theme-dark-elegant .rights-info-icon{display:inline-grid;place-items:center;width:25px;height:25px;margin-left:.45rem;border:1.5px solid var(--de-amber);border-radius:3px;color:var(--de-amber);font:800 .78rem/1 var(--de-serif);cursor:help;vertical-align:middle;background:transparent}
body.theme-dark-elegant .content-source-help{border-left:2px solid var(--de-amber);background:rgba(33,27,19,.72);padding:1rem 1.1rem;border-radius:0 3px 3px 0}
body.theme-dark-elegant .stats-hub{display:grid;gap:1rem}
body.theme-dark-elegant .stats-hub .stat-card{border-bottom:1px solid var(--de-line);padding:1rem 0}

/* Breadcrumbs */
body.theme-dark-elegant .breadcrumbs{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;margin:0 0 1.2rem;color:var(--de-cream-faint);font:600 .73rem/1.4 var(--de-sans)}
body.theme-dark-elegant .breadcrumbs a{color:var(--de-cream-dim);text-decoration:none}
body.theme-dark-elegant .breadcrumbs a:hover{color:var(--de-amber)}
body.theme-dark-elegant .breadcrumbs>*+*:before{content:none}.breadcrumbs>span:not([aria-current]):not(:last-child){color:var(--de-rust)}

/* Notices, privacy and footer */
body.theme-dark-elegant .notice,body.theme-dark-elegant .content-warning{border-left-color:var(--de-rust);background:rgba(193,101,59,.08)}
body.theme-dark-elegant .notice.muted{border-left-color:var(--de-amber);background:rgba(231,173,92,.05)}
body.theme-dark-elegant .site-footer{background:#0F0C09;border-top-color:var(--de-line);color:var(--de-cream-faint);font-family:var(--de-sans)}
body.theme-dark-elegant .site-footer a{color:var(--de-cream-dim)}
body.theme-dark-elegant .site-footer:before{content:"◆";color:var(--de-rust);font-size:.55rem;align-self:center}
body.theme-dark-elegant .cookie-banner{background:#17130E;border-color:var(--de-line)}

/* CMS 2.0 blocks: order independent */
body.theme-dark-elegant .block{--block-gap:clamp(1rem,2.4vw,2rem);margin-block:clamp(1rem,2.4vw,2rem)}
body.theme-dark-elegant .block:first-child{margin-top:0}
body.theme-dark-elegant .block-reader-welcome{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(260px,.65fr);gap:var(--block-gap);align-items:stretch}
body.theme-dark-elegant .block-reader-welcome[data-variant="compact"]{display:block;padding:clamp(1.2rem,3vw,2.2rem);background:linear-gradient(125deg,#1C1710,#120F0B);border:1px solid var(--de-line);border-radius:var(--de-radius)}
body.theme-dark-elegant .block-reader-welcome[data-variant="compact"] .welcome-reader-card{display:none}
body.theme-dark-elegant .welcome-copy{padding:clamp(1.45rem,4vw,3.2rem);background:linear-gradient(135deg,rgba(28,23,16,.98),rgba(18,15,11,.96));border:1px solid rgba(231,173,92,.18);border-radius:var(--de-radius);box-shadow:var(--de-shadow);position:relative;overflow:hidden}
body.theme-dark-elegant .welcome-copy:after{content:"";position:absolute;right:-35px;bottom:-50px;width:180px;height:180px;background:url("botanical.png") center/contain no-repeat;opacity:.08;pointer-events:none}
body.theme-dark-elegant .welcome-reader-card{background:#17130E;border:1px solid var(--de-line);border-radius:var(--de-radius);box-shadow:var(--de-shadow)}
body.theme-dark-elegant .welcome-card-progress strong{color:var(--de-amber);font:500 2rem/1 var(--de-serif)}
body.theme-dark-elegant .block-reading-list{padding-top:1rem;border-top:1px solid var(--de-line)}
body.theme-dark-elegant .block-reading-list[data-variant="current"],body.theme-dark-elegant .block-reading-list[data-variant="next"]{border-top-color:rgba(193,101,59,.55)}
body.theme-dark-elegant .story-list{display:grid;gap:.8rem}
body.theme-dark-elegant .story-row{background:linear-gradient(135deg,#1C1710,#17130E);border:1px solid var(--de-line);border-radius:var(--de-radius);box-shadow:0 10px 32px rgba(0,0,0,.20)}
body.theme-dark-elegant .story-row.completed{background:linear-gradient(90deg,rgba(138,149,115,.06),#17130E)}
body.theme-dark-elegant .block-reader-tools{padding:1rem 0;border-top:1px solid var(--de-line);border-bottom:1px solid var(--de-line)}
body.theme-dark-elegant .block-reader-tools a{font-size:.78rem;font-weight:650;letter-spacing:.025em}
body.theme-dark-elegant .block-feedback-prompt .modal-card,body.theme-dark-elegant .block-invite-prompt .modal-card{border-top:3px solid var(--de-rust)}
body.theme-dark-elegant .preview-bar{background:#211B13;color:var(--de-cream);border-bottom:1px solid rgba(231,173,92,.32)}
body.theme-dark-elegant .preview-bar strong{font-family:var(--de-serif);font-weight:500;color:var(--de-cream)}
body.theme-dark-elegant .preview-bar .button.secondary{color:var(--de-cream);border-color:rgba(244,234,217,.45);background:transparent}

/* Template-builder hooks used by the optional 2.0.1 builder update */
body.theme-dark-elegant .block-builder{display:grid;gap:1rem}
body.theme-dark-elegant .block-builder-item{display:grid;grid-template-columns:minmax(130px,.55fr) minmax(150px,.6fr) minmax(120px,.45fr) 110px minmax(150px,.7fr);gap:.75rem;align-items:end;padding:1rem;background:rgba(33,27,19,.58);border:1px solid var(--de-line);border-radius:3px}
body.theme-dark-elegant .block-builder-item .block-builder-order{max-width:90px}
body.theme-dark-elegant .block-builder-remove{display:flex;align-items:center;gap:.5rem;min-height:44px}
body.theme-dark-elegant .template-preset-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:end;padding:1rem;margin-bottom:1rem;border:1px dashed rgba(231,173,92,.28);background:rgba(231,173,92,.035)}

/* Responsive and accessibility */
@media(max-width:900px){body.theme-dark-elegant .site-header{align-items:flex-start;flex-direction:column;gap:.45rem}body.theme-dark-elegant .site-nav{width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:.2rem}body.theme-dark-elegant .site-nav a{white-space:nowrap}}
@media(max-width:820px){body.theme-dark-elegant .block-reader-welcome{grid-template-columns:1fr}body.theme-dark-elegant .block-builder-item{grid-template-columns:1fr 1fr}}
@media(max-width:680px){body.theme-dark-elegant:after{display:none}body.theme-dark-elegant .site-main{width:min(100% - 1rem,1240px);margin-top:1rem}body.theme-dark-elegant .story-content{padding:1.6rem 1.15rem}body.theme-dark-elegant .site-footer{flex-direction:column}body.theme-dark-elegant .site-footer:before{display:none}body.theme-dark-elegant .block-builder-item,body.theme-dark-elegant .template-preset-panel{grid-template-columns:1fr}.button{width:auto}}
@media(prefers-reduced-motion:reduce){body.theme-dark-elegant *,body.theme-dark-elegant *:before,body.theme-dark-elegant *:after{transition:none!important;animation:none!important}}

/* v1.1.1: contrast coverage for the full 2.2.2 editor UI */
body.theme-dark-elegant .admin-dropdown-nav,body.theme-dark-elegant .admin-dropdown-menu,body.theme-dark-elegant .profile-fieldset,body.theme-dark-elegant .profile-visibility-fieldset,body.theme-dark-elegant .profile-note,body.theme-dark-elegant .reader-business-card,body.theme-dark-elegant .app-shadowbox,body.theme-dark-elegant .rich-editor,body.theme-dark-elegant .block-choice-card,body.theme-dark-elegant .block-order-panel,body.theme-dark-elegant .block-order-grid label,body.theme-dark-elegant .gallery-drive-steps article,body.theme-dark-elegant .gallery-drive-help,body.theme-dark-elegant .office-summary-grid article,body.theme-dark-elegant .theme-choice-card,body.theme-dark-elegant .chapter-overview-row,body.theme-dark-elegant .dashboard-tools a,body.theme-dark-elegant .legal-summary,body.theme-dark-elegant .update-wizard,body.theme-dark-elegant .update-db-choice,body.theme-dark-elegant .update-check-results,body.theme-dark-elegant .update-error,body.theme-dark-elegant .update-complete{background:#17130E!important;color:var(--de-cream)!important;border-color:var(--de-line)!important}
body.theme-dark-elegant .admin-dropdown-nav a,body.theme-dark-elegant .admin-dropdown-nav summary,body.theme-dark-elegant .admin-dropdown-menu a{color:var(--de-cream)!important}
body.theme-dark-elegant .admin-dropdown-nav a:hover,body.theme-dark-elegant .admin-dropdown-nav summary:hover,body.theme-dark-elegant .admin-dropdown-nav details[open]>summary,body.theme-dark-elegant .admin-dropdown-menu a:hover,body.theme-dark-elegant .admin-dropdown-menu a[aria-current="page"]{background:var(--de-amber)!important;color:#120F0B!important}
body.theme-dark-elegant .admin-menu-separator,body.theme-dark-elegant .chapter-section-list,body.theme-dark-elegant .chapter-section-list li{border-color:var(--de-line)!important}
body.theme-dark-elegant .block-choice-card.optional:has(input:checked),body.theme-dark-elegant .theme-choice-card.active{border-color:var(--de-amber)!important;box-shadow:0 0 0 2px rgba(231,173,92,.18)!important}
body.theme-dark-elegant .status-chip,body.theme-dark-elegant .block-choice-state{background:#211B13;color:var(--de-cream-dim);border-color:var(--de-line)}
body.theme-dark-elegant .status-chip.status-error,body.theme-dark-elegant .notice.error{background:#3A1719!important;color:#FFD9D9!important;border-color:#B85E68!important}
body.theme-dark-elegant .footer-build small{color:var(--de-cream-faint)}

.theme-dark-elegant{--hst-surface:var(--de-panel);--hst-surface-soft:var(--de-panel-2);--hst-text:var(--de-cream);--hst-muted:var(--de-cream-dim);--hst-line:var(--de-line);--hst-accent:var(--de-rust);--hst-accent-strong:var(--de-amber);--hst-shadow:var(--de-shadow);--hst-radius:8px}
.theme-dark-elegant .editor-office-tab{background:linear-gradient(180deg,var(--de-rust),var(--de-rust-deep));color:var(--de-cream)}
.theme-dark-elegant .herstasia-divider{filter:sepia(.25) brightness(.88);opacity:.68}

/* v3.0.2: shared dark-surface contract for current Core and Format 2 modules. */
body.theme-dark-elegant{
  --white:var(--de-panel);
  --panel:var(--de-panel);
  --panel-muted:var(--de-panel-2);
  --surface:var(--de-panel);
  --surface-soft:var(--de-panel-2);
  --border-color:var(--de-line);
  --shadow:var(--de-shadow);
  color-scheme:dark;
}

/* Newer Core surfaces that otherwise keep their light default background. */
body.theme-dark-elegant .story-html-rendered,
body.theme-dark-elegant .statistics-chart-card,
body.theme-dark-elegant .statistics-chart-dialog,
body.theme-dark-elegant .office-chart-panel,
body.theme-dark-elegant .module-installed-dialog{
  background:linear-gradient(145deg,rgba(28,23,16,.99),rgba(18,15,11,.98))!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line)!important;
}
body.theme-dark-elegant .story-html-rendered :where(p,li,dd),
body.theme-dark-elegant .module-installed-dialog>p,
body.theme-dark-elegant .statistics-chart-card :where(p,span),
body.theme-dark-elegant .statistics-chart-dialog :where(p,span){color:var(--de-cream-dim)!important}
body.theme-dark-elegant .module-installed-close,
body.theme-dark-elegant .systemtest-v2-close{
  background:#17130E!important;
  color:var(--de-amber)!important;
  border-color:var(--de-line-strong)!important;
}
body.theme-dark-elegant .module-installed-close:hover,
body.theme-dark-elegant .module-installed-close:focus-visible,
body.theme-dark-elegant .systemtest-v2-close:hover,
body.theme-dark-elegant .systemtest-v2-close:focus-visible{background:var(--de-panel-2)!important;color:var(--de-cream)!important}

/* System Audit uses intentionally light hard-coded surfaces in its neutral theme. */
body.theme-dark-elegant .systemtest-v2-dialog{
  background:linear-gradient(145deg,rgba(28,23,16,.99),rgba(18,15,11,.99))!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line)!important;
  box-shadow:var(--de-shadow)!important;
}
body.theme-dark-elegant .systemtest-v2-kicker{color:var(--de-amber)!important}
body.theme-dark-elegant .systemtest-v2-version,
body.theme-dark-elegant .systemtest-v2-detail,
body.theme-dark-elegant .systemtest-category,
body.theme-dark-elegant .systemtest-status-heading,
body.theme-dark-elegant .systemtest-status-meta,
body.theme-dark-elegant .system-audit-issue small,
body.theme-dark-elegant .system-audit-group-summary>summary small,
body.theme-dark-elegant .system-audit-compact-check p{color:var(--de-cream-dim)!important}
body.theme-dark-elegant .systemtest-v2-lead,
body.theme-dark-elegant .systemtest-counter,
body.theme-dark-elegant .systemtest-path{color:var(--de-cream-dim)!important}
body.theme-dark-elegant .systemtest-v2-preflight{color:var(--de-cream-dim)!important}
body.theme-dark-elegant .systemtest-v2-preflight span{background:#17130E!important;border-color:var(--de-line)!important;color:var(--de-cream-dim)!important}
body.theme-dark-elegant .systemtest-v2-preflight .is-complete{background:#18261D!important;border-color:#3E6949!important;color:#BBDAC1!important}
body.theme-dark-elegant .systemtest-v2-preflight .is-error{background:#301719!important;border-color:#85414A!important;color:#FFD1D4!important}
body.theme-dark-elegant .systemtest-v2-preflight .is-running{background:#2B2415!important;border-color:#7B6130!important;color:#F0CB84!important}

body.theme-dark-elegant :is(.system-audit-summary,.systemtest-v2-cards) .is-ok{background:#18261D!important;border-color:#3E6949!important;color:#BBDAC1!important}
body.theme-dark-elegant :is(.system-audit-summary,.systemtest-v2-cards) .is-warning{background:#2B2415!important;border-color:#7B6130!important;color:#F0CB84!important}
body.theme-dark-elegant :is(.system-audit-summary,.systemtest-v2-cards) .is-error{background:#301719!important;border-color:#85414A!important;color:#FFD1D4!important}
body.theme-dark-elegant :is(.system-audit-summary,.systemtest-v2-cards) .is-info{background:#17242C!important;border-color:#3B6479!important;color:#BFDDF0!important}
body.theme-dark-elegant .system-audit-summary .is-ok .system-audit-summary-icon{background:#223829!important}
body.theme-dark-elegant .system-audit-summary .is-warning .system-audit-summary-icon{background:#3B3019!important}
body.theme-dark-elegant .system-audit-summary .is-error .system-audit-summary-icon{background:#492126!important}
body.theme-dark-elegant .system-audit-summary .is-info .system-audit-summary-icon{background:#203744!important}
body.theme-dark-elegant .systemtest-status-section.is-inactive .system-audit-summary article{background:#1B1814!important;border-color:var(--de-line)!important;color:var(--de-cream-faint)!important}
body.theme-dark-elegant .systemtest-status-section.is-inactive .system-audit-summary-icon{background:#252019!important;color:var(--de-cream-faint)!important}

body.theme-dark-elegant .system-audit-list,
body.theme-dark-elegant .system-audit-issue,
body.theme-dark-elegant .system-audit-group-summary,
body.theme-dark-elegant .system-audit-compact-list{border-color:var(--de-line)!important}
body.theme-dark-elegant .system-audit-grid-head{background:var(--de-panel-2)!important;color:var(--de-cream)!important}
body.theme-dark-elegant .system-audit-check,
body.theme-dark-elegant .system-audit-compact-check{border-color:var(--de-line)!important}
body.theme-dark-elegant .system-audit-issue.is-error,
body.theme-dark-elegant .system-audit-group-summary.has-errors>summary,
body.theme-dark-elegant .system-audit-compact-check.is-error{background:#301719!important;border-color:#85414A!important;color:#FFD1D4!important}
body.theme-dark-elegant .system-audit-compact-check.is-warning{background:#2B2415!important;color:#F0CB84!important}
body.theme-dark-elegant .system-audit-group-toggle{color:var(--de-amber)!important}

/* Footer alignment: decoration must not become a third flex item. */
body.theme-dark-elegant .site-footer:before{content:none!important;display:none!important}
body.theme-dark-elegant .footer-build,
body.theme-dark-elegant .footer-legal{display:flex;flex-direction:column;gap:.35rem}
body.theme-dark-elegant .footer-build{align-items:flex-start;text-align:left}
body.theme-dark-elegant .footer-legal{align-items:flex-end;text-align:right}
body.theme-dark-elegant .footer-legal-links,
body.theme-dark-elegant .footer-copyright{max-width:100%}

@media(max-width:900px),(hover:none) and (pointer:coarse){
  body.theme-dark-elegant .systemtest-v2-popup{background:var(--de-panel)!important}
  body.theme-dark-elegant .systemtest-v2-dialog{background:var(--de-panel)!important;color:var(--de-cream)!important}
}
@media(max-width:760px){
  body.theme-dark-elegant .site-footer{flex-direction:column}
  body.theme-dark-elegant .footer-legal{align-items:flex-start;text-align:left}
}

/* v3.0.3: Update Center installationsstatus skal følge Dark Elegant.
   Korrektivet er rent præsentation og ændrer ingen installationslogik. */
body.theme-dark-elegant .update-install-status{
  background:linear-gradient(145deg,rgba(28,23,16,.995),rgba(18,15,11,.99))!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line-strong)!important;
  box-shadow:var(--de-shadow)!important;
}
body.theme-dark-elegant .update-install-status strong{
  color:var(--de-cream)!important;
}
body.theme-dark-elegant .update-install-status p,
body.theme-dark-elegant .update-install-status [data-update-floating-percent]{
  color:var(--de-cream-dim)!important;
}
body.theme-dark-elegant .update-install-status progress{
  accent-color:var(--de-rust);
}
body.theme-dark-elegant .update-install-status-close{
  background:#17130E!important;
  color:var(--de-amber)!important;
  border-color:var(--de-line-strong)!important;
}
body.theme-dark-elegant .update-install-status-close:hover,
body.theme-dark-elegant .update-install-status-close:focus-visible{
  background:var(--de-panel-2)!important;
  color:var(--de-cream)!important;
}
body.theme-dark-elegant .update-install-status[data-state="done"]{
  background:#18261D!important;
  border-color:#3E6949!important;
}
body.theme-dark-elegant .update-install-status[data-state="warning"]{
  background:#2B2415!important;
  border-color:#7B6130!important;
}
body.theme-dark-elegant .update-install-status[data-state="error"]{
  background:#301719!important;
  border-color:#85414A!important;
}



/* v3.0.5: runtime surface-contract corrective for Sidebygger and Modulcenter. */
body.theme-dark-elegant .cms-builder-dialog,
body.theme-dark-elegant .cms-builder-coach,
body.theme-dark-elegant .module-installed-dialog{
  background:linear-gradient(145deg,rgba(28,23,16,.99),rgba(18,15,11,.99))!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line)!important;
  box-shadow:var(--de-shadow)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(p,li,dd,dt,label,small,.muted,.help,.hint),
body.theme-dark-elegant .cms-builder-coach :where(p,li,dd,dt,label,small,.muted,.help,.hint),
body.theme-dark-elegant .module-installed-dialog :where(p,small,.muted){
  color:var(--de-cream-dim)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(h1,h2,h3,h4,strong),
body.theme-dark-elegant .cms-builder-coach :where(h1,h2,h3,h4,strong),
body.theme-dark-elegant .module-installed-dialog :where(h1,h2,h3,h4,strong){
  color:var(--de-cream)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(input,textarea,select),
body.theme-dark-elegant .cms-builder-coach :where(input,textarea,select){
  background:#17130E!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line-strong)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(.button.secondary,button.secondary),
body.theme-dark-elegant .cms-builder-coach :where(.button.secondary,button.secondary),
body.theme-dark-elegant .module-installed-dialog :where(.button.secondary,button.secondary){
  background:#17130E!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line-strong)!important;
}

/* v3.0.6: runtime-confirmed WCAG corrective.
   3.0.5 proved that the remaining 3.83 ratio is the light label on the
   standard rust primary control, while ~1.19 is light theme text over
   Sidebygger-owned white inner containers. Keep the correction scoped to
   Dark Elegant presentation and the affected builder surfaces. */
body.theme-dark-elegant .button.primary,
body.theme-dark-elegant button.primary,
body.theme-dark-elegant a.button.primary,
body.theme-dark-elegant input.button.primary{
  background:var(--de-rust-deep)!important;
  border-color:var(--de-rust-deep)!important;
  color:#FFF8ED!important;
}
body.theme-dark-elegant .button.primary:hover,
body.theme-dark-elegant .button.primary:focus-visible,
body.theme-dark-elegant button.primary:hover,
body.theme-dark-elegant button.primary:focus-visible,
body.theme-dark-elegant a.button.primary:hover,
body.theme-dark-elegant a.button.primary:focus-visible{
  background:#7A3C1B!important;
  border-color:#7A3C1B!important;
  color:#FFF8ED!important;
}

/* Sidebygger ships neutral/light inner containers below the dialog root.
   Neutralize structural container backgrounds inside the two builder
   surfaces, then explicitly restore themed controls. This does not alter
   Sidebygger layout, state or interaction semantics. */
body.theme-dark-elegant .cms-builder-dialog :where(
  div,section,article,aside,header,footer,main,nav,form,fieldset,legend,
  details,summary,ul,ol,li,dl,dt,dd,table,thead,tbody,tfoot,tr,td,th
),
body.theme-dark-elegant .cms-builder-coach :where(
  div,section,article,aside,header,footer,main,nav,form,fieldset,legend,
  details,summary,ul,ol,li,dl,dt,dd,table,thead,tbody,tfoot,tr,td,th
){
  background-color:transparent!important;
  background-image:none!important;
  border-color:var(--de-line)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(input,textarea,select,option),
body.theme-dark-elegant .cms-builder-coach :where(input,textarea,select,option){
  background:#17130E!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line-strong)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(button,.button),
body.theme-dark-elegant .cms-builder-coach :where(button,.button){
  border-color:var(--de-line-strong)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(button,.button):not(.primary),
body.theme-dark-elegant .cms-builder-coach :where(button,.button):not(.primary){
  background:#17130E!important;
  color:var(--de-cream)!important;
}


/* v3.0.7: final Sidebygger surface normalization from 3.0.6 runtime evidence.
   The remaining failures are text-bearing inline/card elements that keep
   Sidebygger light backgrounds or local text colors below the dark dialog root. */
body.theme-dark-elegant .cms-builder-dialog :where(
  label,span,a,figure,figcaption,output,address,blockquote,pre,code,kbd,samp
),
body.theme-dark-elegant .cms-builder-coach :where(
  label,span,a,figure,figcaption,output,address,blockquote,pre,code,kbd,samp
){
  background-color:transparent!important;
  background-image:none!important;
  border-color:var(--de-line)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(p,li,dd,dt,label,span,small,figcaption,output,.muted,.help,.hint),
body.theme-dark-elegant .cms-builder-coach :where(p,li,dd,dt,label,span,small,figcaption,output,.muted,.help,.hint){
  color:var(--de-cream-dim)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(a),
body.theme-dark-elegant .cms-builder-coach :where(a){
  color:var(--de-amber)!important;
}
body.theme-dark-elegant .cms-builder-dialog :where(pre,code,kbd,samp),
body.theme-dark-elegant .cms-builder-coach :where(pre,code,kbd,samp){
  color:var(--de-cream)!important;
  background:#17130E!important;
}
body.theme-dark-elegant .cms-builder-dialog :where([class*="card"],[class*="option"],[class*="choice"],[class*="item"],[class*="row"]),
body.theme-dark-elegant .cms-builder-coach :where([class*="card"],[class*="option"],[class*="choice"],[class*="item"],[class*="row"]){
  background-color:#17130E!important;
  background-image:none!important;
  border-color:var(--de-line)!important;
}

/* v3.0.8: Notice Center meta text is ordinary UI text and must meet WCAG AA.
   The global small-text tint remains available for decorative/subordinate text,
   but notice metadata inside the shared dialog uses the stronger dim token. */
body.theme-dark-elegant .notice-dialog .notice-dialog-meta,
body.theme-dark-elegant dialog.notice-dialog .notice-dialog-meta,
body.theme-dark-elegant .site-notice-dialog .notice-dialog-meta{
  color:var(--de-cream-dim)!important;
}


/* v3.0.9: Update Center rollback contrast corrective.
   Update Center owns intentionally light neutral rollback surfaces. Dark Elegant
   must restyle those surfaces so inherited light theme text never lands on a
   light card. Presentation only, no rollback logic changes. */
body.theme-dark-elegant .update-rollback-summary{
  background:#17130E!important;
  color:var(--de-cream)!important;
  border-color:var(--de-line)!important;
}
body.theme-dark-elegant .update-rollback-summary span,
body.theme-dark-elegant .update-rollback-arrow{
  color:var(--de-cream-dim)!important;
}
body.theme-dark-elegant .update-rollback-summary strong{
  color:var(--de-cream)!important;
}
body.theme-dark-elegant .update-rollback-safety{
  background:color-mix(in srgb,var(--de-panel) 90%,var(--de-rust) 10%)!important;
  color:var(--de-cream-dim)!important;
  border-left-color:var(--de-rust)!important;
}
body.theme-dark-elegant .update-rollback-safety p{
  color:var(--de-cream-dim)!important;
}
body.theme-dark-elegant .update-rollback-safety strong{
  color:var(--de-cream)!important;
}


/* v3.0.10: one-time deep theme sweep corrective.
   The shared admin accent #C1653B measured 4.39-4.40:1 on the active
   admin navigation surfaces. Preserve the visual rust palette for fills,
   but use a slightly lighter rust only for the shared admin accent token. */
body.theme-dark-elegant.admin-office-mode{--hst-accent:#C96B40}


/* v3.0.11: deep full-page mobile navigation contrast corrective.
   The Core mobile section toggle keeps a blue neutral text color (#31556F)
   that measures about 2.25:1 on Dark Elegant's #1C1710 admin surface.
   In Dark Elegant admin office mode it is ordinary control text, so use the
   existing stronger cream-dim token. No navigation behavior changes. */
body.theme-dark-elegant.admin-office-mode button.mobile-nav-section-toggle,
body.theme-dark-elegant.admin-office-mode .mobile-nav-section-toggle{
  color:var(--de-cream-dim)!important;
}


/* v3.0.12: full-page Notice Center icon contrast corrective.
   The one-time deep theme sweep measured .site-notice-icon at about 4.47:1
   on the darkest admin surface, just below WCAG AA 4.50:1. Keep the icon
   visually secondary but use the existing cream-dim token at full opacity. */
body.theme-dark-elegant.admin-office-mode .site-notice-icon{
  color:var(--de-cream-dim)!important;
  opacity:1!important;
}


/* v3.0.13: deep-sweep shared admin contrast corrective.
   Fix only selectors evidenced by System Audit 3.0.53. Generic small/strong
   findings are deliberately not overridden globally because they occur on both
   light and dark owner surfaces and require owner-specific correction. */
body.theme-dark-elegant.admin-office-mode .editor-office-tab-symbol{
  color:#17130E!important;
}
body.theme-dark-elegant.admin-office-mode .editorial-state.pending{
  color:#5B341D!important;
}
body.theme-dark-elegant.admin-office-mode .server-storage-class.is-protected{
  color:#E9A7AF!important;
}
body.theme-dark-elegant.admin-office-mode .cdn-status.ok{
  color:#244837!important;
}
body.theme-dark-elegant.admin-office-mode .cms-layer-filter.button.secondary{
  background:#17130E!important;
  color:var(--de-cream)!important;
}
body.theme-dark-elegant.admin-office-mode p.eyebrow{
  color:var(--de-cream)!important;
}

/* v3.0.14: evidence-based shared admin return-tab contrast corrective.
   System Audit 3.0.53 / Core 3.4.76 measured a.editor-office-tab-return
   on 61 backend surfaces at 3.71:1: white text on #C96B40. The control is
   a rust-filled navigation tab; use the existing darkest theme foreground
   only for this component. No layout, route, behavior or owner changes. */
body.theme-dark-elegant.admin-office-mode a.editor-office-tab-return{
  color:#17130E!important;
}


/* v3.0.15: runtime-evidence corrective after run d170c1e052d1593350a9b7af.
   3.0.14 targeted editor-office-tab-return, while the installed runtime actually
   renders editor-office-child on 53 failing backend surfaces. The generic small
   override is also removed so owner/component text colors are no longer clobbered
   across mixed light/dark surfaces. Two exact shared admin counters are corrected
   from the same runtime evidence. */
body.theme-dark-elegant.admin-office-mode .cms-reusable-count{
  color:#17130E!important;
}
body.theme-dark-elegant.admin-office-mode .office-count-badge{
  color:#17130E!important;
}


/* v3.0.18: runtime-evidenced Editor Office navigation contrast corrective.
   System Audit 3.0.56 on Core 3.4.78 reports 53 editor-office-child and
   1 editor-office-home failures at 3.71:1 (white on #C96B40).
   Scope is limited to the shared rust-filled navigation controls. */
@media (min-width: 901px){
  body.theme-dark-elegant.admin-office-mode a.editor-office-home,
  body.theme-dark-elegant.admin-office-mode a.editor-office-child{
    color:#17130E!important;
  }
}

/* v3.0.19: mobile Baglokalet readability.
   3.0.18's dark foreground is desktop-only. On the mobile drawer the same
   navigation controls sit on the dark menu surface and therefore retain
   the theme's readable cream foreground. */
@media (max-width: 900px){
  body.theme-dark-elegant.admin-office-mode a.editor-office-home,
  body.theme-dark-elegant.admin-office-mode a.editor-office-child{
    color:var(--de-cream)!important;
  }
}

/* v3.0.20: Editor Office navigation + full-viewport frontend corrective.
   Normal desktop home/child navigation lives on the dark Baglokalet surface and
   therefore uses the readable cream foreground. Only the selected rust-filled
   current item keeps the dark foreground. Ordinary frontend pages form a
   column at least as tall as the dynamic viewport so short pages cannot expose
   the browser/default white canvas below the footer. */
@media (min-width: 901px){
  body.theme-dark-elegant.admin-office-mode a.editor-office-home,
  body.theme-dark-elegant.admin-office-mode a.editor-office-child{
    color:var(--de-cream)!important;
  }
  body.theme-dark-elegant.admin-office-mode a.editor-office-home[aria-current="page"],
  body.theme-dark-elegant.admin-office-mode a.editor-office-child[aria-current="page"]{
    color:#17130E!important;
  }
}
body.theme-dark-elegant:not(.admin-office-mode){
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
}
body.theme-dark-elegant:not(.admin-office-mode) .site-main{
  flex:1 0 auto;
  width:100%;
}
body.theme-dark-elegant:not(.admin-office-mode) .site-footer{
  flex:0 0 auto;
  margin-top:auto;
}

/* v3.0.21: Systemtest inline status readability.
   System Audit owns the semantic state; Dark Elegant owns presentation. The
   generic System Audit fallback uses light semantic cards, which are not valid
   on Dark Elegant because the theme also supplies light foreground text.
   Keep the semantic distinctions on theme-native dark surfaces. */
body.theme-dark-elegant.admin-office-mode .systemtest-inline-current{
  background:color-mix(in srgb,var(--de-panel) 92%,var(--de-rust) 8%)!important;
  border-left-color:var(--de-rust)!important;
  color:var(--de-cream)!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-step,
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article{
  background:var(--de-panel)!important;
  border-color:var(--de-line)!important;
  color:var(--de-cream)!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-step.is-complete{
  background:color-mix(in srgb,var(--de-panel) 88%,var(--de-sage,#8A9573) 12%)!important;
  border-color:color-mix(in srgb,var(--de-line) 58%,var(--de-sage,#8A9573) 42%)!important;
  color:#E7F0DE!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-step.is-running{
  background:color-mix(in srgb,var(--de-panel) 89%,var(--de-amber) 11%)!important;
  border-color:color-mix(in srgb,var(--de-line) 58%,var(--de-amber) 42%)!important;
  color:#F4D59E!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-step.is-error{
  background:color-mix(in srgb,var(--de-panel) 84%,#8B252B 16%)!important;
  border-color:color-mix(in srgb,var(--de-line) 58%,#D05C63 42%)!important;
  color:#F2C4C7!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-step small,
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article :where(strong,span,small){
  color:inherit!important;
}



/* v3.0.22: Systemtest låst testplan, fem kolonner ejes semantisk af
   System Audit 3.1.16. Temaet holder tællingen sekundær og læsbar. */
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan-count{
  color:var(--de-cream-dim)!important;
  font-weight:650;
  letter-spacing:.01em;
}
@media(min-width:1101px){
  body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
}

/* v3.0.23: persistent Systemtest group status.
   System Audit 3.1.17 keeps the latest 15 group cards visible after reload and
   marks each group with its highest result severity. Dark Elegant maps those
   semantic states to theme-native dark surfaces with readable text. */
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article.is-ok{
  background:color-mix(in srgb,var(--de-panel) 84%,var(--de-sage,#8A9573) 16%)!important;
  border-color:color-mix(in srgb,var(--de-line) 56%,var(--de-sage,#8A9573) 44%)!important;
  color:#E7F0DE!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article.is-warning{
  background:color-mix(in srgb,var(--de-panel) 84%,var(--de-amber,#E7AD5C) 16%)!important;
  border-color:color-mix(in srgb,var(--de-line) 54%,var(--de-amber,#E7AD5C) 46%)!important;
  color:#F4D59E!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article.is-error{
  background:color-mix(in srgb,var(--de-panel) 82%,#8B252B 18%)!important;
  border-color:color-mix(in srgb,var(--de-line) 54%,#D05C63 46%)!important;
  color:#F2C4C7!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article.is-info{
  background:color-mix(in srgb,var(--de-panel) 84%,#31556F 16%)!important;
  border-color:color-mix(in srgb,var(--de-line) 54%,#5F8BA8 46%)!important;
  color:#CFE4F3!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article.is-pending{
  background:var(--de-panel)!important;
  border-color:var(--de-line)!important;
  color:var(--de-cream)!important;
}
body.theme-dark-elegant.admin-office-mode .systemtest-inline-plan article:is(.is-ok,.is-warning,.is-error,.is-info) .systemtest-inline-plan-count{
  color:inherit!important;
  opacity:.9;
}

/* v3.0.25: Preserve the centered 1240px content container.
   At non-mobile widths the outer gutter may never be less than 60px;
   on wider screens the centered max-width naturally creates a larger gutter.
   Override the non-admin full-width layout rule above without adding padding. */
@media (min-width: 681px) {
  body.theme-dark-elegant .site-main,
  body.theme-dark-elegant:not(.admin-office-mode) .site-main {
    box-sizing: border-box;
    width: min(1240px, calc(100% - 120px));
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 0;
  }
}
/* Mobile retains the original narrow-screen sizing, with no added inset. */
@media (max-width: 680px) {
  body.theme-dark-elegant .site-main,
  body.theme-dark-elegant:not(.admin-office-mode) .site-main {
    width: min(calc(100% - 1rem), 1240px);
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 0;
  }
}

/* 3.0.27: explicit keyboard focus on breadcrumb and universe-card links. */
body.theme-dark-elegant .breadcrumbs a:focus-visible,body.theme-dark-elegant .universe-card a:focus-visible{outline:2px solid var(--de-amber);outline-offset:4px;border-radius:2px}

/* Update Center: critical approval remains readable on dark surfaces. */
.update-critical-choice{background:#211b13;color:#f4ead9;border-color:#e7ad5c}
.update-critical-choice code{color:#e7ad5c;overflow-wrap:anywhere}
.update-critical-choice input{background:#120f0b;color:#f4ead9;border:1px solid #8a9573}
.update-critical-choice input:focus-visible{outline:3px solid #e7ad5c;outline-offset:3px}
.update-critical-choice button:disabled{opacity:.6;cursor:not-allowed}
.update-error{overflow-wrap:anywhere}

.shared-media-report{color:#f4ead9}.shared-media-report .shared-media-checks li{border-color:#8a795f}.shared-media-report .shared-media-checks .ok strong{color:#b9d9b6}.shared-media-report .shared-media-checks .pending strong{color:#e7ad5c}.shared-media-report .shared-media-checks .error strong{color:#ffacaa}.shared-media-report .shared-media-summary.ok{border-color:#b9d9b6}.shared-media-report .shared-media-summary.error{border-color:#ffacaa}.shared-media-report .shared-media-summary.pending{border-color:#e7ad5c}

.media-store-comparison{color:var(--chalk,#f4ead9)}.media-comparison-counts div{border-color:#6d5d49;background:#211b13}.media-comparison-state.conflict,.media-comparison-state.blocked{border-color:#e98d7c;color:#ffc1b6}.media-comparison-state.compared{border-color:#9caf86;color:#d7e4ca}

/* 3.0.32: CDN Guard installation notices remain readable in Dark Elegant. */
body.theme-dark-elegant #cdn-guard-installation .cdn-installer-warning,
body.theme-dark-elegant #cdn-guard-installation .notice.warning{
  background:#211B13!important;border-color:#E7AD5C!important;color:#F4EAD9!important;
}
body.theme-dark-elegant #cdn-guard-installation .notice.success{
  background:#1B2920!important;border-color:#9CAF86!important;color:#F4EAD9!important;
}
body.theme-dark-elegant #cdn-guard-installation .notice.error{
  background:#321B19!important;border-color:#E98D7C!important;color:#F4EAD9!important;
}
body.theme-dark-elegant #cdn-guard-installation :is(.cdn-installer-warning,.notice.success,.notice.warning,.notice.error) :is(strong,p){
  color:inherit!important;opacity:1!important;
}
body.theme-dark-elegant #cdn-guard-installation .notice.success strong{color:#D7E4CA!important;}

/* 3.0.33: CDN health cards and status badges, including cards outside installer. */
body.theme-dark-elegant .cdn-status-grid article,
body.theme-dark-elegant .cdn-status{
  background:#211B13!important;color:#F4EAD9!important;border:1px solid #8A795F;
}
body.theme-dark-elegant .cdn-status-grid article.ok,
body.theme-dark-elegant .cdn-status.ok{
  background:#1B2920!important;color:#D7E4CA!important;border-color:#9CAF86!important;
}
body.theme-dark-elegant .cdn-status-grid article.bad,
body.theme-dark-elegant .cdn-status.bad{
  background:#321B19!important;color:#FFC1B6!important;border-color:#E98D7C!important;
}
body.theme-dark-elegant .cdn-status.warn{
  background:#211B13!important;color:#F4D59E!important;border-color:#E7AD5C!important;
}
body.theme-dark-elegant .cdn-status-grid article :is(strong,span,small),
body.theme-dark-elegant .cdn-status :is(strong,span,small){
  color:inherit!important;opacity:1!important;
}

/* v3.0.35: scoped media storage diagnostics and forms */
body.theme-dark-elegant .media-store-comparison code{overflow-wrap:anywhere;white-space:normal}
body.theme-dark-elegant .media-store-comparison input[type="text"]{box-sizing:border-box;max-width:100%;min-height:44px;width:100%}
body.theme-dark-elegant .media-store-comparison button{min-height:44px}
body.theme-dark-elegant .media-store-comparison label:has(input[type="checkbox"]){display:flex;align-items:flex-start;gap:.65rem}
body.theme-dark-elegant .media-store-comparison input[type="checkbox"]{flex:0 0 auto;margin-top:.3rem}
body.theme-dark-elegant .media-store-comparison :is(input,button,summary):focus-visible{outline:2px solid var(--de-amber);outline-offset:3px}
body.theme-dark-elegant .media-store-comparison dd{margin-inline-start:0;overflow-wrap:anywhere}

/* v3.0.36: compact Systemtest preflight labels */
body.theme-dark-elegant .systemtest-v2-preflight{gap:.5rem}
body.theme-dark-elegant .systemtest-v2-preflight>span{min-width:0;align-items:baseline;padding:.4rem .65rem;line-height:1.4}
body.theme-dark-elegant .systemtest-v2-preflight>span small{white-space:nowrap;font-size:.8em}
body.theme-dark-elegant .systemtest-inline-step strong{overflow-wrap:anywhere}

/* v3.0.37: scoped Systemtest result accessibility */
body.theme-dark-elegant .systemtest-inline-step{min-width:0}
body.theme-dark-elegant .systemtest-inline-current :is(strong,span),body.theme-dark-elegant .system-audit-issue :is(strong,p,small){overflow-wrap:anywhere}
body.theme-dark-elegant .system-audit-issue>div{min-width:0}
body.theme-dark-elegant .system-audit-file-table{max-width:100%;overflow-x:auto}
body.theme-dark-elegant .system-audit-file-table code{overflow-wrap:anywhere;white-space:normal}
body.theme-dark-elegant :is(.system-audit-intro,.system-audit-critical-files,.system-audit-group-summary,.system-audit-history)>summary{min-height:44px;box-sizing:border-box;display:flex;align-items:center;gap:.6rem}
body.theme-dark-elegant :is(.system-audit-intro,.system-audit-critical-files,.system-audit-group-summary,.system-audit-history)>summary:focus-visible{outline:2px solid var(--de-amber);outline-offset:3px}
body.theme-dark-elegant .system-audit-group-summary>summary>span:first-child{min-width:0;overflow-wrap:anywhere}

/* v3.0.38: media administration, scoped reflow and keyboard access */
body.theme-dark-elegant :is(.image-library-card,.image-card-body,.image-card-facts dd,.image-technical-facts dd,.cdn-monitor-head>div){min-width:0;overflow-wrap:anywhere}
body.theme-dark-elegant .image-library-card .button-row{flex-wrap:wrap}
body.theme-dark-elegant :is(.image-technical-details,.cdn-monitor-hero) summary:focus-visible{outline:2px solid var(--de-amber);outline-offset:3px}
body.theme-dark-elegant .image-technical-details>summary{min-height:44px;display:flex;align-items:center}
@media(max-width:640px){
body.theme-dark-elegant .image-filter-grid{grid-template-columns:1fr}
body.theme-dark-elegant .image-filter-grid>label{grid-column:auto;min-width:0}
body.theme-dark-elegant .image-library-card .button-row>.button{white-space:normal;text-align:center}
body.theme-dark-elegant .cdn-monitor-head{flex-wrap:wrap;gap:1rem}
}

/* v3.0.39: dynamic media and CDN status readability */
body.theme-dark-elegant :is(.image-format-grid-row,.image-format-grid-head)>*{min-width:0;overflow-wrap:anywhere}
body.theme-dark-elegant .cdn-bars>div>span{min-width:0;overflow-wrap:anywhere}
body.theme-dark-elegant .cdn-installer-warning{overflow-wrap:anywhere}
body.theme-dark-elegant .systemtest-inline-step>span{white-space:normal;overflow-wrap:anywhere}
@media(max-width:640px){
body.theme-dark-elegant :is(.image-format-grid-row,.image-format-grid-head){grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,1fr));gap:.5rem}
body.theme-dark-elegant .cdn-bars>div{grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(3ch,max-content)}
}

/* 3.0.40: authenticated authoring marker inspection only */
body.theme-dark-elegant .story-progression-preview { margin-block: 1.25rem; padding: 1rem; border: 1px solid currentColor; border-radius: .5rem; min-width: 0; }
body.theme-dark-elegant .story-progression-preview p, body.theme-dark-elegant .story-progression-preview li, body.theme-dark-elegant .story-progression-preview code { overflow-wrap: anywhere; }
body.theme-dark-elegant .story-progression-preview summary { min-height: 44px; padding-block: .6rem; cursor: pointer; }
body.theme-dark-elegant .story-progression-preview summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
body.theme-dark-elegant .story-progression-preview ul { padding-inline-start: 1.5rem; }

/* 3.0.41: authoring report states, labels also describe state */
body.theme-dark-elegant .story-progression-preview[data-marker-state="invalid"] { border-width: 2px; border-color: var(--rust, #C1653B); }
body.theme-dark-elegant .story-progression-preview[data-marker-state="valid"] { border-color: var(--sage, #8A9573); }

/* 3.0.42: desktop notice access uses the existing right-side button. */
body.theme-dark-elegant .site-header > nav.notice-entry-nav { display: none !important; }

/* 3.0.43: accessible desktop direct administration control. */
@media(min-width:901px){
body.theme-dark-elegant .site-admin-direct{background:#C1653B;color:#17130E;border-color:#E7AD5C}
body.theme-dark-elegant .site-admin-direct:hover{background:#E7AD5C;color:#17130E}
body.theme-dark-elegant .site-admin-direct:focus-visible{outline:2px solid #F4EAD9;outline-offset:-4px}
}

/* 3.0.44: Design Sitemap and story overview share the dark theme palette. */
body.theme-dark-elegant :is(.smap-filters,.smap-tree,.smap-warning,.smap-duplicate-summary){background:#1C1710!important;color:#F4EAD9!important;border-color:#59442D!important}
body.theme-dark-elegant :is(.smap-check,.smap-menu-state,.smap-node,.smap-level .smap-level){border-color:#59442D!important}
body.theme-dark-elegant :is(.smap-check,.smap-filter-status,.smap-folder,.smap-menu-name,.smap-page-copy,.smap-filters legend){color:#F4EAD9!important}
body.theme-dark-elegant .smap-page-copy a{color:#E7AD5C!important}
body.theme-dark-elegant .smap-context>.smap-page{opacity:1}
body.theme-dark-elegant .smap-context>.smap-page .smap-page-copy{color:#CBBFAE!important}
body.theme-dark-elegant .smap :is(a,summary,input):focus-visible{outline:2px solid #E7AD5C;outline-offset:3px}
body.theme-dark-elegant .reading-layout-root .story-row{background:#1C1710!important;color:#F4EAD9!important;border-color:#59442D!important;opacity:1!important}
body.theme-dark-elegant .reading-layout-root .story-row.completed{background:#211B13!important;border-color:#8A9573!important}
body.theme-dark-elegant .reading-layout-root :is(.story-seq,.story-copy,.story-facts){color:#F4EAD9!important;opacity:1!important}
body.theme-dark-elegant .reading-layout-root :is(.story-seq small,.story-seq>span,.subtitle){color:#CBBFAE!important;opacity:1!important}
body.theme-dark-elegant .reading-layout-root .story-chapter-tile{background:#30261B!important;color:#F4EAD9!important}
body.theme-dark-elegant .reading-layout-root .story-person-chip{background:#30261B!important;color:#F4EAD9!important;border-color:#59442D!important}
body.theme-dark-elegant .reading-layout-root .badge.done{background:#26342C!important;color:#D9E8D8!important;border-color:#8A9573!important}
body.theme-dark-elegant .reading-layout-root .draft-badge{background:#30261B!important;color:#F4D59E!important;border-color:#E7AD5C!important}
body.theme-dark-elegant .reading-layout-root .story-actions .button.primary{background:#C1653B!important;color:#17130E!important;border-color:#C1653B!important}
body.theme-dark-elegant .reading-layout-root .story-actions .button.secondary{background:#211B13!important;color:#F4EAD9!important;border-color:#E7AD5C!important}
body.theme-dark-elegant .reading-layout-root .story-actions a:focus-visible{outline:2px solid #E7AD5C;outline-offset:3px}

/* 3.0.45: consistent original return-arrow control styling. */
@media(min-width:901px){
body.theme-dark-elegant .editor-office-tab-return[data-admin-office-shortcut]{display:grid!important;place-items:center!important;font:900 1.15rem/1 system-ui,sans-serif!important;color:#F4EAD9!important}
body.theme-dark-elegant .site-admin-direct{font:900 1.15rem/1 system-ui,sans-serif!important;color:#F4EAD9!important}
body.theme-dark-elegant .site-admin-direct:hover{background:#8B441F!important;color:#F4EAD9!important}
}

/* 3.0.46: modest mobile content gutter, with one outer inset only. */
@media(max-width:680px){
body.theme-dark-elegant .site-main,
body.theme-dark-elegant:not(.admin-office-mode) .site-main{box-sizing:border-box;width:min(calc(100% - 2rem),1240px);max-width:1240px;margin-inline:auto;padding-inline:0}
}
/* Direct office navigation retains readable contrast on all screen sizes. */
body.theme-dark-elegant .site-admin-direct[data-admin-direct-desktop]{color:#17130E!important;background:#C1653B!important}
body.theme-dark-elegant .site-admin-direct[data-admin-direct-desktop]:hover{color:#17130E!important;background:#E7AD5C!important}
