:root {
  --jr-primary: #11aef4;
  --jr-primary-dark: #0785d8;
  --jr-primary-soft: rgba(17, 174, 244, 0.13);
  --jr-ink: #f8fbff;
  --jr-muted: #c7d4e2;
  --jr-line: rgba(18, 174, 244, 0.35);
  --jr-card-bg: rgba(3, 15, 36, 0.78);
  --jr-bg: #020b1d;
  --jr-ok: #52e7a4;
  --jr-ok-bg: rgba(82, 231, 164, 0.12);
  --jr-warn: #ffd166;
  --jr-warn-bg: rgba(255, 209, 102, 0.14);
  --jr-err: #ff8f9b;
  --jr-err-bg: rgba(255, 143, 155, 0.12);
  --jr-shadow: 0 24px 58px rgba(0, 0, 0, 0.32);
  --jr-deep: #020a1b;
  --jr-panel: rgba(4, 18, 43, 0.88);
  --jr-panel-soft: rgba(7, 29, 62, 0.78);
  --jr-cyan: #12b8f6;
  --jr-cyan-bright: #35d4ff;
  --jr-white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  color: var(--jr-ink);
  line-height: 1.5;
  background: #000b25;
}

.calc-page {
  max-width: 1125px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Two-column layout: sticky results on left, inputs on right */
.calc-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.calc-results {
  flex: 0 0 380px;
  position: sticky;
  top: 16px;
}
.calc-inputs {
  flex: 1;
  min-width: 0;
}

/* ===== Header ===== */
.calc-header {
  text-align: center;
  margin-bottom: 24px;
}
.calc-logo {
  height: 44px;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(18, 184, 246, 0.36));
}
.calc-header h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.2;
  color: var(--jr-ink);
}
.calc-subtitle {
  margin: 0 auto;
  max-width: 560px;
  font-size: 15px;
  color: var(--jr-muted);
  line-height: 1.55;
}

/* ===== Results panel ===== */
.calc-results {
  background: linear-gradient(180deg, rgba(5, 21, 49, 0.94) 0%, rgba(3, 13, 33, 0.94) 100%);
  border: 1px solid var(--jr-line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--jr-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.result-header {
  margin-bottom: 20px;
}
.result-label {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--jr-ink);
}
.result-label.green { color: var(--jr-ok); text-shadow: 0 0 16px rgba(82, 231, 164, 0.32); }
.result-label.yellow { color: var(--jr-warn); text-shadow: 0 0 16px rgba(255, 209, 102, 0.28); }
.result-label.red { color: var(--jr-err); text-shadow: 0 0 16px rgba(255, 143, 155, 0.28); }
.result-copy {
  font-size: 14px;
  color: var(--jr-muted);
  line-height: 1.5;
}

/* ===== Recommendation row ===== */
.recommendation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--jr-line);
  border-radius: 8px;
  background: var(--jr-primary-soft);
}
.rec-label {
  font-size: 14px;
  color: var(--jr-muted);
  font-weight: 700;
}
.rec-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--jr-cyan-bright);
  text-shadow: 0 0 12px rgba(53, 212, 255, 0.22);
  text-align: right;
}

/* ===== Capacity bars ===== */
.capacity-bar-wrap {
  margin-bottom: 18px;
}
.capacity-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--jr-ink);
  margin-bottom: 6px;
}
.capacity-bar-label span:last-child {
  color: var(--jr-cyan-bright);
  font-size: 16px;
}
.capacity-bar {
  width: 100%;
  height: 28px;
  background: var(--jr-deep);
  border: 1px solid var(--jr-line);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.capacity-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease, background 0.3s ease;
  position: relative;
}
.capacity-bar-fill.green { background: linear-gradient(90deg, #2bd98b 0%, #52e7a4 100%); box-shadow: 0 0 12px rgba(82, 231, 164, 0.3); }
.capacity-bar-fill.yellow { background: linear-gradient(90deg, #e8b030 0%, #ffd166 100%); box-shadow: 0 0 12px rgba(255, 209, 102, 0.3); }
.capacity-bar-fill.red { background: linear-gradient(90deg, #d63d52 0%, #ff6b7e 100%); box-shadow: 0 0 12px rgba(255, 107, 126, 0.3); }
.capacity-bar-fill.upload-fill { opacity: 0.8; }
.capacity-bar-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--jr-muted);
}

/* ===== Headroom ===== */
.headroom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  border-top: 1px solid rgba(18, 174, 244, 0.14);
}
.headroom-label { font-size: 14px; color: var(--jr-muted); }
.headroom-value { font-size: 22px; font-weight: 800; color: var(--jr-cyan-bright); text-shadow: 0 0 16px rgba(53, 212, 255, 0.28); }

/* ===== Reset button ===== */
.reset-btn {
  display: block;
  margin: 16px auto 0;
  padding: 8px 18px;
  border: 1px solid var(--jr-line);
  border-radius: 8px;
  background: var(--jr-panel-soft);
  color: var(--jr-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.reset-btn:hover { background: var(--jr-primary-soft); color: var(--jr-ink); }

/* ===== Inputs ===== */
.calc-inputs {
  margin-bottom: 20px;
}
.calc-inputs h2 {
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--jr-ink);
}
.simultaneous-note {
  margin: 0 0 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.08);
  color: var(--jr-ink);
  font-size: 13px;
  line-height: 1.45;
}
.example-note {
  margin: 0 0 12px;
  color: var(--jr-muted);
  font-size: 13px;
  line-height: 1.45;
}
.example-note strong,
.simultaneous-note strong { color: var(--jr-ink); }
.preset-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.preset-btn {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--jr-line);
  border-radius: 999px;
  background: var(--jr-panel-soft);
  color: var(--jr-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.preset-btn:hover,
.preset-btn.active {
  background: var(--jr-primary-soft);
  border-color: var(--jr-cyan-bright);
  color: var(--jr-cyan-bright);
}
.preset-btn:focus-visible { outline: 2px solid var(--jr-cyan-bright); outline-offset: 2px; }
.input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(18, 174, 244, 0.1);
}
.input-row:last-child { border-bottom: none; }
.input-info {
  flex: 1;
  min-width: 0;
}
.input-info label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--jr-ink);
  margin-bottom: 2px;
}
.activity-icon {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(18, 184, 246, 0.09);
  border: 1px solid rgba(53, 212, 255, 0.16);
  font-size: 17px;
  flex: 0 0 auto;
}
.helper {
  display: block;
  font-size: 12px;
  color: var(--jr-muted);
  line-height: 1.4;
}

/* ===== Stepper ===== */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.step-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--jr-line);
  background: var(--jr-panel-soft);
  color: var(--jr-cyan-bright);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.step-btn:hover { background: var(--jr-primary-soft); }
