:root {
  --accent: #004191;
  --accent-soft: #e8f0fc;
  --bg: #ffffff;
  --bg-elevated: #f6f8fb;
  --text: #14181f;
  --text-muted: #5b6472;
  --border: #e3e7ee;
  --pick-bg: #fff8e6;
  --pick-border: #f0d78c;
  --radius: 12px;
  --max-width: 980px;
  --link: #0b57c9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #6ba0ff;
    --accent-soft: #16233b;
    --bg: #0f1115;
    --bg-elevated: #171a21;
    --text: #e7eaf0;
    --text-muted: #9aa3b2;
    --border: #262b34;
    --pick-bg: #241f10;
    --pick-border: #4a3c14;
    --link: #7fb0ff;
  }
}

:root[data-theme="dark"] {
  --accent: #6ba0ff;
  --accent-soft: #16233b;
  --bg: #0f1115;
  --bg-elevated: #171a21;
  --text: #e7eaf0;
  --text-muted: #9aa3b2;
  --border: #262b34;
  --pick-bg: #241f10;
  --pick-border: #4a3c14;
  --link: #7fb0ff;
}

:root[data-theme="light"] {
  --accent: #004191;
  --accent-soft: #e8f0fc;
  --bg: #ffffff;
  --bg-elevated: #f6f8fb;
  --text: #14181f;
  --text-muted: #5b6472;
  --border: #e3e7ee;
  --pick-bg: #fff8e6;
  --pick-border: #f0d78c;
  --link: #0b57c9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Pretendard, "Apple SD Gothic Neo", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 96px;
}

.hero-card {
  background: #ffffff;
  padding: 28px 0 36px;
}

.banner {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto;
}

header.hero {
  text-align: center;
  padding: 40px 0 8px;
}

header.hero h1 {
  font-size: 2rem;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

header.hero p.tagline {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 1.05rem;
}

/* .hero-card is a fixed white surface (matches the banner image's
   white background) so its text/links stay dark-on-white in both
   themes instead of following the page's dark-mode variables. */
.hero-card header.hero h1,
.hero-card header.hero p.tagline {
  color: #14181f;
}
.hero-card header.hero p.tagline {
  color: #5b6472;
}
.hero-card .badge {
  background: #004191;
}
.hero-card .nav-links a {
  color: #0b57c9;
}

.badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.nav-links a { color: var(--link); text-decoration: none; font-weight: 600; }
.nav-links a:hover { text-decoration: underline; }

.crumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 28px 0 4px;
}
.crumb a { color: var(--link); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

h2 {
  font-size: 1.3rem;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  margin: 28px 0 10px;
}

p { color: var(--text); }
p.muted, .muted { color: var(--text-muted); }

a { color: var(--link); }

.meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 4px 0 20px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.meta-row strong { color: var(--text); }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 14px 0 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  min-width: 640px;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  word-break: keep-all;
}

th {
  background: var(--bg-elevated);
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elevated); }
tr.flash td { background: var(--pick-bg); transition: background-color 1.6s ease; }
td:first-child { white-space: nowrap; }
td:nth-child(2) { white-space: nowrap; word-break: keep-all; }
td:nth-child(3), td:nth-child(4) { white-space: nowrap; }

table.picks td:nth-child(3) a {
  font-weight: 600;
}

table.picks {
  background: var(--pick-bg);
}
table.picks th {
  background: var(--pick-bg);
}
.table-scroll:has(table.picks) {
  border-color: var(--pick-border);
}

.mono { font-variant-numeric: tabular-nums; }

.people a { white-space: nowrap; margin-right: 4px; }
.mail { opacity: 0.65; text-decoration: none; }
.mail:hover { opacity: 1; }

.status-done { color: #1a8a4a; font-weight: 600; }
.status-progress { color: var(--accent); font-weight: 600; }
.status-pending { color: var(--text-muted); }

ul.notes { color: var(--text-muted); font-size: 0.92rem; }
ul.notes li { margin-bottom: 6px; }

footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a { color: var(--text-muted); }

@media (max-width: 640px) {
  body { font-size: 15px; }

  .wrap { padding: 0 14px 56px; }

  .hero-card { padding: 20px 0 24px; }
  .banner { max-width: 200px; }

  header.hero { padding: 24px 0 4px; }
  header.hero h1 { font-size: 1.5rem; }
  header.hero p.tagline { font-size: 0.92rem; margin-bottom: 14px; }

  .badges { gap: 6px; margin-bottom: 12px; }
  .badge { font-size: 0.68rem; padding: 4px 10px; }

  .nav-links { gap: 10px 16px; margin-bottom: 22px; font-size: 0.85rem; }

  .crumb { margin: 18px 0 2px; }

  h2 { font-size: 1.08rem; margin: 28px 0 10px; }
  h3 { font-size: 0.98rem; margin: 20px 0 8px; }

  .meta-row { gap: 10px 18px; font-size: 0.85rem; }

  .table-scroll { -webkit-overflow-scrolling: touch; margin: 10px 0 6px; }

  table { font-size: 0.82rem; min-width: 520px; }
  th, td { padding: 8px 10px; }

  footer { margin-top: 44px; font-size: 0.78rem; }
}
