/* tax-planning-appearance.css — Configurable 12-Tab Dock (Left / Right / Floating / Top)
   & Dynamic Website Appearance + Custom Screen Background Color Engine (T-UI-001 & T-UI-002) */

:root {
  --tp-bg: #faf8f5;
  --tp-card: #ffffff;
  --tp-ink: #0f172a;
  --tp-muted: #475569;
  --tp-line: #cbd5e1;
  --tp-accent: #0f766e;
  --tp-accent-ink: #ffffff;
  --tp-accent-soft: #ecfdf5;
  --tp-table-head: #f8fafc;
}

:root[data-tp-theme="ivory"] {
  --tp-bg: #faf8f5; --tp-card: #ffffff; --tp-ink: #0f172a; --tp-muted: #475569;
  --tp-line: #dedad0; --tp-accent: #0f766e; --tp-accent-soft: #ecfdf5; --tp-table-head: #f5f2eb;
}
:root[data-tp-theme="light"] {
  --tp-bg: #f4f6f8; --tp-card: #ffffff; --tp-ink: #0f172a; --tp-muted: #475569;
  --tp-line: #cbd5e1; --tp-accent: #0f766e; --tp-accent-soft: #ecfdf5; --tp-table-head: #f8fafc;
}
:root[data-tp-theme="sepia"] {
  --tp-bg: #f7f3eb; --tp-card: #fffdf9; --tp-ink: #2c241b; --tp-muted: #6b5e4c;
  --tp-line: #e3dac9; --tp-accent: #0b6b5e; --tp-accent-soft: #edf5f2; --tp-table-head: #f2ece1;
}
:root[data-tp-theme="emerald-mint"] {
  --tp-bg: #eef7f4; --tp-card: #ffffff; --tp-ink: #06372c; --tp-muted: #2d6a5b;
  --tp-line: #bce0d4; --tp-accent: #0f766e; --tp-accent-soft: #d1fae5; --tp-table-head: #e6f4ef;
}
:root[data-tp-theme="ice-slate"] {
  --tp-bg: #eef2f6; --tp-card: #ffffff; --tp-ink: #0f172a; --tp-muted: #475569;
  --tp-line: #cbd5e1; --tp-accent: #1e3a8a; --tp-accent-soft: #dbeafe; --tp-table-head: #e2e8f0;
}
:root[data-tp-theme="high-contrast"] {
  --tp-bg: #ffffff; --tp-card: #ffffff; --tp-ink: #000000; --tp-muted: #1e293b;
  --tp-line: #64748b; --tp-accent: #065f46; --tp-accent-soft: #d1fae5; --tp-table-head: #f1f5f9;
}
:root[data-tp-theme="dark"] {
  --tp-bg: #0f141a; --tp-card: #161d25; --tp-ink: #e6edf3; --tp-muted: #9aa7b4;
  --tp-line: #2b3540; --tp-accent: #14b8a6; --tp-accent-soft: #102a25; --tp-table-head: #1e2936;
}
:root[data-tp-theme="obsidian"] {
  --tp-bg: #090d16; --tp-card: #111827; --tp-ink: #f8fafc; --tp-muted: #94a3b8;
  --tp-line: #1e293b; --tp-accent: #10b981; --tp-accent-soft: #064e3b; --tp-table-head: #1f2937;
}

