:root {
  --bg: #050708;
  --panel: rgba(13, 20, 24, 0.93);
  --panel-2: rgba(17, 28, 34, 0.9);
  --line: rgba(107, 150, 170, 0.22);
  --text: #eff7fa;
  --muted: #8ba0aa;
  --lime: #a9c93f;
  --lime-2: #c3df58;
  --blue: #294f66;
  --blue-2: #3a728f;
  --danger: #ff7878;
  --ok: #8dd36d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(169, 201, 63, 0.14), transparent 30%),
    radial-gradient(circle at 100% 24%, rgba(41, 79, 102, 0.35), transparent 34%),
    linear-gradient(145deg, #020304 0%, #071015 50%, #040607 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 42px;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(3, 8, 10, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-logo { width: min(360px, 48vw); height: auto; display: block; }
.brand-copy { text-align: right; }
.brand-copy h1 { margin: 0; font-size: clamp(1.1rem, 2.5vw, 1.65rem); letter-spacing: -0.03em; }
.brand-copy p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-card, .info-card, .calculator-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--panel), rgba(8, 13, 16, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card { padding: clamp(26px, 5vw, 52px); overflow: hidden; position: relative; }
.hero-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -120px;
  bottom: -130px;
  border-radius: 50%;
  border: 48px solid rgba(169, 201, 63, .08);
}
.hero-kicker { color: var(--lime-2); font-weight: 800; letter-spacing: .14em; font-size: .76rem; text-transform: uppercase; }
.hero-card h2 { margin: 14px 0 14px; font-size: clamp(2rem, 4.5vw, 4.2rem); line-height: .98; letter-spacing: -.055em; max-width: 780px; }
.hero-card h2 span { color: var(--lime); }
.hero-card p { margin: 0; max-width: 720px; color: #aabac1; line-height: 1.72; font-size: 1rem; }

.info-card { padding: 28px; display: grid; align-content: center; gap: 14px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid rgba(255,255,255,.06); border-radius: 16px; background: rgba(255,255,255,.025); }
.info-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(169, 201, 63, .12); color: var(--lime-2); font-weight: 900; }
.info-row strong { display:block; margin-bottom: 4px; }
.info-row span { color: var(--muted); line-height: 1.45; font-size: .9rem; }

.calculator-card { padding: 18px; }
.tabs { display: flex; gap: 10px; padding: 6px; border: 1px solid rgba(255,255,255,.06); border-radius: 16px; background: rgba(0,0,0,.18); }
.tab-button {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  transition: .2s ease;
}
.tab-button.active { color: #0b1113; background: linear-gradient(135deg, var(--lime-2), var(--lime)); box-shadow: 0 10px 26px rgba(169,201,63,.18); }
.tab-panel { display: none; padding: 22px 6px 6px; }
.tab-panel.active { display: block; }

.section-title { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin: 0 0 14px; }
.section-title h3 { margin:0; font-size:1.16rem; }
.section-title p { margin:0; color:var(--muted); font-size:.86rem; }

.input-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 12px; align-items: end; }
.field label { display:block; margin:0 0 8px; color:#afc0c7; font-size:.82rem; font-weight:700; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid rgba(136, 179, 198, .22);
  border-radius: 12px;
  outline: 0;
  background: rgba(2, 6, 8, .76);
  transition: .2s ease;
}
.field input:focus { border-color: rgba(169,201,63,.78); box-shadow: 0 0 0 4px rgba(169,201,63,.10); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 850;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color:#0a1012; background: linear-gradient(135deg, var(--lime-2), var(--lime)); }
.btn-secondary { color:var(--text); background: rgba(41,79,102,.23); border-color: rgba(74,132,160,.3); }
.btn-ghost { color:var(--muted); background:transparent; border-color:rgba(255,255,255,.09); }
.btn-small { min-height:34px; padding:0 11px; font-size:.78rem; border-radius:9px; }

.error { display:none; margin-top:12px; padding:12px 14px; border:1px solid rgba(255,120,120,.28); border-radius:12px; color:#ffb0b0; background:rgba(255,75,75,.08); }
.error.show { display:block; }

.results { margin-top: 18px; }
.result-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px; }
.result-item { min-width:0; padding:15px; border:1px solid rgba(255,255,255,.065); border-radius:14px; background:rgba(255,255,255,.025); }
.result-label { color:var(--muted); font-size:.75rem; font-weight:750; text-transform:uppercase; letter-spacing:.07em; }
.result-value-row { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-top:8px; }
.result-value { min-width:0; overflow-wrap:anywhere; font-family:"SFMono-Regular", Consolas, "Liberation Mono", monospace; color:#f4fbfd; font-size:.92rem; line-height:1.45; }
.copy-btn { flex:0 0 auto; border:0; border-radius:8px; padding:5px 8px; color:var(--lime-2); background:rgba(169,201,63,.1); font-size:.72rem; }

.split-box { margin-top: 18px; padding: 17px; border:1px solid rgba(74,132,160,.22); border-radius:16px; background:rgba(27,56,71,.11); }
.split-controls { display:grid; grid-template-columns: 170px auto 1fr; gap:12px; align-items:end; }
.split-summary { color:var(--muted); font-size:.86rem; align-self:center; }
.table-wrap { margin-top:14px; overflow:auto; border:1px solid rgba(255,255,255,.065); border-radius:13px; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th, td { padding:11px 12px; border-bottom:1px solid rgba(255,255,255,.055); text-align:left; font-size:.82rem; }
th { position:sticky; top:0; z-index:1; color:#b6c7ce; background:#101a1f; letter-spacing:.04em; }
td { font-family:"SFMono-Regular", Consolas, monospace; color:#dfecef; }
tr:last-child td { border-bottom:0; }
.empty-state { padding: 22px; color:var(--muted); text-align:center; }

.footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 4px 0; color:#738993; font-size:.82rem; }
.footer strong { color:#9eb2bb; }

.toast { position:fixed; left:50%; bottom:24px; z-index:50; transform:translate(-50%, 30px); opacity:0; pointer-events:none; padding:11px 16px; border-radius:12px; color:#0b1113; background:var(--lime-2); font-weight:800; box-shadow:var(--shadow); transition:.24s ease; }
.toast.show { transform:translate(-50%,0); opacity:1; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .input-grid { grid-template-columns: 1fr 130px; }
  .actions { grid-column: 1 / -1; }
  .split-controls { grid-template-columns: 150px auto; }
  .split-summary { grid-column:1/-1; }
}

@media (max-width: 620px) {
  .shell { width:min(100% - 18px, 1240px); padding-top:9px; }
  .brandbar { align-items:flex-start; padding:15px; }
  .brand-logo { width:56%; }
  .brand-copy p { display:none; }
  .hero-card, .info-card { padding:22px; }
  .calculator-card { padding:11px; }
  .tab-panel { padding:18px 2px 4px; }
  .input-grid, .split-controls { grid-template-columns:1fr; }
  .actions { grid-column:auto; }
  .result-grid { grid-template-columns:1fr; }
  .section-title { align-items:flex-start; flex-direction:column; gap:5px; }
  .footer { flex-direction:column; align-items:flex-start; }
}
