
:root{
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg:#ddd0a1;
  --bg-2:#c9ba85;
  --panel:#f2e6bc;
  --panel-2:#eadca9;
  --panel-3:#fff5cf;
  --text:#201a0e;
  --muted:#655634;
  --line:#8f7a47;
  --line-strong:#5d4e2b;
  --accent:#3c4b19;
  --accent-2:#6e832d;
  --accent-3:#e0ce82;
  --danger:#7f2f1a;
  --danger-soft:#edd1c2;
  --success:#1f4926;
  --success-soft:#d6ecd8;
  --shadow:0 22px 56px rgba(56, 40, 8, .17);
  --panel-shadow:0 12px 28px rgba(51, 40, 14, .14);
  --radius-xl:1.65rem;
  --radius-lg:1.2rem;
  --radius-md:.95rem;
  --radius-sm:.72rem;
}
html[data-theme="dark"]{
  --bg:#10130f;
  --bg-2:#172017;
  --panel:#171d16;
  --panel-2:#1f281e;
  --panel-3:#262f24;
  --text:#f0ebce;
  --muted:#a7b28b;
  --line:#53624c;
  --line-strong:#7a8d73;
  --accent:#b7cf65;
  --accent-2:#90a64b;
  --accent-3:#42512d;
  --danger:#ffab8f;
  --danger-soft:#35211b;
  --success:#bce0b7;
  --success-soft:#1f3120;
  --shadow:0 20px 48px rgba(0, 0, 0, .38);
  --panel-shadow:0 12px 26px rgba(0, 0, 0, .26);
}
html[data-theme="light"]{
  --bg:#eef3f9;
  --bg-2:#dde6f1;
  --panel:#ffffff;
  --panel-2:#f7fbff;
  --panel-3:#eef5fd;
  --text:#172234;
  --muted:#5c6b80;
  --line:#c6d3e3;
  --line-strong:#98a8bf;
  --accent:#2951bf;
  --accent-2:#17388d;
  --accent-3:#dfe9fb;
  --danger:#bb2b1e;
  --danger-soft:#fee7e3;
  --success:#1f6c38;
  --success-soft:#e8f6eb;
  --shadow:0 18px 42px rgba(18, 30, 53, .10);
  --panel-shadow:0 10px 22px rgba(18, 30, 53, .08);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
body{
  margin:0;
  font-family:var(--font-sans);
  background:
    radial-gradient(circle at 14% 0%, rgba(255,248,215,.38), transparent 26%),
    radial-gradient(circle at 100% 8%, rgba(110,131,45,.10), transparent 20%),
    radial-gradient(circle at 85% 100%, rgba(94,78,39,.08), transparent 18%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color:var(--text);
  line-height:1.6;
}
.screen-noise,
.wall-grid{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-2;
}
.screen-noise{
  opacity:.05;
  background-image:
    radial-gradient(rgba(0,0,0,.22) .8px, transparent .8px),
    radial-gradient(rgba(255,255,255,.12) .7px, transparent .7px);
  background-size:10px 10px, 14px 14px;
  background-position:0 0, 6px 4px;
}
.wall-grid{
  z-index:-3;
  opacity:.14;
  background:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.045) 1px, transparent 1px);
  background-size:38px 38px;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}
