/* warcrimes.gg: one stylesheet, two modes.
   Dark = "War Banner" (the default tokens on :root).
   Light = "The Tribunal" (:root[data-theme=light]).
   The head script sets data-theme before first paint; theme.js wires the switch.
   Words that differ per mode live in .d-only / .l-only spans. */

:root {
  color-scheme: dark;
  --bg: #110b0a;          /* Char */
  --surface: #1c1412;     /* Iron */
  --surface-2: #241a17;
  --line: #3b2622;
  --rule: #3b2622;
  --rule-style: solid;
  --text: #f1e7d4;        /* Bone */
  --muted: #b5a594;       /* Ash */
  --heading: #f2cd6b;     /* Bright Gold */
  --label: #d4a537;       /* Gold */
  --trim: #d4a537;
  --banner: #6e0c13;      /* Banner Red */
  --action: #b0141f;      /* Horde Red */
  --action-text: #fff3dc;
  --action-line: #d4a537;
  --secondary-text: #f2cd6b;
  --secondary-line: #d4a537;
  --link: #f2cd6b;
  --link-hover: #fff1c9;
  --focus: #f2cd6b;
  --stamp: #b3121f;
  --q-poor: #9d9d9d;
  --q-common: #ffffff;
  --q-uncommon: #1eff00;
  --q-rare: #2b8cff;       /* lighter than in-game for 4.5:1 */
  --q-epic: #b65cff;       /* lighter than in-game for 4.5:1 */
  --q-legendary: #ff8000;
  --gold-coin: #f2cd6b;
  --silver: #c7c7cf;
  --copper: #d08a52;
  --f-display: "Grenze Gotisch", Georgia, serif;
  --f-body: "Alegreya Sans", system-ui, sans-serif;
  --f-stamp: "Alegreya Sans", system-ui, sans-serif;
  --display-weight: 800;
  --heading-weight: 600;
  --label-weight: 800;
  --body-size: 18px;
  --label-size: 13px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4ead6;          /* Paper */
  --surface: #e3d3b0;     /* Folder */
  --surface-2: #d6c49c;
  --line: #241a14;
  --rule: #8a7a66;
  --rule-style: dashed;
  --text: #241a14;        /* Ink */
  --muted: #5e5045;       /* Faded Ink */
  --heading: #241a14;
  --label: #735511;       /* Gold Ink */
  --trim: #241a14;
  --banner: transparent;
  --action: #241a14;
  --action-text: #f4ead6;
  --action-line: #241a14;
  --secondary-text: #b3121f;
  --secondary-line: #b3121f;
  --link: #7d0d16;        /* Dried Red */
  --link-hover: #b3121f;
  --focus: #b3121f;
  --stamp: #b3121f;       /* Stamp Red */
  --seal: #b8862b;        /* Seal Gold */
  --q-poor: #5a5a5a;
  --q-common: #241a14;
  --q-uncommon: #166800;
  --q-rare: #0058b8;
  --q-epic: #7b2cbf;
  --q-legendary: #904700;
  --gold-coin: #735511;
  --silver: #5a5a63;
  --copper: #8a4513;
  --f-display: "Old Standard TT", Georgia, serif;
  --f-body: "Courier Prime", "Courier New", monospace;
  --f-stamp: "Stardos Stencil", Impact, sans-serif;
  --display-weight: 700;
  --heading-weight: 700;
  --label-weight: 700;
  --body-size: 17px;
  --label-size: 12px;
}

