:root{
  --bg:#020611;
  --panel:rgba(4,14,28,.78);
  --panel2:rgba(7,25,42,.78);
  --line:rgba(93,224,255,.26);
  --line2:rgba(89,255,194,.28);
  --text:#eaffff;
  --muted:#a8bfca;
  --cyan:#5de0ff;
  --green:#59ffc2;
  --gold:#ffd166;
  --danger:#ff8b8b;
}

*{box-sizing:border-box}

[hidden]{
  display:none !important;
}

body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font-family:Inter,Arial,sans-serif;
  background:
    radial-gradient(circle at 12% 12%,rgba(93,224,255,.20),transparent 30%),
    radial-gradient(circle at 82% 8%,rgba(89,255,194,.14),transparent 28%),
    linear-gradient(135deg,#01030a,#03111f 50%,#01040b);
}

body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.026) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.026) 1px,transparent 1px);
  background-size:44px 44px;
}

.page{
  position:relative;
  width:min(1240px,96vw);
  margin:auto;
  padding:16px 0 28px;
}

.access-gate{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  position:relative;
}

.gate-card{
  width:min(560px,94vw);
  border:1px solid var(--line);
  border-radius:26px;
  padding:34px;
  background:linear-gradient(145deg,rgba(7,25,42,.90),rgba(2,8,18,.86));
  box-shadow:0 0 70px rgba(93,224,255,.12);
}

.gate-card h1{
  font-size:clamp(30px,5vw,52px);
}

.gate-card p{
  color:var(--muted);
  line-height:1.6;
}

.gate-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:24px;
}

.access-badge{
  border:1px solid var(--line2);
  border-radius:999px;
  background:rgba(5,22,30,.65);
  padding:8px 12px;
  color:var(--green);
  font-size:13px;
  font-weight:900;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-bottom:14px;
}

.brand{
  color:var(--text);
  text-decoration:none;
  font-weight:900;
  letter-spacing:.24em;
  text-transform:uppercase;
  text-shadow:0 0 18px rgba(93,224,255,.45);
}

.top-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.mini-link{
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(3,10,20,.65);
  padding:8px 12px;
  color:var(--text);
  text-decoration:none;
  font-size:13px;
}

.top-actions .statwhy-account-shell{
  margin-left:2px;
}

.top-actions .sw-account-pill{
  min-height:38px;
  max-width:min(360px,42vw);
}

.top-actions .sw-power-logout{
  width:38px;
  height:38px;
  min-width:38px;
  flex-basis:38px;
  font-size:18px;
}

.tool-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  border:1px solid rgba(93,224,255,.16);
  border-radius:18px;
  padding:18px 20px;
  background:linear-gradient(135deg,rgba(4,14,28,.64),rgba(2,8,18,.40));
  box-shadow:0 0 38px rgba(93,224,255,.07);
  margin-bottom:14px;
}

.terminal-label{
  color:var(--green);
  letter-spacing:.22em;
  font-size:11px;
  font-weight:900;
  margin-bottom:8px;
}

h1{
  margin:0;
  font-size:clamp(26px,3.2vw,38px);
  line-height:1.08;
  text-shadow:0 0 34px rgba(93,224,255,.38);
}

.tool-hero p{
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
  max-width:760px;
  margin:8px 0 0;
}

.hero-metrics{
  min-width:138px;
  border:1px solid var(--line2);
  border-radius:14px;
  padding:12px;
  background:rgba(5,22,30,.68);
}

.hero-metrics span{display:block;color:var(--green);font-size:12px;font-weight:900}
.hero-metrics strong{display:block;margin-top:4px;font-size:14px}

.calculator-shell{
  display:grid;
  grid-template-columns:minmax(300px,360px) minmax(0,1fr);
  gap:14px;
}

.control-panel,.result-panel{
  border:1px solid var(--line);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(7,25,42,.84),rgba(2,8,18,.76));
  padding:16px;
}

label{
  display:block;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  margin-bottom:10px;
}

input,select{
  width:100%;
  margin-top:6px;
  color:var(--text);
  background:rgba(1,7,16,.72);
  border:1px solid rgba(93,224,255,.30);
  border-radius:10px;
  padding:10px;
  font:inherit;
}

select option{background:#071827}

.param-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.check-row{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(93,224,255,.20);
  border-radius:10px;
  padding:10px;
  margin-top:6px;
}

.check-row input{width:auto;margin:0}
.check-row span{color:var(--text)}

.dynamic-fields{
  border-top:1px solid rgba(93,224,255,.16);
  margin-top:4px;
  padding-top:12px;
}

.primary-action,.ghost-action{
  border:1px solid rgba(93,224,255,.38);
  border-radius:999px;
  color:var(--cyan);
  background:rgba(93,224,255,.10);
  padding:10px 14px;
  font-weight:950;
  cursor:pointer;
}

.primary-action{
  width:100%;
  color:#00131a;
  background:linear-gradient(135deg,var(--cyan),var(--green));
  margin-top:8px;
}

.ghost-action{color:var(--cyan);background:rgba(93,224,255,.08)}

.result-top{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:12px;
}

.result-top h2{margin:0;font-size:24px}

.result-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}

.metric{
  border:1px solid rgba(89,255,194,.22);
  border-radius:14px;
  padding:12px;
  background:rgba(5,22,30,.58);
}

.metric span{display:block;color:var(--muted);font-size:12px;font-weight:800}
.metric strong{display:block;margin-top:4px;color:var(--green);font-size:24px}

.methods-box,.assumption-box{
  border:1px solid rgba(93,224,255,.18);
  border-radius:14px;
  padding:12px;
  background:rgba(1,7,16,.46);
  margin-top:10px;
}

.methods-box h3,.assumption-box h3{margin:0 0 10px;color:var(--cyan)}

pre{
  white-space:pre-wrap;
  word-break:break-word;
  margin:0;
  color:#d8f6ff;
  line-height:1.5;
  font-family:Inter,Arial,sans-serif;
}

ul{margin:0;padding-left:20px;color:#d8f6ff;line-height:1.5}
.error{color:var(--danger);font-weight:900}

@media(max-width:860px){
  .tool-hero,.result-top{flex-direction:column;align-items:stretch}
  .calculator-shell{grid-template-columns:1fr}
  .result-cards{grid-template-columns:1fr}
  .param-grid{grid-template-columns:1fr}
}