code{
  font-family:var(--font-mono);
  background:var(--panel-3);
  border:1px solid var(--line);
  border-radius:.5rem;
  padding:.1rem .35rem;
}
pre, pre code{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
h1,h2,h3,h4,h5,h6{margin:0 0 .7rem}
p,ul,ol,dl{margin:0 0 1rem}
table{width:100%;border-collapse:collapse}
th,td{
  padding:.9rem .95rem;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}
thead th{
  background:var(--panel-3);
  font-size:.84rem;
  text-transform:uppercase;
  letter-spacing:.08em;
}
tr:hover td{background:rgba(0,0,0,.03)}
html[data-theme="dark"] tr:hover td{background:rgba(255,255,255,.03)}
input,textarea,select,button{
  font:inherit;
}
input,textarea,select{
  width:100%;
  color:var(--text);
  background:linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.12));
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  padding:.88rem .95rem;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.24), 0 1px 0 rgba(255,255,255,.12);
}
textarea{min-height:180px;resize:vertical}
input::placeholder,textarea::placeholder{color:var(--muted)}
input:focus,textarea:focus,select:focus,
button:focus-visible,a:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(60,75,25,.22);
}
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] a:focus-visible{
  box-shadow:0 0 0 3px rgba(41,81,191,.16);
}
.shell{
  display:grid;
  grid-template-columns:clamp(320px, 21vw, 360px) minmax(0,1fr);
  min-height:100vh;
}
.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  padding:1.65rem 1.35rem 1.55rem 1.55rem;
  scrollbar-gutter:stable;
  background:
    linear-gradient(180deg, rgba(18,16,10,.16), rgba(0,0,0,.03)),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border-right:1px solid var(--line);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.16), 18px 0 40px rgba(51,40,14,.06);
}
html[data-theme="dark"] .sidebar{
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.brand--retro{
  display:grid;
  gap:.8rem;
  margin-bottom:1rem;
}
.brand__lockup{
  display:flex;
  gap:.9rem;
  align-items:flex-start;
  color:var(--text);
  text-decoration:none;
}
.brand__lockup > span{
  min-width:0;
}
.brand__lockup img{
  width:54px;
  height:54px;
  flex:none;
  border-radius:1rem;
  border:1px solid var(--line);
  box-shadow:var(--panel-shadow);
  background:var(--panel-3);
  padding:.25rem;
}
.brand__lockup strong{
  display:block;
  font-size:1.18rem;
  line-height:1.15;
  letter-spacing:.03em;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.brand__lockup em{
  display:block;
  margin-top:.28rem;
  font-style:normal;
  color:var(--muted);
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.12em;
}
.brand--retro p{
  color:var(--muted);
  margin:0;
  overflow-wrap:anywhere;
}
.sidebar-status,
.sidebar-usercard{
  display:flex;
  align-items:flex-start;
  gap:.65rem;
  padding:.8rem .9rem;
  background:var(--panel-3);
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  box-shadow:var(--panel-shadow);
}
.sidebar-usercard{
  display:grid;
  gap:.24rem;
  align-content:start;
}
.sidebar-usercard strong,
.sidebar-usercard .small{
  min-width:0;
}
.sidebar-usercard strong{
  line-height:1.2;
}
.sidebar-usercard .small{
  line-height:1.45;
}
.sidebar-status{
  margin-bottom:1rem;
  flex-wrap:wrap;
  font-size:.9rem;
  line-height:1.45;
}
.status-led{
  width:.75rem;
  height:.75rem;
  border-radius:999px;
  background:var(--danger);
  box-shadow:0 0 0 4px rgba(127,47,26,.14);
}
.status-led.is-live{
  background:var(--accent-2);
  box-shadow:0 0 0 4px rgba(104,126,41,.18);
}
.side-nav{
  display:grid;
  gap:1.2rem;
}
.side-nav-group{
  display:grid;
  gap:.5rem;
}
.side-nav-heading{
  margin:0 0 .1rem;
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.side-nav__link{
  display:flex;
  align-items:center;
  gap:.7rem;
  min-width:0;
  padding:.84rem 1rem;
  border-radius:1rem;
  color:var(--text);
  line-height:1.38;
  border:1px solid transparent;
  background:transparent;
  overflow-wrap:anywhere;
  transition:background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.side-nav__link:hover{
  text-decoration:none;
  background:rgba(255,255,255,.34);
  border-color:var(--line);
  box-shadow:0 10px 22px rgba(51,40,14,.08);
  transform:translateX(2px);
}
.side-nav__link.is-active{
  background:linear-gradient(180deg, rgba(224,206,130,.92), var(--panel-3));
  border-color:var(--line-strong);
  box-shadow:var(--panel-shadow);
}
html[data-theme="dark"] .side-nav__link.is-active{
  color:var(--text);
  background:linear-gradient(180deg, rgba(183,207,101,.16), rgba(255,255,255,.03));
}
.sidebar__top{
  display:grid;
  gap:1rem;
}
.sidebar__footer{
  margin-top:1rem;
}
.small{
  color:var(--muted);
  font-size:.92rem;
}
.main{
  padding:1.65rem;
  min-width:0;
  display:grid;
  align-content:start;
  gap:1rem;
}
.main > .topbar-panel,
.main > .content-stack,
.main > .site-footer{
  width:min(1180px, 100%);
  margin-inline:auto;
}
.panel{
  position:relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.035)),
    linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--line);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow);
  padding:1.35rem 1.4rem;
  margin-bottom:0;
  overflow:hidden;
}
.panel::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.24), transparent 28%),
    linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  opacity:.95;
}
html[data-theme="dark"] .panel::before{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 24%),
    linear-gradient(90deg, transparent, rgba(255,255,255,.03), transparent);
}
.content-stack > :last-child,
.panel > :last-child,
.notice-card > :last-child,
.quick-link-card > :last-child,
.hero-stack-card > :last-child{margin-bottom:0}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem 1.25rem;
  flex-wrap:wrap;
}
.topbar-panel{
  padding:1rem 1.15rem;
}
.topbar__left,
.topbar__right{
  display:flex;
  align-items:center;
  gap:.8rem;
  min-width:0;
}
.topbar__left{
  flex:1 1 560px;
}
.topbar__right{
  flex:1 1 360px;
  justify-content:flex-end;
  flex-wrap:wrap;
  row-gap:.7rem;
}
.topbar__placeholder{min-height:52px}
.search-form{
  display:flex;
  gap:.75rem;
  flex:1;
  min-width:0;
  max-width:860px;
}
.search-form input{
  min-width:0;
  min-height:3.25rem;
  padding-inline:1.12rem;
  border-radius:1.05rem;
}
.search-form button{
  min-width:86px;
  min-height:3.25rem;
  padding-inline:1.15rem;
}
.button-primary,
.button-link,
.button-danger,
.search-form button,
.editor-tool,
.editor-mode-tab{
  appearance:none;
  border:none;
  cursor:pointer;
  border-radius:1rem;
  padding:.82rem 1rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  min-height:3rem;
  font-weight:750;
  text-decoration:none;
  transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease;
}
.button-primary,
.search-form button{
  color:#fffef8;
  background:linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow:0 10px 18px rgba(60,75,25,.22);
}
html[data-theme="light"] .button-primary,
html[data-theme="light"] .search-form button{
  box-shadow:0 10px 18px rgba(41,81,191,.18);
}
.button-link,
.editor-tool,
.editor-mode-tab{
  color:var(--text);
  background:linear-gradient(180deg, rgba(255,255,255,.52), var(--panel));
  border:1px solid var(--line);
  box-shadow:var(--panel-shadow);
}
.button-danger{
  color:#fffaf8;
  background:linear-gradient(180deg, #ab4627, var(--danger));
  box-shadow:0 10px 18px rgba(127,47,26,.22);
}
.button-primary:hover,
.button-link:hover,
.button-danger:hover,
.search-form button:hover,
.editor-tool:hover,
.editor-mode-tab:hover{
  text-decoration:none;
  transform:translateY(-1px);
}
.button-primary:active,
.button-link:active,
.button-danger:active,
.search-form button:active,
.editor-tool:active,
.editor-mode-tab:active{
  transform:translateY(0);
}
.button-compact{padding:.64rem .86rem;border-radius:.88rem;font-size:.92rem;min-height:2.65rem}
.button-row,
.page-actions,
.userbox,
.link-row,
.action-group{
  display:flex;
  gap:.7rem;
  flex-wrap:wrap;
  align-items:center;
}
.button-row form,
.page-actions form,
.userbox form,
.action-group form{display:inline-flex}
.icon-button span[aria-hidden="true"],
.icon-entry span[aria-hidden="true"]{
  font-size:1rem;
}
.userbox--enhanced{
  justify-content:flex-end;
  row-gap:.65rem;
}
.topbar .userbox--enhanced{
  align-items:center;
}
.topbar .badge-muted{
  background:rgba(255,255,255,.34);
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  border-radius:999px;
  padding:.48rem .78rem;
  background:rgba(255,255,255,.44);
  border:1px solid var(--line);
  font-size:.82rem;
  line-height:1.1;
}
.badge-interactive:hover{
  text-decoration:none;
  background:var(--accent-3);
}
.badge-root{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(180deg, #8b3dff, #5f1bc2);
}
.badge-muted{color:var(--muted)}
.badge-warn{
  color:#fff8ea;
  background:linear-gradient(180deg, #ac7e17, #8a5e10);
  border-color:transparent;
}
.badge-danger{
  color:#fff8f4;
  background:linear-gradient(180deg, #b9482c, #902913);
  border-color:transparent;
}
.flash{
  border-radius:1rem;
  padding:.95rem 1rem;
  margin-bottom:1rem;
  border:1px solid var(--line);
  box-shadow:var(--panel-shadow);
}
.flash.success{
  background:var(--success-soft);
  color:var(--success);
}
.flash.error{
  background:var(--danger-soft);
  color:var(--danger);
}
.eyebrow{
  display:inline-flex;
  margin-bottom:.8rem;
  padding:.28rem .6rem;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel-3);
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:.74rem;
  font-weight:800;
}
.archive-hero,
.dossier-hero{
  overflow:hidden;
}
.archive-hero__grid,
.dossier-hero__grid,
.hero-panel__grid,
.page-hero__grid{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);
  gap:1rem;
  align-items:start;
}
.archive-hero__lead{
  font-size:1.04rem;
  max-width:72ch;
}
.archive-hero__copy .button-row{
  margin-top:1rem;
  margin-bottom:1rem;
  row-gap:.8rem;
}
.archive-hero__copy .hero-meta{
  row-gap:.7rem;
}
.hero-meta,
.tag-row{
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
}
.archive-hero__stack,
.hero-panel__aside,
.page-hero__aside,
.dossier-hero__aside{
  display:grid;
  gap:.8rem;
}
.hero-stack-card,
.page-hero__card,
.notice-card,
.quick-link-card,
.stat,
.special-card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.03)),
    linear-gradient(180deg, var(--panel-3), var(--panel));
  border:1px solid var(--line);
  border-radius:1.1rem;
  box-shadow:var(--panel-shadow);
}
.hero-stack-card,
.page-hero__card,
.notice-card,
.stat,
.special-card{padding:1rem}
.archive-hero__stack .hero-stack-card,
.stat,
.quick-link-card,
.notice-card,
.special-card,
.page-hero__card{
  min-width:0;
}
.archive-hero__stack .hero-stack-card{
  display:grid;
  gap:.42rem;
  align-content:start;
}
.archive-hero__stack .hero-stack-card strong{
  display:block;
  font-size:1.8rem;
  line-height:1;
  margin:0;
}
.archive-hero__stack .hero-stack-card span{
  display:block;
  font-weight:700;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.archive-hero__stack .hero-stack-card p{
  margin:0;
}
.stat{
  display:grid;
  gap:.42rem;
  align-content:start;
}
.quick-link-card{
  display:grid;
  gap:.45rem;
  padding:1rem;
  color:var(--text);
  overflow-wrap:anywhere;
}
.quick-link-card:hover{
  text-decoration:none;
  transform:translateY(-1px);
}
.page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}
.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.9rem;
}
.section-head__copy h2,
.page-head h1{margin-bottom:.2rem}
.stats-grid,
.special-grid,
.card-grid{
  display:grid;
  gap:1rem;
  grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
}
.stats-grid--metrics{
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
}
.stat strong{
  display:block;
  font-size:1.65rem;
  margin-bottom:.35rem;
}
.info-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:1rem;
}
.split-ledger{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:1rem;
}
.list-tight{
  display:grid;
  gap:.75rem;
}
.list-tight > a,
.list-tight > div,
.special-links > a{
  display:block;
}
.list-tight a{
  color:var(--text);
}
.list-tight a:hover{
  text-decoration:none;
}
.list-tight strong{
  display:inline;
}
.tag{
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  padding:.45rem .78rem;
  border-radius:999px;
  background:var(--panel-3);
  border:1px solid var(--line);
  color:var(--text);
}
.tag:hover{
  text-decoration:none;
  background:var(--accent-3);
}
.empty-state{
  color:var(--muted);
  padding:.6rem 0;
}
.table-wrap{
  overflow:auto;
}
.table-wrap table{
  min-width:640px;
}
.grid-form,
.form-stack{
  display:grid;
  gap:1rem;
}
.two-col,
.three-col,
.four-col{
  display:grid;
  gap:1rem;
}
.two-col{grid-template-columns:repeat(2, minmax(0,1fr))}
.three-col{grid-template-columns:repeat(3, minmax(0,1fr))}
.four-col{grid-template-columns:repeat(4, minmax(0,1fr))}
.narrow{max-width:760px}
.checkbox-row{
  display:flex;
  align-items:center;
  gap:.7rem;
  font-weight:600;
}
.checkbox-row input{width:auto}
.checkbox-row.inline{display:inline-flex}
.auth-panel{
  margin-inline:auto;
  width:min(100%, 860px);
}
.auth-panel__intro{
  max-width:62ch;
}
.auth-grid{
  display:grid;
  gap:1rem;
  grid-template-columns:repeat(2, minmax(0,1fr));
}
.form-stack > label,
.grid-form > label,
.two-col > label,
.three-col > label,
.four-col > label,
.auth-grid > label{
  display:grid;
  gap:.45rem;
  font-weight:700;
}
.auth-grid > label{
  padding:1rem;
  border-radius:1.15rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.03)),
    linear-gradient(180deg, var(--panel-3), var(--panel));
  border:1px solid var(--line);
  box-shadow:var(--panel-shadow);
}
.auth-grid > label > input,
.auth-grid > label > textarea,
.auth-grid > label > select{
  background:rgba(255,255,255,.18);
}
.helper-card{
  background:rgba(255,255,255,.26);
  border:1px dashed var(--line);
  border-radius:1.05rem;
  padding:1rem 1.05rem;
}
.wiki-body{
  font-size:1rem;
  line-height:1.78;
}
.dossier-paper{
  background:
    linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,.06)),
    linear-gradient(180deg, #fff7d8, #f6e8b6);
}
html[data-theme="dark"] .dossier-paper{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    linear-gradient(180deg, #1a2118, #141914);
}
html[data-theme="light"] .dossier-paper{
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.1)),
    linear-gradient(180deg, #ffffff, #f6fbff);
}
.wiki-body h2,.wiki-body h3,.wiki-body h4,.wiki-body h5,.wiki-body h6{
  margin-top:1.8rem;
  border-top:1px solid var(--line);
  padding-top:1rem;
}
.wiki-body blockquote,
.visual-editor-surface blockquote{
  border-left:4px solid var(--accent);
  padding:.2rem 0 .2rem 1rem;
  color:var(--muted);
  margin-left:0;
}
.definition-list{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:.45rem .85rem;
  margin:0;
}
.definition-list dt{
  font-weight:800;
  color:var(--muted);
}
.definition-list dd{
  margin:0;
}
.meta-row{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  align-items:center;
  margin-bottom:.9rem;
}
.tabs{
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
  margin-bottom:.9rem;
}
.tab{
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  padding:.58rem .82rem;
  border-radius:.85rem;
  color:var(--text);
  background:var(--panel-3);
  border:1px solid var(--line);
}
.tab.active{
  color:#fffef6;
  border-color:transparent;
  background:linear-gradient(180deg, var(--accent-2), var(--accent));
}
.tab:hover{text-decoration:none}
.result-card{
  padding:1rem 0;
  border-top:1px dashed var(--line);
}
.result-card:first-of-type{border-top:0;padding-top:0}
.content-list{
  padding-left:1.25rem;
}
.content-list li + li{margin-top:.45rem}
.visual-editor-panel{
  background:var(--panel-3);
  border:1px solid var(--line);
  border-radius:1.2rem;
  padding:1rem;
  box-shadow:var(--panel-shadow);
}
.editor-mode-tabs{
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
}
.editor-mode-tab.is-active{
  color:#fffef6;
  background:linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color:transparent;
}
.editor-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  margin-bottom:.8rem;
}
.visual-editor-surface{
  min-height:420px;
  padding:1rem 1.1rem;
  border:1px solid var(--line);
  border-radius:1rem;
  background:rgba(255,255,255,.42);
  overflow-wrap:anywhere;
}
html[data-theme="dark"] .visual-editor-surface{
  background:rgba(255,255,255,.03);
}
.visual-editor-surface:empty::before{
  content:"Start writing the recovered page here…";
  color:var(--muted);
}
.source-editor-wrap.is-hidden,
.is-hidden{display:none!important}
.role-list{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
}
.role-chip{
  min-width:170px;
  display:grid;
  gap:.35rem;
  padding:.85rem .95rem;
  border-radius:1rem;
  border:1px solid var(--line);
  background:var(--panel-3);
}
.notice-card .button-link,
.page-hero__card .button-link{
  width:100%;
}
.remember-toggle{
  width:fit-content;
  padding:.4rem .7rem;
  border-radius:999px;
  background:rgba(255,255,255,.24);
  border:1px solid rgba(143,122,71,.45);
}
.site-footer{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1.2rem 1.25rem;
}
.site-footer__links{
  display:flex;
  gap:.85rem;
  flex-wrap:wrap;
}
.site-footer__links a{
  color:var(--text);
}
.site-footer .small{
  margin-bottom:0;
}
.metric-card{
  min-height:172px;
}
.metric-card__value{
  display:block;
  margin:0;
  font-size:clamp(1.8rem, 2vw, 2.15rem);
  line-height:1;
}
.metric-card__label{
  display:block;
  font-weight:800;
  font-size:1rem;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.metric-card__meta{
  display:block;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.content-stack{
  display:grid;
  gap:1rem;
}
.content-stack > .panel,
.content-stack > .flash{
  margin-bottom:0;
}
.content-stack h1,
.content-stack h2,
.content-stack h3,
.content-stack h4,
.sidebar-usercard,
.userbox,
.badge{
  overflow-wrap:anywhere;
}
.cookie-banner{
  position:fixed;
  left:1rem;
  right:1rem;
  bottom:1rem;
  z-index:60;
}
.cookie-banner__content{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
  padding:1rem 1.1rem;
  background:var(--panel);
  border:1px solid var(--line-strong);
  border-radius:1.1rem;
  box-shadow:var(--shadow);
}
.sidebar-toggle{
  display:none;
}
.app-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.44);
  z-index:30;
}
.sr-only{
  position:absolute!important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.text-break-anywhere,
.text-truncate{
  overflow-wrap:anywhere;
  word-break:break-word;
}
.hero-panel,
.page-hero{overflow:hidden}
.archive-hero__copy,
.dossier-hero__body,
.page-hero__body{min-width:0}

.is-admin-area .panel{
  border-color:var(--line-strong);
}
.is-admin-area .topbar-panel{
  background:
    linear-gradient(180deg, rgba(60,75,25,.08), rgba(255,255,255,.01)),
    linear-gradient(180deg, var(--panel), var(--panel-2));
}
html[data-theme="dark"] .is-admin-area .topbar-panel{
  background:
    linear-gradient(180deg, rgba(183,207,101,.09), rgba(255,255,255,.01)),
    linear-gradient(180deg, var(--panel), var(--panel-2));
}

@media (max-width: 1100px){
  .archive-hero__grid,
  .dossier-hero__grid,
  .hero-panel__grid,
  .page-hero__grid,
  .info-grid,
  .split-ledger,
  .two-col,
  .three-col,
  .four-col,
  .auth-grid{
    grid-template-columns:1fr;
  }
}
@media (max-width: 980px){
  .shell{
    grid-template-columns:1fr;
  }
  .sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:min(380px, 100vw);
    max-width:100vw;
    transform:translateX(-105%);
    transition:transform .22s ease;
    z-index:40;
    height:100dvh;
    padding-right:1rem;
  }
  body.sidebar-open{
    overflow:hidden;
  }
  body.sidebar-open .sidebar{
    transform:translateX(0);
  }
  .main{
    padding:1rem;
  }
  .main > .topbar-panel,
  .main > .content-stack,
  .main > .site-footer{
    width:100%;
  }
  .topbar__left,
  .topbar__right{
    flex:1 1 100%;
  }
  .sidebar-toggle{
    display:inline-flex;
  }
  .topbar{
    flex-direction:column;
    align-items:stretch;
  }
  .topbar__left,
  .topbar__right{
    width:100%;
    justify-content:space-between;
  }
  .topbar__left{
    flex-direction:column;
    align-items:stretch;
  }
  .search-form{
    max-width:none;
  }
}
@media (max-width: 720px){
  .panel{padding:1rem 1rem}
  .archive-hero__copy .button-row{
    margin-bottom:.9rem;
  }
  .topbar{
    gap:.85rem;
  }
  .topbar__right,
  .userbox--enhanced{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
  }
  .button-row,
  .page-actions,
  .userbox,
  .link-row{
    align-items:stretch;
  }
  .button-primary,
  .button-link,
  .button-danger,
  .search-form button,
  .sidebar-toggle,
  .userbox--enhanced > .badge,
  .userbox--enhanced > a,
  .userbox--enhanced > form,
  .userbox--enhanced > form > button{
    width:100%;
  }
  .userbox--enhanced > .badge,
  .userbox--enhanced > a,
  .userbox--enhanced > form{
    justify-content:center;
  }
  .badge{
    justify-content:center;
    text-align:center;
    white-space:normal;
  }
  .search-form{
    flex-direction:column;
  }
  .site-footer,
  .cookie-banner__content,
  .page-head,
  .section-head{
    flex-direction:column;
  }
  .cookie-banner{
    left:.75rem;
    right:.75rem;
    bottom:.75rem;
  }
}
@media (max-width: 560px){
  .main{
    padding:.75rem;
  }
  .panel,
  .topbar-panel,
  .cookie-banner__content{
    border-radius:1.05rem;
  }
  .topbar-panel{
    padding:.9rem;
  }
  .sidebar{
    width:100vw;
    padding:.9rem .9rem 1rem;
  }
  .sidebar-status,
  .sidebar-usercard{
    padding:.75rem .8rem;
  }
}