/* ---------- mode switching ---------- */
:root[data-theme="light"] .d-only { display: none !important; }
:root:not([data-theme="light"]) .l-only { display: none !important; }
:root:not([data-theme]) .theme-switch { display: none; } /* no JS: no switch */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--body-size);
  line-height: 1.55;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--f-display);
  color: var(--heading);
  line-height: 1.05;
  text-wrap: balance;
}
h2 { font-weight: var(--heading-weight); font-size: clamp(30px, 4.6vw, 40px); }
h3 { font-weight: var(--display-weight); font-size: clamp(32px, 4vw, 44px); line-height: 1; }
:root[data-theme="light"] h3 { font-size: clamp(30px, 3.6vw, 40px); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--bg); padding: 8px 12px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.label {
  font-family: var(--f-body);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--label);
}
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
:root[data-theme="light"] .topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in {
  display: flex;
  align-items: center;
  gap: 8px 28px;
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--heading);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--banner);
  border: 1px solid var(--trim);
  color: var(--heading);
  font-family: var(--f-display);
  font-weight: var(--display-weight);
  font-size: 19px;
  line-height: 1;
}
:root[data-theme="light"] .brand-mark {
  border-radius: 50%;
  background: var(--seal);
  border: 0;
  box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 4px #735511;
  color: #3a2a08;
  font-size: 15px;
  transform: rotate(-8deg);
}
.brand-name { font-family: var(--f-display); font-weight: var(--display-weight); font-size: 24px; line-height: 1; }
:root[data-theme="light"] .brand-name { font-size: 21px; }
.nav { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--heading); }
:root[data-theme="light"] .nav a:hover { color: var(--link-hover); }
.nav a[aria-current="page"] { border-bottom-color: var(--trim); }
:root[data-theme="light"] .nav a[aria-current="page"] { border-bottom-color: var(--stamp); }

.theme-switch {
  margin-left: auto;
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--trim);
}
:root[data-theme="light"] .theme-switch { border: 2px solid var(--line); }
.theme-switch button {
  appearance: none;
  min-height: 40px;
  min-width: 64px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--heading);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-switch button + button { border-left: 1px solid var(--trim); }
:root[data-theme="light"] .theme-switch button + button { border-left: 2px solid var(--line); }
.theme-switch button[aria-pressed="true"] { background: var(--action); color: var(--action-text); cursor: default; }
.theme-switch button[aria-pressed="false"]:hover { background: var(--surface-2); }
:root[data-theme="light"] .theme-switch button { color: var(--text); font-weight: 700; }
:root[data-theme="light"] .theme-switch button[aria-pressed="true"] { color: var(--action-text); }

