/* Workbench 2 (player/modern/workbench2.html): Workbench's guided session as
   a self-contained card, so it drops into a customer's iframe the way the
   Classic player does. Its own stylesheet, wb2- prefixed, loaded after
   modern.css (which still supplies the shared .mp-* rules).

   Everything is laid out by the card's own width (container queries on
   .mp--workbench2), never the window's, so the same markup reads the same on
   its own page, in a 1000px column and in a 360px phone-width iframe. Nothing
   is position: fixed — in an iframe that pins to the frame, not the screen. */

/* =========================================================================
   WORKBENCH 2 — a guided work session, boxed
   ========================================================================= */
.mp-body--workbench2 {
  --mp-font: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --wb2-bg: #0c0f14;
  --wb2-panel: #151a22;
  --wb2-panel-2: #1c222c;
  --wb2-line: rgba(255,255,255,.09);
  --wb2-muted: rgba(255,255,255,.55);
  /* "Done" green is the brand accent: the ticks, ring, switch and the
     Done button follow the client colours, like the play button. */
  --wb2-go: var(--sv-accent);
  --wb2-go-ink: var(--sv-text);
  --wb2-paper: #f3f5f8;
  --mp-muted: #6b7280; --mp-line: #e2e8f0;
  --mp-menu-bg: #1c222c; --mp-menu-fg: #fff; --mp-menu-hover: rgba(255,255,255,.1);
  --mp-tile-bg: var(--wb2-panel); --mp-tile-line: var(--wb2-line); --mp-tile-ic: rgba(255,255,255,.08);
  --mp-accent-text: color-mix(in oklab, var(--sv-accent) 62%, #fff);
  background: var(--wb2-paper); color: #111827;
}
/* The page around the card (mockup only): a plain light page like Classic. */
.mp--workbench2 { max-width: 1240px; margin: 0 auto; padding: 28px 28px 40px; container-type: inline-size; }
@media (max-width: 767px) { .mp--workbench2 { padding: 14px 12px 28px; } }
.mp-body--embed .mp--workbench2 { max-width: none; padding: 0; }
.mp-body--workbench2 .mp-switch { bottom: 18px; }
.wb2-intro { margin-bottom: 16px; }
.wb2-intro .mp-eyebrow { color: var(--sv-main); }
.wb2-intro p { color: #6b7280; font-size: 15px; margin: 8px 0 0; line-height: 1.5; }
.wb2-intro a { color: var(--sv-main); font-weight: 600; }

/* The card: everything the player is lives inside this dark box. */
.wb2-card { position: relative; background: var(--wb2-bg); color: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px -24px rgba(12,15,20,.55), 0 0 0 1px rgba(255,255,255,.06) inset; }
.mp-body--embed .wb2-card { border-radius: 14px; box-shadow: none; }

.wb2-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 12px; font-weight: 600; color: rgba(255,255,255,.8); white-space: nowrap; }
.wb2-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--wb2-go); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wb2-go) 25%, transparent); }
.wb2-pill--voice i { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.25); animation: wb2-blink 1.2s ease-in-out infinite; }
@keyframes wb2-blink { 50% { opacity: .35; } }


/* Picture on the left, session rail on the right when the card is wide;
   stacked when it is not. Decided by the card's width, not the window's. */
.wb2-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 18px 18px; }
.wb2-card--solo .wb2-grid { grid-template-columns: minmax(0, 1fr); }

.wb2-frame { position: relative; border-radius: 14px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.07); }
.wb2-frame .mp-stage-box { --mp-r: 14px; }
.wb2-overlay { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6,8,12,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 14px; }
.wb2-overlay__card { text-align: center; max-width: 560px; }
.wb2-overlay__k { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--mp-accent-text); }
.wb2-overlay__t { font-size: clamp(1.3rem, 4cqw, 2.2rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; }
.wb2-overlay__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.wb2-overlay--finish .wb2-overlay__k { color: var(--wb2-go); }

.wb2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 15.5px; color: #fff; background: rgba(255,255,255,.1); text-decoration: none; white-space: nowrap; transition: background .15s ease, transform .12s ease, filter .15s ease; -webkit-tap-highlight-color: transparent; }
.wb2-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.wb2-btn:hover { background: rgba(255,255,255,.18); }
.wb2-btn:active { transform: scale(.97); }
.wb2-btn--ghost { background: rgba(255,255,255,.08); border: 1px solid var(--wb2-line); }
.wb2-btn--go { background: var(--wb2-go); color: var(--wb2-go-ink); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--wb2-go) 70%, transparent); }
.wb2-btn--go:hover { background: var(--sv-hover); filter: none; }

