/* ============================================================
   Shared styles for the checklist and the two calculators
   ============================================================ */

.tool-page { background: var(--porcelain-deep); }

.tool-head { padding: clamp(34px, 5vw, 60px) 0 26px; max-width: 780px; }
.tool-head h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.032em;
  margin: 0 0 16px;
}
.tool-head p {
  margin: 0;
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.sheet {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(27, 33, 64, 0.04), 0 30px 60px -44px rgba(27, 33, 64, 0.45);
  padding: clamp(22px, 3.4vw, 42px);
}

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

.progress-wrap { margin: 8px 0 18px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.progress-meta b { color: var(--ink); font-weight: 600; letter-spacing: 0.1em; }
.progress-track {
  height: 4px;
  background: rgba(27, 33, 64, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  transition: width 0.45s var(--ease);
}

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

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

.task { border-top: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 1px solid var(--line-soft); }

.task label {
  display: grid;
  grid-template-columns: 34px 42px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 24px 4px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.task label:hover { background: rgba(234, 223, 203, 0.28); }

.task input { position: absolute; opacity: 0; width: 0; height: 0; }

.task .box {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.task .box svg { width: 16px; height: 16px; opacity: 0; transform: scale(0.7); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.task input:checked + .box { background: var(--ink); border-color: var(--ink); }
.task input:checked + .box svg { opacity: 1; transform: none; }
.task input:focus-visible + .box { outline: 2px solid var(--brass); outline-offset: 3px; }

.task .num {
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--brass);
  padding-top: 4px;
  letter-spacing: 0.06em;
}

.task h2 {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.16;
  letter-spacing: -0.018em;
  margin: 0 0 6px;
  transition: color 0.2s var(--ease);
}
.task p { margin: 0; font-size: 1.125rem; line-height: 1.55; color: var(--ink-soft); }

.task input:checked ~ .task-body h2 { color: var(--ink-mute); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--brass-light); }

.task .tag {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  white-space: nowrap;
  margin-top: 4px;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 24px 0 64px;
}

.howto {
  margin: 0 0 64px;
  padding: 22px 26px;
  border-left: 2px solid var(--brass-light);
  background: rgba(234, 223, 203, 0.34);
  max-width: none;
}
.howto h2 { font-family: var(--serif); font-size: 1.125rem; margin: 0 0 8px; }
.howto p { margin: 0; font-size: 1.125rem; color: var(--ink-soft); line-height: 1.6; }

/* ---------- calculators ---------- */

.calc-form { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-end; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.field input, .field select {
  height: 52px;
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 1.125rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.field input:focus, .field select:focus { border-color: var(--brass); }
.field input[type="date"] { min-width: 200px; }

.result { display: none; margin-top: 30px; }
.result.show { display: block; }

.card-line {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(22px, 3.4vw, 40px);
  align-items: center;
}

.playing-card {
  aspect-ratio: 5 / 7;
  border: 1px solid rgba(27, 33, 64, 0.35);
  border-radius: 7px;
  background: #fffdf9;
  box-shadow: 0 22px 40px -30px rgba(27, 33, 64, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  position: relative;
}
.playing-card .corner {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 0.9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.playing-card .corner span { font-size: 1.125rem; }
.playing-card .corner.bottom { transform: rotate(180deg); }
.playing-card .pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
}
.playing-card.red { color: #9c3a2a; }
.playing-card.black { color: var(--ink); }

.result-label {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 8px;
}
.result h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.028em;
  line-height: 1.02;
  margin: 0 0 12px;
}
.result .result-note { margin: 0; font-size: 1.125rem; color: var(--ink-soft); max-width: 46ch; }

.steps {
  margin: 26px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
  display: grid;
  gap: 8px;
}
.steps li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  font-size: 1.125rem;
  color: var(--ink-soft);
}
.steps li b {
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 1.125rem;
  color: var(--ink-mute);
  padding-top: 3px;
}
.steps li span { font-variant-numeric: tabular-nums; color: var(--ink); }

.mini-table {
  margin: 26px 0 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 1.125rem;
}
.mini-table th, .mini-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.mini-table th { font-size: 1.125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; }

.weekday-big {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}

.planet-line { display: flex; align-items: center; gap: 12px; font-size: 1.125rem; color: var(--ink-soft); }
.planet-line .glyph {
  font-family: "DejaVu Sans", var(--sans);
  font-size: 1.7rem;
  color: var(--brass);
  line-height: 1;
}

.empty-state {
  margin-top: 26px;
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  font-size: 1.125rem;
  color: var(--ink-mute);
  text-align: center;
}
.result.show + .empty-state { display: none; }

/* ---------- print ---------- */

.print-sheet { display: none; }

@media print {
  @page { size: letter portrait; margin: 16mm 16mm; }
  html, body { background: #fff !important; }
  .site-header, .site-footer, .tool-head, .sheet, .sheet-actions, .howto, .progress-wrap, .print-hide { display: none !important; }
  .print-sheet { display: block !important; }
  body.preview-print .print-sheet { padding: 0 !important; border: 0 !important; margin: 0 !important; }
  body.preview-print .print-sheet { display: block; background: #fff; padding: 26px 30px; border: 1px dashed #c9c0ae; margin-bottom: 30px; }
  .ps-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #1b2140; padding-bottom: 7pt; margin-bottom: 12pt; }
  .ps-head h1 { font-family: var(--serif); font-size: 24pt; letter-spacing: -0.03em; margin: 0 0 3pt; }
  .ps-head p { margin: 0; font-size: 8pt; color: #6b7089; }
  .ps-head .mark { width: 30pt; height: 30pt; }
  .ps-fields { display: flex; gap: 24pt; margin-bottom: 14pt; font-size: 8pt; }
  .ps-fields div { flex: 1; border-bottom: 1px solid #9aa0b4; padding-bottom: 4pt; }
  .ps-fields span { display: block; font-size: 6.4pt; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8fa3; margin-bottom: 8pt; }
  .ps-item { display: grid; grid-template-columns: 18pt 16pt minmax(0, 1fr); gap: 9pt; padding: 21pt 0; border-bottom: 1px solid #ddd5c6; page-break-inside: avoid; }
  .ps-item .box { width: 13pt; height: 13pt; border: 1.2pt solid #1b2140; border-radius: 1pt; margin-top: 2pt; display: flex; align-items: center; justify-content: center; font-size: 10pt; }
  .ps-item .n { font-family: var(--serif); font-size: 9pt; color: #a8823e; }
  .ps-item h2 { font-family: var(--serif); font-size: 12pt; margin: 0 0 3pt; letter-spacing: -0.01em; }
  .ps-item p { margin: 0; font-size: 8.6pt; color: #4a5069; line-height: 1.4; }
  .ps-item .done { margin-top: 5pt; font-size: 7pt; color: #8a8fa3; letter-spacing: 0.06em; }
  .ps-notes { margin-top: 18pt; }
  .ps-notes b { display: block; font-size: 6.6pt; letter-spacing: 0.16em; text-transform: uppercase; color: #8a8fa3; margin-bottom: 10pt; }
  .ps-notes .line { border-bottom: 1px solid #ddd5c6; height: 20pt; }
  .ps-foot { margin-top: 12pt; display: flex; justify-content: space-between; font-size: 6.6pt; color: #8a8fa3; }
}

@media (max-width: 720px) {
  .task label { grid-template-columns: 30px 30px minmax(0, 1fr); gap: 12px; }
  .task .tag { grid-column: 3; justify-self: start; margin-top: 10px; }
  .card-line { grid-template-columns: 1fr; }
  .playing-card { max-width: 168px; }
  .steps li { grid-template-columns: 1fr; gap: 2px; }
}
