.tool-hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 32px;
  align-items: center;
  padding: 120px 0 56px;
}

.tool-title {
  max-width: 11ch;
}

.hero-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-intro-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.hero-intro-point {
  position: relative;
  z-index: 1;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.038),
    rgba(255, 255, 255, 0.022)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-intro-label {
  display: block;
  font-size: 0.82rem;
  color: var(--gg-muted);
  margin-bottom: 8px;
}

.section-emphasis {
  padding-top: 10px;
}

.section-muted {
  position: relative;
}

.section-muted::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
  gap: 28px;
  align-items: stretch;
}

.calc-card,
.results-card {
  min-height: 100%;
  height: 100%;
}

.card-heading {
  margin-bottom: 20px;
}

.card-heading h3 {
  margin: 0 0 8px;
  font-size: 1.28rem;
}

.card-heading p {
  margin: 0;
  color: var(--gg-text-soft);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.input-grid-top {
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  color: rgba(240, 236, 255, 0.94);
  font-weight: 700;
  font-size: 1rem;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.input-wrap,
.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(32, 220, 255, 0.26);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.025)
  );
  color: var(--gg-text);
  outline: none;
  font-size: 1.05rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.select-wrap select:hover,
.select-wrap select:focus {
  border-color: rgba(32, 220, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(32, 220, 255, 0.08);
}

.select-wrap select option,
select option {
  background-color: #141a2b !important;
  color: #f4efff !important;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-btn {
  min-height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.025)
  );
  color: var(--gg-text);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.mode-btn:hover {
  transform: translateY(-1px);
}

.mode-btn:focus-visible {
  border-color: rgba(32, 220, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(32, 220, 255, 0.08);
}

.mode-btn.active {
  border-color: rgba(32, 220, 255, 0.28);
  box-shadow: 0 10px 26px rgba(32, 220, 255, 0.08);
  background: linear-gradient(
    135deg,
    rgba(32, 220, 255, 0.16),
    rgba(124, 58, 237, 0.18)
  );
}

.mini-info {
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.038),
    rgba(255, 255, 255, 0.022)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-info-tight {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mini-info-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gg-cyan);
  font-weight: 800;
  font-size: 0.9rem;
}

.mini-info p,
.toolbar-copy {
  margin: 0;
  color: var(--gg-text-soft);
  line-height: 1.7;
}

.builder-wrap {
  margin-bottom: 0;
}

.mode-panel[hidden] {
  display: none;
}

.course-builder {
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.026),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.course-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar-label {
  margin-bottom: 4px;
}

.course-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.points-grid,
.weighted-grid {
  display: grid;
  gap: 12px;
  align-items: center;
}

.points-grid {
  grid-template-columns: minmax(0, 2.2fr) minmax(84px, 0.68fr) minmax(
      84px,
      0.68fr
    ) minmax(128px, 0.9fr) 52px;
}

.weighted-grid {
  grid-template-columns: minmax(0, 2.35fr) minmax(82px, 0.58fr) minmax(
      82px,
      0.58fr
    ) minmax(110px, 0.76fr) 52px;
}

