:root {
  --bg: #08080F; --card: #12121E; --cardB: #1E1E32; --dark: #0E0E1A;
  --text: #E8E8F0; --dim: #8888A8; --faint: #6666AA; --vfaint: #44446A;
  --green: #00E88F; --red: #FF3B6B; --orange: #FF8C42; --blue: #4C9BFF;
  --purple: #B07CFF; --yellow: #FFD166;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--purple); color: #fff; }
body { background: var(--bg); color: var(--text); font-family: 'Outfit', sans-serif; min-height: 100vh; }
.mono { font-family: 'Fira Code', monospace; }
a { text-decoration: none; color: inherit; }

/* Layout */
.wrap { max-width: 700px; margin: 0 auto; padding: 0 18px 70px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .4s ease; }

/* Header */
.header { padding: 28px 0 20px; text-align: center; animation: fadeIn .5s ease; }
.logo-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; text-decoration: none; color: inherit; }
.logo-icon { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--green), var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 900; color: var(--bg); }
.logo-text { font-size: 24px; font-weight: 900; letter-spacing: -0.5px; }
.logo-text span { color: var(--green); }
.header p { font-size: 13px; color: var(--faint); }

/* Nav */
.nav-scroll { display: flex; gap: 3px; background: var(--dark); border-radius: 14px; padding: 4px; margin-bottom: 24px; animation: fadeIn .5s ease .1s both; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.nav-scroll::-webkit-scrollbar { height: 0; display: none; }
.nav-scroll { -ms-overflow-style: none; scrollbar-width: none; }
.nav-btn { flex-shrink: 0; padding: 10px 12px; border: none; border-radius: 10px; cursor: pointer; white-space: nowrap; background: transparent; color: var(--faint); font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 700; transition: all .2s ease; display: flex; align-items: center; gap: 5px; text-decoration: none; }
.nav-btn:hover { filter: brightness(1.15); }
.nav-btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* Page title */
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 3px; }
.page-desc { font-size: 13px; color: var(--faint); margin-bottom: 20px; }

/* Form */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.full { grid-column: 1 / -1; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--dim); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 5px; }
.input-wrap { display: flex; align-items: center; background: var(--card); border: 1px solid var(--cardB); border-radius: 10px; overflow: hidden; }
.input-pre, .input-suf { padding: 0 12px; color: var(--faint); font-family: 'Fira Code', monospace; font-weight: 700; }
.input-pre { font-size: 15px; padding-right: 0; }
.input-suf { font-size: 13px; padding-left: 0; }
.field input, .field select { flex: 1; background: transparent; border: none; padding: 12px; color: var(--text); font-size: 17px; font-weight: 600; outline: none; font-family: 'Fira Code', monospace; width: 100%; }
.field select { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 500; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236666AA' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; width: 100%; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
input[type="number"]::-webkit-inner-spin-button { opacity: .3; }
input[type="number"] { -moz-appearance: textfield; }

/* Divider */
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--cardB), transparent); margin: 24px 0; }

/* Warning */
.warn { background: rgba(255, 209, 102, 0.067); border: 1px solid rgba(255, 209, 102, 0.2); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; display: flex; align-items: start; gap: 8px; }
.warn span { font-size: 11px; color: var(--yellow); line-height: 1.5; }