.wb2-transport { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wb2-tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 46px; height: 46px; border-radius: 13px; border: 0; background: var(--wb2-panel); color: #fff; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; transition: background .15s ease; }
.wb2-tbtn:hover { background: var(--wb2-panel-2); }
.wb2-tbtn svg { width: 20px; height: 20px; }
.wb2-tbtn--play { width: 62px; background: var(--sv-accent); color: var(--sv-text); }
.wb2-tbtn--play:hover { filter: brightness(1.12); background: var(--sv-accent); }
.wb2-tbtn--play span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wb2-tbtn--play svg { width: 24px; height: 24px; }
.wb2-tbtn--menu { width: auto; padding: 0 16px; }
.wb2-tbtn--mic { width: auto; padding: 0 14px 0 12px; }
.wb2-tbtn--mic.is-on { background: #f43f5e; color: #fff; box-shadow: 0 0 0 4px rgba(244,63,94,.22); }
.wb2-pace { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 14px 0 12px; border-radius: 13px; background: var(--wb2-panel); color: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; user-select: none; }
.wb2-pace:hover { background: var(--wb2-panel-2); }
.wb2-pace input { position: absolute; opacity: 0; width: 0; height: 0; }
.wb2-switch { flex: 0 0 auto; width: 36px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: background .2s ease; }
.wb2-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.wb2-pace input:checked + .wb2-switch { background: var(--wb2-go); }
.wb2-pace input:checked + .wb2-switch::after { transform: translateX(14px); }
.wb2-pace input:focus-visible + .wb2-switch { outline: 2px solid var(--sv-accent); outline-offset: 2px; }
.wb2-transport__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wb2-transport .sv-menu { margin-left: 0; }
.wb2-menu-only { display: none; }
.wb2-transport { position: relative; }
.wb2-share { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 41; width: min(340px, 100%); padding: 12px; border-radius: 14px; background: var(--mp-menu-bg); color: var(--mp-menu-fg); box-shadow: 0 16px 40px -8px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); }
.wb2-share[hidden] { display: none; }
.wb2-share__h { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.wb2-share__x { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.wb2-share__x:hover { background: var(--mp-menu-hover); }
.wb2-share__x svg { width: 16px; height: 16px; }
.wb2-share__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wb2-share__b { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); color: inherit; font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; }
.wb2-share__b:hover { background: var(--mp-menu-hover); }
.wb2-share__b svg { width: 20px; height: 20px; }
.wb2-share__more { width: 100%; margin-top: 8px; padding: 9px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.wb2-share__more:hover { background: var(--mp-menu-hover); }
.wb2-menu-only .wb2-switch { width: 30px; height: 18px; }
.wb2-menu-only .wb2-switch::after { width: 12px; height: 12px; }
.wb2-menu-only[aria-checked="true"] .wb2-switch { background: var(--wb2-go); }
.wb2-menu-only[aria-checked="true"] .wb2-switch::after { transform: translateX(12px); }
.wb2-menu-only.is-on { color: #fb7185; }

/* Session row: ring | current step | buttons, in one line under the transport. */
.wb2-now { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 12px; padding: 10px 14px; background: var(--wb2-panel); border: 1px solid var(--wb2-line); border-radius: 18px; }
.wb2-ring { position: relative; width: 56px; height: 56px; flex: 0 0 auto; }
.wb2-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wb2-ring__track { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 10; }
.wb2-ring__fill { fill: none; stroke: #22c55e; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: calc(326.7 * (1 - var(--done, 0))); transition: stroke-dashoffset .5s ease; }
.wb2-ring__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.wb2-ring__num b { display: inline-block; line-height: 1; }
.wb2-ring__num small { font-size: 10px; font-weight: 700; color: var(--wb2-muted); margin-left: 1px; }
.wb2-ring__num b { font-size: 17px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wb2-now__mid { min-width: 0; }
.wb2-now__label { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The step bar seeks within the step (player_workbench2.js). The track is
   drawn 4px tall, but the element is 20px so it is easy to hit; it thickens
   under the pointer to say it can be clicked. */
.wb2-now__bar { position: relative; height: 20px; margin-top: 0; cursor: pointer; touch-action: none; }
.wb2-now__bar::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); border-radius: 4px; background: rgba(255,255,255,.1); transition: height .15s ease; }
.wb2-now__bar i { position: absolute; left: 0; top: 50%; display: block; height: 4px; width: 0; transform: translateY(-50%); border-radius: 4px; background: var(--sv-accent); transition: width .3s linear, height .15s ease; }
.wb2-now__bar:hover::before, .wb2-now__bar:hover i, .wb2-now__bar.is-dragging::before, .wb2-now__bar.is-dragging i { height: 7px; }
.wb2-now__bar.is-dragging i { transition: height .15s ease; }
.wb2-now__btns { display: flex; align-items: center; gap: 8px; }
.wb2-now__btns .wb2-btn--ghost { padding: 0 12px; font-size: 13px; height: 38px; border-radius: 10px; }
.wb2-now__btns .wb2-btn--ghost svg { width: 16px; height: 16px; }
.wb2-btn--big { height: 40px; font-size: 14.5px; border-radius: 11px; padding: 0 16px; }

/* Steps rail: top to bottom, one row per step. */
.wb2-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wb2-side > * { flex: 0 0 auto; }
.wb2-list__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 6px 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--wb2-muted); }
.wb2-list__h b { color: #22c55e; }
.wb2-list__nav { display: flex; align-items: center; gap: 6px; }
.wb2-list__nav > span { margin-right: 4px; }
.wb2-list__body { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; min-height: 0; }
/* Paging arrows either side of the sideways strip (narrow cards only); full
   strip height, greyed at an end rather than removed so the strip never
   changes width. */
.wb2-page { display: none; place-items: center; flex: 0 0 auto; width: 30px; border-radius: 10px; border: 1px solid var(--wb2-line); background: var(--wb2-panel); color: #fff; cursor: pointer; transition: background .15s ease, opacity .15s ease; }
.wb2-page:hover { background: var(--wb2-panel-2); }
.wb2-page svg { width: 18px; height: 18px; }
.wb2-page[disabled] { opacity: .3; cursor: default; background: var(--wb2-panel); }
/* The list scrolls but shows no scrollbar, the way Classic's chapter rail
   does (.chapters-scroll in player/_theme.html): wheel and touch still work,
   there is no bar down the side of the steps and no gutter reserved for one. */
.wb2-list { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; max-height: 360px; }
.wb2-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.wb2-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid transparent; background: var(--wb2-panel); color: #fff; text-align: left; font: inherit; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.wb2-row:hover { background: var(--wb2-panel-2); }
.wb2-row__box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center; color: var(--wb2-go-ink); transition: background .2s ease, border-color .2s ease; }
.wb2-row__box svg { width: 13px; height: 13px; opacity: 0; }
.wb2-row.is-done .wb2-row__box { background: var(--wb2-go); border-color: var(--wb2-go); }
.wb2-row.is-done .wb2-row__box svg { opacity: 1; }
.wb2-row.is-done .wb2-row__t { color: var(--wb2-muted); }
.wb2-row__t { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb2-row__d { font-size: 11px; color: var(--wb2-muted); font-variant-numeric: tabular-nums; }
.wb2-row.active { border-color: color-mix(in srgb, var(--sv-accent) 60%, transparent); background: color-mix(in srgb, var(--sv-accent) 14%, var(--wb2-panel)); }
.wb2-row.active .wb2-row__t { font-weight: 700; }

/* Stacked under the picture: the steps are a sideways row of cards, one
   snap per card, paged by the arrows; the scrollbar is hidden. */
@container (max-width: 859px) {
  /* Heading on the right: "Chapters | 9 of 22 Done", over the strip's end. */
  .wb2-list__h { align-items: center; justify-content: flex-end; }
  .wb2-list__h > span:first-child::after { content: '|'; margin-left: 10px; opacity: .5; }
  .wb2-page { display: grid; margin: 4px 0 6px; }
  .wb2-list { flex-direction: row; gap: 8px; max-height: none; overflow-y: hidden; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 6px; margin: 0 -2px; overscroll-behavior-x: contain; }
  .wb2-pace > span:last-child { display: none; }
  .wb2-pace { padding: 0 10px; }
  .wb2-row { flex: 0 0 calc(25% - 6px); scroll-snap-align: start; grid-template-columns: minmax(0, 1fr); grid-template-areas: "box" "t" "d"; align-items: start; gap: 6px 8px; min-height: 96px; padding: 10px 12px; border-radius: 14px; }
  .wb2-row__box { grid-area: box; }
  .wb2-row__t { grid-area: t; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .wb2-row__d { grid-area: d; align-self: end; }
}

/* ---- by the card's width ------------------------------------------------ */
/* Wide: rail beside the picture, sticky so the big button stays in reach
   while a long checklist scrolls. */
@container (min-width: 860px) {
  .wb2-grid { grid-template-columns: minmax(0, 1fr) 236px; align-items: start; }
  /* Beside the video the rail is the column's height (player_modern.js sets
     it), and the list takes whatever is left under the heading. */
  .wb2-list { max-height: none; }
}
@container (min-width: 1100px) {
  .wb2-grid { grid-template-columns: minmax(0, 1fr) 260px; }
  .wb2-now { gap: 16px; padding: 10px 16px; }
  .wb2-now__label { font-size: 16.5px; }
}
/* Narrow (a phone, or a phone-width iframe): tighter padding, no title in
   the bar, shorter pills; the rail stacks under the picture, big button first. */
@container (max-width: 560px) {
  /* Three smaller cards across, so more of the list shows at a glance. */
  .wb2-list { gap: 6px; }
  .wb2-row { flex-basis: calc((100% - 12px) / 3); min-height: 76px; padding: 8px 9px; gap: 4px; border-radius: 11px; }
  .wb2-row__box { width: 18px; height: 18px; border-radius: 6px; }
  .wb2-row__box svg { width: 11px; height: 11px; }
  .wb2-row__t { font-size: 12px; }
  .wb2-row__d { font-size: 10.5px; }
  .wb2-pill span { display: none; }
  .wb2-pill { padding: 6px 8px; }
  .wb2-grid { padding: 12px 12px 14px; gap: 12px; }
  .wb2-now { grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px; gap: 12px; }
  .wb2-now__btns { grid-column: 1 / -1; }
  .wb2-now__btns .wb2-btn--big { flex: 1 1 auto; }
  .wb2-now__btns .wb2-btn--ghost span { display: none; }
  .wb2-now__btns .wb2-btn--ghost { padding: 0 11px; }
  /* Voice and pacing move into More, and More sits right after +10s;
     its panel hangs from the row's right edge so it stays inside the card. */
  .wb2-tbtn--mic, .wb2-pace { display: none; }
  .wb2-menu-only:not([hidden]) { display: flex; }
  .wb2-transport__right { margin-left: 0; }
  .wb2-transport .sv-menu { order: -1; }
  .wb2-transport .sv-menu { position: static; }
  .wb2-transport .sv-menu-panel { right: 0; }
  .wb2-overlay { padding: 12px; }
  .wb2-overlay__btns { margin-top: 14px; }
  .wb2-overlay .wb2-btn { height: 42px; font-size: 14px; padding: 0 14px; }
}