/* Bind Tax Planning surfaces to appearance variables & prevent /styles.css body padding collision */
html body {
  background-color: var(--tp-bg) !important;
  color: var(--tp-ink) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.tp-shell {
  background-color: var(--tp-bg);
  color: var(--tp-ink);
  min-height: 100vh;
  box-sizing: border-box !important;
}
.tp-topbar { border-bottom-color: var(--tp-line) !important; }
.tp-title-wrap h1, .tp-kpi-val, .tp-card h3 { color: var(--tp-ink) !important; }
.tp-title-wrap p, .tp-kpi-label, .tp-form-row label { color: var(--tp-muted) !important; }
.tp-kpi-card, .tp-card {
  background-color: var(--tp-card) !important;
  border-color: var(--tp-line) !important;
  color: var(--tp-ink) !important;
}
.tp-table th {
  background-color: var(--tp-table-head) !important;
  color: var(--tp-ink) !important;
  border-color: var(--tp-line) !important;
}
.tp-table td {
  border-color: var(--tp-line) !important;
  color: var(--tp-ink) !important;
}
.tp-form-row input, .tp-form-row select, .tp-controls select {
  background-color: var(--tp-card) !important;
  color: var(--tp-ink) !important;
  border-color: var(--tp-line) !important;
}
.tp-btn {
  background-color: var(--tp-accent) !important;
  border-color: var(--tp-accent) !important;
  color: var(--tp-accent-ink, #ffffff) !important;
}
.tp-btn.tp-btn-secondary, .tp-btn.secondary {
  background-color: var(--tp-card) !important;
  color: var(--tp-accent) !important;
  border-color: var(--tp-accent) !important;
}

/* Font family, scale, and density overrides */
:root[data-tp-font="sans"] body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
:root[data-tp-font="editorial"] body { font-family: "IBM Plex Sans", "Inter", system-ui, sans-serif !important; }
:root[data-tp-font="serif"] body { font-family: Georgia, "Merriweather", "Times New Roman", serif !important; }
:root[data-tp-font="mono"] body { font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace !important; }

:root[data-tp-scale="compact"] body { font-size: 13px !important; }
:root[data-tp-scale="standard"] body { font-size: 14.5px !important; }
:root[data-tp-scale="comfortable"] body { font-size: 16px !important; }
:root[data-tp-scale="large"] body { font-size: 17.5px !important; }

:root[data-tp-density="compact"] .tp-card { padding: 12px 14px !important; }
:root[data-tp-density="compact"] .tp-table th, :root[data-tp-density="compact"] .tp-table td { padding: 5px 7px !important; font-size: 12px !important; }
:root[data-tp-density="relaxed"] .tp-card { padding: 24px 26px !important; }
:root[data-tp-density="relaxed"] .tp-table th, :root[data-tp-density="relaxed"] .tp-table td { padding: 11px 13px !important; }

/* ── 12-TAB NAVIGATION DOCK MODES (LEFT / RIGHT / FLOATING / TOP) ── */
.tp-tabs-dock-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 6px 8px; margin-bottom: 6px;
  border-bottom: 1px solid var(--tp-line); font-size: 11.5px; font-weight: 700;
  color: var(--tp-muted);
}
.tp-dock-mini-btn {
  padding: 3px 7px; border-radius: 5px; border: 1px solid var(--tp-line);
  background: var(--tp-card); color: var(--tp-ink); font-size: 11px;
  font-weight: 600; cursor: pointer;
}
.tp-dock-mini-btn.active {
  background: var(--tp-accent); color: #ffffff; border-color: var(--tp-accent);
}
.tp-tab-btn {
  background-color: var(--tp-card) !important;
  color: var(--tp-ink) !important;
  border-color: var(--tp-line) !important;
  transition: all 0.14s ease;
}
.tp-tab-btn.active {
  background-color: var(--tp-accent) !important;
  color: #ffffff !important;
  border-color: var(--tp-accent) !important;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}

/* Mode 1: LEFT VERTICAL SIDEBAR RAIL (Like Ledgerly CPA — Flush Border, Zero Dead Gap, Centered Content) */
@media (min-width: 900px) {
  :root[data-tp-nav="left"] .tp-shell {
    margin-left: 204px !important;
    margin-right: 0 !important;
    width: calc(100% - 204px) !important;
    max-width: none !important;
    padding: 8px 16px 32px 12px !important;
    border-left: 1px solid var(--tp-line);
  }
  :root[data-tp-nav="left"] .tp-tabs {
    position: fixed; top: 0; left: 0; bottom: 0; width: 204px; z-index: 45;
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    gap: 3px; padding: 8px 8px; margin: 0; overflow-y: auto; box-sizing: border-box;
    background: var(--tp-card); border-right: 1px solid var(--tp-line); border-bottom: none;
    box-shadow: 1px 0 6px rgba(15, 23, 42, 0.04);
  }
  body:has(#tax-planning-demo-banner:not([hidden])) .tp-tabs {
    top: 42px;
  }
  :root[data-tp-nav="left"] .tp-tab-btn {
    width: 100%; text-align: left; padding: 5px 8px; font-size: 11.5px; line-height: 1.25; box-sizing: border-box;
  }

  /* Mode 2: RIGHT VERTICAL SIDEBAR RAIL */
  :root[data-tp-nav="right"] .tp-shell {
    margin-left: 0 !important;
    margin-right: 204px !important;
    width: calc(100% - 204px) !important;
    max-width: none !important;
    padding: 8px 12px 32px 16px !important;
    border-right: 1px solid var(--tp-line);
  }
  :root[data-tp-nav="right"] .tp-tabs {
    position: fixed; top: 0; right: 0; left: auto; bottom: 0; width: 204px; z-index: 45;
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    gap: 3px; padding: 8px 8px; margin: 0; overflow-y: auto; box-sizing: border-box;
    background: var(--tp-card); border-left: 1px solid var(--tp-line); border-bottom: none;
    box-shadow: -1px 0 6px rgba(15, 23, 42, 0.04);
  }
  :root[data-tp-nav="right"] .tp-tab-btn {
    width: 100%; text-align: left; padding: 5px 8px; font-size: 11.5px; line-height: 1.25; box-sizing: border-box;
  }

  /* Mode 3: COMPACT NUMBERED RAIL (1..12) */
  :root[data-tp-nav="left-compact"] .tp-shell {
    margin-left: 58px !important;
    margin-right: 0 !important;
    width: calc(100% - 58px) !important;
    max-width: none !important;
    padding: 8px 16px 32px 12px !important;
    border-left: 1px solid var(--tp-line);
  }
  :root[data-tp-nav="left-compact"] .tp-tabs {
    position: fixed; top: 0; left: 0; bottom: 0; width: 58px; z-index: 45;
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: center;
    gap: 5px; padding: 8px 6px; margin: 0; overflow-y: auto; box-sizing: border-box;
    background: var(--tp-card); border-right: 1px solid var(--tp-line);
  }
  :root[data-tp-nav="left-compact"] .tp-tab-btn {
    width: 44px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; border-radius: 8px;
  }

  /* Mode 4 & 5: Center content cleanly when using Floating or Top Dock */
  :root[data-tp-nav="floating"] .tp-shell,
  :root[data-tp-nav="floating-bottom"] .tp-shell,
  :root[data-tp-nav="top"] .tp-shell {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 20px 36px !important;
  }
}

/* Mode 4: FLOATING GLASS PILL DOCK (Top or Bottom, Draggable & Minimizable) */
:root[data-tp-nav="floating"] .tp-tabs,
:root[data-tp-nav="floating-bottom"] .tp-tabs {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(96vw, 1520px); z-index: 60;
  display: flex; flex-wrap: nowrap; align-items: center; gap: 5px;
  overflow-x: auto; padding: 6px 10px; margin: 0;
  background: color-mix(in srgb, var(--tp-card) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--tp-accent); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}
:root[data-tp-nav="floating"] .tp-tabs { top: 44px; bottom: auto; }
:root[data-tp-nav="floating-bottom"] .tp-tabs { bottom: 14px; top: auto; }
:root[data-tp-nav="floating"] .tp-tab-btn,
:root[data-tp-nav="floating-bottom"] .tp-tab-btn {
  white-space: nowrap; flex-shrink: 0; padding: 5px 9px; font-size: 11.5px; border-radius: 7px;
}

/* Mode 5: TOP SINGLE-ROW COMPACT RIBBON (No 4-Row Wrap!) */
:root[data-tp-nav="top"] .tp-tabs {
  display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px;
  padding: 4px 2px 6px; margin-bottom: 10px; white-space: nowrap;
}
:root[data-tp-nav="top"] .tp-tab-btn {
  white-space: nowrap; flex-shrink: 0; padding: 5px 9px; font-size: 11.5px;
}

/* ── COMPACT TAX PLANNING TOPBAR, PORTFOLIO STRIP & TOP BASELINE CARD ── */
.tp-topbar {
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
  gap: 6px 10px !important;
}
.tp-title-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
}
.tp-title-wrap > div:first-child {
  margin-bottom: 0 !important;
  gap: 6px !important;
}
.tp-title-wrap img {
  width: 22px !important;
  height: 22px !important;
}
.tp-title-wrap h1 {
  font-size: 14.5px !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
#tp-firm-client-subtitle {
  font-size: 11px !important;
  line-height: 1.2 !important;
  max-width: 460px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
  background: color-mix(in srgb, var(--tp-card) 75%, var(--tp-line)) !important;
  border: 1px solid var(--tp-line) !important;
  margin: 0 !important;
}
.tp-controls {
  gap: 4px !important;
}
.tp-controls select,
.tp-controls .tp-btn,
.tp-controls a.tp-btn {
  height: 24px !important;
  padding: 0 7px !important;
  font-size: 11px !important;
  border-radius: 5px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}
