:root {
  color-scheme: dark;
  --iron: #070605;
  --steel: #100e0c;
  --panel: #14110e;
  --panel-raise: #241c14;
  --line: rgba(166, 124, 62, 0.45);
  --line-gold: rgba(212, 168, 84, 0.78);
  --gold: #c6a15a;
  --gold-bright: #f0d7a2;
  --parchment: #f4ecdf;
  --muted: #b7a78f;
  --emerald: #7dce86;
  --ember: #d0604c;
  --sidebar: 240px;
  --serif: "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", Candara, sans-serif;
  --text: var(--parchment);
  --focus: var(--gold-bright);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { scrollbar-color: #8c7344 #100e0c; scrollbar-width: thin; }
body {
  background-color: #070605;
  background-image:
    linear-gradient(rgba(7, 6, 5, 0.78), rgba(7, 6, 5, 0.86)),
    url("/static/brand/ui/20_background%20texture.png");
  background-repeat: repeat;
  background-size: auto, 520px;
  color: var(--parchment);
  font-family: var(--sans);
  line-height: 1.45;
}
a { color: var(--gold-bright); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--parchment); }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--panel);
  color: var(--parchment);
  padding: 0.4rem 0.7rem;
  z-index: 8;
}
.skip:focus { top: 0.5rem; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; align-items: stretch; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: sticky;
  top: 0;
  z-index: 6;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 12px 10px 10px;
  background:
    linear-gradient(180deg, rgba(12, 11, 10, 0.55), rgba(12, 11, 10, 0.82)),
    url("/static/brand/ui/20_background%20texture.png");
  background-size: auto, 360px;
  border-right: 1px solid var(--line-gold);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.85), inset 1px 0 0 rgba(240, 210, 150, 0.08);
}
.sidebar::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 3px;
  width: 10px;
  height: 220px;
  background: url("/static/brand/ui/13_edge_rivet.png") center top / 8px auto no-repeat;
  opacity: 0.55;
  pointer-events: none;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 160px;
  right: 3px;
  width: 12px;
  height: 280px;
  background: url("/static/brand/ui/12_chain_vertical.png") center top / 12px auto no-repeat;
  opacity: 0.4;
  pointer-events: none;
}
html.sidebar-collapsed .sidebar::before,
html.sidebar-collapsed .sidebar::after { content: none; }
.brand-lockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding-right: 1.6rem;
}
.sidebar-logo {
  display: block;
  width: 132px;
  height: auto;
  max-height: 148px;
  object-fit: contain;
}
.sidebar-mark { display: none; width: 40px; height: 40px; object-fit: contain; }
.brand-lockup .rail-toggle { position: absolute; top: 0; right: 0; }
img.crest {
  display: block;
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: 56px;
  min-height: 56px;
  max-height: 56px;
  flex: 0 0 56px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line-gold);
  background: #100e0c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65);
}
img.crest.crest-small {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  flex: 0 0 32px;
}
img.crest.crest-large {
  width: 64px;
  height: 64px;
  min-width: 64px;
  max-width: 64px;
  min-height: 64px;
  max-height: 64px;
  flex: 0 0 64px;
  margin: 0 0 0.6rem;
}
.brand {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.brand-by {
  margin: 0;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand-note, .nav-label, .eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.rail-toggle {
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  padding: 0;
  border-radius: 2px;
  border: 1px solid var(--line-gold);
  background: #16130f;
  color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.2);
}
.rail-toggle:hover {
  background: #2a2118;
  color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.45), 0 8px 14px rgba(180, 110, 30, 0.28);
}
.tenant {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  background: rgba(0, 0, 0, 0.35);
}
.tenant-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--parchment);
}
.tenant-kingdom, .kingdom, .who, .meta, .hero-role { color: var(--muted); margin: 0; }
.nav {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.15rem 14px 0.4rem 0.1rem;
}
.nav-label { margin: 0.7rem 0.35rem 0.15rem; }
.nav-icon, .mark, .tile-icon, .empty-icon { line-height: 1; }
.nav-icon, .mark { color: var(--gold); }
.nav-icon { width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; text-align: center; }
.nav a, .switcher a, .foot-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--parchment);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0 0.55rem;
  background: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.nav a:hover, .switcher a:hover, .foot-link:hover {
  transform: translateY(-3px);
  color: var(--gold-bright);
  background: #1a140e;
  border-color: rgba(212, 168, 84, 0.7);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5), 0 10px 16px rgba(176, 104, 28, 0.32);
}
.nav a:hover .nav-icon, .nav a[aria-current="page"] .nav-icon { filter: brightness(1.18); }
.nav a:hover::after, .nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 12px;
  background: url("/static/brand/ui/19_glow_underbar.png") center / contain no-repeat;
  pointer-events: none;
}
.nav a:active, .link-card:active, button:active, .action:active { transform: translateY(-1px); }
.nav a[aria-current="page"] {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #3a2c18, #22180f);
  border-color: var(--line-gold);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.22), 0 6px 12px rgba(150, 90, 20, 0.28);
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.3rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.logout button {
  width: 100%;
  justify-content: flex-start;
  gap: 0.5rem;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 2px;
  box-shadow: none;
}
.logout button:hover {
  color: var(--gold-bright);
  background: #1a140e;
  border-color: rgba(212, 168, 84, 0.7);
  transform: translateY(-3px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5), 0 10px 16px rgba(176, 104, 28, 0.32);
}

