:root {
  /* Cool-light LK Forge brand palette — keep EXACT across the family */
  --bg:        #f5f7ff;
  --surface:   #ffffff;
  --surface2:  #eceeff;
  --border:    #cdd1f0;
  --text:      #0f0f2e;
  --muted:     #515180;
  /* Per-tool accent — habit tracker teal */
  --accent:    #0d9488;
  --accent-h:  #0f766e;
  --accent-bg: #d6f5ef;
  --accent-fg: #115e59;
  --radius:    9px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.14);
  --mono:      'JetBrains Mono', 'Courier New', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Outfit', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100; }
.site-logo { font-family: 'Orbitron', sans-serif; font-size: 1.1rem; font-weight: 900; color: var(--text); letter-spacing: -.5px; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-link { display: none; align-items: center; justify-content: center; min-width: 92px; font-size: .875rem; font-weight: 600; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); color: var(--text); background: transparent; text-decoration: none; transition: background .18s, border-color .18s, color .18s, transform .1s; }
.nav-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; transform: translateY(-1px); }
@media (min-width: 700px) { .site-nav .nav-link { display: inline-flex; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; font-size: .8rem; color: var(--muted); }
.site-footer nav { margin-bottom: 6px; }
.site-footer a { color: var(--muted); } .site-footer a:hover { color: var(--text); text-decoration: none; }

/* Orbitron display headings */
.site-logo, .tool-hero h1, .section > h2 { font-family: 'Orbitron', sans-serif; }
.tool-hero h1 { font-weight: 900; font-size: clamp(1.4rem, 4.2vw, 2.05rem); letter-spacing: -.4px; line-height: 1.2; }
.section > h2 { font-weight: 700; }

/* Hero */
.tool-hero { max-width: 900px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px; background: #0f0e0d; display: flex; align-items: center; justify-content: center; }
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 720px; }

main { max-width: 900px; margin: 0 auto; padding: 20px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }
.card > h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.card > .card-sub { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 18px; font-family: inherit; font-size: .95rem; font-weight: 700; border: none; border-radius: var(--radius); cursor: pointer; background: var(--accent); color: #fff; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--accent-h); } .btn:active { transform: scale(.98); } .btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--muted); }
.btn-danger { background: var(--surface); color: #b91c1c; border: 1.5px solid var(--border); }
.btn-danger:hover { background: #fef2f2; border-color: #fca5a5; }

/* Controls layout */
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { font-family: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 9px 11px; width: 100%; }
.field textarea { resize: vertical; min-height: 118px; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
.field .hint { font-size: .76rem; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; gap: 3px; }
.seg button { border: none; background: transparent; font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 6px; cursor: pointer; min-height: 38px; }
.seg button.active { background: var(--surface); color: var(--accent-fg); box-shadow: var(--shadow); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Ready-made PDF downloads */
.pdf-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--accent-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 20px; }
.pdf-dl .pdf-dl-label { font-weight: 700; font-size: .92rem; color: var(--accent-fg); margin-right: 2px; }
.pdf-dl .pdf-dl-note { font-size: .82rem; color: var(--muted); flex-basis: 100%; }
@media (max-width: 620px) { .pdf-dl .btn { flex: 1; } }

/* Printable preview */
.preview-wrap { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: auto; background: #fff; }
.sheet { background: #fff; color: #111; padding: 26px 26px 30px; min-width: 640px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.sheet-title { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1.5rem; letter-spacing: -.5px; color: #111; }
.sheet-meta { font-size: .82rem; color: #555; text-align: right; }
.grid-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.grid-table th, .grid-table td { border: 1px solid #c9c9c9; padding: 0; text-align: center; }
.grid-table thead th { background: #f1f1f1; color: #333; font-weight: 700; padding: 6px 4px; font-size: .74rem; }
.grid-table .habit-col { text-align: left; padding: 9px 10px; font-weight: 600; color: #111; min-width: 150px; width: 34%; }
.grid-table thead .habit-col { background: #111; color: #fff; }
.grid-table tbody td { height: 30px; }
.grid-table .dow { display: block; font-weight: 400; font-size: .66rem; color: #888; }
.sheet-foot { margin-top: 14px; font-size: .72rem; color: #999; display: flex; justify-content: space-between; }

/* Interactive tracker */
.tracker-empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: .95rem; }
.add-row { display: flex; gap: 10px; margin-bottom: 18px; }
.add-row input { flex: 1; }
.htable { width: 100%; border-collapse: collapse; }
.htable th, .htable td { padding: 8px 6px; text-align: center; }
.htable thead th { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; border-bottom: 1px solid var(--border); }
.htable thead th.today { color: var(--accent-fg); }
.htable .hname { text-align: left; font-weight: 600; font-size: .95rem; min-width: 120px; }
.htable .hstreak { font-family: var(--mono); font-size: .78rem; color: var(--accent-fg); font-weight: 600; white-space: nowrap; }
.htable tbody tr { border-bottom: 1px solid var(--surface2); }
.day-cell { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background .12s, border-color .12s, transform .1s; }
.day-cell:hover { border-color: var(--accent); }
.day-cell.done { background: var(--accent); border-color: var(--accent); }
.day-cell.done svg { width: 16px; height: 16px; stroke: #fff; fill: none; }
.day-cell.today { box-shadow: 0 0 0 2px rgba(13,148,136,.35); }
.day-cell:active { transform: scale(.9); }
.hdel { background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 6px; min-height: 34px; }
.hdel:hover { color: #b91c1c; background: #fef2f2; }
.hdel svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.tracker-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 16px; }
.tracker-foot .wk-nav { display: inline-flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); }
.tracker-foot .wk-nav button { min-height: 38px; padding: 7px 12px; }

/* Trust row */
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.trust-item svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; flex-shrink: 0; }

/* Sections */
.section { max-width: 900px; margin: 16px auto; padding: 24px 20px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.section p { margin-bottom: 14px; }
.section h3 { font-size: 1.05rem; font-weight: 700; margin: 18px 0 6px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.step-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* Related links */
.related { display: flex; flex-wrap: wrap; gap: 10px; }
.related a { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface); }
.related a:hover { border-color: var(--accent); color: var(--accent-fg); text-decoration: none; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }

@media (max-width: 620px) {
  .tool-hero .hero-icon { width: 48px; height: 48px; } .tool-hero .hero-icon svg { width: 26px; height: 26px; }
  .controls-grid { grid-template-columns: 1fr; }
  .site-header { padding: 0 16px; }
  main, .section { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto; } }

/* ── Print: only the printable sheet, edge to edge ── */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .site-header, .tool-hero, .section, .site-footer, .no-print, .trust-row { display: none !important; }
  main { max-width: none; padding: 0; margin: 0; }
  #printable-card { border: none; box-shadow: none; padding: 0; margin: 0; }
  #printable-card > h2, #printable-card > .card-sub, #printable-card .print-controls { display: none !important; }
  .preview-wrap { border: none; overflow: visible; margin: 0; }
  .sheet { min-width: 0; padding: 0; width: 100%; }
  .grid-table { font-size: .8rem; }
  .grid-table tbody td { height: 26px; }
}
