/* Shared typography and layout. No browser zoom or scaling transforms. */
:root { --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-bold: 650; }
[data-theme="light"] { --green: #14723e; --orange: #9a3412; }
[data-theme="dark"] { --btn-primary-bg: #1d4ed8; --btn-primary-bg-hover: #1e40af; }
[data-theme="dark"] .pill.captain { color: #93c5fd; }
.btn-primary > span, #view .btn-primary > .muted { color: var(--btn-primary-fg) !important; }
body { font-size: 16px; line-height: 1.55; }
input, select, textarea, button { font-family: inherit; }
.content { min-width: 0; padding: 28px clamp(16px, 2.5vw, 40px) 48px; }
.card { padding: 24px; margin-bottom: 20px; border-radius: 12px; }
.card h3, .challenge-card h4 { font-size: 20px; line-height: 1.35; }
.btn, .btn-sm, .btn-small, .subtab { font-size: var(--ui-control-font,14px); min-height: var(--ui-control-height,40px); padding: var(--ui-control-padding,8px 14px); white-space: normal; line-height: 1.4; }
.field label, .field > span, label, .admin-input, input, select, textarea { font-size: var(--ui-input,15px); line-height: 1.5; }
input:not([type=checkbox]):not([type=radio]), select { min-height: var(--ui-control-height,42px); }
#view :is(input, select, textarea) { font-size: var(--ui-input,15px); }
#view .muted { font-size: var(--ui-small,14px) !important; }
.play-runtime-kicker { font-size: 14px; }
.play-runtime-idle p { font-size: 16px; line-height: 1.6; }
.field { min-width: 0; }
.row { row-gap: 12px; }
.pill, .badge, .status-indicator, .timer-label, .stat-label, .muted { font-size: var(--ui-small,14px); line-height: 1.5; }
.pill { padding: 3px 8px; }
#view :is(small, .play-card-badge, .play-filter-label, .play-reasons, .play-card-tags, .play-card-meta, .play-selection-strip > span, .play-detail-head code, .play-objectives > span, .play-detail-taxonomy > span, .play-detail-head > div > span) { font-size: var(--ui-small,14px); line-height: 1.5; }
#view :is(.play-challenge-card, .chal-card) code { font-size: 14px !important; overflow-wrap: anywhere; }
.play-stats-strip, .play-cat, .play-cat span, .catalog-results-head, .catalog-pagination span, .catalog-filter-group > span, .catalog-field > span, .chal-card-footer { font-size: 14px; }
.play-card-top b, .chal-card h3, .play-selection-strip strong, .play-reco-head h3 { font-size: 18px; font-weight: 650; line-height: 1.4; }
.play-card-top { flex-wrap: wrap; }
.play-card-badge { border: 0; padding: 0; background: transparent; }
.play-card-description, .chal-desc, .play-detail-description { font-size: 16px; line-height: 1.6; }
.play-card-meta .pill, .play-card-tags .pill, .play-detail-meta .pill { font-size: 13px !important; }
.play-challenge-card { padding: 20px; gap: 12px; border-radius: 10px; min-width: 0; }
.play-challenge-section h3 { font-size: 14px; padding-bottom: 12px; margin-bottom: 16px; }
.play-challenge-grid, .cat-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.play-reco-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 18px; margin-bottom: 28px; }
.play-reco-grid .play-challenge-card { min-width: 0; }
.play-reco-head { flex-wrap: wrap; margin: 18px 0 14px; }
.play-picker-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
.play-category-rail { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; gap: 8px; }
.play-cat { width: auto; min-width: 0; padding: 9px 12px; border-color: var(--border); min-height: 42px; }
.play-challenge-browser { max-height: none; overflow: visible; padding: 0; }
.play-picker-layout .play-detail-panel { grid-column: auto; padding: 22px; max-height: none; overflow: visible; position: static; }
.play-detail-head { flex-wrap: wrap; }
.play-detail-head h3 { font-size: 22px; line-height: 1.3; }
.play-objectives li { font-size: 16px; line-height: 1.6; margin-bottom: 10px; }
.play-filterbar { grid-template-columns: 1fr 1fr; gap: 18px; }
.play-filterline.wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 220px; }
.play-selection-strip { grid-template-columns: auto minmax(0, 1fr) auto; padding: 16px; }
.play-selection-strip small { font-size: 14px; }
.play-launchbar { gap: 16px; padding: 18px 0; }
.play-detail-grid { gap: 10px; }
table { font-size: 15px; }
th, td { padding: 12px 14px; line-height: 1.5; }
thead th { font-size: 13px; }
.table-wrapper { overflow-x: auto; }
.table-wrapper:focus-visible { outline: 3px solid var(--text-primary); outline-offset: 3px; }
.topbar { min-height: 72px; flex-wrap: wrap; height: auto; gap: 12px; padding: 12px 20px; }
.topbar-right { flex-wrap: wrap; }
.nav-burger { min-width: 44px; min-height: 44px; font-size: 22px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1000; background: var(--bg-card); color: var(--text-primary); padding: 12px 18px; border: 2px solid var(--primary); }
.skip-link:focus { top: 12px; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--text-primary); outline-offset: 3px; }
/* Players have direct links; administrators navigate areas and entity pages. */
.sidebar { width: 246px; align-self: flex-start; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.sidebar .nav-rail { width: 100%; min-height: calc(100vh - 72px); padding: 20px 12px; gap: 18px; }
.sidebar .nav-sub { display: none !important; }
.sidebar.collapsed { display: none; }
.navigation-role { padding: 0 12px 16px; border-bottom: 1px solid var(--border); }
.navigation-role strong { display: block; font-size: 16px; }
.navigation-role span { display: block; font-size: 13px; color: var(--text-muted); }
.navigation-group { display: grid; gap: 3px; }
.navigation-group > h2, .navigation-group > summary { color: var(--text-muted); font-size: 13px; font-weight: 650; letter-spacing: .03em; margin: 0; padding: 5px 12px; }
.navigation-group > summary { cursor: pointer; min-height: 40px; }
.navigation-group .sub-btn { display: block; width: 100%; font-size: 15px; min-height: 42px; padding: 10px 12px; line-height: 1.4; }
.navigation-group .sub-btn.active { box-shadow: inset 3px 0 0 var(--primary); font-weight: 650; }
.admin-sidebar .nav-rail { gap: 6px; padding: 20px 12px; }
.admin-sidebar .navigation-role { margin-bottom: 16px; }
.admin-nav-link { display:flex; align-items:center; gap:12px; color:var(--text-helper); font-size:15px; font-weight:550; min-height:48px; padding:12px; border-radius:8px; text-decoration:none; line-height:1.35; }
.admin-nav-link svg { flex-shrink:0; }
.admin-nav-link:hover { background:var(--btn-bg-hover); color:var(--text-primary); }
.admin-nav-link.active { background:var(--blue-bg); color:var(--text-primary); box-shadow:inset 3px 0 0 var(--primary); font-weight:700; }
.navigation-tools-label { margin:20px 12px 5px; color:var(--text-muted); font-size:12px; text-transform:uppercase; letter-spacing:.07em; }
.admin-nav-utility { margin-top:20px; border-top:1px solid var(--border); border-radius:0; }
.entity-breadcrumbs { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:14px; color:var(--text-muted); margin-bottom:12px; }
.entity-breadcrumbs a { color:var(--text-helper); text-underline-offset:4px; padding:4px 0; }
.entity-breadcrumbs [aria-current] { color:var(--text-primary); }
.admin-section-nav,.entity-tabs { display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--border); margin:24px 0; }
.admin-section-nav { margin-bottom:0; }
.admin-section-nav a,.entity-tabs a { display:block; text-decoration:none; color:var(--text-helper); padding:12px 16px; min-height:46px; border-bottom:3px solid transparent; }
.admin-section-nav a:hover,.entity-tabs a:hover { background:var(--btn-bg-hover); }
.admin-section-nav [aria-current],.entity-tabs [aria-current] { color:var(--text-primary); border-color:var(--primary); font-weight:700; }
.entity-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:24px; }
.entity-toolbar h2 { font-size:22px; margin:0 0 6px; }
.entity-toolbar p { color:var(--text-helper); margin:0; }
.entity-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.entity-detail-actions { margin:0 0 24px; }
.entity-filters { display:flex; align-items:flex-end; gap:16px; flex-wrap:wrap; margin-bottom:24px; }
.entity-filters .field { margin:0; display:grid; gap:6px; flex:1; min-width:200px; }
.entity-filters .field:first-child { flex:2; }
.entity-filters input,.entity-filters select { width:100%; }
.entity-filters>p { margin:0; padding:12px 0; }
.entity-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr)); gap:18px; }
.entity-card { display:flex; flex-direction:column; gap:14px; padding:24px; min-width:0; border:1px solid var(--border); background:var(--bg-card); border-radius:12px; color:var(--text-primary); text-decoration:none; transition:border-color .15s,box-shadow .15s; }
.entity-card:hover { border-color:var(--primary); box-shadow:0 3px 12px #0000000c; }
.entity-card h3 { font-size:21px; line-height:1.35; margin:0; overflow-wrap:anywhere; }
.entity-card p { color:var(--text-helper); font-size:15px; line-height:1.55; margin:0; }
.entity-card-top,.entity-card-bottom { display:flex; gap:12px; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.entity-card-bottom { margin-top:auto; padding-top:14px; border-top:1px solid var(--border); font-size:14px; }
.entity-card-bottom>span { color:var(--text-muted); }
.entity-eyebrow { font-size:13px; color:var(--text-muted); font-weight:650; }
.entity-excerpt { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.entity-status { border:1px solid var(--border); border-radius:20px; padding:4px 10px; font-size:13px; font-weight:600; background:var(--bg-panel); white-space:nowrap; }
.entity-status.status-active { color:var(--text-primary); border-color:var(--primary); background:var(--blue-bg); }
.entity-pagination { display:flex; justify-content:center; margin-top:24px; }
.entity-pagination [hidden] { display:none; }
.entity-empty { grid-column:1/-1; padding:32px; text-align:center; background:var(--bg-card); border:1px dashed var(--border); border-radius:12px; }
.entity-empty p { color:var(--text-helper); margin-top:10px; }
.entity-empty .entity-actions { justify-content:center; margin-top:20px; }
.entity-detail-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:24px; }
.entity-detail-grid h2,.entity-league-settings h2 { font-size:22px; margin-bottom:18px; }
.entity-detail-grid .card { min-width:0; }
.entity-statement ol { padding-left:24px; line-height:1.7; }
.entity-prose { white-space:pre-wrap; line-height:1.7; overflow-wrap:anywhere; }
.entity-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:0 0 24px; }
.entity-stats a { padding:22px; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; text-decoration:none; color:var(--text-primary); display:grid; gap:8px; }
.entity-stats a:hover { border-color:var(--primary); }
.entity-stats strong { font-size:32px; line-height:1.2; }
.entity-stats span { color:var(--text-helper); }
.entity-facts { display:grid; gap:16px; margin-bottom:20px; }
.entity-facts dt { color:var(--text-muted); font-size:14px; margin-bottom:4px; }
.entity-facts dd { margin:0; overflow-wrap:anywhere; font-weight:550; }
.entity-checklist { padding-left:24px; margin:0 0 20px; }
.entity-checklist li { padding:8px 0; }
.entity-checklist a { color:var(--text-primary); text-underline-offset:4px; }
.entity-hint { font-size:14px; color:var(--text-helper); padding-top:16px; }
.entity-hint a,.entity-empty a { color:var(--text-primary); text-underline-offset:4px; }
.entity-league-meta { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:24px; color:var(--text-helper); }
.entity-league-settings { margin-top:32px; }
.entity-danger { padding:18px 0; margin-top:20px; border-top:1px solid var(--border); }
.entity-danger summary { cursor:pointer; color:var(--text-helper); min-height:40px; padding:8px 0; }
.entity-danger p { margin:12px 0 16px; }
.entity-danger .btn { margin-right:10px; }
.entity-table th,.entity-table td { padding:16px; font-size:15px; }
.entity-pending { color:var(--text-helper); font-style:italic; }
#challenge-assignment select { width:100%; margin:10px 0 16px; }
.scoped-test .play-context-control { display:none; }
@media (max-width:1100px) { .entity-detail-grid { grid-template-columns:1fr; } }
@media (max-width:600px) { .entity-stats { gap:10px; } .entity-stats a { padding:14px 10px; } .entity-stats strong { font-size:26px; } .entity-stats span { font-size:13px; } .entity-card { padding:20px; } .entity-tabs a,.admin-section-nav a { padding:12px 10px; font-size:14px; } }
.view-heading { margin-bottom: 24px; }
.view-heading > span { font-size: 13px; color: var(--text-muted); }
.view-heading h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.025em; }
.view-heading p { margin: 0; color: var(--text-helper); max-width: 70ch; }
.control-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.control-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.control-card:hover { border-color: var(--primary); }
.control-card b { font-size: 21px; }
.control-card span { color: var(--text-helper); }
.control-card small { margin-top: auto; color: var(--text-muted); }
.control-status { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.control-status > span { padding: 12px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.guide-layout { max-width: 1000px; }
.guide-layout p { max-width: 75ch; }
.guide-layout h2 { font-size: 24px; margin-bottom: 12px; }
.guide-layout ol, .guide-layout ul { padding-left: 24px; }
.guide-layout li { margin-bottom: 10px; }
.guide-layout a { color: var(--text-primary); text-underline-offset: 3px; }
.guide-sections { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.guide-step-count { color: var(--text-muted); font-size: 14px; }
.guide-step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.an-toolbar { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.an-toolbar-copy b { font-size: 20px; }
.an-toolbar-copy span, .an-field label { font-size: 14px; line-height: 1.5; }
.an-toolbar-controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; min-width: 0; width: 100%; gap: 14px; }
.an-field, .an-field-wide { min-width: 0; }
.an-toolbar-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.an-toolbar-status small { white-space: normal; }
.an-coverage { margin: 12px 0 24px; color: var(--text-helper); font-size: 15px; }
.an-overview { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 20px; }
.an-overview-main h2 { font-size: 26px; }
.an-health-grid { gap: 14px; }
.an-health-card { padding: 18px; }
.an-health-card b, .an-kpis .stat-value { font-size: 28px; line-height: 1.4; }
.an-health-card span, .an-health-card em, .an-structure-line, .an-eyebrow, .an-kpis .stat-label, .an-kpis .stat-hint, .an-leader-label, .an-leader > span:last-child, .an-grid .an-sub, .an-empty span, .an-eff-list span { font-size: 14px; line-height: 1.5; white-space: normal; }
.an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.an-kpis .kpi, .an-leader { padding: 18px; }
.an-leader b, .an-empty b { font-size: 17px; line-height: 1.4; }
.an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 18px; }
.an-grid .card { min-width: 0; min-height: 340px; padding: 22px; }
.an-grid .an-h { flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.an-grid .an-h h3 { font-size: 19px; line-height: 1.4; }
.an-grid .chart.sm { height: 260px; min-height: 260px; }
.an-grid .table-wrapper { max-height: 360px; }
.an-grid table { font-size: 14px; }
.an-grid th, .an-grid td { padding: 10px 12px; }
@media (max-width: 1350px) {
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .play-picker-layout { grid-template-columns: minmax(0, 1fr); }
  .play-picker-layout .play-detail-panel { grid-column: 1; }
}
@media (max-width: 860px) {
  .an-toolbar-controls { grid-template-columns: 1fr 1fr; }
  .an-grid { grid-template-columns: minmax(0, 1fr); }
  .an-grid .span-2 { grid-column: auto; }
  .an-health-grid, .an-leaders { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: var(--topbar-height, 72px) auto 0 0; width: min(300px, calc(100vw - 32px)); max-height: calc(100vh - var(--topbar-height, 72px)); }
  .sidebar.expanded, .sidebar.collapsed.expanded { display: flex; }
  .sidebar .nav-rail { min-height: 100%; }
  .play-filterbar, .catalog-controls { grid-template-columns: 1fr; }
  .play-filterline.wide { grid-template-columns: minmax(0, 1fr); }
  .play-selection-strip { grid-template-columns: 1fr; }
  .play-selection-strip small { text-align: left; }
  .content { padding: 20px 16px 40px; }
  .card { padding: 18px; }
  .play-category-rail { order: 1; }
  .play-challenge-browser { order: 2; max-height: none; }
  .play-picker-layout .play-detail-panel { order: 3; }
}
@media (max-width: 520px) {
  .an-toolbar-controls, .an-kpis { grid-template-columns: minmax(0, 1fr); }
  .an-toolbar-copy { min-width: 0; }
  .control-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 10px 12px; }
  .logo-acdc { max-width: 140px; height: auto; }
  #user-chip { max-width: 100%; font-size: 13px; }
  .topbar-right { gap: 6px; }
  .play-reco-grid { display: grid; overflow: visible; }
  .play-filterline .row { flex-wrap: wrap; }
  .play-challenge-card { padding: 18px; }
  .play-selection-strip { overflow-wrap: anywhere; }
  .btn { max-width: 100%; }
  .catalog-search { grid-column: auto; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .sidebar, .topbar, .skip-link, .guide-step-actions, .guide-sections { display: none !important; }
  .guide-layout { max-width: none; }
  .card { break-inside: avoid; }
  body { color: #000; background: #fff; }
}
.studio-layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:24px; align-items:start; }
.studio-layout a:not(.btn) { color:var(--text-primary); text-underline-offset:4px; }
.classroom-topbar-help { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--border); border-radius:8px; color:var(--text-primary); text-decoration:none; font-weight:650; }
.guide-progress-control { margin:24px 0; padding:16px; border:1px solid var(--border); border-radius:10px; }
.guide-progress-control label { display:flex; gap:10px; align-items:center; }
.guide-progress-control p { font-size:14px; margin-top:8px; }
.studio-sidebar { position:sticky; top:24px; min-width:0; }
.studio-project-heading, .studio-name-row, .studio-toolbar, .studio-file-bar, .studio-editor-footer, .studio-version, .studio-version-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.studio-project-heading { justify-content:space-between; }
.studio-project-heading h2 { font-size:19px; margin:0; }
.studio-sidebar > p, .studio-sidebar > a { font-size:14px; line-height:1.5; }
.studio-project { display:block; width:100%; padding:16px; margin:10px 0; text-align:left; border:1px solid var(--border); border-radius:10px; background:var(--bg-card); color:var(--text); cursor:pointer; }
.studio-project strong { display:block; font-size:16px; overflow-wrap:anywhere; }
.studio-project span { display:block; margin-top:6px; font-size:13px; line-height:1.5; color:var(--text-muted); }
.studio-project.selected, .studio-file.selected { border-color:var(--blue); box-shadow:inset 3px 0 0 var(--blue); }
#studio-workspace { min-width:0; }
.studio-main { padding:24px; }
.studio-name-row { margin-bottom:16px; }
.studio-name-row .field { flex:1; min-width:200px; margin:0; }
.studio-name-row input { width:100%; font-size:20px; min-height:48px; }
.studio-toolbar .btn { min-height:42px; font-size:14px; }
.studio-save-status { min-height:24px; font-size:14px; }
.studio-file-bar { border:1px solid var(--border); border-radius:10px 10px 0 0; padding:8px; gap:8px; background:var(--bg-page); }
#studio-files { display:flex; flex:1; min-width:0; flex-wrap:wrap; gap:4px; }
.studio-file { font:14px/1.5 monospace; padding:10px 14px; border:1px solid transparent; color:var(--text); background:transparent; border-radius:6px; cursor:pointer; max-width:100%; overflow-wrap:anywhere; }
.studio-code { min-width:0; border:1px solid var(--border); border-top:0; }
.studio-code .CodeMirror { font:15px/1.65 'JetBrains Mono',monospace; min-height:360px; }
#studio-code { width:100%; min-height:420px; font:15px/1.65 monospace; resize:vertical; color:var(--text); background:var(--bg-card); padding:16px; border:0; }
.studio-editor-footer { justify-content:space-between; font-size:13px; padding:10px 0; color:var(--text-muted); }
.studio-help, .studio-team-versions { border-top:1px solid var(--border); margin-top:20px; padding-top:16px; }
.studio-help summary, .studio-team-versions summary { cursor:pointer; min-height:44px; font-size:15px; font-weight:600; }
.studio-help li, .studio-help p { font-size:15px; line-height:1.7; margin-bottom:10px; }
.studio-version { padding:18px 0; border-bottom:1px solid var(--border); justify-content:space-between; }
.studio-version strong { font-size:17px; margin-right:10px; overflow-wrap:anywhere; }
.studio-version p { font-size:14px; margin:8px 0 0; }
.studio-empty { padding:40px; }
.studio-empty p { font-size:17px; line-height:1.7; max-width:700px; }
.studio-empty a { margin-left:16px; }
.studio-add-file { display:flex; flex-wrap:wrap; gap:10px; align-items:end; padding:16px 0; }
.studio-add-file label { display:grid; gap:6px; flex:1; }
.studio-add-file input { width:100%; }
@media (max-width:1150px) {
  .studio-layout { grid-template-columns:minmax(0,1fr); gap:20px; }
  .studio-sidebar { position:static; }
  #studio-projects { display:flex; flex-wrap:wrap; gap:10px; max-height:230px; overflow:auto; }
  .studio-project { width:calc(50% - 5px); margin:0; }
  .studio-sidebar > a { display:inline-block; margin-top:10px; }
}
@media (max-width:600px) {
  .studio-main { padding:14px; }
  .studio-project { width:100%; }
  .studio-empty { padding:22px; }
  .studio-empty a { display:block; margin:16px 0 0; }
  .studio-version-actions { gap:8px; }
  .studio-code .CodeMirror { font-size:14px; }
}

/* Personal results stay readable at laptop and mobile widths. */
.results-toolbar {display:flex;align-items:end;gap:18px;flex-wrap:wrap;margin:24px 0}
.results-toolbar label {display:grid;gap:8px;flex:1;min-width:200px}
.results-metrics {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:20px}
.results-stat {display:flex;flex-direction:column;gap:12px}
.results-stat>strong {font-size:38px;line-height:1.15;color:var(--text-primary)}
.results-stat p {margin:0;color:var(--text-helper)}
.results-rule {padding:16px 0;line-height:1.65;max-width:100ch}
.results-columns {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:20px}
.results-ranking {list-style:none;padding:0;margin:16px 0}
.results-ranking li {display:grid;grid-template-columns:36px 1fr auto;align-items:center;gap:14px;padding:14px 10px;border-bottom:1px solid var(--border)}
.results-ranking li.is-own {background:var(--bg-page);border-left:3px solid var(--primary)}
.results-ranking small {display:block;color:var(--text-helper);font-size:14px;margin-top:4px}
.results-position {font-size:20px}
.results-section-head {display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.results-runs article {display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--border);flex-wrap:wrap}
.results-runs article>div {flex:1;min-width:min(100%,260px)}
.results-runs article strong {font-size:17px;overflow-wrap:anywhere}
.results-runs article p {margin:8px 0 0;color:var(--text-helper);font-size:14px;line-height:1.6}
.results-empty {padding:20px 0;color:var(--text-helper);line-height:1.7}
#tab-performance>.card {margin-top:20px}

.play-context-control {margin-bottom:24px;max-width:760px}
.play-context-control label {display:block;font-weight:600;margin-bottom:8px}
.play-context-control p {margin:10px 0;line-height:1.6}

.results-section-head a:not(.btn) {color:var(--text-primary);text-underline-offset:4px}
.results-ranking li>span {overflow-wrap:anywhere;min-width:0}

#tab-play>.page-head {display:none}
.play-launch-status:empty {display:none}
/* Preparation, statements and nomination share one player CTF page. */
.ctf-player-picker { margin-bottom: 20px; }
.ctf-player-picker label, .ctf-player-nomination label { display: block; margin-bottom: 8px; font-weight: 650; }
.ctf-player-picker select { width: 100%; min-height: 44px; }
.ctf-player-summary { padding: 24px; }
.ctf-player-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ctf-player-heading h3, .ctf-player-heading h4 { margin: 0; font-size: 22px; line-height: 1.35; }
.ctf-player-heading p { margin: 0 0 8px; }
.ctf-player-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; padding: 20px 0; }
.ctf-player-facts span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.ctf-player-facts b { display: block; color: var(--text); font-size: 17px; line-height: 1.5; margin-bottom: 4px; }
.ctf-player-nomination { border-top: 1px solid var(--border); padding: 16px 0; }
.ctf-player-nomination h4 { font-size: 18px; margin: 8px 0; }
.ctf-player-nomination select { width: 100%; margin-bottom: 12px; min-height: 44px; }
.ctf-player-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ctf-player-statements-title { margin: 28px 0 8px; }
.ctf-player-statements { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,340px),1fr)); gap: 16px; }
.ctf-player-statements .card { padding: 22px; }
.ctf-player-statements h4 { font-size: 19px; }
.ctf-player-statements p, .ctf-player-statements li, .ctf-player-summary p { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; }
@media(max-width:600px) { .ctf-player-facts { grid-template-columns: 1fr; gap: 12px; } .ctf-player-summary { padding: 18px; } }