html.sidebar-collapsed { --sidebar: 68px; }
html.sidebar-collapsed .brand-copy,
html.sidebar-collapsed .tenant,
html.sidebar-collapsed .who,
html.sidebar-collapsed .nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
html.sidebar-collapsed img.crest {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  min-height: 36px;
  max-height: 36px;
  flex: 0 0 36px;
}
html.sidebar-collapsed .brand-lockup { padding-right: 0; }
html.sidebar-collapsed .sidebar-logo { display: none; }
html.sidebar-collapsed .sidebar-mark { display: block; }
html.sidebar-collapsed .nav-icon { width: 26px; height: 26px; flex-basis: 26px; }
html.sidebar-collapsed .rail-toggle { margin: 0; }
html.sidebar-collapsed .nav a,
html.sidebar-collapsed .foot-link,
html.sidebar-collapsed .logout button { justify-content: center; padding-inline: 0; }
html.sidebar-collapsed .nav-label {
  height: 0;
  margin: 0.35rem 0.4rem;
  padding: 0;
  overflow: hidden;
  border-top: 1px solid rgba(198, 161, 90, 0.4);
  color: transparent;
}
.rail-tip {
  position: fixed;
  z-index: 40;
  transform: translateY(-50%);
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  background: #16130f;
  color: var(--parchment);
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.rail-tip[hidden] { display: none; }

.main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0.3rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #0c0b0a;
  position: relative;
  z-index: 4;
}
.identity { margin-right: auto; min-width: 0; }
.alliance { font-family: var(--serif); font-size: 1.05rem; margin: 0; }
.topbar .who { font-size: 0.88rem; }
.nav-button { display: none; }
main {
  width: min(1440px, 100%);
  max-width: 1440px;
  margin-inline: auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 24px 36px;
}
h1, h2, h3, .keep-title { font-family: var(--serif); font-weight: 600; letter-spacing: 0.03em; }
h1 { font-size: 1.7rem; margin: 0.05rem 0 0.15rem; color: var(--gold-bright); }
h2 { font-size: 0.78rem; margin: 0; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-bright); }
.keep-title { margin: 0; font-size: 1.45rem; color: var(--parchment); letter-spacing: 0.01em; text-transform: none; }
.lede, .empty-copy { color: var(--muted); }
.page-head {
  position: sticky;
  top: 0;
  z-index: 3;
  overflow: hidden;
  min-height: 0;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-gold);
  background-color: #070605;
  background-image:
    linear-gradient(90deg, rgba(7, 6, 5, 0.94) 0%, rgba(7, 6, 5, 0.82) 62%, rgba(7, 6, 5, 0.74) 100%),
    url("/static/brand/castellan-banner.jpg");
  background-size: cover;
  background-position: center 42%;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.16), 0 10px 16px rgba(0, 0, 0, 0.55);
}
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-height: none; }
.page-head .meta { margin-top: 0.15rem; }

