.qual-selector-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px);
  gap: 14px;
  margin: 28px 0 24px;
}

.qual-field label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--soft-ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.qual-field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 5px 20px rgba(20, 42, 67, 0.04);
}

.qual-field select:focus-visible,
.breakdown-tabs button:focus-visible {
  outline: 3px solid rgba(52, 127, 172, 0.25);
  outline-offset: 2px;
}

.selection-heading { margin: 0 0 15px; }
.selection-heading h2 { margin: 0 0 6px; font-size: clamp(1.45rem, 3vw, 1.95rem); font-weight: 680; letter-spacing: -0.035em; }
.selection-heading p { margin: 0; color: var(--soft-ink); font-size: 0.84rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.qual-stat {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.qual-stat-value {
  margin-top: 10px;
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1;
}

.qual-stat-context { margin: 10px 0 0; color: var(--soft-ink); font-size: 0.73rem; line-height: 1.4; }
.qual-stat-context strong { color: var(--ink); font-weight: 650; }

.qual-main-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1.45fr) minmax(300px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.qualification-profile, .trend-card, .breakdown-card { padding: 21px; }
.qualification-profile h3, .trend-card h3, .breakdown-card h3 { margin: 0; font-size: 1.08rem; font-weight: 680; }
.panel-intro { margin: 5px 0 0; color: var(--soft-ink); font-size: 0.78rem; line-height: 1.45; }

.profile-bars { display: grid; gap: 15px; margin-top: 22px; }
.profile-row { display: grid; grid-template-columns: 145px minmax(130px, 1fr) 145px; gap: 14px; align-items: center; }
.profile-name { font-size: 0.82rem; line-height: 1.25; }
.profile-track { height: 13px; overflow: hidden; border-radius: 999px; background: var(--panel-soft); }
.profile-fill { width: var(--bar-width); height: 100%; border-radius: inherit; background: var(--blue); transition: width 240ms ease; }
.profile-row:nth-child(4) .profile-fill { background: var(--navy); }
.profile-value { color: var(--soft-ink); font-size: 0.76rem; text-align: right; white-space: nowrap; }
.profile-value strong { color: var(--ink); font-weight: 680; }

.composition-strip { display: flex; height: 17px; overflow: hidden; margin-top: 20px; border-radius: 999px; background: var(--panel-soft); }
.composition-strip span { min-width: 0; height: 100%; }
.composition-strip span:nth-child(1) { background: #8dbfd1; }
.composition-strip span:nth-child(2) { background: #69a7c1; }
.composition-strip span:nth-child(3) { background: #4d8eb1; }
.composition-strip span:nth-child(4) { background: #173c63; }
.composition-strip span:nth-child(5) { background: #e0a35a; }

.trend-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 17px; color: var(--soft-ink); font-size: 0.72rem; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.legend-item:last-child .legend-dot { background: var(--navy); }
.trend-chart { display: block; width: 100%; height: auto; margin-top: 14px; overflow: visible; }
.trend-axis { stroke: var(--line); stroke-width: 1; }
.trend-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.trend-line-a { fill: none; stroke: var(--blue); stroke-width: 3; }
.trend-line-b { fill: none; stroke: var(--navy); stroke-width: 3; }
.trend-point-a { fill: var(--blue); }
.trend-point-b { fill: var(--navy); }
.trend-chart text { fill: var(--soft-ink); font: 12px Inter, ui-sans-serif, system-ui, sans-serif; }
.trend-table { width: 100%; margin-top: 13px; border-collapse: collapse; font-size: 0.76rem; }
.trend-table th, .trend-table td { padding: 8px 4px; border-top: 1px solid var(--line); text-align: right; }
.trend-table th:first-child, .trend-table td:first-child { text-align: left; }
.trend-table th { color: var(--soft-ink); font-weight: 600; }

.breakdown-card { margin-top: 16px; }
.breakdown-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.breakdown-tabs { display: inline-flex; flex-wrap: wrap; gap: 5px; padding: 4px; border-radius: 11px; background: var(--panel-soft); }
.breakdown-tabs button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--soft-ink); font-size: 0.75rem; }
.breakdown-tabs button[aria-selected="true"] { background: var(--panel); color: var(--navy); box-shadow: 0 2px 7px rgba(20, 42, 67, 0.08); font-weight: 650; }
.detail-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; row-gap: 12px; margin-top: 22px; }
.detail-item { display: grid; grid-template-columns: minmax(130px, 1fr) 95px; gap: 10px; align-items: center; }
.detail-label { color: var(--ink); font-size: 0.78rem; line-height: 1.25; }
.detail-measure { color: var(--soft-ink); font-size: 0.74rem; text-align: right; }
.detail-mini-track { grid-column: 1 / -1; height: 7px; overflow: hidden; margin-top: -5px; border-radius: 999px; background: var(--panel-soft); }
.detail-mini-fill { width: var(--bar-width); height: 100%; border-radius: inherit; background: var(--blue); }

.qual-notes { margin-top: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.7); }
.qual-notes summary { color: var(--navy); font-size: 0.88rem; font-weight: 680; }
.qual-notes p { margin: 12px 0 0; color: var(--soft-ink); font-size: 0.78rem; line-height: 1.55; }

@media (max-width: 920px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qual-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .qual-selector-panel, .detail-bars { grid-template-columns: 1fr; }
  .breakdown-head { display: block; }
  .breakdown-tabs { margin-top: 15px; }
  .profile-row { grid-template-columns: 105px minmax(90px, 1fr); gap: 10px; }
  .profile-value { grid-column: 2; margin-top: -7px; text-align: left; }
}

@media (max-width: 430px) {
  .stat-grid { grid-template-columns: 1fr; }
  .qual-stat { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-fill { transition: none; }
}
