@font-face {
  font-family: "Bramble Display";
  src: url("assets/BrambleGuard/Assets/Content/UI/Fonts/MacondoSwashCaps-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Bramble Text";
  src: url("assets/BrambleGuard/Assets/Content/UI/Fonts/NovaOval-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Bramble Description";
  src: url("assets/BrambleGuard/Assets/Content/UI/Fonts/BG_FontsToPick/MarckScript-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: dark;
  --bg: #0b1113;
  --bg-grid: rgba(130, 171, 153, 0.045);
  --sidebar: #0f1719;
  --surface: #131d1f;
  --surface-2: #182426;
  --surface-3: #1d2b2d;
  --line: #2a3b3d;
  --line-strong: #3c5252;
  --text: #ecf0e8;
  --muted: #9eaaa3;
  --faint: #6d7b76;
  --green: #75ba8b;
  --green-soft: rgba(117, 186, 139, 0.13);
  --gold: #e6b75d;
  --gold-soft: rgba(230, 183, 93, 0.13);
  --red: #e17865;
  --red-soft: rgba(225, 120, 101, 0.13);
  --blue: #73a9cb;
  --blue-soft: rgba(115, 169, 203, 0.13);
  --purple: #b697d5;
  --purple-soft: rgba(182, 151, 213, 0.13);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
  --radius: 12px;
  --sidebar-width: 292px;
  font-family: "Bramble Text", Georgia, serif;
}

html[data-theme="paper"] {
  color-scheme: light;
  --bg: #c7a576;
  --bg-grid: rgba(83, 54, 31, 0.045);
  --sidebar: #073943;
  --surface: rgba(248, 232, 200, 0.92);
  --surface-2: rgba(232, 204, 158, 0.88);
  --surface-3: rgba(211, 179, 130, 0.82);
  --line: rgba(92, 57, 31, 0.34);
  --line-strong: rgba(77, 42, 22, 0.62);
  --text: #3f2819;
  --muted: #6e513a;
  --faint: #876b51;
  --green: #0b6f6b;
  --green-soft: rgba(11, 111, 107, 0.12);
  --gold: #a56724;
  --gold-soft: rgba(165, 103, 36, 0.14);
  --red: #a5493b;
  --red-soft: rgba(165, 73, 59, 0.1);
  --blue: #376e91;
  --blue-soft: rgba(55, 110, 145, 0.1);
  --purple: #765598;
  --purple-soft: rgba(118, 85, 152, 0.1);
  --shadow: 0 18px 48px rgba(50, 29, 15, 0.24);
  --shadow-soft: 0 9px 22px rgba(50, 29, 15, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--text);
  font-family: "Bramble Text", Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
}

button,
input { font: inherit; }

button { color: inherit; }

a { color: var(--green); }

a:hover { color: var(--gold); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-weight: 700;
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--sidebar) 96%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px 21px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50% 44% 48% 44%;
  background: var(--green-soft);
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  transform: rotate(-3deg);
}

.brand-mark span { transform: rotate(3deg); }

.brand-mark i {
  position: absolute;
  right: -4px;
  top: 3px;
  width: 11px;
  height: 18px;
  border: 2px solid var(--green);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 100% 0 100%;
  transform: rotate(-24deg);
}

.brand strong,
.brand span { display: block; }

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
  border-radius: 9px;
  background: var(--green-soft);
}

.privacy-note strong,
.privacy-note small { display: block; }

.privacy-note strong { font-size: 13px; }
.privacy-note small { color: var(--muted); font-size: 12px; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

#primary-nav {
  display: grid;
  gap: 4px;
}

.nav-group-label {
  margin: 16px 10px 7px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-link {
  width: 100%;
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 3px 0 var(--green);
}

.nav-icon { color: var(--gold); font-size: 16px; }
.nav-count { color: var(--faint); font-size: 12px; }

.sidebar-footer {
  margin-top: auto;
  padding: 24px 10px 4px;
  color: var(--muted);
}

.sidebar-footer span,
.sidebar-footer strong,
.sidebar-footer small { display: block; }

.sidebar-footer span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-footer strong { margin: 4px 0; font-size: 13px; color: var(--text); }
.sidebar-footer small { font-size: 12px; }

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.search-wrap {
  width: min(660px, 100%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
}

.search-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.search-wrap input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-wrap input::placeholder { color: var(--faint); }

kbd {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.icon-button,
.text-button,
.filter-button,
.tab-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.text-button { padding: 8px 14px; }

.icon-button:hover,
.text-button:hover,
.filter-button:hover,
.tab-button:hover { border-color: var(--line-strong); background: var(--surface-2); }

.menu-button { display: none; }

.context-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.context-separator { margin: 0 8px; color: var(--faint); }
#search-status { color: var(--faint); text-align: right; }

#main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 38px clamp(20px, 4vw, 64px) 80px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 4px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.page-header p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.page-kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.snapshot-stamp {
  min-width: 170px;
  padding: 13px 15px;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
}

.snapshot-stamp span,
.snapshot-stamp strong { display: block; }
.snapshot-stamp span { color: var(--muted); font-size: 12px; }
.snapshot-stamp strong { margin-top: 3px; font-size: 14px; }

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 30px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -160px;
  width: 330px;
  height: 330px;
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
  border-radius: 52% 43% 57% 46%;
  transform: rotate(18deg);
  pointer-events: none;
}

.hero-quote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3.6vw, 43px);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.hero-quote em { color: var(--gold); font-style: normal; }

.hero-copy p { max-width: 780px; color: var(--muted); }

.loop-strip {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loop-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.loop-step:not(:last-child)::after { content: "→"; color: var(--gold); margin-left: 2px; }

.hero-side {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 12px;
}

.signal {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.signal > span { display: block; color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.signal strong { display: block; margin: 4px 0; font-size: 15px; }
.signal small { color: var(--muted); font-size: 13px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 34px;
}

.metric-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 31px;
  line-height: 1;
}

.metric-card span { display: block; font-size: 14px; font-weight: 700; }
.metric-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.section-block { margin-top: 38px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.section-heading p,
.section-heading span { margin: 0; color: var(--muted); font-size: 13px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.wiki-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.wiki-card:hover { border-color: var(--line-strong); }

.wiki-card h3,
.wiki-card h4 { margin: 0 0 8px; line-height: 1.25; }
.wiki-card h3 { font-size: 18px; }
.wiki-card h4 { font-size: 15px; }
.wiki-card p { margin: 0 0 10px; color: var(--muted); }
.wiki-card p:last-child { margin-bottom: 0; }

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.provenance,
.badge,
.status-badge,
.type-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.provenance,
.badge,
.type-chip { padding: 6px 8px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); }
.provenance.repo { color: var(--green); background: var(--green-soft); }
.provenance.chat { color: var(--purple); background: var(--purple-soft); }
.provenance.audit { color: var(--gold); background: var(--gold-soft); }

.status-badge { padding: 6px 9px; }
.status-badge.red, .status-badge.reported, .status-badge.rejected { color: var(--red); background: var(--red-soft); }
.status-badge.amber, .status-badge.in-line, .status-badge.pending { color: var(--gold); background: var(--gold-soft); }
.status-badge.green, .status-badge.confirmed, .status-badge.implemented { color: var(--green); background: var(--green-soft); }
.status-badge.blue, .status-badge.active { color: var(--blue); background: var(--blue-soft); }
.status-badge.grey, .status-badge.won-t-fix, .status-badge.notloaded { color: var(--muted); background: var(--surface-2); }

.bullet-list,
.check-list,
.source-list,
.plain-list { margin: 12px 0 0; padding: 0; list-style: none; }

.bullet-list li,
.check-list li,
.source-list li,
.plain-list li {
  position: relative;
  margin: 8px 0;
  padding-left: 18px;
  color: var(--muted);
}

.bullet-list li::before {
  content: "";
  position: absolute;
  top: 0.66em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.check-list li::before {
  content: "□";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 800;
}

.check-list li.done::before { content: "✓"; color: var(--green); }

.plain-list li { padding-left: 0; }

.callout {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--muted);
}

.callout strong { color: var(--text); }
.callout.danger { border-left-color: var(--red); background: var(--red-soft); }
.callout.good { border-left-color: var(--green); background: var(--green-soft); }
.callout.info { border-left-color: var(--blue); background: var(--blue-soft); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-button,
.tab-button {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.filter-button.active,
.tab-button.active {
  border-color: color-mix(in srgb, var(--green) 50%, var(--line));
  background: var(--green-soft);
  color: var(--green);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

.faction-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
}

.faction-list {
  display: grid;
  align-content: start;
  gap: 7px;
}

.faction-list .tab-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  text-align: left;
}

.faction-tab {
  display: grid !important;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 9px;
}

.faction-tab img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.faction-panel { min-width: 0; }

.faction-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.faction-title h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; }
.faction-title p { margin: 4px 0 0; color: var(--muted); }

.faction-heraldry {
  position: relative;
  min-height: 470px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #171b1c;
  box-shadow: var(--shadow);
}

.faction-banner-art {
  display: block;
  width: 100%;
  height: 470px;
  object-fit: cover;
  object-position: center;
}

.faction-heraldry::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 13, 14, 0.94) 0%, rgba(8, 13, 14, 0.76) 36%, rgba(8, 13, 14, 0.12) 72%);
}

.faction-heraldry-copy {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: min(570px, 72%);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 34px;
}

.faction-emblem {
  flex: 0 0 auto;
  width: 146px;
  height: 146px;
  border: 2px solid rgba(230, 183, 93, 0.62);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.faction-heraldry-copy h2 {
  margin: 5px 0 8px;
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.faction-heraldry-copy p { margin: 0 0 16px; color: #d8dfd9; }

.resource-pair { display: flex; gap: 7px; flex-wrap: wrap; }

.element-affinities {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 11px;
}

.element-affinity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-3) 88%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.element-affinity.primary {
  border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
  color: var(--text);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--gold) 8%, transparent);
}

.element-affinity img {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
}

.element-affinities.missing {
  padding: 8px 10px;
  border: 1px dashed rgba(216, 175, 94, 0.42);
  border-radius: 8px;
  color: var(--faint);
  font-size: 12px;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.branch-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.branch-card h4 { margin: 0 0 12px; color: var(--gold); }

.tier-line {
  position: relative;
  margin: 10px 0;
  padding-left: 18px;
}

.tier-line::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--green);
  transform: rotate(45deg);
}

