/* Shared styles for /tools pages */

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
@media (max-width: 960px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.cin { display: grid; gap: 14px; }
.grp { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.grp h3 { margin: 0 0 4px; font-size: 15px; color: #FAFBFB; }
.grp .sub { margin: 0 0 12px; font-size: 12.5px; color: var(--text-faint); }
.fld { display: grid; grid-template-columns: 1fr 140px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.04); }
.fld:first-of-type { border-top: 0; }
.fld label { font-size: 13.5px; color: #C9D1DA; line-height: 1.35; }
.fld label small { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.inp { display: flex; align-items: center; background: #0B0E13; border: 1px solid #262B35; border-radius: 8px; overflow: hidden; }
.inp:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(47,168,255,.15); }
.inp span { padding: 0 8px; font-size: 12.5px; color: var(--text-faint); font-family: 'IBM Plex Mono', monospace; }
.inp input { width: 100%; background: transparent; border: 0; outline: 0; color: #FAFBFB; font: 600 14px 'Manrope', sans-serif; padding: 9px 8px; text-align: right; -moz-appearance: textfield; }
.inp input::-webkit-outer-spin-button, .inp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bar-top-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { font: 600 12.5px 'Manrope', sans-serif; padding: 7px 14px; border: 0; background: transparent; color: var(--text-dim); cursor: pointer; }
.seg button.on { background: rgba(0,102,178,.35); color: #fff; }
.tbtn { font: 600 12.5px 'Manrope', sans-serif; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); cursor: pointer; }
.tbtn:hover { color: #fff; border-color: rgba(47,168,255,.5); }
.cout { position: sticky; top: 16px; display: grid; gap: 12px; }
@media (max-width: 960px) { .cout { position: static; } }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border: 1px solid rgba(47,168,255,.3); border-radius: 12px; padding: 14px; }
.kpi.main { background: linear-gradient(135deg, rgba(0,102,178,.45), rgba(47,168,255,.14)); border-color: rgba(111,195,255,.6); }
.kpi .k { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-2); }
.kpi.main .k { color: #BFE3FF; }
.kpi .v { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 28px; color: #FAFBFB; line-height: 1.1; margin-top: 6px; }
.kpi .d { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.kpi .v.neg { color: #FF8A8A; } .kpi .v.pos { color: #8BE8B8; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0 0 10px; font-size: 14.5px; color: #FAFBFB; }
.split { display: flex; height: 34px; border-radius: 8px; overflow: hidden; background: #11151C; }
.split span { height: 100%; transition: width .5s cubic-bezier(.2,.7,.2,1); min-width: 0; }
.legend2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.legend2 div { display: flex; justify-content: space-between; gap: 8px; }
.legend2 i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend2 b { color: #FAFBFB; font-weight: 700; font-variant-numeric: tabular-nums; }
.rows { display: grid; gap: 0; }
.rows div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.05); font-size: 13.5px; color: #C9D1DA; }
.rows div:first-child { border-top: 0; }
.rows b { color: #FAFBFB; font-variant-numeric: tabular-nums; }
.rows div.tot { border-top: 1px solid rgba(47,168,255,.35); margin-top: 4px; padding-top: 9px; }
.rows div.tot b { font-size: 15px; }
.scen { width: 100%; border-collapse: collapse; font-size: 13px; }
.scen th, .scen td { padding: 7px 8px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.05); font-variant-numeric: tabular-nums; color: #C9D1DA; }
.scen th { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); font-weight: 500; }
.scen th:first-child, .scen td:first-child { text-align: left; }
.scen tr.be td { background: rgba(255,216,77,.08); }
.scen tr.cur td { background: rgba(47,168,255,.12); color: #FAFBFB; }
.scen td.neg { color: #FF8A8A; } .scen td.pos { color: #8BE8B8; }
.warn { font-size: 12.5px; color: #FFB08F; background: rgba(255,138,91,.08); border: 1px solid rgba(255,138,91,.35); border-radius: 10px; padding: 10px 12px; display: none; }
.formula-list { display: grid; gap: 10px; margin: 10px 0 20px; }
.formula-list div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; color: #C9D1DA; }
.formula-list code { display: block; margin-top: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: #BFE3FF; background: #0B0E13; border-radius: 6px; padding: 8px 10px; white-space: normal; }
.calc-note { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* comparison table */
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.cmp th, .cmp td { padding: 8px 10px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.05); font-variant-numeric: tabular-nums; color: #C9D1DA; }
.cmp th { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-2); font-weight: 500; vertical-align: bottom; }
.cmp th:first-child, .cmp td:first-child { text-align: left; color: var(--text-dim); }
.cmp td.best { background: rgba(47,182,122,.14); color: #FAFBFB; font-weight: 700; }
.cmp th.base, .cmp td.base { background: rgba(255,255,255,.03); }
.cmp td.neg { color: #FF8A8A; } .cmp td.pos { color: #8BE8B8; }
.cmp tr.key td { font-weight: 700; color: #FAFBFB; border-top: 1px solid rgba(47,168,255,.35); }
.hbars2 { display: grid; gap: 10px; }
.hbars2 .r { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; color: #C9D1DA; }
.hbars2 .r .b { height: 18px; border-radius: 6px; background: #11151C; overflow: hidden; position: relative; }
.hbars2 .r .b span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.hbars2 .r b { text-align: right; color: #FAFBFB; font-variant-numeric: tabular-nums; }
.fld select { width: 100%; background: #0B0E13; border: 1px solid #262B35; border-radius: 8px; color: #FAFBFB; font: 600 14px 'Manrope', sans-serif; padding: 9px 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.verdict { border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.5; border: 1px solid rgba(47,168,255,.4); background: rgba(0,102,178,.14); color: #E6EBF0; }
.verdict.good { border-color: rgba(91,214,155,.55); background: rgba(27,110,78,.18); }
.verdict.bad { border-color: rgba(255,138,91,.5); background: rgba(138,42,58,.14); }
.verdict b { color: #FAFBFB; }
.tl { position: relative; height: 54px; border-radius: 10px; background: #11151C; overflow: hidden; }
.tl span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: #fff; overflow: hidden; white-space: nowrap; border-right: 1px solid rgba(2,3,5,.6); }
.tl-axis { display: flex; justify-content: space-between; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--text-faint); margin-top: 6px; }
@media (max-width: 560px) { .hbars2 .r { grid-template-columns: 1fr 70px; } .hbars2 .r .b { grid-column: 1 / -1; order: 3; } }
.cout, .cin { min-width: 0; }
.cout, .cin { grid-template-columns: minmax(0, 1fr); }