.hero {
  position: sticky;
  top: 0;
  z-index: 3;
  width: min(100%, 1204px);
  margin: 0 auto 0.85rem;
  border: 1px solid var(--line-gold);
  background: #100e0c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), 0 10px 18px rgba(0, 0, 0, 0.55);
}
.hero-art {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.hero-corner {
  position: absolute;
  width: 42px;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
}
.hero-corner-tl { top: 4px; left: 4px; }
.hero-corner-tr { top: 4px; right: 4px; }
.hero-corner-bl { bottom: 4px; left: 4px; }
.hero-corner-br { bottom: 4px; right: 4px; }
.hero-brand {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.05rem;
  background: linear-gradient(180deg, rgba(7, 6, 5, 0.18), rgba(7, 6, 5, 0.55));
}
.hero-by {
  margin: 0;
  color: #ead9b4;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-mark {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: cover;
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.hero-name {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}
.hero-role { letter-spacing: 0.22em; text-transform: uppercase; font-size: 0.66rem; color: #ead9b4; }
.ornament {
  display: block;
  width: min(16rem, 70%);
  height: 28px;
  margin: 0.1rem auto;
  background: url("/static/brand/ui/leaf.svg") center / contain no-repeat;
}
.troop-icon { display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; }
.troop-icon img { width: 100%; height: 100%; object-fit: contain; }
.facts strong { display: block; }

.panel, .card, .table-wrap, .empty, .note {
  position: relative;
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.045), transparent 2rem),
    linear-gradient(180deg, #1b1713, #100e0c);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.38);
}
.panel::before, .link-card::before, .table-wrap::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 5px;
  background:
    linear-gradient(var(--gold), var(--gold)) left top / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left top / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right top / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right top / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left bottom / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left bottom / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 1px 12px no-repeat;
  opacity: 0.55;
}
.panel { padding: 0 0 0.8rem; margin-bottom: 0.8rem; }
.note, .empty { padding: 0.9rem 1rem; margin-bottom: 0.8rem; }
.empty h2 { margin-bottom: 0.3rem; }
.empty-icon { margin: 0 0 0.35rem; font-size: 1.25rem; }
.card { padding: 0.75rem 0.8rem; }
.section-head, .panel > h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.48rem 0.75rem;
  border-bottom: 1px solid var(--line-gold);
  background-image:
    linear-gradient(90deg, rgba(8, 7, 6, 0.94), rgba(8, 7, 6, 0.8)),
    url("/static/brand/castellan-banner.jpg");
  background-size: cover;
  background-position: center 36%;
}
.panel > h2 { margin-bottom: 0.75rem; }
.dossier-head, .panel > .timeline, .panel > .access-grid, .panel > .stat-grid, .panel > .meta, .panel > .empty, .panel > .keep-grid, .panel .config-list, .panel .stat-list {
  margin-right: 0.75rem;
  margin-left: 0.75rem;
}
.dossier-head { display: flex; justify-content: space-between; gap: 0.7rem; align-items: center; margin-bottom: 0.7rem; }
.group-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.subpanel { min-width: 0; }
.keep-grid, .settings-grid, .dash-split, .card-grid, .stat-grid, .access-grid {
  display: grid;
  gap: 0.7rem;
}
.dash-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; margin-bottom: 0.8rem; }
.dash-split:has(> :only-child) { grid-template-columns: 1fr; }
.keep-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid, .card-grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.access-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.facts { display: grid; gap: 0.5rem; margin-top: 0.15rem; }
.facts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
  padding: 0.55rem 0.4rem 0.65rem;
  background: #0b0a09;
  border: 1px solid rgba(184, 140, 60, 0.5);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.12), inset 0 -10px 14px rgba(0, 0, 0, 0.35);
}
.tile span, .stat-card span, .link-card span, .config-list dt, .stat-list dt {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tile strong, .stat-card strong, .facts strong {
  font-family: var(--sans);
  font-size: 1.28rem;
  font-weight: 680;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--parchment);
}
.tile-icon { font-size: 1rem; color: var(--gold); }
.stat-card em { display: block; margin-top: 0.35rem; color: var(--muted); font-style: normal; font-size: 0.75rem; }
.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 7.2rem;
  color: inherit;
  text-decoration: none;
  text-align: center;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.link-card .mark { font-size: 1.45rem; }
