/* Calculator pages. Builds on /styles.css (tokens, nav, buttons, footer). */
.crumbs { padding: 28px 0 0; font-size: 14px; font-weight: 600; color: var(--muted-2); }
.crumbs a { color: var(--accent); }
.crumbs a:hover { text-decoration: underline; opacity: 1; }
.crumbs span { margin: 0 8px; opacity: .6; }

.tool-hero { padding: 24px 0 8px; }
.tool-hero h1 { margin-top: 14px; font-size: 48px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; max-width: 820px; }
.tool-hero .lead { margin-top: 16px; font-size: 19px; color: var(--muted); max-width: 720px; }

.tool-grid { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.tool-card { flex: 1 1 420px; min-width: 0; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 60px -40px rgba(11, 27, 43, .25); }
.tool-card h2 { font-size: 18px; font-weight: 800; }
.tool-form { margin-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.tool-form .field > label, .tool-form .field > .legend { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.tool-form .hint { margin-top: 6px; font-size: 13px; color: var(--muted-2); }
.tool-form input[type="number"], .tool-form select { width: 100%; padding: 13px 14px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; }
.tool-form input[type="number"]:focus-visible, .tool-form select:focus-visible { border-color: var(--accent); }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted-2); pointer-events: none; }
.input-wrap input { padding-left: 32px !important; }
.row2 { display: flex; flex-wrap: wrap; gap: 16px; }
.row2 > .field { flex: 1 1 140px; }

.seg { display: flex; padding: 4px; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1; padding: 10px 12px; font-size: 14px; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(11, 27, 43, .15); }

.result-card { flex: 1 1 380px; min-width: 0; padding: 32px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 20px; }
.result-card .label { font-size: 15px; font-weight: 700; color: var(--accent); }
.result-big { margin-top: 8px; font-size: 52px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; word-break: break-word; }
.result-list { margin-top: 24px; border-top: 1px solid var(--accent-line); }
.result-list .r { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--accent-line); font-size: 15px; }
.result-list .r span:first-child { color: var(--muted); }
.result-list .r strong { font-weight: 800; text-align: right; }
.result-note { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--amber-bg); color: var(--amber-ink); font-size: 14px; font-weight: 600; display: none; }
.result-note.show { display: block; }
.invalid { margin-top: 12px; font-size: 14px; font-weight: 600; color: #9A2A1F; display: none; }
.invalid.show { display: block; }

.prose-wrap { padding: 72px 0 24px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 48px; font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-top: 14px; font-size: 17px; color: var(--ink-2); }
.prose ul, .prose ol { margin: 14px 0 0 22px; padding: 0; list-style: revert; font-size: 17px; color: var(--ink-2); }
.prose li { margin-top: 8px; }
.prose a { color: var(--accent); text-decoration: underline; }
.table-wrap { margin-top: 16px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 800; background: var(--bg); }
.prose code { font-family: var(--mono); font-size: 14px; }
.formula { margin-top: 16px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; font-family: var(--mono); font-size: 15px; font-weight: 600; overflow-x: auto; }
.example { margin-top: 16px; padding: 18px 20px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; font-size: 16px; }
.example b { color: var(--ink); }

.faq { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.faq summary { padding: 16px 20px; font-size: 16px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0; padding: 0 20px 18px; font-size: 16px; color: var(--ink-2); }

.cta-card { margin-top: 56px; padding: 36px; background: var(--ink); color: #E8EEF2; border-radius: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-card h2 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; color: #fff; }
.cta-card p { margin: 8px 0 0; font-size: 16px; color: var(--night-text); max-width: 520px; }

.related { margin-top: 56px; padding-bottom: 96px; }
.related h2 { font-size: 22px; font-weight: 800; }
.related .cards { margin-top: 18px; gap: 16px; }
.related a.card { flex: 1 1 220px; padding: 22px; background: #fff; display: block; }
.related a.card:hover { border-color: var(--accent); opacity: 1; }
.related a.card h3 { margin: 0; font-size: 17px; }
.related a.card p { margin-top: 6px; font-size: 14px; }

@media (max-width: 900px) {
    .tool-hero h1 { font-size: 38px; }
    .prose-wrap { padding-top: 56px; }
}
@media (max-width: 600px) {
    .tool-hero h1 { font-size: 32px; }
    .tool-hero .lead { font-size: 17px; }
    .tool-card, .result-card { padding: 22px; }
    .result-big { font-size: 40px; }
    .prose h2 { font-size: 24px; }
    .cta-card { padding: 26px; }
}