.tp-controls #tp-client-select { max-width: 205px !important; }
.tp-controls #tp-filing-status-select { max-width: 130px !important; }
.tp-controls #tp-nav-pos-select { max-width: 130px !important; }
.tp-controls #tp-quick-theme { max-width: 125px !important; }
.tp-controls #tp-custom-bg-color {
  width: 24px !important;
  height: 24px !important;
  padding: 1px !important;
}
#tp-uhnw-portfolio-strip {
  padding: 6px 12px !important;
  margin-bottom: 8px !important;
}
#tp-uhnw-portfolio-strip summary::-webkit-details-marker {
  display: none;
}
.tp-kpi-strip {
  margin-bottom: 8px !important;
  gap: 8px !important;
}
.tp-card {
  padding: 12px 14px !important;
}
.tp-card h3 {
  font-size: 14px !important;
  margin-bottom: 4px !important;
}
.tp-cite {
  font-size: 11px !important;
  margin-bottom: 6px !important;
}
.tp-form-row {
  margin: 6px 0 !important;
  gap: 8px !important;
}
.tp-form-row label {
  font-size: 11.5px !important;
  gap: 2px !important;
}
.tp-form-row input,
.tp-form-row select {
  height: 28px !important;
  padding: 2px 8px !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
}
.tp-form-row .tp-btn {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

/* Minimized Floating Pill Launcher (0px Workspace Overhead) & Hide Marketing Floating Pill Inside Workspace */
#global-floating-back-main-site, #tp-back-to-main-site-btn {
  display: none !important;
}
:root[data-tp-nav-collapsed="true"] .tp-tabs .tp-tab-btn:not(.active) {
  display: none !important;
}

