/* Tools › Salary v Dividend (#sd). Colours come from styles.css's tokens, so light and dark both work. */
.sd-panel { margin-bottom: 16px; }
.sd-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); align-items: end; margin-bottom: 12px; }
.sd-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.sd-form .sd-check { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ink); }
.sd-table td, .sd-table th { text-align: right; white-space: nowrap; }
.sd-table td:first-child, .sd-table th:first-child { text-align: left; white-space: normal; }
.sd-table .sd-best { background: var(--green-soft); }
.sd-table th.sd-best { color: var(--green); }
.sd-table tr.sd-net td { font-weight: 700; border-top: 2px solid var(--line); }
.sd-table tr.sd-sub td { color: var(--muted); font-size: 12.5px; }
.sd-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--green-soft); color: var(--green); margin-left: 6px; }
#sd-assume { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
#sd-params table td:nth-child(2) { text-align: right; }
.sd-unv { color: var(--amber); font-size: 12px; font-weight: 600; }
.sd-form input[type=number] { font: 13px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 36px; width: 100%; box-sizing: border-box; }
/* On a phone the table scrolls sideways; the row labels stay in view. */
.sd-table td:first-child, .sd-table th:first-child { min-width: 8.5rem; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.sd-table td.sd-best:first-child { background: var(--panel); }
.sd-client { margin: 0 0 12px; }
/* The printed summary's heading is for paper only. */
.sd-print-head { display: none; }
@page { size: A4; margin: 14mm; }
@media print {
  /* A client-file copy is always light on white, whatever the screen theme. */
  :root, :root[data-theme] { --ink: #111; --panel: #fff; --line: #bbb; --muted: #555; --green: #14532d; --green-soft: #e3f2e8; --amber: #7a4300; --amber-soft: #fff3e0; --red: #9b1c1c; --red-soft: #fdecea; }
  body { background: #fff !important; color: #111 !important; }
  #sidebar, .side-nav, .crumb, .toast, #toast, #sd-banner, #sd-client, #sd-form, #sd-error, #sd-params-box, [data-page="sd"] .page-head { display: none !important; }
  .shell { display: block !important; }
  .main { padding: 0 !important; }
  .sd-print-head { display: block; margin-bottom: 12px; }
  .sd-print-head h1 { font-size: 22px; margin: 0 0 4px; }
  .sd-print-sub { margin: 0 0 10px; color: #333; }
  .sd-print-inputs { border-collapse: collapse; margin-bottom: 10px; font-size: 13px; }
  .sd-print-inputs td { padding: 2px 18px 2px 0; }
  .sd-print-inputs td:first-child { color: #555; }
  .sd-print-warn { border: 1px solid #a85d00; background: #fff3e0; color: #5a3200; padding: 6px 10px; border-radius: 6px; font-size: 12.5px; }
  .sd-panel { box-shadow: none; border: 0; padding: 0; break-inside: avoid; }
  .table-wrap { overflow: visible !important; max-height: none !important; margin: 0 !important; }
  .sd-table { font-size: 11.5px; }
  .sd-table { width: 100% !important; table-layout: auto; }
  .sd-table th { white-space: normal; }
  .sd-table th, .sd-table td { padding: 4px 6px !important; }
  .sd-table td:first-child, .sd-table th:first-child { width: 28%; }
  .sd-table th:first-child { border: 0; }
  #sd-assume { font-size: 11.5px; gap: 2px; }
  #sd-assume-box h2 { font-size: 14px; margin: 8px 0 0; }
  .sd-table td:first-child, .sd-table th:first-child { position: static; min-width: 0; }
  .foot-note { font-size: 11px; }
}
