/* The sundial maker (/sundial, ADR 0044), light theme, on top of
   learn.css. sundial-dark.css overrides it for the dark theme. The sheets
   are paper: white with black ink in both themes, as they will print. */

/* ---- The form ---- */
.sd-form { margin: 4px 0 16px; }
.sd-kinds { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.sd-kinds legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.sd-kind {
  position: relative;
  display: block;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  line-height: 1.4;
}
.sd-kind:hover { border-color: var(--muted); }
.sd-kind input { position: absolute; left: 14px; top: 15px; margin: 0; accent-color: var(--accent-moon); }
.sd-kind:has(input:checked) { border-color: var(--accent-moon); background: var(--accent-moon-soft); }
.sd-kind:has(input:focus-visible) { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.sd-kind-name { display: block; font-weight: 650; }
.sd-kind-text { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.sd-fields { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.sd-fields label { display: grid; gap: 4px; font-size: 0.88rem; color: var(--muted); }
.sd-fields select, .sd-fields input {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  min-height: 38px;
}
.sd-width { display: flex; gap: 6px; }
.sd-width input { width: 6em; }
/* The width only matters for the playground dial; with :has() it shows only then. */
.sd-form:has(input[name="dial"]:checked:not([value="playground"])) .sd-playground-only { display: none; }
.sd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent-moon);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.sd-button:hover { background: var(--accent-moon-soft); }
.sd-button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.sd-button-strong { background: var(--accent-moon); color: #fff; }
.sd-button-strong:hover { background: #3b4a78; }
.sd-button[hidden] { display: none; }
/* With script the form updates as soon as a choice changes. */
.sd-live [data-sd-submit] { display: none; }

/* ---- Actions and the sheets ---- */
.sd-notice { margin: 8px 0 14px; }
.sd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 6px 0 14px; }
.sd-hint { color: var(--muted); font-size: 0.88rem; }
.sd-sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; align-items: start; }
.sd-sheet { margin: 0; }
.sd-paper {
  background: #fff;
  border: 1px solid #d9d5ca;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgb(20 24 40 / 0.12);
  /* The page's margins, so the preview looks like the paper. */
  padding: 4.2%;
}
.sd-svg { display: block; width: 100%; height: auto; }
.sd-a4 .sd-svg { aspect-ratio: 186 / 273; }
.sd-letter .sd-svg { aspect-ratio: 191.9 / 255.4; }
.sd-sheet figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.sd-busy .sd-sheets { opacity: 0.5; transition: opacity 0.2s; }

/* ---- Facts ---- */
.sd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px 22px; margin: 18px 0 0; }
.sd-facts > div { padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.sd-facts dt { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-moon); }
.sd-facts dd { margin: 2px 0 0; line-height: 1.5; }

/* ---- The correction table ---- */
.lx-card .sd-table-h { margin-top: 22px; }
.sd-table-wrap { overflow-x: auto; }
.sd-table { border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 560px; width: 100%; font-size: 0.92rem; }
.sd-table th, .sd-table td { padding: 5px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.sd-table thead th { font-weight: 650; color: var(--muted); }
.sd-table tbody th { color: var(--muted); font-weight: 500; text-align: right; }
.sd-table .sd-now { background: var(--accent-sun-soft); font-weight: 700; border-radius: 6px; }

/* ---- Print: only the sheets, one per page, at true size ---- */
@media print {
  @page { margin: 12mm; }
  body.sd-printing > *:not(main), .sd-printing .site-header, .sd-printing .site-footer, .sd-printing .circumstances { display: none !important; }
  .sd-printing .sd-page > *:not(.sd-maker), .sd-printing .sd-maker > *:not(.sd-sheets) { display: none !important; }
  .sd-printing .sd-maker { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
  .sd-printing .sd-sheets { display: block; }
  .sd-printing .sd-sheet { break-after: page; break-inside: avoid; }
  .sd-printing .sd-sheet:last-child { break-after: auto; }
  .sd-printing .sd-sheet figcaption { display: none; }
  .sd-printing .sd-paper { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .sd-printing .sd-a4 .sd-svg { width: 186mm; height: 273mm; }
  .sd-printing .sd-letter .sd-svg { width: 191.9mm; height: 255.4mm; }
  .sd-printing main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
}
