:root{
  --page-bg: #E4E9ED;
  --panel-bg: #FFFFFF;
  --panel-bg-alt: #F5F7F9;
  --border: #98AAB1;
  --border-soft: #C9D3DA;
  --title-dark: #0B3D66;
  --title-light: #4A7FA5;
  --text: #1A1A1A;
  --text-muted: #5B6770;
  --link: #06C;
  --link-visited: #5D8AA8;
  --online: #2E7D32;
  --offline: #B00020;
  --gold: #B8860B;
  --input-bg: #FFFFFF;
  --chart-grid: #dde4e9;
  --chart-text: #333333;
  --chart-border: #c9d3da;
  --chart-slice: #F5F7F9;
  --ticker-bg: #FFF6D9;
  --ticker-border: #E0C97A;
  --ticker-text: #6B5A1E;
  --input-soft: #FFFFF0;
  --ghost-hover: #E9EFF3;
  --code-bg: #EEF3F7;
  --code-border: #DFE7ED;
  --formula-bg: #F4F8FB;
  --example-bg: #FBFDFE;
  --warn-bg: #FFF8E7;
  --warn-border: #F0DFB6;
  --banner-info-bg: #FFF6D9;
  --banner-info-border: #F0C36D;
  --banner-info-text: #6B5A1E;
  --banner-error-bg: #FCE7E7;
  --banner-error-border: #E0A0A0;
  --banner-error-text: #7A1E1E;
}

html.theme-dark{
  --page-bg: #14181D;
  --panel-bg: #1D232A;
  --panel-bg-alt: #232B34;
  --border: #3A4550;
  --border-soft: #2C353F;
  --title-dark: #7FB4DC;
  --title-light: #5E93BA;
  --text: #D8DEE4;
  --text-muted: #8B97A1;
  --link: #6FB7FF;
  --link-visited: #8FB3C9;
  --online: #4CAF50;
  --offline: #E57373;
  --gold: #D4A72C;
  --input-bg: #161B21;
  --chart-grid: #313B46;
  --chart-text: #C4CDD5;
  --chart-border: #3A4550;
  --chart-slice: #1D232A;
  --ticker-bg: #2A2620;
  --ticker-border: #5A4E2E;
  --ticker-text: #D8C48A;
  --input-soft: #1A2027;
  --ghost-hover: #2A343F;
  --code-bg: #262E37;
  --code-border: #3A4550;
  --formula-bg: #232B34;
  --example-bg: #20262E;
  --warn-bg: #2E2A1D;
  --warn-border: #5A4E2E;
  --banner-info-bg: #2E2A1D;
  --banner-info-border: #5A4E2E;
  --banner-info-text: #D8C48A;
  --banner-error-bg: #3A2323;
  --banner-error-border: #6E3A3A;
  --banner-error-text: #E5A5A5;
}

*{ box-sizing: border-box; }

html,body{
  margin:0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; }
a:visited{ color: var(--link-visited); }
b{ font-weight: bold; }

.forum-shell{ max-width: 1180px; margin: 0 auto; padding: 10px 12px 24px; }

