/* UI v1 interaction and density contract. Keeps the reference site.css untouched. */

:where(.seg, .chips, .review-tabs, .review-grid, .review-kpis, .review-kpi, .review-card) {
  min-width: 0;
  max-width: 100%;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.nowrap {
  white-space: nowrap;
}

.seg,
.review-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.seg::-webkit-scrollbar,
.review-tabs::-webkit-scrollbar {
  display: none;
}

.seg button {
  flex: none;
  height: 36px;
  line-height: 1;
}

.seg button::after,
.btn-s::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.review-tabs button {
  flex: none;
  min-height: 44px;
  height: 44px;
}

.chips button {
  flex: none;
}

.chips button::after {
  content: "";
  position: absolute;
  inset: -8px -4px;
}

.chips > [role="status"] {
  margin-left: auto;
}

.btn:disabled,
.btn-ghost:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.job[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .48;
}

.role-desc {
  font-size: 17px;
}

.tool-library-scroll {
  width: 100%;
  max-width: calc(100vw - 48px);
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.tool-library-scroll > .spec {
  min-width: 680px;
}

.tool-library-scroll .spec thead th {
  top: 0;
}

.tool-library-scroll .spec td:nth-child(3) {
  white-space: nowrap;
}

.searchbar input {
  min-height: 44px;
}

.job .h4 {
  text-wrap: balance;
}

.cell > .spec td:last-child {
  padding-right: var(--s64);
}

.cert .name,
.cert .meta {
  text-wrap: pretty;
}

@media  (max-width: 1200px) {
  .cert {
    padding: var(--s16);
  }
}

.code-snippet {
  display: block;
  max-width: 42em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

button.link {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s16);
  white-space: nowrap;
}

.unavailable {
  color: var(--label-2);
  font-size: 13px;
}

.retro-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(150px, .7fr));
  gap: var(--s12);
  max-width: 980px;
}

.retro-filters .searchbar,
.retro-filters select {
  min-height: 52px;
}

.retro-filters select {
  width: 100%;
  padding: 0 var(--s16);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--label);
  font: inherit;
  font-size: 15px;
}

.retro-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.retro-row strong,
.retro-row span {
  display: block;
}

.retro-row span {
  margin-top: var(--s8);
  color: var(--label-2);
  font-size: 13px;
}

.retro-row:hover,
.retro-row[aria-current="true"] {
  border-color: var(--brand-3);
}

/* Approved layout utilities for product-shell pages. These replace repeated
   inline style attributes without introducing new visual values. */
.u-mt-8 { margin-top: var(--s8); }
.u-mt-16 { margin-top: var(--s16); }
.u-mt-24 { margin-top: var(--s24); }
.u-mt-32 { margin-top: var(--s32); }
.u-mt-48 { margin-top: var(--s48); }
.u-ml-auto { margin-left: auto; }
.u-measure-16 { max-width: 16em; }
.u-measure-20 { max-width: 20em; }
.u-measure-22 { max-width: 22em; }
.u-measure-38 { max-width: 38em; }
.u-measure-40 { max-width: 40em; }
.u-measure-42 { max-width: 42em; }
.u-measure-720 { max-width: 720px; }
.u-row-rule {
  display: flex;
  padding: var(--s8) 0;
  border-bottom: 1px solid var(--hair);
}
.u-row-flat {
  display: flex;
  padding: var(--s8) 0;
}
.u-center { justify-content: center; }
.u-stack-8 {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}
.u-text-label { color: var(--label); }
.u-min-h-0 { min-height: 0; }
.u-selected-brand {
  border-color: var(--brand-1);
  background: var(--brand-0);
}
.u-input-15 {
  min-height: 44px;
  padding: 0 var(--s16);
  font-size: 15px;
}
.u-feature-frame {
  margin-top: var(--s48);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: 0 32px 64px -48px rgba(29, 29, 31, .28);
  text-align: left;
}
.u-media-frame {
  max-height: 460px;
  border-radius: var(--r-lg);
}
.u-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.u-action-block {
  width: 100%;
  min-height: 44px;
  margin-top: var(--s24);
}
.u-progress-0 { width: 0%; }

.retro-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s12);
  margin-top: var(--s24);
}

.retro-fact {
  min-width: 0;
  padding: var(--s16);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
}

.retro-fact b,
.retro-fact span {
  display: block;
}

.retro-fact b {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.retro-fact span {
  margin-top: var(--s4);
  color: var(--label-2);
  font-size: 13px;
}

.retro-next {
  display: grid;
  gap: var(--s12);
  margin: var(--s24) 0 0;
  padding: 0;
  list-style: none;
}

.retro-next li {
  padding-top: var(--s12);
  border-top: 1px solid var(--hair);
}

.retro-next b,
.retro-next span {
  display: block;
}

.retro-next span {
  margin-top: var(--s4);
  color: var(--label-2);
  font-size: 13px;
}

.retro-detail-link {
  margin-top: var(--s24);
}

.message-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: calc(var(--s8) + var(--s4));
  align-items: center;
  margin-top: var(--s24);
}

