/* ============ Rent vs Buy Calculator - styles ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1d4ed8; --purple: #7c3aed; --ink: #1e293b; --muted: #64748b;
  --line: #e2e8f0; --bg: #f8fafc; --card: #ffffff;
  --buy: #1d4ed8; --rent: #16a34a; --warn: #b45309; --bad: #b91c1c;
}
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.site-header { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; padding: 44px 0 40px; }
.hub-link { color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; }
.hub-link:hover { text-decoration: underline; }
.site-header h1 { font-size: 2.2rem; margin: 10px 0 8px; }
.site-header .sub { opacity: .93; max-width: 760px; font-size: 1.02rem; }

.verdict-card { background: var(--card); border-radius: 16px; box-shadow: 0 4px 24px rgba(15,23,42,.08); padding: 28px 32px; margin: 28px 0; border-left: 6px solid var(--blue); }
.verdict-headline { font-size: 1.5rem; font-weight: 700; }
.verdict-headline .hl-buy { color: var(--blue); }
.verdict-headline .hl-rent { color: var(--rent); }
.verdict-sub { color: var(--muted); margin-top: 6px; }

.layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; margin-bottom: 28px; }
.card { background: var(--card); border-radius: 16px; box-shadow: 0 4px 24px rgba(15,23,42,.07); padding: 24px; margin-bottom: 24px; }
.card h2 { font-size: 1.2rem; margin-bottom: 14px; }
.results-col .card:last-child { margin-bottom: 0; }

.inputs-card fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 10px; margin-bottom: 14px; }
.inputs-card legend { font-weight: 700; font-size: .92rem; padding: 0 8px; color: var(--blue); }
.inputs-card label { display: block; font-size: .88rem; margin-bottom: 10px; color: #334155; }
.inputs-card input[type="number"], .inputs-card select { width: 100%; padding: 8px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.inputs-card input[type="range"] { width: 100%; margin-top: 8px; accent-color: var(--blue); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unit { color: var(--muted); font-size: .78rem; }
.hint { font-size: .82rem; color: var(--muted); margin: 2px 0 6px; }
.check-row { display: flex !important; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; }
.check-row small { color: var(--muted); }

.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: .92rem; font-weight: 600; cursor: pointer; }
.btn-ghost { background: #eef2ff; color: var(--blue); width: 100%; }
.btn-ghost:hover { background: #e0e7ff; }

#chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 18px; align-items: center; margin-top: 10px; font-size: .88rem; flex-wrap: wrap; }
.sw { display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw-buy { background: var(--buy); } .sw-rent { background: var(--rent); }
.muted { color: var(--muted); }

.sum-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sum-table th, .sum-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.sum-table th.num, .sum-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sum-table tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.sum-table tr.winner td { background: #f0fdf4; }
.pos { color: var(--rent); } .neg { color: var(--bad); }

.math-card summary { cursor: pointer; font-size: 1.05rem; }
.math-body { margin-top: 14px; font-size: .92rem; color: #334155; }
.math-body h3 { font-size: 1rem; margin: 16px 0 6px; color: var(--blue); }
.math-body ul { margin-left: 20px; }
.math-body li { margin: 5px 0; }
.math-body code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; font-size: .85rem; }

.faq-card details.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq-card details.faq:last-child { border-bottom: none; }
.faq-card summary { cursor: pointer; font-weight: 600; }
.faq-card details p { margin-top: 8px; color: #475569; font-size: .93rem; }

.disclaimer { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 14px 18px; font-size: .86rem; color: #92400e; margin-bottom: 28px; }
.site-footer { text-align: center; padding: 20px 0 36px; color: #94a3b8; font-size: .85rem; }
.site-footer a { color: var(--blue); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .site-header h1 { font-size: 1.7rem; }
  .verdict-headline { font-size: 1.2rem; }
}
