:root {
  color-scheme: dark;
  --bg: #1e1e1e;
  --surface: #2c2c2c;
  --surface-2: #333333;
  --text: #ffffff;
  --muted: #cccccc;
  --blue: #4a90e2;
  --green: #22c55e;
  --amber: #f59e0b;
  --border: #4a4a4a;
  --max: 1400px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--blue); }
a:hover { color: #95c7ef; }

.site-header {
  width: min(calc(100% - 40px), var(--max));
  margin: 20px auto 30px;
}

.page,
.site-footer__inner {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.site-header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 30px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2c2c2c 0%, #3a3a3a 100%);
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.brand {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  column-gap: 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.45rem;
}

.brand img {
  grid-row: 1 / 3;
  width: 80px;
  height: 71px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.brand span {
  display: block;
  color: var(--blue);
  font-size: .95rem;
  font-weight: 500;
}

.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 12px;
  border-radius: 12px;
  background: #333333;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.top-nav a {
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--blue);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  transition: all .25s ease;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(74,144,226,0.3);
}

.page {
  margin-bottom: 30px;
  padding: 40px;
  border-radius: 12px;
  background: #333333;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border-left: 4px solid var(--blue);
}

.eyebrow,
.tag {
  color: var(--green);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: 0; }
h1 { max-width: 900px; margin: 10px 0 18px; font-size: 2.5rem; }
h2 {
  margin: 42px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
  color: var(--blue);
  font-size: 1.5rem;
}
h3 { margin: 0 0 9px; font-size: 1.08rem; }

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.14rem;
}

.hero-rule {
  width: 86px;
  height: 4px;
  margin: 28px 0 0;
  background: var(--green);
}

.notice {
  margin: 30px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: #2c2c2c;
  color: #f2f2f2;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.topic-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 2px solid var(--blue);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  transition: all .28s ease;
}

.topic-card:hover {
  border-color: var(--blue);
  background: #3a3a3a;
  color: var(--text);
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(74,144,226,0.28), 0 0 30px rgba(74,144,226,0.25);
}

.topic-card[hidden] { display: none; }

.topic-card p { margin: 10px 0 22px; color: var(--muted); }
.topic-card .read { margin-top: auto; color: var(--blue); font-weight: 700; font-size: .9rem; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 52px;
  align-items: start;
}

.article-body { max-width: 760px; }
.article-body p, .article-body li { color: #dce1e4; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 10px; }

.quick-list {
  position: sticky;
  top: 20px;
  padding: 20px;
  border: 2px solid var(--blue);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.quick-list h2 { margin: 0 0 12px; font-size: 1rem; }
.quick-list a { display: block; padding: 7px 0; text-decoration: none; font-size: .9rem; }

.checklist,
.source-list {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.source-list a { overflow-wrap: anywhere; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 30px 0;
}

.stat-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 2px solid var(--blue);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.stat-card strong { color: var(--blue); font-size: 2rem; line-height: 1; }
.stat-card span { margin-top: 10px; color: var(--muted); font-size: .82rem; }
.stat-card--accent { border-color: var(--green); }
.stat-card--accent strong { color: var(--green); }

.table-wrap {
  max-width: 100%;
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--text); background: #242424; font-size: .82rem; }
td { color: #dce1e4; }
tbody tr:last-child td { border-bottom: 0; }
.steps li { padding-left: 4px; }

.search-wrap { margin: 32px 0 10px; }
.search-wrap label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
.search-wrap input {
  width: min(100%, 560px);
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #242424;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.search-wrap input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }

.site-footer__inner {
  margin-bottom: 20px;
  padding: 30px;
  border-radius: 12px;
  background: #2c2c2c;
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.site-footer p { margin: 5px 0; }

@media (max-width: 820px) {
  .site-header__inner { padding: 24px; align-items: stretch; flex-direction: column; }
  .top-nav { justify-content: center; }
  .article-layout { grid-template-columns: 1fr; gap: 24px; }
  .quick-list { position: static; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header,
  .page,
  .site-footer__inner { width: min(calc(100% - 24px), var(--max)); }
  .page { padding: 24px; }
  .brand { grid-template-columns: 58px 1fr; font-size: 1.05rem; }
  .brand img { width: 58px; height: 52px; }
  .brand span { font-size: .8rem; }
  .top-nav a { flex: 1 1 130px; text-align: center; }
  .grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 0; }
  .table-wrap { overflow: visible; border: 0; box-shadow: none; }
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td { display: block; width: 100%; }
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .table-wrap tbody { display: grid; gap: 12px; }
  .table-wrap tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(105px, .75fr) minmax(0, 1.25fr);
    gap: 12px;
    padding: 12px 14px;
  }
  .table-wrap td::before {
    content: attr(data-label);
    color: var(--blue);
    font-size: .76rem;
    font-weight: 700;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
}

@media print {
  .site-header, .site-footer, .quick-list, .search-wrap { display: none; }
  body { background: white; color: black; }
  .page { width: 100%; padding: 0; }
  .article-body p, .article-body li, .lede { color: #222; }
}
