/* Free cleaning schedule maker (/cleaning-schedule-maker). Uses the tokens in site.css. */

.sm-intro { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-block: 16px 28px; }
.sm-intro h1 { font-size: clamp(36px, 5.5vw, 56px); font-weight: 900; line-height: 1.04; letter-spacing: -0.02em; }

.sm-layout { display: flex; flex-direction: column; gap: 20px; }
.sm-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; align-items: start; }
.sm-card { margin: 0; min-width: 0; border: none; background: var(--surface); border-radius: 24px; padding: 18px 18px 16px; box-shadow: var(--card-edge); display: flex; flex-direction: column; gap: 12px; }
.sm-card legend { float: left; width: 100%; padding: 0; font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sm-card legend + * { clear: both; }
.sm-step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mint-wash); color: var(--rinse-text); font-size: 14px; font-weight: 900; }
.sm-hint, .sm-note { font-size: 14px; font-weight: 600; color: var(--muted); }

/* Room chips and day toggles: real buttons with a pressed state, marked by a tick as well as colour. */
.sm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-chip, .sm-day, .sm-week { font-family: inherit; font-weight: 800; color: var(--ink); background: var(--linen); border: 2px solid var(--hairline); cursor: pointer; }
.sm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 15px; }
.sm-chip:hover, .sm-day:hover, .sm-week:hover { border-color: var(--control); }
.sm-chip[aria-pressed="true"], .sm-day[aria-pressed="true"] { background: var(--mint-wash); border-color: var(--rinse); }
.sm-chip[aria-pressed="true"]::after { content: "✓"; color: var(--rinse-text); font-weight: 900; }

.sm-segments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--linen); }
.sm-segment { position: relative; }
.sm-segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sm-segment span { display: block; text-align: center; padding: 10px 2px; border-radius: 12px; font-size: 15px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.sm-segment input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 2px var(--rinse); }
.sm-segment input:focus-visible + span { outline: 3px solid var(--rinse); outline-offset: 2px; }

.sm-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sm-day { padding: 10px 0; border-radius: 14px; font-size: 15px; }
.sm-day[aria-pressed="false"] { color: var(--muted); border-style: dashed; }

/* Task picker: a fourth card across the full width, closed by default. */
.sm-picker { grid-column: 1 / -1; }
.sm-picker summary { cursor: pointer; list-style: none; font-size: 18px; font-weight: 900; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sm-picker summary::-webkit-details-marker { display: none; }
.sm-picker summary::after { content: "+"; margin-left: auto; color: var(--rinse-text); font-weight: 900; }
.sm-picker[open] summary::after { content: "–"; }
.sm-optional { font-size: 13px; font-weight: 800; color: var(--muted); }
.sm-pick-count { font-size: 14px; font-weight: 800; color: var(--rinse-text); background: var(--mint-wash); padding: 3px 10px; border-radius: 999px; }
.sm-pick-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.sm-pick-room { margin: 0; min-width: 0; border: none; padding: 12px; border-radius: 18px; background: var(--linen); }
.sm-pick-room legend { float: left; width: 100%; padding: 0 0 6px; font-size: 15px; font-weight: 900; }
.sm-pick-room ul { clear: both; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sm-pick { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: start; cursor: pointer; }
.sm-pick input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--rinse); }
.sm-pick .sm-glyph { font-size: 18px; }