[data-message-thread-panel] {
  container-type: inline-size;
}

@container (max-width: 520px) {
  .message-composer {
    grid-template-columns: 1fr;
  }

  .message-composer .btn {
    width: 100%;
  }
}

.message-peer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s8);
  flex-wrap: wrap;
}

.message-report-dialog .auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
  margin-top: var(--s16);
  color: var(--label-2);
  font-size: 13px;
}

.message-report-dialog .auth-field select,
.message-report-dialog .auth-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--label);
  font: inherit;
  font-size: 15px;
}

.message-report-dialog .auth-field textarea {
  resize: vertical;
}

.message-report-dialog .auth-field select:focus,
.message-report-dialog .auth-field textarea:focus {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 4px var(--brand-0);
}

.message-composer .searchbar {
  min-width: 0;
}

.message-composer .btn {
  min-width: 88px;
}

.message-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--s8);
}

.notification-center {
  margin-top: var(--s24);
}

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

.notification-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s12) var(--s24);
  margin-top: var(--s16);
}

.ability-chart {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: var(--s24) auto 0;
  overflow: visible;
}

.ability-axes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s12) var(--s24);
  margin-top: var(--s24);
}

.ability-axis {
  min-width: 0;
}

.ability-axis-head,
.ability-axis-value {
  display: flex;
  justify-content: space-between;
  gap: var(--s16);
  align-items: baseline;
}

.ability-axis-head {
  font-size: 13px;
  color: var(--label-2);
}

.ability-axis-value {
  margin-top: var(--s4);
  font-weight: 500;
}

.ability-bar {
  height: 4px;
  margin-top: var(--s8);
  overflow: hidden;
  border-radius: 999px;
  background: var(--hair);
}

.ability-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.ability-items {
  display: grid;
  gap: var(--s12);
  margin-top: var(--s24);
}

.ability-kpis {
  grid-template-columns: 1fr;
  margin-top: var(--s24);
}

.ability-kpis .review-kpi {
  min-width: 0;
}

.ability-kpis .review-kpi b {
  font-size: 34px;
  white-space: nowrap;
}

.ability-item {
  padding-top: var(--s12);
  border-top: 1px solid var(--hair);
}

.ability-item-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s16);
  font-size: 15px;
}

.ability-item-head b {
  flex: none;
  font-weight: 500;
}

.ability-item-head span {
  min-width: 0;
  text-wrap: balance;
}

.exam-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s12);
  align-items: end;
  margin-top: var(--s24);
}

.exam-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--s12);
}

.exam-head .pill {
  white-space: nowrap;
}

.exam-start .account-field {
  margin: 0;
}

.exam-rubric,
.exam-result,
.exam-follow {
  margin-top: var(--s24);
}

.exam-rubric ul {
  display: grid;
  gap: var(--s8);
  margin: var(--s12) 0 0;
  padding-left: 20px;
  color: var(--label-2);
  font-size: 15px;
  line-height: 1.5;
}

.exam-score {
  display: flex;
  align-items: baseline;
  gap: var(--s8);
}

.exam-score b {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.exam-score span {
  color: var(--label-2);
  font-size: 13px;
}

.exam-result p {
  margin-top: var(--s12);
}

.exam-score-list {
  display: grid;
  gap: var(--s8);
  margin: var(--s12) 0 0;
  padding-left: 20px;
  color: var(--label-2);
  font-size: 15px;
  line-height: 1.5;
}

.diagnostic-shell {
  max-width: 900px;
}

.diagnostic-kpis {
  margin-top: var(--s24);
}

.diagnostic-intro .actions,
.diagnostic-quiz .actions,
.diagnostic-result .actions {
  margin-top: var(--s24);
}

.diagnostic-intro > .body {
  margin-top: var(--s16);
}

[data-diagnostic-state] {
  width: fit-content;
  max-width: min(100%, 36em);
  margin-top: var(--s16);
  padding: var(--s8) var(--s16);
}

[data-diagnostic-state] .character-state-icon {
  display: none;
}

.diagnostic-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hair);
}

.diagnostic-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .15s ease;
}

.diagnostic-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s16);
  margin-top: var(--s16);
  color: var(--label-2);
  font-size: 13px;
}

.diagnostic-quiz .h3 {
  margin-top: var(--s24);
}

.diagnostic-options {
  display: grid;
  gap: var(--s8);
  margin-top: var(--s24);
}

.diagnostic-option {
  width: 100%;
  min-height: 44px;
  padding: var(--s16) var(--s24);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--label);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.diagnostic-option:hover {
  border-color: var(--brand-3);
}

.diagnostic-option[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-0);
}

.diagnostic-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s24);
  margin-top: var(--s24);
}

.diagnostic-review-grid .chips {
  margin-top: var(--s12);
}

.diagnostic-choice {
  min-height: 44px;
  padding: 0 var(--s12);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--label);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.diagnostic-choice[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-0);
  color: var(--brand);
}

