:root {
  --bg: #071426;
  --bg-soft: #0d1f3a;
  --card: #10284a;
  --card-2: #0b1e37;
  --primary: #3ea6ff;
  --primary-soft: #8ed0ff;
  --text: #f5f9ff;
  --muted: #c0d6ee;
  --border: rgba(126, 178, 255, 0.22);
  --success: #7ee0a1;
  --danger: #ffb3b3;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(62, 166, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #06111f 0%, #09182b 52%, #0c2342 100%);
  color: var(--text);
  line-height: 1.6;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.custom-navbar {
  background: rgba(6, 17, 31, 0.82);
  border-bottom: 1px solid rgba(126, 178, 255, 0.12);
  backdrop-filter: blur(12px);
}

.brand-badge {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 178, 255, 0.18);
  background: rgba(62, 166, 255, 0.08);
  color: var(--primary-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero-section {
  padding: 2rem 0 1rem;
}

.hero-wrap {
  max-width: 1180px;
}

.hero-compact {
  position: relative;
  overflow: hidden;
}

.hero-kicker {
  display: inline-flex;
  margin-bottom: 0.9rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: rgba(62, 166, 255, 0.1);
  border: 1px solid rgba(126, 178, 255, 0.14);
  color: var(--primary-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero-box,
.calculator-shell,
.info-box {
  background: linear-gradient(135deg, rgba(15, 33, 58, 0.96), rgba(10, 24, 45, 0.96));
  border: 1px solid rgba(126, 178, 255, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.section-title {
  color: #eaf4ff;
  font-weight: 700;
}

.section-head {
  max-width: 760px;
}

#calculator .container {
  max-width: 1180px;
}

.section-desc,
.lead,
.tab-desc,
.hint,
.form-label,
.nav-link,
.small-text {
  color: var(--muted) !important;
}

.tab-btn {
  background: rgba(11, 30, 55, 0.72);
  color: var(--text) !important;
  border: 1px solid rgba(126, 178, 255, 0.12);
  font-weight: 700;
  border-radius: 1rem;
  padding: 0.95rem 1rem;
}

.tab-btn.active {
  background: var(--primary) !important;
  color: #04101f !important;
  border-color: transparent;
}

.panel-box {
  background: rgba(8, 23, 42, 0.72);
  border: 1px solid rgba(126, 178, 255, 0.12);
}

.custom-input {
  background: rgba(7, 20, 38, 0.92);
  color: var(--text);
  border: 1px solid rgba(126, 178, 255, 0.14);
}

.custom-input::placeholder {
  color: #91aecd;
}

.custom-input:focus {
  background: #0a1a31;
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(62, 166, 255, 0.15);
}

.result-box {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(126, 224, 161, 0.1);
  border: 1px solid rgba(126, 224, 161, 0.25);
  color: var(--text);
  word-break: break-word;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.result-box.result-pop {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 0 0.25rem rgba(126, 224, 161, 0.08);
  background: rgba(126, 224, 161, 0.16);
}

.summary-text {
  color: var(--primary-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.quick-label {
  color: #9fb6d1;
  font-size: 0.84rem;
  font-weight: 700;
  margin-right: 0.15rem;
}

.btn-soft-info {
  background: rgba(62, 166, 255, 0.1);
  color: var(--primary-soft);
  border: 1px solid var(--border);
}

.btn-soft-info:hover {
  background: rgba(62, 166, 255, 0.18);
  color: var(--text);
  border-color: rgba(126, 178, 255, 0.35);
}

.result-box strong {
  color: var(--success);
  font-size: 1.15rem;
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

footer {
  border-top: 1px solid rgba(126, 178, 255, 0.08);
}

.footer-clean {
  margin-top: 0.5rem;
}

@media (min-width: 992px) {
  body {
    line-height: 1.7;
  }

  .custom-navbar .container,
  .hero-wrap,
  #calculator .container,
  footer .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-section {
    padding: 2.5rem 0 1.25rem;
  }

  .hero-compact {
    padding: 2.4rem 2.6rem !important;
  }

  .display-6 {
    font-size: 2.55rem;
    line-height: 1.12;
  }

  .lead {
    max-width: 760px;
    font-size: 1.08rem;
  }

  .calculator-shell {
    padding: 1.7rem !important;
  }

  .panel-box {
    padding: 1.5rem !important;
  }

  .tab-btn {
    min-height: 60px;
  }

  .custom-input {
    min-height: 58px;
  }

  .result-box {
    min-height: 92px;
  }
}

@media (min-width: 1200px) {
  .hero-wrap,
  #calculator .container {
    max-width: 1240px;
  }

  .hero-compact {
    padding: 2.75rem 3rem !important;
  }

  .section-head {
    margin-bottom: 1.5rem !important;
  }
}

@media (max-width: 767.98px) {
  .navbar-brand {
    font-size: 1rem;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
  }

  .hero-box,
  .calculator-shell,
  .info-box,
  .panel-box {
    border-radius: 1.1rem !important;
  }

  .hero-section {
    padding-top: 1.2rem;
  }

  .brand-badge {
    display: none !important;
  }

  .display-6 {
    font-size: 1.72rem;
    line-height: 1.2;
  }

  .lead {
    font-size: 0.98rem;
  }

  .section-title {
    font-size: 1.45rem;
  }

  .calculator-shell {
    padding: 0.95rem !important;
  }

  .panel-box {
    padding: 1rem !important;
  }

  .tab-btn {
    min-height: 52px;
    font-size: 0.98rem;
  }

  .quick-actions {
    gap: 0.55rem !important;
  }

  .quick-label {
    width: 100%;
    margin-bottom: 0.1rem;
  }

  .btn,
  .form-control {
    font-size: 16px;
  }

  .form-control,
  .btn {
    min-height: 50px;
  }

  .result-box,
  .summary-text,
  .hint,
  .error-text {
    font-size: 0.95rem;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem !important;
  }

  .toast-container .toast {
    width: 100%;
  }

  .d-grid.d-md-flex.gap-2 > * {
    width: 100%;
  }
}

@supports (padding: max(0px)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .toast-container {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
}
