:root {
  --bg: #1d2025;
  --bg-deep: #17191d;
  --panel: #272a30;
  --panel-alt: #23262b;
  --panel-soft: #2c3036;
  --line: #3d424a;
  --line-dark: #111317;
  --text: #d7d9dc;
  --text-strong: #f0f1f2;
  --muted: #959ba3;
  --faint: #6f767f;
  --green: #87a95b;
  --green-strong: #9abd69;
  --green-dark: #50693c;
  --rust: #b87858;
  --blue: #82a8ca;
  --warning-bg: #2d2b25;
  --warning-line: #605840;
  --max: 1020px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text);
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-strong); text-decoration: underline; }

.site-shell {
  width: min(var(--max), calc(100% - 24px));
  margin: 18px auto 40px;
  border: 1px solid var(--line-dark);
  box-shadow: 0 0 0 1px #30343b;
  background: var(--bg);
}

.masthead {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  background: #25282e;
  border-bottom: 1px solid var(--line);
}
.masthead-brand { min-width: 0; }
.masthead-title {
  color: var(--text-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.05;
}
.masthead-title span { color: var(--green); }
.masthead-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.masthead-mark {
  flex: 0 0 auto;
  color: var(--green);
  font: 700 28px/1 "Courier New", Courier, monospace;
  letter-spacing: -.08em;
  opacity: .88;
}


.site-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 44px;
  padding: 7px 10px 0;
  background: #1f2227;
  border-bottom: 1px solid var(--line-dark);
}
.site-tabs a {
  display: block;
  min-width: 112px;
  padding: 10px 18px 9px;
  border: 1px solid #444a53;
  border-bottom: 0;
  background: #2b2f35;
  color: #d5d8db;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: inset 0 1px 0 #393e46;
}
.site-tabs a:hover {
  color: #eef0f1;
  background: #32373e;
  text-decoration: none;
}
.site-tabs a.active {
  color: #eef2e9;
  background: #343b31;
  border-color: #536047;
  box-shadow: inset 0 2px 0 var(--green);
}

.subnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 31px;
  padding: 0 10px;
  background: #30343b;
  border-bottom: 1px solid var(--line-dark);
  box-shadow: inset 0 -1px 0 #40454e;
}
.subnav span {
  padding: 7px 9px 7px 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.subnav a {
  display: block;
  padding: 7px 10px;
  color: #bfc4c9;
  font-size: 10px;
  font-weight: 700;
  border-left: 1px solid #41464e;
}
.subnav a:last-child { border-right: 1px solid #41464e; }
.subnav a:hover { color: var(--green-strong); background: #282b31; text-decoration: none; }


main { padding: 14px; }

.notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--warning-line);
  background: var(--warning-bg);
  color: #cbc6b6;
}
.notice strong { color: #e1dac4; }

.board {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 var(--line-dark);
}
.board-title {
  min-height: 33px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  background: #34383f;
  border-bottom: 1px solid var(--line-dark);
  box-shadow: inset 0 -1px 0 #454a53;
}
.board-title h1,
.board-title h2 {
  margin: 0;
  color: var(--text-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.2;
}
.board-title a { font-size: 10px; }
.board-title .crumb { color: var(--muted); font-size: 10px; }

.grade-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}
.grade-row:last-child { border-bottom: 0; }
.grade-row:nth-child(even) { background: var(--panel-alt); }
.grade-code {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 6px 10px;
  border-right: 1px solid var(--line);
  color: #a4aab1;
  font: 700 24px/1 "Courier New", Courier, monospace;
}
.grade-code.c,
.grade-code.cc { color: var(--green-strong); }
.grade-body { padding: 10px 13px 11px; }
.grade-body h2 {
  margin: 0 0 3px;
  color: var(--text-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.3;
}
.grade-body p { margin: 0; max-width: 820px; }
.grade-body .current {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.grade-body .current b { color: #bfc4c9; }
.quiet {
  color: var(--faint);
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 5px;
}

.level-table { width: 100%; }
.level-row {
  display: grid;
  grid-template-columns: 145px 1fr;
  border-bottom: 1px solid var(--line);
}
.level-row:last-child { border-bottom: 0; }
.level-row:nth-child(even) { background: var(--panel-alt); }
.level-row > div { padding: 9px 11px; }
.level-name {
  border-right: 1px solid var(--line);
  color: #c8ccd0;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
}
.cc-text { color: var(--green-strong); }

.archive-list p {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px dotted #4a4f57;
}
.archive-list p:last-child { border-bottom: 0; }
.archive-list b { color: #c8ccd0; }

/* history */
.history-intro { padding: 12px 13px; color: #c9ccd0; }
.history-intro p { margin: 0 0 8px; }
.history-intro p:last-child { margin-bottom: 0; }
.timeline { background: var(--panel); }
.timeline-entry {
  display: grid;
  grid-template-columns: 138px 1fr;
  border-bottom: 1px solid var(--line);
}
.timeline-entry:last-child { border-bottom: 0; }
.timeline-entry:nth-child(even) { background: var(--panel-alt); }
.timeline-date {
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  color: var(--green-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
}
.timeline-copy { padding: 11px 13px 12px; }
.timeline-copy h3 {
  margin: 0 0 5px;
  color: var(--text-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}
.timeline-copy p { margin: 0 0 7px; }
.timeline-copy p:last-child { margin-bottom: 0; }
.timeline-copy ul { margin: 6px 0 0 18px; padding: 0; }
.timeline-copy li { margin: 3px 0; }

.clan-table { width: 100%; border-collapse: collapse; }
.clan-table th,
.clan-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.clan-table tr:last-child td { border-bottom: 0; }
.clan-table th { color: #d8dbde; background: #2d3036; font-size: 10px; }
.clan-table tbody tr:nth-child(even) { background: var(--panel-alt); }
.clan-table .tag { white-space: nowrap; color: var(--green-strong); font-weight: 700; }

.source-list { padding: 5px 12px 7px; }
.source-list p { margin: 0; padding: 8px 0; border-bottom: 1px dotted #4a4f57; }
.source-list p:last-child { border-bottom: 0; }
.source-list small { display: block; color: var(--muted); margin-top: 2px; }

.callout {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #22262a;
  border-left: 3px solid var(--green-dark);
  color: #bfc3c7;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #22252a;
  color: var(--faint);
  font-size: 10px;
}
footer .links { display: flex; gap: 10px; }

@media (max-width: 650px) {
  body { font-size: 12px; }
  .site-shell { width: calc(100% - 8px); margin: 4px auto 16px; }
  .masthead { min-height: 72px; padding: 14px; }
  .masthead-title { font-size: 24px; }
  .masthead-mark { font-size: 22px; }
  .site-tabs { padding: 6px 6px 0; }
  .site-tabs a { min-width: 0; flex: 1 1 50%; padding: 10px 12px 9px; font-size: 13px; }
  .subnav { padding: 0 4px; overflow-x: auto; flex-wrap: nowrap; }
  .subnav span, .subnav a { white-space: nowrap; }
  main { padding: 8px; }
  .grade-row { grid-template-columns: 52px 1fr; }
  .grade-code { font-size: 20px; padding: 13px 4px 9px; }
  .grade-body { padding: 9px 10px 10px; }
  .level-row { grid-template-columns: 95px 1fr; }
  .timeline-entry { grid-template-columns: 1fr; }
  .timeline-date { border-right: 0; border-bottom: 1px solid var(--line); padding: 7px 10px; background: #2b2f34; }
  .clan-table th:nth-child(3), .clan-table td:nth-child(3) { display: none; }
  footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