.points-grid-head,
.weighted-grid-head {
  margin-bottom: 10px;
  padding: 0 12px;
  color: var(--gg-muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.points-grid-head > div,
.weighted-grid-head > div {
  display: flex;
  align-items: center;
  min-height: 20px;
}

.points-grid-head > :nth-child(2),
.points-grid-head > :nth-child(3),
.points-grid-head > :nth-child(4),
.weighted-grid-head > :nth-child(2),
.weighted-grid-head > :nth-child(3),
.weighted-grid-head > :nth-child(4) {
  justify-content: center;
  text-align: center;
}

.data-row {
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.038),
    rgba(255, 255, 255, 0.022)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.row-input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 16, 30, 0.58);
  color: var(--gg-text);
  font-size: 1rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.row-input:focus {
  border-color: rgba(32, 220, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(32, 220, 255, 0.08);
}

.row-input::placeholder {
  color: rgba(205, 196, 232, 0.46);
}

.points-grid .row-input:nth-child(2),
.points-grid .row-input:nth-child(3),
.weighted-grid .row-input:nth-child(2),
.weighted-grid .row-input:nth-child(3) {
  text-align: center;
  padding-left: 12px;
  padding-right: 12px;
}

.value-pill {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 0 12px;
  background: linear-gradient(
    135deg,
    rgba(127, 255, 212, 0.12),
    rgba(32, 220, 255, 0.14)
  );
  border: 1px solid rgba(32, 220, 255, 0.18);
  color: rgba(240, 236, 255, 0.95);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.remove-row {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  color: rgba(240, 236, 255, 0.9);
  font-size: 1.45rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.remove-row:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 111, 174, 0.35);
  background: linear-gradient(
    180deg,
    rgba(255, 111, 174, 0.12),
    rgba(255, 53, 212, 0.08)
  );
}

.button-row {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.results-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.results-title {
  margin: 10px 0 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-box {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.016)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.result-box-highlight {
  border-color: rgba(32, 220, 255, 0.16);
}

.result-label,
.summary-label,
.loan-stat-label,
.warning-label {
  display: block;
  color: var(--gg-muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-value {
  display: block;
  margin-top: 10px;
  font-size: 1.85rem;
  line-height: 1.12;
}

.result-value-hero {
  font-size: 2rem;
  background: linear-gradient(
    90deg,
    var(--gg-cyan) 0%,
    #73b8ff 38%,
    #9d89ff 72%,
    var(--gg-magenta) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #f0ecff;
}

.summary-panel,
.warning-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.026),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-text,
.warning-text {
  margin: 12px 0 0;
  color: var(--gg-text-soft);
  line-height: 1.75;
}

.loan-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.loan-stat-item {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.016)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.loan-stat-item strong {
  display: block;
  margin-top: 10px;
  font-size: 1.15rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
  color: #22170a;
  background: #ffd36a;
}

.result-badge.elite {
  background: #73ffd4;
}

.result-badge.strong {
  background: #ffd36a;
}

.result-badge.steady {
  background: #a5b4fc;
}

.result-badge.invalid {
  background: #ff9aa5;
}

.info-card,
.info-usage-card {
  min-height: 100%;
}

.info-card h3,
.tool-card h3 {
  margin: 0 0 10px;
}

.info-card p,
.tool-card p {
  margin: 0;
  color: var(--gg-text-soft);
  line-height: 1.7;
}

.tool-card {
  display: block;
}

.card-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--gg-cyan);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .tool-hero,
  .calculator-layout,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .input-grid,
  .results-grid,
  .loan-stats,
  .hero-intro-points {
    grid-template-columns: 1fr;
  }

  .points-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(76px, 0.62fr) minmax(
        76px,
        0.62fr
      ) minmax(106px, 0.8fr) 48px;
    gap: 10px;
  }

  .weighted-grid {
    grid-template-columns: minmax(0, 1.95fr) minmax(74px, 0.54fr) minmax(
        74px,
        0.54fr
      ) minmax(96px, 0.68fr) 48px;
    gap: 10px;
  }

  .points-grid-head,
  .weighted-grid-head {
    padding: 0 4px;
    font-size: 0.78rem;
  }
}

@media (max-width: 640px) {
  .tool-hero {
    padding: 106px 0 44px;
  }

  .course-toolbar,
  .results-top,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .course-toolbar .gg-btn,
  .button-row .gg-btn {
    width: 100%;
  }

  .points-grid-head,
  .weighted-grid-head {
    display: none;
  }

  .data-row {
    padding: 12px;
  }

  .points-grid,
  .weighted-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .points-grid .row-input:first-child,
  .weighted-grid .row-input:first-child {
    grid-column: 1 / -1;
  }

  .value-pill,
  .remove-row {
    width: 100%;
    min-width: 0;
  }

  .value-pill {
    min-height: 52px;
  }

  .remove-row {
    height: 52px;
  }

  .results-title {
    font-size: 1.72rem;
  }
}
