/* Printable habit tracker. Builds on site.css + tools.css tokens. */

.ht-shell { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.ht-shell .tool-controls { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ht-shell .tool-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.ht-inputs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
@media (min-width: 560px) { .ht-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ht-in { display: grid; grid-template-columns: 1.5rem 1fr; align-items: center; gap: 0.5rem; }
.ht-in b { font-size: 0.78rem; color: var(--clay-ink); text-align: right; }
.ht-examples { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.4rem; }
.ht-examples button { font: inherit; font-size: 0.88rem; padding: 0.42rem 0.85rem; border-radius: 999px; border: 1px solid rgba(28, 24, 20, 0.16); background: var(--paper); color: var(--ink-soft); cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.ht-examples button:hover { border-color: var(--clay); }
.ht-examples button:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

.ht-options { display: grid; gap: 1rem; }
.ht-options .seg { max-width: 100%; }
.ht-options .t-label { margin-bottom: 0.35rem; }

.ht-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; margin-bottom: 1rem; }
.ht-actions .privacy-note { flex: 1 1 18rem; }

/* The sheet (screen preview and print) */
.ht-scroll { overflow-x: auto; padding: 0.4rem 0 1rem; -webkit-overflow-scrolling: touch; }
.ht-sheet { background: #fff; color: #1c1814; border: 1px solid var(--line); border-radius: 14px; padding: clamp(0.9rem, 2.4vw, 1.6rem); box-shadow: 0 30px 60px -38px rgba(72, 43, 24, 0.45); min-width: 50rem; }
.ht-sheet.is-week { min-width: 34rem; max-width: 46rem; }
.ht-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.7rem; }
.ht-title h2 { font-family: var(--serif); font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; }
.ht-title p { margin: 0; font-weight: 600; color: #6e6052; }
.ht-blank { display: inline-block; width: 7rem; border-bottom: 1px solid #1c1814; vertical-align: baseline; }

.ht-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.8rem; }
.ht-table .ht-namecol { width: 21%; }
.is-week .ht-table .ht-namecol { width: 26%; }
.ht-table th, .ht-table td { border: 1px solid #b9ad9d; padding: 0; text-align: center; }
.ht-table th.ht-corner { text-align: left; padding: 0 0.5rem; font-size: 0.78rem; background: #f3e9dc; }
.ht-table th.ht-wd, .ht-table th.ht-dn { background: #f7f0e6; font-weight: 600; font-size: 0.72rem; line-height: 1.5; }
.ht-table th.ht-dn { font-weight: 500; color: #3a3029; }
.ht-table th.we, .ht-table td.we { background: #f3ebe0; }
.ht-table th.ht-name { vertical-align: middle; text-align: left; font-weight: 500; padding: 0 0.5rem; height: 1.95rem; overflow: hidden; line-height: 1.15; font-size: 0.78rem; }
.is-week .ht-table th.ht-name, .is-week .ht-table td { height: 2.6rem; }
.ht-table td { height: 1.95rem; position: relative; }

/* Soft style: round check circles, warm colours */
.style-soft .ht-table { border-collapse: separate; border-spacing: 3px; }
.style-soft .ht-table th, .style-soft .ht-table td { border: 0; border-radius: 8px; }
.style-soft .ht-table th.ht-corner { background: #ead6c3; color: #5a2d16; }
.style-soft .ht-table th.ht-wd, .style-soft .ht-table th.ht-dn { background: #f8ece0; }
.style-soft .ht-table th.ht-name { background: #fbf4ec; border-radius: 8px; }
.style-soft .ht-table td { background: #fbf4ec; }
.style-soft .ht-table td.we, .style-soft .ht-table th.we { background: #f3e1d0; }
.style-soft .ht-table td::after { content: ""; position: absolute; inset: 0; margin: auto; width: min(1.1rem, 72%); height: auto; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid #c9a98f; background: #fff; }
.style-soft .ht-title h2 { color: #5a2d16; }

.ht-below { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.ht-box { border: 1px solid #b9ad9d; border-radius: 8px; padding: 0.5rem 0.7rem 0.3rem; }
.ht-box b { font-size: 0.78rem; color: #6e6052; font-weight: 600; }
.style-soft .ht-box { border: 0; background: #fbf4ec; border-radius: 12px; }
.ht-line { display: block; height: 1.5rem; border-bottom: 1px solid #cfc4b4; }
.ht-foot { margin: 0.8rem 0 0; font-size: 0.72rem; color: #6e6052; text-align: center; }

@media (max-width: 560px) {
  .ht-actions .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ht-examples button { transition: none; }
}

@media print {
  html, body { background: #fff !important; }
  .site-header, .site-footer, .sticky-get, .t-toast, .print-hide { display: none !important; }
  main { padding: 0 !important; margin: 0 !important; }
  .ht-shell { display: block; width: 100%; max-width: none; margin: 0; }
  .ht-scroll { overflow: visible; padding: 0; }
  .ht-sheet, .ht-sheet.is-week { min-width: 0; max-width: none; width: 100%; border: 0; border-radius: 0; box-shadow: none; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ht-title { margin-bottom: 3mm; }
  .ht-title h2 { font-size: 17pt; }
  .ht-title p { font-size: 11pt; }
  .ht-table { font-size: 8.5pt; }
  .ht-table th.ht-wd, .ht-table th.ht-dn { font-size: 7.5pt; }
  .ht-table td, .ht-table th.ht-name { height: 8.2mm; }
  .is-week .ht-table td, .is-week .ht-table th.ht-name { height: 14mm; }
  .ht-table th, .ht-table td { border-width: 0.4pt; }
  .style-soft .ht-table th, .style-soft .ht-table td { border: 0; }
  .style-soft .ht-table td::after { width: 5mm; border-width: 0.5pt; }
  .ht-table th.ht-name { font-size: 8pt; }
  .ht-below { margin-top: 4mm; gap: 5mm; break-inside: avoid; }
  .ht-line { height: 7mm; }
  .ht-foot { font-size: 7.5pt; margin-top: 3mm; }
}
