:root {
  --header-bg: #172026;
  --header-border: #d8e0e7;
  --header-text: #f7fafc;
  --header-muted: #aebbc6;
  --accent-blue: #49bfdf;
  --accent-yellow: #ffd91d;
  --accent-red: #ec5b63;
  --accent-green: #99cf76;
}

body {
  background: #f7f9fb;
}

.main-shell {
  padding-bottom: 56px;
  padding-top: 48px;
}

.calculator-heading {
  margin-bottom: 28px;
}

.site-header {
  background:
    linear-gradient(90deg, var(--accent-blue), var(--accent-yellow), var(--accent-red), #b583bd, var(--accent-green)) top / 100% 5px no-repeat,
    var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 10px 28px rgba(23, 32, 38, 0.14);
}

.site-header .navbar {
  min-height: 86px;
  padding: 16px 0 14px;
}

.header-inner {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  align-items: center;
  color: var(--header-text);
  display: inline-flex;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo-wrap {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 56px;
  padding: 8px 14px;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--header-muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.site-nav {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  max-width: 58vw;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav-link-pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #dfe8ee;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link-pill:hover,
.nav-link-pill.active {
  background: #ffffff;
  color: #172026;
}

.calculate-button {
  font-weight: 700;
  min-height: 54px;
  min-width: 160px;
  padding: 0.85rem 2.6rem;
  width: 100%;
}

.ops-form-panel {
  overflow: hidden;
  padding: 0;
}

.form-header {
  background:
    linear-gradient(90deg, rgba(73, 191, 223, 0.14), rgba(255, 217, 29, 0.16), rgba(236, 91, 99, 0.12)),
    #ffffff;
  border-bottom: 1px solid #dbe3ea;
  padding: 24px;
}

.form-header h1 {
  color: #172026;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.08;
  margin: 0 0 10px;
}

.form-header p:last-child {
  color: #53616c;
  font-size: 0.98rem;
  margin: 0;
}

.ops-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

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

.form-field {
  min-width: 0;
}

.form-field-full,
.form-field-wide {
  grid-column: 1 / -1;
}

.form-field label {
  align-items: center;
  color: #172026;
  display: flex;
  font-size: 0.92rem;
  font-weight: 800;
  justify-content: space-between;
  margin-bottom: 7px;
}

.form-field small {
  color: #64727d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.form-field .form-control {
  background: #fbfdfe;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  box-shadow: none;
  color: #172026;
  font-size: 1.12rem;
  font-weight: 800;
  height: 54px;
  padding: 0.72rem 0.9rem;
}

.form-field .form-control:focus {
  background: #ffffff;
  border-color: #49bfdf;
  box-shadow: 0 0 0 4px rgba(73, 191, 223, 0.16);
}

.form-field .form-control::placeholder {
  color: #96a4ae;
  font-weight: 600;
}

.form-field input[type="number"] {
  appearance: textfield;
}

.form-field input[type="number"]::-webkit-inner-spin-button,
.form-field input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.form-section-label {
  align-items: center;
  color: #177e89;
  display: flex;
  font-size: 0.84rem;
  font-weight: 900;
  gap: 10px;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.form-section-label::after {
  background: #dbe3ea;
  content: "";
  flex: 1;
  height: 1px;
}

.reference-section {
  color: #172026;
}

.reference-header {
  margin-bottom: 18px;
}

.reference-header h2 {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.reference-header p {
  color: #53616c;
  margin-bottom: 0;
}

.reference-kicker {
  color: #177e89;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ops-scale {
  margin: 22px 0;
}

.scale-track {
  background: linear-gradient(90deg, #49bfdf 0%, #ffd91d 34%, #ec5b63 68%, #99cf76 100%);
  border-radius: 999px;
  height: 12px;
}

.whip-scale .scale-track {
  background: linear-gradient(90deg, #99cf76 0%, #49bfdf 34%, #ffd91d 68%, #ec5b63 100%);
}

.scale-labels {
  color: #64727d;
  display: grid;
  font-size: 0.76rem;
  grid-template-columns: repeat(4, 1fr);
  line-height: 1.3;
  margin-top: 8px;
  text-align: center;
}

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

.benchmark-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.result-comparison {
  background: #ffffff;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.08);
  margin-bottom: 22px;
  padding: 20px;
}

.result-ops-row {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.result-ops-row span {
  color: #53616c;
  font-weight: 700;
}

.result-ops-row strong {
  color: #172026;
  font-size: 3rem;
  line-height: 1;
}

.result-comment {
  color: #172026;
  font-size: 1rem;
  font-weight: 700;
  margin: 14px 0 6px;
}

.closest-player {
  color: #64727d;
  margin-bottom: 0;
}

.player-card {
  background: #ffffff;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.08);
  padding: 14px;
}

.card-topline {
  align-items: center;
  color: #64727d;
  display: flex;
  font-size: 0.75rem;
  justify-content: space-between;
  margin-bottom: 10px;
}

.league-pill {
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}

.player-card-mlb .league-pill {
  background: #177e89;
}

.player-card-npb .league-pill {
  background: #c74b55;
}

.player-card h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.player-ops {
  color: #172026;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  margin: 10px 0 6px;
}

.player-line,
.player-note,
.reference-source {
  color: #64727d;
  font-size: 0.82rem;
  margin-bottom: 0;
}

.player-note {
  margin-top: 7px;
}

.reference-source {
  margin-top: 14px;
}

.page-intro {
  margin: 0 auto 30px;
  max-width: 760px;
  text-align: center;
}

.page-intro h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 12px;
}

.page-intro p:last-child {
  color: #53616c;
  font-size: 1.05rem;
  margin-bottom: 0;
}

.calculator-menu-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 40px;
}

.metric-menu-card {
  background: #ffffff;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.08);
  color: #172026;
  display: grid;
  gap: 10px;
  padding: 20px;
  text-decoration: none;
}

.metric-menu-card:hover {
  border-color: #49bfdf;
  color: #172026;
}

.metric-menu-card strong {
  font-size: 1.2rem;
  line-height: 1.35;
}

.metric-menu-card span:last-child {
  color: #64727d;
}

.featured-card {
  min-height: 164px;
}

.menu-card-label {
  color: #177e89;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-index-section {
  margin-top: 34px;
}

.mini-metric-grid,
.metric-result-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-metric-grid article,
.metric-result-card,
.calculator-panel {
  background: #ffffff;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.08);
}

.mini-metric-grid article {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.mini-metric-grid strong {
  color: #172026;
  font-size: 1.15rem;
}

.mini-metric-grid span {
  color: #64727d;
  font-size: 0.84rem;
}

.calculator-panel {
  padding: 20px;
}

.metric-result-card {
  display: grid;
  gap: 6px;
  min-height: 136px;
  padding: 16px;
}

.metric-result-card span {
  color: #64727d;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.metric-result-card strong {
  color: #172026;
  font-size: 2rem;
  line-height: 1;
}

.metric-result-card p {
  color: #64727d;
  font-size: 0.82rem;
  margin: 0;
}

.metric-result-card.metric-primary {
  border-top: 5px solid #49bfdf;
}

@media (min-width: 992px) {
  .ops-form-panel {
    position: sticky;
    top: 24px;
  }
}

@media (max-width: 767.98px) {
  .site-nav {
    gap: 6px;
    max-width: 100%;
  }

  .nav-link-pill {
    padding: 7px 10px;
  }

  .calculator-menu-grid,
  .mini-metric-grid,
  .ops-form-grid,
  .metric-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .site-header .navbar {
    min-height: 74px;
    padding: 14px 0 12px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-link {
    gap: 10px;
  }

  .brand-logo-wrap {
    height: 46px;
    padding: 7px 10px;
  }

  .brand-logo {
    height: 31px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .benchmark-grid {
    grid-template-columns: 1fr;
  }
}