/* T-OBS-011 whole-book scan (tax-planning-whole-book.js) */
.tp-wbs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tp-wbs-chip { border: 1px solid var(--tp-line); background: var(--tp-card); color: var(--tp-ink); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.tp-wbs-chip span { color: var(--tp-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.tp-wbs-chip.active { background: var(--tp-accent); border-color: var(--tp-accent); color: var(--tp-accent-ink, #fff); }
.tp-wbs-chip.active span { color: inherit; }
.tp-wbs-chip:disabled { opacity: 0.45; cursor: default; }
.tp-wbs-chip:focus-visible, .tp-wbs-row button:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; }
.tp-wbs-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; margin: 8px 0; border: 1px solid var(--tp-line); border-radius: 8px; background: var(--tp-accent-soft); }
.tp-wbs-bulk[hidden] { display: none; }
.tp-wbs-bulk input { flex: 1 1 220px; min-width: 0; padding: 6px 8px; border: 1px solid var(--tp-line); border-radius: 6px; }
.tp-wbs-scroll { overflow-x: auto; }
.tp-wbs-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-wbs-actions { white-space: nowrap; }
.tp-wbs-check { width: 32px; text-align: center; }
.tp-wbs-detail > td { background: var(--tp-table-head); }
.tp-wbs-row { border: 1px solid var(--tp-line); border-radius: 8px; background: var(--tp-card); padding: 10px 12px; margin: 8px 0; }
.tp-wbs-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tp-wbs-row p { margin: 6px 0; }
.tp-wbs-list { font-size: 12.5px; margin-top: 4px; }
.tp-wbs-list ul { margin: 2px 0 0 18px; padding: 0; }
.tp-wbs-row-actions { margin-top: 6px; }
.tp-wbs-reason { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tp-wbs-reason input { padding: 6px 8px; border: 1px solid var(--tp-line); border-radius: 6px; min-width: 220px; }
.tp-wbs-muted { color: var(--tp-muted); }
.tp-wbs-subject { color: var(--tp-muted); }
.tp-badge.tp-wbs-maybe { background: transparent; color: var(--tp-muted); border-style: dashed; border-color: var(--tp-line); }
.tp-wbs-fold { margin-top: 12px; }
.tp-wbs-fold summary { cursor: pointer; font-weight: 600; }
/* T-SCEN-016 complexity, audit risk and implementation checklist */
.tp-wbs-plan { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--tp-line); }
.tp-wbs-plan-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tp-badge.tp-wbs-cx-low { background: var(--tp-accent-soft); color: var(--tp-ink); }
.tp-badge.tp-wbs-cx-medium { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.tp-badge.tp-wbs-cx-high { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.tp-wbs-steps { margin: 6px 0 0 18px; padding: 0; font-size: 13px; }
.tp-wbs-steps li { margin: 3px 0; }
.tp-wbs-steps input { margin-right: 4px; }
/* T-SCEN-015 three plans side by side */
.tp-wbs-plans { margin: 4px 0 10px; }
.tp-wbs-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.tp-wbs-plan-col { border: 1px solid var(--tp-line); border-radius: 8px; background: var(--tp-card); padding: 10px 12px; min-width: 0; }
.tp-wbs-plan-col h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tp-muted); }
.tp-wbs-plan-tax { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tp-wbs-plan-saving { font-weight: 700; color: var(--tp-accent); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.tp-wbs-plan-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; }
.tp-wbs-plan-list li { border-top: 1px solid var(--tp-line); padding-top: 6px; }
.tp-wbs-move select { margin-left: 4px; font-size: 12px; max-width: 100%; }
.tp-ri-best td { font-weight: 700; background: var(--tp-accent-soft); }
.tp-wbs-clientbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
#tp-wbs-pkg-table input, #tp-wbs-pkg-table select { width: 100%; min-width: 80px; }

/* ── Whole-book scan, 10 Nov 2026 redesign: summary band, bars, pills, calm type ── */
#panel-whole-book .tp-cite { font-family: inherit; color: var(--tp-muted); font-size: 13px; }
.tp-wbs-tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin: 12px 0 6px; }
.tp-wbs-tile { border: 1px solid var(--tp-line); border-radius: 10px; padding: 14px 16px; background: var(--tp-card); min-width: 0; }
.tp-wbs-tile-lead { background: var(--tp-accent-soft); border-color: transparent; }
.tp-wbs-tile-label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--tp-muted); }
.tp-wbs-tile-value { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--tp-ink); }
.tp-wbs-tile-lead .tp-wbs-tile-value { color: var(--tp-accent); font-size: 36px; }
.tp-wbs-tile-text { font-size: 17px; line-height: 1.3; }
.tp-wbs-of { font-size: 16px; font-weight: 500; color: var(--tp-muted); }
.tp-wbs-tile-sub { font-size: 12.5px; color: var(--tp-muted); margin-top: 4px; }
.tp-wbs-fine { font-size: 12.5px; color: var(--tp-muted); margin: 4px 0 10px; }
#tp-wbs-table td { vertical-align: middle; }
#tp-wbs-table .tp-wbs-rank { color: var(--tp-muted); width: 36px; font-variant-numeric: tabular-nums; }
#tp-wbs-table .tp-wbs-num { font-weight: 700; min-width: 120px; }
.tp-wbs-bar { display: block; height: 4px; border-radius: 2px; background: var(--tp-line); margin-top: 6px; }
.tp-wbs-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--tp-accent); }
.tp-wbs-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-wbs-opp { font-size: 12px; border: 1px solid var(--tp-line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; background: var(--tp-card); }
.tp-wbs-opp b { font-variant-numeric: tabular-nums; }
.tp-wbs-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; }
.tp-wbs-chipline { border-radius: 999px; padding: 1px 8px; font-weight: 600; text-transform: capitalize; }
.tp-wbs-chipline.tp-wbs-cx-low { background: var(--tp-accent-soft); color: var(--tp-ink); }
.tp-wbs-chipline.tp-wbs-cx-medium { background: #fef3c7; color: #92400e; }
.tp-wbs-chipline.tp-wbs-cx-high { background: #fee2e2; color: #991b1b; }
.tp-wbs-why { margin-top: 6px; }
.tp-wbs-why > summary { cursor: pointer; color: var(--tp-accent); font-weight: 600; font-size: 13px; }
.tp-wbs-why[open] > summary { margin-bottom: 6px; }
.tp-wbs-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--tp-muted); margin-left: 8px; }
@media (max-width: 760px) {
  .tp-wbs-tiles { grid-template-columns: 1fr; }
  .tp-wbs-tile-lead .tp-wbs-tile-value { font-size: 30px; }
  #tp-wbs-table th:nth-child(4), #tp-wbs-table td:nth-child(4) { display: none; }
}