.tier-line strong,
.tier-line span { display: block; }
.tier-line strong { font-size: 13px; }
.tier-line span { color: var(--muted); font-size: 12px; }

.mission-list { display: grid; gap: 9px; }

.mission-card {
  display: grid;
  grid-template-columns: 92px 54px minmax(190px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.mission-index { color: var(--gold); font-family: Georgia, serif; font-size: 25px; }
.mission-card h3 { margin: 0 0 5px; font-size: 17px; }
.mission-card p { margin: 0; color: var(--muted); font-size: 14px; }
.mission-outcome { margin-top: 7px !important; color: var(--text) !important; }
.mission-card > .record-visual,
.mission-card > .record-visual-missing { width: 92px; height: 92px; }
.mission-figure img { object-fit: cover; }

.coverage-note {
  margin: -2px 0 18px;
  padding: 11px 14px;
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: var(--green-soft);
  color: var(--muted);
  font-size: 14px;
}

.coverage-note.missing {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.coverage-state {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coverage-state.complete { color: var(--green); background: var(--green-soft); }
.coverage-state.missing { color: var(--gold); background: var(--gold-soft); }

.record-visual,
.record-visual-missing {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(117, 186, 139, 0.16), transparent 68%), #202627;
}

.record-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.record-visual-missing {
  min-height: 86px;
  padding: 10px;
  border-style: dashed;
  color: var(--faint);
  text-align: center;
}

.record-visual-missing span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 24px;
}

.record-visual-missing strong {
  display: block;
  font-size: 10px;
  line-height: 1.25;
}

.record-copy { padding: 15px; }
.record-copy h3 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 21px; }
.record-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.record-copy small { display: block; color: var(--faint); }

.unit-record-grid,
.record-card-grid,
.mount-record-grid,
.hero-role-grid,
.achievement-grid,
.deck-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.record-card-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.hero-role-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 16px; }

.hero-role-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(117, 186, 139, 0.1), transparent 60%), var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-role-card h3 { margin: 7px 0 9px; font-family: Georgia, serif; font-size: 21px; }
.hero-role-card p { min-height: 84px; margin: 0 0 13px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.unit-record-card,
.character-record-card,
.ability-record-card,
.mount-record-card,
.matter-record-card,
.consumable-record-card,
.achievement-record-card,
.deck-slot-card,
.overview-vessel-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.unit-record-card .record-visual,
.unit-record-card .record-visual-missing { height: 280px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.unit-record-copy { padding: 14px; }
.unit-record-copy h3 { margin: 5px 0 7px; font-family: Georgia, serif; font-size: 21px; }
.unit-record-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.unit-icon img { padding: 8px 8px 0; object-position: center bottom; }

.unit-required-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 5px 7px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.unit-required-item img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(54, 31, 15, 0.25));
}

.unit-required-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
}

