/* Shared styles for the free calculators (/tools). Matches the main site's dark theme. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0e1a; color: #e6edf3; line-height: 1.55;
}
a { color: #58a6ff; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

nav.top { border-bottom: 1px solid #21262d; background: rgba(10, 14, 26, 0.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
nav.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 18px; color: #e6edf3; text-decoration: none; letter-spacing: -0.2px; }
.brand span { color: #58a6ff; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav-links a { color: #b1bac4; text-decoration: none; }
.nav-links a:hover { color: #e6edf3; }
.nav-links a.cta { background: #238636; color: #fff; padding: 8px 16px; border-radius: 8px; font-weight: 600; }
.nav-links a.cta:hover { background: #2ea043; }

header.page { padding: 48px 0 28px; }
.crumbs { font-size: 13px; color: #7d8590; margin-bottom: 14px; }
.crumbs a { color: #7d8590; text-decoration: none; }
.crumbs a:hover { color: #b1bac4; }
h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.6px; margin-bottom: 14px; }
.lede { font-size: 17px; color: #b1bac4; max-width: 760px; }

.calc { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.card { background: #0d1117; border: 1px solid #21262d; border-radius: 12px; padding: 22px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.7px; color: #7d8590; margin-bottom: 16px; font-weight: 600; }
.card + .card { margin-top: 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #b1bac4; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: #7d8590; margin-top: 5px; }
.calc > * { min-width: 0; }   /* wide result tables scroll inside their box, not the page */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=number], input[type=text] {
  width: 100%; background: #161b22; border: 1px solid #30363d; color: #e6edf3;
  padding: 10px 12px; border-radius: 8px; font-size: 15px; font-family: inherit;
}
input:focus { outline: none; border-color: #58a6ff; box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #b1bac4; cursor: pointer; }
label.check input { width: auto; }
button.run {
  width: 100%; background: #1f6feb; color: #fff; border: 0; padding: 12px 16px; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 6px;
}
button.run:hover { background: #388bfd; }
button.run:disabled { opacity: 0.6; cursor: wait; }
.err { display: none; margin-top: 12px; padding: 10px 12px; border: 1px solid #f85149; border-radius: 8px; color: #ffa198; font-size: 13px; background: rgba(248, 81, 73, 0.08); }

.hero-result { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; }
.big { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.big-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.7px; color: #7d8590; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: #161b22; border: 1px solid #21262d; border-radius: 10px; padding: 12px 14px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #7d8590; }
.stat .v { font-size: 18px; font-weight: 600; margin-top: 4px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #21262d; white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t thead th { color: #7d8590; font-weight: 600; font-size: 12px; }
table.t tr.total td { font-weight: 700; border-top: 1px solid #30363d; }
table.t td.base { outline: 2px solid #58a6ff; outline-offset: -2px; border-radius: 4px; font-weight: 700; }
.scroll { overflow-x: auto; }

.trace { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; color: #b1bac4; }
.trace div { padding: 6px 0; border-bottom: 1px dashed #21262d; word-break: break-word; }
.trace div:last-child { border-bottom: 0; }
.trace strong { color: #e6edf3; font-weight: 600; }

.flag { border-left: 3px solid #58a6ff; background: #161b22; border-radius: 0 8px 8px 0; padding: 12px 14px; margin-bottom: 10px; }
.flag.warning { border-left-color: #d29922; }
.flag.critical { border-left-color: #f85149; }
.flag .t { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.flag .m { font-size: 13px; color: #b1bac4; }
.ok { color: #3fb950; font-size: 14px; }
.neg { color: #f85149; } .pos { color: #3fb950; }
.muted { color: #7d8590; font-size: 13px; }

section.prose { border-top: 1px solid #21262d; padding: 44px 0; }
section.prose h2 { font-size: 24px; letter-spacing: -0.3px; margin-bottom: 14px; }
section.prose h3 { font-size: 16px; margin: 22px 0 6px; }
section.prose p, section.prose li { color: #b1bac4; font-size: 15.5px; max-width: 800px; }
section.prose p + p { margin-top: 12px; }
section.prose ul, section.prose ol { margin: 10px 0 0 22px; }
section.prose li { margin-bottom: 6px; }
.formula { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 13.5px; background: #0d1117; border: 1px solid #21262d; border-radius: 8px; padding: 12px 14px; margin: 12px 0; color: #e6edf3; max-width: 800px; overflow-x: auto; white-space: nowrap; }

.band { border: 1px solid #1f6feb; background: linear-gradient(135deg, rgba(31, 111, 235, 0.14), rgba(31, 111, 235, 0.03)); border-radius: 14px; padding: 28px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; margin: 8px 0 48px; }
.band h2 { font-size: 20px; margin-bottom: 6px; }
.band p { color: #b1bac4; font-size: 14.5px; max-width: 620px; }
.band a { background: #238636; color: #fff; text-decoration: none; padding: 12px 20px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.band a:hover { background: #2ea043; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 48px; }
a.tile { display: block; text-decoration: none; color: inherit; background: #0d1117; border: 1px solid #21262d; border-radius: 12px; padding: 24px; transition: border-color 0.15s, transform 0.15s; }
a.tile:hover { border-color: #58a6ff; transform: translateY(-2px); }
a.tile .ico { font-size: 28px; }
a.tile h2 { font-size: 19px; margin: 12px 0 8px; }
a.tile p { color: #b1bac4; font-size: 14.5px; }
a.tile .go { color: #58a6ff; font-size: 14px; margin-top: 14px; display: inline-block; }

footer.site { border-top: 1px solid #21262d; padding: 32px 0 44px; text-align: center; color: #484f58; font-size: 13px; }
footer.site a { color: #484f58; text-decoration: none; margin: 0 12px; }
footer.site a:hover { color: #7d8590; }
footer.site div + div { margin-top: 8px; }

@media (max-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .grid3 { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .big { font-size: 36px; }
  .nav-links a.hide-sm { display: none; }
}
