/* Related workspace sections share one canvas, without changing their behavior. */
.screen:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > * {
  box-sizing:border-box;
  width:100%;
  max-width:var(--workspace-layout-width,820px);
  min-width:0;
  margin:0 auto;
}
.screen:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > * + * {
  margin-top:32px;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > .page-title {
  font-size:clamp(32px,3.5vw,44px);
  line-height:1.14;
  overflow-wrap:break-word;
  text-wrap:balance;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > .page-title + .body-copy {
  margin-top:14px;
  font-size:17px;
  line-height:1.7;
  overflow-wrap:anywhere;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > .panel,
.screen--friends > :is(.friend-list,.duel-list) {
  padding:30px;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) :is(.panel,.friend-list,.duel-list,.resume-list) > h2,
.screen--progress > section:not([class]) > h2 {
  margin:0 0 18px;
  font-size:24px;
  line-height:1.3;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) :is(.panel,.friend-list,.duel-list,.resume-list) > p,
.screen--progress > section:not([class]) > p {
  margin:0 0 20px;
  color:var(--muted);
  font-size:14px;
  line-height:1.8;
  overflow-wrap:anywhere;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) :is(.panel,.friend-list,.duel-list,.resume-list) > p:last-child,
.screen--progress > section:not([class]) > p:last-child {
  margin-bottom:0;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) .button-row {
  gap:14px;
  min-width:0;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) .button {
  box-sizing:border-box;
  min-width:0;
  min-height:54px;
  padding:14px 18px;
  line-height:1.45;
  white-space:normal;
  overflow-wrap:anywhere;
}
:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) .form-stack {
  min-width:0;
  gap:22px;
}
:is(.screen--lab,.screen--friends,.screen--profile,.screen--account-form) .form-stack > label:not(.consent) {
  min-width:0;
  gap:10px;
}
:is(.screen--lab,.screen--friends,.screen--profile,.screen--account-form) .input {
  min-width:0;
  min-height:54px;
  max-width:100%;
}
:is(.screen--lab,.screen--friends,.screen--profile,.screen--account-form) .consent {
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin:4px 0;
  font-size:14px;
  line-height:1.7;
}
:is(.screen--lab,.screen--friends,.screen--profile,.screen--account-form) .consent > span {
  min-width:0;
  overflow-wrap:anywhere;
}

/* The Lab keeps file choices, settings, output and privacy at the same width. */
.screen--lab #lab-form {
  width:100%;
  max-width:var(--workspace-layout-width,820px);
  margin-left:auto;
  margin-right:auto;
}
.screen--lab #lab-form > * { min-width:0; }
.screen--lab #lab-form > label:not(.consent) { align-self:start; align-content:start; }
.screen--lab #lab-form > .file-picker-control { width:100%; }
.screen--lab #lab-form .file-picker-button {
  width:100%;
  min-height:80px;
  border-style:dashed;
  background:var(--surface-2);
}
.screen--lab #lab-file-help {
  font-size:12px;
  line-height:1.75;
}
.screen--lab #lab-file-status {
  margin:0;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--page);
  color:var(--muted);
  font-size:13px;
  line-height:1.7;
  overflow-wrap:anywhere;
}
.screen--lab #lab-form > .button,
.screen--lab > .panel > .button {
  width:100%;
}
.screen--lab > .panel[role="status"] > .button {
  margin:4px 0 22px;
}
.screen--lab .lab-results {
  display:grid;
  gap:12px;
  width:100%;
  max-width:none;
  min-width:0;
  margin:24px 0 0;
}
.screen--lab .lab-results > article {
  min-width:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--page);
}
.screen--lab .lab-results > article > strong {
  display:block;
  line-height:1.6;
  overflow-wrap:anywhere;
}
.screen--lab .lab-results > article > p {
  margin:8px 0 0;
  line-height:1.7;
  overflow-wrap:anywhere;
}