.control-task-title { font-size:22px; margin:28px 0 18px; }
#sc-picker label[hidden] { display:none; }

/* Lists stay bounded and readable at both laptop and wide operator displays. */
.entity-list { display:flex; flex-direction:column; gap:10px; }
.entity-row { display:grid; grid-template-columns:minmax(240px,2fr) minmax(180px,1fr) minmax(200px,1fr); gap:8px 24px; min-height:100px; padding:18px 22px; align-items:center; }
.entity-row .entity-card-top { grid-column:2; grid-row:1; margin:0; justify-content:flex-start; gap:12px; }
.entity-row h3 { grid-column:1; grid-row:1; margin:0; font-size:18px; }
.entity-row p { grid-column:1; grid-row:2; margin:0; font-size:14px; }
.entity-row .entity-card-bottom { grid-column:3; grid-row:1 / 3; margin:0; padding:0; border:0; display:flex; flex-direction:column; align-items:flex-end; gap:12px; }
.entity-row .entity-excerpt { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.entity-pagination { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:20px 0; }
.entity-description { margin:16px 0; }
.entity-description summary { cursor:pointer; }
.entity-table td { padding:16px; vertical-align:middle; }
.entity-table td small { display:block; font-size:14px; line-height:1.6; color:var(--text-muted); overflow-wrap:anywhere; }
.entity-name { font-size:17px; font-weight:650; }
.member-options { display:grid; gap:12px; max-height:280px; overflow:auto; margin:16px 0; }
.member-options label { display:flex; align-items:center; gap:8px; }
.member-options input { width:auto; }
.btn-quiet { background:transparent; }
/* A transparent sticky heading was painting the next row through its labels. */
thead th { background:var(--bg-card); }
thead th::after { display:none; }
.tm-roster-table thead, .op-history-table thead, .audit-table thead { background:var(--bg-card); }
.tm-roster-table { max-height:none; }
.table-wrapper table { isolation:isolate; }
@media(max-width:1100px) { .entity-row {grid-template-columns:minmax(220px,2fr) minmax(170px,1fr);} .entity-row .entity-card-top {grid-column:2;grid-row:1;} .entity-row .entity-card-bottom {grid-column:2;grid-row:2;align-items:flex-start;} }
@media(max-width:650px) { .entity-row {display:flex; flex-direction:column; align-items:stretch;} .entity-row .entity-card-top {order:-1;} .entity-row .entity-card-bottom {align-items:flex-start;} .entity-table table {min-width:640px;} .entity-pagination {font-size:14px;} }
.challenge-author { font-size:16px; }
.author-steps { display:flex; gap:8px; margin-bottom:24px; flex-wrap:wrap; }
.author-steps button { flex:1; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--bg-card); color:var(--text-primary); cursor:pointer; font:inherit; }
.author-steps button[aria-current=step] { background:var(--text-primary); color:var(--bg-card); }
.author-two { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.author-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; padding-top:18px; border-top:1px solid var(--border); }
.author-upload { padding:16px; border:1px solid var(--border); border-radius:8px; margin:18px 0; }
.author-upload input { margin:12px 0; }
.challenge-author p { line-height:1.6; margin:12px 0 20px; }
.challenge-author textarea { width:100%; }
.challenge-author [hidden] { display:none !important; }
@media(max-width:650px) { .author-two {grid-template-columns:1fr;} .author-steps {font-size:14px;} .author-footer {flex-wrap:wrap;} }
.fl-node .fl-lbl { font-size:14px; line-height:1.4; }
.fl-node .fl-step { font-size:12px; }
.fl-node .fl-det { font-size:12px; line-height:1.5; margin-top:5px; }
.entity-table a { color:var(--text-primary); text-decoration:underline; text-underline-offset:3px; }
.entity-table a.btn { text-decoration:none; }
.entity-row { min-height:0; padding:14px 20px; row-gap:4px; }
.entity-pagination-top { padding:0 0 14px; }
.author-upload { display:grid; gap:12px; }
.author-upload input { max-width:100%; margin:0; }
.author-upload button { justify-self:start; }