@media (max-width: 720px) {
  .brand-name { display: none; }
  .nav { order: 3; width: 100%; gap: 4px 20px; }
  .topbar-in { flex-wrap: wrap; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--banner);
  border-bottom: 4px solid var(--trim);
  padding: 64px 0 56px;
}
.hero-in { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.kicker { display: flex; align-items: center; gap: 18px; }
.kicker-rule { width: 64px; height: 1px; background: var(--trim); flex-shrink: 0; }
.hero .kicker { font-size: 14px; letter-spacing: 0.32em; color: var(--heading); }
.wordmark {
  font-weight: var(--display-weight);
  font-size: clamp(52px, 10.5vw, 120px);
  line-height: 0.95;
  text-shadow: 0 4px 0 #2a0507;
}
.hero--page .wordmark { font-size: clamp(48px, 8vw, 92px); }
.hero-sub { font-size: 20px; letter-spacing: 0.08em; }
.seal, .stamp { display: none; }

:root[data-theme="light"] .hero {
  background: transparent;
  border-bottom: 3px double var(--line);
  padding: 56px 0 44px;
}
:root[data-theme="light"] .hero-in { flex-direction: row; align-items: center; gap: 44px; text-align: left; }
:root[data-theme="light"] .hero .kicker { font-size: 13px; letter-spacing: 0.26em; color: var(--muted); }
:root[data-theme="light"] .wordmark { font-size: clamp(44px, 8vw, 96px); line-height: 1; text-shadow: none; }
:root[data-theme="light"] .hero--page .wordmark { font-size: clamp(42px, 7vw, 80px); }
:root[data-theme="light"] .hero-sub { font-size: 17px; letter-spacing: 0; color: var(--muted); }
:root[data-theme="light"] .hero-text { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
:root[data-theme="light"] .seal {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: inset 0 0 0 6px var(--seal), inset 0 0 0 8px #735511, inset 0 0 0 16px var(--seal), inset 0 0 0 17px #735511;
  transform: rotate(-8deg);
  font-family: "Old Standard TT", Georgia, serif;
  font-weight: 700;
  font-size: 52px;
  color: #3a2a08;
}
:root[data-theme="light"] .stamp {
  display: inline-block;
  border: 5px solid var(--stamp);
  color: var(--stamp);
  padding: 10px 18px;
  font-family: var(--f-stamp);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: rotate(-10deg);
  opacity: 0.9;
  mix-blend-mode: multiply;
}
:root[data-theme="light"] .stamp-hero { flex-shrink: 0; }
@media (max-width: 860px) {
  :root[data-theme="light"] .hero-in { gap: 24px; }
  :root[data-theme="light"] .seal { width: 92px; height: 92px; font-size: 32px; box-shadow: inset 0 0 0 4px var(--seal), inset 0 0 0 5px #735511, inset 0 0 0 10px var(--seal), inset 0 0 0 11px #735511; }
  :root[data-theme="light"] .stamp-hero { position: absolute; right: 16px; top: 18px; font-size: 22px; border-width: 3px; padding: 4px 10px; }
  :root[data-theme="light"] .hero { padding-top: 76px; }
}
@media (max-width: 600px) {
  .hero { padding: 48px 0 40px; }
  .kicker-rule { width: 28px; }
  .hero .kicker { font-size: 12px; letter-spacing: 0.22em; gap: 12px; }
  .hero-sub { font-size: 17px; }
  :root[data-theme="light"] .hero-in { flex-direction: column; align-items: flex-start; gap: 18px; }
  :root[data-theme="light"] .seal { width: 72px; height: 72px; font-size: 26px; }
}

/* ---------- sections ---------- */
.section { padding-top: 80px; }
.section:last-child { padding-bottom: 88px; }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; max-width: 760px; }
.section-head p:not(.label) { color: var(--muted); }
@media (max-width: 600px) { .section { padding-top: 56px; } .section:last-child { padding-bottom: 64px; } }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- intro / voice ---------- */
.intro { padding-top: 64px; }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px 56px; align-items: start; }
@media (max-width: 860px) { .intro-grid { grid-template-columns: minmax(0, 1fr); } }
.intro-copy { display: flex; flex-direction: column; gap: 18px; }
.voice { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.3; }
:root[data-theme="light"] .voice { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.45; }
.quote-box {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quote-box .quote { font-size: 19px; line-height: 1.5; font-style: italic; }
:root[data-theme="light"] .quote-box .quote { font-style: normal; font-size: 18px; }

/* ---------- buttons, badges, item links, money ---------- */
.buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--f-body);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn-primary { background: var(--action); color: var(--action-text); border: 1px solid var(--action-line); }
.btn-primary:hover { color: var(--action-text); filter: brightness(1.12); }
.btn-secondary { color: var(--secondary-text); border: 1px solid var(--secondary-line); }
.btn-secondary:hover { color: var(--secondary-text); background: var(--surface); }
:root[data-theme="light"] .btn { font-weight: 700; }
:root[data-theme="light"] .btn-secondary { border-width: 2px; padding: 0 22px; }
:root[data-theme="light"] .btn-primary:hover { filter: none; background: #3a2c22; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 1px;
}
.badge-major { background: var(--action); border: 1px solid var(--trim); color: var(--action-text); }
.badge-minor { border: 1px solid var(--trim); color: var(--heading); }
:root[data-theme="light"] .badge { background: transparent; font-family: var(--f-stamp); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; padding: 1px 8px; }
:root[data-theme="light"] .badge-major { border: 3px solid var(--stamp); color: var(--stamp); }
:root[data-theme="light"] .badge-minor { border: 2px solid var(--muted); color: var(--muted); }

.item { font-weight: 700; text-decoration: none; }
.item:hover { text-decoration: underline; }
.q-poor, .q-poor:hover { color: var(--q-poor); }
.q-common, .q-common:hover { color: var(--q-common); }
.q-uncommon, .q-uncommon:hover { color: var(--q-uncommon); }
.q-rare, .q-rare:hover { color: var(--q-rare); }
.q-epic, .q-epic:hover { color: var(--q-epic); }
.q-legendary, .q-legendary:hover { color: var(--q-legendary); }
.m-g { color: var(--gold-coin); }
.m-s { color: var(--silver); }
.m-c { color: var(--copper); }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- member cards ---------- */
.members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
@media (max-width: 860px) { .members { grid-template-columns: minmax(0, 1fr); max-width: 560px; } }
.member { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.portrait {
  position: relative;
  height: clamp(320px, 42vw, 400px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.backdrop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78%;
  background: var(--banner);
  border-top: 3px solid var(--trim);
  box-shadow: inset 0 0 0 10px var(--banner), inset 0 0 0 11px #a47a2a;
}
.backdrop span { display: none; }
.portrait img { position: relative; height: calc(100% - 10px); width: auto; max-width: calc(100% - 24px); object-fit: contain; object-position: bottom; }
.member-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--trim);
}
.member-line { font-size: 18px; }
.record { margin-top: 12px; padding-top: 14px; border-top: 1px var(--rule-style) var(--rule); display: flex; flex-direction: column; gap: 8px; }
.record .label { color: var(--muted); }
.record ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 16px; line-height: 1.45; }
.record b { color: var(--heading); font-variant-numeric: tabular-nums; }
:root[data-theme="light"] .record b { color: var(--text); }

