/* Embeddable calculator widget (/embed/*). Self-contained: no site header, footer or web fonts. */
:root {
  --w-bg: #ffffff;
  --w-panel: #f4f7fa;
  --w-ink: #0b1b2b;
  --w-ink-2: #26384a;
  --w-muted: #536476;
  --w-line: #cfd9e3;
  --w-brand: #047857;
  --w-pos: #047857;
  --w-neg: #b42318;
  --w-focus: #2563eb;
  --w-best: #eef6f3;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --w-bg: #0f1a24;
  --w-panel: #172532;
  --w-ink: #eef3f7;
  --w-ink-2: #c9d4de;
  --w-muted: #9fb0c0;
  --w-line: #2d3f50;
  --w-brand: #34d399;
  --w-pos: #34d399;
  --w-neg: #fca5a5;
  --w-focus: #93c5fd;
  --w-best: #12332a;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--w-bg); color: var(--w-ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.w { max-width: 460px; margin: 0 auto; padding: 14px 16px 12px; }
.w-title { font-size: 1.05rem; line-height: 1.3; margin: 0 0 10px; }
.w-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.w-field { display: grid; gap: 3px; min-width: 0; }
.w-field.w-wide { grid-column: 1 / -1; }
.w-field label { font-size: .8rem; font-weight: 600; color: var(--w-ink-2); }
.w-money { display: flex; align-items: center; border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-bg); }
.w-money span { padding: 0 0 0 9px; color: var(--w-muted); }
.w-money input, .w-field select { width: 100%; min-width: 0; min-height: 40px; border: 0; background: transparent; color: var(--w-ink); font: inherit; padding: 6px 9px; }
.w-money input { padding-left: 4px; font-variant-numeric: tabular-nums; }
.w-field select { border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-bg); }
.w-money:focus-within, .w-field select:focus-visible { outline: 3px solid var(--w-focus); outline-offset: 1px; }
.w-money input:focus { outline: none; }
.w-out { background: var(--w-panel); border-radius: 10px; padding: 10px 12px; }
.w-sum { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 0; }
.w-sum div { min-width: 0; }
.w-sum dt { font-size: .75rem; color: var(--w-muted); text-transform: uppercase; letter-spacing: .04em; }
.w-sum dd { margin: 0; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.w-profit dd { font-size: 1.25rem; }
.w-lines { margin: 8px 0 0; font-size: .8rem; color: var(--w-muted); min-height: 2.4em; }
.w-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.w-table th, .w-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--w-line); white-space: nowrap; }
.w-table th:first-child { text-align: left; }
.w-table thead th { font-size: .72rem; color: var(--w-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.w-table tbody tr:last-child th, .w-table tbody tr:last-child td { border-bottom: 0; }
.w-table tr.is-best th, .w-table tr.is-best td { background: var(--w-best); }
.w-badge { font-size: .68rem; font-weight: 700; color: var(--w-pos); border: 1px solid currentColor; border-radius: 999px; padding: 0 5px; margin-left: 2px; vertical-align: 1px; }
.pos { color: var(--w-pos); }
.neg { color: var(--w-neg); }
.w-note { margin: 10px 0 0; font-size: .74rem; color: var(--w-muted); }
.w-credit { margin: 8px 0 0; font-size: .8rem; }
.w-credit a { color: var(--w-brand); font-weight: 600; text-underline-offset: 3px; }
.w-credit a:focus-visible { outline: 3px solid var(--w-focus); outline-offset: 2px; border-radius: 3px; }
@media (max-width: 340px) {
  .w { padding: 10px 10px 8px; }
  .w-table th, .w-table td { padding: 5px 2px; }
}
