/* V2 candidate workflow. Keep the existing ARK Web tokens and host clock. */
.flow-room #flow-total-timer{display:block;color:var(--muted);font-variant-numeric:tabular-nums;font-size:var(--font-caption)}
.flow-room--scenario .room-frame{grid-template-rows:auto auto minmax(0,1fr) auto;grid-template-areas:"feedback reference" "task reference" "messages reference" "composer reference"}
.flow-room .room-frame:not(:has(>.room-reference)){grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"feedback" "messages" "composer"}
.flow-room--scenario .room-frame:not(:has(>.room-reference)){grid-template-rows:auto auto minmax(0,1fr) auto;grid-template-areas:"feedback" "task" "messages" "composer"}
.is-candidate.is-room .flow-room .room-clock #timer-label{display:inline;color:var(--ink)}
.flow-room .flow-interview-actions{display:flex;flex-wrap:wrap;gap:10px;padding:0 24px 12px;border-top:0}
.flow-room .flow-interview-actions>button{font-size:var(--font-caption);min-height:44px}
.flow-room .flow-scenario{grid-area:task;min-width:0;min-height:0;max-height:36dvh;overflow:auto;overscroll-behavior:contain;margin:0;padding:16px 24px;border-bottom:1px solid var(--line);background:var(--surface)}
.flow-room .flow-scenario-heading>span{font-size:var(--font-caption);color:var(--muted)}
.flow-room .flow-scenario h2{font-size:var(--font-caption);line-height:1.6;margin:0 0 6px;color:var(--muted);font-weight:500}
.flow-room .flow-scenario-brief{font-size:var(--font-caption);line-height:1.8;white-space:pre-wrap;color:var(--text);margin-top:10px}
.flow-room .flow-scenario-goal{line-height:1.8;font-size:var(--font-body);margin:0;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}
.flow-room .flow-scenario-details{margin-top:6px;font-size:var(--font-caption);line-height:1.8}
.flow-room .flow-scenario-details>summary{cursor:pointer;color:var(--action);min-height:44px;display:list-item;align-content:center}
.flow-room .flow-scenario-material{border-top:1px solid var(--line);padding-top:12px}
.flow-room .flow-scenario-material h3{font-size:var(--font-caption);margin:14px 0 6px;color:var(--muted)}
.flow-room .flow-scenario-material ul{margin:8px 0;padding-left:20px}
.flow-room .flow-scenario-goal>strong{display:block;font-size:var(--font-caption);color:var(--muted);margin-bottom:6px}
.flow-room .flow-scenario-constraints{margin-top:16px;line-height:1.8;font-size:var(--font-caption)}
.flow-room .flow-scenario-constraints>summary{color:var(--action);cursor:pointer}
.flow-room .flow-scenario-constraints ul{padding-left:20px;margin:12px 0 0}
.flow-room .flow-ai-message .ark-message__bubble{border-left:3px solid var(--action);background:var(--ark-ai-surface)}
.flow-room .flow-ai-message .ark-message__author>strong{color:var(--action)}
.flow-room .flow-material-message .ark-message__bubble{border-left:3px solid var(--line);background:var(--surface)}
.flow-room .flow-material-message .ark-message__meta{color:var(--text)}
.flow-room .flow-workspace{padding:18px 24px 12px;background:var(--surface)}
.flow-room .flow-workspace-title{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.flow-room .flow-workspace-title>strong{font-size:15px;color:var(--ink)}
.flow-room .flow-workspace-title>span{font-size:var(--font-caption);color:var(--muted);line-height:1.7}
.flow-room .flow-field{display:flex;flex-direction:column;gap:8px;color:var(--ink);font-size:14px;font-weight:500}
.flow-room .flow-field textarea{font-family:inherit;font-size:16px;font-weight:400;line-height:1.75;min-height:76px;max-height:240px;resize:vertical;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--control);padding:12px 14px;box-sizing:border-box;width:100%}
.flow-room .flow-form-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.flow-room .flow-form-actions>span{font-size:12px;color:var(--muted);line-height:1.7}
.flow-room .flow-form-actions>button{min-height:44px;font-size:14px;white-space:nowrap;padding:9px 15px}
.flow-room .flow-workspace-notes{display:flex;gap:12px;align-items:flex-start;margin-top:16px}
.flow-room .flow-note{flex:1;min-width:0;border-top:1px solid var(--line);padding-top:12px}
.flow-room .flow-note>summary{cursor:pointer;color:var(--action);font-size:14px;line-height:1.8;font-weight:500}
.flow-room .flow-note>summary>span{display:block;font-size:12px;color:var(--muted);font-weight:400}
.flow-room .flow-note form,.flow-room .flow-note>p{margin-top:14px}
.flow-room .flow-note>p{font-size:14px;line-height:1.8;color:var(--muted)}
.flow-room .flow-information{margin-top:12px}
.flow-room .flow-information>summary{display:list-item;min-height:44px}
.flow-room .flow-information>summary>span{display:inline;margin-left:8px}
.flow-room .flow-working,.flow-room .flow-limit{font-size:13px;line-height:1.8;color:var(--muted);margin:0 0 14px}
.flow-room .flow-session-end{margin-top:8px;text-align:right}
.flow-room .flow-session-end>button{font-size:12px;min-height:44px}
.flow-room--scenario .composer-dock{max-height:54dvh;overflow:auto;overscroll-behavior:contain}
@media(max-width:960px){
 .flow-room--scenario .room-frame{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto auto;grid-template-areas:"feedback" "task" "messages" "reference" "composer"}
 .flow-room #flow-total-timer{font-size:var(--font-caption)}
 .is-candidate.is-room .flow-room .room-clock{flex-direction:column;align-items:flex-end;gap:0}
 .is-candidate.is-room .flow-room .room-clock #timer-label{display:block;font-size:var(--font-caption)}
 .flow-room .flow-scenario{padding:12px 18px;max-height:22dvh}
 .flow-room .flow-scenario-brief{font-size:17px}
 .flow-room .flow-workspace-title{gap:4px 10px}
 .flow-room .flow-workspace-notes{display:block;margin-top:12px}
 .flow-room .flow-note+.flow-note{margin-top:12px}
 .flow-room .flow-workspace{padding:14px 18px 8px}
 .flow-room .flow-interview-actions{padding-inline:18px}
 .flow-room--scenario .composer-dock{max-height:32dvh}
}
@media(max-width:960px) and (max-height:600px){
 .flow-room--scenario .flow-scenario{max-height:18dvh}
 .flow-room--scenario .composer-dock{max-height:28dvh}
}