:root[data-theme="light"] .backdrop {
  left: 24px;
  right: 24px;
  height: 75%;
  background: var(--surface-2);
  border: 1px solid var(--muted);
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
:root[data-theme="light"] .backdrop span {
  display: flex;
  flex: 1;
  align-items: flex-end;
  padding: 0 8px;
  border-bottom: 1px solid #8a7a66;
  font-size: 11px;
  color: var(--muted);
}
:root[data-theme="light"] .backdrop span:last-child { border-bottom: 0; }
:root[data-theme="light"] .member-body { border-top: 2px solid var(--line); }
:root[data-theme="light"] .member-line { font-size: 16px; }
:root[data-theme="light"] .record ul { font-size: 15px; }
:root[data-theme="light"] .member { position: relative; }
:root[data-theme="light"] .stamp-card {
  position: absolute;
  right: 22px;
  top: calc(clamp(320px, 42vw, 400px) - 34px);
  z-index: 1;
  font-size: 30px;
  border-width: 4px;
  padding: 4px 14px;
  background: rgba(244, 234, 214, 0.55);
  transform: rotate(-7deg);
}
:root[data-theme="light"] .stamp-card.stamp--gold { border-color: #735511; color: #735511; transform: rotate(5deg); }
@media (max-width: 600px) {
  .member-body { padding: 20px 20px 24px; }
  :root[data-theme="light"] .stamp-card { right: 14px; font-size: 24px; border-width: 3px; top: calc(clamp(320px, 42vw, 400px) - 28px); }
}

/* ---------- roster ---------- */
.roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.roster li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cls, var(--trim));
  padding: 12px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.roster .who { font-weight: 700; font-size: 18px; color: var(--text); }
.roster .what { font-size: 15px; color: var(--muted); }
.roster .docket { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--label); }
:root[data-theme="light"] .roster li { border: 1px solid var(--line); border-left-width: 1px; }
:root[data-theme="light"] .roster .who { font-size: 16px; }
:root[data-theme="light"] .roster .what { font-size: 14px; }
.as-of { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* ---------- guides ---------- */
.guides { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .guides { grid-template-columns: minmax(0, 1fr); } }
.guide {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.guide:hover { color: var(--text); border-color: var(--trim); }
.guide-title { font-family: var(--f-display); font-weight: var(--heading-weight); font-size: 28px; line-height: 1.1; color: var(--heading); }
:root[data-theme="light"] .guide-title { font-size: 24px; }
:root[data-theme="light"] .guide:hover { border-color: var(--stamp); }
:root[data-theme="light"] .guide:hover .guide-title { color: var(--link-hover); }
.guide-desc { font-size: 16px; line-height: 1.5; color: var(--muted); }
:root[data-theme="light"] .guide-desc { font-size: 15px; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); background: var(--surface); }
.table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 17px; }
.table th {
  text-align: left;
  padding: 14px 20px;
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  border-bottom: 2px solid var(--trim);
  white-space: nowrap;
}
.table td { padding: 16px 20px; border-bottom: 1px var(--rule-style) var(--rule); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .note { color: var(--muted); font-size: 15px; }
.table td.slot { color: var(--muted); }
:root[data-theme="light"] .table { font-size: 16px; }
:root[data-theme="light"] .table th { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--banner); border-top: 4px solid var(--trim); padding: 28px 0 30px; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 12px 32px; flex-wrap: wrap; }
.footer-mark { font-family: var(--f-display); font-weight: var(--display-weight); font-size: 28px; color: var(--heading); }
.footer-note { font-size: 15px; }
.footer-fine { width: 100%; font-size: 13px; color: var(--muted); }
:root:not([data-theme="light"]) .footer-fine { color: #d9c9b4; }
:root[data-theme="light"] .site-footer { background: transparent; border-top: 3px double var(--line); }
:root[data-theme="light"] .footer-mark { font-size: 26px; }
:root[data-theme="light"] .footer-note { font-size: 14px; color: var(--muted); }

/* ---------- style guide page ---------- */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .modes { grid-template-columns: minmax(0, 1fr); } }
.mode-panel { padding: 28px; display: flex; flex-direction: column; gap: 26px; border: 1px solid; }
@media (max-width: 600px) { .mode-panel { padding: 20px; } }
.mode-panel--dark { background: #110b0a; color: #f1e7d4; border-color: #3b2622; font-family: "Alegreya Sans", system-ui, sans-serif; }
.mode-panel--light { background: #f4ead6; color: #241a14; border-color: #241a14; font-family: "Courier Prime", "Courier New", monospace; }
.mode-panel .p-label { font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
.mode-panel--dark .p-label { color: #d4a537; }
.mode-panel--light .p-label { color: #735511; font-weight: 700; }
.mode-panel .p-title { font-size: 32px; line-height: 1.05; margin-top: 4px; }
.mode-panel--dark .p-title { font-family: "Grenze Gotisch", Georgia, serif; font-weight: 800; color: #f2cd6b; }
.mode-panel--light .p-title { font-family: "Old Standard TT", Georgia, serif; font-weight: 700; color: #241a14; }
.mode-panel .p-sub { font-size: 15px; line-height: 1.5; margin-top: 6px; }
.mode-panel--dark .p-sub, .mode-panel--dark .sw-use { color: #b5a594; }
.mode-panel--light .p-sub, .mode-panel--light .sw-use { color: #5e5045; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; }
@media (max-width: 480px) { .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sw-chip { height: 56px; border: 1px solid; }
.mode-panel--dark .sw-chip { border-color: #3b2622; }
.mode-panel--light .sw-chip { border-color: #241a14; }
.sw-name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.sw-use { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.specimens { display: flex; flex-direction: column; gap: 14px; }
.spec { display: flex; flex-direction: column; gap: 2px; }
.spec-note { font-size: 12px; }
.mode-panel--dark .spec-note { color: #b5a594; }
.mode-panel--light .spec-note { color: #5e5045; }
.panel-items { display: flex; flex-direction: column; gap: 6px; font-weight: 700; padding: 16px 18px; border: 1px solid; }
.mode-panel--dark .panel-items { background: #1c1412; border-color: #3b2622; font-size: 17px; }
.mode-panel--light .panel-items { background: #e3d3b0; border-color: #241a14; font-size: 16px; }
.panel-items a { text-decoration: none; }
.panel-items a:hover { text-decoration: underline; }
.panel-items .hex { font-weight: 400; font-size: 12px; margin-left: 8px; }
.mode-panel--dark .panel-items .hex { color: #b5a594; }
.mode-panel--light .panel-items .hex { color: #5e5045; }

.rules { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.rules li::marker { color: var(--label); }
.says { width: 100%; min-width: 640px; }
.says td:first-child { width: 22%; color: var(--muted); }
.spec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.spec-card { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.spec-card h3 { font-size: 24px; font-weight: var(--heading-weight); }
:root[data-theme="light"] .spec-card h3 { font-size: 22px; }
.spec-card p { font-size: 16px; color: var(--muted); }
:root[data-theme="light"] .spec-card p { font-size: 15px; }
code { font-family: ui-monospace, "Courier Prime", monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; }
.demo-row { display: flex; gap: 14px 18px; flex-wrap: wrap; align-items: center; }
.demo-block { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 40px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .guide, .theme-switch button { transition: background-color 0.15s, border-color 0.15s, color 0.15s, filter 0.15s; }
}
