/* Calculator pages: form on one side, results on the other; stacks on phones. Uses the tokens in styles.css. */
.calc-wrap {
  width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px;
  display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 20px; align-items: start;
}
@media (max-width: 820px) { .calc-wrap { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }

.calc-form { display: grid; gap: 14px; }
.calc-field { display: flex; flex-direction: column; gap: 5px; }
.calc-field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.calc-field select, .calc-input input {
  font: inherit; font-size: 16px; color: var(--fg); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; min-width: 0;
}
.calc-input { position: relative; display: flex; align-items: center; }
.calc-input input { padding-inline-end: 54px; font-variant-numeric: tabular-nums; }
.calc-input .unit {
  position: absolute; inset-inline-end: 12px; font-size: 13px; color: var(--muted); pointer-events: none; font-family: var(--font-mono);
}
.calc-field select:focus-visible, .calc-input input:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.calc-out h2, .calc-sched h2 { font-size: 18px; margin-block-end: 12px; }
.calc-res { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.calc-res > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.calc-res .k { display: block; font-size: 12.5px; color: var(--muted); }
.calc-res .v { display: block; margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-res .v small { font-family: var(--font-body); font-weight: 500; font-size: 12.5px; color: var(--muted); }
.calc-res > .big { grid-column: 1 / -1; background: var(--accent-soft); }
.calc-res > .big .v { font-size: 30px; color: var(--accent-strong); }
.calc-verdict { grid-column: 1 / -1; background: var(--accent-soft) !important; color: var(--accent-strong); font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.calc-sentence { grid-column: 1 / -1; font-size: 14px; }
.calc-disc { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

.calc-chart { margin: 16px 0 0; }
.calc-chart figcaption { font-size: 13px; color: var(--muted); margin-block-end: 6px; }
.calc-chart svg { width: 100%; height: auto; display: block; }
.c-prin { fill: var(--accent); }
.c-int { fill: #e0a43a; }
.c-axis { stroke: var(--line); stroke-width: 1; }
.c-buy, .c-rent { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.c-buy { stroke: var(--accent); }
.c-rent { stroke: #e0a43a; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.legend i.c-prin, .legend i.c-buy { background: var(--accent); }
.legend i.c-int, .legend i.c-rent { background: #e0a43a; }

.calc-sched { width: calc(100% - 40px); max-width: 1120px; margin: 0 auto 20px; }
.sched-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-block-end: 12px; }
.sched-head h2 { margin: 0; }
.sched-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.sched-tabs button { background: transparent; border: 0; padding: 6px 14px; font-size: 13px; }
.sched-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-fg); }
.sched-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.sched-scroll { overflow-x: auto; max-height: 480px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.sched { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sched th, .sched td { padding: 7px 12px; text-align: end; white-space: nowrap; border-bottom: 1px solid var(--line); }
.sched th:first-child, .sched td:first-child { text-align: start; }
.sched thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; font-size: 13px; }

@media (max-width: 520px) {
  .calc-wrap { padding: 16px; }
  .calc-sched { width: calc(100% - 32px); }
  .card { padding: 16px; }
  .calc-res > .big .v { font-size: 26px; }
}

@media print {
  .top, .tools-nav, .foot, .seo, .sched-tabs, .sched-actions, .lang-select { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
  .calc-wrap { display: block; padding: 0; }
  .calc-form { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
  .calc-input input, .calc-field select { border: 0; padding: 0; }
  .sched-scroll { max-height: none; overflow: visible; border: 0; }
  .calc-sched { width: 100%; }
}

/* calc.js fills these after load; reserve roughly their final height so nothing jumps. --rows is set per page. */
.calc-form:empty { min-height: calc(24px + var(--rows, 5) * 84px); }
.calc-out:empty { min-height: 640px; }