/* ── Phone (10 Nov 2026): the page header used to fill three screens before any
   content. Desktop-only appearance and dock controls are hidden; the header
   cards and the tabs scroll sideways instead of stacking. ── */
@media (max-width: 760px) {
  #tp-nav-pos-select, #tp-quick-theme, #tp-custom-bg-color, #tp-open-appearance-btn,
  #tp-practitioner-guide-link, #tp-tabs-dock-bar { display: none !important; }
  /* #id: client-teach-catalog.js injects ".tp-kpi-strip { display: grid !important }"
     site-wide; the id outranks it here without touching that shared script. */
  #tp-kpi-strip.tp-kpi-strip { display: flex !important; overflow-x: auto !important; gap: 8px !important; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  #tp-kpi-strip .tp-kpi-card { flex: 0 0 72%; scroll-snap-align: start; }
  :root .tp-tabs, :root[data-tp-nav] .tp-tabs {
    position: static !important; width: auto !important; height: auto !important; max-height: none !important;
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important;
    gap: 6px; margin: 8px 0 12px !important; padding: 0 0 6px !important;
  }
  :root .tp-tabs .tp-tab-btn { flex: 0 0 auto; white-space: nowrap; }
  :root[data-tp-nav] body, :root[data-tp-nav] main { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; }
}
.tp-wbs-link { background: none; border: 0; padding: 4px 6px; color: var(--tp-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.tp-wbs-link:hover, .tp-wbs-link:focus-visible { text-decoration: underline; }
.tp-wbs-quiet-toggle td { background: var(--tp-table-head); text-align: center; }
#panel-retirement .tp-cite { font-family: inherit; color: var(--tp-muted); font-size: 13px; }
.tp-records-wide { grid-column: 1 / -1; }
.tp-records-wide ul { columns: 2 320px; column-gap: 32px; margin: 6px 0 0 18px; padding: 0; }

/* T-030: which figures on a tab are the client's and which are assumed. */
.tp-inputs-note {
  border: 1px solid var(--tp-line);
  border-left: 3px solid var(--tp-accent);
  background: var(--tp-accent-soft);
  color: var(--tp-ink);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}
.tp-inputs-note p { margin: 2px 0; }
.tp-inputs-note .tp-muted { color: var(--tp-muted); }
.tp-inputs-note ul { margin: 2px 0 0; padding-left: 18px; }
.tp-inputs-note li { margin: 1px 0; }
.tp-inputs-note strong { font-weight: 700; }
/* Tab 8 with nothing on file: one line in place of $0 tables. */
.tp-fold-line { display: none; color: var(--tp-muted); font-size: 13px; margin: 0 0 12px; }
.tp-zero-fold .tp-fold-line { display: block; }
.tp-zero-fold .tp-card ~ .tp-card { display: none; }
.tp-linklike { background: none; border: 0; padding: 0; color: var(--tp-accent); text-decoration: underline; cursor: pointer; font: inherit; }
.tp-linklike:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; }
/* T-053: the Form 1040 entry form. */
.tp-1040-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; margin: 8px 0; }
.tp-1040-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--tp-ink); }
/* Tabs 4 and 5 (11 Nov 2026): a seven-column table in a one-third card ran
   under the card beside it. A grid item's min-width is its content, so the
   card could not shrink and the table painted over its neighbour. Wide
   cards take a whole row; any table still too wide scrolls inside its card. */
.tp-grid > .tp-card { min-width: 0; }
#card-client-roster, #card-1040-intake, #card-multiyear-compare { grid-column: 1 / -1; }
.tp-card > div[id$="-wrap"] { overflow-x: auto; }
#tp-roster-wrap { max-height: 520px; overflow-y: auto; }
#tp-roster-wrap thead th { position: sticky; top: 0; background: var(--tp-card, #fff); z-index: 1; }