/* Keep the instruction's author and purpose in its label; the repeated workspace
   title adds no second task. Preserve draft status and all distinct actions. */
.flow-room .flow-command-help{margin:0 0 10px;font-size:var(--font-caption);line-height:1.7;color:var(--muted)}
.flow-room .flow-note>summary{min-height:44px}
.flow-room .flow-form-actions{flex-wrap:wrap}
.flow-room .flow-form-actions>button{white-space:normal;max-width:100%;overflow-wrap:anywhere}
@media(max-width:700px){
 .flow-room .flow-workspace{padding-top:10px}
 .flow-room .flow-command-help{font-size:12px;margin-bottom:8px}
 .flow-room .flow-workspace-notes{margin-top:8px}
 .flow-room .flow-note{padding-top:8px}
 .flow-room .flow-field{gap:6px}
}

/* The two optional editors share a compact closed row. Opening either gives
   that editor the full width; scrolling remains with the existing dock. */
@media(max-width:700px){
 .flow-room .flow-workspace-notes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;align-items:start}
 .flow-room .flow-note+.flow-note{margin-top:0}
 .flow-room .flow-note[open]{grid-column:1/-1}
}

/* Short phones keep the send action within the first view of the input dock.
   Only the instruction starts shorter; font size, resize, and 44px actions stay. */
@media(max-width:700px) and (max-height:600px){
 .flow-room--scenario .flow-command-help{display:none}
 .flow-room--scenario .flow-workspace{padding-block:4px}
 .flow-room--scenario .flow-command-form .flow-field{gap:4px}
 .flow-room--scenario .flow-command-form textarea{height:48px;min-height:48px;padding-block:8px}
 .flow-room--scenario .flow-command-form .flow-form-actions{margin-top:6px}
}

/* Action scope is expressed by placement as well as wording: current answer,
   current topic, a deliberate phase review, then the whole interview. */
.flow-room--interview .ark-message-composer__send{min-width:132px}
.flow-room .flow-interview-navigation{justify-content:space-between;align-items:center;gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.flow-room .flow-topic-actions,.flow-room .flow-stage-actions{display:flex;align-items:center;gap:8px;min-width:0}
.flow-room .flow-interview-navigation button{min-height:44px;padding:9px 14px;font-size:var(--font-label);font-weight:500;white-space:normal}
.flow-room .flow-topic-actions>button{background:var(--surface);border:1px solid var(--ark-control-line);color:var(--text)}
.flow-room .flow-stage-actions>.flow-review-link{background:var(--accent-soft);border:1px solid var(--accent-line);color:var(--ark-material-color-brand);font-weight:600}
.flow-room .flow-interview-navigation button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}

