/* vets.css (new) — designed to sit on top of /styles.css */

/* =========================================
   WCAG helpers (vets page)
   ========================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  color: #000;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
  z-index: 9999;
}
.skip-link:focus {
  transform: translateY(0);
}

html:not(.js) .fade-in {
  opacity: 1 !important;
  transform: none !important;
}

/* Focus styles (don’t rely on browser default) */
.vets-page a:focus-visible,
.vets-page button:focus-visible,
.vets-page input:focus-visible,
.vets-page select:focus-visible,
.vets-page summary:focus-visible {
  outline: 3px solid var(--blue-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto !important;
  }
}

.vets-page {
  padding-top: 8px;
  padding-bottom: 28px;
}

/* HERO tweaks */
.vets-hero .widget-content p {
  max-width: 100%;
}

.vets-hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 16px;
  align-items: stretch;
}

.vets-hero-panel {
  background: rgb(2, 10, 28);
  border: 1px solid rgb(148, 163, 184);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 12px 30px rgb(0, 0, 0);
}

.light-mode .vets-hero-panel {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.vets-hero-stat .label,
.vets-hero-mini .label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(226, 232, 240);
}

.light-mode .vets-hero-stat .label,
.light-mode .vets-hero-mini .label {
  color: rgb(15, 23, 42);
}

.vets-hero-stat .value {
  font-size: 1.55rem;
  font-weight: 900;
  margin-top: 6px;
  color: #ffffff;
}

.light-mode .vets-hero-stat .value {
  color: #0f172a;
}

.vets-hero-stat .sub {
  margin-top: 6px;
  font-size: 0.82rem;
  color: rgb(226, 232, 240);
  line-height: 1.35;
}

.light-mode .vets-hero-stat .sub {
  color: #0f172a;
}

.vets-hero-mini {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.vets-hero-mini .mini {
  border-radius: 12px;
  padding: 10px 10px;
  border: 1px solid rgb(148, 163, 184);
  background: rgb(2, 6, 23);
}

.light-mode .vets-hero-mini .mini {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgb(15, 23, 42);
}

.vets-hero-mini .value {
  margin-top: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
}

.light-mode .vets-hero-mini .value {
  margin-top: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
}

.vets-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.vets-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  border-radius: 999px;
  padding: 12px 16px;
  border: 1px solid rgba(250, 204, 21, 0.55);
  background: rgba(251, 191, 36, 0.15);
  color: #fff;
}

.vets-hero-btn.ghost {
  border-color: rgb(10, 23, 40);
  background: rgb(255, 255, 255);
  color: rgb(15, 23, 42);
}

.light-mode .vets-hero-btn {
  color: #0f172a;
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
}

.light-mode .vets-hero-btn.ghost {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

/* ===== Collapsible cards ===== */
.vets-card {
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(
    180deg,
    rgba(11, 17, 32, 0.92),
    rgba(17, 24, 39, 0.92)
  );
  box-shadow: 0 14px 40px -14px rgba(15, 23, 42, 0.92);
  overflow: hidden;
}

.light-mode .vets-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.vets-summary {
  cursor: pointer;
  user-select: none;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: radial-gradient(
    circle at 0 0,
    rgba(250, 204, 21, 0.08),
    transparent 45%
  );
}

.vets-summary::-webkit-details-marker {
  display: none;
}
.vets-summary::marker {
  content: "";
}

.vets-summary-left h2 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.15;
}

.vets-eyebrow {
  margin: 0 0 6px 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.vets-summary-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vets-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
  max-width: 220px;
}

.vets-collapse-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.35);
}

.light-mode .vets-collapse-pill {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.08);
}

.vets-collapse-pill .pill-close {
  display: none;
}
details[open] .vets-collapse-pill .pill-open {
  display: none;
}
details[open] .vets-collapse-pill .pill-close {
  display: inline;
}
.vets-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  margin-top: 4px;
}
details[open] .vets-chevron {
  transform: rotate(180deg);
}

.vets-body {
  padding: 0 16px 16px 16px;
}

/* ===== calculator layout ===== */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 16px;
}

.step {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.28);
}

.light-mode .step {
  background: rgba(244, 244, 245, 0.8);
  border-color: rgba(15, 23, 42, 0.12);
}

.step h3 {
  margin: 0 0 10px 0;
  font-size: 0.98rem;
  font-weight: 900;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 0.9rem;
}

.field span {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
}

