:root {
  --ink: #132238;
  --ink-soft: #34445b;
  --paper: #f7f9fb;
  --sheet: #ffffff;
  --line: #ced7e1;
  --line-dark: #9aabba;
  --muted: #617083;
  --d1: #bf3d35;
  --d1-soft: #fff0ee;
  --d2: #7557bd;
  --d2-soft: #f3efff;
  --d3: #0e8178;
  --d3-soft: #e9f8f5;
  --d4: #a8660b;
  --d4-soft: #fff5df;
  --blue: #28699d;
  --blue-soft: #eaf4fb;
  --danger: #a73832;
  --shadow: 0 18px 48px rgba(23, 38, 58, .1);
  --shadow-small: 0 6px 18px rgba(23, 38, 58, .08);
  --radius: 14px;
  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(69, 93, 119, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 93, 119, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: var(--font-body);
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid #1e70a7; outline-offset: 3px; }
.skip-link {
  position: fixed; left: 16px; top: 8px; z-index: 1000; transform: translateY(-160%);
  padding: 10px 14px; border-radius: 6px; color: white; background: var(--ink); font-weight: 700;
}
.skip-link:focus { transform: none; }

.masthead {
  position: sticky; top: 0; z-index: 50;
  min-height: 68px; padding: 10px clamp(16px, 3vw, 42px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  color: white; background: rgba(19, 34, 56, .97); border-bottom: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.wordmark__tiles { width: 32px; height: 32px; flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-3deg); }
.wordmark__tiles i { border-radius: 2px; background: var(--d1); }
.wordmark__tiles i:nth-child(2) { background: var(--d2); border-radius: 50%; }
.wordmark__tiles i:nth-child(3) { background: var(--d3); border-radius: 50%; }
.wordmark__tiles i:nth-child(4) { background: #e4a738; }
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-size: 15px; line-height: 1.2; letter-spacing: .01em; }
.wordmark small { margin-top: 2px; color: #bfcada; font: 500 10px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; }
.masthead__status { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.connection-badge, .room-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  font: 500 11px var(--font-mono); color: #dce5ee;
}
.connection-badge i { width: 7px; height: 7px; border-radius: 50%; background: #8290a2; }
.connection-badge[data-state="online"] i { background: #55d29a; box-shadow: 0 0 0 4px rgba(85,210,154,.12); }
.connection-badge[data-state="loading"] i { background: #efb247; animation: pulse 1.2s ease-in-out infinite; }
.connection-badge[data-state="error"] i { background: #fa7c73; }
.user-button { min-width: 30px; min-height: 30px; }

.view { min-height: calc(100vh - 68px); }
.view--home { padding: clamp(40px, 7vw, 96px) clamp(16px, 4.5vw, 72px) 44px; }
.home-board { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); gap: clamp(40px, 7vw, 100px); align-items: center; }
.kicker { margin: 0 0 12px; color: var(--muted); font: 600 11px/1.35 var(--font-mono); text-transform: uppercase; letter-spacing: .09em; }
.home-copy h1, .paper-panel h1, .workspace-head h1, .activity-heading h1, .waiting-card h1, .participant-activity h1 {
  margin: 0; font-family: var(--font-display); font-weight: 400; letter-spacing: -.045em; line-height: .98;
}
.home-copy h1 { max-width: 760px; font-size: clamp(48px, 7vw, 102px); }
.home-lead { max-width: 680px; margin: 28px 0; color: var(--ink-soft); font-size: clamp(17px, 1.7vw, 22px); line-height: 1.6; }
.privacy-strip { max-width: 680px; display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-left: 4px solid var(--d4); background: var(--d4-soft); color: #624a26; font-size: 13px; }
.privacy-strip p { margin: 0; }
.privacy-strip span { font-size: 22px; line-height: 1; }
.role-cards { display: grid; gap: 16px; }
.role-card {
  position: relative; min-height: 190px; width: 100%; overflow: hidden; padding: 24px 70px 24px 26px;
  display: grid; grid-template-columns: 54px 1fr; align-content: center; gap: 8px 12px;
  color: var(--ink); text-align: left; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px 18px 18px 4px;
  box-shadow: var(--shadow-small); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.role-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--d3); }
.role-card--host::before { background: var(--d2); }
.role-card:hover { transform: translate(-5px, -3px) rotate(-.25deg); border-color: var(--line-dark); box-shadow: var(--shadow); }
.role-card__number { grid-row: 1 / 3; color: var(--muted); font: 600 13px var(--font-mono); }
.role-card__label { font-family: var(--font-display); font-size: clamp(20px, 2vw, 27px); letter-spacing: -.025em; }
.role-card__detail { max-width: 370px; color: var(--muted); font-size: 14px; }
.role-card__arrow { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); font: 500 34px var(--font-mono); }
.four-tracks { max-width: 1240px; margin: clamp(50px, 8vw, 110px) auto 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; border-top: 1px solid var(--line); }
.four-tracks li { min-width: 0; padding: 18px 12px 10px 18px; border-left: 4px solid var(--d1); }
.four-tracks li[data-d="D2"] { border-color: var(--d2); }
.four-tracks li[data-d="D3"] { border-color: var(--d3); }
.four-tracks li[data-d="D4"] { border-color: var(--d4); }
.four-tracks span, .four-tracks b, .four-tracks small { display: block; }
.four-tracks span { color: var(--muted); font: 600 10px var(--font-mono); }
.four-tracks b { margin: 6px 0 2px; font-size: 15px; }
.four-tracks small { color: var(--muted); font-size: 12px; }

.view--center { display: grid; place-items: center; padding: 32px 16px; }
.paper-panel { width: min(100%, 620px); padding: clamp(28px, 5vw, 54px); background: var(--sheet); border: 1px solid var(--line); border-radius: 4px 22px 22px 4px; box-shadow: var(--shadow); }
.paper-panel--narrow { max-width: 530px; }
.paper-panel h1 { margin: 22px 0 16px; font-size: clamp(32px, 6vw, 54px); }
.paper-panel > p:not(.kicker):not(.fine-print) { color: var(--muted); }
.text-button { padding: 3px 0; color: var(--ink-soft); border: 0; background: transparent; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-dark); text-underline-offset: 4px; }
.text-button:hover { color: var(--blue); }
.text-button--danger { color: var(--danger); }
.back-button { margin-bottom: 32px; }
.join-form { display: grid; gap: 12px; margin-top: 28px; }
.join-form label, .filter-bar span { color: var(--muted); font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.join-form input {
  width: 100%; padding: 18px; color: var(--ink); background: #fbfcfd; border: 2px solid var(--line); border-radius: 10px;
  font: 600 clamp(24px, 6vw, 34px) var(--font-mono); text-align: center; text-transform: uppercase; letter-spacing: .14em;
}
.fine-print { margin: 24px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-error { min-height: 1.4em; margin: 4px 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.button-row, .export-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button {
  min-height: 44px; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink); background: var(--sheet); border: 1px solid var(--line-dark); border-radius: 7px; font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-small); }
.button--primary { color: white; background: var(--ink); border-color: var(--ink); }
.button--primary:hover:not(:disabled) { background: #203552; }
.button--secondary { background: #f1f5f8; }
.button--danger { color: white; background: var(--danger); border-color: var(--danger); }
.button--wide { width: 100%; }
.button--small { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.loader-rule { height: 3px; overflow: hidden; margin: 24px 0; background: var(--line); }
.loader-rule span { display: block; width: 35%; height: 100%; background: var(--d2); animation: loading 1.2s ease-in-out infinite alternate; }

.view--builder { padding: 30px clamp(14px, 3vw, 44px) 54px; }
.workspace-head { max-width: 1500px; margin: 0 auto 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.workspace-head h1 { max-width: 920px; font-size: clamp(32px, 4vw, 58px); }
.workspace-head > div > p:last-child { max-width: 740px; color: var(--muted); }
.builder-layout { max-width: 1500px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 410px); gap: 24px; align-items: start; }
.catalog-pane { min-width: 0; }
.filter-bar { padding: 14px; display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)) auto; gap: 10px; align-items: end; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; }
.filter-bar label { min-width: 0; display: grid; gap: 5px; }
.filter-bar select { min-width: 0; width: 100%; padding: 9px 30px 9px 9px; color: var(--ink); background: #f8fafb; border: 1px solid var(--line); border-radius: 6px; }
.filter-clear { align-self: center; margin-bottom: 7px; white-space: nowrap; }
.inline-status { margin: 28px 0; color: var(--muted); }
.catalog { display: grid; gap: 26px; }
.catalog-group { min-width: 0; }
.catalog-group__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 4px 8px; border-bottom: 3px solid var(--d-color); }
.catalog-group__head h2 { margin: 0; font-size: 22px; }
.catalog-group__head span { color: var(--muted); font: 500 11px var(--font-mono); }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 10px; }
.activity-card {
  position: relative; min-height: 172px; padding: 18px 18px 16px; display: flex; flex-direction: column; align-items: flex-start;
  color: var(--ink); text-align: left; background: var(--sheet); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 1px 0 rgba(19,34,56,.04);
}
.activity-card:hover { border-color: var(--d-color); box-shadow: var(--shadow-small); }
.activity-card[data-selected="true"] { border: 2px solid var(--d-color); padding: 17px 17px 15px; background: var(--d-soft); }
.activity-card__position { position: absolute; right: 14px; top: 12px; min-width: 30px; height: 30px; padding: 0 5px; display: grid; place-items: center; color: white; background: var(--d-color); border-radius: 50%; font: 600 12px var(--font-mono); }
.activity-card__eyebrow { padding-right: 35px; color: var(--muted); font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.activity-card h3 { margin: 9px 0 7px; font-size: 17px; line-height: 1.25; }
.activity-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.activity-card__foot { width: 100%; margin-top: auto; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: 500 10px var(--font-mono); }
.run-sheet { position: sticky; top: 90px; max-height: calc(100vh - 112px); padding: 20px; overflow: auto; background: var(--sheet); border: 1px solid var(--line); border-top: 7px solid var(--ink); border-radius: 5px 5px 15px 15px; box-shadow: var(--shadow); }
.run-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.run-sheet h2 { margin: 0; font-size: 26px; }
.run-sheet__summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 16px 0; padding: 10px 0; border-block: 1px dashed var(--line-dark); color: var(--muted); font: 500 10px var(--font-mono); }
.playlist { margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.playlist-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px; background: var(--paper); border-left: 4px solid var(--d-color); border-radius: 4px; }
.playlist-item__number { font: 600 12px var(--font-mono); color: var(--d-color); }
.playlist-item__copy { min-width: 0; }
.playlist-item__copy b, .playlist-item__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-item__copy b { font-size: 13px; }
.playlist-item__copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.playlist-item__tools { display: flex; align-items: center; gap: 5px; }
.duration-select { width: 88px; padding: 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: white; font-size: 11px; }
.icon-button { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 4px; color: var(--danger); background: transparent; font-size: 20px; }
.icon-button:hover { background: #fbeceb; }
.empty-note { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; border: 1px dashed var(--line-dark); border-radius: 6px; }
.empty-note span { font-size: 30px; }
.empty-note p { max-width: 240px; margin: 0; font-size: 13px; }

.view--host { padding: 0; background: #eef2f5; }
.host-stage { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.session-rail { padding: 28px 22px; color: #eef4f8; background: var(--ink); border-top: 1px solid rgba(255,255,255,.1); }
.session-rail .kicker { color: #9fb1c5; }
.room-code-block { margin: 18px 0 16px; }
.room-code-block small, .room-code-block strong { display: block; }
.room-code-block small { margin-bottom: 4px; color: #9fb1c5; font: 500 10px var(--font-mono); text-transform: uppercase; }
.room-code-block strong { font: 600 25px var(--font-mono); letter-spacing: .11em; }
.room-qr { width: 152px; height: 152px; padding: 7px; display: block; margin: 0 0 12px; object-fit: contain; background: white; border-radius: 4px; }
.room-join-link { display: block; margin: 0 0 10px; color: #d8e9f5; font: 500 10px/1.45 var(--font-mono); overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.session-rail .button--secondary { width: 100%; color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }
.session-facts { margin: 30px 0; display: grid; gap: 12px; }
.session-facts div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.13); }
.session-facts dt { color: #9fb1c5; font-size: 12px; }
.session-facts dd { margin: 0; font: 600 19px var(--font-mono); }
.timer { margin-bottom: 24px; padding: 15px; background: rgba(255,255,255,.08); border-left: 4px solid #efb247; }
.timer span, .timer strong { display: block; }
.timer span { color: #9fb1c5; font-size: 11px; }
.timer strong { font: 600 30px var(--font-mono); }
.session-rail > .text-button { color: #ffaaa5; }
.facilitation-desk { min-width: 0; padding: clamp(26px, 4vw, 58px); }
.activity-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line-dark); }
.activity-heading h1 { max-width: 950px; margin: 15px 0 12px; font-size: clamp(34px, 5vw, 68px); }
.activity-heading p { max-width: 900px; margin: 0; color: var(--ink-soft); font-size: clamp(16px, 1.6vw, 22px); }
.activity-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.d-badge { padding: 5px 8px; color: white; background: var(--d-color, var(--ink)); border-radius: 4px; }
.phase-stamp { flex: 0 0 auto; padding: 8px 11px; border: 2px solid var(--ink); transform: rotate(1.5deg); font: 600 11px var(--font-mono); text-transform: uppercase; }
.lobby-panel { max-width: 920px; margin: 34px 0; padding: clamp(24px, 4vw, 44px); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--sheet); border: 1px solid var(--line); border-left: 7px solid var(--d3); border-radius: 3px 14px 14px 3px; box-shadow: var(--shadow-small); }
.lobby-panel h2, .ended-panel h2 { margin: 0 0 8px; font-size: clamp(23px, 3vw, 36px); line-height: 1.15; }
.lobby-panel p:not(.kicker), .ended-panel p { margin: 0; color: var(--muted); }
.host-results, .participant-results { margin: 28px 0; }
.result-grid { display: grid; gap: 10px; }
.result-row { position: relative; min-height: 56px; overflow: hidden; padding: 13px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--sheet); border: 1px solid var(--line); border-radius: 7px; }
.result-row__fill { position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--blue-soft); pointer-events: none; }
.result-row span, .result-row strong { position: relative; z-index: 1; }
.result-row strong { font: 600 13px var(--font-mono); }
.result-empty { padding: 45px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line-dark); border-radius: 8px; }
.word-cloud { min-height: 240px; padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 13px 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; }
.word-cloud__term { position: relative; color: var(--word-color, var(--ink)); font-size: var(--word-size, 1.1rem); font-weight: 700; outline-offset: 5px; cursor: help; }
.word-cloud__term:focus-visible { outline: 3px solid var(--focus); border-radius: 3px; }
.word-cloud__term::after { content: attr(data-count-label); position: absolute; z-index: 2; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: 180px; padding: 5px 7px; color: white; background: var(--ink); border-radius: 4px; opacity: 0; pointer-events: none; transform: translateX(-50%); font: 600 11px var(--font-mono); }
.word-cloud__term:hover::after, .word-cloud__term:focus-visible::after { opacity: 1; }
.text-wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.text-card { position: relative; min-height: 110px; padding: 18px 44px 18px 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px 12px 12px 4px; box-shadow: var(--shadow-small); white-space: pre-wrap; overflow-wrap: anywhere; }
.text-card button { position: absolute; right: 9px; top: 9px; }
.matrix-result { overflow-x: auto; }
.matrix-table { width: 100%; min-width: 580px; border-collapse: collapse; background: white; }
.matrix-table th, .matrix-table td { padding: 10px; border: 1px solid var(--line); text-align: center; }
.matrix-table th:first-child { text-align: left; }
.matrix-heat { position: relative; min-width: 120px; overflow: hidden; }
.matrix-heat__bar { position: absolute; inset: 0 auto 0 0; width: var(--score); background: color-mix(in srgb, var(--d-color, var(--d3)) 22%, white); }
.matrix-heat strong { position: relative; z-index: 1; font: 600 12px var(--font-mono); }
.rank-list { margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: rank; list-style: none; }
.rank-results { display: grid; gap: 12px; }
.rank-consensus { padding: 15px 17px; display: grid; gap: 4px; background: var(--d-soft, var(--blue-soft)); border-left: 4px solid var(--d-color, var(--blue)); }
.rank-consensus span { color: var(--muted); font: 600 10px var(--font-mono); text-transform: uppercase; }
.rank-consensus strong { line-height: 1.45; }
.rank-consensus small { color: var(--muted); }
.rank-list li { padding: 11px 14px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 10px; align-items: center; background: white; border: 1px solid var(--line); border-left: 4px solid var(--d-color, var(--blue)); }
.rank-list li::before { counter-increment: rank; content: counter(rank); color: var(--d-color, var(--blue)); font: 600 13px var(--font-mono); }
.facilitator-guide { max-width: 960px; margin: 24px 0; padding: 14px 18px; background: #fff9e9; border: 1px solid #e5d4a4; border-radius: 7px; }
.facilitator-guide summary { cursor: pointer; font-weight: 700; }
.facilitator-guide p { margin: 12px 0 0; color: #624f29; white-space: pre-wrap; }
.moderation-panel { margin-top: 18px; padding: 12px 15px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.moderation-panel summary { cursor: pointer; font-weight: 700; }
.moderation-list { margin-top: 12px; display: grid; gap: 7px; }
.moderation-item { padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--paper); border-left: 3px solid var(--d-color, var(--blue)); overflow-wrap: anywhere; }
.moderation-item[data-hidden="true"] { opacity: .6; text-decoration: line-through; }
.facilitator-controls { position: sticky; bottom: 18px; z-index: 10; display: flex; flex-wrap: wrap; gap: 9px; padding: 13px; background: rgba(247,249,251,.94); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.ended-panel { max-width: 900px; margin-top: 34px; padding: clamp(26px, 4vw, 50px); background: white; border: 1px solid var(--line); border-left: 7px solid var(--d4); border-radius: 4px 16px 16px 4px; }
.ended-panel .delete-hint { margin-top: 14px; color: var(--danger); font-size: 12px; font-weight: 600; }

.view--participant { display: grid; place-items: center; padding: clamp(20px, 5vw, 70px) 16px; }
.participant-shell { width: min(100%, 840px); }
.participant-status { min-height: 36px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; color: var(--muted); font: 500 11px var(--font-mono); }
.participant-timer { margin-left: auto; padding: 6px 9px; color: #754d0e; background: var(--d4-soft); border-radius: 4px; font-weight: 700; }
.waiting-card, .participant-activity { padding: clamp(28px, 6vw, 64px); background: var(--sheet); border: 1px solid var(--line); border-radius: 5px 24px 24px 5px; box-shadow: var(--shadow); }
.waiting-card { min-height: 430px; display: grid; align-content: center; justify-items: start; border-left: 8px solid var(--d3); }
.waiting-mark { width: 42px; height: 42px; margin-bottom: 28px; border: 3px solid var(--line); border-top-color: var(--d3); border-radius: 50%; animation: spin 1.2s linear infinite; }
.waiting-card h1, .participant-activity h1 { font-size: clamp(34px, 7vw, 60px); }
.waiting-card > p:last-child { color: var(--muted); }
.participant-activity { border-left: 8px solid var(--d-color, var(--d3)); }
.participant-activity header > p { color: var(--ink-soft); font-size: clamp(16px, 2.5vw, 21px); }
.participant-activity .instructions { padding: 10px 12px; background: var(--paper); border-left: 3px solid var(--d-color, var(--d3)); font-size: 13px; }
.response-form { margin-top: 30px; }
.choice-list { display: grid; gap: 9px; }
.choice {
  position: relative; width: 100%; padding: 14px 15px; display: flex; align-items: flex-start; gap: 12px;
  color: var(--ink); text-align: left; background: white; border: 1px solid var(--line); border-radius: 7px;
}
.choice:hover { border-color: var(--d-color, var(--blue)); }
.choice[aria-pressed="true"] { background: var(--d-soft, var(--blue-soft)); border: 2px solid var(--d-color, var(--blue)); padding: 13px 14px; }
.choice__mark { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid var(--line-dark); border-radius: 50%; color: white; font-size: 12px; }
.choice[data-multiple="true"] .choice__mark { border-radius: 4px; }
.choice[aria-pressed="true"] .choice__mark { background: var(--d-color, var(--blue)); border-color: var(--d-color, var(--blue)); }
.response-actions { margin-top: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.response-actions span { color: var(--muted); font-size: 13px; }
.response-form textarea, .response-form input[type="text"] { width: 100%; padding: 14px; color: var(--ink); background: #fbfcfd; border: 1px solid var(--line-dark); border-radius: 7px; }
.response-form textarea { min-height: 140px; resize: vertical; }
.field-meta { margin-top: 6px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.ranking-editor { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.ranking-item { padding: 10px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 8px; background: #fbfcfd; border: 1px solid var(--line); border-left: 4px solid var(--d-color, var(--blue)); border-radius: 5px; }
.ranking-item[draggable="true"] { cursor: grab; }
.ranking-item[aria-grabbed="true"] { opacity: .55; }
.ranking-item__position { color: var(--d-color, var(--blue)); font: 600 12px var(--font-mono); }
.ranking-tools { display: flex; gap: 4px; }
.ranking-tools button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: white; }
.matrix-editor { overflow-x: auto; }
.matrix-question { min-width: 560px; display: grid; grid-template-columns: minmax(160px, 1.4fr) repeat(2, minmax(130px, 1fr)); border: 1px solid var(--line); border-bottom: 0; }
.matrix-question:last-child { border-bottom: 1px solid var(--line); }
.matrix-question > * { min-width: 0; padding: 11px; border-right: 1px solid var(--line); }
.matrix-question > *:last-child { border-right: 0; }
.matrix-question label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.matrix-question select { width: 100%; padding: 7px; color: var(--ink); border: 1px solid var(--line-dark); border-radius: 4px; background: white; }
.participant-results { padding-top: 20px; border-top: 1px solid var(--line); }
.participant-results h2 { font-size: 19px; }
.participant-privacy { margin: 14px auto 0; color: var(--muted); text-align: center; font-size: 11px; }

.toast { position: fixed; z-index: 200; left: 50%; bottom: 22px; max-width: min(560px, calc(100vw - 28px)); transform: translateX(-50%); padding: 11px 16px; color: white; background: var(--ink); border-radius: 7px; box-shadow: var(--shadow); font-size: 13px; text-align: center; }
.fatal-error { position: fixed; z-index: 300; inset: auto 16px 16px; margin: auto; max-width: 700px; padding: 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; color: white; background: var(--danger); border-radius: 8px; box-shadow: var(--shadow); }
.fatal-error button { color: white; background: transparent; border: 1px solid rgba(255,255,255,.55); border-radius: 4px; padding: 6px 9px; }

@keyframes loading { from { transform: translateX(-20%); } to { transform: translateX(210%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 1050px) {
  .home-board { grid-template-columns: 1fr; }
  .role-cards { grid-template-columns: 1fr 1fr; }
  .builder-layout { grid-template-columns: 1fr; }
  .run-sheet { position: static; max-height: none; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-clear { justify-self: start; }
  .host-stage { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .masthead { min-height: 60px; }
  .wordmark small, .connection-badge span, .room-chip { display: none; }
  .view { min-height: calc(100vh - 60px); }
  .view--home { padding-top: 38px; }
  .home-copy h1 { font-size: clamp(42px, 14vw, 66px); }
  .role-cards { grid-template-columns: 1fr; }
  .role-card { min-height: 150px; }
  .four-tracks { grid-template-columns: 1fr 1fr; }
  .four-tracks li { border-top: 1px solid var(--line); }
  .workspace-head { display: block; }
  .workspace-head > .text-button { margin-top: 8px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .host-stage { display: block; }
  .session-rail { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 15px 18px; }
  .session-rail > .kicker, .room-qr { display: none !important; }
  .room-code-block { margin: 0; }
  .room-code-block small, .room-code-block strong { display: inline; margin-right: 5px; }
  .room-join-link { grid-column: 1 / -1; margin: 0; }
  .session-rail .button--secondary { width: auto; }
  .session-facts { grid-column: 1 / -1; margin: 5px 0 2px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .session-facts div { display: grid; gap: 2px; padding: 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 4px; }
  .session-facts dt { font-size: 9px; }
  .session-facts dd { font-size: 15px; }
  .timer { grid-column: 1 / -1; margin: 0; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; }
  .timer[hidden] { display: none !important; }
  .timer span, .timer strong { display: inline; }
  .timer strong { font-size: 19px; }
  .session-rail > .text-button { grid-column: 1 / -1; justify-self: start; }
  .facilitation-desk { padding: 24px 16px 60px; }
  .activity-heading { display: block; }
  .phase-stamp { display: inline-block; margin-top: 18px; }
  .lobby-panel { display: grid; }
  .text-wall { grid-template-columns: 1fr; }
  .waiting-card, .participant-activity { padding: 28px 20px; }
  .fatal-error { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .wordmark__tiles { width: 27px; height: 27px; }
  .wordmark strong { font-size: 13px; }
  .home-copy h1 { font-size: 43px; }
  .home-lead { font-size: 16px; }
  .four-tracks { grid-template-columns: 1fr; }
  .four-tracks small { display: none; }
  .four-tracks li { padding-block: 10px; }
  .paper-panel { padding: 24px 18px; border-radius: 4px 14px 14px 4px; }
  .filter-bar { grid-template-columns: 1fr; }
  .activity-card { min-height: 155px; }
  .run-sheet { padding: 15px; }
  .playlist-item { grid-template-columns: 24px minmax(0, 1fr); }
  .playlist-item__tools { grid-column: 2; }
  .duration-select { width: 116px; }
  .facilitator-controls .button, .export-row .button { width: 100%; }
  .participant-status { flex-wrap: wrap; }
  .participant-timer { margin-left: 0; }
  .response-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .masthead, .session-rail, .facilitator-controls, .facilitator-guide { display: none !important; }
  .host-stage { display: block; }
  .facilitation-desk { padding: 0; }
  body { background: white; }
}