.link-card strong { font-family: var(--serif); font-size: 0.95rem; color: var(--parchment); }
.link-card:hover, .choice-list button:hover, .segmented a:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.2), 0 10px 14px rgba(0, 0, 0, 0.5), 0 12px 18px rgba(176, 104, 28, 0.3);
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.badge-ok { color: var(--emerald); border-color: rgba(125, 206, 134, 0.45); }
.badge-idle { color: var(--ember); border-color: rgba(208, 96, 76, 0.5); }
.badge-plain { color: var(--parchment); }
.badge-ok::before, .badge-idle::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.stat-list, .config-list { margin: 0 0.75rem; }
.stat-list div, .config-list div {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.48rem 0;
  border-bottom: 1px solid rgba(166, 124, 62, 0.28);
}
.stat-list dd, .config-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.panel .config-list, .panel .empty, .panel .stat-list { border: 0; box-shadow: none; background: transparent; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 32rem; }
th, td { text-align: left; padding: 0.58rem 0.75rem; border-bottom: 1px solid rgba(166, 124, 62, 0.28); }
th {
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #0c0b0a;
}
tbody tr:nth-child(even) { background: rgba(255, 236, 210, 0.025); }
tbody tr:hover { background: rgba(198, 161, 90, 0.08); }
.keep-name { font-weight: 680; color: var(--parchment); }
.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(166, 124, 62, 0.35);
  border-radius: 2px;
  background: #120f0c;
}
.board .rank { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.board strong { color: var(--parchment); }
.board em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--gold-bright); }
.board.ranks-only li { grid-template-columns: 6.2rem minmax(0, 1fr); }
.place-1 { border-color: var(--line-gold); background: linear-gradient(90deg, rgba(198, 161, 90, 0.22), #16130f 58%); }
.place-2 { border-color: rgba(190, 190, 190, 0.28); }
.place-3 { border-color: rgba(176, 112, 64, 0.45); }
.switcher, .segmented { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.8rem; }
.segmented {
  width: max-content;
  max-width: 100%;
  padding: 0.2rem;
  border: 1px solid var(--line-gold);
  background: #0c0b0a;
  border-radius: 2px;
}
.segmented a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.34rem 0.7rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.segmented a[aria-current="true"], .switcher a[aria-current="true"] {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #4a3820, #2a2014);
  border-color: var(--line-gold);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.2);
}
.page-head.board-head { overflow: visible; }
.board-picker { display: grid; gap: 0.25rem; min-width: 14rem; max-width: 100%; margin: 0; position: relative; z-index: 4; }
.board-picker > span { color: var(--gold); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; }
.forged-select { position: relative; min-width: 0; }
.forged-select-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
}
.forged-select-value { min-width: 0; }
.forged-select-chevron { color: var(--gold); font-size: 0.7rem; line-height: 1; }
.forged-select-button[aria-expanded="true"] .forged-select-chevron { transform: rotate(180deg); }
button.forged-select-button:hover,
button.forged-select-button:focus {
  transform: none;
  color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.22), 0 6px 12px rgba(0, 0, 0, 0.35);
}
.forged-select-list {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 32px));
  margin: 0;
  padding: 0.28rem 0 0.4rem;
  background: #15120f;
  color: #f1dfbd;
  border: 1px solid rgba(176, 132, 68, 0.85);
  border-radius: 2px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(240, 210, 150, 0.08);
  max-height: min(22rem, 70vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #8c7344 #0d0c0a;
  scrollbar-width: thin;
}
.forged-select-list[hidden] { display: none; }
.forged-select-list::-webkit-scrollbar { width: 10px; }
.forged-select-list::-webkit-scrollbar-track { background: #0d0c0a; }
.forged-select-list::-webkit-scrollbar-thumb { background: #8c7344; border: 2px solid #0d0c0a; }
.forged-select-list::-webkit-scrollbar-thumb:hover { background: #c6a15a; }
.forged-select-heading {
  margin: 0.28rem 0 0.05rem;
  padding: 0.28rem 0.75rem 0.18rem;
  background: #0d0c0a;
  color: #c6a15a;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.forged-select-option {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0.85rem 0.3rem 1.05rem;
  color: #f1dfbd;
  background: transparent;
  text-decoration: none;
  line-height: 1.3;
  border-left: 3px solid transparent;
}
.forged-select-option:hover,
.forged-select-option[data-active="true"] {
  background: #3a2c18;
  color: #f4ecdf;
  border-left-color: #c6a15a;
}
.forged-select-option[aria-selected="true"] {
  background: linear-gradient(180deg, #4a3820, #2a2014);
  color: #f4ecdf;
  border-left-color: #f0d7a2;
}
.forged-select-option[aria-selected="true"]:hover,
.forged-select-option[aria-selected="true"][data-active="true"] {
  background: linear-gradient(180deg, #5a4528, #322618);
  color: #fff8ea;
}
.board-picker select, button, .action {
  font: inherit;
  color: var(--gold-bright);
  background: linear-gradient(180deg, #3a2c18, #22180f);
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  padding: 0.48rem 0.7rem;
}
.board-picker select { width: 100%; }
button, .action {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.22), 0 6px 12px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
button:hover, .action:hover {
  color: var(--gold-bright);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.3), 0 10px 14px rgba(0, 0, 0, 0.5), 0 12px 18px rgba(176, 104, 28, 0.3);
}
.inline button, .nav-button {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.timeline { margin: 0.1rem 0 0 0.35rem; padding-left: 0.9rem; border-left: 1px solid var(--line-gold); }
.timeline .card { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0.35rem 0 0.55rem; }
.timeline .card::before { content: ""; position: absolute; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--gold); left: -1.2rem; top: 0.7rem; box-shadow: 0 0 0 3px #100e0c, 0 0 8px rgba(198, 161, 90, 0.45); }
.event-when, .event-title { color: var(--gold-bright); font-family: var(--serif); }
.event-change, .prose p { margin: 0.12rem 0; }
.relation-list { list-style: none; margin: 0; padding: 0 0.15rem 0.3rem; }
.relation-list li { padding: 0.45rem 0; border-bottom: 1px solid rgba(166, 124, 62, 0.28); }
.account-relations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: start;
  min-width: 0;
}
.account-relations > .panel { min-width: 0; }
@media (max-width: 640px) {
  .account-relations { grid-template-columns: minmax(0, 1fr); }
}
.gate { max-width: 36rem; padding: 2rem 0.2rem 1rem; }
.gate.narrow { max-width: 32rem; }
.choice-list { display: grid; gap: 0.55rem; }
.choice-list button {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 52px;
  text-align: left;
  padding: 0.7rem 0.85rem;
}
.plate-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; }
.plate-arrow { margin-left: auto; color: var(--gold-bright); font-size: 1.5rem; line-height: 1; }
.leaderboard { padding: 0.45rem; }
.leaderboard .board { margin: 0; }
.choice-list span { color: var(--muted); }

@media (max-width: 1100px) {
  .dash-split, .keep-grid, .settings-grid, .facts-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-button { display: inline-flex; }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(250px, 88vw);
    flex-basis: auto;
    height: 100vh;
    overflow: hidden;
    background: #0c0b0a;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.5);
  }
  .nav-toggle:checked ~ .app .sidebar { display: flex; }
  .rail-toggle { display: none; }
  main { width: 100%; max-width: none; padding: 0 14px 14px; }
  .hero { width: 100%; }
  .hero-corner, .sidebar::before, .sidebar::after { display: none; }
  body { background-attachment: scroll; }
  .nav a, .choice-list button, .link-card, button, .action { min-height: 44px; }
  .page-head { max-height: none; }
  .page-head-row, .dash-split, .keep-grid, .settings-grid { display: grid; grid-template-columns: 1fr; }
  .board-picker { min-width: 0; width: 100%; }
  .forged-select-list { left: 0; right: 0; width: auto; max-width: none; }
  .topbar .who { display: none; }
  .stat-list div, .config-list div { grid-template-columns: 1fr; gap: 0.12rem; }
  .stat-list dd, .config-list dd { text-align: left; }
  html.sidebar-collapsed { --sidebar: 250px; }
  html.sidebar-collapsed .brand-copy,
  html.sidebar-collapsed .tenant,
  html.sidebar-collapsed .who,
  html.sidebar-collapsed .nav-text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
  html.sidebar-collapsed img.crest {
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    min-height: 56px;
    max-height: 56px;
    flex: 0 0 56px;
  }
  html.sidebar-collapsed .brand-lockup { display: flex; align-items: center; padding-right: 0; }
  html.sidebar-collapsed .sidebar-logo { display: block; width: 120px; max-height: 132px; }
  html.sidebar-collapsed .sidebar-mark { display: none; }
  html.sidebar-collapsed .nav-icon { width: 22px; height: 22px; flex-basis: 22px; }
  html.sidebar-collapsed .nav a,
  html.sidebar-collapsed .foot-link,
  html.sidebar-collapsed .logout button { justify-content: flex-start; padding-inline: 0.55rem; }
  html.sidebar-collapsed .nav-label {
    height: auto;
    margin: 0.7rem 0.35rem 0.15rem;
    overflow: visible;
    border: 0;
    color: var(--gold);
    font-size: 0.62rem;
  }
}
@media (max-width: 640px) {
  .facts-4, .facts-3, .facts-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .facts-4, .facts-3, .facts-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .nav a:hover, .link-card:hover, button:hover, .action:hover, .foot-link:hover, .segmented a:hover, .rail-toggle:hover {
    transform: none;
  }
}

.dash-body {
  width: min(100%, 1204px);
  margin-inline: auto;
}
.dash-body .panel {
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.045), transparent 2.2rem),
    linear-gradient(180deg, #1a1612, #0e0c0a);
  border-color: rgba(184, 140, 60, 0.72);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.62), 0 12px 22px rgba(0, 0, 0, 0.42);
}
.dash-body .panel::before { content: none; }
.dash-body .section-head {
  position: relative;
  background: linear-gradient(180deg, rgba(42, 32, 20, 0.62), rgba(14, 12, 10, 0.15));
  border-bottom-color: rgba(212, 168, 84, 0.4);
}
.dash-body .command-emblem {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
}
.dash-body .command-major {
  overflow: hidden;
  border-color: rgba(212, 168, 84, 0.88);
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.9), rgba(8, 7, 6, 0.94)),
    url("/static/brand/ui/16_panel_background.png") center / 128% auto no-repeat;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.7), 0 16px 28px rgba(0, 0, 0, 0.48);
}
.dash-body .command-major .section-head { padding: 0.72rem 3.1rem 0.58rem; }
.dash-body .panel-corner {
  position: absolute;
  z-index: 2;
  width: 38px;
  height: 38px;
  object-fit: contain;
  pointer-events: none;
}
.dash-body .panel-corner-tl { top: 3px; left: 3px; }
.dash-body .panel-corner-tr { top: 3px; right: 3px; }
.dash-body .panel-corner-bl { bottom: 3px; left: 3px; }
.dash-body .panel-corner-br { bottom: 3px; right: 3px; }
.dash-body .header-tower {
  position: absolute;
  right: 48px;
  top: 50%;
  width: 34px;
  height: 42px;
  object-fit: contain;
  transform: translateY(-50%);
  opacity: 0.7;
  pointer-events: none;
}
.dash-body .gold-leaf {
  display: block;
  width: min(240px, 58%);
  height: auto;
  margin: 0.4rem auto 0.15rem;
  object-fit: contain;
  pointer-events: none;
}
.dash-body .keep-title {
  font-size: 1.7rem;
  color: var(--parchment);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}
