/* Kasane free tools: the interactive parts of /tools/, /printables/ and /records/ pages.
   Loaded after /guides/guides.css and built on its tokens (--paper, --card, --ink, --line, --ocean,
   --topic, --font), so tools follow the page's topic colour and dark mode.
   Every class here is prefixed kt- (on screen) or kp- (the printable output).
   The scripts in this folder write each tool's printable view into #kt-print-root at the end of
   <body> and add body.kt-printing; @media print below then shows only that view, on clean paper. */

/* ---------- the tool on the page ---------- */
.tool {
  --w: min(var(--fig, 800px), calc(100vw - 40px));
  width: var(--w); margin: 2.2em 0 2.6em calc((100% - var(--w)) / 2);
}
.kt {
  color-scheme: light;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--hair); border-radius: 24px;
  padding: 28px 28px 24px;
  box-shadow: 0 1px 2px rgba(36, 27, 21, .05), 0 18px 40px -28px rgba(36, 27, 21, .35);
  font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) { .kt { color-scheme: dark; box-shadow: none; } }
@media (max-width: 560px) { .kt { padding: 20px 16px 18px; border-radius: 18px; } }

/* Reset the article's prose rhythm inside a tool. */
.kt p { margin: 0 0 .8em; hanging-punctuation: none; }
.kt h3, .kt h4 { margin: 0 0 .5em; letter-spacing: -0.012em; line-height: 1.3; text-wrap: balance; }
.kt h3 { font-size: 19px; font-weight: 620; }
.kt h4 { font-size: 16px; font-weight: 620; }
.kt ul, .kt ol { margin: 0 0 .8em; padding-left: 1.3em; }
.kt li { margin: 0 0 .35em; padding-left: 0; }
.kt table { font-size: 14.5px; }
.kt th, .kt td { padding: 8px 10px; }
.kt td:first-child { font-weight: inherit; }
.kt section { margin-top: 0; } /* undo the article's section rhythm inside a tool */

.kt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.kt-title { font-size: 20px; font-weight: 620; letter-spacing: -0.015em; margin: 0; }
.kt-privacy { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 18px; display: flex; gap: 8px; align-items: baseline; }
.kt-privacy::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 99px; background: var(--ocean); translate: 0 -1px; }
.kt-warning { font-size: 14.5px; padding: 10px 14px; border-radius: 12px; background: var(--care); border: 1px solid var(--care-edge); margin: 0 0 16px; }
.kt-warning[hidden] { display: none; }
.kt-muted { color: var(--ink-soft); }
.kt-small { font-size: 14px; line-height: 1.45; }
.kt-empty { color: var(--ink-soft); font-size: 15px; padding: 18px 0; margin: 0; }
.kt-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.kt-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.kt-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kt [hidden] { display: none !important; }

/* ---------- fields ---------- */
.kt-form { display: grid; gap: 16px; }
.kt-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kt-grid.kt-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kt-field { display: grid; gap: 6px; min-width: 0; }
.kt-field > label, .kt-label, .kt fieldset > legend {
  font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); padding: 0;
}
.kt-field .kt-help { font-size: 13px; color: var(--ink-faint); line-height: 1.4; }
.kt fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.kt fieldset > legend { margin-bottom: 8px; }
.kt input[type="text"], .kt input[type="date"], .kt input[type="time"], .kt input[type="number"],
.kt input[type="search"], .kt select, .kt textarea {
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--ink); background: var(--canvas);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; width: 100%; min-height: 46px; margin: 0;
  -webkit-appearance: none; appearance: none;
}
.kt select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.kt input[type="date"], .kt input[type="time"] { min-width: 0; }
.kt textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.kt input::placeholder, .kt textarea::placeholder { color: var(--ink-faint); }
.kt input:hover, .kt select:hover, .kt textarea:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.kt :focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }
.kt input:focus-visible, .kt select:focus-visible, .kt textarea:focus-visible { outline-offset: 1px; border-color: var(--ocean); }
.kt input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--ocean); flex: none; }

