/* Calculators for /post/huberman-protocols/. Loaded only by that post. */
.ptool {
  position: relative;
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--border-active, #334155);
  border-radius: var(--radius-lg, 12px);
  background: var(--surface-slate, #0f141c);
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.5;
}
.ptool h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.ptool .ptool-lead { margin: 0 0 0.9rem; color: var(--text-muted, #94a3b8); }
.ptool label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0 0.9rem 0.5rem 0; }
.ptool input[type="number"], .ptool input[type="time"], .ptool select {
  background: var(--surface-elevated, #151c27);
  color: var(--text-parchment, #f1f5f9);
  border: 1px solid var(--border-active, #334155);
  border-radius: var(--radius-sm, 4px);
  padding: 0.3rem 0.45rem;
  font: inherit;
  max-width: 100%;
}
.ptool input[type="number"] { width: 5.2rem; }
.ptool input[type="time"] { color-scheme: dark; }
.ptool button {
  background: transparent;
  color: var(--secondary-bright, #4cd7f6);
  border: 1px solid var(--secondary, #06b6d4);
  border-radius: var(--radius-md, 8px);
  padding: 0.3rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.ptool button:hover, .ptool button:focus-visible { background: rgba(6, 182, 212, 0.12); }
.ptool .ptool-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ptool table { width: 100%; border-collapse: collapse; margin: 0.4rem 0 0.6rem; }
.ptool td, .ptool th { padding: 0.3rem 0.3rem; border-bottom: 1px solid var(--border-subtle, #1e293b); text-align: left; vertical-align: middle; }
.ptool thead th { color: var(--text-muted, #94a3b8); font-weight: 500; font-size: 0.85rem; }
.ptool td select { width: 100%; min-width: 7rem; }
.ptool .pt-amt { white-space: nowrap; }
.ptool .pt-unit { margin-left: 0.3rem; color: var(--text-muted, #94a3b8); }
.ptool .pt-num { text-align: right; white-space: nowrap; font-family: var(--font-mono, monospace); }
.ptool .pt-remove { padding: 0.1rem 0.5rem; border-color: var(--border-active, #334155); color: var(--text-muted, #94a3b8); }
.ptool .pt-bar { height: 10px; border-radius: 999px; background: var(--surface-elevated, #151c27); border: 1px solid var(--border-subtle, #1e293b); overflow: hidden; margin: 0.5rem 0; }
.ptool .pt-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary, #10b981), var(--primary-bright, #4edea3)); transition: width 0.2s; }
.ptool .pt-summary { font-weight: 600; color: var(--text-parchment, #f1f5f9); }
.ptool .pt-fill { columns: 2 16rem; margin: 0.4rem 0 0; padding-left: 1.1rem; }
.ptool .pt-fill li { break-inside: avoid; margin-bottom: 0.2rem; }
.ptool .pt-chip { margin: 0.3rem 0.4rem 0 0; font-size: 0.85rem; }
.ptool .ptool-sub { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--border-active, #334155); }
.ptool .ptool-note { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--text-muted, #94a3b8); }
.ptool .tm-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.ptool .tm-list li { display: flex; gap: 0.8rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border-subtle, #1e293b); }
.ptool .tm-time { flex: 0 0 10.5rem; font-family: var(--font-mono, monospace); color: var(--tertiary-bright, #ffb95f); font-size: 0.88rem; }
.ptool .tm-what { flex: 1; }
.ptool .wk-min input { width: 3.8rem; }
.ptool .wk-mob { text-align: center; }
.ptool .wk-checks { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.ptool .wk-checks li { padding: 0.15rem 0; }
.ptool .wk-checks li.ok .wk-mark { color: var(--primary-bright, #4edea3); }
.ptool .wk-checks li.miss { color: var(--text-muted, #94a3b8); }
.ptool .wk-checks li.miss .wk-mark { color: var(--tertiary, #f59e0b); }
.ptool output, .ptool .ptool-out { display: block; margin-top: 0.4rem; }
.protocols-cover { float: right; width: 160px; margin: 0.2rem 0 1rem 1.2rem; }
.protocols-cover img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.protocols-cover figcaption { font-size: 0.75rem; color: var(--text-muted, #94a3b8); margin-top: 0.35rem; line-height: 1.3; }
.protocols-buy { clear: both; margin: 1.2rem 0; padding: 0.8rem 1rem; border-left: 3px solid var(--tertiary, #f59e0b); background: var(--surface-slate, #0f141c); border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0; }
@media (max-width: 560px) {
  .protocols-cover { float: none; width: 140px; margin: 0 auto 1rem; }
  .ptool .tm-list li { flex-direction: column; gap: 0.1rem; }
  .ptool .tm-time { flex-basis: auto; }
  .ptool { padding: 0.8rem; }
}
@media (max-width: 560px) {
  .ptool td select { min-width: 6rem; }
  .ptool input[type="number"] { width: 4.4rem; }
}

/* Printable weekly training sheet: hidden on screen, only page shown when printing. */
.wk-sheet { display: none; }
@media print {
  @page { size: auto; margin: 12mm; }
  html, body {
    background: #fff !important;
    color: #111 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  /* Hide the rest of the site so only the sheet takes up pages. The sheet is a
     direct child of body, so this does not hide its contents. */
  body > *:not(#wk-sheet) { display: none !important; }
  .wk-sheet {
    display: block !important;
    position: static;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff !important;
    color: #111 !important;
    border: 0;
    box-shadow: none;
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 10.5pt;
    line-height: 1.35;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .wk-sheet-title {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16pt;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
    color: #111 !important;
    page-break-after: avoid;
  }
  .wk-sheet-kicker {
    font-size: 10pt;
    margin: 2pt 0 10pt;
    color: #111 !important;
    page-break-after: avoid;
  }
  .wk-sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 10pt;
    page-break-inside: avoid;
  }
  .wk-sheet-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .wk-sheet-table th, .wk-sheet-table td {
    border: 1px solid #222;
    padding: 5pt 6pt;
    text-align: left;
    vertical-align: top;
    background: #fff !important;
    color: #111 !important;
  }
  .wk-sheet-table thead th {
    font-size: 8.5pt;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f0f0f0 !important;
    color: #111 !important;
  }
  .wk-sheet-table tbody th { width: 3.2rem; white-space: nowrap; font-weight: 600; }
  .wk-sheet-min, .wk-sheet-mob, .wk-sheet-done { text-align: center; white-space: nowrap; }
  .wk-sheet-min { width: 3.6rem; }
  .wk-sheet-mob { width: 4.2rem; }
  .wk-sheet-done { width: 2.6rem; }
  .wk-sheet-box {
    display: inline-block;
    width: 11pt;
    height: 11pt;
    border: 1.25pt solid #111;
    background: #fff !important;
    vertical-align: middle;
  }
  .wk-sheet-steps, .wk-sheet-footer, .wk-sheet-sub { color: #111 !important; }
  .wk-sheet-steps { margin: 0 0 8pt; font-size: 10.5pt; }
  .wk-sheet-sub {
    font-size: 11pt;
    font-weight: 650;
    margin: 4pt 0 4pt;
    page-break-after: avoid;
  }
  .wk-sheet-checks {
    list-style: none;
    margin: 0 0 12pt;
    padding: 0;
    page-break-inside: avoid;
  }
  .wk-sheet-checks li { padding: 1.5pt 0; color: #111 !important; }
  .wk-sheet-checks li + li { border-top: 0.5pt solid #ccc; }
  .wk-sheet-footer {
    margin: 0;
    padding-top: 8pt;
    border-top: 1pt solid #111;
    font-size: 9pt;
    letter-spacing: 0.02em;
  }
}

.protocols-guide {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.15rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  clear: both;
  margin: 1.6rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-active, #334155);
  border-radius: var(--radius-lg, 12px);
  background: var(--surface-slate, #0f141c);
}
.protocols-guide-thumb {
  display: block;
  width: 180px;
  max-width: 180px;
  height: auto;
  flex: 0 0 180px;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--border-subtle, #1e293b);
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.post .protocols-guide-thumb { max-width: 180px; height: auto; }
.protocols-guide-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
}
.protocols-guide-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-parchment, #f1f5f9);
}
.protocols-guide-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted, #94a3b8);
}
.protocols-guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--secondary-bright, #4cd7f6);
  border: 1px solid var(--secondary, #06b6d4);
  border-radius: var(--radius-md, 8px);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.protocols-guide-btn:hover, .protocols-guide-btn:focus-visible {
  background: rgba(6, 182, 212, 0.12);
  color: var(--secondary-bright, #4cd7f6);
}
@media (max-width: 560px) {
  .protocols-guide {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
  }
  .protocols-guide-thumb,
  .post .protocols-guide-thumb {
    width: 160px;
    max-width: 160px;
    flex: 0 0 auto;
    align-self: center;
  }
  .protocols-guide-body { align-items: stretch; }
  .protocols-guide-btn { width: 100%; }
}