.unit-required-item strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text);
  font-family: "Bramble Display", Georgia, serif;
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.mount-catalog-card .record-copy > p {
  display: -webkit-box;
  margin-bottom: 6px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mount-stat-list {
  display: grid;
  gap: 2px;
}

.mount-stat {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 1px 4px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  font-size: 9px;
  line-height: 1.05;
}

.mount-stat img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.mount-stat span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mount-stat strong {
  color: var(--text);
  font-family: "Bramble Display", Georgia, serif;
  font-size: 10px;
}

.character-record-card .record-visual,
.character-record-card .record-visual-missing,
.mount-record-card .record-visual,
.mount-record-card .record-visual-missing { height: 255px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.character-portrait img { object-position: center bottom; }
.mount-portrait img { object-fit: cover; object-position: center; }

.ability-record-card,
.consumable-record-card,
.matter-record-card,
.achievement-record-card,
.deck-slot-card { display: grid; grid-template-columns: 108px minmax(0, 1fr); }

.ability-record-card .record-visual,
.ability-record-card .record-visual-missing,
.consumable-record-card .record-visual,
.matter-record-card .record-visual,
.matter-record-card .record-visual-missing,
.achievement-record-card .record-visual,
.deck-slot-card .record-visual { min-height: 145px; border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.ability-icon img,
.consumable-icon img,
.achievement-icon img { padding: 10px; }

.achievement-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.achievement-record-card { grid-template-columns: 126px minmax(0, 1fr); }
.achievement-record-card .record-copy h3 { font-size: 19px; }

.overview-vessel-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1fr);
}

.overview-vessel-card .record-visual {
  min-height: 240px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.vessel-overview img { padding: 10px; }

.issue-list { display: grid; gap: 9px; }

.issue-row {
  display: grid;
  grid-template-columns: 110px minmax(150px, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.issue-id { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-weight: 700; }
.issue-row p { margin: 0; color: var(--muted); font-size: 13px; }
.issue-row .desired { color: var(--text); }

.chat-grid { display: grid; gap: 10px; }

.chat-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr) 100px;
  gap: 18px;
  align-items: start;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.chat-row h3 { margin: 0; font-size: 15px; }
.chat-row p { margin: 0; color: var(--muted); font-size: 13px; }
.chat-id { margin-top: 5px; color: var(--faint); font-family: ui-monospace, Consolas, monospace; font-size: 11px; }

.source-item {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr) auto;
  gap: 18px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.source-item:last-child { border-bottom: 0; }
.source-item strong { display: block; }
.source-item small { display: block; margin-top: 3px; color: var(--faint); }
.source-item p { margin: 0; color: var(--muted); font-size: 13px; }
.source-item a { font-size: 13px; font-weight: 700; text-decoration: none; }

.detail-panel {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

details summary {
  color: var(--green);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

details[open] summary { margin-bottom: 10px; }

.empty-state {
  padding: 50px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); font-family: Georgia, serif; font-size: 22px; }

.visual-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 26px;
}

.wiki-figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,0.035), rgba(0,0,0,0.12));
  box-shadow: var(--shadow-soft);
}

.wiki-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  background: #252a2c;
}

.wiki-figure.contain img,
.wiki-figure.wide-art img {
  object-fit: contain;
}

.wiki-figure.wide-art img {
  max-height: 680px;
  aspect-ratio: auto;
}

.wiki-figure.portrait-feature img {
  object-fit: contain;
  object-position: center 18%;
}

.wiki-figure figcaption {
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.faction-visuals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.fleet-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.fleet-card .wiki-figure {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.fleet-card .wiki-figure img {
  aspect-ratio: 1 / 1;
}

.fleet-copy { padding: 15px 17px 18px; }
.fleet-copy h3 { margin: 3px 0 7px; font-family: Georgia, serif; font-size: 22px; }
.fleet-copy p { margin: 0; color: var(--muted); }

.hero-roster-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.hero-visual-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-portrait {
  display: grid;
  place-items: center;
  height: 330px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 50% 38%, rgba(74, 167, 137, 0.16), transparent 64%), #202627;
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.hero-visual-copy { padding: 14px; }
.hero-visual-copy h3 { margin: 5px 0 10px; font-family: Georgia, serif; font-size: 21px; }

.hero-profile-stats {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.class-resource {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "Bramble Text", Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.class-resource strong {
  color: var(--text);
  font-size: 12px;
}

.stat-rail {
  display: grid;
  gap: 4px;
}

.stat-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 31px;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--muted);
  font-family: "Bramble Text", Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.stat-row strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stat-glyph {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.stat-glyph-sprite {
  background-image: url("assets/BrambleGuard/Assets/Content/UI/Icons/T_UI_SkillsStats.webp");
  background-repeat: no-repeat;
}

.stat-glyph-sprite.range {
  background-position: 99.84% 0.18%;
  background-size: 1007.63% 403.31%;
}

.hero-role-card .hero-profile-stats { margin-top: 0; }

.hero-class-roster {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.hero-class-row {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  min-width: 0;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-soft), inset 0 0 0 2px rgba(255, 247, 220, 0.2);
}

.hero-class-portraits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  border-right: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 38%, rgba(23, 121, 115, 0.18), transparent 62%),
    color-mix(in srgb, var(--surface-2) 70%, #233231);
}

.hero-class-portrait {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.hero-class-portrait + .hero-class-portrait { border-left: 1px solid var(--line); }

.hero-class-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 8px 8px 0;
  object-fit: contain;
  object-position: center bottom;
}

.hero-class-portrait figcaption {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(229, 188, 100, 0.42);
  border-radius: 4px;
  background: rgba(6, 42, 47, 0.86);
  color: #f5dfaa;
  font-family: "Bramble Text", Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.hero-class-copy {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 22px 26px;
}

.hero-class-copy h3 {
  margin: 5px 0 8px;
  font-family: "Bramble Text", Georgia, serif;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.05;
}

.hero-class-copy > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

.hero-class-copy .hero-profile-stats { margin-top: 4px; }
.hero-class-copy .stat-row { min-height: 33px; }

html[data-theme="night"] .hero-class-row {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(227, 187, 101, 0.04);
}

.section-intro {
  max-width: 850px;
  margin: -4px 0 18px;
  color: var(--muted);
}

.system-art-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.system-art-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.system-icon {
  display: grid;
  place-items: center;
  min-height: 150px;
  border-right: 1px solid var(--line);
  background: radial-gradient(circle at 50% 45%, rgba(74, 167, 137, 0.14), transparent 67%), #202627;
}

.system-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.system-art-copy { align-self: center; padding: 16px; }
.system-art-copy h3 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 22px; }
.system-art-copy p { margin: 0; color: var(--muted); }

.omen-banner img { max-height: 540px; }

.omen-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.omen-rule-card {
  min-width: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.omen-rule-visual {
  width: 100%;
  aspect-ratio: 5.45 / 1;
  margin: 0 0 15px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.3));
}

.omen-ascendance,
.omen-rootbound,
.omen-whispers {
  background-image: url("assets/BrambleGuard/Assets/Content/UI/FactionPortrait/Omen Banners - Wind Lightning Earth.webp");
  background-size: 109.5% auto;
  background-position-x: center;
}

.omen-ascendance { background-position-y: 56%; }
.omen-rootbound { background-position-y: 100%; }
.omen-whispers { background-position-y: 0; }

.omen-cinderwake,
.omen-deep {
  background-image: url("assets/BrambleGuard/Assets/Content/UI/FactionPortrait/FactionPortrait_Spritesheet_2048.webp");
  background-size: 178.7% auto;
  background-position-x: 93%;
}

.omen-cinderwake { background-position-y: 48%; }
.omen-deep { background-position-y: 31%; }

.omen-rule-card h3 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 21px; }
.omen-rule-card p { min-height: 70px; margin: 0 0 14px; color: var(--muted); }

.modifier-pair { display: flex; flex-wrap: wrap; gap: 7px; }
.modifier-pair span { padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.modifier-pair .favored { border: 1px solid rgba(74, 167, 137, 0.35); background: rgba(74, 167, 137, 0.12); color: var(--green); }
.modifier-pair .dimmed { border: 1px solid rgba(218, 119, 119, 0.32); background: rgba(218, 119, 119, 0.1); color: #da7777; }

.element-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.element-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.element-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 167, 137, 0.13), transparent 69%), #202627;
}

.element-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.element-card h3 { margin: 5px 0 7px; font-family: Georgia, serif; font-size: 20px; }
.element-card p { margin: 0; color: var(--muted); font-size: 14px; }
.element-card.omen-item { min-height: 155px; }

