:root {
  --bg: #eef5fb;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-2: rgba(247, 251, 255, 0.98);
  --line: rgba(26, 56, 101, 0.12);
  --text: #173153;
  --muted: #617794;
  --lime: #2fd06f;
  --lime-2: #60e79a;
  --blue: #223f6b;
  --blue-2: #30578f;
  --danger: #d9535a;
  --ok: #2ea76a;
  --shadow: 0 20px 50px rgba(23, 49, 83, 0.10);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { color-scheme: light; 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 10% 0%, rgba(47, 208, 111, 0.16), transparent 28%),
    radial-gradient(circle at 100% 10%, rgba(34, 63, 107, 0.11), transparent 32%),
    linear-gradient(180deg, #f7fbff 0%, #eef5fb 42%, #e8f0f7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(34,63,107,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,63,107,.032) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

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

.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(255,255,255,0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-logo { width: min(380px, 52vw); 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; color: var(--blue); }
.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(180deg, var(--panel), var(--panel-2));
  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(47, 208, 111, .10);
}
.hero-kicker { color: var(--blue-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; color: var(--blue); }
.hero-card h2 span { color: var(--lime); }
.hero-card p { margin: 0; max-width: 720px; color: var(--muted); 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(34,63,107,.08); border-radius: 16px; background: rgba(245, 249, 253, .88); }
.info-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(47, 208, 111, .14); color: var(--blue); font-weight: 900; }
.info-row strong { display:block; margin-bottom: 4px; color: var(--blue); }
.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(34,63,107,.08); border-radius: 16px; background: rgba(240,246,252,.9); }
.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: white; background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 10px 26px rgba(34,63,107,.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; color: var(--blue); }
.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:#557191; font-size:.82rem; font-weight:700; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid rgba(34,63,107,.16);
  border-radius: 12px;
  outline: 0;
  background: rgba(255,255,255,.95);
  transition: .2s ease;
}
.field input:focus { border-color: rgba(47,208,111,.78); box-shadow: 0 0 0 4px rgba(47,208,111,.12); }
.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:#ffffff; background: linear-gradient(135deg, var(--lime), var(--lime-2)); text-shadow: 0 1px 1px rgba(0,0,0,.08); }
.btn-secondary { color:var(--blue); background: rgba(34,63,107,.06); border-color: rgba(34,63,107,.14); }
.btn-ghost { color:var(--muted); background:transparent; border-color:rgba(34,63,107,.10); }
.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(217,83,90,.18); border-radius:12px; color:#b64248; background:rgba(217,83,90,.06); }
.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(34,63,107,.08); border-radius:14px; background:rgba(248,251,255,.96); }
.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:var(--blue); font-size:.92rem; line-height:1.45; }
.copy-btn { flex:0 0 auto; border:0; border-radius:8px; padding:5px 8px; color:var(--blue); background:rgba(47,208,111,.16); font-size:.72rem; }

.split-box { margin-top: 18px; padding: 17px; border:1px solid rgba(34,63,107,.1); border-radius:16px; background:rgba(243,248,253,.75); }
.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(34,63,107,.08); border-radius:13px; background: white; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th, td { padding:11px 12px; border-bottom:1px solid rgba(34,63,107,.06); text-align:left; font-size:.82rem; }
th { position:sticky; top:0; z-index:1; color:#f7fbff; background:var(--blue); letter-spacing:.04em; }
td { font-family:"SFMono-Regular", Consolas, monospace; color:var(--text); }
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:#67809f; font-size:.82rem; }
.footer strong { color:var(--blue); }

.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:#ffffff; background:var(--blue); 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:72%; max-width: 380px; }
  .brand-copy { text-align:left; }
  .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; }
}
