/* Experience v19: progressive setup and browsable guild examples.
   Load after experience-v18.css; all colours inherit the v18 brand tokens. */

.setup-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin: 0 0 25px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.setup-progress > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  gap: 7px;
  padding: 3px 0;
  line-height: 1.6;
}
.setup-progress > span.active { color: var(--accent); font-weight: 800; }
.setup-progress > span.done { color: #765566; }
.start-wizard { max-width: 830px; margin: 26px auto 0; min-width: 0; }
.start-wizard > .panel-top { margin-bottom: 24px; }
.start-wizard h2 { font-size: 16px; margin: 0 0 13px; line-height: 1.6; }
.start-wizard > p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.quick-directions.choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick-directions .choice { min-height: 91px; padding: 18px 16px; border-radius: 14px; }
.quick-directions .choice.active { padding: 17px 15px; }
.quick-directions .choice strong { font-size: 16px; }
.quick-directions .choice span { font-size: 12px; line-height: 1.75; }
.more-directions { margin: 12px 0 26px; color: var(--muted); }
.more-directions > summary {
  cursor: pointer;
  display: list-item;
  list-style-position: inside;
  min-height: 44px;
  padding: 12px 3px;
  font-size: 13px;
  line-height: 1.65;
  border-radius: 7px;
}
.more-directions > summary::marker { color: var(--accent); }
.more-directions[open] > summary { color: var(--accent); font-weight: 700; }
.more-directions .choice-grid { margin-top: 7px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.more-directions .choice { min-height: 80px; }
.difficulty-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; }
.difficulty-choice {
  min-width: 0;
  min-height: 95px;
  padding: 17px 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffcfd;
  text-align: left;
  color: var(--ink);
}
.difficulty-choice strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.5; }
.difficulty-choice span { display: block; font-size: 12px; color: var(--muted); line-height: 1.75; margin-top: 5px; overflow-wrap: anywhere; }
.difficulty-choice.active { background: #fbecf1; border-color: var(--accent); }
.difficulty-choice.active strong { color: var(--accent); }
.wizard-action { margin-top: 26px; padding-top: 21px; border-top: 1px solid var(--line); }
.wizard-action .primary { font-size: 16px; min-height: 52px; }
.wizard-action > p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.85; text-align: center; }
.start-wizard .selection-summary { margin-top: 20px; }