.vets-page input:not([type="range"]),
.vets-page select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.light-mode .vets-page input:not([type="range"]),
.light-mode .vets-page select {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

.light-mode .vets-page input,
.light-mode .vets-page select {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

.vets-page input:focus,
.vets-page select:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.rating-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.rating-live {
  font-weight: 900;
  color: #fbbf24;
}

.light-mode .rating-live {
  color: var(--primary);
}

.vets-page input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.rating-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rating-buttons button {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.light-mode .rating-buttons button {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.rating-buttons button.active {
  border-color: rgba(250, 204, 21, 0.65);
  background: rgba(251, 191, 36, 0.14);
  color: #fef3c7;
}

.light-mode .rating-buttons button.active {
  color: #0f172a;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* toggles + segmented */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  min-height: 44px;
}

.light-mode .toggle {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.toggle input {
  width: 18px;
  height: 18px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.seg-btn {
  position: relative;
}

.seg-btn input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.seg-btn span {
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
  padding: 10px 0;
  text-align: center;
  font-weight: 900;
  cursor: pointer;
}

.seg-btn input:focus-visible + span {
  outline: 3px solid var(--blue-accent);
  outline-offset: 3px;
}

.light-mode .seg-btn span {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.seg-btn input:checked + span {
  border-color: rgba(250, 204, 21, 0.65);
  background: rgba(251, 191, 36, 0.14);
  color: #fef3c7;
}

.light-mode .seg-btn input:checked + span {
  color: #0f172a;
}

/* output side */
.calc-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

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

.summary-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
}

.light-mode .summary-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.summary-card .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 700;
}

.summary-card .value {
  font-size: 1.25rem;
  font-weight: 900;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.summary-card .sub,
.summary-card .delta {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.summary-card .delta.positive {
  color: var(--green-accent);
}
.summary-card .delta.negative {
  color: var(--red-accent);
}

.breakdown {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.22);
}

.light-mode .breakdown {
  background: rgba(244, 244, 245, 0.8);
  border-color: rgba(15, 23, 42, 0.12);
}

.breakdown h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 900;
}

.breakdown ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.9rem;
}

.breakdown li:last-child {
  border-bottom: none;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.4;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Buttons (scoped to vets page so it doesn't affect other pages) */
.vets-page .btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary), rgba(251, 191, 36, 0.65));
  color: rgba(2, 6, 23, 0.92);
  font-weight: 900;
  cursor: pointer;
}

.vets-page .btn.ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.35);
}

/* SMC */
.smc-output {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 14px;
  background: rgba(15, 23, 42, 0.35);
}

.light-mode .smc-output {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.smc-output .value {
  font-size: 1.35rem;
  font-weight: 900;
}

/* DIC table should scroll */
.dic-table {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dic-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.dic-table th,
.dic-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.dic-table th {
  background: rgba(15, 23, 42, 0.55);
}

.light-mode .dic-table th {
  background: rgba(244, 244, 245, 0.9);
}

/* STATES */
.state-chipbar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 6px 0 10px;
  scrollbar-width: none;
}
.state-chipbar::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.82rem;
  cursor: pointer;
}

.light-mode .chip-btn {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.chip-btn.active {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(250, 204, 21, 0.65);
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.state-card {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.light-mode .state-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
}

.state-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.state-card p {
  margin: 0;
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.state-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.state-actions .btn {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.state-links {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.vets-footnote {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.is-hidden {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .vets-hero-grid {
    grid-template-columns: 1fr;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  /* keep rating buttons from becoming a tall wall
  .rating-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
  } */
  .rating-buttons::-webkit-scrollbar {
    display: none;
  }
  @media (max-width: 320px) {
    .field-grid {
      grid-template-columns: 1fr;
    }
  }

  /* ===== Range slider (fix thumb/track + value fill) ===== */
  .vets-page input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 0;
    margin: 10px 0 0;
    background: transparent;
    border: none;
    height: 38px; /* touch target */
    --pct: 100%;
  }

  .vets-page input[type="range"]::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      var(--primary) 0%,
      var(--primary) var(--pct),
      rgba(148, 163, 184, 0.35) var(--pct),
      rgba(148, 163, 184, 0.35) 100%
    );
  }

  .vets-page input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--primary);
    border: 2px solid rgba(2, 6, 23, 0.9);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.6);
    margin-top: -6px; /* centers thumb on 10px track */
  }

  .vets-page input[type="range"]:focus-visible {
    outline: none;
  }
  .vets-page input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35),
      0 8px 18px rgba(15, 23, 42, 0.6);
  }
  .vets-page input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35),
      0 8px 18px rgba(15, 23, 42, 0.6);
  }

  .vets-page input[type="range"]::-moz-range-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
  }

  .vets-page input[type="range"]::-moz-range-progress {
    height: 10px;
    border-radius: 999px;
    background: var(--primary);
  }

  .vets-page input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--primary);
    border: 2px solid rgba(2, 6, 23, 0.9);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.6);
  }

  /* action buttons swipeable */
  .card-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .card-actions::-webkit-scrollbar {
    display: none;
  }
  .card-actions .btn {
    white-space: nowrap;
  }

  .vets-meta {
    max-width: 160px;
  }
}

/* Make the Open/Close pill readable */
.vets-collapse-pill {
  color: var(--text-primary);
}
.light-mode .vets-collapse-pill {
  color: #0f172a;
}

/* Link discoverability */
.app-footer .legal-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