/* Scores, skills and resume states form one readable progression page. */
.screen--progress > .xp-summary {
  gap:24px;
  align-items:start;
  grid-template-rows:auto auto auto;
  padding:28px;
}
.screen--progress > .xp-summary > div {
  display:grid;
  align-content:start;
  grid-row:1 / span 3;
  grid-template-rows:subgrid;
  gap:8px;
  min-width:0;
}
.screen--progress > .xp-summary > div:first-child { grid-column:1; }
.screen--progress > .xp-summary > div + div { grid-column:2; padding-left:26px; }
.screen--progress > .xp-summary strong {
  font-size:48px;
  line-height:1.2;
}
.screen--progress > .xp-summary small {
  display:inline-block;
  font-size:13px;
  line-height:1.6;
}
.screen--progress > .xp-summary p { margin:0; line-height:1.7; }
.screen--progress > .prototype-score { margin-top:18px; line-height:1.75; }
.screen--progress > .panel > .button { width:100%; margin-top:4px; }
.screen--progress > .skill-list {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
}
.screen--progress > .skill-list > article {
  min-width:0;
  padding:24px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
}
.screen--progress > .skill-list h2 { margin:0 0 20px; font-size:22px; line-height:1.35; }
.screen--progress > .skill-list progress {
  display:block;
  width:100%;
  height:12px;
  overflow:hidden;
  appearance:none;
  border:0;
  border-radius:999px;
  background:var(--surface-3);
  accent-color:var(--accent);
}
.screen--progress > .skill-list progress::-webkit-progress-bar { border-radius:999px; background:var(--surface-3); }
.screen--progress > .skill-list progress::-webkit-progress-value { border-radius:999px; background:var(--accent); }
.screen--progress > .skill-list progress::-moz-progress-bar { border-radius:999px; background:var(--accent); }
.screen--progress > .skill-list p { margin:14px 0 0; line-height:1.6; }
.screen--progress .resume-method {
  gap:12px;
  margin:16px 0 0;
  padding:22px;
}
.screen--progress .resume-method > :is(strong,span) { min-width:0; line-height:1.6; overflow-wrap:anywhere; }
.screen--progress > .legacy-progress {
  padding:24px 0 0;
  border-top:1px solid var(--line);
}
.screen--progress > .legacy-progress > summary {
  min-height:48px;
  padding:10px 0;
  font-size:16px;
  font-weight:700;
  line-height:1.6;
}
.screen--progress > .legacy-progress[open] > summary { margin-bottom:16px; }
.screen--progress > .legacy-progress > p { margin:0 0 20px; font-size:14px; line-height:1.8; color:var(--muted); }
.screen--progress > .button-row > .button { width:100%; }

/* Invitations and private activity stay visibly separate, including empty states. */
.screen--friends > :is(.friend-list,.duel-list) {
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface);
}
.screen--friends > .button-row { margin-bottom:0; }
.screen--friends > .panel > .invite-code-field { margin-top:24px; }
.screen--friends .invite-code-actions { gap:12px; margin-top:18px; }
.screen--friends .invite-code-actions > .button { flex:1 1 180px; }
.screen--friends #friend-request { gap:20px; margin-top:28px; padding-top:28px; }
.screen--friends #friend-request > .button { width:100%; }
.screen--friends #friend-request + .legal-copy { margin-top:24px; margin-bottom:0; font-size:12px; }
.screen--friends .invite-feedback:not([hidden]) { margin-top:18px; }
.screen--friends .friend-list > article {
  padding:24px 0;
}
.screen--friends .friend-list > article:last-child { padding-bottom:0; }
.screen--friends .friend-list > article h3 { margin:0 0 10px; line-height:1.4; overflow-wrap:anywhere; }
.screen--friends .friend-list > article p { margin:0 0 20px; line-height:1.8; }
.screen--friends .friend-list > .empty-state {
  margin:0;
  padding:24px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:var(--page);
  text-align:left;
}
.screen--friends .duel-row { gap:12px; padding:22px; margin:18px 0 0; }
.screen--friends .duel-row > :is(strong,span) { min-width:0; line-height:1.6; overflow-wrap:anywhere; }

