:root {
  --bg: #faf9f7;
  --bg-raised: #ffffff;
  --bg-done: #edf3f1;
  --text: #16181c;
  --text-muted: #5f656e;
  --line: #e2dfd9;
  --line-strong: #cfcbc3;
  --accent: #0b6b5f;
  --accent-weak: #e2eeeb;
  --accent-text: #075045;
  --warn-bg: #f6eee4;
  --warn-text: #7a4a12;
  --z-header: 100;

  --step: 0.25rem;
  --radius: 10px;
}

:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15171b;
    --bg-raised: #1c1f24;
    --bg-done: #17302c;
    --text: #eceef1;
    --text-muted: #a3a9b3;
    --line: #2c3038;
    --line-strong: #3d434c;
    --accent: #56c3b2;
    --accent-weak: #17302c;
    --accent-text: #8fd8cb;
    --warn-bg: #33281a;
    --warn-text: #e0bb87;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171b;
  --bg-raised: #1c1f24;
  --bg-done: #17302c;
  --text: #eceef1;
  --text-muted: #a3a9b3;
  --line: #2c3038;
  --line-strong: #3d434c;
  --accent: #56c3b2;
  --accent-weak: #17302c;
  --accent-text: #8fd8cb;
  --warn-bg: #33281a;
  --warn-text: #e0bb87;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  font-feature-settings: "palt";
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

a:hover { text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- header ---------- */

.site-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.logo {
  margin: 0 0 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-text);
}

.site-header h1 {
  margin: 0 0 20px;
  font-size: 28px;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 16px;
}

.lead strong {
  color: var(--text);
  font-weight: 700;
}

.asof {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- sections ---------- */

main section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

main section:last-of-type { border-bottom: none; }

h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
}

.section-note {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--text-muted);
}

.footnote {
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ---------- progress ---------- */

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line-strong);
}

.progress-count {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
}

.progress-label {
  font-size: 14px;
  color: var(--text-muted);
}

.reset {
  margin-left: auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.reset:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ---------- steps ---------- */

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  border-bottom: 1px solid var(--line);
  counter-increment: step;
}

.step label {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 12px 18px 10px;
  margin: 0 -12px 0 -10px;
  min-height: 44px;
  cursor: pointer;
  border-radius: var(--radius);
}

.step label:hover { background: var(--bg-raised); }

.step input[type="checkbox"] {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 5px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.step-body {
  display: block;
  min-width: 0;
}

.step-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
}

.step-title::before {
  content: counter(step) ". ";
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.step-desc {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
}

.step-desc strong {
  color: var(--text);
  font-weight: 700;
}

.step-list {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-muted);
}

.step-list span {
  display: block;
  padding-left: 16px;
  position: relative;
  line-height: 1.9;
}

.step-list span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.amount,
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount {
  background: var(--accent-weak);
  color: var(--accent-text);
  font-weight: 700;
}

.tag {
  background: var(--warn-bg);
  color: var(--warn-text);
  font-weight: 700;
}

/* 完了状態は塗って示す */
.step.is-done,
.step:has(input:checked) {
  background: var(--bg-done);
}

.step.is-done .step-title,
.step.is-done .step-title::before,
.step:has(input:checked) .step-title,
.step:has(input:checked) .step-title::before {
  color: var(--accent-text);
}

.step.is-done .step-desc,
.step.is-done .step-list,
.step:has(input:checked) .step-desc,
.step:has(input:checked) .step-list {
  color: var(--text-muted);
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 13px 14px 13px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.7;
}

thead th {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.th-sub {
  display: block;
  font-size: 13px;
  font-weight: 400;
}

tbody th {
  font-weight: 700;
  padding-right: 18px;
}

td:last-child, th:last-child { padding-right: 0; }

.num {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-text);
}

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}

.badge-ok {
  background: var(--accent-weak);
  color: var(--accent-text);
}

.badge-ng {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.badge-unknown {
  background: var(--warn-bg);
  color: var(--warn-text);
}

/* ---------- traps ---------- */

.traps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.traps li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.traps li:last-child { border-bottom: none; }

.trap-title {
  display: block;
  font-weight: 700;
  font-size: 16px;
}

.trap-desc {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- sources ---------- */

.sources {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources li {
  border-bottom: 1px solid var(--line);
}

.sources li:last-child { border-bottom: none; }

.sources a {
  display: block;
  padding: 14px 0;
  min-height: 44px;
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 40px 0 64px;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}

.site-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-muted);
}

.footer-meta { margin-top: 10px !important; }

/* ---------- responsive ---------- */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-header { padding: 40px 0 32px; }
  .site-header h1 { font-size: 23px; }
  main section { padding: 44px 0; }
  h2 { font-size: 19px; }
  .step-title { font-size: 16px; }
}
