/* =============================================================
   Psychofarm - the Tools pages (tools/*.html), 2026-11-15
   -------------------------------------------------------------
   The form on the left, the handout it prints on the right (it
   follows as you type), the action bar on top, and the printed
   handout, wallet card and family page. Drawn by assets/js/tk.js;
   pages written by library-tools/kit.mjs. library.css supplies the
   colour tokens: each tool's hue is --h on .tk-page-wrap.
   ============================================================= */

.tk-wrap { padding-block: 0 64px; }

/* ---------- the action bar: pinned under the site header ---------- */
.tk-bar {
  position: sticky; top: var(--header-h, 72px); z-index: 25;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; padding: 12px 0;
  background: rgb(248 250 252 / .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--line);
}
.tk-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 0.875rem/1 var(--font-body); white-space: nowrap; transition: background .15s, box-shadow .15s, color .15s;
}
.tk-btn svg { width: 16px; height: 16px; flex: none; }
.tk-btn--go { background: #131B2D; color: #fff; }
.tk-btn--go:hover { background: #1E293B; }
.tk-btn--quiet { background: #fff; color: var(--heading-ink); box-shadow: inset 0 0 0 1px #CBD5E1; }
.tk-btn--quiet:hover { box-shadow: inset 0 0 0 1px #94A3B8; }
.tk-btn--ghost { background: none; color: var(--muted-light); padding: 0 10px; }
.tk-btn--ghost:hover { color: var(--heading-ink); }
.tk-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.tk-bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tk-keep { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--slate); cursor: pointer; }
.tk-keep input { width: 18px; height: 18px; accent-color: #131B2D; }
.tk-saved { font-size: 0.8125rem; color: var(--teal-deep); }
.tk-show { display: none; }

/* ---------- the layout: form and handout side by side ---------- */
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 32px; align-items: start; }
.tk-editor { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* a wide table scrolls inside its box, never the page */
.tk-preview { position: sticky; top: calc(var(--header-h, 72px) + 80px); min-width: 0; }
.tk-preview-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.tk-preview-h p { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-light); }
.tk-preview-h span { font-size: 0.8125rem; color: var(--muted-light); }
.tk-sheet {
  max-height: calc(100vh - var(--header-h, 72px) - 140px); overflow: auto; border-radius: 10px;
  background: #fff; box-shadow: 0 0 0 1px rgb(15 23 42 / .08), 0 22px 40px -28px rgb(15 23 42 / .45);
}
/* the page is drawn at letter width and shown smaller, like a document thumbnail */
.tk-sheet .tk-pagebox { width: 8.5in; padding: 0.6in 0.65in; zoom: 0.54; }
@supports not (zoom: 1) { .tk-sheet .tk-pagebox { width: 100%; } }
@media (max-width: 1180px) {
  .tk-layout { grid-template-columns: minmax(0, 1fr); }
  .tk-preview { display: none; position: static; }
  .tk-layout.show-page .tk-preview { display: block; }
  .tk-layout.show-page .tk-editor { display: none; }
  .tk-show { display: inline-flex; }
  .tk-sheet { max-height: none; }
  .tk-sheet .tk-pagebox { zoom: 0.8; }
}
@media (max-width: 640px) {
  .tk-bar { gap: 6px; padding: 10px 0; }
  .tk-btn { height: 38px; padding: 0 13px; font-size: 0.8125rem; }
  .tk-bar-end { margin-left: 0; width: 100%; justify-content: space-between; }
  .tk-sheet .tk-pagebox { zoom: 0.42; }
}

/* ---------- the steps of the form ---------- */
.tk-step {
  padding: 20px 22px 22px; border-radius: var(--lib-r, 14px); background: #fff;
  box-shadow: 0 0 0 1px rgb(15 23 42 / .08), 0 1px 2px rgb(15 23 42 / .05);
}
.tk-step-h { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin: 0 0 14px; }
.tk-step-h:not(:has(.tk-n)) { grid-template-columns: minmax(0, 1fr); }
.tk-n {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font: 700 0.9375rem/1 var(--font-body); color: #fff; background: var(--c-ink);
}
.tk-step-h h2 { margin: 3px 0 0; font-size: 1.1875rem; font-weight: 600; line-height: 1.3; color: var(--heading-ink); }
.tk-step-h p { margin: 4px 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--muted-light); }
.tk-step[data-tone="alert"] { box-shadow: 0 0 0 1px #FDBA9A, 0 1px 2px rgb(15 23 42 / .05); background: #FFFAF7; }
.tk-step[data-tone="alert"] .tk-n { background: #C2410C; }
.tk-tip {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--c-tint);
  font-size: 0.8125rem; line-height: 1.5; color: var(--c-ink);
}
.tk-tip b { font-weight: 700; }

/* fields */
.tk-field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.tk-field:last-child { margin-bottom: 0; }
.tk-label { display: block; margin: 0 0 6px; font-size: 0.875rem; font-weight: 600; color: var(--heading-ink); padding: 0; }
.tk-hint { display: block; margin: -2px 0 8px; font-size: 0.8125rem; color: var(--muted-light); line-height: 1.45; }
.tk-in, .tk-editor select {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid #CBD5E1; background: #fff;
  font: 400 1rem/1.4 var(--font-body); color: #131B2D;
}
textarea.tk-in { min-height: 2.9em; resize: vertical; overflow: hidden; }
.tk-in:focus { outline: 3px solid rgb(124 58 237 / .25); outline-offset: 0; border-color: var(--violet); }
.tk-in::placeholder { color: #7B8798; }
.tk-field--short { max-width: 15rem; display: inline-block; margin-right: 12px; vertical-align: top; }
.tk-fixed { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--c-tint); color: var(--c-ink); font-size: 0.875rem; line-height: 1.5; }
.tk-fixed a { color: inherit; font-weight: 600; }

/* lists, contacts and rows */
.tk-list, .tk-cts, .tk-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: tk; }
.tk-li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 6px; align-items: center; counter-increment: tk; }
.tk-li::before { content: counter(tk); position: absolute; left: -24px; top: 50%; transform: translateY(-50%); font: 600 0.75rem/1 var(--font-body); color: var(--muted-light); }
.tk-list { padding-left: 24px; }
.tk-ct { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 36px; gap: 6px; align-items: center; }
.tk-ct .tk-ct-x { grid-column: 1 / 3; }
.tk-ct:has(.tk-ct-x) .tk-x { grid-row: 1; grid-column: 3; }
.tk-row { display: grid; grid-template-columns: var(--cols) 36px; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--c-tint); }
.tk-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 0.75rem; font-weight: 600; color: var(--c-ink); }
.tk-cell .tk-in { font-size: 0.9375rem; padding: 8px 10px; }
.tk-cell--wide { grid-column: 1 / -2; }
.tk-x {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #64748B; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.tk-x:hover { background: #F1F5F9; color: var(--heading-ink); }
.tk-row .tk-x { align-self: end; }
.tk-add {
  margin-top: 8px; padding: 7px 12px; border: 0; border-radius: 999px; background: var(--c-tint); color: var(--c-ink);
  font: 600 0.8125rem/1 var(--font-body); cursor: pointer;
}
.tk-add::before { content: "+ "; }
.tk-add:hover { background: var(--c-line); }

/* idea chips: one tap adds the idea to the list, a second tap takes it off */
.tk-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed #E2E8F0; }
.tk-ideas-l { margin-right: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-light); }
.tk-idea {
  padding: 6px 11px; border: 0; border-radius: 999px; background: #F1F5F9; color: var(--slate);
  font: 500 0.8125rem/1.25 var(--font-body); text-align: left; cursor: pointer; transition: background .12s, color .12s;
}
.tk-idea:hover { background: #E2E8F0; color: var(--heading-ink); }
.tk-idea.is-on { background: var(--c-ink); color: #fff; }
.tk-idea.is-on::before { content: "\2713  "; }
.tk-idea:focus-visible, .tk-add:focus-visible, .tk-x:focus-visible, .tk-pill:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* choices, checks, scales */
.tk-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-pill { padding: 8px 14px; border: 0; border-radius: 999px; background: #F1F5F9; color: var(--slate); font: 600 0.875rem/1.3 var(--font-body); text-align: left; cursor: pointer; }
.tk-pill[aria-checked="true"] { background: #131B2D; color: #fff; }
.tk-check { display: grid; gap: 4px; }
.tk-ck { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 0.9375rem; line-height: 1.45; color: var(--slate); }
.tk-ck:hover { background: #F8FAFC; }
.tk-ck input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--c-lift); }
.tk-ck-other { margin-top: 6px; }
.tk-scale-row { display: flex; align-items: center; gap: 12px; }
.tk-scale-row input[type="range"] { flex: 1; accent-color: var(--c-lift); padding: 0; border: 0; }
.tk-scale-v { min-width: 2.4em; padding: 4px 8px; border-radius: 8px; background: var(--c-tint); color: var(--c-ink); font: 700 0.9375rem/1.2 var(--font-body); text-align: center; }
.tk-scale-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.75rem; color: var(--muted-light); }

/* ---------- around the form: the visit guide, resources, the fine print ---------- */
.tk-coach { margin: 0 0 18px; border-radius: var(--lib-r, 14px); background: #fff; box-shadow: inset 0 0 0 1px rgb(15 23 42 / .08); }
.tk-coach > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px 18px; cursor: pointer; list-style: none; font-weight: 600; color: var(--heading-ink); }
.tk-coach > summary::-webkit-details-marker { display: none; }
.tk-coach > summary::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center no-repeat; }
.tk-coach[open] > summary::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.tk-coach > summary span { font-weight: 400; font-size: 0.875rem; color: var(--muted-light); }
.tk-coach-b { padding: 0 18px 16px 50px; }
.tk-coach-b ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.tk-coach-b li { font-size: 0.9375rem; line-height: 1.55; color: var(--slate); }
.tk-coach-b p { margin: 10px 0 0; font-size: 0.8125rem; color: var(--muted-light); line-height: 1.5; }

.tk-res { margin-top: 40px; }
.tk-res > h2 { margin: 0 0 4px; font-size: 1.375rem; font-weight: 600; color: var(--heading-ink); letter-spacing: -0.015em; }
.tk-res > p { margin: 0 0 16px; color: var(--muted-light); font-size: 0.9375rem; }
.tk-res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tk-res-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: #fff; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / .09); color: var(--heading-ink); transition: box-shadow .15s, transform .15s;
}
.tk-res-card:hover { box-shadow: inset 0 0 0 1px var(--c-dot); transform: translateY(-1px); }
.tk-res-card b { font-size: 0.9375rem; }
.tk-res-card span { font-size: 0.8125rem; line-height: 1.45; color: var(--muted-light); }
.tk-res-card small { margin-top: auto; padding-top: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink); }
.tk-fine { max-width: 52rem; margin: 28px 0 0; font-size: 0.8125rem; line-height: 1.6; color: var(--muted-light); }
.tk-fine a { color: var(--teal-deep); }

