.checklist-main {
  padding-top: 24px;
  padding-bottom: 72px;
}

.checklist-hero {
  grid-template-columns: 82px minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.checklist-hero img {
  width: 70px;
  height: 86px;
}

.hero-copy {
  min-width: 0;
}

.hero-intro {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.action-button,
.small-button,
.filter-chip,
.note-button,
.guide-jump {
  font: inherit;
}

.action-button {
  min-height: 34px;
  padding: 7px 10px;
}

.file-button {
  cursor: pointer;
}

.danger-button {
  border-color: rgba(210, 59, 48, 0.62);
  color: #ffd1c9;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.storage-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(222, 163, 68, 0.62);
  border-radius: 7px;
  color: #ffe0a4;
  background: rgba(91, 55, 10, 0.58);
}

.save-status {
  min-height: 20px;
  margin: 0 2px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-card {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(46, 17, 14, 0.98), rgba(14, 8, 7, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.06), 0 9px 20px rgba(0, 0, 0, 0.2);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold);
}

.reached-card::before { background: #4f9c62; }
.available-card::before { background: #d69b27; }
.locked-card::before { background: #497ba4; }
.issue-card::before { background: #c94a3f; }

.summary-label,
.summary-detail {
  display: block;
}

.summary-label {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-value {
  display: block;
  margin: 1px 0 3px;
  color: var(--gold-bright);
  font-size: 29px;
  line-height: 1;
}

.summary-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-meter {
  display: block;
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.summary-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 180ms ease;
}

.control-panel {
  position: sticky;
  z-index: 9;
  top: 8px;
  margin-bottom: 12px;
  padding: 12px;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(35, 13, 11, 0.97), rgba(13, 7, 6, 0.95));
}

.search-row {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.search-row label,
.filter-label {
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
}

#checklist-search {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(216, 166, 76, 0.44);
  border-radius: 6px;
  color: var(--text);
  background: rgba(5, 3, 3, 0.76);
  font: inherit;
}

#checklist-search::placeholder {
  color: #8f806c;
}

.small-button,
.filter-chip,
.note-button,
.guide-jump {
  border: 1px solid rgba(216, 166, 76, 0.34);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(24, 10, 9, 0.86);
  cursor: pointer;
}

.small-button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-row + .filter-row {
  margin-top: 7px;
}

.filter-label {
  min-width: 52px;
}

.filter-chip {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.filter-chip.active {
  border-color: rgba(255, 225, 160, 0.78);
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(111, 27, 21, 0.98), rgba(39, 10, 8, 0.98));
}

.small-button:hover,
.small-button:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.note-button:hover,
.note-button:focus-visible,
.guide-jump:hover,
.guide-jump:focus-visible,
#checklist-search:focus-visible,
.result-select:focus-visible,
.item-note:focus-visible,
.reach-check:focus-visible + .checkmark {
  border-color: var(--gold-bright);
  outline: 2px solid rgba(255, 225, 160, 0.22);
  outline-offset: 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 2px 13px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend b { font-weight: 600; }

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7f7466;
  box-shadow: 0 0 0 3px rgba(127, 116, 102, 0.12);
}

.legend-dot.reached { background: #62a96f; }
.legend-dot.available { background: #d9a036; }
.legend-dot.locked { background: #4f7fa6; }
.legend-dot.unavailable { background: #716b67; }

.checklist-root {
  display: grid;
  gap: 12px;
}

.check-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(42, 14, 12, 0.95), rgba(14, 8, 7, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.04), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.section-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.section-summary::-webkit-details-marker { display: none; }

.section-summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(216, 166, 76, 0.38);
  border-radius: 50%;
  color: var(--gold-bright);
  font-size: 18px;
  line-height: 1;
}

.check-section[open] > .section-summary::after { content: "−"; }

.section-title-wrap {
  min-width: 0;
}

.section-title {
  display: block;
  color: var(--gold-bright);
  font-size: 20px;
  line-height: 1.15;
}

.section-description {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-progress {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.section-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 12px;
  border-top: 1px solid rgba(216, 166, 76, 0.18);
}

.check-group {
  overflow: hidden;
  border: 1px solid rgba(216, 166, 76, 0.2);
  border-radius: 7px;
  background: rgba(8, 5, 5, 0.4);
}

.check-group:first-child { margin-top: 10px; }

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(216, 166, 76, 0.16);
  background: rgba(55, 18, 15, 0.72);
}

.group-title {
  color: #f3d49b;
  font-size: 14px;
  font-weight: 800;
}

.group-progress {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.check-list {
  display: grid;
}

.check-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 145px auto;
  grid-template-areas:
    "check copy result tools"
    ". note note note";
  gap: 8px 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(216, 166, 76, 0.12);
  transition: background 120ms ease, opacity 120ms ease;
}

.check-item:last-child { border-bottom: 0; }
.check-item:hover { background: rgba(102, 31, 24, 0.14); }
.check-item.is-reached { background: rgba(35, 92, 50, 0.12); }
.check-item.is-unavailable { opacity: 0.76; }
.check-item[hidden], .check-group[hidden], .check-section[hidden] { display: none !important; }

.check-control {
  grid-area: check;
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.reach-check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.checkmark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #907c61;
  border-radius: 5px;
  color: #07140a;
  background: rgba(4, 3, 3, 0.72);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.reach-check:checked + .checkmark {
  border-color: #70bb7e;
  background: #70bb7e;
}

.reach-check:checked + .checkmark::after { content: "✓"; }

.reach-check:disabled + .checkmark {
  border-color: #625b55;
  background: rgba(84, 78, 72, 0.2);
  cursor: not-allowed;
}

.check-item.is-unavailable .check-control {
  cursor: not-allowed;
}

.item-copy {
  grid-area: copy;
  min-width: 0;
}

.item-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.item-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.item-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.meta-chip,
.reachability-badge,
.type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(216, 166, 76, 0.24);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.type-badge {
  color: #e7c27f;
  background: rgba(87, 28, 21, 0.58);
}

.meta-chip {
  color: #bcae98;
  background: rgba(12, 8, 7, 0.68);
}

.meta-chip.issue-chip {
  border-color: rgba(210, 72, 60, 0.62);
  color: #ffc1b7;
  background: rgba(108, 27, 21, 0.32);
}

.meta-chip.prerequisite-chip {
  border-color: rgba(79, 127, 166, 0.52);
  color: #bad7ed;
}

.reachability-badge.reached {
  border-color: rgba(93, 175, 111, 0.54);
  color: #b8edc2;
  background: rgba(40, 105, 56, 0.35);
}

.reachability-badge.available {
  border-color: rgba(218, 158, 47, 0.55);
  color: #ffe0a2;
  background: rgba(112, 72, 16, 0.35);
}

.reachability-badge.locked {
  border-color: rgba(79, 127, 166, 0.58);
  color: #bad7ed;
  background: rgba(36, 74, 104, 0.36);
}

.reachability-badge.unavailable {
  border-color: rgba(132, 124, 116, 0.48);
  color: #d0c8bf;
  background: rgba(71, 65, 61, 0.34);
}

.result-select {
  grid-area: result;
  width: 100%;
  min-height: 34px;
  padding: 6px 26px 6px 8px;
  border: 1px solid rgba(216, 166, 76, 0.34);
  border-radius: 6px;
  color: var(--text);
  background: #170b09;
  font: inherit;
  font-size: 12px;
}

.result-select[data-result="pass"] {
  border-color: rgba(93, 175, 111, 0.62);
  color: #b8edc2;
}

.result-select[data-result="issue"],
.result-select[data-result="blocked"] {
  border-color: rgba(210, 72, 60, 0.7);
  color: #ffc1b7;
}

.item-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.note-button,
.guide-jump {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
}

.note-button.has-note {
  border-color: rgba(216, 166, 76, 0.72);
  color: var(--gold-bright);
}

.note-wrap {
  grid-area: note;
  display: grid;
  gap: 5px;
  padding: 4px 0 2px;
}

.note-wrap[hidden] { display: none; }

.note-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.item-note {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  padding: 8px 9px;
  border: 1px solid rgba(216, 166, 76, 0.34);
  border-radius: 6px;
  color: var(--text);
  background: rgba(4, 3, 3, 0.78);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.empty-state,
.noscript-message {
  margin-top: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .check-item {
    grid-template-columns: 38px minmax(0, 1fr) 132px;
    grid-template-areas:
      "check copy result"
      ". tools tools"
      ". note note";
  }

  .item-tools { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .checklist-main { padding-top: 16px; }

  .checklist-hero {
    grid-template-columns: 66px minmax(0, 1fr);
    align-items: start;
  }

  .checklist-hero img {
    width: 58px;
    height: 72px;
  }

  .hero-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coverage-card { grid-column: 1 / -1; }

  .control-panel {
    position: static;
  }

  .search-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-row .small-button {
    grid-row: 2;
  }

  .section-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .section-progress {
    grid-column: 1;
    grid-row: 2;
  }

  .section-summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .check-item {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "check copy"
      ". result"
      ". tools"
      ". note";
    align-items: start;
  }

  .result-select { max-width: 210px; }
}

@media (max-width: 430px) {
  .summary-grid { grid-template-columns: 1fr; }
  .coverage-card { grid-column: auto; }
  .summary-card { min-height: 96px; }
  .summary-label { min-height: 0; }
  .filter-label { width: 100%; }
  .section-description { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