.forum-header{
  background: linear-gradient(180deg, #0B3D66 0%, #072A47 100%);
  border: 1px solid #06233C;
  padding: 14px 56px 16px 18px;
  color: #fff;
  position: relative;
}
.forum-header__logo{
  font-size: 22px; font-weight: bold; font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
}
.forum-header__logo span{ color: #9FD1FF; }

.forum-header__tagline{ font-size: 11px; color: #C7DCEC; margin-top: 2px; }

.forum-breadcrumb{
  background: var(--panel-bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  padding: 6px 12px;
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
}
.forum-breadcrumb__clock{ font-family: "Courier New", monospace; }

.forum-statsbar{
  background: var(--ticker-bg); border: 1px solid var(--ticker-border); border-top:none;
  padding: 5px 12px; font-size: 11px; color: var(--ticker-text); text-align:center;
}

.forum-footer__update{
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 10px; opacity: .75; color: var(--text-muted);
}
.forum-footer__feedback{ font-size: 10px; opacity: .6; color: var(--text-muted); margin: 2px 0 0; }
.forum-footer__vibe{ font-size: 10px; opacity: .6; color: var(--text-muted); margin: 2px 0 0; }
.forum-footer__update::before{
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--link); display: inline-block;
}

.searchbox{ margin-top: 14px; border: 1px solid var(--border); }
.searchbox__title{
  background: linear-gradient(180deg, var(--title-light), var(--title-dark));
  color: #fff; font-weight: bold; padding: 5px 10px; font-size: 12px;
}
.searchbox__body{ background: var(--panel-bg); padding: 12px; }
.tabs{ display:flex; gap:0; margin-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.tab{
  font-family: inherit; font-size: 11px; font-weight:bold; letter-spacing: .02em;
  background: var(--panel-bg-alt); border: 1px solid var(--border-soft); border-bottom:none;
  color: var(--text-muted); padding: 6px 16px; cursor:pointer; margin-right:3px; margin-bottom:-1px;
}
.tab.is-active{ background: var(--panel-bg); color: var(--title-dark); border-bottom: 1px solid var(--panel-bg); }
.tab:hover:not(.is-active){ color: var(--text); }

.searchbox__field{ display:flex; border: 1px solid var(--border); background:var(--input-bg); }
.searchbox__prefix{ font-family: "Courier New", monospace; color: var(--text-muted); display:flex; align-items:center; padding: 0 0 0 10px; font-size:11px; }
#query-input{
  flex:1; border:none; outline: 1px dotted transparent; padding: 8px 8px; font-family: inherit; font-size: 13px;
  background: var(--input-soft); color: var(--text);
}
#query-input:focus{ background: var(--input-bg); outline: 1px dotted var(--title-light); }

.btn-primary{
  background: linear-gradient(180deg, #4A7FA5, #2E5C82);
  border: 1px solid #1E3E58; color: #fff; font-weight: bold; font-size: 12px;
  padding: 0 18px; cursor:pointer;
}
.btn-primary:hover{ background: linear-gradient(180deg, #5A8FB5, #3E6C92); }
.btn-primary:active{ background: #234A66; }

.btn-ghost{
  background: var(--panel-bg-alt); border: 1px solid var(--border-soft); color: var(--link);
  font-size: 11px; font-weight:bold; padding: 4px 10px; cursor:pointer;
}
.btn-ghost:hover{ background: var(--ghost-hover); text-decoration: underline; }

.searchbox__hint{ font-size: 11px; color: var(--text-muted); margin: 8px 0 0; }
.searchbox__hint em{ font-style: normal; font-family: "Courier New", monospace; }

.ns-note{ font-size: 13px; color: var(--text-muted); padding: 12px; border: 1px solid var(--border-soft); background: var(--panel-bg-alt); }
.banner{
  margin-top: 10px; padding: 8px 12px; border: 1px solid var(--banner-info-border); background: var(--banner-info-bg);
  font-size: 12px; color: var(--banner-info-text);
}
.banner.is-error{ border-color: var(--banner-error-border); background: var(--banner-error-bg); color: var(--banner-error-text); }
.banner.is-warn{ border-color: var(--banner-info-border); background: var(--banner-info-bg); color: var(--banner-info-text); }

#dossier-root{ margin-top: 12px; }
.dossier{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: start; grid-auto-flow: row dense; }

.card{ background: var(--panel-bg); border: 1px solid var(--border); padding: 0 10px 12px; min-width: 0; }
.card--wide{ grid-column: 1 / -1; }
.card--identity{ grid-column: span 3; padding:0; display:flex; flex-direction:column; }
.identity-hero{ position:relative; width:100%; height:120px; overflow:hidden; background:var(--panel-bg-alt); display:none; border-bottom:1px solid var(--border); }
.identity-hero.is-visible{ display:block; }
.identity__banner{ width:100%; height:100%; object-fit:cover; display:block; }
.identity-body{ display:flex; flex:1; min-height:0; }

.card__title{
  background: linear-gradient(180deg, var(--title-light), var(--title-dark));
  color: #fff; font-weight: bold; font-size: 12px; margin: 0 -12px 10px; padding: 5px 10px;
}
.card__title-row{ display:flex; align-items:center; justify-content:space-between; gap:8px;
  background: linear-gradient(180deg, var(--title-light), var(--title-dark)); margin: 0 -12px 10px; padding: 4px 6px 4px 10px; }
.card__title-row .card__title{ background:none; margin:0; padding:0; }

.profile-box{
  width: 190px; flex-shrink:0; background: var(--panel-bg-alt); border-right: 1px solid var(--border);
  padding: 12px; text-align:center;
}
.avatar-frame{
  width: 160px; height: 106px; margin: 0 auto 8px;
  background: var(--input-bg); border: 2px inset #3A4550;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.identity__flag{ max-width: 100%; max-height: 100%; object-fit: contain; }
.profile-box__badge{
  display:inline-block; font-size: 10.5px; font-weight:bold; letter-spacing: .02em;
  padding: 2px 8px; border: 1px solid var(--border-soft); border-radius: 2px; margin-bottom: 10px;
  color: var(--text-muted); background:var(--input-bg);
}
.profile-box__badge.is-online{ color: var(--online); border-color: var(--online); }
.profile-box__badge.is-offline{ color: var(--offline); border-color: var(--offline); }
.profile-box__stats{ width:100%; font-size:11px; border-collapse: collapse; }
.profile-box__stats td{ padding: 3px 0; text-align:left; border-top: 1px dotted var(--border-soft); }
.profile-box__stats td:first-child{ color: var(--text-muted); }
.profile-box__stats td:last-child{ text-align:right; font-weight:bold; }
.profile-box__stats tr:first-child td{ border-top:none; }

.profile-main{ flex:1; min-width:0; padding: 14px 16px; }
.profile-main__head{
  font-size: 11px; color: var(--text-muted); display:flex; justify-content:space-between;
  border-bottom: 1px dashed var(--border-soft); padding-bottom: 6px; margin-bottom: 8px;
}
.identity__name{ font-family: Georgia, "Times New Roman", serif; font-size: 24px; margin: 0 0 2px; color: var(--title-dark); }
.identity__fullname{ margin: 0 0 6px; color: var(--text-muted); }
.identity__motto{ margin: 0 0 8px; font-style: italic; color: var(--title-light); }
.identity__motto.identity__power{ font-style: normal; font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; }
.identity__motto.identity__power .power-label{ letter-spacing: .05em; font-size: 10px; color: var(--text-muted); }
.identity__motto.identity__power b{ color: var(--title-dark); }
.identity__compass{ display:flex; align-items:center; gap:10px; margin: 10px 0 4px; padding: 8px 10px; background: var(--panel-bg-alt); border: 1px solid var(--border-soft); }
.identity__compass-canvas{ width: 110px; height: 72px; flex:0 0 auto; }
.identity__compass-meta{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.identity__compass-label{ font-size:10px; letter-spacing:.06em; color: var(--text-muted); font-weight:bold; }
.identity__compass-ideology{ font-size:13px; font-weight:bold; color: var(--title-dark); }

.ledger-table{ width:100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 12px; }
.ledger-table td{ padding: 5px 6px; border-bottom: 1px solid var(--border-soft); }
.ledger-table td:first-child{ color: var(--text-muted); width: 44%; }
.ledger-table td:last-child{ font-weight:bold; text-align:right; }
.erate-line{ display:block; white-space:nowrap; }
.erate-line + .erate-line{ margin-top:2px; font-weight:normal; color: var(--text-muted); font-size:11px; }
.trade-status{ grid-column: 1 / -1; margin: 4px 2px 0; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.economy-loading{ padding: 18px 12px 20px; text-align: center; }
.economy-loading__msg{ font-weight: bold; margin-bottom: 12px; }
.economy-loading__why{ font-size: 11px; color: var(--text-muted); max-width: 560px; margin: 10px auto 0; line-height: 1.5; }
.economy-loading__track{ height: 8px; border-radius: 999px; background: var(--panel-bg-alt); border: 1px solid var(--border-soft); overflow: hidden; max-width: 560px; margin: 0 auto; }
.economy-loading__fill{ height: 100%; width: 0%; background: linear-gradient(90deg, var(--link, #2E5C82), #2E5C82); transition: width .4s ease; }
.economy-loading__fill.is-indeterminate{ width: 40%; animation: econ-indet 1.4s ease-in-out infinite; }
@keyframes econ-indet{ 0%{ margin-left: -40%; } 100%{ margin-left: 100%; } }
.economy-loading__stats{ font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.economy-loading__count{ margin-left: 6px; }
.ledger-table tr:nth-child(even){ background: var(--panel-bg-alt); }
.ledger__desc{ margin: 4px 0 0; font-size: 11.5px; color: var(--text-muted); font-style: italic; white-space: pre-line; overflow-wrap: anywhere; }

.mini-title{ font-size: 11px; font-weight:bold; color: var(--text-muted); margin: 0 0 6px; }

.chart-box{ position:relative; height: 200px; margin: 8px 0 4px; }

.chart-box--square{ height: 310px; max-width: 340px; margin-left:auto; margin-right:auto; aspect-ratio: 1 / 1; height: auto; }
.chart-box--square canvas{ width:100% !important; height:100% !important; }

canvas{ max-width: 100%; }
.compass-layout > *, .economy-grid > *, .cmp-grid2 > *{ min-width: 0; }
.chart-box--wide{ height: 170px; }
#chart-polcompass, #chart-polcompass-region, #chart-polcompass-world, #chart-cmp-compass, #chart-cmp-radar{ width:100%; height:100%; display:block; }
.chart-box--compass{ width: min(100%, 440px); aspect-ratio: 1 / 1; height: auto !important; margin-left: auto; margin-right: auto; }
.compass__labels{ font-size:12px; }
.compass__labels p{ margin: 4px 0; }
.dot{ display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; }
.dot--blue{ background:#2E5C82; } .dot--gold{ background:var(--gold); } .dot--red{ background:#B00020; }

.wa-status{ font-weight:bold; color: var(--title-dark); margin: 8px 0 0; }
.wa-badges{ margin-top: 10px; }

.chips{ display:flex; flex-wrap:wrap; gap:5px; margin: 6px 0; }
.chips--scroll{ max-height: 130px; overflow-y:auto; padding: 2px; border: 1px solid var(--border-soft); background: var(--panel-bg-alt); }
.chips--attr .chip{ background: var(--panel-bg-alt); border-style:dashed; color:#2E5C82; }

.quirk-list{ list-style:none; margin:0 0 12px; padding:0; }
.quirk-list__item{ padding:3px 0 3px 16px; font-size:12px; color:var(--text); line-height:1.45; position:relative; }
.quirk-list__item::before{ content:"“"; position:absolute; left:0; top:2px; color:var(--link); font-family:Georgia, serif; font-size:14px; }
.quirk-list__item::after{ content:"”"; color:var(--link); font-family:Georgia, serif; }
.quirk-list__more{ font-size:11px; padding-left:16px; }
.chip{
  font-size: 11px; color: var(--text); border:1px solid var(--border-soft); background: var(--input-bg);
  padding: 2px 8px; border-radius: 2px;
}

.census-top{ list-style:none; margin: 8px 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.census-row{ display:flex; align-items:center; gap:8px; font-size:11.5px; }
.census-row__name{ flex: 0 0 170px; color: var(--text-muted); }
.census-row__bar{ flex:1; height: 8px; background: var(--panel-bg-alt); border: 1px solid var(--border-soft); }
.census-row__fill{ height:100%; background: linear-gradient(90deg, #4A7FA5, var(--gold)); }
.census-row__val{ flex:0 0 auto; font-family: "Courier New", monospace; font-size: 11px; width: 190px; text-align:right; }.census-full{ margin: 10px 0 0; border-top: 1px solid var(--border-soft); padding-top: 10px; max-height: 400px; overflow-y: auto; }

.census-hint{ font-size: 11px; }

.activity-log, .dispatch-list, .rmb-feed{ list-style:none; margin: 8px 0; padding:0; }
.activity-log li, .dispatch-list li, .rmb-feed li{
  padding: 6px 0; border-bottom: 1px dotted var(--border-soft); display:flex; gap:10px; font-size: 11.5px;
}
.activity-log li:last-child, .dispatch-list li:last-child, .rmb-feed li:last-child{ border-bottom:none; }
.log-time{ flex:0 0 108px; color: var(--text-muted); font-family: "Courier New", monospace; font-size: 10.5px; padding-top:1px; }
.log-text{ flex:1; }
.rmb-feed .log-text::before{ content: "» "; color: var(--title-light); }

.muted{ color: var(--text-muted); font-style: italic; list-style:none; }

.forum-footer{ margin-top: 16px; padding: 10px 4px; text-align:center; color: var(--text-muted); font-size: 11px; }
.forum-footer p{ margin: 3px 0; }
.forum-footer__small{ font-family: "Courier New", monospace; }

.spotlights{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.spotlight-card{ border: 1px solid var(--border); background: var(--panel-bg); }
.spotlight-card__title{
  background: linear-gradient(180deg, var(--title-light), var(--title-dark));
  color:#fff; font-weight:bold; font-size: 12px; padding: 5px 10px;
}
.spotlight-card__body{
  display:block; width:100%; text-align:left; font: inherit; cursor:pointer;
  padding: 10px 12px; color: var(--text); font-size: 12px; line-height:1.4; border:none; background:var(--panel-bg);
}
.spotlight-card__body:hover{ background: var(--panel-bg-alt); }
.spotlight-card__body strong{ color: var(--title-dark); font-size: 14px; display:block; margin-top: 3px; }
.spotlight-card__body small{ color: var(--text-muted); }
.spot-tag{ display:inline-block; font-size:10px; font-weight:bold; color: var(--link); border:1px solid var(--border-soft); padding:1px 6px; border-radius:2px; margin-bottom:4px; }
.spotlight-card__body:hover .spot-tag{ text-decoration:underline; }

.compare-panel{ margin-top: 10px; border: 1px solid var(--border); }
.compare-panel .searchbox__body{ padding: 12px; }
.compare-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-field label{ display:block; font-size:10.5px; color: var(--text-muted); margin:0 0 3px 1px; font-weight:bold; }
.cmp-field input{ width:100%; border:1px solid var(--border); background:var(--input-soft); color:var(--text); font-family:inherit; font-size:12px; padding:7px 8px; }
.cmp-field input:focus{ outline:1px dotted var(--title-light); background:var(--input-bg); }
.cmp-tabs{ margin-bottom:10px; }

.cmp-result{ margin-top: 14px; }
.cmp-head{ display:grid; grid-template-columns: 1fr auto 1fr; gap:10px; align-items:stretch; margin-bottom:12px; }
.cmp-entity{ border:1px solid var(--border); background:var(--panel-bg-alt); padding:10px 12px; }
.cmp-entity--a{ text-align:left; }
.cmp-entity--b{ text-align:right; }
.cmp-entity img{ max-height:46px; max-width:80px; border:1px solid var(--border-soft); background:var(--input-bg); vertical-align:middle; }
.cmp-entity__name{ font-family:Georgia, serif; font-size:16px; font-weight:bold; color:var(--title-dark); display:block; margin-top:6px; }
.cmp-entity__quad{ font-size:11px; color:var(--text-muted); }
.cmp-vs{ align-self:center; font-weight:bold; color:var(--text-muted); font-size:14px; }
.cmp-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }

.cmp-census{ margin-top:14px; }
.cmp-history__toggle{
  display:inline-flex; align-items:center; gap:6px;
  background: var(--panel-bg-alt); border:1px solid var(--border-soft); color: var(--link);
  font-size:11px; font-weight:bold; padding:5px 12px; cursor:pointer;
}
.cmp-history__toggle:hover{ background: var(--ghost-hover); text-decoration: underline; }
.cmp-history__panel{ margin-top:10px; border:1px solid var(--border); background:var(--panel-bg); padding:10px 12px; }
.cmp-history__head{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.cmp-history__select{ font:inherit; font-size:12px; padding:4px 8px; background:var(--input-bg); color:var(--text); border:1px solid var(--border); }
.cmp-history__legend{ display:flex; gap:14px; font-size:11px; color:var(--text); }
.cmp-history__key{ display:inline-flex; align-items:center; gap:6px; }
.cmp-history__key > span{ width:14px; height:4px; display:inline-block; border-radius:2px; }
.cmp-history__chart{ height:260px; }
.cmp-history__status{ font-size:11px; color:var(--text-muted); min-height:14px; }
.cmp-a{ color:#2E5C82; } .cmp-b{ color:#C9A227; }

.ideology-line{ font-size: 14px; font-weight:bold; color: var(--title-dark); margin: 10px 0 4px; }
.progressive{ margin: 10px 0 4px; }
.progressive__head{ display:flex; justify-content:space-between; font-size:12px; color: var(--text-muted); margin-bottom:4px; }
.progressive__head b{ font-size:12.5px; color: var(--title-dark); }
.progressive__bar{ height:8px; background: var(--panel-bg-alt); border:1px solid var(--border-soft); }
.progressive__fill{ height:100%; background:#88929A; transition: width .4s ease, background .4s ease; }
.ideology-desc{ margin:0; font-size: 12px; color: var(--text-muted); white-space: pre-line; line-height: 1.5; }
.compass-legend{ display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:8px; font-size:10.5px; color:var(--text-muted); }
.compass-legend span{ display:inline-flex; align-items:center; gap:4px; }
.compass-legend i{ width:9px; height:9px; border-radius:2px; display:inline-block; }

.economy-grid{ display:grid; grid-template-columns: 1fr 1.2fr; gap: 16px; }
.economy-charts .chart-box{ margin-top:0; }
.economy-note{ font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 8px; }

.clickable{ color: var(--link); cursor:pointer; font-weight:bold; }
.clickable:hover{ text-decoration: underline; }
.ledger-table td a, .profile-box__stats td a{ color: var(--link); font-weight:bold; }
.census-row__name a{ color: var(--text); }

.chart-box--govt{ height: 240px; }
.govt-legend{ display:flex; flex-wrap:wrap; gap:4px 14px; margin:10px 0 0; font-size:11.5px; color:var(--text-main, #333); }
.govt-legend__item{ display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
.govt-legend__dot{ width:10px; height:10px; border-radius:50%; flex:0 0 auto; border:1px solid rgba(0,0,0,.15); }

.card--ledger-wide{ grid-column: span 2; }

.card--compass-wide{ grid-column: 1 / -1; display:grid; }
.compass-layout{ display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items:start; }
.compass-layout__chart{ display:flex; flex-direction:column; align-items:center; }
.compass-layout__info{ display:flex; flex-direction:column; justify-content:center; min-width:0; }
.compass-layout__info .progressive{ margin:0 0 8px; }
@media (max-width: 760px){
  .compass-layout{ grid-template-columns: 1fr; }
}

.census-ladder{ margin: 4px 0 4px; }
.census-ladder__body{ display:grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap:12px; }
.census-ladder-group{ border:1px solid var(--border-soft); background: var(--panel-bg-alt); border-radius:4px; overflow:hidden; }
.census-ladder-group__head{ display:flex; align-items:center; gap:8px; padding:6px 9px; background: var(--panel-bg); border-bottom:1px solid var(--border-soft); }
.census-ladder-group__dot{ width:10px; height:10px; border-radius:2px; display:inline-block; }
.census-ladder-group__name{ font-size:11px; font-weight:bold; color:var(--title-dark); flex:1; }
.census-ladder-group__count{ font-size:10px; color:var(--text-muted); font-family:"Courier New", monospace; }
.census-ladder-row{ display:flex; align-items:center; gap:8px; width:100%; text-align:left; font:inherit; padding:4px 9px; cursor:pointer; background:transparent; border:none; border-bottom:1px solid var(--border-soft); }
.census-ladder-row:last-child{ border-bottom:none; }
.census-ladder-row:hover{ background: var(--panel-bg); }
.census-ladder-row__name{ font-size:11px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.2; flex:1; }
.census-ladder-row__track{ height:7px; background: var(--panel-bg); border:1px solid var(--border-soft); border-radius:2px; overflow:hidden; position:relative; flex:2; }
.census-ladder-row__fill{ height:100%; display:block; }
.census-ladder-row__val{ font-family:"Courier New", monospace; font-size:10px; color:var(--text-muted); text-align:right; white-space:nowrap; flex:0 0 auto; min-width:72px; }
@media (max-width: 760px){
  .census-ladder__body{ grid-template-columns: 1fr; }
}
.census-ladder-row__name{ flex: 0 1 42%; }
.census-ladder-row__track{ flex: 1 1 auto; min-width: 40px; }
.census-ladder-row__val{ flex: 0 0 auto; }

.forum-header .forum-header__by{
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-family: Verdana, Arial, sans-serif;
  font-size: 10px;
  font-weight: normal;
  color: #8FB6D0;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0.9;
}
@media (max-width: 640px){
  .forum-header{ padding: 14px 18px 26px; }
  .forum-header .forum-header__by{ right: 14px; bottom: 8px; }
}

.card--policies .chips{ margin: 2px 0 0; }

.census-ladder-item{ border-bottom:1px solid var(--border-soft); }
.census-ladder-item:last-child{ border-bottom:none; }
.census-ladder-row__chevron{ margin-left:auto; color:var(--text-muted); font-size:10px; transition: transform .18s ease; }
.census-ladder-row.is-open .census-ladder-row__chevron{ transform: rotate(180deg); }
.census-ladder-body{ padding: 2px 9px 8px 9px; }
.census-ladder-body__chart{ height: 150px; margin: 2px 0 4px; }
.census-ladder-body__note{ font-size: 10.5px; color: var(--text-muted); }

.header-actions{
  position:absolute; top:12px; right:14px;
  display:flex; align-items:center; gap:8px;
}
.btn-help{
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(255,255,255,0.12); color:#EAF4FB;
  border:1px solid rgba(255,255,255,0.35); border-radius:999px;
  font: 500 11px/1 Verdana, Arial, sans-serif; letter-spacing:0.02em;
  padding:6px 11px; cursor:pointer; transition: background .15s ease;
}
.btn-help:hover{ background: rgba(255,255,255,0.24); }
.btn-theme{
  width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,0.12); color:#EAF4FB;
  border:1px solid rgba(255,255,255,0.35); border-radius:999px;
  font-size:14px; line-height:1; cursor:pointer; transition: background .15s ease;
}
.btn-theme:hover{ background: rgba(255,255,255,0.24); }
@media (max-width: 640px){
  .header-actions{ top:10px; right:10px; gap:6px; }
  .btn-help span{ display:none; }
  .btn-help{ padding:7px 9px; font-size:14px; }
}
.help-dialog{ border:0; padding:0; background:transparent; width:calc(100vw - 20px); max-width:none; height:calc(100vh - 20px); max-height:none; }
.help-dialog::backdrop{ background: rgba(4,20,34,0.72); }
.help-dialog__panel{ background:var(--panel-bg); border:1px solid var(--border-soft); border-radius:6px; overflow:hidden; display:flex; flex-direction:column; width:100%; height:100%; max-height:none; box-shadow:0 18px 50px rgba(0,0,0,.35); }
.help-dialog__head{ display:flex; align-items:center; justify-content:space-between; gap:10px; background:linear-gradient(180deg,#0B3D66,#072A47); color:#fff; padding:12px 16px; }
.help-dialog__head h2{ margin:0; font-size:16px; font-family:Georgia, "Times New Roman", serif; }
.btn-close{ background:transparent; border:1px solid rgba(255,255,255,.4); color:#fff; border-radius:4px; cursor:pointer; font-size:12px; line-height:1; padding:5px 9px; }
.btn-close:hover{ background:rgba(255,255,255,.18); }
.help-dialog__body{ overflow-y:auto; padding:14px 18px 22px; }
.help-lede{ font-size:12.5px; color:var(--text); margin:2px 0 14px; }
.help-sec{ border-top:1px solid var(--border-soft); padding:12px 0 4px; margin-top:4px; }
.help-sec h3{ margin:0 0 6px; font-size:13.5px; color:var(--title-dark); }
.help-sec p, .help-sec ul, .help-sec ol{ font-size:12px; line-height:1.55; color:var(--text); margin:4px 0 6px; }
.help-sec ul, .help-sec ol{ padding-left:20px; }
.help-sec li{ margin:3px 0; }
.help-sec code{ background:var(--code-bg); border:1px solid var(--code-border); border-radius:3px; padding:0 3px; font-size:11px; font-family:"Courier New", monospace; }
.help-defs{ margin:4px 0 8px; }
.help-defs div{ margin:7px 0; }
.help-defs dt{ font-weight:bold; font-size:12px; color:var(--title-dark); }
.help-defs dd{ margin:2px 0 0; font-size:12px; line-height:1.55; color:var(--text); }
.help-sec--warn{ background:var(--warn-bg); border:1px solid var(--warn-border); border-radius:4px; padding:8px 12px; margin-top:14px; }
.help-sec--warn h3{ color:var(--ticker-text); }

.help-dialog__body h4{ margin:14px 0 6px; font-size:12.5px; color:var(--title-dark); text-transform:none; }
.help-formula-line{ background:var(--formula-bg); border:1px solid var(--code-border); border-radius:4px; padding:6px 9px; font-size:12px; margin:6px 0; }
.help-note{ background:var(--formula-bg); border-left:3px solid var(--link); border-radius:0 4px 4px 0; padding:6px 9px; font-size:11.5px; color:var(--text); margin:8px 0; }
.help-table{ width:100%; border-collapse:collapse; margin:8px 0; font-size:11.5px; }
.help-table th{ text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:0.03em; color:var(--text-muted); border-bottom:1px solid var(--border-soft); padding:4px 6px; }
.help-table td{ border-bottom:1px solid var(--border-soft); padding:4px 6px; vertical-align:top; color:var(--text); }
.help-table tr:nth-child(even) td{ background:var(--panel-bg-alt); }
.help-table--wide td{ font-size:11px; }
.help-table-scroll{ overflow-x:auto; margin:8px 0; }
.help-table-scroll .help-table{ margin:0; }
.help-ideo-name{ font-weight:bold; color:var(--title-dark); }
.help-ideo-example{ font-size:10px; color:var(--text-muted); margin-top:1px; white-space:nowrap; }
.help-ideo-example a{ color:var(--link); text-decoration:underline; cursor:pointer; }
.help-table--narrow{ max-width:420px; }
.econ-steps{ margin:4px 0 10px; }
.econ-steps div, ol.econ-steps > li{ border:1px solid var(--border-soft); border-radius:4px; padding:7px 10px; margin:6px 0; background:var(--panel-bg-alt); }
ol.econ-steps{ padding-left:0; list-style-position:inside; }
ol.econ-steps > li::marker{ font-weight:bold; color:var(--title-dark); }
.econ-steps dt{ font-weight:bold; font-size:12px; color:var(--title-dark); display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; }
.econ-steps dt span{ font-weight:normal; font-size:11px; color:var(--text-muted); font-style:italic; }
.econ-steps dd, ol.econ-steps > li{ margin:3px 0 0; font-size:12px; line-height:1.55; color:var(--text); }
.help-example{ border:1px dashed var(--border); border-radius:5px; background:var(--example-bg); padding:8px 12px; margin:8px 0; }
.help-example ul{ padding-left:20px; font-size:12px; }
.help-example li{ margin:3px 0; }

.avatar-frame--globe{ font-size: 60px; line-height: 1; }
.dossier--world .identity-hero{ display:none; }

.ideo-hist{ margin-top: 16px; border-top: 1px dashed var(--border-soft); padding-top: 10px; }
.ideo-hist__title{ margin: 4px 0 2px; font-size: 13px; font-weight: bold; color: var(--title-dark); font-family: Georgia, "Times New Roman", serif; }
.ideo-hist__hint{ font-size: 11px; margin: 0 0 6px; }
.ideo-hist__note{ font-size: 11px; margin: 4px 0 6px; }

.time-scrub{ margin: 10px 0 2px; padding: 8px 10px 6px; background: var(--panel-bg-alt); border: 1px solid var(--border-soft); border-radius: 5px; }
.time-scrub__band{ display: flex; height: 10px; border-radius: 3px; overflow: hidden; gap: 1px; margin-bottom: 2px; }
.time-scrub__seg{ border: 0; padding: 0; cursor: pointer; min-width: 0; font: inherit; opacity: .92; }
.time-scrub__seg:hover{ opacity: 1; outline: 1px solid rgba(0,0,0,.45); outline-offset: 1px; }
.time-scrub__range{ width: 100%; margin: 0; accent-color: var(--title-dark); cursor: pointer; }
.time-scrub__labels{ display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 10.5px; color: var(--text-muted); font-family:"Courier New", monospace; margin-top: 3px; }
.time-scrub__cur{ color: var(--title-dark); font-size: 11.5px; font-family: Verdana, sans-serif; }

.census-ladder-row.is-avg .census-ladder-row__name{ flex: 1 1 auto; }
.census-ladder-row.is-avg .census-ladder-row__val{ margin-left:auto; }

@media (max-width: 900px){
  .dossier{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .economy-grid{ grid-template-columns: minmax(0,1fr); }

  .card--identity, .card--ledger-wide{ grid-column: 1 / -1; }
}
@media (max-width: 760px){
  .cmp-grid2{ grid-template-columns:1fr; }
  .compass-layout{ grid-template-columns:1fr; }
  .census-ladder__body{ grid-template-columns:1fr; }
}
@media (max-width: 640px){
  .card--identity{ flex-direction:column; }
  .identity-body{ flex-direction:column; }
  .profile-box{ width:auto; border-right:none; border-bottom:1px solid var(--border); }
  .dossier{ grid-template-columns: minmax(0,1fr); }
  .card--identity, .card--ledger-wide{ grid-column: 1 / -1; }
  .census-row{ flex-wrap:wrap; }
  .census-row__val{ width:auto; }
  .spotlights{ grid-template-columns: 1fr; }
  .compare-grid{ grid-template-columns: 1fr; }
  .cmp-head{ grid-template-columns:1fr; }
  .cmp-vs{ text-align:center; }
  .cmp-entity--b{ text-align:left; }
  .add-space{ display:none; }

  .forum-shell{ padding: 8px 8px 18px; }
  .forum-header{ padding: 14px 44px 26px 16px; }
  .forum-header__logo{ font-size: 19px; }
  .card{ padding: 0 8px 10px; }
  .card__title, .card__title-row{ margin-left: -8px; margin-right: -8px; }
  .card__title{ padding-left: 8px; padding-right: 8px; }
  #query-input, .cmp-field input, .searchbox__prefix{ font-size: 16px; }
  #query-input{ min-width: 0; flex: 1 1 60px; }
  .ledger-table td:first-child{ width: auto; }
  .activity-log li, .dispatch-list li, .rmb-feed li{ flex-wrap: wrap; }
  .log-time{ flex-basis: 100%; }
  .cmp-entity img{ display:block; margin: 0 auto 4px; }
}
@media (max-width: 420px){
  .forum-header__logo{ font-size: 17px; }
  .identity__name{ font-size: 20px; }
  .avatar-frame{ width: 132px; }
  .census-ladder-row__name{ flex-basis: 38%; }
  .header-actions{ top: 9px; right: 9px; }
}