.diagnostic-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s8);
  margin-top: var(--s12);
}

.diagnostic-custom input {
  min-width: 0;
  height: 44px;
  padding: 0 var(--s12);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--label);
  font: inherit;
  font-size: 15px;
}

.diagnostic-result-head {
  display: flex;
  align-items: baseline;
  gap: var(--s16);
  margin-top: var(--s12);
}

.diagnostic-result-head strong {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.12;
}

.diagnostic-result-head span {
  color: var(--label-2);
  font-size: 15px;
}

.diagnostic-dimensions {
  display: grid;
  gap: var(--s12);
  margin-top: var(--s24);
}

.diagnostic-dimension {
  min-width: 0;
}

.library-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  color: var(--label);
  box-shadow: 0 24px 80px rgb(0 0 0 / .18);
}

.library-dialog::backdrop {
  background: rgb(29 29 31 / .28);
}

.library-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s24);
  padding: var(--s32) var(--s32) var(--s24);
  border-bottom: 1px solid var(--hair);
}

.library-dialog-head .eyebrow {
  margin: 0 0 var(--s8);
}

.library-dialog-body {
  display: grid;
  gap: var(--s24);
  max-height: min(540px, calc(100vh - 220px));
  padding: var(--s24) var(--s32);
  overflow: auto;
}

.library-dialog-body > p {
  margin: 0;
}

.library-dialog-meta,
.library-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s8);
}

.library-dialog-section {
  display: grid;
  gap: var(--s12);
}

.library-dialog-section h3,
.library-dialog-section ul {
  margin: 0;
}

.library-dialog-section ul {
  display: grid;
  gap: var(--s8);
  padding-left: 20px;
  color: var(--label-2);
  font-size: 15px;
  line-height: 1.5;
}

.library-dialog-models {
  display: grid;
  gap: var(--s12);
}

.library-dialog-model {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr);
  gap: var(--s16);
  padding: var(--s12) 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}

.library-dialog-model span {
  color: var(--label-2);
}

.library-dialog-actions {
  padding: var(--s24) var(--s32) var(--s32);
  border-top: 1px solid var(--hair);
}

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

.employer-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s16);
}

.employer-fields[hidden] {
  display: none;
}

.employer-fields .account-field {
  margin-top: 0;
}

.employer-field-full {
  grid-column: 1 / -1;
}

.seg button {
  transition: color .15s ease, transform .15s ease;
}

.seg button:hover:not([aria-selected="true"]) {
  color: var(--label);
}

.carousel-controls button {
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.carousel-controls button:hover {
  border-color: var(--brand-3);
  background: var(--page);
}

.seg button:active,
.chips button:active,
.swatch:active,
.job:active,
.carousel-controls button:active,
.course-phase:active {
  transform: scale(.98);
}

.job,
.course-phase {
  transition: color .15s ease, border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.jobs-list li {
  font-size: 17px;
}

.review-tabs {
  display: flex;
  width: 100%;
}

.review-kpi,
.review-card {
  overflow-wrap: anywhere;
}

@media  (max-width: 600px) {
  .seg,
  .review-tabs,
  .chips {
    max-width: 100%;
  }

  .seg[data-seg="main"] {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .seg[data-seg="main"] button {
    width: 100%;
    min-width: 0;
  }

  .chips > [role="status"] {
    flex-basis: 100%;
    margin: var(--s4) 0 0;
  }

  .tool-library-scroll .spec th:first-child,
  .tool-library-scroll .spec td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 112px;
    background: var(--card);
    white-space: nowrap;
  }

  .tool-library-scroll .spec thead th:first-child {
    z-index: 6;
    background: var(--page);
  }

  .tool-library-scroll .spec th:nth-child(2),
  .tool-library-scroll .spec td:nth-child(2) {
    white-space: nowrap;
  }

  .library-dialog {
    width: calc(100vw - 24px);
  }

  .library-dialog-head {
    padding: var(--s24) var(--s16) var(--s16);
  }

  .library-dialog-body {
    padding: var(--s16) var(--s24);
  }

  .library-dialog-actions {
    padding: var(--s16) var(--s24) var(--s24);
  }

  .library-dialog-model {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }

  .diagnostic-result-head {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--s4);
  }

  .diagnostic-result-head strong {
    font-size: 34px;
  }

  .diagnostic-result-head span {
    white-space: nowrap;
  }

  .retro-filters,
  .retro-facts,
  .message-composer,
  .ability-axes,
  .exam-start,
  .employer-fields,
  .diagnostic-review-grid,
  .notification-types {
    grid-template-columns: 1fr;
  }

  .employer-field-full {
    grid-column: auto;
  }
}

@media  (min-width: 601px) and (max-width: 900px) {
  .retro-filters {
    grid-template-columns: 1fr 1fr;
  }

  .retro-filters .searchbar {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .cell > .spec td:last-child {
    padding-right: var(--s16);
  }
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid ButtonText;
  }
}