.ready-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 26px; align-items: start; margin-top: 25px; }
.ready-layout > *, .beginner-preview, .recording-ready { min-width: 0; }
.task-preview-details > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 700; line-height: 1.8; padding: 13px 16px; min-height: 49px; border: 1px solid var(--line); border-radius: 12px; background: #fff9fb; list-style-position: inside; }
.task-preview-details[open] > summary { margin-bottom: 12px; }
.beginner-preview { display: grid; gap: 12px; }
.beginner-preview > h2 { font-size: 16px; line-height: 1.6; margin: 0 0 2px; }
.beginner-preview > p { font-size: 13px; color: var(--muted); line-height: 1.85; margin: 0; }
.prompt-preview { border: 1px solid var(--line); border-radius: 14px; background: #fff9fb; padding: 20px 22px; }
.prompt-preview > small { display: block; color: var(--accent); font-weight: 700; font-size: 11px; line-height: 1.6; }
.prompt-preview > h3 { font-size: 17px; line-height: 1.5; margin: 9px 0; }
.prompt-preview > p { color: #6b5863; font-size: 13px; line-height: 1.85; margin: 0; }
.prompt-example { margin-top: 13px; border-top: 1px solid #eadce3; }
.prompt-example > summary { cursor: pointer; min-height: 44px; padding: 11px 0 7px; font-size: 12px; color: var(--accent); font-weight: 700; list-style-position: inside; }
.prompt-example > p { font-size: 12px; color: #78616e; line-height: 1.85; padding: 11px 14px; margin: 4px 0 0; background: #f7eaf0; border-radius: 10px; }
.recording-ready { border: 1px solid #e5d3dc; border-radius: 16px; background: #fff; padding: 25px; box-shadow: 0 8px 30px rgba(84, 36, 55, .04); }
.recording-ready > h2 { font-size: 20px; margin: 0 0 10px; line-height: 1.45; }
.recording-ready > p { font-size: 12px; color: var(--muted); line-height: 1.85; }
.recording-ready .selection-summary { margin: 0 0 20px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 15px; }
.recording-ready .consent { margin: 19px 0; font-size: 12px; line-height: 1.9; }
.recording-ready #start { min-height: 52px; }
.recording-ready #startHint { font-size: 12px; line-height: 1.8; margin: 11px 0 0; text-align: center; }
.recording-ready #demo { margin-top: 18px; box-shadow: none; }
.recording-ready .form-note { font-size: 11px; margin-top: 9px; }
#backSetup { margin-top: 16px; }

.guild-browser { margin-top: 28px; min-width: 0; }
.panel-top.guild-browser { margin-top: 0; }
.guild-browser > .intro, .guild-browser > p { color: var(--muted); font-size: 14px; line-height: 1.85; max-width: 740px; }
.guild-browser > h1 { font-size: clamp(27px, 3vw, 37px); line-height: 1.35; }
.guild-browser > h2 { font-size: 21px; margin: 0 0 11px; line-height: 1.5; }
.guild-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 21px 0 23px; }
.guild-filters button { min-height: 44px; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #6b5561; font-size: 13px; font-weight: 700; padding: 10px 15px; }
.guild-filters button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.guild-samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.guild-sample { min-width: 0; background: #fffcfd; border: 1px solid var(--line); border-radius: 16px; padding: 23px; display: flex; flex-direction: column; }
.guild-sample > .badge { align-self: flex-start; padding: 5px 9px; font-size: 11px; }
.guild-sample > h3 { font-size: 19px; line-height: 1.5; margin: 16px 0 9px; }
.guild-sample > p { font-size: 13px; line-height: 1.85; color: var(--muted); margin: 0; }
.guild-sample .tags { margin: 17px 0 20px; }
.guild-sample .tags span { font-size: 11px; padding: 5px 8px; }
.sample-toggle { min-height: 44px; width: 100%; border: 1px solid #d9b6c6; border-radius: 10px; background: #fff; color: var(--accent); padding: 11px 13px; font-size: 13px; font-weight: 800; line-height: 1.6; }
.sample-toggle[aria-expanded="true"] { background: #f8e7ee; border-color: #c1859b; }
summary.sample-toggle { display: list-item; list-style-position: inside; cursor: pointer; }
.guild-sample details.sample-detail { padding: 0; margin: 0; border: 0; }
.guild-sample details.sample-detail[open] > .sample-toggle { background: #f8e7ee; border-color: #c1859b; margin-bottom: 19px; }
.guild-sample details.sample-detail > ol { border-top: 1px solid var(--line); padding-top: 18px; }
.guild-sample details.sample-detail > p { margin: 17px 0 0; }
.sample-detail { padding-top: 20px; margin-top: 19px; border-top: 1px solid var(--line); }
.sample-detail[hidden], .guild-sample[hidden] { display: none; }
.sample-detail > p { font-size: 12px; color: var(--muted); line-height: 1.85; margin: 0 0 15px; }
.sample-detail ol { margin: 0; padding-left: 20px; display: grid; gap: 17px; }
.sample-detail li { padding-left: 3px; font-size: 12px; color: var(--accent); }
.sample-detail li strong { font-size: 13px; color: var(--ink); line-height: 1.65; }
.sample-detail li p { font-size: 12px; color: var(--muted); line-height: 1.85; margin: 6px 0 0; }
.optional-job { border: 1px solid var(--line); border-radius: 16px; margin-top: 30px; background: #fff; }
.optional-job > summary { display: list-item; list-style-position: inside; min-height: 56px; padding: 18px 22px; cursor: pointer; font-size: 14px; font-weight: 700; color: #715765; border-radius: 15px; line-height: 1.65; }
.optional-job > summary::marker { color: var(--accent); }
.optional-job[open] > summary { border-bottom: 1px solid var(--line); color: var(--accent); border-radius: 15px 15px 0 0; }
.optional-job > .invite-card { border: 0; padding: 25px; }
.optional-job .invite-card h2 { font-size: 19px; }
.optional-job .invite-card .form-note { max-width: 760px; }
.optional-job .salary-grid { max-width: 100%; }
.optional-job .field input, .optional-job .field select { width: 100%; }
.optional-job .match-result { margin-top: 18px; }

/* Beginner guidance sits with the current task, above the recording actions. */
.cue-example { margin: 13px 0 0; border-left: 2px solid #d795b3; padding: 2px 0 2px 12px; color: #f2deea; font-size: 14px; line-height: 1.8; }
.cue-example > small { color: #e5bfd1; font-size: 11px; line-height: 1.7; }
.cue-example p { font-size: 14px; line-height: 1.8; color: #f2deea; margin: 3px 0 0; }
.beginner-task-note { font-size: 12px; line-height: 1.8; color: #d5b6cb; margin: 14px 0; }
.beginner-task-note strong { color: #f5d8e9; }
.studio-side > .beginner-task-note { margin: 0 0 17px; }

@media (hover: hover) {
  .difficulty-choice:not(.active):hover { border-color: #ba7b91; background: #fff7fa; }
  .guild-filters button:not(.active):hover { border-color: #b87891; color: var(--accent); }
  .sample-toggle:hover { border-color: var(--accent); background: #fff3f8; }
  .more-directions > summary:hover { color: var(--accent); }
}

@media (max-width: 1000px) {
  .guild-samples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ready-layout { gap: 20px; }
}

@media (max-width: 820px) {
  .setup-progress { margin-bottom: 21px; }
  .ready-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .recording-ready { padding: 24px; }
  .guild-sample { padding: 21px; }
  .studio-side > .beginner-task-note { grid-column: 1 / -1; grid-row: 1; font-size: 11px; line-height: 1.6; margin: 0; }
  .beginner-studio .studio-side > .timer { grid-column: 1; grid-row: 2; }
  .beginner-studio .studio-side > .studio-actions { grid-column: 2; grid-row: 2; }
  .beginner-studio .stage-bottom { bottom: 147px; max-height: calc(100dvh - 265px); overflow-y: auto; overscroll-behavior: contain; }
  .cue-example { margin-top: 10px; padding-left: 10px; font-size: 12px; }
  .cue-example p { font-size: 12px; line-height: 1.8; }
}

@media (max-width: 520px) {
  .setup-progress { gap: 8px 16px; padding-bottom: 12px; margin-bottom: 18px; font-size: 11px; }
  .setup-progress > span { min-height: 28px; }
  .start-wizard { margin-top: 22px; }
  .start-wizard > .panel-top { margin-bottom: 20px; }
  .start-wizard h2 { font-size: 14px; margin-bottom: 10px; }
  .quick-directions.choice-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .quick-directions .choice { display: grid; grid-template-columns: minmax(72px, .42fr) minmax(0, 1fr); align-items: center; gap: 12px; min-height: 64px; padding: 12px 13px; border-radius: 12px; }
  .quick-directions .choice.active { padding: 11px 12px; }
  .quick-directions .choice strong { font-size: 14px; }
  .quick-directions .choice span { font-size: 11px; line-height: 1.7; margin: 0; }
  .more-directions { margin-top: 7px; margin-bottom: 19px; }
  .more-directions > summary { font-size: 12px; padding-top: 11px; padding-bottom: 10px; }
  .more-directions .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .more-directions .choice { min-height: 84px; }
  .difficulty-picker { gap: 9px; margin-top: 10px; }
  .difficulty-choice { padding: 13px 11px; min-height: 93px; border-radius: 12px; }
  .difficulty-choice strong { font-size: 13px; }
  .difficulty-choice span { font-size: 11px; line-height: 1.75; margin-top: 5px; }
  .wizard-action { margin-top: 21px; padding-top: 17px; padding-bottom: env(safe-area-inset-bottom); }
  .wizard-action .primary { font-size: 14px; min-height: 49px; padding: 13px 11px; }
  .wizard-action > p { font-size: 11px; line-height: 1.75; margin-top: 9px; }
  .ready-layout { margin-top: 21px; gap: 19px; }
  .beginner-preview { gap: 10px; }
  .beginner-preview > h2 { font-size: 14px; }
  .beginner-preview > p { font-size: 12px; }
  .prompt-preview { padding: 17px 15px; border-radius: 12px; }
  .prompt-preview > h3 { font-size: 15px; }
  .prompt-preview > p { font-size: 12px; line-height: 1.85; }
  .prompt-example > summary { font-size: 11px; }
  .prompt-example > p { font-size: 11px; padding: 10px 12px; }
  .recording-ready { padding: 20px 15px; border-radius: 13px; }
  .recording-ready > h2 { font-size: 18px; }
  .recording-ready .selection-summary { padding: 13px; margin-bottom: 16px; }
  .recording-ready .consent { font-size: 12px; margin: 18px 0; }
  .recording-ready #start { font-size: 14px; min-height: 49px; padding: 13px 11px; }
  .recording-ready #startHint { font-size: 11px; }
  .recording-ready #demo { font-size: 13px; margin-top: 16px; padding: 12px; }
  #backSetup { margin-top: 12px; }
  .guild-browser { margin-top: 22px; }
  .guild-browser > h1 { font-size: 26px; }
  .guild-browser > h2 { font-size: 19px; }
  .guild-browser > .intro, .guild-browser > p { font-size: 12px; line-height: 1.85; }
  .guild-filters { gap: 7px; margin: 17px 0 18px; }
  .guild-filters button { font-size: 12px; padding: 10px 11px; border-radius: 9px; }
  .guild-samples { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .guild-sample { padding: 21px 18px; border-radius: 14px; }
  .guild-sample > h3 { font-size: 18px; margin-top: 13px; }
  .guild-sample > p { font-size: 12px; }
  .guild-sample .tags { margin: 15px 0 17px; }
  .sample-toggle { font-size: 12px; }
  .sample-detail { padding-top: 17px; margin-top: 17px; }
  .sample-detail li p { font-size: 12px; }
  .optional-job { margin-top: 23px; border-radius: 13px; }
  .optional-job > summary { font-size: 13px; padding: 16px; min-height: 52px; border-radius: 12px; }
  .optional-job[open] > summary { border-radius: 12px 12px 0 0; }
  .optional-job > .invite-card { padding: 20px 15px; }
  .optional-job .invite-card h2 { font-size: 18px; }
  .beginner-studio .stage-bottom { bottom: 143px; }
  .cue-example { font-size: 11px; }
  .cue-example > small { font-size: 10px; }
  .cue-example p { font-size: 11px; }
}

@media (max-height: 520px) and (max-width: 820px) {
  .beginner-studio .stage-bottom { max-height: calc(100dvh - 245px); }
}

/* v20 acceptance: private replay and a compact, actionable demo result. */
/* Guild interaction preview: no private media or fabricated candidates. */
.guild-flow { max-width: 760px; margin: 24px auto; padding: 0 20px; }
.guild-flow-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.guild-flow-heading h1 { font-size: 28px; margin: 8px 0; }
.guild-flow-heading p,.guild-flow-notice,.guild-flow-status { font-size: 13px; line-height: 1.7; }
.guild-flow-notice { color: #664859; background: #f5edf1; border-radius: 12px; padding: 12px 14px; }
.guild-flow-stage { height: min(62dvh,580px); min-height: 340px; overflow: hidden; border-radius: 22px; background: #211923; color: #fff; touch-action: none; outline-offset: 4px; }
.guild-flow-scene { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; box-sizing: border-box; background: linear-gradient(155deg,#342a3d,#1b151d); }
.guild-flow-badge { align-self: start; color: #f4dce8; border: 1px solid #725667; border-radius: 99px; padding: 5px 10px; font-size: 12px; }
.guild-flow-placeholder { text-align: center; padding: 20px 0; color: #ddd0dc; }
.guild-flow-placeholder > span { display: block; font-size: 32px; margin-bottom: 12px; }
.guild-flow-placeholder strong { font-size: 19px; }
.guild-flow-placeholder p { font-size: 12px; color: #c1b1c0; }
.guild-flow-info h2 { color: #fff; font-size: 27px; margin: 7px 0; }
.guild-flow-info p { color: #e5d9e2; font-size: 13px; }
.guild-flow-info small { color: #c8b6c6; }
.guild-flow-facts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.guild-flow-facts span { padding: 5px 8px; border-radius: 8px; background: #4b3c4c; }
.guild-flow-info .guild-flow-cue { margin-bottom: 0; color: #f3cadb; }
.guild-flow-controls { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 12px; padding-bottom: env(safe-area-inset-bottom); }
.guild-flow-controls button { min-height: 48px; padding: 10px 5px; font-size: 13px; }
.guild-flow-controls button:disabled { opacity: .45; cursor: default; }
.guild-flow-empty { display: flex; height: 100%; padding: 26px; box-sizing: border-box; flex-direction: column; justify-content: center; text-align: center; }
.guild-flow-empty h2 { color: white; }
.guild-flow-empty p { color: #e3d4df; }
.guild-flow-reference { max-width: 760px; margin: 24px auto; padding: 0 20px; }
.guild-flow-reference > summary { padding: 14px 0; cursor: pointer; font-size: 13px; }
.guild-flow-reference .panel { padding: 0; margin: 0; }
.guild-flow-dialog-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #21142199; padding: 20px; }
.guild-flow-dialog { width: min(440px,100%); max-height: calc(100dvh - 40px); overflow: auto; box-sizing: border-box; background: white; border-radius: 20px; padding: 22px; color: #402335; }
.guild-flow-dialog h2 { font-size: 23px; margin: 0 0 10px; }
.guild-flow-dialog-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
@media (max-width:600px) {
  .guild-flow { padding: 0 12px; margin-top: 15px; }
  .guild-flow-heading h1 { font-size: 23px; }
  .guild-flow-heading .back { white-space: nowrap; font-size: 11px; }
  .guild-flow-stage { min-height: 310px; height: 52dvh; border-radius: 18px; }
  .guild-flow-scene { padding: 17px; }
  .guild-flow-controls { gap: 6px; }
  .guild-flow-controls button { font-size: 12px; }
}
.result-replay { margin: 22px 0; padding: 16px; border: 1px solid #eadde5; border-radius: 16px; background: #faf7f9; }
.result-replay video { display: block; width: 100%; max-height: 360px; border-radius: 12px; background: #171219; object-fit: contain; }
.result-replay .back { display: inline-block; margin: 6px 0 0; }
.demo-next-action { margin: 20px 0; padding: 20px; border: 1px solid #eadde5; border-radius: 16px; background: #faf7f9; }
.demo-next-action strong { color: #492439; }
.demo-next-action p { font-size: 14px; margin: 8px 0 16px; }
.demo-card-layout.card-layout { display: block; }
.demo-card-layout .score-card { width: 100%; }
.saved-record-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0; padding: 15px; border: 1px solid #eadde5; border-radius: 12px; }
.saved-record-entry strong { font-size: 14px; }
@media (max-width: 600px) {
  .demo-next-action { padding: 15px; margin: 16px 0; }
  .demo-next-action p { font-size: 12px; }
  .result-replay { padding: 12px; }
  .result-replay video { max-height: 260px; }
}

.simple-setup .recording-ready { margin: 16px 0; }
.simple-setup .setup-selection { margin: 0 0 10px; font-weight: 600; }
.simple-setup .setup-options, .simple-setup .task-preview-details { margin: 12px 0; }
.simple-setup .setup-options > summary { cursor: pointer; }
.simple-setup .quick-directions .choice { min-height: 56px; }
.guild-live-empty .panel-card { max-width: 720px; }
.guild-preview-only { max-width: 1120px; margin: 20px auto; }
/* Keep the first action in view on narrow phones without overlaying choices. */
@media (max-width: 360px) {
  .setup-progress { padding-bottom: 8px; margin-bottom: 12px; }
  .start-wizard { margin-top: 8px; }
  .start-wizard > .panel-top { margin-bottom: 12px; }
  .start-wizard .panel-top h1 { font-size: 24px; line-height: 1.35; margin: 10px 0; }
  .start-wizard .panel-top p { font-size: 12px; line-height: 1.75; }
  .quick-directions.choice-grid { gap: 7px; }
  .quick-directions .choice { min-height: 52px; padding: 9px 13px; }
  .quick-directions .choice.active { padding: 8px 12px; }
  .quick-directions .choice span { line-height: 1.6; }
  .more-directions { margin-top: 4px; margin-bottom: 11px; }
  .difficulty-picker { margin-top: 8px; }
  .difficulty-choice { min-height: 84px; padding: 10px 11px; }
  .difficulty-choice span { line-height: 1.6; }
  .wizard-action { margin-top: 16px; padding-top: 12px; }
  .wizard-action > p { margin-top: 7px; }
}