/* Result cards */
.results { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.res { background: var(--card); border-radius: 12px; padding: 14px 16px; flex: 1; min-width: 130px; }
.res.big { padding: 20px 16px; min-width: 100%; }
.res-label { font-size: 11px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.res-value { font-family: 'Fira Code', monospace; font-weight: 700; line-height: 1.2; }
.res.big .res-value { font-size: 32px; }
.res:not(.big) .res-value { font-size: 22px; }
.res-sub { font-size: 12px; color: var(--faint); margin-top: 3px; }

/* Breakdown box */
.breakdown { background: var(--dark); border-radius: 12px; padding: 16px; border: 1px solid #1A1A2E; }
.breakdown-title { font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.bar-label { width: 90px; font-size: 11px; color: var(--dim); font-weight: 500; text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 20px; background: #1A1A2E; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.bar-amt { font-family: 'Fira Code', monospace; width: 85px; font-size: 12px; font-weight: 600; text-align: right; flex-shrink: 0; }

/* Comparison bars */
.compare-row { margin-bottom: 10px; }
.compare-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.compare-header span:first-child { font-size: 12px; color: var(--dim); }
.compare-header span:last-child { font-family: 'Fira Code', monospace; font-size: 12px; }
.compare-bar { height: 16px; background: #1A1A2E; border-radius: 5px; overflow: hidden; }
.compare-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }

/* Insight callout */
.insight { border-radius: 10px; padding: 14px; margin-top: 12px; font-size: 13px; line-height: 1.6; }

/* Advanced toggle */
.adv-btn { background: none; border: 1px solid var(--cardB); border-radius: 8px; padding: 8px 14px; color: var(--faint); font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Outfit', sans-serif; display: flex; align-items: center; gap: 6px; width: 100%; justify-content: center; margin: 6px 0 14px; }
.adv-content { margin-top: 12px; padding: 14px; background: var(--dark); border-radius: 10px; border: 1px solid var(--cardB); }
.adv-note { font-size: 11px; color: var(--faint); margin-top: 8px; line-height: 1.5; }

/* Split columns */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.split-card { background: var(--dark); border-radius: 12px; padding: 16px; border: 1px solid #1A1A2E; }
.split-label { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.split-value { font-family: 'Fira Code', monospace; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.split-detail { font-size: 11px; color: var(--faint); line-height: 1.5; }

/* Two-column compare */
.vs { display: flex; justify-content: space-between; margin-bottom: 12px; }
.vs-col { text-align: center; flex: 1; }
.vs-col-label { font-size: 11px; color: var(--dim); margin-bottom: 4px; }
.vs-col-value { font-family: 'Fira Code', monospace; font-size: 22px; font-weight: 700; }
.vs-divider { width: 1px; background: var(--cardB); }

/* Before/after rows */
.ba-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ba-row span:first-child { font-size: 12px; color: var(--dim); }
.ba-row span:last-child { font-family: 'Fira Code', monospace; font-size: 13px; }

/* Progress bar */
.progress-bar { height: 24px; background: #1A1A2E; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 6px; transition: width .5s ease; }
.progress-text { font-family: 'Fira Code', monospace; font-size: 11px; color: var(--faint); margin-top: 6px; }

/* Footer */
footer { margin-top: 40px; text-align: center; padding: 20px 0; border-top: 1px solid #1A1A2E; }
footer p { line-height: 1.6; }
.footer-story { font-size: 12px; color: var(--vfaint); }
.footer-legal { font-size: 11px; color: #33335A; margin-top: 8px; }
.footer-legal button { background: none; border: none; color: var(--purple); text-decoration: underline; cursor: pointer; font-size: 11px; font-family: 'Outfit', sans-serif; padding: 0; }
.footer-copy { font-size: 10px; color: #2A2A44; margin-top: 6px; }

/* Disclaimer modal */
.modal-overlay { position: fixed; inset: 0; background: #08080FEE; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card); border: 1px solid #2A2A3E; border-radius: 18px; padding: 24px; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.modal p { font-size: 13px; color: var(--dim); line-height: 1.8; margin-bottom: 10px; }
.modal p strong { color: var(--text); }
.modal-close { margin-top: 16px; width: 100%; padding: 11px 0; background: var(--purple); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: 'Outfit', sans-serif; }

/* Home grid */
.home-hero { text-align: center; margin-bottom: 32px; }
.home-hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; line-height: 1.3; }
.home-hero p { font-size: 14px; color: var(--faint); max-width: 420px; margin: 0 auto; line-height: 1.6; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.home-card { background: var(--card); border: 1px solid var(--cardB); border-radius: 14px; padding: 20px 16px; cursor: pointer; text-align: left; font-family: 'Outfit', sans-serif; transition: all .2s ease; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.home-card:hover { border-color: var(--faint); transform: translateY(-2px); }
.home-card .icon { font-size: 28px; }
.home-card .name { font-size: 15px; font-weight: 700; }
.home-card .desc { font-size: 12px; color: var(--dim); line-height: 1.5; }

/* Responsive */
@media (max-width: 500px) {
  .grid { grid-template-columns: 1fr; }
  .grid .full { grid-column: 1; }
  .split { grid-template-columns: 1fr; }
  .res.big .res-value { font-size: 26px; }
  .home-grid { grid-template-columns: 1fr; }
}
/* Active nav button */
.nav-btn.active-green { background: rgba(0, 232, 143, 0.09); color: var(--green); }
.nav-btn.active-blue { background: rgba(76, 155, 255, 0.09); color: var(--blue); }
.nav-btn.active-orange { background: rgba(255, 140, 66, 0.09); color: var(--orange); }
.nav-btn.active-yellow { background: rgba(255, 209, 102, 0.09); color: var(--yellow); }
.nav-btn.active-red { background: rgba(255, 59, 107, 0.09); color: var(--red); }
.nav-btn.active-purple { background: rgba(176, 124, 255, 0.09); color: var(--purple); }