/* Result */
.sm-result { background: var(--surface); border-radius: 32px; padding: clamp(16px, 3vw, 28px); box-shadow: var(--card-edge); display: flex; flex-direction: column; gap: 12px; }
.sm-fit { font-size: 16px; font-weight: 600; color: var(--ink-soft); background: var(--glow); border-radius: 20px; padding: 14px 18px; }
.sm-fit strong { color: var(--ink); font-weight: 800; }
.sm-link { font: inherit; font-weight: 800; color: var(--rinse-text); background: none; border: none; padding: 0; text-decoration: underline; cursor: pointer; }
.sm-paper { font-size: 14px; font-weight: 700; color: var(--muted); }
.sm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 4px; }
.sm-weeks { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-week { padding: 7px 14px; border-radius: 999px; font-size: 15px; }
.sm-week[aria-pressed="true"] { background: var(--ink); color: var(--linen); border-color: var(--ink); }
.sm-actions { display: flex; gap: 8px; }
.sm-small { padding: 10px 16px; font-size: 15px; }
.sm-ink { font-size: 14px; font-weight: 700; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.sm-ink input { width: 18px; height: 18px; accent-color: var(--rinse); }
.sm-copied { font-size: 14px; font-weight: 700; color: var(--rinse-text); }
.sm-copied:empty { display: none; }

.sm-table { width: 100%; border-collapse: separate; border-spacing: 6px 0; table-layout: fixed; }
.sm-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sm-table thead th { font-size: 13px; font-weight: 900; color: var(--muted); padding: 4px 0 8px; text-align: left; }
.sm-table abbr { text-decoration: none; }
.sm-corner, .sm-table tbody th { display: none; }
.sm-table td { vertical-align: top; background: var(--linen); border-radius: 16px; padding: 10px 8px; }
.sm-table td.sm-off { background: repeating-linear-gradient(135deg, var(--linen) 0 10px, var(--mint-wash) 10px 20px); }
.sm-hidden-week { display: none; }
.sm-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sm-tasks li { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: start; }
.sm-box { display: none; }
.sm-glyph { font-size: 20px; line-height: 1.1; }
.sm-task { display: flex; flex-direction: column; min-width: 0; }
.sm-name { font-size: 14px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.sm-meta { font-size: 12px; font-weight: 600; color: var(--muted); }
.sm-total { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hairline); font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.sm-rest { font-size: 14px; font-weight: 800; color: var(--muted); }
.sm-print-foot { display: none; }

/* Narrow screens: the chosen week as a list of days. Roles keep it a table for screen readers. */
@media (max-width: 860px) {
  .sm-table, .sm-table tbody, .sm-table tr, .sm-table td { display: block; }
  .sm-table thead { display: none; }
  .sm-table tr.sm-hidden-week { display: none; }
  .sm-table tr { display: flex; flex-direction: column; gap: 8px; }
  .sm-table td { display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; padding: 12px; }
  .sm-table td::before { content: attr(data-day); grid-row: 1 / span 2; font-size: 14px; font-weight: 900; color: var(--muted); padding-top: 2px; }
  .sm-table td > * { grid-column: 2; }
  .sm-tasks { gap: 10px; }
}

@media (max-width: 600px) {
  .sm-intro { padding-block: 4px 20px; }
  .sm-segment span { font-size: 14px; padding-inline: 0; }
  .sm-toolbar { flex-direction: column; align-items: stretch; }
  .sm-weeks { display: grid; grid-template-columns: repeat(4, 1fr); }
  .sm-week { padding-inline: 4px; font-size: 14px; }
  .sm-actions .btn { flex: 1; }
}

.sm-cta { padding-block: 48px 0; }
.sm-cta .launch .h2 { font-size: clamp(26px, 3.4vw, 36px); }
.sm-cta-link { margin-top: 8px; }
.sm-how { padding-block: 56px 0; max-width: 820px; display: flex; flex-direction: column; gap: 14px; }
.sm-how p { font-size: 17px; font-weight: 600; color: var(--ink-soft); }
.sm-faq { padding-block: 56px 72px; }

/* Print: one landscape page, all 4 weeks, tick boxes, nothing else. */
@page { size: landscape; margin: 8mm; }
@media print {
  :root { --linen: #F4F8F7; --mint-wash: #E6F2EE; --ink: #14302A; --muted: #4F625D; --hairline: #CBD8D4; color-scheme: light; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 10pt; line-height: 1.2; }
  .skip, .site-header, .site-footer, .sm-intro .pill, .sm-intro .lead, .sm-controls, .sm-paper, .sm-toolbar, .sm-ink, .sm-copied, .sm-cta, .sm-how, .sm-faq { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .sm-intro { padding: 0 0 1mm; }
  .sm-intro h1 { font-size: 14pt; }
  .sm-result { box-shadow: none; padding: 0; border-radius: 0; gap: 1.5mm; }
  .sm-fit { background: none; padding: 0; font-size: 8.5pt; }
  .sm-fit .sm-link { display: none; }

  /* Always the full table, whatever the screen width was. */
  .sm-table { display: table; border-spacing: 1mm; margin: 0 -1mm; width: calc(100% + 2mm); }
  .sm-table thead { display: table-header-group; }
  .sm-table tbody { display: table-row-group; }
  .sm-table tr, .sm-table tr.sm-hidden-week { display: table-row; break-inside: avoid; }
  .sm-table td { display: table-cell; padding: 1.2mm 1.4mm; border-radius: 1.6mm; font-size: 7pt; line-height: 1.15; }
  .sm-table td::before { content: none; }
  .sm-table thead th { font-size: 8pt; padding: 0 0 0 1.4mm; }
  .sm-corner, .sm-table tbody th { display: table-cell; width: 7mm; background: none; }
  .sm-table tbody th { font-size: 7pt; font-weight: 900; vertical-align: top; text-align: left; padding-top: 1.4mm; color: var(--muted); }

  .sm-tasks { gap: 0.6mm; }
  .sm-tasks li { grid-template-columns: auto auto 1fr; column-gap: 0.8mm; }
  .sm-box { display: block; width: 2.4mm; height: 2.4mm; margin-top: 0.2mm; border: 0.25mm solid var(--ink); border-radius: 0.5mm; background: #fff; }
  .sm-glyph { font-size: 6.5pt; line-height: 1.15; }
  .sm-tasks, .sm-task { font-size: 7pt; line-height: 1.15; }
  .sm-task { display: block; }
  .sm-name { font-size: 7pt; }
  .sm-meta { font-size: 6pt; white-space: nowrap; }
  .sm-total { font-size: 6pt; line-height: 1.15; margin-top: 0.8mm; padding-top: 0.6mm; }
  .sm-rest { font-size: 7pt; }
  .sm-print-foot { display: block; font-size: 7.5pt; font-weight: 700; color: var(--muted); }

  .sm-ink-saver .sm-glyph { display: none; }
  .sm-ink-saver .sm-tasks li { grid-template-columns: auto 1fr; }
  .sm-ink-saver .sm-table td, .sm-ink-saver .sm-table td.sm-off { background: none; box-shadow: inset 0 0 0 0.25mm var(--hairline); }
}