/* Segmented choices: a real radio inside each label, drawn as a chip. Arrow keys move between them. */
.kt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kt-chip { position: relative; display: inline-flex; }
.kt .kt-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.kt-chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 9px 15px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--canvas);
  font-size: 15px; font-weight: 520; line-height: 1.2; cursor: pointer; user-select: none;
}
.kt-chip input:hover + span { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.kt-chip input:checked + span { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.kt-chip input:focus-visible + span { outline: 3px solid var(--ocean); outline-offset: 2px; }
.kt-chips.kt-num .kt-chip span { min-width: 46px; justify-content: center; padding: 9px 12px; }

/* Bristol picker: seven drawn tiles. */
.kt-bristol { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.kt-bristol .kt-chip { display: block; }
.kt-bristol .kt-chip span {
  display: grid; justify-items: center; gap: 4px; border-radius: 14px; padding: 8px 4px 9px; min-height: 0; height: 100%;
  font-size: 12.5px; font-weight: 550; text-align: center; line-height: 1.2;
}
.kt-bristol svg { width: 100%; max-width: 64px; height: auto; display: block; color: var(--ink-soft); }
.kt-bristol .kt-chip input:checked + span svg { color: var(--canvas); }
.kt-bristol .kt-clear-choice span { border-style: dashed; }
@media (max-width: 640px) { .kt-bristol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- buttons ---------- */
.kt-btn {
  font: inherit; font-size: 15px; font-weight: 550; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--canvas); border: 1px solid var(--ink);
  text-decoration: none;
}
.kt-btn:hover { background: color-mix(in srgb, var(--ink) 85%, var(--canvas)); }
.kt-btn.kt-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.kt-btn.kt-secondary:hover { border-color: var(--ink); background: transparent; }
.kt-btn.kt-quiet { background: transparent; color: var(--ink-soft); border-color: transparent; padding-left: 8px; padding-right: 8px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.kt-btn.kt-quiet:hover { color: var(--ink); }
.kt-btn.kt-small-btn { font-size: 14px; min-height: 36px; padding: 6px 12px; }
.kt-btn[disabled] { opacity: .45; cursor: not-allowed; }
.kt-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kt-actions .kt-push { margin-left: auto; }
.kt-output { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.kt-output .kt-help { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* ---------- lists of saved things ---------- */
.kt-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.kt-list > li { margin: 0; padding: 0; }
.kt-card { background: var(--card); border-radius: 16px; padding: 16px 18px; }
.kt-card > :last-child { margin-bottom: 0; }
.kt-row-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.kt-tag { display: inline-block; font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ink-soft); padding: 3px 9px; border-radius: 999px; background: var(--card-deep); white-space: nowrap; }
.kt-sev { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.kt-sev i { display: inline-block; width: 10px; height: 10px; border-radius: 99px; background: var(--sev-0); }
.kt-sev.s1 i { background: var(--sev-1); } .kt-sev.s2 i { background: var(--sev-2); } .kt-sev.s3 i { background: var(--sev-3); }

/* ---------- food diary: the day timeline ---------- */
.kt-days { display: grid; gap: 22px; }
.kt-day h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 16px; margin-bottom: 10px; }
.kt-day h4 .kt-muted { font-size: 13.5px; font-weight: 500; }
.kt-strip { position: relative; height: 46px; margin: 0 6px 6px; }
.kt-strip .ax { position: absolute; left: 0; right: 0; top: 22px; height: 2px; background: var(--line); }
.kt-strip .tk { position: absolute; top: 30px; translate: -50% 0; font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.kt-strip .tk:first-of-type { translate: 0 0; } .kt-strip .tk.last { translate: -100% 0; }
.kt-strip .mk { position: absolute; translate: -50% 0; }
.kt-strip .mk.food { top: 4px; width: 12px; height: 12px; border-radius: 99px; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.kt-strip .mk.sym { top: 16px; width: 12px; height: 14px; border-radius: 3px; background: var(--sev-0); box-shadow: 0 0 0 2px var(--paper); }
.kt-strip .mk.sym.s1 { background: var(--sev-1); } .kt-strip .mk.sym.s2 { background: var(--sev-2); } .kt-strip .mk.sym.s3 { background: var(--sev-3); }
.kt-strip .mk.bm { top: 17px; width: 11px; height: 11px; rotate: 45deg; background: var(--ocean); box-shadow: 0 0 0 2px var(--paper); }
.kt-strip .mk.other { top: 18px; width: 9px; height: 9px; border-radius: 99px; border: 2px solid var(--ink-soft); background: var(--paper); }
.kt-lanes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 74px 1fr 1fr; column-gap: 12px; }
.kt-lanes .lh { font-size: 12.5px; font-weight: 650; color: var(--ink-faint); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.kt-lanes > li { display: contents; }
.kt-lanes .t, .kt-lanes .c { padding: 9px 0; border-bottom: 1px solid var(--hair); }
.kt-lanes .t { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.kt-lanes .c { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.kt-lanes .c.empty { border-bottom: 1px solid var(--hair); }
.kt-lanes .c.span { grid-column: 2 / 4; }
.kt-lanes .c .kt-muted { display: block; font-size: 13.5px; }
.kt-lanes .c .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.kt-lanes .c .kt-row-actions { margin-top: 2px; }
.kt-lanes .c .kt-btn.kt-quiet { min-height: 32px; padding: 4px 6px; font-size: 13.5px; }
.kt-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.kt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 99px; background: var(--ink); }
.kt-legend i.sym { border-radius: 3px; background: var(--sev-2); }
.kt-legend i.bm { border-radius: 0; rotate: 45deg; width: 9px; height: 9px; background: var(--ocean); }
.kt-legend i.other { background: transparent; border: 2px solid var(--ink-soft); width: 9px; height: 9px; }
@media (max-width: 560px) {
  .kt-lanes { grid-template-columns: 58px 1fr 1fr; column-gap: 8px; }
  .kt-lanes .c { font-size: 14.5px; }
  .kt-strip .tk:nth-of-type(even) { display: none; }
}

/* Editable little tables ("What I've tried", conditions) stack on narrow screens. */
.kt-rows { display: grid; gap: 10px; }
.kt-rowedit { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; padding: 14px; background: var(--card); border-radius: 14px; }
.kt-rowedit .kt-field.wide { grid-column: 1 / -1; }

/* ---------- FODMAP reintroduction ---------- */
.kt-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 4px; }
.kt-groups li { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: 14.5px; display: grid; gap: 2px; }
.kt-groups li b { font-weight: 620; }
.kt-groups li span { font-size: 13px; color: var(--ink-soft); }
.kt-chal { display: grid; gap: 12px; }
.kt-chal-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.kt-chal-days { display: grid; gap: 10px; }
.kt-chal-day { padding: 12px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--hair); display: grid; gap: 10px; }
.kt-chal-day .kt-label { color: var(--ink); }
.kt-break { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); font-size: 14.5px; color: var(--ink-soft); }
.kt-break b { color: var(--ink); font-weight: 600; }

/* ---------- vaccine finder ---------- */
.kt-steps { counter-reset: kt-step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.kt-steps > li { counter-increment: kt-step; display: grid; grid-template-columns: 30px 1fr; gap: 10px; margin: 0; padding: 0; }
.kt-steps > li::before { content: counter(kt-step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; background: var(--ink); color: var(--canvas); font-size: 14px; font-weight: 650; }
.kt-steps > li > div > :last-child { margin-bottom: 0; }
.kt-result { margin-top: 24px; padding: 22px; border-radius: 18px; background: var(--topic-soft); }
.kt-result h3 { font-size: 21px; }
.kt-result .kt-portal { margin: 4px 0 2px; }
.kt-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin: 16px 0 0; }
.kt-facts div { display: grid; gap: 2px; }
.kt-facts dt { font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.kt-facts dd { margin: 0; font-size: 15px; }
.kt-verified { font-size: 13px; color: var(--ink-soft); margin-top: 14px; }

/* ---------- medication list, family history ---------- */
.kt-medsec + .kt-medsec { margin-top: 24px; }
.kt-medsec > .kt-head { margin-bottom: 10px; }
.kt-item { background: var(--card); border-radius: 16px; padding: 14px; display: grid; gap: 12px; }
.kt-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kt-item-head b { font-weight: 620; font-size: 15.5px; }
.kt-item .kt-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kt-item .kt-field.wide { grid-column: 1 / -1; }
.kt-cond { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: end; }
@media (max-width: 480px) { .kt-cond { grid-template-columns: 1fr 96px; } .kt-cond .kt-btn { grid-column: 1 / -1; justify-self: start; } }

/* ---------- medical binder ---------- */
.kt-check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.kt-check:last-child { border-bottom: 0; }
.kt-check input[type="checkbox"] { margin-top: 2px; }
.kt-check label { font-weight: 600; cursor: pointer; }
.kt-check .kt-help { font-size: 14px; color: var(--ink-soft); margin: 2px 0 0; }
.kt-check ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.kt-check ul li { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 15px; }
.kt-check ul li label { font-weight: 450; }
.kt-check .kt-link { display: inline-block; margin-top: 6px; font-size: 14.5px; }
.kt-progress { height: 8px; border-radius: 99px; background: var(--card-deep); overflow: hidden; margin: 6px 0 4px; }
.kt-progress i { display: block; height: 100%; background: var(--ocean); border-radius: 99px; width: 0; transition: width .2s; }

/* ---------- sleep diary: two-week chart ---------- */
.kt-sleepchart { display: grid; gap: 6px; }
.kt-sleepchart .n { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: center; }
.kt-sleepchart .d { font-size: 13px; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.kt-sleepchart .tr { position: relative; height: 16px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px var(--hr, 10%)); }
.kt-sleepchart .tr i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.kt-sleepchart .tr i.bed { background: color-mix(in srgb, var(--ocean) 30%, var(--card-deep)); }
.kt-sleepchart .tr i.mk-sl { top: -3px; bottom: -3px; width: 3px; translate: -50% 0; border-radius: 2px; background: var(--ink); }
.kt-sleepchart .tr i.mk-wake { top: 3px; bottom: auto; width: 10px; height: 10px; translate: -50% 0; border-radius: 99px; background: var(--paper); border: 2px solid var(--ink); box-sizing: border-box; }
.kt-sleepchart .tr.none { background: none; border: 1px dashed var(--line); }
.kt-sleepchart .sc { position: relative; height: 18px; font-size: 12px; color: var(--ink-faint); }
.kt-sleepchart .sc span { position: absolute; translate: -50% 0; white-space: nowrap; }
.kt-sleepchart .sc span.first { translate: 0 0; } .kt-sleepchart .sc span.last { translate: -100% 0; }
.kt-sleeplegend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }
.kt-sleeplegend span { display: inline-flex; align-items: center; gap: 6px; }
.kt-sleeplegend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--ocean) 30%, var(--card-deep)); }
.kt-sleeplegend i.sl { width: 3px; height: 14px; border-radius: 2px; background: var(--ink); }
.kt-sleeplegend i.wk { width: 10px; height: 10px; border-radius: 99px; background: var(--paper); border: 2px solid var(--ink); box-sizing: border-box; }
.kt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0 0; }
.kt-stats div { background: var(--card); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.kt-stats dt { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); line-height: 1.3; }
.kt-stats dd { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.kt-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 14px; border-radius: 14px; background: var(--card); }
.kt-table-wrap table { min-width: 620px; }
.kt-table-wrap th { font-size: 13px; }
.kt-measure-err { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 560px) { .kt-sleepchart .n { grid-template-columns: 64px 1fr; gap: 6px; } .kt-sleepchart .d { font-size: 11.5px; } }

/* ---------- print ---------- */
.kt-print-root { display: none; }
@media print {
  @page { margin: 14mm 12mm 14mm; }
  body.kt-printing { background: #fff !important; color: #000 !important; font-size: 10.5pt; line-height: 1.4; }
  body.kt-printing::before { display: none !important; }
  body.kt-printing > :not(.kt-print-root) { display: none !important; }
  body.kt-printing > .kt-print-root { display: block !important; }
  /* Without a tool's print view (no script), at least drop the site chrome. */
  body:not(.kt-printing) header.site, body:not(.kt-printing) footer.site, body:not(.kt-printing) aside.cta,
  body:not(.kt-printing) .kt-actions, body:not(.kt-printing) .kt-output { display: none !important; }
}
.kp { font-family: var(--font); color: #000; background: #fff; font-size: 10.5pt; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-variant-numeric: tabular-nums; }
.kp * { color: #000; }
.kp h1 { font-size: 18pt; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 2pt; }
.kp h2 { font-size: 12.5pt; font-weight: 650; margin: 14pt 0 5pt; letter-spacing: -0.01em; break-after: avoid; }
.kp h3 { font-size: 11pt; font-weight: 650; margin: 10pt 0 4pt; break-after: avoid; }
.kp p { margin: 0 0 5pt; }
.kp ul, .kp ol { margin: 0 0 6pt; padding-left: 14pt; }
.kp li { margin: 0 0 2pt; }
.kp a { color: #000; text-decoration: none; }
.kp .kp-sub { font-size: 10pt; color: #333; margin: 0 0 10pt; padding-bottom: 6pt; border-bottom: 1.5pt solid #000; }
.kp .kp-sub * { color: #333; }
.kp .kp-muted, .kp .kp-muted * { color: #555; }
.kp table { width: 100%; border-collapse: collapse; font-size: 9.5pt; line-height: 1.35; margin: 0 0 8pt; background: none; }
.kp th, .kp td { border: 0.5pt solid #999; padding: 3pt 5pt; text-align: left; vertical-align: top; font-weight: 400; overflow-wrap: anywhere; }
.kp th { font-weight: 650; background: #f2f2f2; font-size: 8.5pt; color: #222; }
.kp td:first-child { font-weight: 400; }
.kp tr { break-inside: avoid; }
.kp tr:last-child td, .kp tr:last-child th { border-bottom: 0.5pt solid #999; } /* guides.css drops it */
.kp thead { display: table-header-group; }
.kp td.blank { height: 20pt; }
.kp .kp-day { break-inside: auto; }
.kp .kp-day h3 { margin-top: 9pt; }
.kp .kp-lines { display: grid; gap: 0; margin: 0 0 8pt; }
.kp .kp-line { display: grid; grid-template-columns: 34% 1fr; gap: 8pt; padding: 5pt 0 3pt; border-bottom: 0.5pt solid #999; min-height: 20pt; }
.kp .kp-line b { font-weight: 600; font-size: 9.5pt; }
.kp .kp-box { display: inline-block; width: 9pt; height: 9pt; border: 0.8pt solid #000; vertical-align: -1pt; margin-right: 5pt; }
.kp .kp-box.on { background: #000; }
.kp .kp-check { list-style: none; padding: 0; }
.kp .kp-check li { margin: 0 0 4pt; }
.kp .kp-url { font-size: 9pt; overflow-wrap: anywhere; }
.kp .kp-foot { margin-top: 14pt; padding-top: 5pt; border-top: 0.5pt solid #999; font-size: 8pt; color: #555; }
.kp .kp-page { break-after: page; page-break-after: always; }
.kp .kp-page:last-child { break-after: auto; page-break-after: auto; }
.kp .kp-sev { display: inline-block; width: 7pt; height: 7pt; border-radius: 99px; border: 0.6pt solid #000; vertical-align: 0; margin-right: 3pt; }
.kp .kp-sev.s1 { background: #ccc; } .kp .kp-sev.s2 { background: #888; } .kp .kp-sev.s3 { background: #000; }
/* binder cover and dividers: full pages */
.kp-medical-binder .kp-cover, .kp-medical-binder .kp-divider { min-height: 245mm; display: flex; flex-direction: column; }
.kp-medical-binder .kp-cover h1 { font-size: 34pt; margin-top: 60mm; }
.kp-medical-binder .kp-cover .kp-for { font-size: 18pt; margin-top: 10pt; }
.kp-medical-binder .kp-cover .kp-date { font-size: 12pt; color: #333; margin-top: 6pt; }
.kp-medical-binder .kp-cover .kp-foot { margin-top: auto; }
.kp-medical-binder .kp-divider .kp-num { font-size: 60pt; font-weight: 300; line-height: 1; margin-top: 40mm; }
.kp-medical-binder .kp-divider h1 { font-size: 28pt; margin-top: 6pt; }
.kp-medical-binder .kp-divider p { font-size: 12pt; max-width: 140mm; }
.kp-medical-binder .kp-divider ul { font-size: 11.5pt; margin-top: 10pt; list-style: none; padding: 0; }
.kp-medical-binder .kp-divider li { margin-bottom: 5pt; }
/* sleep chart in print */
.kp .kp-chart { display: grid; gap: 2.5pt; margin: 4pt 0 8pt; }
.kp .kp-chart .n { display: grid; grid-template-columns: 60pt 1fr; gap: 6pt; align-items: center; font-size: 8.5pt; }
.kp .kp-chart .tr { position: relative; height: 9pt; border: 0.4pt solid #ccc; }
.kp .kp-chart .tr i { position: absolute; top: 0; bottom: 0; background: #ddd; }
.kp .kp-chart .tr i.mk-sl { width: 1.5pt; top: -1.5pt; bottom: -1.5pt; background: #000; translate: -50% 0; }
.kp .kp-chart .tr i.mk-wake { width: 5pt; height: 5pt; top: 2pt; bottom: auto; border-radius: 99px; background: #fff; border: 1pt solid #000; translate: -50% 0; box-sizing: border-box; }
.kp .kp-chart .sc { position: relative; height: 10pt; font-size: 7.5pt; margin-left: 66pt; }
.kp .kp-chart .sc span { position: absolute; translate: -50% 0; white-space: nowrap; color: #555; }
.kp .kp-chart .sc span.first { translate: 0 0; } .kp .kp-chart .sc span.last { translate: -100% 0; }
.kp .kp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4pt 10pt; margin: 4pt 0 8pt; }
.kp .kp-stats div { border-top: 0.5pt solid #999; padding-top: 2pt; }
.kp .kp-stats dt { font-size: 8pt; color: #333; }
.kp .kp-stats dd { margin: 0; font-size: 11pt; font-weight: 600; }