.world-layer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.world-layer-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.world-layer-card .record-visual {
  height: 290px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.world-layer-visual img { object-fit: cover; }
.world-layer-copy { padding: 17px; }
.world-layer-copy h3 { margin: 8px 0; font-family: Georgia, serif; font-size: 28px; }
.world-layer-copy > p { min-height: 90px; margin: 0; color: var(--muted); }

.layer-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  text-align: center;
}

.layer-flow span { color: var(--text); font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.layer-flow strong { color: var(--green); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

.multiplayer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: 30px;
  min-height: 440px;
  margin-bottom: 32px;
  padding: 38px 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at 78% 30%, rgba(74, 167, 137, 0.18), transparent 38%), linear-gradient(135deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

.multiplayer-hero > img {
  display: block;
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.38));
  transform: rotate(2deg);
}

.deck-slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.deck-slot-card { grid-template-columns: 126px minmax(0, 1fr); }
.deck-slot-card .record-copy h3 { font-size: 20px; }
.deck-slot-visual img { padding: 8px; }

.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.lifecycle-step {
  position: relative;
  min-width: 0;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lifecycle-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 2;
  right: -18px;
  top: 28px;
  width: 24px;
  color: var(--gold);
  text-align: center;
}

.lifecycle-step > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-family: Georgia, serif;
  font-weight: 700;
}

.lifecycle-step h3 { margin: 12px 0 6px; font-family: Georgia, serif; font-size: 20px; }
.lifecycle-step p { margin: 0; color: var(--muted); font-size: 13px; }

.family-intro { margin-top: 16px; }
.family-intro h2 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 30px; }

.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bestiary-card {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: 1fr;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.bestiary-portrait {
  display: grid;
  place-items: center;
  height: auto;
  min-height: 0;
  padding: 12px 0 12px 12px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: radial-gradient(circle at 50% 45%, rgba(74, 167, 137, 0.17), transparent 64%), #202627;
}

.bestiary-portrait img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.bestiary-portrait.square img {
  width: 100%;
  max-width: 100%;
  object-fit: contain;
}

.bestiary-portrait.missing {
  align-content: center;
  gap: 9px;
  padding: 12px;
  border: 0;
  border-right: 1px dashed rgba(216, 175, 94, 0.42);
  color: var(--faint);
  text-align: center;
}

.bestiary-portrait.missing span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1;
}

.bestiary-portrait.missing strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bestiary-copy {
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.bestiary-copy h3 { margin: 4px 0 6px; font-family: Georgia, serif; font-size: 24px; }
.bestiary-copy > .coverage-state { margin: 0 0 8px; }
.bestiary-copy > p { min-height: 0; margin: 0 0 9px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.bestiary-copy .signature-rule { margin-bottom: 9px; padding: 8px 10px; font-size: 13px; }
.bestiary-copy .detail-panel { margin-top: 8px; padding-top: 8px; }

.signature-rule {
  display: grid;
  gap: 3px;
  margin: 0 0 13px;
  padding: 11px 12px;
  border-left: 3px solid var(--green);
  background: rgba(74, 167, 137, 0.075);
  color: var(--muted);
  font-size: 14px;
}

.signature-rule strong { color: var(--text); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.stat-grid span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-grid strong { color: var(--text); font-size: 15px; letter-spacing: 0; }

.mobile-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.58);
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
}

[hidden],
.is-hidden { display: none !important; }

/* Current Bramble Guard compendium / HUD skin. */
.sidebar {
  padding: 18px 15px 16px;
  border-right: 3px solid #aa6e2e;
  background:
    radial-gradient(circle at 50% -8%, rgba(39, 155, 154, 0.28), transparent 34%),
    linear-gradient(180deg, #0b4f56 0%, #07343d 42%, #06272f 100%);
  color: #f6e7bf;
  box-shadow: inset -1px 0 rgba(255, 220, 147, 0.28), 12px 0 30px rgba(33, 20, 10, 0.28);
}

.brand {
  gap: 11px;
  padding: 0 6px 16px;
  border-bottom: 1px solid rgba(230, 183, 93, 0.38);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 0;
  background: none;
  transform: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.38));
}

.brand strong {
  color: #fff0c9;
  font-family: "Bramble Display", Georgia, serif;
  font-size: 21px;
  line-height: 1.05;
}