/* Account controls have one geometry; destructive data actions and exit remain distinct. */
.screen--profile > .panel > .button-row { margin-top:24px; }
.screen--profile > .account-data { padding:22px 28px; }
.screen--profile > .account-data > summary {
  min-height:48px;
  padding:10px 0;
  line-height:1.6;
  font-size:17px;
}
.screen--profile > .account-data[open] > summary { margin-bottom:20px; }
.screen--profile > .account-data > p { margin:0 0 24px; line-height:1.8; }
.screen--profile > .account-data > .button { width:100%; }
.screen--profile #delete-form { gap:20px; margin:0; }
.screen--profile #delete-form > .button { width:100%; }
.screen--profile > .session-exit {
  gap:22px;
  padding-top:30px;
}
.screen--profile > .session-exit h2 { margin:0 0 12px; font-size:22px; line-height:1.4; }
.screen--profile > .session-exit p { margin:0; line-height:1.8; }
.screen--profile > .session-exit .button--signout { min-height:54px; }

@media(min-width:760px) {
  .screen--lab #lab-form { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; }
  .screen--lab #lab-form > * { grid-column:1/-1; }
  .screen--lab #lab-form > label:has(select[name="filter"]),
  .screen--lab #lab-form > button[type="submit"] { grid-column:1; }
  .screen--lab #lab-form > label:has(input[name="prefix"]),
  .screen--lab #lab-form > button[data-exp-action="clear-lab"] { grid-column:2; }
  .screen--progress > .skill-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .screen--friends > .button-row,
  .screen--profile > .panel > .button-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .screen--friends .friend-list .button-row { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
}
@media(max-width:650px) {
  .screen:is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > * + * { margin-top:24px; }
  :is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > .page-title + .body-copy { margin-top:14px; font-size:16px; }
  :is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > .panel,
  .screen--friends > :is(.friend-list,.duel-list) { padding:22px; }
  :is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) :is(.panel,.friend-list,.duel-list,.resume-list) > h2,
  .screen--progress > section:not([class]) > h2 { font-size:23px; }
  .screen--progress > .xp-summary { gap:16px; padding:22px; }
  .screen--progress > .xp-summary > div + div { padding-left:18px; }
  .screen--progress > .xp-summary strong { font-size:40px; }
  .screen--progress > .skill-list { gap:16px; }
  .screen--progress > .skill-list > article { padding:22px; }
  .screen--profile > .account-data { padding:18px 22px; }
  .screen--profile > .session-exit { padding-top:26px; }
}
@media(max-width:360px) {
  :is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) > .panel,
  .screen--friends > :is(.friend-list,.duel-list),
  .screen--profile > .account-data { padding:18px; }
  :is(.screen--lab,.screen--progress,.screen--friends,.screen--profile,.screen--account-form) .button { padding-left:14px; padding-right:14px; }
  .screen--progress > .xp-summary { gap:12px; padding:18px; }
  .screen--progress > .xp-summary > div + div { padding-left:14px; }
  .screen--progress > .xp-summary strong { font-size:36px; }
  .screen--friends .invite-code-actions > .button { flex-basis:100%; }
}

/* Account destinations use the same canvas as the account that opens them. */
.screen--account-form > form {
  width:100%;
  max-width:var(--workspace-layout-width,820px);
  margin-left:auto;
  margin-right:auto;
}
.screen--account-form > form > .button { width:100%; }
.screen--account-form > .device-controls { padding:22px; }
.screen--account-form .device-checkboxes { margin:4px 0; gap:16px; }
.screen--account-form .device-checkboxes legend { margin-bottom:18px; }
.screen--account-form .device-checkboxes label { min-width:0; line-height:1.6; }
.screen--account-form .device-checkboxes label > span { min-width:0; overflow-wrap:anywhere; }
@media(max-width:360px) { .screen--account-form .device-checkboxes { grid-template-columns:1fr; } }
