/* Tend free tools: layered on top of /blog/blog.css (nav, footer, article body,
   banners). Quiet & Editorial: flat, 1px hairlines, colour only in the control. */

.tool-page { max-width: 760px; margin: 0 auto; padding: 24px 24px 0; }
.crumbs { font-size: 12.5px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.tool-page .article-title { margin-top: 10px; }
.tool-page .dek { margin-top: 10px; }

/* ---------- Counter widget ---------- */
.tally {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 18px 20px; position: relative;
}
.tally-top { display: flex; align-items: center; gap: 10px; }
.tally-label {
  flex: 1 1 0; min-width: 0; border: 1px solid transparent; background: transparent;
  font: 600 15px var(--sans); color: var(--ink); padding: 8px 10px; border-radius: 9px;
}
.tally-label::placeholder { color: var(--faint); }
.tally-label:hover { border-color: var(--line); }
.tally-label:focus { outline: none; border-color: var(--faint); background: var(--canvas); }

.tally-display { text-align: center; padding: 14px 0 4px; }
.tally-count {
  display: inline-block; font-family: var(--display); font-weight: 700;
  font-size: clamp(76px, 22vw, 132px); line-height: 1; letter-spacing: -3px;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.tally-count.neg { color: var(--coral); }
.tally-count.bump { animation: bump .16s ease-out; }
@keyframes bump { 0% { transform: scale(1.06); } 100% { transform: scale(1); } }

.tally-marks {
  margin: 14px auto 0; min-height: 34px; max-width: 520px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px;
}
.gate { width: 40px; height: 31px; }
.gate line { stroke: var(--teal); stroke-width: 3; stroke-linecap: round; }
.tally-more { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

.tally-controls {
  margin-top: 18px; display: grid; grid-template-columns: 76px 1fr; gap: 10px;
}
.tbtn {
  appearance: none; border: 1px solid var(--line); background: var(--chip); color: var(--ink);
  border-radius: 14px; cursor: pointer; font-family: var(--display); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background .12s ease, transform .06s ease;
}
.tbtn:active { transform: scale(0.98); }
.tbtn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tbtn.minus { height: 96px; font-size: 34px; }
.tbtn.plus {
  height: 96px; font-size: 40px; background: var(--teal); border-color: var(--teal); color: #fff;
}
.tbtn.plus:hover { background: #0D6E6D; }
.tbtn.minus:hover { background: var(--heat0); }

.tally-tools {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 8px 12px; font: 600 13px var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; touch-action: manipulation;
}
.chip:hover { border-color: var(--faint); }
.chip:disabled { color: var(--faint); cursor: default; border-color: var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper-inv); }
.chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
select.chip { padding-right: 10px; }
.chip[hidden] { display: none; }

.tally-foot { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.tally-foot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tally-foot-head h2 {
  margin: 0; font-family: var(--display); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.tally-stats { font-size: 12.5px; color: var(--muted); }
.tally-log { list-style: none; margin: 8px 0 0; padding: 0; }
.tally-log li {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 8px;
  padding: 5px 0; font-size: 13.5px; color: var(--body); border-bottom: 1px dashed var(--line);
}
.tally-log li:last-child { border-bottom: none; }
.tally-log .what { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tally-log .n { font-variant-numeric: tabular-nums; }
.tally-log .t { color: var(--faint); font-variant-numeric: tabular-nums; }
.tally-log-empty { margin: 8px 0 0; font-size: 13.5px; color: var(--faint); }
.tally-keys { margin: 12px 0 0; font-size: 12.5px; color: var(--faint); text-align: center; }
.tally-keys kbd, .article-body kbd {
  font: 600 11.5px var(--sans); color: var(--muted); background: var(--chip);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}

.tally-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px);
  background: var(--ink); color: var(--paper-inv); font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 9px; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; white-space: nowrap; max-width: 92%;
  overflow: hidden; text-overflow: ellipsis;
}
.tally-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* full screen / focus mode: just the number and the buttons */
.tally:fullscreen, .tally.focus {
  border-radius: 0; border: none; display: flex; flex-direction: column; justify-content: center;
  padding: 24px max(24px, env(safe-area-inset-left)); background: var(--canvas);
}
.tally.focus { position: fixed; inset: 0; z-index: 100; margin: 0; overflow-y: auto; }
.tally:fullscreen { margin: 0; }
.tally:fullscreen .tally-foot, .tally.focus .tally-foot,
.tally:fullscreen .tally-keys, .tally.focus .tally-keys { display: none; }
.tally:fullscreen .tally-count, .tally.focus .tally-count { font-size: clamp(110px, 30vw, 260px); }
.tally:fullscreen .tally-controls, .tally.focus .tally-controls { max-width: 640px; width: 100%; margin-left: auto; margin-right: auto; }
.tally:fullscreen .tbtn, .tally.focus .tbtn { height: 140px; }

/* ---------- Click counter: the whole panel is the button ---------- */
.hit {
  appearance: none; display: block; width: 100%; margin-top: 14px; border: none;
  border-radius: 14px; background: var(--teal); color: #fff; cursor: pointer;
  padding: 34px 16px 20px; text-align: center; font: inherit;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; transition: background .12s ease, transform .06s ease;
}
.hit:hover { background: #0D6E6D; }
.hit:active { transform: scale(0.99); }
.hit:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.tally-count.wheels {
  display: inline-flex; gap: 6px; letter-spacing: 0; color: var(--paper-inv);
  font-size: clamp(56px, 17vw, 96px);
}
.wheels .wheel {
  display: inline-block; min-width: 0.7em; padding: 8px 4px 6px; line-height: 1;
  background: var(--ink); border-radius: 10px;
}
.tally-count.wheels.neg { color: #FFB4A3; }
.hit-hint { display: block; margin-top: 14px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.82); }
.clicker .tally-tools { margin-top: 14px; }
.tally:fullscreen .hit, .tally.focus .hit { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tally:fullscreen .tally-count.wheels, .tally.focus .tally-count.wheels { font-size: clamp(72px, 22vw, 180px); }

/* ---------- App bridge under the tool ---------- */
.tool-bridge { margin-top: 14px; }

/* ---------- Content below the tool ---------- */
.tool-page .article-body { margin-top: 36px; }
.tool-page .article-body table td:first-child { white-space: nowrap; }

@media (min-width: 900px) {
  .tool-page { padding-top: 40px; }
  .tally { padding: 22px 26px 24px; margin-top: 26px; }
  .tally-controls { grid-template-columns: 110px 1fr; gap: 12px; }
  .tbtn.minus, .tbtn.plus { height: 110px; }
}

/* touch devices: the keyboard hint is noise */
@media (hover: none) { .tally-keys { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .tally-count.bump { animation: none; }
  .tbtn, .tally-toast { transition: none; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Multiple counter ---------- */
.multi-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.multi-total { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.multi-total strong {
  font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; margin-left: 4px;
}
.mc-grid {
  margin-top: 14px; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.mc { --acc: var(--teal); background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.mc-teal { --acc: var(--teal); }
.mc-indigo { --acc: var(--indigo); }
.mc-coral { --acc: var(--coral); }
.mc-emerald { --acc: var(--emerald); }
.mc-sky { --acc: var(--sky); }
.mc-head { display: flex; align-items: center; gap: 4px; }
.mc-key {
  flex: 0 0 auto; min-width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--chip); font: 700 10.5px var(--sans); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.mc-key:empty { visibility: hidden; }
.mc-name {
  flex: 1 1 0; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 7px;
  font: 600 13.5px var(--sans); color: var(--ink); padding: 5px 6px;
}
.mc-name:hover { border-color: var(--line); }
.mc-name:focus { outline: none; border-color: var(--faint); background: var(--surface); }
.mc-icon {
  appearance: none; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: 700 12px var(--sans); display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.mc-icon:hover { color: var(--ink); border-color: var(--faint); }
.mc-icon .dot { width: 10px; height: 10px; border-radius: 5px; background: var(--acc); }
.mc-hit {
  appearance: none; display: block; width: 100%; margin-top: 8px; border: none; border-radius: 10px;
  background: var(--acc); color: #fff; cursor: pointer; padding: 16px 6px 10px; text-align: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: filter .12s ease, transform .06s ease;
}
.mc-hit:hover { filter: brightness(0.92); }
.mc-hit:active { transform: scale(0.98); }
.mc-hit:focus-visible, .mc-btn:focus-visible, .mc-icon:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.mc-count {
  display: block; font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1;
  letter-spacing: -1px; font-variant-numeric: tabular-nums;
}
.mc-count.bump { animation: bump .16s ease-out; }
.mc-share { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; opacity: 0.85; }
.mc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.mc-btn {
  appearance: none; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 700 22px var(--display); cursor: pointer; touch-action: manipulation;
}
.mc-btn:hover { background: var(--heat0); }
.multi .tally-foot { margin-top: 16px; }
.tally.focus .mc-grid, .tally:fullscreen .mc-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tally.focus .mc-count, .tally:fullscreen .mc-count { font-size: clamp(48px, 9vw, 96px); }
.tally.focus .mc-hit, .tally:fullscreen .mc-hit { padding: 28px 6px 14px; }
.tally.multi.focus, .tally.multi:fullscreen { justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) { .mc-count.bump { animation: none; } .mc-hit { transition: none; } }
/* phones: compact rows so five or six counters fit on one screen. The coloured
   panel is the + (so the separate + button goes), − sits beside it. */
@media (max-width: 560px) {
  .mc-grid { grid-template-columns: 1fr; gap: 8px; }
  .mc { display: grid; grid-template-columns: 1fr 64px; column-gap: 6px; }
  .mc-head { grid-column: 1 / -1; }
  .mc-hit {
    margin-top: 6px; padding: 10px 14px; display: flex; align-items: baseline;
    justify-content: space-between; gap: 8px; text-align: left;
  }
  .mc-count { font-size: 38px; }
  .mc-share { margin-top: 0; }
  .mc-row { margin-top: 6px; grid-template-columns: 1fr; }
  .mc-plus { display: none; }
  .mc-minus { height: 100%; }
}
@media (hover: none) { .mc-key { display: none; } }

/* ---------- Printable habit tracker: controls ---------- */
#printable [hidden] { display: none !important; }
.pt-controls { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; }
.pt-field { display: grid; gap: 6px; }
.pt-field > span, .pt-legend { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pt-field input[type="text"], .pt-field input[type="month"], .pt-field input[type="date"], .pt-field select, .pt-field textarea {
  font: 500 15px var(--sans); color: var(--ink); background: var(--canvas); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; width: 100%;
}
.pt-field textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.pt-field input:focus, .pt-field select:focus, .pt-field textarea:focus { outline: none; border-color: var(--faint); background: #fff; }
.pt-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.pt-seg legend { margin-bottom: 6px; }
.pt-seg label { cursor: pointer; }
.pt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pt-seg label span {
  display: inline-block; padding: 8px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--canvas); font: 600 13.5px var(--sans); color: var(--ink);
}
.pt-seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper-inv); }
.pt-seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.pt-swatches label span { width: 30px; height: 30px; padding: 0; border-radius: 15px; border: 2px solid transparent; }
.pt-swatches input:checked + span { border-color: var(--ink); background: var(--sw); box-shadow: inset 0 0 0 3px var(--surface); }
.pt-swatches label span { background: var(--sw); }
.pt-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.pt-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.pt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pt-print {
  appearance: none; border: none; border-radius: 11px; background: var(--teal); color: #fff;
  font: 700 15.5px var(--sans); padding: 13px 20px; cursor: pointer;
}
.pt-print:hover { background: #0D6E6D; }
.pt-print:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.pt-hint { font-size: 12.5px; color: var(--muted); }
.pt-preview { margin-top: 16px; }
.pt-viewport { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (min-width: 900px) {
  .pt-controls { grid-template-columns: 1fr 1fr; padding: 22px 24px; gap: 16px 22px; }
  .pt-span2 { grid-column: 1 / -1; }
}

/* ---------- Printable habit tracker: the sheet (sized in mm for paper) ---------- */
.ps-sheet {
  --acc: #10807F; --rule: #CFC8BA;
  transform-origin: top left; background: #fff; color: #1A1814; font-family: var(--sans);
  display: flex; flex-direction: column; overflow: hidden;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6mm;
  border-bottom: 0.6mm solid var(--acc); padding-bottom: 2mm; margin-bottom: 4mm; }
.ps-head h2 { margin: 0; font: 700 16pt var(--display); letter-spacing: -0.2pt; color: var(--acc); }
.ps-head p { margin: 0; font-size: 8.5pt; color: #6E695F; text-align: right; }
.ps-grid { width: 100%; border-collapse: collapse; table-layout: fixed; flex: 1 1 auto; }
.ps-grid th, .ps-grid td { border: 0.25mm solid var(--rule); padding: 0; text-align: center; font-size: 7pt; }
.ps-grid thead th { background: color-mix(in srgb, var(--acc) 15%, #fff); font-weight: 700; height: 5mm; color: #1A1814; }
.ps-grid thead th.we { background: color-mix(in srgb, var(--acc) 28%, #fff); }
.ps-grid td.we { background: color-mix(in srgb, var(--acc) 6%, #fff); }
.ps-grid th.hn { text-align: left; padding-left: 2mm; font-size: 8pt; }
.ps-grid td.hn { text-align: left; padding: 0 2mm; font-size: 8.5pt; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-grid .gl, .ps-grid .tt { font-size: 7.5pt; }
.ps-grid col.c-hn { width: 46mm; }
.ps-grid col.c-gl { width: 11mm; }
.ps-grid col.c-tt { width: 12mm; }
.ps-month tbody td { height: 10mm; }
.ps-week col.c-hn { width: 52mm; }
.ps-week thead th { height: 10mm; }
.ps-week thead th b { display: block; font: 700 8.5pt var(--display); }
.ps-week thead th span { display: block; font-size: 7pt; font-weight: 600; color: #6E695F; }
.ps-week tbody td { height: 13mm; }
.ps-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-top: 5mm; }
.ps-notes div { border: 0.25mm solid var(--rule); border-radius: 2mm; height: 42mm; padding: 2mm 3mm; }
.ps-notes h3 { margin: 0; font: 700 9pt var(--display); color: var(--acc); }
.ps-cards { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 5mm; flex: 1 1 auto; }
.ps-card { border: 0.3mm solid var(--rule); border-radius: 3mm; padding: 3.5mm 4mm 4mm; display: flex; flex-direction: column; }
.ps-card-name { font: 700 11.5pt var(--display); border-bottom: 0.25mm solid var(--rule); padding-bottom: 1.5mm; min-height: 7mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-card-meta { margin-top: 1.8mm; font-size: 7pt; color: #6E695F; white-space: nowrap; overflow: hidden; }
.ps-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2mm; margin-top: 3.5mm; flex: 1 1 auto; align-content: space-evenly; }
.ps-dots span { aspect-ratio: 1; border: 0.35mm solid var(--acc); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 6.5pt; color: #A8A299; }
.ps-foot { margin-top: auto; padding-top: 2mm; display: flex; justify-content: space-between; font-size: 6.5pt; color: #A8A299; }

/* Print: only the sheet, at real size, no preview scaling or page chrome. */
@media print {
  body { background: #fff; padding: 0 !important; }
  body > *:not(main), main > *:not(#printable), #printable > *:not(.pt-preview), .pt-preview > *:not(.pt-viewport) { display: none !important; }
  main.tool-page, #printable, .pt-preview { margin: 0 !important; padding: 0 !important; max-width: none !important; border: 0 !important; background: none !important; }
  .pt-viewport { height: auto !important; overflow: visible !important; border: 0 !important; border-radius: 0 !important; }
  .ps-sheet { transform: none !important; }
}

/* ---------- Spreadsheet templates ---------- */
.dl-grid { margin-top: 20px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.dl-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  transition: border-color .15s ease;
}
.dl-card:hover { border-color: var(--faint); }
.dl-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dl-kind { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--emerald); }
.dl-name { font: 700 18px var(--display); letter-spacing: -0.2px; }
.dl-desc { font-size: 14px; line-height: 1.5; color: var(--muted); }
.dl-btn {
  margin-top: 6px; align-self: flex-start; background: var(--emerald); color: #fff;
  font: 700 14px var(--sans); padding: 9px 16px; border-radius: 9px;
}
.dl-card:hover .dl-btn { background: #186F4B; }
@media (min-width: 900px) { .dl-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }

.xl-preview { margin: 18px 0 0; }
.xl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.xl { border-collapse: collapse; font: 500 12.5px var(--sans); color: var(--ink); min-width: 640px; width: 100%; }
.xl th, .xl td { border: 1px solid #E2DED5; padding: 6px 7px; text-align: center; white-space: nowrap; }
.xl th { background: #DBEDEC; font-weight: 700; }
.xl th.we { background: #C9E3E2; }
.xl td.we { background: #EEF6F6; }
.xl .xl-h { text-align: left; font-weight: 700; }
.xl td.on { background: #10807F; color: #fff; font-weight: 700; }
.xl td.b { font-weight: 700; position: relative; }
.xl .bar { position: absolute; left: 3px; top: 4px; bottom: 4px; width: calc(var(--p) - 6px); background: rgba(16,128,127,0.25); border-radius: 2px; }
.xl-preview figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tool-page .article-body code { font-size: 0.9em; background: var(--chip); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

/* ---------- Online habit tracker ---------- */
.ht-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ht-today { font: 700 18px var(--display); letter-spacing: -0.2px; color: var(--ink); }
.ht-today small { display: block; font: 600 11.5px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.ht-form { margin-top: 12px; display: grid; gap: 10px; grid-template-columns: 1fr; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ht-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ht-form input, .ht-form select { font: 500 15px var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.ht-form-actions { display: flex; gap: 8px; align-items: end; }
.ht-form .pt-print { padding: 10px 16px; font-size: 14.5px; }
@media (min-width: 640px) { .ht-form { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }
#ht [hidden] { display: none !important; }
.ht-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.ht-empty { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.ht-habit { --acc: var(--teal); background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ht-teal { --acc: var(--teal); } .ht-indigo { --acc: var(--indigo); } .ht-coral { --acc: var(--coral); }
.ht-emerald { --acc: var(--emerald); } .ht-sky { --acc: var(--sky); }
.ht-main { display: flex; align-items: center; gap: 12px; }
.ht-ring { appearance: none; border: 0; background: none; padding: 0; width: 52px; height: 52px; flex: 0 0 auto; cursor: pointer; border-radius: 26px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ht-ring svg { width: 52px; height: 52px; display: block; }
.ht-ring text { font: 700 12px var(--display); fill: var(--ink); }
.ht-ring:active { transform: scale(0.95); }
.ht-ring:focus-visible, .ht-mini:focus-visible, .ht-day:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ht-info { flex: 1 1 auto; min-width: 0; }
.ht-name { font: 700 16px var(--display); letter-spacing: -0.2px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.ht-meta b { color: var(--acc); }
.ht-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.ht-mini { appearance: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 16px var(--display); cursor: pointer; }
.ht-mini:hover { border-color: var(--faint); }
.ht-week { margin-top: 10px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ht-day { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: 4px; touch-action: manipulation; }
.ht-day b { font-size: 11px; font-weight: 700; color: var(--faint); }
.ht-day.is-today b { color: var(--ink); }
.ht-day span { width: 100%; max-width: 44px; height: 22px; border-radius: 6px; background: var(--heat0); border: 1px solid transparent; }
.ht-day.part span { background: color-mix(in srgb, var(--acc) 35%, #fff); }
.ht-day.full span { background: var(--acc); }
.ht-day.is-today span { border-color: var(--ink); }
.ht-detail { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.ht-heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; max-width: 420px; }
.ht-heat i { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--acc) calc(var(--a) * 100%), var(--heat0)); }
.ht-heat i.fut { background: transparent; border: 1px dashed var(--line); }
.ht-edit { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ht-edit label { display: grid; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ht-edit input { font: 500 14px var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.ht-edit .ht-e-target { width: 72px; }
.ht-file { display: none; }

/* ---------- Free tools hub ---------- */
.hub-grid { margin-top: 22px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.hub-card h2 { margin: 8px 0 0; font: 700 19px var(--display); letter-spacing: -0.2px; color: var(--ink); }
.hub-card p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.hub-kind { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.hub-card .res-more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--teal); }
.hub-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; text-decoration: none; }
.hub-card:hover { border-color: var(--faint); }
@media (min-width: 720px) { .hub-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
