/* Free calculators at /tools/. Same colors and type as the rest of the site. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-top: #0D0D14; --bg-mid: #07070D; --bg-bottom: #050508;
  --line: rgba(255,255,255,0.08); --card: rgba(255,255,255,0.035);
  --text: #f0f0f0; --muted: #9a9aa6; --gold: #F5C842; --amber: #FFAA32;
  --lime: #B4FF50; --electric: #5AC8FA; --coral: #FF6464;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: #0D0D14; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 40%, var(--bg-bottom) 100%);
  background-attachment: fixed; color: var(--text); line-height: 1.6; min-height: 100vh; overflow-x: hidden;
}
a { color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.gradient-text { background: linear-gradient(135deg, var(--gold), var(--amber)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

nav { position: sticky; top: 0; z-index: 10; background: rgba(13,13,20,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; max-width: 1120px; }
nav .logo { font-size: 2rem; font-weight: 900; letter-spacing: -0.03em; text-decoration: none; }
nav .back { color: var(--muted); font-size: 0.92rem; text-decoration: none; }
nav .back:hover { color: var(--text); }

header { padding: 56px 0 28px; }
header .crumb { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }
header .crumb a { text-decoration: none; }
header h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.08; text-wrap: balance; }
header .why { margin-top: 14px; color: #c9c9d2; font-size: 1.08rem; max-width: 620px; }

.calc { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, fieldset > legend { font-size: 0.82rem; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.field > .hint, .hint { font-size: 0.8rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
input[type=number], input[type=text], select {
  font: inherit; font-size: 1rem; color: var(--text); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 11px 12px; width: 100%; min-width: 0;
  -webkit-appearance: none; appearance: none;
}
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus-visible, select:focus-visible, .seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
fieldset { border: 0; margin-bottom: 16px; min-width: 0; }
fieldset > legend { margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--gold); color: #141006; border-color: var(--gold); }
.seg.toggle { display: inline-flex; flex-wrap: nowrap; gap: 0; padding: 3px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); }
.seg.toggle span { min-width: 64px; text-align: center; border: 0; border-radius: 9px; background: transparent; padding: 7px 14px; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.seg.toggle input:checked + span { background: var(--gold); color: #141006; }
.check { display: flex; gap: 10px; align-items: center; font-size: 0.95rem; margin-bottom: 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.inline { display: flex; gap: 8px; }
.inline > * { flex: 1; }
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }

.result { margin-top: 8px; border-radius: 18px; padding: 20px; background: rgba(245,200,66,0.08); border: 1px solid rgba(245,200,66,0.35); }
.result.warn { background: rgba(255,100,100,0.08); border-color: rgba(255,100,100,0.4); }
.result.calm { background: rgba(90,200,250,0.08); border-color: rgba(90,200,250,0.35); }
.result .big { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; }
.result p { margin-top: 8px; color: #d6d6de; }
.result table { width: 100%; border-collapse: collapse; margin-top: 12px; font-variant-numeric: tabular-nums; }
.result th, .result td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); }
.result th { color: var(--muted); font-size: 0.8rem; font-weight: 700; }

section { margin-top: 48px; }
section h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
section p, section li { color: #c9c9d2; }
section p + p { margin-top: 10px; }
section ul { padding-left: 20px; margin-top: 8px; }
section li + li { margin-top: 6px; }

.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-weight: 800; }
.faq details[open] summary::after { content: '−'; }
.faq .faq-answer { padding: 0 0 16px; color: #c9c9d2; }

.cta { margin-top: 56px; padding: 28px 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.cta h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.cta p { color: #c9c9d2; max-width: 520px; margin: 0 auto 18px; }
.cta .buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.btn.primary { background: #000; border: 1px solid rgba(255,255,255,0.25); }
.btn.secondary { border: 1px solid rgba(245,200,66,0.5); color: var(--gold); }
.note { margin-top: 20px; font-size: 0.85rem; color: var(--muted); }

.tool-list { display: grid; gap: 14px; }
.tool-list a { display: block; text-decoration: none; padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); transition: border-color 0.2s, transform 0.2s; }
.tool-list a:hover { border-color: rgba(245,200,66,0.45); transform: translateY(-2px); }
.tool-list strong { display: block; font-size: 1.15rem; }
.tool-list span { color: var(--muted); font-size: 0.95rem; }

footer { margin-top: 72px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
footer .links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

@media (max-width: 480px) {
  .calc { padding: 18px; border-radius: 18px; }
  header { padding-top: 36px; }
  .wide { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
