/* Vietlish Study V17.9.4 — Fix progress-by-level layout (A1–C2).
   Scope is the six progress rows emitted by the Profile component.
   Works with the current markup: <h3>...<div class="card"><div class="row"><b style="width:34px">...
   Does not touch progress numbers, Supabase, admin, or other progress bars. */

/* The preceding heading makes this selector local to profile's progress section.
   The width attribute avoids affecting unrelated rows on the same page. */
h3 + .card > .row:has(> b[style*="width: 34px"]),
h3 + .card > .row:has(> b[style*="width:34px"]) {
  display: grid !important;
  grid-template-columns: minmax(145px, 175px) minmax(80px, 1fr) minmax(55px, 78px);
  column-gap: 14px !important;
  row-gap: 5px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 12px 0 !important;
  min-width: 0;
  border-bottom: 1px solid var(--ln, rgba(100,100,100,.13));
}
h3 + .card > .row:has(> b[style*="width: 34px"]):last-child,
h3 + .card > .row:has(> b[style*="width:34px"]):last-child {
  border-bottom: 0;
}
h3 + .card > .row:has(> b[style*="width: 34px"]) > b,
h3 + .card > .row:has(> b[style*="width:34px"]) > b {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}
h3 + .card > .row:has(> b[style*="width: 34px"]) > .bar,
h3 + .card > .row:has(> b[style*="width:34px"]) > .bar {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 12px;
  align-self: center;
}
h3 + .card > .row:has(> b[style*="width: 34px"]) > .mu,
h3 + .card > .row:has(> b[style*="width:34px"]) > .mu {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Phone: name above the progress bar, counter beside it — no squeezed labels. */
@media (max-width: 600px) {
  h3 + .card > .row:has(> b[style*="width: 34px"]),
  h3 + .card > .row:has(> b[style*="width:34px"]) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px !important;
    padding: 12px 0 !important;
  }
  h3 + .card > .row:has(> b[style*="width: 34px"]) > b,
  h3 + .card > .row:has(> b[style*="width:34px"]) > b {
    grid-column: 1 / -1;
    font-size: 15px;
  }
  h3 + .card > .row:has(> b[style*="width: 34px"]) > .bar,
  h3 + .card > .row:has(> b[style*="width:34px"]) > .bar {
    grid-column: 1;
  }
  h3 + .card > .row:has(> b[style*="width: 34px"]) > .mu,
  h3 + .card > .row:has(> b[style*="width:34px"]) > .mu {
    grid-column: 2;
    font-size: 14px;
  }
}