.step-btn:focus-visible { outline: 2px solid var(--jr-cyan); outline-offset: 1px; }
.step-plus { border-radius: 0 8px 8px 0; }
.step-value {
  min-width: 48px;
  height: 36px;
  border-top: 1px solid var(--jr-line);
  border-bottom: 1px solid var(--jr-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--jr-ink);
  background: var(--jr-deep);
  outline: none;
}
.step-value:focus { box-shadow: inset 0 0 0 2px var(--jr-cyan); }

/* ===== Segmented control ===== */
.segmented {
  display: inline-flex;
  border: 1px solid var(--jr-line);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.seg-btn {
  padding: 8px 14px;
  border: none;
  border-right: 1px solid var(--jr-line);
  background: var(--jr-panel-soft);
  color: var(--jr-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--jr-primary-soft); color: var(--jr-ink); }
.seg-btn.active {
  background: linear-gradient(180deg, var(--jr-primary) 0%, var(--jr-primary-dark) 100%);
  color: #fff;
}
.seg-btn:focus-visible { outline: 2px solid var(--jr-cyan); outline-offset: 1px; }

/* ===== Note ===== */
.calc-note {
  font-size: 12px;
  color: var(--jr-muted);
  line-height: 1.5;
  margin: 0 0 24px;
  padding: 0 4px;
}

/* ===== Educational cards ===== */
.edu-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.edu-card {
  border: 1px solid var(--jr-line);
  border-radius: 10px;
  background: var(--jr-panel-soft);
  padding: 16px;
}
.edu-icon {
  font-size: 22px;
  margin-bottom: 8px;
}
.edu-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--jr-cyan-bright);
}
.edu-card p {
  margin: 0;
  font-size: 13px;
  color: var(--jr-muted);
  line-height: 1.5;
}
.edu-card p strong { color: var(--jr-ink); }

/* ===== CTA ===== */
.cta-section {
  text-align: center;
  padding: 28px 20px;
  background: linear-gradient(135deg, rgba(11, 50, 88, 0.6) 0%, rgba(7, 133, 216, 0.3) 100%);
  border: 1px solid var(--jr-line);
  border-radius: 12px;
}
.cta-section h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--jr-ink);
}
.cta-section p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--jr-muted);
}
.cta-btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--jr-primary) 0%, var(--jr-primary-dark) 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 18px rgba(17, 174, 244, 0.32);
  transition: filter 0.12s;
}
.cta-btn:hover { filter: brightness(1.12); }
.cta-btn:focus-visible { outline: 2px solid var(--jr-cyan-bright); outline-offset: 2px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .calc-body { flex-direction: column; }
  .calc-results { flex: 1 1 auto; position: static; flex-basis: auto; width: 100%; }
  .calc-inputs { flex: 1 1 auto; width: 100%; }
}
@media (max-width: 560px) {
  .calc-header h1 { font-size: 22px; }
  .preset-wrap { flex-direction: column; }
  .preset-btn { width: 100%; }
  .input-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .stepper { align-self: flex-start; }
  .segmented { align-self: flex-start; }
  .edu-cards { grid-template-columns: 1fr; }
  .result-label { font-size: 18px; }
  .headroom-value { font-size: 18px; }
}