.brand span { color: #8ed0c7; font-size: 12px; }

.privacy-note {
  margin: 14px 2px 10px;
  border-color: rgba(225, 179, 88, 0.42);
  background: rgba(9, 35, 37, 0.45);
}

.privacy-note strong { color: #f4dfaa; }
.privacy-note small { color: #9dccca; }
.status-dot { background: #55c7a6; box-shadow: 0 0 0 4px rgba(85, 199, 166, 0.15); }
.nav-group-label { margin: 13px 10px 5px; color: #77aaa7; font-size: 12px; }

.nav-link {
  min-height: 52px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 5px;
  color: #c6d8d0;
  font-family: "Bramble Display", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.015em;
}

.nav-link:hover {
  border-color: rgba(227, 182, 92, 0.32);
  background: rgba(18, 77, 80, 0.74);
  color: #fff0c9;
}

.nav-link.active {
  border-color: transparent;
  background-color: transparent;
  background-image: url("assets/BrambleGuard/Assets/Content/UI/General/unatroButton_01.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #3d2618;
  box-shadow: none;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
}

.nav-icon img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.32));
}

.nav-count {
  min-width: 24px;
  padding: 3px 6px;
  border: 1px solid rgba(229, 188, 100, 0.34);
  border-radius: 999px;
  color: #e9cf94;
  font-family: "Bramble Text", Georgia, serif;
  font-size: 12px;
  text-align: center;
}

.nav-link.active .nav-count {
  border-color: rgba(72, 42, 22, 0.3);
  color: #5b3a24;
  background: rgba(255, 244, 214, 0.46);
}

.sidebar-footer { color: #93b4ae; }
.sidebar-footer span { color: #6f9d98; }
.sidebar-footer strong { color: #efd9a4; }

.workspace {
  min-height: 100vh;
  background-color: #d1b17f;
  background-image:
    linear-gradient(rgba(241, 220, 181, 0.28), rgba(214, 181, 130, 0.2)),
    url("assets/BrambleGuard/Assets/Content/UI/General/T_UI_WindowFill_Big.webp");
  background-position: center top;
  background-repeat: repeat-y;
  background-size: 100% auto;
}

html[data-theme="night"] .workspace {
  background-color: #0b1718;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(22, 104, 101, 0.2), transparent 35%),
    linear-gradient(180deg, #142425, #0b1214 72%);
}

.topbar {
  height: 70px;
  border-bottom: 3px solid #9e6429;
  background: linear-gradient(180deg, #0d5660, #073a43);
  color: #f5e2af;
  box-shadow: 0 5px 18px rgba(46, 27, 13, 0.24), inset 0 -1px rgba(255, 221, 148, 0.26);
}

.search-wrap {
  border: 1px solid #b57938;
  border-radius: 4px;
  background: rgba(250, 232, 194, 0.96);
  color: #80552e;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.66), 0 3px 8px rgba(0, 0, 0, 0.18);
}

.search-wrap:focus-within {
  border-color: #e4bb65;
  box-shadow: 0 0 0 3px rgba(228, 187, 101, 0.25);
}

.search-wrap input { color: #3d281a; font-size: 16px; }
.search-wrap input::placeholder { color: #82684f; }
.topbar kbd { border-color: rgba(73, 44, 24, 0.32); color: #78583b; }

.topbar .icon-button,
.topbar .text-button {
  border-color: #b37a3a;
  border-radius: 4px;
  background: linear-gradient(#f2d79f, #c89455);
  color: #432919;
  font-family: "Bramble Display", Georgia, serif;
  font-weight: 800;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.55), 0 3px 7px rgba(0, 0, 0, 0.22);
}

.context-bar {
  min-height: 44px;
  border-bottom: 1px solid #9e6429;
  background: rgba(7, 48, 55, 0.94);
  color: #a8c9c3;
}

.eyebrow { color: #e7bd65; font-family: "Bramble Display", Georgia, serif; font-size: 13px; }
.context-separator { color: #628f8b; }
.context-bar strong { color: #f1ddb0; }

#main { padding-top: 30px; }

.page-header {
  position: relative;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 132px;
  padding: 18px 20px;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 3px rgba(255, 247, 220, 0.3);
}

.page-header::before,
.section-heading::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  background: var(--green);
  transform: translateX(-50%) rotate(45deg);
}

.page-header::before { bottom: -9px; }

.page-header-icon {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 7px 6px rgba(53, 31, 16, 0.34));
}

h1,
h2,
.page-header h1,
.section-heading h2,
.hero-quote,
.faction-heraldry-copy h2,
.faction-title h2,
.record-copy h3,
.unit-record-copy h3,
.hero-visual-copy h3,
.hero-role-card h3,
.bestiary-copy h3,
.element-card h3,
h3,
h4,
h5,
h6,
.wiki-card h3,
.wiki-card h4 {
  font-family: "Bramble Display", Georgia, serif;
}

.page-header h1 { color: var(--green); letter-spacing: -0.02em; }
.page-header p { color: var(--muted); font-size: 17px; line-height: 1.45; }
.page-kicker { color: var(--gold); font-size: 13px; }

.snapshot-stamp {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 4px;
  background: var(--gold-soft);
}

.section-heading {
  position: relative;
  padding: 0 4px 9px;
  border-bottom: 2px solid color-mix(in srgb, var(--green) 58%, var(--line));
}

.section-heading::before { bottom: -8px; width: 10px; height: 10px; }
.section-heading h2 { color: var(--green); }

.wiki-card,
.metric-card,
.hero-panel,
.branch-card,
.table-wrap,
.unit-record-card,
.character-record-card,
.mount-record-card,
.ability-record-card,
.consumable-record-card,
.matter-record-card,
.achievement-record-card,
.deck-slot-card,
.hero-role-card,
.hero-visual-card,
.fleet-card,
.overview-vessel-card,
.world-layer-card,
.system-art-card,
.omen-card,
.element-card,
.mission-card,
.bestiary-card {
  border-color: var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-soft), inset 0 0 0 2px rgba(255, 247, 220, 0.2);
}

.wiki-card:hover,
.metric-card:hover,
.hero-visual-card:hover,
.bestiary-card:hover {
  border-color: color-mix(in srgb, var(--gold) 72%, var(--line));
}

.topic-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.topic-card-icon {
  display: block;
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(55, 31, 14, 0.28));
}

.metric-card strong { color: var(--green); font-family: "Bramble Display", Georgia, serif; }

.hero-panel {
  border-width: 2px;
  background:
    linear-gradient(115deg, rgba(7, 69, 73, 0.97), rgba(6, 39, 45, 0.96)),
    var(--surface);
  color: #f6e8c2;
}

.hero-panel .page-kicker { color: #e8bd64; }
.hero-panel p,
.hero-panel .hero-copy p,
.hero-panel .signal small { color: #b8d1ca; }
.hero-quote em { color: #f1c875; }
.signal { border-color: rgba(229, 185, 92, 0.34); background: rgba(4, 32, 36, 0.44); }

.icon-button,
.text-button,
.filter-button,
.tab-button {
  border-color: var(--line-strong);
  border-radius: 4px;
  font-family: "Bramble Display", Georgia, serif;
}

.text-button,
.filter-button,
.tab-button {
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 88%, #18332e), color-mix(in srgb, var(--green) 74%, #102b28));
  color: #f7e8bd;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 2px 5px rgba(48, 28, 14, 0.18);
}

.filter-button:hover,
.tab-button:hover,
.text-button:hover,
.filter-button.active,
.tab-button.active {
  border-color: color-mix(in srgb, var(--gold) 72%, var(--line));
  background: linear-gradient(180deg, #f1d397, #c68b4a);
  color: #432919;
}

.provenance,
.badge,
.type-chip,
.status-badge,
.coverage-state,
.element-affinity {
  border-color: var(--line);
  border-radius: 4px;
  font-family: "Bramble Text", Georgia, serif;
  font-size: 12px;
}

.table-wrap th { background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green); font-size: 12px; }
tbody tr:hover { background: var(--green-soft); }

.record-visual,
.hero-portrait,
.bestiary-portrait,
.fleet-card figure,
.visual-gallery figure {
  background:
    radial-gradient(circle at 50% 45%, rgba(23, 121, 115, 0.18), transparent 62%),
    color-mix(in srgb, var(--surface-2) 70%, #233231);
}

.hero-portrait,
.bestiary-portrait { border-color: var(--line-strong); }
.bestiary-copy .signature-rule,
.signature-rule { border-left-color: var(--green); background: var(--green-soft); }
.detail-panel summary { color: var(--green); }

.element-affinity {
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  color: var(--muted);
}

.element-affinity.primary {
  border-color: color-mix(in srgb, var(--gold) 74%, var(--line));
  background: color-mix(in srgb, var(--gold-soft) 68%, var(--surface));
  color: var(--text);
}

.faction-castle-icon {
  position: absolute;
  right: 1.5%;
  bottom: -3%;
  z-index: 1;
  width: min(47%, 500px);
  height: 88%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.5));
}

.faction-heraldry-copy { z-index: 2; }

.tier-line.has-icon {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding-left: 0;
}

.tier-line.has-icon::before { display: none; }

.structure-icon {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(54, 31, 15, 0.25));
}

/* Unified illustrated encyclopedia grid: three square records, art left, data right. */
.card-grid,
.card-grid.two,
.card-grid.four,
.unit-record-grid,
.record-card-grid,
.record-card-grid.compact,
.mount-record-grid,
.hero-role-grid,
.hero-roster-grid,
.achievement-grid,
.deck-slot-grid,
.visual-gallery,
.faction-visuals,
.fleet-grid,
.system-art-grid,
.omen-rule-grid,
.element-grid,
.world-layer-grid,
.bestiary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

:is(
  .bestiary-card,
  .unit-record-card,
  .character-record-card,
  .ability-record-card,
  .mount-record-card,
  .matter-record-card,
  .consumable-record-card,
  .achievement-record-card,
  .deck-slot-card,
  .overview-vessel-card,
  .hero-visual-card,
  .fleet-card,
  .system-art-card,
  .omen-rule-card,
  .element-card,
  .world-layer-card
) {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.card-grid .topic-card {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
}

.card-grid .topic-card-icon {
  width: 100%;
  height: 100%;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: radial-gradient(circle at 50% 45%, rgba(23, 121, 115, 0.18), transparent 62%), color-mix(in srgb, var(--surface-2) 70%, #233231);
}

.card-grid .topic-card > div {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

:is(
  .unit-record-card,
  .character-record-card,
  .ability-record-card,
  .mount-record-card,
  .matter-record-card,
  .consumable-record-card,
  .achievement-record-card,
  .deck-slot-card,
  .overview-vessel-card,
  .world-layer-card
) > :is(.record-visual, .record-visual-missing) {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px 0 8px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.hero-portrait,
.system-icon,
.element-icon,
.omen-rule-visual {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.hero-portrait { border-bottom: 0; }

.fleet-card .wiki-figure {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.fleet-card .wiki-figure img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  padding: 8px;
  object-fit: contain;
}

.fleet-card .wiki-figure figcaption { display: none; }

.omen-rule-visual {
  background-color: #202627;
  background-position-x: center;
}

.element-icon img { padding: 18px; }

:is(
  .bestiary-copy,
  .unit-record-copy,
  .record-copy,
  .hero-visual-copy,
  .fleet-copy,
  .system-art-copy,
  .omen-rule-copy,
  .world-layer-copy,
  .element-card > div:last-child
) {
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  padding: 12px;
  overflow: hidden;
}

:is(
  .bestiary-copy,
  .unit-record-copy,
  .record-copy,
  .hero-visual-copy,
  .fleet-copy,
  .system-art-copy,
  .omen-rule-copy,
  .world-layer-copy,
  .element-card > div:last-child,
  .card-grid .topic-card > div
) h3 {
  margin: 3px 0 6px;
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.08;
}

:is(
  .bestiary-copy,
  .unit-record-copy,
  .record-copy,
  .hero-visual-copy,
  .fleet-copy,
  .system-art-copy,
  .omen-rule-copy,
  .world-layer-copy,
  .element-card > div:last-child,
  .card-grid .topic-card > div
) p {
  min-height: 0;
  margin: 0 0 7px;
  font-size: 13px;
  line-height: 1.32;
}

:is(
  .bestiary-card,
  .unit-record-card,
  .character-record-card,
  .ability-record-card,
  .mount-record-card,
  .consumable-record-card,
  .achievement-record-card,
  .deck-slot-card,
  .hero-visual-card,
  .system-art-card,
  .omen-rule-card,
  .element-card,
  .world-layer-card
) :is(.page-kicker, .badge, .type-chip, .coverage-state, small) {
  font-size: 12px;
}

:is(
  .bestiary-card,
  .unit-record-card,
  .character-record-card,
  .mount-record-card,
  .hero-visual-card
) .element-affinities {
  gap: 4px;
  margin: 4px 0 6px;
}

:is(
  .bestiary-card,
  .unit-record-card,
  .character-record-card,
  .mount-record-card,
  .hero-visual-card
) .element-affinity {
  gap: 3px;
  padding: 2px 5px 2px 3px;
  font-size: 12px;
}

:is(
  .bestiary-card,
  .unit-record-card,
  .character-record-card,
  .mount-record-card,
  .hero-visual-card
) .element-affinity img {
  width: 24px;
  height: 24px;
}

.bestiary-copy {
  overflow: hidden;
  scrollbar-width: none;
}

.bestiary-copy > .coverage-state { margin: 0 0 6px; }
.bestiary-copy > p { margin-bottom: 7px; font-size: 13px; line-height: 1.3; }
.bestiary-copy .signature-rule { margin-bottom: 6px; padding: 6px 8px; font-size: 12px; line-height: 1.25; }
.bestiary-copy .detail-panel { margin-top: 6px; padding-top: 6px; }
.bestiary-copy .resource-pair { gap: 4px; }
.bestiary-copy .card-topline { flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }

.world-layer-copy > p { min-height: 0; }
.world-layer-copy .signature-rule { margin-bottom: 0; padding: 7px 8px; font-size: 12px; line-height: 1.25; }

/* Equipment catalogue: the same square, left-art/right-data language as the bestiary. */
.equipment-filters {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.equipment-filters .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.equipment-record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.equipment-record-card {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: minmax(0, 1fr);
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.equipment-record-card > :is(.record-visual, .record-visual-missing) {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: radial-gradient(circle at 50% 44%, rgba(24, 126, 119, 0.2), transparent 62%), color-mix(in srgb, var(--surface-2) 76%, #25302e);
}

.equipment-record-card .equipment-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(35, 20, 11, 0.28));
  transform: scale(1.08);
}

.equipment-record-card .record-copy {
  min-width: 0;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
}

.equipment-record-card .record-copy h3 {
  margin: 2px 0 4px;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1;
}

.equipment-record-card .page-kicker { font-size: 9px; line-height: 1.05; }
.equipment-record-card .element-affinities { gap: 3px; margin: 2px 0 4px; }
.equipment-record-card .element-affinity { gap: 2px; padding: 1px 4px 1px 2px; font-size: 9px; }
.equipment-record-card .element-affinity img { width: 18px; height: 18px; }

.equipment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 4px;
}

.equipment-tags .badge { padding: 2px 5px; font-size: 9px; }

.equipment-stat-list {
  display: grid;
  gap: 3px;
}

.equipment-stat {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  font-size: 9px;
  line-height: 1.05;
}

.equipment-stat img { width: 18px; height: 18px; object-fit: contain; }
.equipment-stat span { min-width: 0; color: var(--muted); }
.equipment-stat strong { color: var(--text); font-family: "Bramble Display", Georgia, serif; font-size: 10px; }
.equipment-stat.native { border-color: color-mix(in srgb, var(--gold) 52%, var(--line)); }
.equipment-stat.native span { color: color-mix(in srgb, var(--gold) 72%, var(--text)); }

.equipment-adventure {
  display: grid;
  gap: 1px;
  margin-top: 3px;
  padding: 3px 5px;
  border-left: 3px solid var(--green);
  background: color-mix(in srgb, var(--green-soft) 72%, transparent);
  font-size: 9px;
  line-height: 1.12;
}

.equipment-adventure strong { color: var(--green); font-size: 9px; }
.equipment-adventure span { color: var(--muted); }

.skill-record-grid,
.perk-record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.skill-record-card,
.perk-record-card {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: minmax(0, 1fr);
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-soft), inset 0 0 0 2px rgba(255, 247, 220, 0.2);
}

:is(.skill-record-card, .perk-record-card) > :is(.record-visual, .record-visual-missing) {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: radial-gradient(circle at 50% 45%, rgba(24, 126, 119, 0.2), transparent 62%), color-mix(in srgb, var(--surface-2) 76%, #25302e);
}

:is(.skill-record-card, .perk-record-card) .record-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.12);
  filter: drop-shadow(0 10px 10px rgba(35, 20, 11, 0.3));
}

:is(.skill-record-card, .perk-record-card) .record-copy {
  min-width: 0;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
}

:is(.skill-record-card, .perk-record-card) .record-copy h3 {
  margin: 2px 0 4px;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1;
}

:is(.skill-record-card, .perk-record-card) .page-kicker { display: block; overflow: hidden; font-size: 8px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
:is(.skill-record-card, .perk-record-card) .element-affinities { gap: 3px; margin: 2px 0 4px; }
:is(.skill-record-card, .perk-record-card) .element-affinity { gap: 2px; padding: 1px 4px 1px 2px; font-size: 9px; }
:is(.skill-record-card, .perk-record-card) .element-affinity img { width: 18px; height: 18px; }

:is(.skill-record-card, .perk-record-card) .record-copy > p {
  display: -webkit-box;
  margin: 3px 0 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.perk-record-card .record-copy > p { -webkit-line-clamp: 6; }

.skill-tag-line {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--gold);
  font-size: 8px;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.skill-fact-list {
  display: grid;
  gap: 2px;
}

.skill-fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  font-size: 9px;
  line-height: 1.08;
}

.skill-fact span { min-width: 0; color: var(--muted); }
.skill-fact strong { color: var(--text); font-family: "Bramble Display", Georgia, serif; font-size: 9px; text-align: right; }
:is(.skill-record-card, .perk-record-card) .record-copy > small { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; line-height: 1.1; }

.visual-gallery .wiki-figure {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: minmax(0, 1fr);
  aspect-ratio: 1;
}

.visual-gallery .wiki-figure img,
.visual-gallery .wiki-figure.wide-art img {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  padding: 8px;
  border-right: 1px solid var(--line);
  object-fit: contain;
}

.visual-gallery .wiki-figure figcaption {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border-top: 0;
  font-size: 13px;
}

html[data-theme="night"] .page-header h1,
html[data-theme="night"] .section-heading h2 { color: #79c4b7; }

html[data-theme="night"] .page-header,
html[data-theme="night"] .wiki-card,
html[data-theme="night"] .metric-card,
html[data-theme="night"] .branch-card,
html[data-theme="night"] .table-wrap,
html[data-theme="night"] .unit-record-card,
html[data-theme="night"] .character-record-card,
html[data-theme="night"] .mount-record-card,
html[data-theme="night"] .hero-role-card,
html[data-theme="night"] .hero-visual-card,
html[data-theme="night"] .bestiary-card { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(227, 187, 101, 0.04); }

/* Project typography hierarchy: display titles, readable interface/body text,
   and handwriting reserved for deliberately oversized quotations. */
.page-header h1,
.section-heading h2,
.faction-heraldry-copy h2,
.faction-title h2,
.family-intro h2,
.brand strong {
  font-family: "Bramble Display", Georgia, serif;
  font-weight: 400;
}

.wiki-card h3,
.wiki-card h4,
.metric-card strong,
.record-copy h3,
.unit-record-copy h3,
.hero-visual-copy h3,
.hero-role-card h3,
.bestiary-copy h3,
.fleet-copy h3,
.system-art-copy h3,
.omen-rule-card h3,
.element-card h3,
.world-layer-copy h3,
.lifecycle-step h3,
.empty-state strong,
.page-kicker,
.nav-link,
.nav-group-label,
.privacy-note,
.snapshot-stamp,
.badge,
.type-chip,
.status-badge,
.coverage-state,
.element-affinity,
.class-resource,
.stat-row,
.filter-button,
.tab-button,
.text-button,
.icon-button,
th,
td,
summary,
input,
kbd {
  font-family: "Bramble Text", Georgia, serif;
  font-weight: 400;
}

p,
li,
blockquote,
figcaption,
.section-intro,
.coverage-note,
.signature-rule span,
.tier-line span,
.signal small,
.empty-state,
.chat-row p,
.source-item p {
  font-family: "Bramble Text", Georgia, serif;
  font-weight: 400;
}

.hero-quote {
  font-family: "Bramble Description", "Segoe Print", cursive;
  font-weight: 400;
}

.filter-button.faction-locked,
.tab-button.faction-locked {
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--surface-2) 72%, #777);
  color: var(--faint);
  box-shadow: none;
  filter: grayscale(1);
  opacity: 0.48;
}

.filter-button.faction-locked {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.filter-button.faction-locked small,
.tab-button.faction-locked span:last-child {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-button.faction-locked:hover,
.tab-button.faction-locked:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 62%, #8b8172);
  color: var(--muted);
  filter: grayscale(0.72);
  opacity: 0.7;
}

.faction-tba-shell {
  min-height: min(58vh, 620px);
  display: grid;
  place-items: center;
}

.faction-tba-card {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 5vw, 52px);
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, #777);
  box-shadow: var(--shadow);
}

.faction-tba-card > img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.42;
}

.faction-tba-card h2 { margin: 4px 0 10px; }
.faction-tba-card p { margin: 0 0 22px; color: var(--muted); }

/* Official community calls to action */
.community-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: -4px 0 24px;
}

.community-button {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(45, 27, 14, 0.25), inset 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.community-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 38%, rgba(255, 255, 255, 0.07));
}

.community-button.steam { background: linear-gradient(135deg, #182f46, #0b1825 72%); }
.community-button.discord { background: linear-gradient(135deg, #6673f2, #3946ad 72%); }

.community-button:hover,
.community-button:focus-visible {
  transform: translateY(-2px);
  border-color: #f0c66d;
  box-shadow: 0 11px 22px rgba(45, 27, 14, 0.31), 0 0 0 3px rgba(240, 198, 109, 0.18);
}

.community-button:focus-visible { outline: 0; }

.community-mark {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.community-mark img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.community-button > span { position: relative; z-index: 1; }
.community-button small,
.community-button strong { display: block; }
.community-button small { margin-bottom: 4px; color: rgba(255, 255, 255, 0.72); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.community-button strong { color: #fff; font-family: "Bramble Display", Georgia, serif; font-size: clamp(17px, 2vw, 22px); }
.community-arrow { font-size: 28px; color: #f0c66d; }

/* Player-facing setup manuals */
.manual-section { scroll-margin-top: 92px; }

.manual-steps {
  counter-reset: manual-step;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manual-steps li {
  counter-increment: manual-step;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 94%, var(--gold-soft));
  box-shadow: var(--shadow-soft);
}

.manual-steps li > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, var(--line));
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-soft), var(--surface-2));
  color: var(--gold);
  font-family: "Bramble Display", Georgia, serif;
  font-size: 18px;
  font-weight: 900;
}

.manual-steps strong {
  display: block;
  margin: 2px 0 5px;
  color: var(--text);
  font-family: "Bramble Display", Georgia, serif;
  font-size: 18px;
}

.manual-steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Shared copyright footer */
.workspace { display: flex; flex-direction: column; }
#main { flex: 1 0 auto; }

.site-footer {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 5px clamp(20px, 4vw, 64px);
  border-top: 2px solid #9e6429;
  background: linear-gradient(180deg, #0b4249, #082e34);
  color: #bdd3cd;
  box-shadow: inset 0 1px rgba(255, 221, 148, 0.2);
  font-size: 12px;
}

.site-footer p { margin: 0; color: #bdd3cd; }
.site-footer a {
  color: #f4ddb0;
  font-family: "Bramble Display", Georgia, serif;
  font-weight: 800;
  text-decoration: none;
}
.site-footer a:hover,
.site-footer a:focus-visible { color: #fff1c9; text-decoration: underline; }
.footer-edition { color: #8eb0aa; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

/* Portrait crop: fill tall catalogue frames and favour the face/upper body over empty canvas. */
.hero-class-portrait,
.hero-portrait,
.bestiary-portrait:not(.missing),
:is(.unit-record-card, .character-record-card, .mount-record-card) > :is(.unit-icon, .character-portrait, .mount-portrait) {
  padding: 0;
  overflow: hidden;
}

:is(
  .hero-class-portrait,
  .hero-portrait,
  .bestiary-portrait,
  .unit-icon,
  .character-portrait,
  .mount-portrait
) img,
.bestiary-portrait.square img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
  object-position: center bottom;
  transform: scale(1.06);
  transform-origin: center bottom;
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bestiary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .system-art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omen-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .element-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .unit-record-grid,
  .record-card-grid,
  .record-card-grid.compact,
  .hero-role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mount-record-grid,
  .skill-record-grid,
  .perk-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement-grid,
  .deck-slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lifecycle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lifecycle-step:nth-child(3)::after { display: none; }
}

@media (max-width: 880px) {
  .app-shell { display: block; }
  .workspace { grid-column: auto; }
  .sidebar {
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: grid; }
  .page-header { grid-template-columns: 1fr; align-items: start; }
  .snapshot-stamp { width: fit-content; }
  .hero-panel { grid-template-columns: 1fr; }
  .faction-layout { grid-template-columns: 1fr; }
  .faction-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .faction-list .faction-tab { display: grid; grid-template-columns: 30px 1fr; text-align: left; }
  .faction-list .tab-button span:last-child { display: none; }
  .mission-card { grid-template-columns: 86px 1fr; }
  .mission-card > .record-visual,
  .mission-card > .record-visual-missing { grid-column: 1; grid-row: 1 / 4; align-self: stretch; width: 86px; height: 100%; min-height: 112px; }
  .mission-card > .mission-index,
  .mission-card > div:nth-child(3),
  .mission-card > div:last-child { grid-column: 2; }
  .issue-row { grid-template-columns: 100px 1fr; }
  .issue-row > :nth-child(3), .issue-row > :nth-child(4) { grid-column: 1 / -1; }
  .chat-row { grid-template-columns: 1fr auto; }
  .chat-row > p { grid-column: 1 / -1; grid-row: 2; }
  .source-item { grid-template-columns: 1fr auto; }
  .source-item p { grid-column: 1 / -1; }
  .fleet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omen-rule-grid,
  .element-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-record-grid,
  .record-card-grid,
  .record-card-grid.compact,
  .mount-record-grid,
  .hero-role-grid,
  .world-layer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-record-grid,
  .skill-record-grid,
  .perk-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .multiplayer-hero { grid-template-columns: minmax(0, 1fr) 220px; padding: 30px; }
  .lifecycle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lifecycle-step:nth-child(2)::after,
  .lifecycle-step:nth-child(4)::after { display: none; }
  .lifecycle-step:nth-child(3)::after { display: block; }
  .hero-class-row { grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr); }
  .manual-steps { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 12px; }
  .text-button { display: none; }
  .search-wrap kbd { display: none; }
  .context-bar { padding: 0 16px; }
  .eyebrow, .context-separator { display: none; }
  #main { padding: 25px 14px 60px; }
  .equipment-record-grid,
  .skill-record-grid,
  .perk-record-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 36px; }
  .metric-grid,
  .card-grid,
  .card-grid.two,
  .card-grid.four,
  .branch-grid { grid-template-columns: 1fr; }
  .fleet-grid,
  .bestiary-grid,
  .hero-roster-grid,
  .system-art-grid,
  .omen-rule-grid,
  .element-grid,
  .visual-gallery,
  .faction-visuals { grid-template-columns: 1fr; }
  .unit-record-grid,
  .record-card-grid,
  .record-card-grid.compact,
  .mount-record-grid,
  .hero-role-grid,
  .achievement-grid,
  .deck-slot-grid,
  .world-layer-grid,
  .lifecycle-grid { grid-template-columns: 1fr; }
  .faction-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faction-heraldry { min-height: 560px; }
  .faction-banner-art { height: 560px; }
  .faction-heraldry::after { background: linear-gradient(0deg, rgba(8, 13, 14, 0.97) 0%, rgba(8, 13, 14, 0.75) 62%, rgba(8, 13, 14, 0.12) 100%); }
  .faction-heraldry-copy { inset: auto 0 0; width: 100%; display: block; padding: 22px; }
  .faction-castle-icon { right: -7%; bottom: 33%; width: 68%; height: 52%; opacity: 0.92; }
  .faction-emblem { width: 94px; height: 94px; margin-bottom: 14px; }
  .mission-card { grid-template-columns: 74px 1fr; padding: 14px; }
  .layer-flow { grid-template-columns: 1fr; }
  .multiplayer-hero { grid-template-columns: 1fr; padding: 24px; }
  .multiplayer-hero > img { width: 180px; margin: 0 auto; }
  .lifecycle-step::after { display: none !important; }
  .ability-record-card,
  .consumable-record-card,
  .matter-record-card,
  .achievement-record-card,
  .deck-slot-card { grid-template-columns: 50% 50%; }
  .overview-vessel-card { grid-template-columns: 50% 50%; }
  .overview-vessel-card .record-visual { min-height: 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .issue-row { grid-template-columns: 1fr; }
  .issue-row > * { grid-column: auto !important; }
  .chat-row { grid-template-columns: 1fr; }
  .chat-row > p { grid-column: auto; grid-row: auto; }
  .source-item { grid-template-columns: 1fr; }
  .source-item p { grid-column: auto; }
  .hero-class-row {
    grid-template-columns: 1fr;
    grid-template-rows: 330px auto;
  }
  .hero-class-portraits {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }
  .hero-class-copy { padding: 18px; }
  .faction-tba-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .faction-tba-card > img {
    width: min(170px, 60%);
    margin: 0 auto;
  }
  .faction-tba-card .text-button { display: inline-flex; }
  .community-actions { grid-template-columns: 1fr; }
  .community-button { grid-template-columns: 46px minmax(0, 1fr) auto; min-height: 82px; padding: 13px 14px; gap: 12px; }
  .community-mark { width: 46px; height: 46px; }
  .community-mark img { width: 26px; height: 26px; }
  .manual-steps li { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; gap: 11px; }
  .manual-steps li > span { width: 40px; height: 40px; font-size: 16px; }
  .site-footer { min-height: 36px; gap: 8px; padding-block: 5px; }
  .site-footer p span:last-child { display: none; }
  .footer-edition { font-size: 9px; }
}

@media print {
  :root, html[data-theme="paper"] { color-scheme: light; }
  body { background: white; color: #111; }
  .sidebar, .topbar, .context-bar, .toolbar, .snapshot-stamp { display: none !important; }
  .workspace { grid-column: 1; }
  #main { width: 100%; padding: 0; }
  .wiki-card, .hero-panel, .metric-card, .mission-card, .issue-row, .chat-row, .table-wrap { break-inside: avoid; box-shadow: none; background: white; border-color: #bbb; }
  a { color: #111; text-decoration: underline; }
  .community-actions { display: none; }
  .site-footer { min-height: 0; padding: 16px 0 0; border-top: 1px solid #777; background: white; color: #111; box-shadow: none; }
  .site-footer p, .site-footer a, .footer-edition { color: #111; }
}
