/* Habit Finder + habit tracker. Loaded after /quiz-kit/quiz.css, reuses its tokens and .app/.panel/.opt. */
.opt.sel { border-color: var(--primary); background: var(--right-bg); }
.opt.sel .key { background: var(--primary); color: #fff; }
.f-hint { font-size: .88rem; color: var(--text-light); margin: -1rem 0 1.1rem; }
.f-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.25rem; min-height: 2.75rem; }
.f-back { font: inherit; font-size: .9rem; font-weight: 600; color: var(--text-muted); background: none; border: 0; cursor: pointer; padding: .6rem 0; }
.f-back:hover { color: var(--primary-dark); }
.next:disabled { opacity: .35; cursor: not-allowed; }
.f-nojs { margin: 0; color: var(--text-muted); }
#finder.ready .f-nojs { display: none; }

.f-head { text-align: center; margin-bottom: 1.5rem; }
.f-head .score-of { margin-top: .2rem; }
.f-title { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hcards { display: grid; gap: 1rem; }
.hcard { border: 1.5px solid var(--border-color); border-radius: 1rem; padding: 1.15rem 1.25rem 1rem; background: #fff; }
.hgroup { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-dark); margin: 0 0 .35rem; }
.hcard h3 { display: flex; align-items: center; gap: .65rem; font-size: 1.15rem; font-weight: 800; line-height: 1.3; margin: 0 0 .75rem; }
.hnum { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--quiz-dark); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.hcard dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; margin: 0; font-size: .93rem; line-height: 1.55; }
.hcard dt { font-weight: 700; color: var(--text); }
.hcard dd { margin: 0; color: var(--text-muted); }
@media (max-width: 520px) { .hcard dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; } .hcard dd { margin-bottom: .45rem; } }
.hswap { font: inherit; font-size: .85rem; font-weight: 600; color: var(--primary-dark); background: none; border: 0; padding: .7rem 0 0; cursor: pointer; }
.hswap:hover { text-decoration: underline; }
.f-actions { margin-top: 1.25rem; }
.f-app { margin-top: 1.25rem; }

/* full list below the tool */
.hlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.5rem; margin: 1rem 0 1.5rem; }
@media (max-width: 640px) { .hlist { grid-template-columns: minmax(0, 1fr); } }
.hlist div { border-bottom: 1px dashed var(--border-color); padding-bottom: .6rem; }
.hlist strong { display: block; color: var(--text); font-size: .98rem; }
.hlist span { color: var(--text-muted); font-size: .92rem; line-height: 1.5; }

/* tracker */
.tk-presets { margin-bottom: 1.25rem; }
/* Own class, not .chips: ns-reading.js turns every .app .chips row into a one-line segmented control. */
.tk-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.tk-rows { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.tk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.tk-row input { font: inherit; font-size: 16px; padding: .7rem .85rem; border: 1.5px solid var(--border-color); border-radius: .7rem; width: 100%; }
.tk-row input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.tk-row button { font: inherit; font-size: .85rem; font-weight: 600; color: var(--text-muted); background: #fff; border: 1.5px solid var(--border-color); border-radius: .7rem; padding: 0 .9rem; cursor: pointer; min-height: 44px; }
.tk-add { font: inherit; font-size: .9rem; font-weight: 700; color: var(--primary-dark); background: none; border: 1.5px dashed var(--border-color); border-radius: .7rem; padding: .7rem; width: 100%; cursor: pointer; }
.tk-grid-wrap { margin: 1.25rem 0 .5rem; }
/* Fixed layout at 100% width: tracker.js picks the days per block so the row always fits, no sideways scroll. */
.tk-grid { border-collapse: separate; border-spacing: 3px; font-size: .8rem; width: 100%; table-layout: fixed; }
.tk-grid th { font-weight: 600; color: var(--text-light); text-align: center; padding: 0 0 .25rem; overflow: hidden; }
.tk-grid th.tk-name { width: 9rem; text-align: left; color: var(--text); font-size: .85rem; padding-right: .5rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.tk-grid td { text-align: center; padding: 0; }
.tk-grid td button { width: 100%; max-width: 2.3rem; aspect-ratio: 1 / 1; border-radius: .45rem; border: 1.5px solid var(--border-color); background: #fff; cursor: pointer; padding: 0; font-size: .72rem; color: var(--text-light); font-weight: 600; display: block; margin: 0 auto; }
.tk-grid td button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 480px) { .tk-grid th.tk-name { width: 30%; font-size: .78rem; } .tk-grid { border-spacing: 2px; font-size: .72rem; } .tk-grid td button { border-radius: .35rem; } }
.tk-grid td button.today { border-color: var(--quiz-dark); }
.tk-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .9rem; color: var(--text-muted); margin: .75rem 0 0; }
.tk-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.tk-note { font-size: .82rem; color: var(--text-light); margin-top: .75rem; }
.tk-src { display: none; }
.tk-table { overflow-x: auto; margin: 1rem 0 1.5rem; }
.tk-table table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 30rem; }
.tk-table th, .tk-table td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--border-color); color: var(--text-muted); line-height: 1.5; }
.tk-table th { color: var(--text); font-weight: 700; background: var(--right-bg); }
.tk-table td:first-child { color: var(--text); font-weight: 700; }
@media print { .tk-src { display: block; font-size: .7rem; color: #64748b; margin-top: .75rem; } }

@media print {
  /* quiz.css prints only #all-questions (visibility trick); habit pages print the tool instead. */
  body * { visibility: visible !important; }
  #all-questions { position: static !important; }
  #ns-nav, .pillar-hero, .breadcrumbs, .prose, .cta, footer, .ns-landing-footer, .f-actions, .hswap, .f-app, .tk-presets, .tk-rows, .tk-add, .no-print, .ns-promo,
  #tracker .setup-label, #tracker .tk-chips, #tracker .row, #tracker .btn-row, #tracker .tk-note, .ns-bar, [class*="ns-sticky"], [id*="consent"], [class*="consent"] { display: none !important; }
  .tk-grid td button { border-color: #94a3b8; max-width: 1.4rem; border-radius: .3rem; }
  .pillar-page .wrap { max-width: none; padding: 0; }
  .tk-grid { border-spacing: 2px; font-size: .65rem; }
  .tk-grid th.tk-name { width: 8rem; font-size: .72rem; }
  body { background: #fff !important; }
  .app { box-shadow: none; border: 0; padding: 0; margin: 0; }
  .panel { display: none !important; }
  .panel.on { display: block !important; animation: none; }
  .hcard { break-inside: avoid; }
  @page { margin: 12mm; }
}