/* A new phase starts from a concrete situation. The original scenario remains
   a single scroll owner; its content is never line-clamped or ellipsized. */
.flow-room .flow-scenario{scrollbar-gutter:stable;border-bottom:1px solid var(--accent-line);box-shadow:inset 0 -1px 0 var(--line)}
.flow-room .flow-scenario-stage{margin:0 0 8px;color:var(--ark-material-color-brand);font-size:12px;font-weight:600;line-height:1.5}
.flow-room .flow-scenario-context{min-width:0}
.flow-room .flow-scenario-context h2{margin:0 0 8px;color:var(--ink);font-size:var(--font-heading);font-weight:600;line-height:1.5}
.flow-room .flow-scenario-brief{margin:0;color:var(--text);font-size:var(--font-body);line-height:1.8;overflow-wrap:anywhere}
.flow-room .flow-scenario-goal{margin:14px 0 0;padding-left:12px;border-left:2px solid var(--accent-line);font-size:var(--font-body);font-weight:500;line-height:1.8}
.flow-room .flow-scenario-goal>strong{font-size:var(--font-caption);line-height:1.6;font-weight:500;margin-bottom:4px}
.flow-room .flow-scenario-details{margin-top:10px}
.flow-room .flow-scenario-details>summary{font-weight:500}
.flow-room .flow-scenario-material{font-size:var(--font-body);line-height:1.8}

@media(max-width:700px){
 .flow-room--interview .ark-message-composer__send{grid-column:1/-1;grid-row:3;width:100%;min-height:48px}
 .is-candidate.is-room .flow-room .flow-interview-navigation{grid-column:1/-1;grid-row:4;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:2px 0 0;padding-top:10px}
 .flow-room .flow-topic-actions>button,.flow-room .flow-stage-actions>button{width:100%;padding-inline:10px}
 .flow-room .flow-scenario{max-height:26dvh;padding-block:12px}
 .flow-room .flow-scenario-context h2{font-size:var(--font-body);line-height:1.6}
 .flow-room .flow-scenario-goal{margin-top:12px}
}
@media(max-width:700px) and (max-height:600px){
 .flow-room--interview .ark-message-composer{padding-block:8px;gap:6px}
 .is-candidate.is-room .flow-room .flow-interview-navigation{padding-top:6px;margin-top:0}
 .flow-room--scenario .flow-scenario{max-height:24dvh;padding-block:8px}
 .flow-room .flow-scenario-stage{margin-bottom:6px}
 .flow-room .flow-scenario-context h2{margin-bottom:6px}
}

/* The full task can be put away after reading. Keep its disclosure within the
   same scroll owner, with a reachable summary while the original text scrolls. */
.flow-room .flow-scenario{padding:0}
.flow-room .flow-scenario-briefing{min-width:0;margin:0}
.flow-room .flow-scenario-briefing>summary{position:sticky;top:0;z-index:2;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;min-height:64px;padding:12px 24px;list-style:none;background:var(--surface);cursor:pointer}
.flow-room .flow-scenario-briefing>summary::-webkit-details-marker{display:none}
.flow-room .flow-scenario-briefing>summary>.flow-scenario-stage{grid-column:1/-1;margin:0}
.flow-room .flow-scenario-briefing>summary>h2{grid-column:1;min-width:0;margin:0;color:var(--ink);font-size:var(--font-heading);font-weight:600;line-height:1.5;overflow-wrap:anywhere}
.flow-room .flow-scenario-toggle-cue{grid-column:2;grid-row:2;display:inline-flex;align-items:center;justify-content:center;padding:2px 6px;border:1px solid var(--accent-line);border-radius:var(--control);background:var(--accent-soft);color:var(--ark-material-color-brand);font-size:var(--font-label);line-height:1.6;white-space:nowrap}
.flow-room .flow-scenario-briefing[open]>summary{border-bottom:1px solid var(--line)}
.flow-room .flow-scenario-briefing[open] .flow-scenario-cue-closed,.flow-room .flow-scenario-briefing:not([open]) .flow-scenario-cue-open{display:none}
.flow-room .flow-scenario-briefing>summary:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.flow-room .flow-scenario-briefing>.flow-scenario-context{padding:12px 24px 16px}
.flow-room .flow-scenario-briefing>.flow-scenario-details{margin:0;padding:0 24px 12px}
.flow-room .flow-scenario-goal-label{display:block;margin-bottom:4px;color:var(--muted);font-size:var(--font-caption);font-weight:500;line-height:1.6}
@media(max-width:700px){
 .flow-room .flow-scenario-briefing>summary{padding:8px 18px}
 .flow-room .flow-scenario-briefing>summary>h2{font-size:var(--font-body);line-height:1.6}
 .flow-room .flow-scenario-briefing>.flow-scenario-context{padding:8px 18px 12px}
 .flow-room .flow-scenario-briefing>.flow-scenario-details{padding:0 18px 8px}
}
@media(max-width:700px) and (max-height:600px){
 .flow-room--scenario .flow-scenario{max-height:36dvh}
}

