.ride-carb-page {
  color: #172033;
  background: #eef3f7 !important;
}

.ride-carb-main h1,
.ride-carb-main h2,
.ride-carb-main h3 {
  letter-spacing: 0;
}

.carb-hero {
  border: 1px solid #d5e0ea;
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #edf7fb 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.carb-hero h1 {
  max-width: 980px;
  margin: 0 0 .6rem;
  color: #0f2437;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
}

.carb-hero .lead {
  max-width: 900px;
  color: #45576b;
  font-size: 1.05rem;
}

.calculator-shell,
.content-section {
  border: 1px solid #d5e0ea;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

.calculator-shell {
  padding: 1.2rem;
}

.calculator-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e4edf4;
}

.calculator-heading h2,
.content-section h2 {
  margin: .15rem 0 0;
  color: #102a43;
  font-size: 1.45rem;
  font-weight: 900;
}

.calculator-heading p {
  max-width: 420px;
  margin: 0;
  color: #5a6b7d;
  font-size: .95rem;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  color: #087f8c;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
  gap: 1rem;
  align-items: start;
}

.calculator-panel,
.summary-panel,
.results-panel {
  border: 1px solid #e1e9f0;
  border-radius: 10px;
  background: #f8fbfd;
  padding: 1rem;
}

.calculator-panel .form-label {
  color: #304255;
  font-size: .83rem;
  font-weight: 800;
}

.calculator-panel .form-control,
.calculator-panel .form-select {
  border-color: #cbd8e3;
  border-radius: 8px;
  min-height: 44px;
}

.calculator-panel .form-control:focus,
.calculator-panel .form-select:focus {
  border-color: #087f8c;
  box-shadow: 0 0 0 .2rem rgba(8, 127, 140, .14);
}

.interval-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .5rem 0 1rem;
}

.interval-header h3,
.summary-panel h3 {
  margin: 0;
  color: #102a43;
  font-size: 1rem;
  font-weight: 900;
}

.interval-row {
  padding: .75rem;
  border: 1px solid #dbe5ee;
  border-radius: 10px;
  background: #ffffff;
}

.interval-row.d-flex {
  flex-wrap: wrap;
  gap: .65rem;
}

.interval-row.d-flex label {
  margin-bottom: 0;
  font-weight: 800;
}

.interval-row.d-flex input {
  width: min(220px, 100%) !important;
}

.summary-panel {
  position: sticky;
  top: 1rem;
  background: #102a43;
  color: #ffffff;
}

.summary-box {
  margin-top: .8rem;
  padding: .9rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
}

.summary-box p {
  margin: 0;
  line-height: 1.7;
}

.summary-box span {
  color: #8ee3ef;
  font-weight: 900;
}

.summary-box .btn-info {
  border: 0;
  background: #8ee3ef;
  color: #102a43;
  font-weight: 800;
}

.quick-rules {
  display: grid;
  gap: .45rem;
  margin-top: .8rem;
}

.quick-rules span {
  display: block;
  border-radius: 999px;
  padding: .42rem .65rem;
  background: rgba(142, 227, 239, .14);
  color: #dffafe;
  font-size: .82rem;
  font-weight: 800;
}

.results-panel:empty {
  display: none;
}

.results-panel h4 {
  margin-bottom: .8rem;
  color: #102a43;
  font-weight: 900;
}

.results-panel p {
  border-left: 4px solid #087f8c;
  padding: .65rem .8rem;
  margin-bottom: .65rem;
  background: #ffffff;
  border-radius: 8px;
}

.content-section {
  padding: 1.35rem 1.45rem;
}

.content-section p {
  color: #3d4f61;
  line-height: 1.75;
}

.formula-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}

.formula-strip div,
.example-grid article {
  border: 1px solid #dbe5ee;
  border-radius: 10px;
  padding: .9rem;
  background: #f8fbfd;
}

.formula-strip strong {
  display: block;
  color: #087f8c;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.formula-strip span {
  color: #102a43;
  font-weight: 800;
}

.carb-table th {
  color: #102a43;
  font-size: .82rem;
  text-transform: uppercase;
}

.carb-table td {
  color: #304255;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}

.example-grid h3 {
  color: #102a43;
  font-size: 1rem;
  font-weight: 900;
}

.reference-list {
  display: grid;
  gap: .55rem;
  padding-left: 1.1rem;
}

.reference-list a {
  color: #075f68;
  font-weight: 800;
}

.medical-note {
  border-left: 4px solid #e09f3e;
  padding: .75rem .9rem;
  border-radius: 8px;
  background: #fff7ed;
  color: #653f12 !important;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .calculator-heading,
  .interval-header {
    align-items: stretch;
    flex-direction: column;
  }

  .calculator-grid,
  .formula-strip,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 575.98px) {
  .carb-hero,
  .calculator-shell,
  .content-section {
    border-radius: 10px;
    padding: 1rem;
  }

  .carb-hero h1 {
    font-size: 1.75rem;
  }
}
