/* ---------- checklist page ---------- */

.check-page {
  padding-top: var(--head-h);
}

.check-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: end;
  padding-block: clamp(52px, 7vw, 92px) clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
}

.check-intro .page-title {
  margin-top: 18px;
}

.check-intro .page-title span {
  color: var(--red);
}

.intro-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.intro-facts div {
  padding: 13px 0 11px;
}

.intro-facts div:nth-child(odd) {
  padding-right: 14px;
}

.intro-facts div:nth-child(even) {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.intro-facts div:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.intro-facts b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  font-weight: 500;
  line-height: 1;
}

.intro-facts span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.check-layout {
  display: grid;
  grid-template-columns: minmax(250px, 350px) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: start;
  padding-block: clamp(32px, 5vw, 64px) clamp(64px, 8vw, 120px);
}

/* ---------- rail ---------- */

.check-rail {
  position: sticky;
  top: calc(var(--head-h) + 28px);
}

.progress-block {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.ring {
  position: relative;
  width: clamp(108px, 12vw, 148px);
  height: clamp(108px, 12vw, 148px);
  flex: none;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 1.6;
}

.ring-track {
  stroke: var(--line);
}

.ring-fill {
  stroke: var(--red);
  stroke-linecap: round;
  stroke-dasharray: 439.82;
  stroke-dashoffset: 439.82;
  transition: stroke-dashoffset 0.6s var(--ease-out);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.ring-label b {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.ring-label b small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0;
}

.ring-label span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-copy h2 {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 1.9vw, 1.7rem);
  font-weight: 520;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.progress-copy p {
  max-width: 20em;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.progress-copy .save-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.progress-copy .save-note::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.filter-block {
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}

.filter-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-group .chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 10.5px;
}

.rail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 18px;
}

.rail-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.rail-actions button:hover {
  color: var(--red);
}

.rail-actions svg {
  width: 12px;
  height: 12px;
}

.rail-foot {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.rail-foot a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

/* ---------- list ---------- */

.check-list {
  min-width: 0;
  border-top: 1px solid var(--ink);
}

.cat-section {
  scroll-margin-top: calc(var(--head-h) + 16px);
}

.cat-head {
  position: sticky;
  top: var(--head-h);
  z-index: 20;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 239, 230, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}

.cat-head .cat-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.cat-head .cat-num {
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.cat-head h2 {
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.1vw, 1.75rem);
  font-weight: 540;
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-head .cat-count {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.cat-items {
  border-bottom: 1px solid var(--line);
}

.check-row {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 16px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition:
    background 0.18s ease,
    padding 0.3s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row:hover {
  padding-left: 12px;
  padding-right: 4px;
  background: rgba(255, 255, 255, 0.22);
}

.check-row:active {
  background: var(--paper-deep);
}

.check-box {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.4s var(--ease-spring);
}

.check-box svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--paper-high);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.22s ease 0.04s;
}

.check-row[aria-checked="true"] .check-box {
  border-color: var(--red);
  background: var(--red);
  transform: scale(1.04);
}

.check-row[aria-checked="true"] .check-box svg {
  stroke-dashoffset: 0;
}

.check-row .item-main {
  min-width: 0;
}

.item-name {
  display: inline;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  background-image: linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat;
  background-position: 0 64%;
  background-size: 0 1px;
  transition:
    color 0.22s ease,
    background-size 0.4s var(--ease-out);
}

.check-row[aria-checked="true"] .item-name {
  color: var(--muted);
  background-size: 100% 1px;
}

.item-note {
  display: block;
  max-width: 56em;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.optional-tag {
  display: inline-flex;
  align-items: center;
  align-self: start;
  margin-top: 3px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.check-row.is-optional .item-name {
  color: var(--ink-soft);
}

.check-row.is-optional[aria-checked="true"] .item-name {
  color: var(--muted);
}

.list-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.list-note::before {
  content: "※";
  color: var(--red);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
}

.print-head {
  display: none;
}

/* ---------- mobile progress bar ---------- */

.mobile-bar {
  display: none;
}

@media (max-width: 900px) {
  .check-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .check-rail {
    position: static;
  }

  .progress-block {
    padding-bottom: 20px;
  }

  .filter-block {
    padding-block: 18px;
  }

  .rail-actions,
  .rail-foot {
    display: none;
  }

  .cat-head {
    top: var(--head-h);
  }

  .check-page {
    padding-bottom: 84px;
  }

  .mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(243, 239, 230, 0.18);
    background: rgba(25, 25, 22, 0.94);
    color: var(--paper);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .mobile-bar .m-count {
    flex: none;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }

  .mobile-bar .m-count b {
    color: var(--red);
    font-weight: 400;
  }

  .mobile-bar .m-track {
    flex: 1;
    height: 2px;
    background: rgba(243, 239, 230, 0.2);
    overflow: hidden;
  }

  .mobile-bar .m-track i {
    display: block;
    height: 100%;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease-out);
  }

  .mobile-bar button {
    flex: none;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(243, 239, 230, 0.25);
    border-radius: 999px;
    color: var(--paper);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.05em;
  }

  .mobile-bar button:hover {
    border-color: var(--red);
  }
}

@media (max-width: 620px) {
  .check-intro {
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
  }

  .intro-facts b {
    font-size: 1.55rem;
  }

  .intro-facts span {
    font-size: 9.5px;
  }

  .progress-block {
    gap: 18px;
  }

  .ring {
    width: 104px;
    height: 104px;
  }

  .progress-copy h2 {
    font-size: 1.4rem;
  }

  .progress-copy p {
    font-size: 13.5px;
  }

  .check-row {
    grid-template-columns: 23px minmax(0, 1fr);
    gap: 12px;
    padding-block: 15px;
  }

  .optional-tag {
    grid-column: 2;
    justify-self: start;
    margin-top: 3px;
  }

  .cat-head h2 {
    font-size: 1.15rem;
  }

  .cat-head .cat-num {
    font-size: 10px;
  }

  .item-name {
    font-size: 15.5px;
  }

  .item-note {
    font-size: 13.5px;
  }
}

@media print {
  :root {
    --paper: #fff;
    --paper-high: #fff;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-head,
  .site-foot,
  .check-intro,
  .check-rail,
  .mobile-bar,
  .toast,
  .menu,
  .skip-link {
    display: none !important;
  }

  .check-page {
    padding-top: 0;
    padding-bottom: 0;
  }

  .check-layout {
    display: block;
    padding: 0;
  }

  .check-list {
    border-top: 0;
  }

  .cat-section[hidden] {
    display: block !important;
  }

  .check-row[hidden] {
    display: grid !important;
  }

  .print-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #000;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .cat-head {
    position: static;
    padding-top: 18px;
    background: #fff;
    break-after: avoid;
  }

  .check-row {
    break-inside: avoid;
    padding-block: 9px;
  }

  .check-row:hover {
    padding-inline: 8px;
    background: none;
  }

  .check-row[aria-checked="true"] .item-name {
    color: #555;
  }

  .item-note {
    color: #555;
  }
}

/* ---------- phone: compact overview before the list ---------- */

@media (max-width: 620px) {
  .check-intro {
    gap: 22px;
    padding-block: 36px 26px;
  }

  .check-layout {
    gap: 20px;
    padding-block: 18px 76px;
  }

  .progress-block {
    gap: 14px;
    padding-bottom: 12px;
  }

  .ring {
    width: 92px;
    height: 92px;
  }

  .progress-copy h2 {
    font-size: 1.3rem;
  }

  .progress-copy p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.65;
  }

  .progress-copy .save-note {
    margin-top: 9px;
  }

  .filter-block {
    padding-block: 14px;
  }

  .filter-label {
    margin-bottom: 8px;
  }

  .check-rail .filter-block + .filter-block .filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .check-rail .filter-block + .filter-block .filter-group::-webkit-scrollbar {
    display: none;
  }

  .check-rail .filter-block + .filter-block .filter-group .chip {
    flex: 0 0 auto;
  }
}

@media (max-width: 620px) {
  .check-rail,
  .check-rail .filter-block,
  .check-rail .filter-block + .filter-block .filter-group {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  .check-rail .filter-block + .filter-block {
    display: none;
  }
}