/* Share the available scenario workspace, rather than letting the task and
   expanded editors consume the whole grid before the message track is sized.
   Each content owner scrolls inside its own track. A closed task uses only its
   summary height, returning the released space to messages and the editor. */
.flow-room--scenario .room-frame,
.flow-room--scenario .room-frame:not(:has(>.room-reference)){
 grid-template-rows:auto minmax(0,.8fr) minmax(0,1.2fr) minmax(0,1fr);
}
.flow-room--scenario .flow-scenario,
.flow-room--scenario .composer-dock{max-height:none;min-height:0;align-self:stretch}
.flow-room--scenario .room-frame:has(.flow-scenario-briefing:not([open])){
 grid-template-rows:auto auto minmax(0,1.2fr) minmax(0,1fr);
}
@media(max-width:960px){
 .flow-room--scenario .room-frame:has(>.room-reference){
  grid-template-rows:auto minmax(0,.8fr) minmax(0,1.2fr) auto minmax(0,1fr);
 }
 .flow-room--scenario .room-frame:has(>.room-reference):has(.flow-scenario-briefing:not([open])){
  grid-template-rows:auto auto minmax(0,1.2fr) auto minmax(0,1fr);
 }
}

/* Answer workspace proportions: keep text comfortable without enlarging the
   whole page or trading away the live conversation on a short viewport. */
.is-candidate.is-room .flow-room--interview .ark-message-composer {
 padding:16px 24px max(14px,env(safe-area-inset-bottom));
}
.is-candidate.is-room .flow-room .ark-message-composer__caption {
 margin-bottom:8px;font-size:var(--interview-font-meta);line-height:1.6;
}
.is-candidate.is-room .flow-room .ark-message-composer__caption label {
 font-size:var(--interview-font-meta);font-weight:500;
}
.is-candidate.is-room .flow-room--interview .ark-message-composer__row { gap:12px; }
.is-candidate.is-room .flow-room--interview .ark-message-composer__input {
 min-height:88px;max-height:min(200px,28dvh);padding:12px 16px;
 font-size:var(--interview-font-reading);font-weight:400;line-height:1.75;
 overflow-y:auto!important;
}
.is-candidate.is-room .flow-room--interview .ark-message-composer__input::placeholder {
 font-size:var(--interview-font-control);font-weight:400;line-height:1.75;
}
.is-candidate.is-room .flow-room--interview .ark-message-composer__send {
 min-width:128px;max-width:none;min-height:48px;padding:10px 16px;
 font-size:var(--interview-font-control);font-weight:550;line-height:1.6;
}
.is-candidate.is-room .flow-room .flow-interview-navigation {
 margin-top:10px;padding-top:10px;
}
.is-candidate.is-room .flow-room .flow-interview-navigation button {
 min-height:44px;font-size:var(--font-label);font-weight:500;line-height:1.6;
}
.is-candidate.is-room .flow-room .flow-field textarea {
 font-size:var(--interview-font-reading);font-weight:400;line-height:1.75;
}
.is-candidate.is-room .flow-room .flow-field { font-size:var(--font-label); }
@media(max-width:700px) {
 .is-candidate.is-room .flow-room--interview .ark-message-composer {
  padding:12px 16px max(10px,env(safe-area-inset-bottom));gap:8px;
 }
 .is-candidate.is-room .flow-room--interview .ark-message-composer__input {
  min-height:72px;max-height:min(160px,24dvh);padding:10px 12px;
 }
 .is-candidate.is-room .flow-room .ark-message-composer__caption { margin:0; }
 .is-candidate.is-room .flow-room .flow-interview-navigation { margin-top:0;padding-top:8px; }
}
@media(max-width:700px) and (max-height:600px) {
 .is-candidate.is-room .flow-room--interview .ark-message-composer { padding-block:8px;gap:6px; }
 .is-candidate.is-room .flow-room--interview .composer-dock { max-height:48dvh; }
 .is-candidate.is-room .flow-room--interview .ark-message-composer__input { min-height:64px;max-height:16dvh; }
}
