/* HCA Playroom: the local design-system experiment, connected to Flask.
 * No framework/CDN. Tokens and typography come from experiments/design-system.html.
 */
@font-face { font-family: Nunito; src: url('playroom/nunito-sans-variable.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }
:root {
  --brand-slate: #4d656c; --brand-orange: #e34321; --brand-sky: #9dcddb;
  --ink: #26383e; --muted: #596d70; --paper: #faf8f1; --surface: #fffefa;
  --line: #dedfd4; --orange-50: #fff0e5; --action: #b83218;
  --sky-50: #e8f4f5; --sky-700: #32616e; --success: #32634c;
  --shadow: 0 5px 0 #dcded3, 0 12px 26px #26383e09;
  --spring: cubic-bezier(.2,.8,.25,1.25); --radius: 22px;
}
* { box-sizing: border-box; }
html { height: 100%; }
body.pr-shell { margin: 0; height: 100%; color: var(--ink); background: var(--paper); font: 16px/1.4 Nunito, system-ui, sans-serif; }
.pr-shell button, .pr-shell input, .pr-shell select, .pr-shell textarea { font: inherit; }
.pr-shell a { color: inherit; }
.pr-shell button { color: inherit; cursor: pointer; touch-action: manipulation; }
.pr-shell button:disabled { opacity: .5; cursor: default; }
.pr-shell :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 3px solid var(--sky-700); outline-offset: 4px; }
.pr-shell h1, .pr-shell h2, .pr-shell h3, .pr-shell p { margin: 0; }
.pr-shell h1 { font-size: clamp(24px, 2.5vw, 32px); font-weight: 900; line-height: 1.15; letter-spacing: -.8px; }
.pr-shell h2 { font-size: 21px; font-weight: 850; }
.pr-shell h3 { font-size: 17px; font-weight: 850; }
[hidden] { display: none !important; }
.pr-icon { width: 25px; height: 25px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pr-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.pr-skip { position: absolute; top: -80px; left: 12px; z-index: 10; padding: 12px; background: var(--ink); color: white !important; border-radius: 10px; }
.pr-skip:focus { top: 12px; }
.pr-app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 100px minmax(0,1fr); grid-template-rows: 64px minmax(0,1fr); }
.pr-top { grid-column: 1/-1; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding: 0 25px; background: var(--surface); position: static; }
.pr-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.pr-brand #logoLink { font-size: 17px; font-weight: 950; }
.pr-original-logo { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.pr-logo { background: var(--brand-orange); color: white; border-radius: 12px 12px 12px 4px; width: 36px; height: 36px; display: grid; place-items: center; transform: rotate(-5deg); }
.pr-account-tools { margin-left: auto; }
.pr-avatar { background: var(--brand-sky); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
.pr-account { position: relative; }
.pr-account summary { list-style: none; cursor: pointer; border-radius: 50%; }
.pr-account summary::-webkit-details-marker { display: none; }
.pr-account-menu { position: absolute; right: 0; top: 48px; width: min(270px, calc(100vw - 24px)); z-index: 5; display: grid; padding: 14px; gap: 5px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.pr-account-menu a { padding: 10px; border-radius: 9px; text-decoration: none; font-size: 14px; }
.pr-account-menu a:hover { background: var(--sky-50); }
.pr-account-menu strong { overflow-wrap: anywhere; padding: 4px 10px; }
.pr-text-link { font-weight: 800; font-size: 13px; text-underline-offset: 4px; }
.pr-dock { border-right: 1px solid var(--line); padding: 22px 12px 16px; display: flex; gap: 18px; align-items: center; flex-direction: column; background: var(--surface); min-height: 0; overflow-y: auto; }
.pr-dock-button { position: relative; display: grid; place-items: center; width: 66px; min-height: 62px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 5px 0 #dcded3; text-decoration: none; transition: box-shadow .16s; }
.pr-dock-button .pr-icon { width: 30px; height: 30px; transition: transform .16s var(--spring); }
.pr-dock-button:hover .pr-icon { transform: translateY(-2px); }
.pr-dock-button[aria-current='page'] { background: var(--ink); color: white; box-shadow: 0 5px 0 #14252a; border-color: var(--ink); }
.pr-dock-button[aria-current='page']::before { content: ''; position: absolute; left: -13px; top: 17px; width: 4px; height: 28px; background: var(--brand-orange); border-radius: 0 4px 4px 0; }
.pr-help-dock { margin-top: auto; display: grid; gap: 10px; justify-items: center; padding-top: 16px; }
.pr-help-dock .pr-dock-button { min-height: 72px; background: var(--orange-50); color: var(--action); border-color: #edcfbc; }
.pr-help-dock[data-state='waiting'] .pr-dock-button { background: var(--brand-sky); color: var(--ink); }
.pr-help-dock[data-state='claimed'] .pr-dock-button { background: var(--success); color: white; }
.pr-help-cancel { border: 0; background: none; padding: 6px 0; font-size: 12px !important; font-weight: 800; text-decoration: underline; min-height: 44px; }
.pr-stage { min-width: 0; min-height: 0; overflow: auto; padding: 24px 26px; background-image: radial-gradient(#4d656c14 .8px,transparent .8px); background-size: 16px 16px; scrollbar-color: var(--brand-slate) transparent; scrollbar-width: thin; }
.pr-muted { color: var(--muted); }
.pr-shell .hca-workshop {
  --hca-orange: var(--brand-orange); --hca-orange-700: var(--action);
  --hca-blue: var(--sky-700); --hca-blue-100: var(--sky-50);
  --hca-bg: var(--paper); --hca-surface: var(--surface); --hca-text: var(--ink);
  --hca-muted: var(--muted); --hca-success: var(--success); --hca-danger: var(--action);
  padding: 0; margin: 0; max-width: 1320px; font: inherit; min-height: 100%;
}
.pr-shell .hca-workshop__head { margin-bottom: 22px; }
.pr-shell .hca-workshop__eyebrow { font-size: 11px; font-weight: 900; letter-spacing: 1.5px; margin-bottom: 6px; }
.pr-shell .hca-workshop__title { font-size: clamp(24px,2.5vw,32px); font-weight: 900; }
.pr-shell .hca-workshop__sub { font-size: 14px; margin: 8px 0 16px; }
.pr-shell .hca-section-title { border: 0; padding: 0; margin: 0 0 16px; font-size: 20px; }
.pr-shell .hca-panel, .pr-shell .hca-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.pr-shell .hca-card__title { font-size: 18px; }
.pr-shell .hca-btn, .pr-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 17px; border-radius: 14px; border: 1px solid #d6dcd5; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 850; text-decoration: none; box-shadow: 0 4px 0 #d7dcd4; transition: box-shadow .16s, background .16s; }
.pr-shell .hca-btn:not(:disabled):active, .pr-button:not(:disabled):active { box-shadow: 0 1px 0 #d7dcd4; }
.pr-shell .hca-btn--orange, .pr-button.primary { background: var(--action); border-color: var(--action); color: white; box-shadow: 0 4px 0 #7e2818; }
.pr-shell .hca-btn--orange:hover, .pr-button.primary:hover { background: #a52d17; }
.pr-shell .hca-btn--blue, .pr-button.sky { background: var(--brand-sky); border-color: #7fb9c9; color: var(--ink); box-shadow: 0 4px 0 #79aab5; }
.pr-shell .hca-btn--blue:hover, .pr-button.sky:hover { background: #c4dfe4; }
.pr-shell .hca-btn--danger { color: var(--action); background: var(--surface); border-color: #efcaba; }
.pr-shell .hca-badge { padding: 5px 10px; border-radius: 50px; background: var(--sky-50); font-size: 11px; font-weight: 900; }
.pr-shell .hca-form { gap: 14px; }
.pr-shell .hca-form + .hca-form { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line); }
.pr-shell .hca-field label, .pr-shell .hca-fieldset legend { font-size: 13px; font-weight: 850; }
.pr-shell .hca-workshop :is(input:not([type='checkbox']):not([type='radio']):not([type='hidden']), select, textarea), .pr-field { min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 2px solid #ccd7d5; border-radius: 12px; background: var(--paper); color: var(--ink); }
.pr-shell .hca-form.hca-inline :is(input,select) { flex: 1 1 160px; }
.pr-shell .hca-form.hca-inline input[type='hidden'] { flex: none; }
.pr-shell .hca-workshop :is(input,select,textarea):focus { border-color: var(--sky-700); }
.pr-shell .hca-hint { font-size: 12px; line-height: 1.5; }
.pr-shell .hca-code { background: var(--ink); color: var(--surface); border-radius: 14px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.pr-shell .hca-banner { border-radius: 14px; font-size: 14px; }
.pr-shell .hca-roster thead th { background: var(--sky-50); }
.pr-shell .hca-roster :is(th,td) { overflow-wrap: anywhere; }
.pr-shell .hca-queue-row { background: var(--paper); border-radius: 12px; padding: 14px; }
.pr-shell .hca-queue-info { min-width: 0; overflow-wrap: anywhere; }
.pr-shell .hca-grant-list { padding: 0; list-style: none; }
.pr-shell .hca-grant { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.pr-shell .hca-grant form { margin-left: auto; }
.pr-session-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,290px),1fr)); gap: 20px; }
.pr-shell .pr-session-list .hca-card { margin: 0; display: grid; gap: 20px; align-content: space-between; }
.pr-session-list .hca-card__title a { color: var(--ink); text-decoration: none; }
.pr-section { margin-bottom: 28px; scroll-margin-top: 16px; }
.pr-session-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 20px; }
.pr-shell .pr-session-header .hca-workshop__title { margin-bottom: 8px; }
.pr-session-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; min-height: 380px; }
.pr-activity, .pr-resource { min-width: 0; border: 1px solid #c4dfe4; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); overflow: clip; display: flex; flex-direction: column; }
.pr-activity-head, .pr-resource-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #c4dfe4; background: var(--sky-50); }
.pr-activity-head p { font-size: 11px; font-weight: 900; }
.pr-world { display: grid; place-items: center; position: relative; min-height: 230px; flex: 1; background: repeating-linear-gradient(to bottom,var(--sky-50) 0,var(--sky-50) 29px,#c4dfe4 30px,var(--sky-50) 31px); }
.pr-world::before { content: ''; position: absolute; width: 220px; height: 180px; background: var(--brand-sky); border-radius: 38% 62% 30% 70% / 57% 28% 72% 43%; transform: rotate(-12deg); }
.pr-robot { position: relative; width: 150px; height: 150px; }
.pr-world-label { position: absolute; top: 18px; left: 20px; font-size: 13px; font-weight: 850; }
.pr-activity-foot { padding: 18px 20px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.pr-activity-foot p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pr-resource-head { background: var(--surface); border-color: var(--line); }
.pr-resource-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.pr-close { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; font-size: 24px !important; }
.pr-resource-body { flex: 1; padding: 20px; overflow: auto; max-height: 380px; }
.pr-resource-body pre { font-size: 13px; }
.pr-resource-body .pr-muted { font-size: 13px; margin-bottom: 12px; }
.pr-resource-footer { padding: 16px 20px; border-top: 1px solid var(--line); min-height: 24px; }
.pr-resource-empty { display: grid; place-content: center; text-align: center; color: var(--muted); padding: 25px; gap: 12px; min-height: 250px; flex: 1; }
.pr-resource-empty .pr-icon { margin: auto; width: 40px; height: 40px; }
.pr-material-tray { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 20px; }
.pr-material-tray .pr-button { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.pr-material-tray .pr-button[aria-pressed='true'] { background: var(--sky-50); border-color: var(--sky-700); }
.pr-material-tray .pr-button[data-new] { border-color: var(--brand-orange); box-shadow: 0 4px 0 #f5c7b5; }
.pr-copy-feedback { font-size: 12px; min-height: 20px; color: var(--success); margin-top: 10px !important; }
.pr-help-note { font-size: 13px; margin-top: 8px !important; color: var(--muted); }
.pr-staff-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.85fr); gap: 22px; align-items: start; }
.pr-staff-layout > * { min-width: 0; }
.pr-shell .pr-form-card { max-width: 500px; margin: 20px auto; padding: 28px; }
.pr-form-card h1 { margin-bottom: 10px; }
.pr-form-card > p { margin-bottom: 20px; }
.pr-form-card form { display: grid; gap: 16px; }
.pr-form-card label { display: block; font-size: 13px; font-weight: 850; margin-bottom: 6px; }
.pr-form-card input:not([type='checkbox']):not([type='radio']) { width: 100%; }
.pr-form-card label.hca-radio { display: flex; }
.pr-qr-section { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.pr-qr-section #reader { width: 100%; min-height: 100px; background: var(--paper); border-radius: 12px; }
.pr-qr-section button { width: 100%; margin-top: 12px; }
.pr-file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.pr-file-row > a:first-child { flex: 1 1 180px; overflow-wrap: anywhere; font-weight: 850; }
.pr-upload { margin-top: 24px; }
.pr-upload input[type='file'] { width: 100%; font-size: 14px; }
.pr-explorer { border: 1px solid var(--line); border-radius: 26px; padding: 26px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); width: min(580px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; }
.pr-explorer::backdrop { background: #26383e70; }
.pr-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.pr-explore-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.pr-explore-card { display: grid; gap: 10px; padding: 20px; background: var(--sky-50); border: 1px solid #c4dfe4; border-radius: 20px; text-decoration: none; }
.pr-explore-card:nth-child(2) { background: var(--orange-50); border-color: #edcfbc; }
.pr-explore-card span { font-size: 13px; color: var(--muted); }
@media (max-width:1100px) { .pr-session-layout { grid-template-columns: minmax(0,1fr) 290px; } .pr-staff-layout { grid-template-columns: minmax(0,1fr); } }
@media (max-width:700px) {
  .pr-app { grid-template-columns: 77px minmax(0,1fr); grid-template-rows: 57px minmax(0,1fr); }
  .pr-top { padding: 0 12px; gap: 8px; } .pr-brand { gap: 8px; } .pr-brand #logoLink { font-size: 14px; }
  .pr-logo { width: 30px; height: 30px; } .pr-avatar { width: 30px; height: 30px; }
  .pr-dock { padding: 18px 8px 12px; gap: 16px; }
  .pr-dock-button { width: 54px; min-height: 54px; border-radius: 17px; }
  .pr-dock-button[aria-current='page']::before { left: -9px; }
  .pr-dock-button .pr-icon { width: 27px; height: 27px; }
  .pr-help-dock .pr-dock-button { min-height: 62px; }
  .pr-stage { padding: 16px 12px 24px; }
  .pr-session-layout { grid-template-columns: minmax(0,1fr); min-height: 330px; }
  .pr-session-layout[data-resource-open] .pr-activity { display: none; }
  .pr-resource:not([data-open]) { display: none; }
  .pr-resource-body { max-height: none; }
  .pr-session-header { gap: 8px; flex-wrap: wrap; }
  .pr-activity-head, .pr-activity-foot, .pr-resource-head, .pr-resource-body { padding: 14px; }
  .pr-activity-head h2 { font-size: 18px; } .pr-activity-head p { display: none; }
  .pr-activity-foot .pr-button { width: 100%; }
  .pr-world { min-height: 210px; } .pr-robot { width: 120px; height: 120px; }
  .pr-world::before { width: 160px; height: 150px; }
  .pr-world-label { font-size: 11px; left: 14px; }
  .pr-material-tray .pr-button { font-size: 12px; padding: 9px 12px; }
  .pr-shell .hca-panel, .pr-shell .hca-card { padding: 16px; }
  .pr-shell .pr-form-card { padding: 18px; margin: 0; }
  .pr-explore-links { grid-template-columns: 1fr; }
  .pr-shell .hca-form.hca-inline { align-items: stretch; }
  .pr-shell .hca-form.hca-inline :is(input,select) { flex: none; width: 100%; }
}
@media (max-height:650px) and (min-width:701px) { .pr-dock { gap: 10px; padding-top: 14px; } .pr-dock-button { min-height: 50px; width: 55px; } .pr-stage { padding: 16px 20px; } .pr-world { min-height: 180px; } .pr-session-layout { min-height: 330px; } }
@media (prefers-reduced-motion:reduce) { .pr-shell *, .pr-shell *::before, .pr-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .pr-dock-button:hover .pr-icon { transform: none; } }

/* Login has its own compact rhythm; do not tighten staff registration forms. */
.pr-shell .pr-login-page { display: flex; justify-content: center; align-items: flex-start; padding-block: clamp(8px,3vh,24px); }
.pr-shell .pr-login-card { width: 100%; max-width: 420px; margin: 0; padding: 24px; display: grid; gap: 20px; }
.pr-login-card h1, .pr-login-card > p { margin: 0; }
.pr-login-card .pr-login-field { display: grid; gap: 6px; }
.pr-login-card .pr-login-field label { margin: 0; }
.pr-login-card .pr-qr-section { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.pr-login-card .pr-qr-section button { margin: 0; }
.pr-login-card .pr-login-support { color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width:700px) { .pr-shell .pr-login-card { padding: 18px; } .pr-shell .pr-login-page { padding-block: 0; } }
