:root {
  --bg: #090e1a;
  --panel: #111a2b;
  --panel-2: #0d1524;
  --border: #253148;
  --text: #f3f6ff;
  --muted: #8e9bb3;
  --green: #30e0a1;
  --red: #ff6b81;
  --accent: #7c8cff;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(ellipse at 50% -20%, #1b2b4c 0%, var(--bg) 55%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.topbar {
  height: 76px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100% - 1160px) / 2)); border-bottom: 1px solid #ffffff0d;
  background: #090e1acc;
}
.brand { color: var(--text); text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #f7931a; color: #101522; font-size: 23px; }
.top-tag { font-size: 10px; letter-spacing: 1.5px; font-weight: 800; color: #9eacc4; display: flex; align-items: center; gap: 8px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px #30e0a177; }
.container { max-width: 1160px; padding: 0 24px; margin: auto; }
.hero { text-align: center; padding: 60px 0 38px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: 2px; margin: 0 0 11px; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 49px); letter-spacing: -1.8px; line-height: 1.12; }
h1 span { color: var(--green); }
.subtitle { color: var(--muted); margin: 15px 0 0; font-size: 15px; line-height: 1.6; }
.calculator { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.inputs-card, .results-card { border: 1px solid var(--border); border-radius: 20px; padding: 28px; background: linear-gradient(155deg, #141e31 0%, #0f1727 100%); box-shadow: 0 20px 60px #0000001c; }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 27px; }
.card-heading .eyebrow { margin-bottom: 7px; }
h2 { font-size: 20px; margin: 0; letter-spacing: -.4px; }
.step { font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; }
label { display: block; font-size: 12px; color: #b6c1d5; font-weight: 650; margin-bottom: 9px; }
select, input { width: 100%; border: 1px solid #2a3851; border-radius: 10px; color: var(--text); background: #0b1322; height: 46px; padding: 0 13px; font: inherit; font-size: 14px; outline: none; }
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #7c8cff20; }
#coin { margin-bottom: 19px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 14px; }
.input-wrap { display: flex; align-items: center; border: 1px solid #2a3851; border-radius: 10px; background: #0b1322; padding: 0 12px; gap: 7px; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #7c8cff20; }
.input-wrap span { color: #7f8ca5; font-size: 14px; }
.input-wrap input { border: 0; box-shadow: none; background: transparent; padding: 0; min-width: 0; }
.input-wrap input:focus { box-shadow: none; }
.calculate-btn { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; height: 49px; margin-top: 24px; border: 0; border-radius: 11px; background: var(--green); color: #071a17; font-weight: 850; font-size: 14px; cursor: pointer; transition: transform .15s, filter .15s; }
.calculate-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.calculate-btn span { font-size: 18px; }
.helper { color: #77859d; font-size: 10px; line-height: 1.5; text-align: center; margin: 12px 0 0; }
.error { color: var(--red); font-size: 12px; min-height: 0; margin: 12px 0 0; }
.error:empty { display: none; }
.result-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: var(--green); background: #30e0a115; font-size: 19px; }
.profit-panel { border: 1px solid #30e0a12a; border-radius: 15px; padding: 22px; background: radial-gradient(ellipse at top right, #30e0a117, transparent 65%), #0b1723; }
.profit-panel.loss { border-color: #ff6b812d; background: radial-gradient(ellipse at top right, #ff6b8116, transparent 65%), #19131f; }
.profit-panel p { margin: 0 0 9px; color: #9eacc1; font-size: 12px; }
.profit-value { font-size: clamp(30px, 4vw, 39px); font-weight: 850; letter-spacing: -1.2px; overflow-wrap: anywhere; color: var(--green); }
.profit-panel.loss .profit-value { color: var(--red); }
.roi-pill { display: inline-block; border-radius: 7px; padding: 6px 9px; margin-top: 11px; font-size: 11px; font-weight: 800; background: #30e0a117; color: var(--green); }
.profit-panel.loss .roi-pill { background: #ff6b8117; color: var(--red); }
.metrics { margin-top: 18px; }
.metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #ffffff0d; }
.metric:last-child { border-bottom: 0; }
.metric span { color: #94a1b8; font-size: 12px; }
.metric strong { text-align: right; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.formula-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; padding: 12px; border-radius: 10px; background: #ffffff05; }
.info-dot { flex: 0 0 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #62718a; color: #9aa8be; font-size: 10px; font-weight: 800; }
.formula-note p { margin: 0; color: #8492aa; font-size: 10px; line-height: 1.65; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 27px 0 35px; margin-top: 20px; border-top: 1px solid #ffffff0d; color: #738199; font-size: 10px; line-height: 1.5; }
footer p { margin: 0; }
@media (max-width: 820px) {
  .calculator { grid-template-columns: 1fr; max-width: 600px; margin: auto; }
  .hero { padding-top: 45px; }
}
@media (max-width: 480px) {
  .topbar { height: 64px; padding: 0 18px; }
  .top-tag { font-size: 8px; letter-spacing: .8px; }
  .container { padding: 0 14px; }
  .hero { padding: 39px 0 27px; }
  .subtitle { font-size: 13px; }
  .inputs-card, .results-card { padding: 20px 17px; border-radius: 16px; }
  .field-grid { gap: 15px 10px; }
  label { font-size: 11px; }
  select, input { font-size: 13px; padding-left: 10px; padding-right: 10px; }
  .input-wrap { padding: 0 9px; gap: 5px; }
  footer { flex-direction: column; }
}