.dash-body .facts { margin: 0.15rem 1.15rem 0.85rem; }
.dash-body .tile strong { max-width: 100%; overflow-wrap: anywhere; }
.dash-body .facts .tile:last-child strong { font-size: 0.95rem; line-height: 1.25; }
.dash-body .tile {
  gap: 0.2rem;
  padding: 0.7rem 0.45rem 0.75rem;
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.04), transparent 1.4rem),
    #0c0b09;
  border-color: rgba(184, 140, 60, 0.48);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 -12px 16px rgba(0, 0, 0, 0.35);
}
.dash-body .icon-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
}
.dash-body .tile-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.dash-body .troop-icon { width: 42px; height: 42px; }
.dash-body .tile-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(212, 168, 84, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a2c18, #120e0a);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.28);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1;
}
.dash-body .status-pip {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 6px rgba(183, 167, 143, 0.45);
}
.dash-body .status-pip.badge-ok { background: var(--emerald); box-shadow: 0 0 7px rgba(125, 206, 134, 0.55); }
.dash-body .status-pip.badge-idle { background: var(--ember); box-shadow: 0 0 7px rgba(208, 96, 76, 0.5); }
.dash-body .rule-thin {
  display: block;
  width: min(210px, 46%);
  height: 12px;
  margin: 0.2rem auto 0.45rem;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.dash-body .inset-empty {
  margin: 0.15rem 0.85rem 0.85rem;
  padding: 1.15rem 1rem 1.2rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(166, 124, 62, 0.38);
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(240, 210, 150, 0.08);
}
.dash-body .panel .inset-empty { background: rgba(0, 0, 0, 0.38); }
.dash-body .empty-emblem {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 0.4rem;
  object-fit: contain;
}
.dash-body .command-lower .empty-emblem { width: 32px; height: 32px; }
.dash-body .inset-empty h2 { font-size: 0.92rem; letter-spacing: 0.16em; }
.dash-body .inset-empty .empty-copy { max-width: 36rem; margin: 0.2rem auto 0; }
.dash-body .dash-split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.82fr); align-items: stretch; }
.dash-body .dash-split > .panel { height: 100%; margin-bottom: 0; }
.dash-body .access-grid { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); margin-bottom: 0.85rem; }
.dash-body .link-card {
  position: relative;
  min-height: 7.4rem;
  padding: 0.8rem 0.45rem;
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.05), transparent 1.6rem),
    linear-gradient(180deg, #1c1814, #0d0b09);
  border-color: rgba(184, 140, 60, 0.55);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.14), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 6px 12px rgba(0, 0, 0, 0.32);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.dash-body .link-card::before { content: none; }
