:root {
  --brand: #4B0082;
  --brand-dark: #35005c;
  --accent: #f7b267;
  --accent-soft: #fff1df;
  --ink: #171321;
  --muted: #625b70;
  --line: #e8e1ef;
  --page: #fcfbfd;
  --surface: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-dark);
}

.skip-link {
  position: absolute;
  left: -999px;
  z-index: 1000;
  padding: 0.5rem 0.75rem;
  color: #fff;
  background: var(--brand);
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
}

.site-header {
  color: #fff;
  background: var(--brand);
}

.site-footer {
  color: #fff;
  background: #20142d;
}

.site-footer a {
  color: #ffd7a5;
}

.navbar-brand {
  font-weight: 850;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  color: var(--brand);
  background: var(--accent);
  border-radius: 8px;
  font-weight: 900;
  place-items: center;
}

.page-hero {
  padding: 0.7rem 0;
  background: linear-gradient(120deg, rgba(75, 0, 130, 0.08), rgba(247, 178, 103, 0.16));
  border-bottom: 1px solid var(--line);
}

.page-hero .breadcrumb,
.page-hero .section-label {
  display: none;
}

.page-hero h1 {
  margin-bottom: 0.15rem !important;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.2;
}

.page-hero .lead {
  margin-bottom: 0 !important;
  font-size: 0.98rem;
  line-height: 1.35;
}

.section-label {
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 850;
  text-transform: uppercase;
}

.card-clean {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 19, 33, 0.06);
}

.calculator-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 992px) {
  .calculator-workspace {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: stretch;
  }
}

.form-control,
.form-select,
.btn {
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(75, 0, 130, 0.14);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 750;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.result-box {
  min-height: 142px;
  padding: 1rem;
  background: rgba(75, 0, 130, 0.07);
  border: 1px solid rgba(75, 0, 130, 0.14);
  border-radius: 8px;
}

.main-result {
  color: var(--brand);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 900;
  line-height: 1.15;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 576px) {
  .breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.breakdown-item {
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.breakdown-item span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.breakdown-item strong {
  display: block;
  font-size: 1.05rem;
}

.chart-wrap {
  min-height: 220px;
}

.chart-wrap canvas {
  width: 100%;
  height: 220px;
  display: block;
}

.insights-box {
  padding: 1rem;
  background: var(--accent-soft);
  border: 1px solid rgba(247, 178, 103, 0.48);
  border-radius: 8px;
}

.insights-box ul {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.insights-box li + li {
  margin-top: 0.45rem;
}

.text-muted-smart {
  color: var(--muted);
}
