/* Profile progress and achievement controls extend the shared Community layout. */
.profile-workspace .profile-level-detail {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.profile-unlock-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 18px;
  align-items: center;
  padding: 19px 20px;
  margin-block: 0 24px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 7%, var(--surface-solid));
}
.profile-unlock-preview > .eyebrow {
  grid-column: 1;
  margin: 0;
  font-size: .68rem;
}
.profile-unlock-preview h3 {
  grid-column: 1;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
}
.profile-unlock-preview > p:not(.eyebrow) {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  overflow-wrap: anywhere;
}
.profile-unlock-preview > button {
  grid-column: 2;
  grid-row: 1 / 4;
  min-height: 44px;
}
.profile-workspace .achievement-toolbar {
  grid-template-columns: minmax(0, 1.2fr) minmax(125px, .8fr) minmax(125px, .8fr);
}
.profile-workspace .achievement-toolbar input,
.profile-workspace .achievement-toolbar select {
  min-width: 0;
  min-height: 44px;
}
.profile-achievement-total {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 5px;
  background: var(--line);
  accent-color: var(--red);
  overflow: hidden;
}
.profile-achievement-total::-webkit-progress-bar { background: var(--line); border-radius: 5px; }
.profile-achievement-total::-webkit-progress-value { background: var(--red); border-radius: 5px; }
.profile-achievement-total::-moz-progress-bar { background: var(--red); border-radius: 5px; }
.achievement-reset { margin: 0 0 5px; min-height: 44px; }
.achievement-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; }
.achievement-card-meta .achievement-mark { margin-bottom: 12px; }
.achievement-category { margin-bottom: 12px; font-size: .7rem; font-weight: 700; color: var(--muted); }
.achievement-details { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 2px; }
.achievement-details summary { display: list-item; min-height: 44px; padding-block: 12px 9px; font-size: .76rem; font-weight: 750; line-height: 1.4; cursor: pointer; }
.achievement-details > p { margin-block: 8px; font-size: .78rem; }
.achievement-details > a { display: inline-flex; align-items: center; min-height: 44px; font-size: .78rem; color: var(--red); }
.achievement-details > a:hover { text-decoration: underline; }
.achievement-earned-date { font-variant-numeric: tabular-nums; }
.achievement-tracked-label { margin-bottom: 12px; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--red); font-size: .69rem; font-weight: 750; }
.profile-level-roadmap { margin-block: 0 25px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.profile-level-roadmap > summary { min-height: 44px; padding-block: 11px; font-size: .9rem; font-weight: 750; cursor: pointer; }
.profile-level-steps { display: grid; gap: 10px; padding: 0; margin-block: 16px 7px; list-style: none; }
.profile-level-steps > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding: 13px 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: .83rem; }
.profile-level-steps > li > strong { grid-column: 1; grid-row: 1 / 3; }
.profile-level-steps > li > span:not(.profile-roadmap-unlock), .profile-level-steps > li > small { grid-column: 2; text-align: right; font-variant-numeric: tabular-nums; }
.profile-level-steps small { color: var(--muted); font-size: .75rem; }
.profile-roadmap-unlock { grid-column: 1 / -1; margin-top: 6px; color: var(--red); font-size: .76rem; font-weight: 750; overflow-wrap: anywhere; }
.profile-tracked-goals { display: grid; gap: 12px; margin-block: 22px 28px; }
.profile-tracked-goals > .profile-section-heading { margin-block: 0; }
.profile-tracking-hint { color: var(--muted); font-size: .81rem; line-height: 1.6; margin-block: 6px 10px; }
.profile-tracked-goal { border-inline-start: 3px solid var(--red); }
.profile-track-goal { min-height: 44px; margin-top: 12px; }
.profile-tracked-goal > .profile-track-goal { display: flex; }
.profile-goal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-goals-status:not(:empty) { margin: 0; padding: 12px 15px; border-left: 3px solid var(--red); border-radius: 0 6px 6px 0; background: var(--surface-2); font-size: .82rem; line-height: 1.6; }
.profile-public-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-block: 18px; }
.profile-earned-badge { min-width: 0; padding: 17px; border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--gold) 6%, var(--surface-solid)); overflow-wrap: anywhere; }
.profile-earned-badge > .achievement-category { display: block; margin-bottom: 9px; }
.profile-earned-badge > h4 { margin: 0 0 8px; font-size: .95rem; line-height: 1.4; }
.profile-earned-badge > p { margin: 0; font-size: .8rem; color: var(--muted); }
.profile-collection-overview { margin-block: 25px; }
.profile-collection-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-block: 17px; }
.profile-collection-category { display: grid; gap: 6px; min-width: 0; min-height: 92px; padding: 14px; text-align: left; font: inherit; line-height: 1.4; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.profile-collection-category:hover { border-color: var(--red); }
.profile-collection-category > strong { font-size: .83rem; }
.profile-collection-category > span { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-collection-category > progress { display: block; width: 100%; height: 6px; accent-color: var(--red); }
.profile-public-collection .profile-collection-category { min-height: 66px; }
.profile-xp-sources { display: grid; gap: 14px; margin-block: 20px 25px; }
.profile-xp-sources > h4 { margin: 0; font-size: .88rem; }
.profile-xp-sources > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; font-size: .78rem; }
.profile-xp-sources strong { min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.profile-xp-sources span { color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-xp-sources progress { grid-column: 1 / -1; display: block; width: 100%; height: 8px; accent-color: var(--red); }
.profile-xp-detail summary { min-height: 44px; padding-block: 10px; font-size: .8rem; font-weight: 650; cursor: pointer; }
.profile-xp-detail p { margin-block: 4px 10px; font-size: .76rem; line-height: 1.6; }
@media (max-width: 680px) {
  .profile-workspace .achievement-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-workspace .achievement-toolbar > label:first-child { grid-column: 1 / -1; }
  .profile-unlock-preview { padding: 17px; grid-template-columns: 1fr; gap: 6px; }
  .profile-unlock-preview > button { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
}
@media (max-width: 460px) {
  .profile-public-badges { grid-template-columns: 1fr; }
  .profile-level-steps > li { padding: 12px; gap: 4px 8px; }
  .profile-goal-actions > button { flex: 1 1 100%; }
}
@media (forced-colors: active) {
  .profile-unlock-preview, .achievement-details { border-color: CanvasText; }
}

@media (max-width: 540px) {
  .profile-tabs { display: grid; grid-template-columns: .85fr 1.25fr 1fr; gap: 4px; padding: 4px; overflow: visible; }
  .profile-tabs[data-tab-count="2"] { grid-template-columns: 1fr 1.3fr; }
  .profile-tab { min-width: 0; min-height: 44px; padding: 10px 6px; white-space: normal; font-size: .76rem; line-height: 1.4; }
  .profile-collection-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .profile-collection-category { padding: 12px; min-height: 86px; }
  .profile-xp-sources > div { grid-template-columns: 1fr; gap: 4px; }
  .profile-xp-sources span { grid-column: 1; }
}

/* A compact list remains a semantic collection of achievement articles. */
.profile-workspace .member-metrics { margin-inline: 0; }
.profile-workspace .member-metrics dt { font-size: .76rem; color: var(--muted); }
.profile-workspace .member-metrics dd { margin: 0; font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.achievement-layout-controls { display: flex; flex-wrap: wrap; gap: 5px; margin-block: 12px; }
.achievement-layout-controls > button { min-width: 72px; min-height: 44px; }
.profile-workspace .achievement-grid[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line-strong); }
.profile-workspace .achievement-grid[data-layout="list"] > .achievement-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .38fr); align-items: start; gap: 5px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 15px; }
.profile-workspace .achievement-grid[data-layout="list"] > .achievement-card:last-child { border-bottom: 0; }
.achievement-grid[data-layout="list"] .achievement-card-meta { grid-column: 1 / -1; justify-content: flex-start; gap: 8px; }
.achievement-grid[data-layout="list"] .achievement-card-meta :is(.achievement-mark, .achievement-category, .achievement-tracked-label) { margin: 0; }
.achievement-grid[data-layout="list"] .achievement-mark { width: 23px; height: 23px; font-size: 1rem; }
.achievement-grid[data-layout="list"] .achievement-card > h4 { grid-column: 1; grid-row: 2; margin: 0; }
.achievement-grid[data-layout="list"] .achievement-card > p { grid-column: 1; grid-row: 3; margin: 0; }
.achievement-grid[data-layout="list"] .achievement-card > progress { grid-column: 2; grid-row: 2; margin: 3px 0 0; }
.achievement-grid[data-layout="list"] .achievement-card > small { grid-column: 2; grid-row: 3; font-variant-numeric: tabular-nums; }
.achievement-grid[data-layout="list"] .achievement-details { grid-column: 1 / -1; margin-top: 3px; }
.profile-workspace .achievement-grid > .profile-empty { grid-column: 1 / -1; }

/* Square borders and shaded headings follow the classic Community board. */
body.community-classic .profile-workspace :is(.member-avatar, .member-progress, .profile-tabs, .profile-tab, .member-metrics > div, .profile-unlock-preview, .profile-goal, .profile-badge-chip, .achievement-card, .achievement-mark, .achievement-tracked-label, .theme-choice, .theme-swatch, .profile-level-steps > li, .profile-earned-badge, .profile-collection-category, .profile-empty, .profile-goals-status) { border-radius: 0; box-shadow: none; }
body.community-classic .compact-profile-progress .member-progress { border-radius: 0; }
body.community-classic .profile-workspace .member-profile-identity { padding: 13px; margin: 0 0 12px; gap: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); }
body.community-classic .profile-workspace .member-profile-identity h3 { font-size: 1.15rem; }
body.community-classic .profile-workspace .member-profile-identity p { margin-block: 4px; font-size: .82rem; line-height: 1.5; }
body.community-classic .profile-workspace .member-progress { padding: 12px 14px; margin-block: 12px; border-color: var(--line-strong); }
body.community-classic .profile-workspace .member-progress-label strong { font-size: 1.2rem; }
body.community-classic .profile-workspace .member-profile-actions { margin-block: 12px; }
body.community-classic .profile-workspace .profile-tabs { gap: 3px; padding: 3px; margin-block: 15px; border-color: var(--line-strong); }
body.community-classic .profile-workspace .profile-tab { border-color: var(--line); padding: 8px 12px; }
body.community-classic .profile-workspace .profile-section-heading { margin-block: 8px 12px; padding: 8px 10px; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: .9rem; }
body.community-classic .profile-workspace .member-metrics { gap: 0; border: 1px solid var(--line-strong); }
body.community-classic .profile-workspace .member-metrics > div { padding: 10px 12px; border: 1px solid var(--line); }
body.community-classic .profile-workspace .member-metrics dd { font-size: 1.15rem; }
body.community-classic .profile-workspace :is(.profile-goal, .profile-unlock-preview, .profile-earned-badge) { padding: 13px; border-color: var(--line-strong); }
body.community-classic .profile-workspace .profile-collection-categories { gap: 0; border: 1px solid var(--line-strong); }
body.community-classic .profile-workspace .profile-collection-category { min-height: 78px; padding: 11px; gap: 4px; border-color: var(--line); }
body.community-classic .profile-workspace .profile-public-collection .profile-collection-category { min-height: 62px; }
body.community-classic .profile-workspace .achievement-card { border-color: var(--line-strong); }
body.community-classic .profile-workspace .achievement-details summary { font-size: .81rem; }
body.community-classic .profile-workspace progress { border-radius: 0; }
body.community-classic .profile-workspace progress::-webkit-progress-bar,
body.community-classic .profile-workspace progress::-webkit-progress-value { border-radius: 0; }
body.community-classic .profile-workspace progress::-moz-progress-bar { border-radius: 0; }

@media (max-width: 620px) {
  .profile-workspace .achievement-grid[data-layout="list"] > .achievement-card { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; }
  .achievement-grid[data-layout="list"] .achievement-card > :is(h4, p, progress, small) { grid-column: 1; grid-row: auto; }
  body.community-classic .profile-workspace .profile-tab { padding-inline: 6px; }
}