/* ---------- crisis lines (the safety plan, and anywhere a tool needs them) ---------- */
.tk-crisis { margin: 0 0 22px; padding: 18px 20px; border-radius: var(--lib-r, 14px); background: #FFF7F2; box-shadow: inset 0 0 0 1px #FBC9AE; }
.tk-crisis h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 1.125rem; font-weight: 700; color: #9A3412; }
.tk-crisis h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #EA580C; box-shadow: 0 0 0 4px rgb(234 88 12 / .18); }
.tk-crisis > p { margin: 0 0 14px; font-size: 0.9375rem; line-height: 1.5; color: #7C2D12; }
.tk-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tk-line { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #FCD7C4; }
.tk-line b { font-size: 0.9375rem; color: #431407; }
.tk-line span { font-size: 0.8125rem; line-height: 1.45; color: #7C2D12; }
.tk-line .tk-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tk-line a { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 999px; background: #C2410C; color: #fff; font-size: 0.8125rem; font-weight: 600; text-decoration: none; }
.tk-line a.alt { background: #fff; color: #9A3412; box-shadow: inset 0 0 0 1px #FDBA9A; }
.tk-line a:hover { filter: brightness(1.08); }
.tk-line--big { background: #C2410C; box-shadow: none; }
.tk-line--big b, .tk-line--big span { color: #fff; }
.tk-line--big a { background: #fff; color: #9A3412; }
.tk-line--big a.alt { background: rgb(0 0 0 / .24); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .55); }

/* ---------- the handout itself (screen preview and print) ---------- */
.tk-pagebox { color: #0F172A; font: 400 10.5pt/1.45 var(--font-body); background: #fff; }
.hp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; break-inside: avoid; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2.5px solid #0F172A; }
.hp-kicker { margin: 0 0 2px; font-size: 8.5pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #475569; }
.hp-head h1 { margin: 0; font: 700 20pt/1.1 var(--font-display); color: #0F172A; letter-spacing: -0.01em; }
.hp-date { margin: 0; font-size: 9pt; color: #475569; text-align: right; }
.hp-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: -4px 0 10px; font-size: 9pt; color: #334155; }
.hp-meta b { font-weight: 700; color: #0F172A; }
.hp-fill { display: inline-block; width: 1.3in; height: 1em; vertical-align: -2px; border-bottom: 1px solid #94A3B8; }
.hp-secs { display: grid; gap: 9px; }
.hp-secs--cols { grid-template-columns: 1fr 1fr; column-gap: 18px; }
.hp-sec { break-inside: avoid; padding: 8px 12px 9px; border: 1.25px solid #CBD5E1; border-radius: 8px; }
.hp-sec h2 { margin: 0 0 4px; font: 700 11pt/1.25 var(--font-display); color: #0F172A; }
.hp-sec[data-tone="alert"] { border-color: #C2410C; }
.hp-label { margin: 5px 0 2px; font-size: 8.5pt; font-weight: 700; color: #475569; }
.hp-list { margin: 0; padding-left: 1.3em; }
.hp-list li { margin: 1px 0; }
.hp-list--dots { list-style: disc; }
.hp-blank { list-style: none; height: 1.45em; margin-left: -1.3em !important; border-bottom: 1px solid #94A3B8; }
.hp-cts { margin: 0; padding: 0; list-style: none; }
.hp-cts li { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 2px 0; }
.hp-cts .hp-tel { font-weight: 600; }
.hp-cts .hp-x { flex-basis: 100%; font-size: 9pt; color: #475569; }
.hp-cts .hp-blank { margin-left: 0 !important; }
.hp-pair, .hp-text, .hp-fixed { margin: 3px 0; }
.hp-fixed { font-size: 9.5pt; padding: 4px 8px; border-radius: 6px; background: #F1F5F9; }
.hp-checks { margin: 2px 0; padding: 0; list-style: none; }
.hp-checks li { position: relative; padding: 1px 0 1px 18px; }
.hp-checks li::before { content: ""; position: absolute; left: 0; top: 0.38em; width: 10px; height: 10px; border: 1.25px solid #0F172A; border-radius: 2px; }
.hp-checks.is-done li::before { content: "\2713"; display: grid; place-items: center; font-size: 8px; line-height: 1; font-weight: 700; }
.hp-box { break-inside: avoid; margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #F1F5F9; }
.hp-box h3 { margin: 0 0 3px; font: 700 10.5pt/1.25 var(--font-display); color: #0F172A; }
.hp-box ul { margin: 0; padding-left: 1.15em; }
.hp-box li { margin: 1px 0; }
.hp-box p { margin: 2px 0; }
.hp-box--alert { background: #FFF1EB; border: 1.5px solid #C2410C; }
.hp-box--alert h3 { color: #9A3412; }
.hp-box--line { background: #fff; border: 1.25px solid #CBD5E1; }
.hp-h { margin: 12px 0 4px; font: 700 11pt/1.25 var(--font-display); color: #0F172A; }
.hp-note { margin: 0 0 4px; font-size: 9pt; color: #475569; }
.hp-table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 3px 0; }
.hp-table th, .hp-table td { border: 1px solid #94A3B8; padding: 4px 6px; text-align: left; vertical-align: top; }
.hp-table th { background: #F1F5F9; font-size: 8pt; }
.hp-table--log td { height: 1.9em; }
.hp-foot { margin-top: 12px; padding-top: 5px; border-top: 1px solid #CBD5E1; font-size: 7.5pt; color: #64748B; }

/* ---------- the wallet card: two folded cards to a page ---------- */
.tk-wallet, .tk-family { display: none; }
.wc-how { font-size: 9pt; color: #475569; margin: 0 0 10px; }
.wc-card { display: grid; grid-template-columns: 1fr 1fr; width: 7in; height: 2.25in; margin: 0 0 0.35in; border: 1.25px solid #0F172A; break-inside: avoid; }
.wc-panel { position: relative; padding: 0.12in 0.16in; overflow: hidden; font-size: 7.5pt; line-height: 1.3; }
.wc-front { border-right: 1.25px dashed #64748B; }
.wc-title { margin: 0 0 3px; font: 700 10pt/1.1 var(--font-display); color: #0F172A; }
.wc-row { margin: 0 0 3px; }
.wc-l { margin: 0; font-size: 6.5pt; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #475569; }
.wc-row ul { margin: 0; padding-left: 1.05em; }
.wc-row li { margin: 0; }
.wc-blank { list-style: none; height: 1.2em; margin-left: -1.05em; border-bottom: 1px solid #94A3B8; }
.wc-fixed { margin: 3px 0 0; padding: 3px 6px; border-radius: 4px; background: #0F172A; color: #fff; font-size: 7.5pt; font-weight: 600; }

/* ---------- print: one part at a time ---------- */
@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff !important; }
  .site-header, .site-footer, .disclaimer-band, .lib-tabs, .lib-head, .lib-band, .tk-bar, .tk-editor, .tk-preview-h, .tk-coach, .tk-res, .tk-fine,
  .tk-crisis, .tk-crisis-line, .skip-link, .pf-lt-overlay, .lib-modal, .pf-fav-toast, .tk-toast, .lt-locked, .lt-wait { display: none !important; }
  .tk-wrap, .lt-page { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .tk-layout { display: block !important; }
  .tk-preview { display: block !important; position: static !important; }
  .tk-sheet { max-height: none !important; overflow: visible !important; box-shadow: none !important; border-radius: 0 !important; }
  .tk-sheet .tk-pagebox { zoom: var(--tk-print-zoom, 1) !important; width: auto !important; padding: 0 !important; }   /* tk.js fit() */
  .tk-pagebox, .hp-sec, .hp-box, .hp-table th, .wc-fixed, .tk-n { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html[data-tk-print="wallet"] .tk-preview, html[data-tk-print="family"] .tk-preview { display: none !important; }
  html[data-tk-print="wallet"] .tk-wallet { display: block !important; }
  html[data-tk-print="family"] .tk-family { display: block !important; }
}

/* =============================================================
   The Tools page (tools/index.html): the Guide Builder featured on
   top, then the tools in four groups, each in its group's colour.
   ============================================================= */
.tk-jumpband { padding: 14px 0; }
.tk-jump b { color: var(--on-dark-soft); }
.tk-index { padding-top: 32px; }

/* the featured tool: a wide panel with the steps and a stack of pages */
.tk-feature {
  position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center;
  margin: 0 0 48px; padding: 34px 38px; border-radius: 24px; color: var(--heading-ink); --h: 286;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(248, 68, 100, .12) 0%, transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(100, 152, 236, .16) 0%, transparent 65%),
    linear-gradient(150deg, #FFF6F1 0%, #F7F3FB 55%, #EEF3FD 100%);
  box-shadow: 0 0 0 1px rgba(19, 27, 45, .07) inset, 0 30px 60px -40px rgba(19, 27, 45, .3);
}
.tk-feature::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgb(248 68 100 / .4), rgb(100 152 236 / .3) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.tk-feature-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 5px 11px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #B92640; background: #fff; box-shadow: inset 0 0 0 1px rgba(217, 50, 79, .2); }
.tk-feature-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #F84464; box-shadow: 0 0 0 3px rgba(248, 68, 100, .18); }
.tk-feature h2 { margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.375rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.028em; color: var(--heading-ink); }
.tk-feature-lede { margin: 12px 0 0; max-width: 34rem; font-size: 1.0625rem; line-height: 1.55; color: var(--slate); }
.tk-feature-steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 7px; }
.tk-feature-steps li { display: flex; align-items: baseline; gap: 10px; font-size: 0.9375rem; color: var(--slate); }
.tk-feature-steps li p { margin: 0; min-width: 0; }
.tk-feature-steps span { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.75rem; font-weight: 700; color: #fff; background: #3F6FD6; transform: translateY(-1px); }
.tk-feature-steps b { color: var(--heading-ink); font-weight: 600; }
.tk-feature-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; }
.tk-feature-cta {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px; border-radius: 999px; text-decoration: none;
  font: 600 1rem/1 var(--font-display); color: #fff; background: #D9324F; box-shadow: 0 10px 24px -12px rgba(217, 50, 79, .7); transition: transform .15s, background .15s;
}
.tk-feature-cta:hover { transform: translateY(-1px); background: #B92640; }
.tk-feature-cta:focus-visible { outline: 2.5px solid var(--cyan); outline-offset: 3px; }
.tk-feature-fine { font-size: 0.8125rem; color: var(--muted-light); }
/* a stack of three pages: the cover in front */
.tk-feature-art { position: relative; height: 260px; }
.tk-doc { position: absolute; width: 168px; height: 218px; border-radius: 8px; background: #fff; box-shadow: 0 20px 40px -18px rgba(19, 27, 45, .35), 0 0 0 1px rgba(19, 27, 45, .06); padding: 16px 14px; display: flex; flex-direction: column; gap: 7px; }
.tk-doc i { display: block; height: 7px; border-radius: 4px; background: #E2E8F0; }
.tk-doc i:nth-child(2n) { width: 78%; }
.tk-doc--3 { right: 4%; top: 6px; transform: rotate(8deg); background: #F5F3FF; }
.tk-doc--2 { right: 22%; top: 20px; transform: rotate(-3deg); background: #F8FAFC; }
.tk-doc--2::before { content: ""; height: 34px; border-radius: 5px; background: linear-gradient(135deg, #DBEAFE, #E0E7FF); }
.tk-doc--1 { right: 40%; top: 34px; transform: rotate(-9deg); gap: 9px; }
.tk-doc--1::before { content: ""; height: 56px; border-radius: 6px; background: linear-gradient(150deg, #4C1D95, #1E3A8A); }
.tk-doc--1 b { font: 700 0.875rem/1.15 var(--font-display); color: #1E1B4B; }
.tk-doc--1 em { font-style: normal; font-size: 0.625rem; color: #64748B; }
.tk-doc--1 u { margin-top: auto; height: 22px; width: 22px; border-radius: 4px; background: repeating-linear-gradient(90deg, #1E1B4B 0 2px, transparent 2px 4px), repeating-linear-gradient(0deg, #1E1B4B 0 2px, transparent 2px 4px); opacity: .7; }
@media (max-width: 900px) {
  .tk-feature { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; gap: 8px; }
  .tk-feature-art { display: none; }
}

/* the groups and their cards */
.tk-group { margin: 0 0 44px; }
.tk-group-head { margin: 0 0 16px; }
.tk-group-head .lt-group-h { display: flex; align-items: baseline; gap: 10px; }
.tk-group-head .lt-group-h::before { content: ""; flex: none; align-self: center; width: 4px; height: 20px; border-radius: 2px; background: var(--c-dot); }
.tk-group-n { font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; letter-spacing: 0; color: var(--muted-light); }
.tk-card { min-height: 128px; }
.tk-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 8px; }
.tk-card-tags span { padding: 3px 8px; border-radius: 6px; font-size: 0.6875rem; font-weight: 600; color: var(--c-ink); background: rgb(255 255 255 / .8); box-shadow: inset 0 0 0 1px var(--c-line); }

/* =============================================================
   The practice panel (calm-down plan): a breathing pacer, the
   one-minute grounding reset and drop anchor, on screen.
   ============================================================= */
.tk-pre { margin: 0 0 22px; padding: 24px 26px 22px; border-radius: 18px; color: #E2E8F0;
  background: radial-gradient(80% 120% at 85% 0%, oklch(0.5 0.12 var(--h) / .55) 0%, transparent 60%), linear-gradient(160deg, #0F1A30 0%, #0B1220 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.cc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.cc-kicker { margin: 0 0 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c-dot-hi); }
.cc-head h2 { margin: 0; font-size: 1.375rem; font-weight: 600; color: #fff; }
.cc-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(255 255 255 / .07); }
.cc-tabs button { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: #CBD5E1; font: 600 0.875rem/1 var(--font-body); cursor: pointer; }
.cc-tabs button[aria-selected="true"] { background: #fff; color: #131B2D; }
.cc-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cc-pick button { height: 32px; padding: 0 13px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .08); color: #E2E8F0; font: 500 0.8125rem/1 var(--font-body); cursor: pointer; }
.cc-pick button[aria-checked="true"] { background: var(--c-dot-hi); color: #131B2D; font-weight: 600; }
.cc-stage { position: relative; display: grid; place-items: center; height: 250px; }
.cc-orb { position: absolute; width: 210px; height: 210px; border-radius: 50%; transform: scale(.5); transition-property: transform; transition-timing-function: ease-in-out;
  background: radial-gradient(circle at 35% 30%, oklch(0.86 0.09 var(--h)) 0%, oklch(0.62 0.14 var(--h)) 55%, oklch(0.45 0.12 var(--h)) 100%);
  box-shadow: 0 0 60px oklch(0.7 0.15 var(--h) / .35); }
.cc-orb i { position: absolute; inset: -14px; border-radius: 50%; border: 1px solid oklch(0.8 0.1 var(--h) / .35); }
.cc-orb.is-in { transform: scale(1); }
.cc-orb.is-out { transform: scale(.5); }
.cc-read { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; text-shadow: 0 1px 8px rgb(0 0 0 / .4); }
.cc-word { font: 700 1.375rem/1.2 var(--font-display); color: #fff; max-width: 15rem; }
.cc-count { font: 600 1.125rem/1 var(--font-body); color: #E2E8F0; min-height: 1.1em; }
.cc-bar { height: 4px; border-radius: 2px; background: rgb(255 255 255 / .1); overflow: hidden; }
.cc-bar i { display: block; height: 100%; width: 0; background: var(--c-dot-hi); }
.cc-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.cc-go { height: 42px; padding: 0 22px; border: 0; border-radius: 999px; background: #fff; color: #131B2D; font: 700 0.9375rem/1 var(--font-body); cursor: pointer; }
.cc-go:hover { background: #E2E8F0; }
.cc-go:disabled { opacity: .5; cursor: default; }
.cc-back { height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .08); color: #E2E8F0; font: 600 0.875rem/1 var(--font-body); cursor: pointer; }
.cc-meta { font-size: 0.875rem; color: #94A3B8; }
.cc-note { margin: 10px 0 0; font-size: 0.9375rem; color: #CBD5E1; }
.cc-warn { margin: 6px 0 0; font-size: 0.8125rem; line-height: 1.5; color: #94A3B8; }
.cc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: cc; }
.cc-steps li { position: relative; display: grid; gap: 3px; padding: 14px 16px 14px 52px; border-radius: 12px; background: rgb(255 255 255 / .04); color: #94A3B8; counter-increment: cc; transition: background .2s, color .2s; }
.cc-steps li::before { content: counter(cc); position: absolute; left: 14px; top: 13px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(255 255 255 / .08); font: 700 0.8125rem/1 var(--font-body); color: #CBD5E1; }
.cc-steps li b { font-size: 1rem; color: #CBD5E1; }
.cc-steps li span { font-size: 0.9375rem; line-height: 1.5; }
.cc-steps li.is-on { background: rgb(255 255 255 / .1); color: #E2E8F0; box-shadow: inset 0 0 0 1px oklch(0.8 0.1 var(--h) / .45); }
.cc-steps li.is-on b { color: #fff; }
.cc-steps li.is-on::before { background: var(--c-dot-hi); color: #131B2D; }
.cc-steps li.is-done::before { content: "\2713"; }
.cc-tabs button:focus-visible, .cc-pick button:focus-visible, .cc-go:focus-visible, .cc-back:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cc-orb { transition: none !important; } }
@media (max-width: 640px) {
  .tk-pre { padding: 18px 16px; }
  .cc-stage { height: 210px; }
  .cc-orb { width: 170px; height: 170px; }
}
@media print { .tk-pre { display: none !important; } }

/* the handout: a chosen skill and its steps */
.hp-skill { display: grid; gap: 1px; padding: 4px 0; border-bottom: 1px solid #E2E8F0; }
.hp-skill:last-child { border-bottom: 0; }
.hp-skill b { font-size: 10pt; }
.hp-skill span { font-size: 9pt; color: #334155; }

/* =============================================================
   Medication schedule (tools/med-schedule.html)
   ============================================================= */
.ms-mode { margin-bottom: 14px; }
.ms-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 14px; }
.ms-top { grid-template-columns: minmax(0, 1fr) minmax(0, 13rem); }
.ms-str { display: grid; grid-template-columns: minmax(0, 1fr) 4.8rem minmax(0, 1.3fr); gap: 6px; }
.ms-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.ms-step { display: grid; grid-template-columns: 26px repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr) 36px; gap: 6px; align-items: end; padding: 10px 8px 8px; border-radius: 12px; background: var(--c-tint); }
.ms-sn { align-self: center; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--c-ink); font: 700 0.75rem/1 var(--font-body); }
.ms-d, .ms-len { display: flex; flex-direction: column; gap: 3px; font-size: 0.6875rem; font-weight: 700; letter-spacing: .03em; color: var(--c-ink); min-width: 0; }
.ms-d input, .ms-len input, .ms-len select { width: 100%; box-sizing: border-box; padding: 8px 8px; border-radius: 9px; border: 1px solid #CBD5E1; background: #fff; font: 400 0.9375rem/1.3 var(--font-body); color: #131B2D; }
.ms-len-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 4px; }
.ms-sum { grid-column: 2 / -1; margin: 0; font-size: 0.8125rem; color: var(--c-ink); }
.ms-sum em { font-style: normal; color: #B45309; font-weight: 600; }
.ms-sum i { font-style: normal; color: var(--muted-light); }
.ms-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-copy::before { content: "\21BA  "; }
.ms-after { margin-top: 14px; }
@media (max-width: 640px) {
  .ms-grid, .ms-top { grid-template-columns: minmax(0, 1fr); }
  .ms-step { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ms-sn { grid-column: 1 / -1; }
  .ms-len { grid-column: 1 / 4; }
  .ms-sum { grid-column: 1 / -1; }
}
/* the handout */
.ms-title { margin: -2px 0 8px; font: 600 11.5pt/1.3 var(--font-display); color: #0F172A; }
.ms-str-p { font: 500 9pt/1 var(--font-body); color: #475569; }
.ms-table td:nth-child(1) { width: 2.4em; text-align: center; }
.ms-table td:nth-child(2) { width: 9.5em; white-space: nowrap; }
.ms-after-p { margin: 2px 0 6px; font-size: 9pt; font-weight: 600; }
.ms-cal { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7.5pt; margin-top: 4px; }
.ms-cal th { padding: 3px; border: 1px solid #94A3B8; background: #F1F5F9; font-size: 7.5pt; }
.ms-cal td { height: 0.62in; padding: 2px 3px; border: 1px solid #94A3B8; vertical-align: top; }
.ms-cal td.ms-off { background: #F8FAFC; color: #CBD5E1; }
.ms-cal td.ms-new { box-shadow: inset 0 0 0 1.5px #0F172A; }
.ms-dt { display: block; font-weight: 700; color: #475569; margin-bottom: 1px; }
.ms-dt i { font-style: normal; font-weight: 700; color: #fff; background: #0F172A; border-radius: 3px; padding: 0 3px; font-size: 6.5pt; }
.ms-c { display: block; line-height: 1.3; }
.ms-c b { font-weight: 700; }
.ms-none { color: #94A3B8; }
.ms-tick { display: inline-block; width: 7px; height: 7px; margin: 0 2px 0 3px; border: 1px solid #334155; border-radius: 1px; vertical-align: -0.5px; }

/* =============================================================
   Drink diary (tools/drink-diary.html)
   ============================================================= */
.dd-row { display: grid; grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 0.8fr)) minmax(0, 1.2fr) 36px; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--c-tint); }
.dd-std { align-self: center; font-size: 0.8125rem; color: var(--c-ink); line-height: 1.3; }
.dd-std b { font-size: 1rem; }
.dd-total { margin: 10px 0 0; font-size: 0.9375rem; color: var(--heading-ink); }
.tk-idea small { color: var(--muted-light); font-size: 0.75rem; }
.tk-idea.is-on small { color: rgb(255 255 255 / .75); }
.dd-limits { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 12px; margin-top: 12px; }
.dd-limits .tk-hint { flex-basis: 100%; margin-top: -6px; }
@media (max-width: 640px) {
  .dd-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dd-what { grid-column: 1 / -1; }
  .dd-std { grid-column: 1 / 3; }
}

/* =============================================================
   Mood chart (tools/mood-chart.html): a month on one page
   ============================================================= */
.mc-key { margin: -4px 0 6px; font-size: 8.5pt; color: #334155; }
.mc-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7pt; }
.mc-table th, .mc-table td { border: 0.75pt solid #94A3B8; padding: 0 2px; text-align: center; vertical-align: middle; }
.mc-table th { background: #F1F5F9; font-size: 6.5pt; font-weight: 700; line-height: 1.15; padding: 2px; }
.mc-table th small { font-weight: 500; }
.mc-table td { height: 0.215in; }
.mc-table col.mc-day { width: 0.42in; }
.mc-table col.mc-m { width: 0.2in; }
.mc-table col.mc-s { width: 0.38in; }
.mc-table col.mc-x { width: 0.5in; }
.mc-table .mc-zero { background: #F1F5F9; }
.mc-table .mc-dn { text-align: left; font-weight: 700; padding-left: 3px; white-space: nowrap; }
.mc-table .mc-dn small { font-weight: 500; color: #64748B; }
.mc-table tr.mc-sun td { border-bottom-width: 1.25pt; border-bottom-color: #475569; }
.mc-table .mc-med { word-break: break-word; }
.mc-foot { margin-top: 6px; padding: 5px 10px; font-size: 8.5pt; }
.mc-foot h3 { font-size: 9.5pt; }

/* the crisis lines on a wide screen: 988 tall on the left, the other six in two rows */
@media (min-width: 1000px) {
  .tk-lines { grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); }
  .tk-line--big { grid-row: span 2; justify-content: flex-end; padding: 20px 22px; }
  .tk-line--big::before { content: "988"; margin-bottom: auto; padding-bottom: 12px; font: 700 3.5rem/1 var(--font-display); letter-spacing: -0.03em; color: #fff; }
  .tk-line--big b { font-size: 1.125rem; }
  .tk-line--big span { font-size: 0.875rem; }
}
/* a slim strip for tools that touch on self-harm (pros and cons, chain analysis, the calm-down plan) */
.tk-crisis-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: #FFF7F2; box-shadow: inset 0 0 0 1px #FBC9AE; font-size: 0.875rem; line-height: 1.45; color: #7C2D12; }
.tk-crisis-line p { margin: 0; flex: 1 1 22rem; }
.tk-crisis-line b { color: #9A3412; }
.tk-crisis-line .tk-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-crisis-line a { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 999px; background: #C2410C; color: #fff; font-size: 0.8125rem; font-weight: 600; text-decoration: none; }
.tk-crisis-line a.alt { background: #fff; color: #9A3412; box-shadow: inset 0 0 0 1px #FDBA9A; }
.tk-crisis-line a:focus-visible, .tk-line a:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* =============================================================
   Fear ladder (tools/fear-ladder.html)
   ============================================================= */
.lad-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lad-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 36px; gap: 6px 8px; align-items: end; padding: 10px 10px 14px; border-radius: 12px; background: var(--c-tint); overflow: hidden; }
.lad-w { grid-column: 1 / 3; }
.lad-w > span { font-weight: 500; }
.lad-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(15 23 42 / .06); }
.lad-bar i { display: block; height: 100%; transition: width .2s; }
.lad-bar--lo { background: oklch(0.82 0.07 var(--h)); }
.lad-bar--mid { background: oklch(0.67 0.13 var(--h)); }
.lad-bar--hi { background: oklch(0.5 0.15 var(--h)); }
.lad-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lad-sort::before { content: "\21C5  "; }
.lad-start { margin: 12px 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--c-ink); }
.lad-start:empty { display: none; }
@media (max-width: 640px) {
  .lad-row { grid-template-columns: minmax(0, 1fr) 6.5rem 36px; }
}
/* the handout: a ladder with the goal at the top */
.lad { margin: 2px 0 6px; }
.lad-end { margin: 0; font-size: 7.5pt; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #64748B; }
.lad-rungs { list-style: none; margin: 3px 0; padding: 0 10px; border-left: 3px solid #334155; border-right: 3px solid #334155; }
.lad-rung { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 3px 4px; border-bottom: 2px solid #CBD5E1; break-inside: avoid; }
.lad-rung:last-child { border-bottom: 0; }
.lad-n { display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; font-size: 8.5pt; font-weight: 700; background: #E2E8F0; color: #0F172A; }
.lad--mid .lad-n { background: #94A3B8; color: #fff; }
.lad--hi .lad-n { background: #334155; color: #fff; }
.lad-tx { font-size: 10pt; line-height: 1.3; }
.lad-tx small { display: block; font-size: 8.5pt; color: #475569; }
.lad-here { padding: 2px 8px; border-radius: 999px; background: #0F172A; color: #fff; font-size: 7pt; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.lad-rung.is-start { background: #F1F5F9; }
.lad-rung--blank { min-height: 2.6em; }
.lad-rung--blank .lad-n { background: none; box-shadow: inset 0 0 0 1px #94A3B8; }
.lad-plan { margin: 4px 0 0; }
.lad-log td { height: 2.05em; }

/* =============================================================
   Activity plan (tools/activity-plan.html)
   ============================================================= */
.act-kinds { display: grid; gap: 16px; }
.act-kind { padding-top: 14px; border-top: 1px solid #E2E8F0; }
.act-kind:first-child { padding-top: 0; border-top: 0; }
.act-days { display: grid; gap: 8px; margin-top: 4px; clear: both; }
.act-day { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 12px; background: var(--c-tint); }
.act-dn { margin: 9px 0 0; font-size: 0.875rem; font-weight: 700; color: var(--c-ink); }
.act-slots { display: grid; gap: 6px; }
.act-slot { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr) minmax(0, 0.7fr); gap: 6px; }
.act-slot .tk-in { padding: 8px 10px; font-size: 0.9375rem; }
.act-more { margin-top: 4px; white-space: nowrap; }
@media (max-width: 640px) {
  .act-day { grid-template-columns: minmax(0, 1fr) auto; }
  .act-dn { margin: 6px 0 0; }
  .act-slots { grid-column: 1 / -1; grid-row: 2; }
  .act-slot { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .act-where { grid-column: 1 / -1; }
}
/* the handout */
.act-lede { margin: 0 0 8px; font-size: 9.5pt; color: #334155; }
.act-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 10px; }
.act-cols .hp-sec h2 { font-size: 9.5pt; }
.act-key { margin-left: 6px; font: 500 8.5pt var(--font-body); color: #64748B; }
.act-table td { height: 1.75em; }
.act-table th:nth-child(3), .act-table td.act-box { width: 3.4em; text-align: center; }
.act-table th:nth-child(4), .act-table td.act-mood { width: 5.6em; text-align: right; color: #64748B; }
.act-box i { display: inline-block; width: 10px; height: 10px; border: 1.25px solid #0F172A; border-radius: 2px; vertical-align: -1px; }

/* =============================================================
   Thought record (tools/thought-record.html)
   ============================================================= */
.thr-h { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-size: 0.9375rem; font-weight: 700; color: var(--heading-ink); }
.thr-h span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-tint); color: var(--c-ink); font-size: 0.75rem; }
.tk-step-h + .thr-h { margin-top: 4px; }
.thr-pair { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; gap: 10px; align-items: end; }
.thr-pair > .tk-field { margin: 0; }
.thr-num .tk-in { font-size: 1rem; padding: 10px 12px; }
.thr-traps { display: flex; flex-wrap: wrap; gap: 6px; }
.thr-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.thr-ask { margin: 0; padding: 10px 12px; border-radius: 10px; background: #F8FAFC; font-size: 0.8125rem; line-height: 1.55; color: var(--slate); }
.thr-hints { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.thr-hints:empty { display: none; }
.thr-hints li { padding: 8px 12px; border-radius: 10px; background: var(--c-tint); font-size: 0.875rem; line-height: 1.45; color: var(--c-ink); }
.thr-drop { margin: 0 0 12px; }
.thr-del { margin-top: 16px; }
.thr-del::before { content: none; }
@media (max-width: 640px) { .thr-two, .thr-pair { grid-template-columns: minmax(0, 1fr); } }
/* the handout */
.thr-lede { margin: 0 0 6px; font-size: 9.5pt; color: #334155; }
.thr-table { margin: 4px 0 8px; table-layout: fixed; }
.thr-table th { font-size: 8pt; background: #F1F5F9; }
.thr-table td { height: 1.75em; }
.thr-table td.thr-n { white-space: nowrap; }
.thr-list { margin: 2px 0 0; padding-left: 1.35em; columns: 2; column-gap: 18px; font-size: 8.5pt; line-height: 1.35; }
.thr-list li { break-inside: avoid; margin: 0 0 4px; }
.thr-list i { display: block; color: #475569; }

/* =============================================================
   Sleep window (tools/sleep-window.html)
   ============================================================= */
.slw-warn { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; font-size: 0.9375rem; line-height: 1.5; color: #7C2D12; }
.slw-wrap { margin-top: 2px; }
.slw-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0 6px; font-size: 0.8125rem; }
.slw-table th { padding: 0 4px; text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--c-ink); }
.slw-table th[scope="row"] { width: 2.4rem; text-align: center; }
.slw-table td { padding: 0 3px; }
.slw-table .tk-in { padding: 7px 8px; font-size: 0.875rem; }
.slw-table input[type="number"] { max-width: 6rem; }
.slw-out { min-width: 7.5rem; font-size: 0.8125rem; color: var(--c-ink); white-space: nowrap; }
.slw-times { display: flex; flex-wrap: wrap; gap: 0 12px; }
.slw-result { margin-top: 2px; padding: 14px 16px; border-radius: 12px; background: var(--c-tint); color: var(--c-ink); }
.slw-result p { margin: 0 0 6px; }
.slw-result p:last-child { margin-bottom: 0; }
.slw-sum { font-size: 0.9375rem; }
.slw-win small { color: var(--muted-light); }
.slw-big { font-size: 1.125rem; line-height: 1.45; color: var(--heading-ink); }
.slw-wait { font-size: 0.9375rem; color: var(--muted-light); }
/* the handout */
.slw-print { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin: 4px 0 2px; padding: 10px 16px; border: 2px solid #0F172A; border-radius: 10px; }
.slw-print p { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.slw-print span { font-size: 9pt; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #475569; }
.slw-print b { font: 700 22pt/1.1 var(--font-display); color: #0F172A; }
.slw-print .hp-fill { width: 1.5in; height: 0.85em; }
.slw-print small { grid-column: 1 / -1; font-size: 9pt; color: #475569; }
.slw-log td { height: 2em; }

/* =============================================================
   The prior authorization letter and the monitoring planner, in the
   shared look (their own scripts and print rules stay; 2026-11-15)
   ============================================================= */
.tk-bar[hidden] { display: none; }
.tk-wrap--pa .pa-wrap { gap: 32px; }
.tk-wrap--pa .pa-side { min-width: 0; display: grid; gap: 14px; align-content: start; }
.tk-wrap--pa .tk-coach { margin: 0; }
.tk-wrap--pa .pa-form { max-width: none; gap: 14px; counter-reset: pa; }
.tk-wrap--pa .fs-group, .tk-wrap--mp .tk-step { border-top: 0; }
.tk-wrap--pa .fs-group { counter-increment: pa; padding: 20px 22px 22px; }
.tk-wrap--pa .fs-group > h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; font-family: var(--font-body); font-size: 1.1875rem; font-weight: 600; }
.tk-wrap--pa .fs-group > h2::before { content: counter(pa); flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font: 700 0.9375rem/1 var(--font-body); color: #fff; background: var(--c-ink); }
.tk-wrap--pa .fs-field > span { font-size: 0.875rem; color: var(--heading-ink); }
.tk-wrap--pa .fs-form input[type="text"], .tk-wrap--pa .fs-form select, .tk-wrap--pa .fs-form textarea { border-radius: 10px; border-color: #CBD5E1; }
@media (min-width: 1040px) { .tk-wrap--pa .pa-out { top: calc(var(--header-h, 72px) + 84px); } }
.tk-wrap--pa .pa-letter { max-height: calc(100vh - var(--header-h, 72px) - 150px); overflow: auto; }
.tk-wrap--mp .mp { display: grid; gap: 14px; }
.tk-wrap--mp .mp-pick { margin: 0; }
.tk-wrap--mp .tk-coach { margin: 0 0 14px; max-width: 56rem; }   /* the same width as the step cards (.mp) */
@media (max-width: 1039px) { .tk-wrap--pa .pa-letter { max-height: none; } }
@media print {
  .tk-wrap--pa .pa-letter { max-height: none !important; overflow: visible !important; }
  .tk-wrap--mp .tk-step { box-shadow: none !important; padding: 0 !important; background: none !important; }
  .tk-wrap--mp .tk-step-h { display: none !important; }
}

/* phones (2026-11-15): the action bar scrolls with the page, a long choice reads as a block, the fear ladder's step gets
   the full width, and the crisis panel shows three lines with a button for the rest */
.tk-crisis-more { display: none; }
@media (max-width: 640px) {
  .tk-bar { position: static; }
  .tk-choice .tk-pill { border-radius: 12px; padding: 10px 14px; }
  .lad-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .lad-t, .lad-w { grid-column: 1 / -1; }
  .lad-f { grid-column: 1; max-width: 10rem; }
  .lad-row > .tk-x { grid-column: 2; grid-row: 2; }
  .tk-crisis:not(.is-open) .tk-line:nth-child(n+4) { display: none; }
  .tk-crisis:not(.is-open) .tk-crisis-more {
    display: block; width: 100%; margin-top: 8px; padding: 10px 14px; border: 0; border-radius: 12px; cursor: pointer; text-align: left;
    font: 600 0.875rem/1.35 var(--font-body); color: #9A3412; background: #fff; box-shadow: inset 0 0 0 1px #FCD7C4;
  }
  .tk-crisis-more:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
}

/* =============================================================
   QA round (2026-11-16)
   ============================================================= */
/* "See the handout" and the Tools page's jump links land below the sticky header and bars */
.tk-preview, .tk-editor { scroll-margin-top: calc(var(--header-h, 72px) + 80px); }
.tk-group { scroll-margin-top: calc(var(--header-h, 72px) + 24px); }
@media (min-width: 901px) and (min-height: 761px) { .tk-group { scroll-margin-top: calc(var(--header-h, 72px) + 84px); } }
@media (max-width: 640px) { .tk-preview, .tk-editor { scroll-margin-top: calc(var(--header-h, 72px) + 12px); } }

/* the handout title keeps its line when the name is long; a box at the top keeps its distance from the sections */
.hp-head > div { flex: 1 1 auto; min-width: 0; }
.hp-head h1 { white-space: nowrap; }
.hp-date { flex: 0 1 auto; max-width: 42%; overflow-wrap: anywhere; }
.hp-box + .hp-secs, .hp-meta + .hp-secs { margin-top: 10px; }
.hp-table--fixed { table-layout: fixed; }

/* the visit guide's heading on a phone: the note goes under the title */
@media (max-width: 640px) {
  .tk-coach > summary span { flex-basis: 100%; padding-left: 32px; }
  .tk-in::placeholder { font-size: 0.875rem; }
}

/* the handout on a phone: reflowed to the screen at a size you can read, instead of a page shrunk to 42% */
@media (max-width: 640px) {
  .tk-sheet { overflow-x: auto; }
  .tk-sheet .tk-pagebox { zoom: 1; width: auto; padding: 18px 16px; font-size: 10pt; }
  .tk-sheet .hp-secs--cols, .tk-sheet .act-cols { grid-template-columns: minmax(0, 1fr); }
  .tk-sheet .hp-head { flex-wrap: wrap; }
  .tk-sheet .hp-head h1 { font-size: 16pt; white-space: normal; }
  .tk-sheet .hp-date { max-width: none; text-align: left; }
  .tk-sheet .hp-table { font-size: 8pt; }
}

/* thought record: the blank practice record has room to write */
.thr-table--blank td { height: 2.5em; }

/* my medicines: one tinted row per medicine. Name, strength and what it is for; then the four times of day; then a note */
.mm-rows { gap: 8px; }
.mm-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 36px; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--c-tint); }
.mm-name { grid-column: 1 / 3; grid-row: 1; }
.mm-str { grid-column: 3; grid-row: 1; }
.mm-why { grid-column: 4; grid-row: 1; }
.mm-row > .tk-x { grid-column: 5; grid-row: 1; }
.mm-slot { grid-row: 2; }
.mm-slot .tk-in { text-align: center; }
.mm-prn { grid-column: 1 / 5; grid-row: 2; }
.mm-note { grid-column: 1 / 5; grid-row: 3; }
@media (max-width: 640px) {
  .mm-name { grid-column: 1 / 5; }
  .mm-str { grid-column: 1 / 3; grid-row: 2; }
  .mm-why { grid-column: 3 / 5; grid-row: 2; }
  .mm-slot { grid-row: 3; }
  .mm-prn { grid-row: 3; }
  .mm-note { grid-row: 4; }
}

/* activity plan: the activity gets the room, "Another" sits under the day's slots */
.act-day { grid-template-columns: 7rem minmax(0, 1fr); }
.act-slot { grid-template-columns: 5.5rem minmax(0, 1.7fr) minmax(0, 0.8fr); }
.act-more { grid-column: 2; justify-self: start; margin-top: 0; }
@media (max-width: 640px) {
  .act-day { grid-template-columns: minmax(0, 1fr); }
  .act-dn { margin: 2px 0 0; }
  .act-slots { grid-column: 1; grid-row: auto; }
  .act-more { grid-column: 1; }
  .act-slot { grid-template-columns: 5.5rem minmax(0, 1fr); }
}

/* mood chart: a medicine's name fits its column without breaking mid-word; no print smaller than 6.5pt */
.mc-table col.mc-medc { width: 0.62in; }
.mc-table th.mc-med, .mc-table .mc-med { word-break: normal; overflow-wrap: normal; hyphens: auto; font-size: 6.5pt; }
.mc-table th small, .mc-table .mc-dn small { font-size: 6.5pt; }

/* the prior authorization letter: room to sign */
.pa-letter p.pa-sign { margin-top: 2.2em; }
@media print { .pa-letter p.pa-sign { margin-top: 0.55in; } }

/* the monitoring planner's printout: a title line, compact checks, two pages at most for a full list */
.mp-print-meta { display: none; }
@media print {
  .tk-wrap--mp .mp-print-meta { display: block; margin: 0 0 8px; font-size: 9pt; color: #475569; }
  .tk-wrap--mp .mp-title { margin: 0 0 2px; font-size: 15pt; }
  .tk-wrap--mp .mp-chips { display: none !important; }
  .tk-wrap--mp .mp-part { break-inside: auto; margin: 8px 0 0; }
  .tk-wrap--mp .mp-part-h { margin: 0 0 4px; font-size: 11pt; }
  .tk-wrap--mp .mp-groups { display: block; margin: 0; padding: 0; }
  .tk-wrap--mp .mp-group { break-inside: avoid; margin: 0 0 4px; padding: 3px 0 4px; border: 0; border-bottom: 0.75pt solid #CBD5E1; border-radius: 0; box-shadow: none; background: none; }
  .tk-wrap--mp .mp-group h4 { margin: 0 0 1px; font-size: 9.5pt; }
  .tk-wrap--mp .mp-row { margin: 0; font-size: 9pt; line-height: 1.35; }
  .tk-wrap--mp .mp-print-foot { display: block; margin-top: 10px; padding-top: 5px; border-top: 1px solid #CBD5E1; font-size: 7.5pt; color: #64748B; }
}
.mp-print-foot { display: none; }