.dash-body .link-card::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 1px;
  height: 14px;
  background: url("/static/brand/ui/19_glow_underbar.png") center / contain no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.dash-body .access-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.dash-body .link-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.24), 0 12px 16px rgba(0, 0, 0, 0.55), 0 14px 18px rgba(176, 104, 28, 0.32);
}
.dash-body .link-card:hover::after { opacity: 1; }
.dash-body .link-card:hover .access-icon { filter: brightness(1.16); }
.dash-body .link-card:hover strong,
.dash-body .link-card:hover span { color: var(--gold-bright); }
.dash-body .link-card:active { transform: translateY(-1px); }
.dash-body .command-lower {
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.32);
}
.dash-body .command-lower .stat-grid { margin-bottom: 0.85rem; }

@media (max-width: 860px) {
  .dash-body .dash-split { grid-template-columns: 1fr; }
  .dash-body .gold-leaf { width: min(168px, 54%); }
  .dash-body .panel-corner { width: 26px; height: 26px; }
  .dash-body .header-tower { display: none; }
  .dash-body .command-major .section-head { padding-inline: 1.7rem; }
  .dash-body .empty-emblem { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-body .link-card:hover,
  .dash-body .link-card:active { transform: none; }
}

.keep-page {
  width: min(100%, 1204px);
  margin-inline: auto;
}
.keep-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 96px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-gold);
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.05), transparent 1.6rem),
    linear-gradient(180deg, #1c1814, #0e0c0a);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.18), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 10px 18px rgba(0, 0, 0, 0.35);
}
.keep-head-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}
.keep-head-copy { min-width: 0; flex: 1; }
.keep-page .keep-name {
  margin: 0.08rem 0 0;
  font-size: 1.85rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--parchment);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  overflow-wrap: anywhere;
}
.keep-leaf {
  display: block;
  width: min(220px, 52%);
  height: auto;
  margin: 0.45rem auto 0.35rem;
  object-fit: contain;
  pointer-events: none;
}
.keep-page .switcher { margin: 0 0 0.7rem; }
.keep-dossier {
  position: relative;
  overflow: hidden;
  padding: 1.15rem 1rem 0.95rem;
  border: 1px solid rgba(212, 168, 84, 0.88);
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.92), rgba(8, 7, 6, 0.95)),
    url("/static/brand/ui/16_panel_background.png") center / 140% auto no-repeat;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.68), 0 16px 28px rgba(0, 0, 0, 0.42);
}
.keep-corner {
  position: absolute;
  z-index: 2;
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
}
.keep-corner-tl { top: 3px; left: 3px; }
.keep-corner-tr { top: 3px; right: 3px; }
.keep-corner-bl { bottom: 3px; left: 3px; }
.keep-corner-br { bottom: 3px; right: 3px; }
.keep-page .dossier-group { position: relative; z-index: 1; }
.keep-page .dossier-group h2 { margin: 0 0 0.55rem; padding-left: 0.15rem; }
.keep-rule {
  display: block;
  width: min(180px, 42%);
  height: 12px;
  margin: 0.7rem auto;
  object-fit: contain;
  pointer-events: none;
}
.keep-page .plate-row { display: grid; gap: 0.55rem; }
.keep-page .plate-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.keep-page .plate-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.keep-page .plate,
.keep-page .activity-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-height: 6.6rem;
  padding: 0.7rem 0.5rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.04), transparent 1.4rem),
    #0c0b09;
  border: 1px solid rgba(184, 140, 60, 0.48);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 -12px 16px rgba(0, 0, 0, 0.32);
}
.keep-page .plate > span:not(.badge):not(.icon-slot),
.keep-page .activity-plate div > span {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.keep-page .plate:hover,
.keep-page .activity-plate:hover {
  transform: none;
  border-color: rgba(184, 140, 60, 0.48);
}
.keep-page .plate strong,
.keep-page .activity-plate strong {
  max-width: 100%;
  font-family: var(--sans);
  font-size: 1.28rem;
  font-weight: 680;
  letter-spacing: 0;
  text-transform: none;
  color: var(--parchment);
  overflow-wrap: anywhere;
}
.keep-page .icon-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
}
.keep-page .plate-icon { width: 24px; height: 24px; object-fit: contain; }
.keep-page .troop-icon { width: 42px; height: 42px; }
.keep-page .plate-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(212, 168, 84, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a2c18, #120e0a);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.28);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}
.keep-page .activity-plate {
  flex-direction: row;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 4.6rem;
  padding-inline: 1rem;
  text-align: left;
}
.keep-page .activity-plate div { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.keep-page .activity-plate strong { font-size: 1.05rem; }
.keep-page .status-pip {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 6px rgba(183, 167, 143, 0.45);
}
.keep-page .status-pip.badge-ok { background: var(--emerald); box-shadow: 0 0 7px rgba(125, 206, 134, 0.55); }
.keep-page .status-pip.badge-idle { background: var(--ember); box-shadow: 0 0 7px rgba(208, 96, 76, 0.5); }
.keep-empty {
  padding: 1.3rem 1rem 1.35rem;
  text-align: center;
  border: 1px solid rgba(184, 140, 60, 0.72);
  background: linear-gradient(180deg, #1a1612, #0e0c0a);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.16), 0 12px 22px rgba(0, 0, 0, 0.38);
}
.keep-empty h1 {
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.keep-empty-mark {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 0.45rem;
  object-fit: contain;
}
.keep-empty .empty-copy { max-width: 36rem; margin: 0.15rem auto 0; }

@media (max-width: 860px) {
  .keep-page .plate-row-3 { grid-template-columns: 1fr 1fr; }
  .keep-page .plate-row-3 .plate:last-child { grid-column: 1 / -1; }
  .keep-leaf { width: min(150px, 48%); }
  .keep-corner { width: 22px; height: 22px; }
  .keep-head-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .keep-page .keep-name { font-size: 1.45rem; }
}
@media (max-width: 360px) {
  .keep-page .plate-row-3,
  .keep-page .plate-row-2 { grid-template-columns: 1fr; }
  .keep-page .plate-row-3 .plate:last-child { grid-column: auto; }
}

.stats-page {
  width: min(100%, 1204px);
  margin-inline: auto;
}
.stats-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 96px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line-gold);
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.05), transparent 1.6rem),
    linear-gradient(180deg, #1c1814, #0e0c0a);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.18), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 10px 18px rgba(0, 0, 0, 0.35);
}
.stats-head-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}
.stats-head-copy { min-width: 0; }
.stats-page .stats-head h1 {
  margin: 0.05rem 0 0;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: none;
}
.stats-keep {
  margin: 0.12rem 0 0;
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.stats-leaf {
  display: block;
  width: min(220px, 52%);
  height: auto;
  margin: 0.45rem auto 0.35rem;
  object-fit: contain;
  pointer-events: none;
}
.stats-page .switcher { margin: 0 0 0.7rem; }
.stats-dossier {
  position: relative;
  overflow: hidden;
  padding: 1.15rem 0.9rem 0.95rem;
  border: 1px solid rgba(212, 168, 84, 0.88);
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.92), rgba(8, 7, 6, 0.95)),
    url("/static/brand/ui/16_panel_background.png") center / 140% auto no-repeat;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.68), 0 16px 28px rgba(0, 0, 0, 0.42);
}
.stats-corner {
  position: absolute;
  z-index: 2;
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
}
.stats-corner-tl { top: 3px; left: 3px; }
.stats-corner-tr { top: 3px; right: 3px; }
.stats-corner-bl { bottom: 3px; left: 3px; }
.stats-corner-br { bottom: 3px; right: 3px; }
.stats-empty-copy,
.stats-empty {
  position: relative;
  z-index: 1;
  padding: 1.15rem 1rem 1.2rem;
  text-align: center;
}
.stats-empty {
  border: 1px solid rgba(184, 140, 60, 0.72);
  background: linear-gradient(180deg, #1a1612, #0e0c0a);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.16), 0 12px 22px rgba(0, 0, 0, 0.38);
}
.stats-empty h1,
.stats-empty-copy h2 {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.stats-empty h1 { font-size: 1.15rem; }
.stats-empty-mark {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.4rem;
  object-fit: contain;
}
.stats-rule {
  display: block;
  width: min(180px, 42%);
  height: 12px;
  margin: 0.45rem auto;
  object-fit: contain;
  pointer-events: none;
}
.stats-empty .empty-copy,
.stats-empty-copy .empty-copy { max-width: 36rem; margin: 0.15rem auto 0; }
.category-index {
  margin: 0.85rem auto 0;
  max-width: 40rem;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stats-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.15rem;
}
.summary-item {
  padding: 0.45rem 0.6rem 0.5rem;
  background: rgba(12, 11, 9, 0.82);
  border: 1px solid rgba(166, 124, 62, 0.4);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.08);
}
.summary-item span {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.summary-item strong {
  display: block;
  margin-top: 0.12rem;
  color: var(--parchment);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.summary-item em {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
}
.stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
}
.stats-page .family {
  min-width: 0;
  padding: 0.7rem 0.75rem 0.45rem;
  background: rgba(8, 7, 6, 0.62);
  border: 1px solid rgba(184, 140, 60, 0.42);
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.stats-page .family h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
}
.stats-page .family:hover,
.stats-page .summary-item:hover,
.stats-page .stats-row:hover {
  transform: none;
}
.stats-page .dragon-mark {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 1.3rem;
  border: 1px solid rgba(212, 168, 84, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a2c18, #120e0a);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}
.stats-page .family dl { margin: 0; }
.stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.8rem;
  align-items: baseline;
  padding: 0.34rem 0;
  border-bottom: 1px solid rgba(166, 124, 62, 0.28);
}
.stats-row:last-child { border-bottom: 0; }
.stats-row dt {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.stats-row dd {
  margin: 0;
  color: var(--parchment);
  font-size: 0.92rem;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.family-capacity .stats-row dd { font-size: 1.28rem; }
.family-empty { padding-bottom: 0.7rem; }
.family-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.family-other { grid-column: 1 / -1; }

@media (max-width: 860px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-leaf { width: min(150px, 48%); }
  .stats-corner { width: 22px; height: 22px; }
  .stats-head-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .stats-page .stats-head h1 { font-size: 1.35rem; }
  .family-other { grid-column: auto; }
}

.growth-lede { margin: 0 0 0.35rem; color: var(--parchment); }
.growth-periods { margin-top: 0.7rem; }
.growth-periods a, .growth-tab, .growth-card { min-height: 44px; }
.growth-panel {
  position: relative;
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.9rem 0.6rem;
  border: 1px solid rgba(184, 140, 60, 0.72);
  border-radius: 2px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.88), rgba(8, 7, 6, 0.94)),
    url("/static/brand/ui/16_panel_background.png") center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(240, 210, 150, 0.16), 0 12px 22px rgba(0, 0, 0, 0.42);
}
.growth-panel h2, .growth-card h2 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.growth-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.4rem; }
.growth-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid rgba(166, 124, 62, 0.45);
  border-bottom-width: 2px;
  border-radius: 2px;
  background: #120f0c;
  font-size: 0.82rem;
}
.growth-tab[aria-current="true"] {
  color: var(--gold-bright);
  border-color: var(--gold);
  border-bottom-color: var(--gold-bright);
  background: linear-gradient(180deg, #3a2c18, #1a140e);
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}
.growth-plot { position: relative; min-width: 0; }
.growth-canvas { position: relative; min-width: 0; }
.growth-svg { display: block; width: 100%; height: auto; }
.growth-axis, .growth-grid { stroke: rgba(198, 161, 90, 0.28); stroke-width: 1; }
.growth-tick { fill: #f1dfbd; font-size: 12px; font-family: inherit; }
.growth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--parchment);
  font-size: 0.78rem;
}
.growth-legend li { display: flex; align-items: center; gap: 0.35rem; }
.growth-legend span { width: 0.7rem; height: 0.7rem; border-radius: 99px; }
.growth-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 0.1rem;
  max-width: 16rem;
  width: max-content;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: #15120f;
  color: #f1dfbd;
  font-size: 0.78rem;
  pointer-events: none;
}
.growth-tooltip strong { color: var(--gold-bright); }
.growth-summary {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.growth-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.growth-empty { padding: 2.2rem 0.6rem; text-align: center; }
.growth-empty-title {
  margin: 0 0 0.35rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-weight: 700;
}
.growth-empty p, .growth-note { color: var(--parchment); }
.growth-lone { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.growth-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.growth-card {
  display: block;
  min-width: 0;
  padding: 0.7rem 0.75rem 0.8rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(166, 124, 62, 0.5);
  border-radius: 2px;
  background: #120f0c;
}
.growth-card[aria-current="true"] {
  border-color: var(--gold);
  border-bottom: 3px solid var(--gold-bright);
  background: linear-gradient(180deg, #3a2c18, #15120f 42%);
}
.growth-selected {
  margin: -0.35rem 0 0.35rem;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.growth-stat { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.75rem; }
.growth-value {
  margin: 0.1rem 0;
  color: var(--parchment);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.growth-delta { margin: 0; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.growth-note { margin: 0.25rem 0 0; font-size: 0.82rem; }
@media (max-width: 860px) {
  .growth-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .growth-cards { grid-template-columns: minmax(0, 1fr); }
  .growth-panel, .growth-card { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .growth-tab, .growth-card, .growth-svg { transition: none; animation: none; }
}
