/* tools.css — shared styles for the AV calculators.
   Two parts:
   1. The calculator UI (inputs, segmented controls, results) — used by the
      standalone /tools/<slug> pages. These rules mirror the equivalent block
      inside tools.html's inline <style> (the hub modal); kept in sync by hand.
   2. The standalone-page layout (breadcrumb, calc card, related links) used
      only by the /tools/<slug> pages.
   Pairs with _shared.css (site shell) + tools-engine.js (calculator logic). */

/* ── Calculator UI (mirrors the hub modal) ───────────────────────────── */
.calc-units { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.unit-toggle { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; }
.unit-toggle button { height: 28px; padding: 0 14px; border-radius: 999px; font-family: 'Geist', sans-serif; font-size: 12.5px; font-weight: 500; color: var(--text-muted); transition: color 160ms var(--ease), background 160ms var(--ease); }
.unit-toggle button[aria-pressed=true] { color: var(--accent-text); background: var(--accent); }
.unit-toggle button:not([aria-pressed=true]):hover { color: var(--text); }

.calc-inputs { padding: 26px 28px 28px; overflow-y: auto; }
.calc-result { padding: 26px 28px 28px; background: var(--surface); display: flex; flex-direction: column; overflow-y: auto; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 19px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.4; }
.num-wrap { position: relative; }
.num-wrap input, .field select { width: 100%; }
.field input[type=number], .field select {
  height: 46px; padding: 0 14px; font-family: 'DM Mono', monospace; font-size: 15.5px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); transition: border-color 180ms var(--ease); -moz-appearance: textfield;
}
.field input[type=number]::-webkit-outer-spin-button, .field input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type=number]:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%238a8a8a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer; }
.num-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: 'DM Mono', monospace; font-size: 12.5px; color: var(--text-faint); pointer-events: none; }
.multi-grid { display: grid; gap: 8px; }
.multi-grid input { width: 100%; min-width: 0; }

.seg { display: grid; grid-auto-flow: column; gap: 5px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 5px; }
.seg button { height: 38px; border-radius: 6px; font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 500; color: var(--text-muted); transition: background 160ms var(--ease), color 160ms var(--ease); }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-text); }
.seg button:not([aria-pressed=true]):hover { color: var(--text); }

.result-state { margin: auto 0; color: var(--text-faint); font-size: 13.5px; text-align: center; line-height: 1.6; }
.result-state svg { width: 28px; height: 28px; margin: 0 auto 12px; color: var(--text-dim); display: block; }
.result-state.error { color: #e0a24a; }
.result-primary { font-family: 'Geist', sans-serif; font-weight: 600; font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.03em; color: var(--accent); line-height: 1; }
.result-primary .u { font-size: 17px; color: var(--text-soft); font-weight: 500; margin-left: 5px; letter-spacing: 0; }
.result-label { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-top: 10px; }
.result-rows { margin-top: 22px; border-top: 1px solid var(--line); }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-row .k { font-size: 13.5px; color: var(--text-soft); }
.result-row .v { font-family: 'DM Mono', monospace; font-size: 14px; color: var(--text); text-align: right; }
.result-row .v.in-band { color: var(--accent); }
.result-row .v.out-band { color: #e0a24a; }
.result-note { margin-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.cite { margin-top: auto; padding-top: 22px; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-faint); letter-spacing: 0.01em; line-height: 1.5; }
.cite b { color: var(--text-muted); font-weight: 500; }

/* ── Standalone /tools/<slug> page layout ────────────────────────────── */
.calc-page { padding: 116px 0 40px; }
.calc-page .container { max-width: 880px; }

.breadcrumb { font-family: 'DM Mono', monospace; font-size: 12px; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 26px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0; margin: 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-dim); }
.breadcrumb [aria-current=page] { color: var(--text-soft); }

.calc-h1 { font-family: 'Geist', sans-serif; font-weight: 600; font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.035em; line-height: 1.06; color: var(--text); margin: 0; text-wrap: balance; }
.calc-lede { font-family: 'Geist', sans-serif; font-size: clamp(15.5px, 1.3vw, 17.5px); line-height: 1.6; color: var(--text-soft); max-width: 70ch; margin: 18px 0 0; text-wrap: pretty; }

.calc-card { display: grid; grid-template-columns: 1fr 1fr; margin-top: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--bg-elev); overflow: hidden; }
.calc-card .calc-inputs { border-right: 1px solid var(--line); }

.calc-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 18px; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.back-link { font-family: 'Geist', sans-serif; font-size: 14.5px; font-weight: 500; color: var(--accent); }
.back-link:hover { color: var(--accent-bright); }
.related { font-size: 14px; color: var(--text-muted); }
.related-label { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); display: block; margin-bottom: 9px; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.related a { color: var(--text-soft); border-bottom: 1px solid transparent; transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.related a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  .calc-page { padding: 100px 0 32px; }
  .calc-card { grid-template-columns: 1fr; }
  .calc-card .calc-inputs { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ── CTA card (mirrors the hub's; shared by the standalone pages) ─────── */
.tools-cta { padding: 56px 0 100px; }
.tools-cta-card { text-align: center; border: 1px solid rgba(0,206,209,0.30); border-radius: var(--radius-xl); background: linear-gradient(155deg, var(--accent-bg), var(--surface) 55%); padding: 48px 40px; position: relative; overflow: hidden; }
.tools-cta-card::before { content: ''; position: absolute; left: -8%; bottom: -50%; width: 480px; height: 480px; background: radial-gradient(ellipse at center, var(--accent-glow), transparent 70%); opacity: 0.55; pointer-events: none; }
.tools-cta-card > * { position: relative; z-index: 1; }
.tools-cta-card h2 { font-family: 'Geist', sans-serif; font-weight: 500; font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.03em; line-height: 1.1; color: var(--text); max-width: 22ch; margin: 0 auto; }
.tools-cta-card h2 em { font-style: normal; color: var(--accent); }
.tools-cta-card p { margin: 16px auto 0; max-width: 54ch; color: var(--text-soft); font-size: 16px; }
.btn-primary-cta { display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 26px; border-radius: 999px; font-weight: 500; font-size: 15px; background: var(--accent); color: var(--accent-text); margin-top: 26px; transition: transform 130ms var(--ease), background 200ms var(--ease); }
.btn-primary-cta:hover { background: var(--accent-bright); }
.btn-primary-cta:active { transform: scale(0.98); }
