/* Xplicit Workout Builder: interface styles.
   Tokens and components follow Claude Design's "Workout Builder V1 — Interface Design & Handoff Spec" and the V1
   prototype's own stylesheet. App UI only: the exported video's graphics come from the approved kits. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/barlow-normal-400-latin.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500 600; font-style: normal; font-display: swap; src: url(../fonts/barlow-normal-600-latin.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700 800; font-style: normal; font-display: swap; src: url(../fonts/barlow-normal-700-latin.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 100 900; font-style: normal; font-display: swap; src: url(../fonts/montserrat-variable-latin.woff2) format("woff2"); }
@font-face { font-family: "Exo 2"; font-weight: 900; font-style: italic; font-display: swap; src: url(../fonts/Exo2-BlackItalic.ttf) format("truetype"); }
@font-face { font-family: "Kanit"; font-weight: 600; font-style: italic; font-display: swap; src: url(../fonts/Kanit-SemiBoldItalic.ttf) format("truetype"); }
@font-face { font-family: "Lato"; font-weight: 900; font-style: normal; font-display: swap; src: url(../fonts/Lato-Black.ttf) format("truetype"); }

:root {
  --bg-base: #0B0B0C; --bg-chrome: #0E0E10; --bg-inspector: #111113; --bg-panel: #141416; --bg-raised: #1C1C1F;
  --bg-track: #17171A; --bg-dialog: #121214;
  --border: #232327; --border-input: #34343A; --border-chrome: #1E1E22;
  --text: #F4F4F1; --text-2: #A8A8A3; --text-label: #8F8F8A; --text-3: #B9B9B4;
  --yellow: #FFD600; --yellow-hover: #FFE14D; --yellow-press: #E0BC00; --tint: rgba(255, 214, 0, .12);
  --ok: #6BE39A; --warn: #FFB25B; --err: #FF7A7A;
  --rep-bar: #FBEF00; --ring: #FFD351; --ring-track: #856A28;
  --shadow: 0 30px 80px rgba(0, 0, 0, .6);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;   /* Plex if installed, else the Mac's monospace */
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg-base); color: var(--text); font: 14px/1.4 Barlow, system-ui, sans-serif; overflow: hidden; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--yellow); }
h1, h2, h3 { margin: 0; }

/* ---------- components (prototype classes) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.btn:focus-visible, .chip:focus-visible, .card:focus-visible, .cellbtn:focus-visible, .rail:focus-visible, .row:focus-visible, .seg:focus-visible, .tile:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.btn-primary { background: var(--yellow); color: var(--bg-base); }
.btn-primary:hover { background: var(--yellow-hover); } .btn-primary:active { background: var(--yellow-press); }
.btn-secondary { background: var(--bg-raised); color: var(--text); border-color: #3A3A40; }
.btn-secondary:hover { border-color: #5C5C63; background: #232327; }
.btn-ghost { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--bg-raised); color: var(--text); }
.btn-danger { background: transparent; color: var(--err); border-color: #4A2626; }
.btn-danger:hover { background: #2A1515; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .38; cursor: not-allowed; }
.iconbtn { width: 36px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid #2E2E33; background: transparent; color: var(--text-3); font-weight: 600; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: #4A4A50; color: var(--text); }
.chip-on, .chip-on:hover { background: var(--tint); border-color: var(--yellow); color: var(--yellow); }
.lbl { font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-label); }
.ttl { font-family: Montserrat, sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.mono { font-family: var(--mono); font-weight: 500; }
.input { height: 36px; width: 100%; background: #0F0F11; border: 1px solid var(--border-input); border-radius: 8px; color: var(--text); padding: 0 12px; font-size: 14px; }
.input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 214, 0, .18); }
.input[readonly] { color: var(--text-3); background: var(--bg-panel); }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #B9B9B4 50%), linear-gradient(135deg, #B9B9B4 50%, transparent 50%); background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 68px; height: 64px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 11.5px; cursor: pointer; }
.rail:hover { background: var(--bg-track); color: var(--text); }
.rail-on, .rail-on:hover { background: var(--tint); color: var(--yellow); }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; color: inherit; font: inherit; }
.card:hover { border-color: #3E3E44; }
.card-on, .card-on:hover { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; }
.st-ok { color: var(--ok); } .st-review { color: var(--warn); } .st-err { color: var(--err); } .st-muted { color: var(--text-label); }
.dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.row:hover { background: #1A1A1D; }
.row-on, .row-on:hover { background: rgba(255, 214, 0, .08); border-color: rgba(255, 214, 0, .55); }
.cellbtn { position: absolute; inset: 0; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; z-index: 3; }
.seg { height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--text-3); font-weight: 700; font-size: 12.5px; border-radius: 7px; cursor: pointer; }
.seg:hover { color: var(--text); }
.seg-on, .seg-on:hover { background: var(--text); color: var(--bg-base); }
.segy-on, .segy-on:hover { background: var(--yellow); color: var(--bg-base); }
.segs { display: flex; gap: 2px; padding: 3px; background: var(--bg-track); border: 1px solid #26262A; border-radius: 10px; }
.tile { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid #26262A; background: var(--bg-track); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.tile:hover { border-color: #4A4A50; } .tile[disabled] { opacity: .45; cursor: not-allowed; }
.tile-cur { border-color: var(--yellow); }
.scroll { overflow: auto; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: #2C2C31; border-radius: 10px; border: 2px solid var(--bg-base); }
.scrub { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; position: absolute; inset: 0; }
.scrub::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 999px; background: var(--yellow); margin-top: -5px; border: 2px solid var(--bg-base); }
.scrub::-moz-range-thumb { width: 14px; height: 14px; border-radius: 999px; background: var(--yellow); border: 2px solid var(--bg-base); }
.scrub:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 220px; border: 1.5px dashed #45454C; border-radius: 14px; background: var(--bg-inspector); cursor: pointer; color: var(--text-3); text-align: center; }
.drop:hover, .drop.over { border-color: var(--yellow); color: var(--text); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.35; }
.check .t { font-weight: 600; } .check .d { color: var(--text-2); font-size: 13px; }
.pbar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.pbar > div { height: 100%; background: var(--yellow); transition: width .2s linear; }
.badge { position: absolute; font-weight: 800; font-size: 11px; letter-spacing: .06em; padding: 4px 7px; border-radius: 5px; z-index: 2; }
.badge-new { top: 8px; left: 8px; background: var(--yellow); color: var(--bg-base); }
.badge-in { top: 8px; right: 8px; background: rgba(11, 11, 12, .82); color: var(--text); font-weight: 700; border: 1px solid #3A3A40; letter-spacing: 0; }
.badge-dur { bottom: 8px; right: 8px; background: rgba(11, 11, 12, .82); color: var(--text); font-size: 11.5px; padding: 3px 6px; letter-spacing: 0; font-weight: 500; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--bg-track); color: var(--text-3); font-size: 13px; line-height: 1.5; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #2A2111; border: 1px solid #6B5320; flex-wrap: wrap; }
.banner-err { background: #2A1515; border-color: #5A2A2A; }
.field { display: flex; flex-direction: column; gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.muted { color: var(--text-2); } .small { font-size: 12.5px; }

/* ---------- app frame ---------- */
.app { height: 100vh; min-height: 640px; display: flex; flex-direction: column; position: relative; }
.topbar { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--border-chrome); background: var(--bg-chrome); }
.brand { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 150px; line-height: 1; }
.brand img { height: 19px; width: auto; display: block; }
.brand span { font-size: 10.5px; color: var(--text-2); font-weight: 600; letter-spacing: .1em; }
.planbar { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.planname { max-width: 340px; height: 34px; background: transparent; border-color: transparent; font-weight: 600; font-size: 15px; }
.planname:hover { border-color: #2A2A2E; }
.body { flex: 1; min-height: 0; display: flex; }
.railnav { width: 84px; flex-shrink: 0; border-right: 1px solid var(--border-chrome); background: var(--bg-chrome); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; }
.railsep { width: 40px; height: 1px; background: #24242A; margin: 4px 0; }
.view { flex: 1; min-width: 0; display: flex; }
.pagehead { padding: 22px 28px 14px; display: flex; flex-direction: column; gap: 16px; border-bottom: 1px solid #1A1A1E; }
.pagehead h1 { font-size: 24px; }
.pagehead p { margin: 6px 0 0; color: var(--text-2); }
.headrow { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.headrow > div:first-child { flex: 1; min-width: 220px; }

/* ---------- library ---------- */
.libmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 300px; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 10px; }
.search .input { padding-left: 36px; }
.vsep { width: 1px; height: 22px; background: #2A2A2E; }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.thumb { position: relative; aspect-ratio: 1 / 1; background: #000; width: 100%; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.cardbody { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 5px; width: 100%; }
.cardbody .nm { font-weight: 700; font-size: 15px; color: var(--text); }
.cardbody .mt { color: var(--text-2); font-size: 13px; }
.cardfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.drawer { width: 400px; flex-shrink: 0; border-left: 1px solid var(--border-chrome); background: var(--bg-inspector); display: flex; flex-direction: column; }
.drawer video { width: 100%; aspect-ratio: 1 / 1; background: #000; border-radius: 10px; display: block; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding-top: 12px; border-top: 1px solid #222226; }
.facts > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.facts span:last-child { font-size: 13px; word-break: break-word; }
.togglechips { display: flex; flex-wrap: wrap; gap: 6px; }
.togglechips .chip { height: 28px; font-size: 12.5px; }
.history { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 12px; }

/* ---------- block editor ---------- */
.editor { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.canvaswrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 26px 28px 18px; }
.canvas { position: relative; }
.grid { width: var(--grid, 560px); height: var(--grid, 560px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 1px; background: #000; box-shadow: var(--shadow); }
.cell { position: relative; overflow: hidden; background: #050505; }
.cell video { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.cell.sel { box-shadow: inset 0 0 0 3px var(--yellow); }
.cell.sel::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--yellow); z-index: 2; pointer-events: none; }
.replabel { position: absolute; top: 13px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; z-index: 1; }
.replabel .bar { height: 3px; width: 100%; background: var(--rep-bar); }
.replabel .txt { margin-top: 9px; font-family: Montserrat, sans-serif; font-weight: 900; font-size: calc(var(--grid, 560px) * .0375); color: #fff; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.edited { position: absolute; left: 10px; bottom: 10px; background: var(--yellow); color: var(--bg-base); font-weight: 800; font-size: 11px; padding: 3px 7px; border-radius: 5px; z-index: 1; }
.empty-cell { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-weight: 600; z-index: 1; }
.timer { position: relative; overflow: hidden; background: #060305; }
.timer .ring { position: absolute; left: 3.6%; top: 52%; width: 43%; aspect-ratio: 1; }
.timer .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: Lato, sans-serif; font-weight: 900; font-size: calc(var(--grid, 560px) * .082); color: #fff; }
.timer .cap { position: absolute; left: 12px; top: 12px; color: #6E6E69; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; }
.seltag { position: absolute; transform: translateY(-100%); padding-bottom: 6px; display: flex; gap: 6px; align-items: center; z-index: 4; }
.seltag span { background: var(--yellow); color: var(--bg-base); font-weight: 800; font-size: 11.5px; letter-spacing: .05em; padding: 4px 8px; border-radius: 5px; }
.seqstrip { padding: 0 28px 22px; }
.seqstrip .panel { padding: 12px 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seqtrack { flex: 1; min-width: 280px; display: flex; gap: 3px; height: 34px; }
.seqtrack > div { display: flex; align-items: center; padding: 0 10px; font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; background: #1E1E22; }
.seqtrack .cur { background: rgba(255, 214, 0, .16); border: 1px solid rgba(255, 214, 0, .55); color: var(--yellow); font-weight: 700; }
.inspector { flex: 1 1 380px; max-width: 420px; min-width: 340px; border-left: 1px solid var(--border-chrome); background: var(--bg-inspector); padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 18px; }
.exrow .letter { width: 26px; height: 26px; border-radius: 6px; background: #232327; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--text); flex-shrink: 0; }
.exrow img, .exrow .noimg { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #000; flex-shrink: 0; }
.exrow .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exrow .info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selpanel { padding: 16px; display: flex; flex-direction: column; gap: 16px; border-color: rgba(255, 214, 0, .4); }
.selhead { display: flex; gap: 12px; align-items: center; }
.selhead img, .selhead .noimg { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #000; flex-shrink: 0; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border-input); border-radius: 8px; overflow: hidden; }
.stepper .btn { border-radius: 0; }
.stepper input { width: 64px; border: 0; border-radius: 0; text-align: center; font-size: 16px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.leadcard { position: relative; height: 128px; border-radius: 10px; background: #15140F; overflow: hidden; border: 1px solid var(--border); }
.leadcard .bar { position: absolute; left: 14px; top: 14px; width: 6px; height: 100px; background: var(--yellow); transform: skewX(-10deg); }
.leadcard .lines { position: absolute; left: 30px; top: 16px; right: 8px; display: flex; flex-direction: column; gap: 3px; }
.leadcard .head { font-family: "Exo 2", sans-serif; font-style: italic; font-weight: 900; font-size: 16px; color: var(--yellow); letter-spacing: .01em; }
.leadcard .line { font-family: Kanit, sans-serif; font-style: italic; font-weight: 600; font-size: 14.5px; color: #fff; white-space: nowrap; }
.leadcard .line span { color: var(--yellow); }
.leadcard .line.over { color: var(--err); }

/* ---------- watch ---------- */
.watch { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; background: #000; }
.stage { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 18px 24px 20px; gap: 14px; overflow: auto; }
.stage > .w { width: 100%; max-width: 860px; }
.watchtag { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--text); color: var(--bg-base); font-weight: 800; font-size: 12px; letter-spacing: .06em; }
.screen { width: min(100%, calc(100vh - 300px), 640px); aspect-ratio: 1 / 1; background: #000; position: relative; border: 1px solid var(--border-chrome); flex-shrink: 0; }
.screen video { width: 100%; height: 100%; display: block; cursor: pointer; }
.screen .empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-2); text-align: center; padding: 30px; }
.track { position: relative; height: 28px; }
.track .segs-bg { position: absolute; left: 0; right: 0; top: 11px; height: 6px; display: flex; gap: 2px; }
.track .segs-bg div { background: #3A3A40; }
.track .segs-bg div.strength { background: #6B5A12; }
.track .segs-bg div:first-child { border-radius: 3px 0 0 3px; } .track .segs-bg div:last-child { border-radius: 0 3px 3px 0; }
.track .played { position: absolute; left: 0; top: 11px; height: 6px; background: var(--yellow); border-radius: 3px; pointer-events: none; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.playbtn { width: 52px; height: 44px; border-radius: 999px; }
.jump { flex: 1 1 300px; max-width: 340px; min-width: 280px; border-left: 1px solid #1A1A1E; background: var(--bg-base); padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.jump .row { padding: 12px; }
.jump .sw { width: 10px; height: 34px; border-radius: 3px; flex-shrink: 0; }

/* ---------- exports ---------- */
.exports { flex: 1; min-width: 0; padding: 22px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.jobcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.stagetiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stagetiles > div { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 8px; background: var(--bg-track); border: 1px solid #26262A; }
.stagetiles > div.working { border-color: rgba(255, 214, 0, .55); }
.stagetiles > div.done { border-color: rgba(107, 227, 154, .35); }
.stagetiles > div.failed { border-color: #5A2A2A; }
.exportrow { padding: 12px 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.exportrow img { width: 54px; height: 54px; border-radius: 6px; object-fit: cover; background: #000; }

/* ---------- dialogs and toast ---------- */
.overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .66); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 20; }
.dialog { max-width: 100%; max-height: 100%; background: var(--bg-dialog); display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); padding: 22px; }
.dialog-head { display: flex; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 18px; flex: 1; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #000; flex-shrink: 0; }
.tile .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg-base); font-weight: 600; padding: 11px 16px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: flex; align-items: center; gap: 10px; z-index: 30; }
.toast.err { background: #3A1A1A; color: #FFD2D2; }

/* Narrower laptop windows: keep everything reachable. */
@media (max-width: 1360px) {
  .inspector { min-width: 320px; flex-basis: 330px; padding: 16px 14px 20px; }
  .drawer { width: 360px; }
  .topbar .btn .lbltext { display: none; }
}
@media (max-height: 820px) {
  .canvaswrap { padding-top: 22px; padding-bottom: 10px; }
}

/* ---------- workout timeline ---------- */
.tlstrip { display: flex; gap: 2px; height: 58px; }
.tlseg { position: relative; min-width: 6px; border: 1px solid transparent; border-radius: 4px; color: var(--text); font: inherit; font-size: 11.5px; font-weight: 700; padding: 0 6px; cursor: pointer; overflow: hidden; text-align: left; display: flex; align-items: center; }
.tlseg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlseg.rest { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .05) 5px 7px) !important; }
.tlseg:hover { border-color: #5C5C63; }
.tlseg.on { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.tlseg .tlstate { position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; border-radius: 99px; }
.tlstate.programmed { background: var(--ok); } .tlstate.incomplete, .tlstate.empty { background: var(--warn); }
.tlruler { position: relative; height: 20px; margin-top: 4px; }
.tlruler span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--text-label); }
.tlruler span:first-child { transform: none; } .tlruler span:last-child { transform: translateX(-100%); }
.tllegend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 28px 4px; font-size: 12.5px; color: var(--text-3); }
.tllegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tlhead, .tlrow { display: grid; grid-template-columns: 10px 26px minmax(160px, 1.6fr) 120px 64px minmax(110px, 1fr) minmax(130px, 1.1fr); gap: 12px; align-items: center; }
.tlhead { padding: 8px 10px; font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-label); }
.tlrow { width: 100%; padding: 9px 10px; border-radius: 9px; border: 1px solid transparent; background: var(--bg-panel); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tlrow:hover { border-color: #3E3E44; }
.tlrow.rest { background: transparent; padding-top: 5px; padding-bottom: 5px; color: var(--text-2); }
.tlrow.rest b { font-weight: 600; }
.tlrow .sw { width: 10px; height: 26px; border-radius: 3px; }
.tlrow.rest .sw { height: 14px; }
.tlrow .n { color: var(--text-label); font-size: 12px; text-align: right; }
.tlrow .nm { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tlrow .nm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlrow .t, .tlrow .d { font-size: 13px; }
.tlrow .stc { display: flex; gap: 8px; flex-wrap: wrap; }
.tlrow.row-on { border-color: rgba(255, 214, 0, .55); background: rgba(255, 214, 0, .08); }
.blockpill { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255, 214, 0, .45); color: var(--yellow); font-weight: 700; font-size: 12px; letter-spacing: .04em; }

/* ---------------------------------------------------------------- boxing editor (Assignment 011) */
.bxstage{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;padding:16px 28px;max-width:980px}
.bxstill{margin:0;display:flex;flex-direction:column;gap:6px}
.bxstill img{width:100%;aspect-ratio:1/1;object-fit:cover;background:#000;border-radius:10px;border:1px solid var(--line, #2A2A2E);display:block;transition:opacity .2s}
.bxstill img.loading{opacity:.45}
.bxstill figcaption{font-size:12.5px;color:var(--text-2);letter-spacing:.02em}
.bxstage > .muted{grid-column:1/-1}
.bxempty{grid-column:1/-1;min-height:260px;border:1px dashed #2E2E33;border-radius:12px;display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;color:var(--text-2);text-align:center;padding:20px}
.bxfoot{display:flex;gap:10px;align-items:center;padding:8px;border-radius:10px;background:var(--bg-panel, #151518);border:1px solid #2A2A2E}
.bxfoot img,.bxfoot .noimg{width:56px;height:56px;border-radius:8px;object-fit:cover;flex:0 0 56px;background:#0B0B0C}
.bxfoot.empty{color:var(--text-2)}
.fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}

/* Warm-up editor (Assignment 012) */
.wubar { display: flex; gap: 2px; height: 40px; border-radius: 8px; overflow: hidden; }
.wubar > div { display: flex; align-items: center; padding: 0 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 3px; }
.wubar .p1 { background: rgba(255, 214, 0, .16); color: var(--yellow); border-bottom: 3px solid var(--yellow); }
.wubar .p1.empty { background: #1A1A1D; color: var(--text-3); border-bottom-color: #3A3A40; }
.wubar .p2 { background: #2A2A30; color: var(--text-2); border-bottom: 3px solid #6A6A72; }
.wubar .p2.rep { background: #222227; }
.wuruler { position: relative; height: 18px; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.wuruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.wuruler span:first-child { transform: none; } .wuruler span:last-child { transform: translateX(-100%); }
.wurow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.wurow .letter { width: 26px; height: 26px; border-radius: 6px; background: #232327; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.wurow img, .wurow .noimg { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #000; flex-shrink: 0; }
.wufields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(150px, 2fr) minmax(110px, 1.2fr) 90px; gap: 8px 10px; }
.wufields .wutake { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wurow.seq .wutake { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wubtns { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.wuempty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px; border: 1px dashed #2E2E33; border-radius: 12px; color: var(--text-2); text-align: center; }
.wuswitch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.wuswitch input { width: 18px; height: 18px; margin-top: 2px; accent-color: #FFD600; }
.wuswitch > span { display: flex; flex-direction: column; gap: 2px; }

/* Stability / Mobility editor and footage picker (Assignment 014, the approved UX redesign) */
.gridedit { padding: 22px 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.gridcols { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.gridslots { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.slotcard { padding: 16px; display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; }
.slotfoot { width: 172px; display: flex; flex-direction: column; gap: 8px; }
.slottile { position: relative; width: 172px; height: 172px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid #2A2A2E; padding: 0; cursor: pointer; display: block; }
.slottile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.slotempty { cursor: default; border: 1.5px dashed #9A6A2E; background: #111113; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 10px; color: var(--text-2); }
.slotbusy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--yellow); background: #111113; }
.draftbadge { position: absolute; left: 8px; top: 8px; background: #FFB25B; color: #0A0A0A; font-weight: 800; font-size: 10px; padding: 2px 5px; border-radius: 4px; letter-spacing: .04em; }
.playtag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; background: rgba(10,10,10,.8); color: #F5F5F2; font-weight: 700; font-size: 11.5px; padding: 4px 7px; border-radius: 6px; }
.draftbtn { background: rgba(255,178,91,.14); color: #FFB25B; border: 1px solid #6B5320; }
.slotbody { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 14px; }
.slotnum { width: 26px; height: 26px; border-radius: 7px; background: var(--yellow); color: #0A0A0A; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }
.slotname { height: 44px; font-size: 17px; font-weight: 700; }
.stepper input[type=number] { width: 66px; height: 36px; border: 0; border-radius: 0; text-align: center; font-size: 17px; -moz-appearance: textfield; }
.gridpreview { flex: 1 1 300px; max-width: 360px; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.minigrid { width: 100%; aspect-ratio: 1 / 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: #000; padding: 1px; }
.mini { position: relative; overflow: hidden; background: #050505; }
.mini video { width: 100%; height: 100%; object-fit: cover; display: block; }
.minilabel { position: absolute; top: 9px; right: 8px; display: flex; flex-direction: column; align-items: flex-end; }
.minilabel .bar { height: 2px; width: 100%; background: #FBEF00; }
.minilabel .txt { margin-top: 6px; font-family: Montserrat, sans-serif; font-weight: 900; font-size: 12.5px; color: #fff; line-height: 1; }
.minitimer svg { position: absolute; left: 12px; top: 50%; width: 74px; height: 74px; margin-top: -37px; }
.minitimer span { position: absolute; left: 12px; top: 50%; margin-top: -37px; width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 24px; color: #fff; }
.scopetag { align-self: flex-start; display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-weight: 700; font-size: 12px; background: #1E1E21; color: var(--text-2); border: 1px solid #303035; }
.steptag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-weight: 700; font-size: 12px; background: #1E1E21; color: var(--text-2); border: 1px solid #303035; }
.steptag.on { background: rgba(255,214,0,.14); color: var(--yellow); border-color: rgba(255,214,0,.5); }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.picktile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 10px; border: 1px solid #2A2A2E; background: #151517; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.picktile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; display: block; background: #000; }
.picktile .nm { font-weight: 700; font-size: 13px; padding: 0 2px; }
.picktile.on { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.picktile .draftbadge { left: 10px; top: 10px; }
.picksel { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.pickvideo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #000; border-radius: 10px; display: block; }
.pickempty { aspect-ratio: 1 / 1; border-radius: 10px; border: 1px dashed #36363B; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--text-2); }
.apprsw { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #111113; cursor: pointer; }
.apprsw input { width: 18px; height: 18px; margin-top: 2px; accent-color: #FFD600; }
.apprsw > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.saveerr { display: inline-flex; align-items: center; gap: 8px; max-width: 520px; }
.saveerr .small { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
/* the save state never runs under the header's buttons: the plan bar shrinks, and the error's reason (also shown in
   the toast and on hover) gives way first */
.planbar { min-width: 0; }
#saveState { min-width: 0; overflow: hidden; }
.saveerr { min-width: 0; }
.saveerr .st, .saveerr .btn { flex-shrink: 0; }
.saveerr .small { min-width: 0; flex: 1 1 auto; }
@media (max-width: 1180px) { .saveerr .small { display: none; } }
/* while a save has failed, "Try again" stays visible: the workout name gives way instead */
.planbar .planname { flex: 0 1 auto; min-width: 90px; }
#saveState:has(.saveerr) { flex-shrink: 0; }

/* Assignment 015: Strength's "plays twice" note, and the warm-up editor in the redesign's footage workflow */
.copynote { padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-color: rgba(255, 214, 0, .35); }
.devbadge { position: absolute; right: 10px; top: 10px; background: #2A2A30; color: #FFB25B; font-weight: 800; font-size: 10px; padding: 2px 5px; border-radius: 4px; letter-spacing: .04em; }
.wupart { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.wuparthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wupartname { font-family: Montserrat, Barlow, system-ui, sans-serif; font-weight: 900; font-size: 20px; text-transform: uppercase; }
.fixedtag { border: 1px solid #3A3A40; border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.wurowhead, .wurow2 { display: grid; grid-template-columns: 28px 76px minmax(150px, 2fr) minmax(120px, 1.3fr) 112px auto; gap: 10px 12px; align-items: start; }
.wurowhead { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 0 12px; }
.wurow2 { padding: 10px 12px; border-radius: 12px; background: #111113; border: 1px solid #222226; }
.wurow2 .letter { width: 26px; height: 26px; margin-top: 4px; border-radius: 6px; background: #232327; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.wurow2 .field { gap: 6px; min-width: 0; }
.wustatus { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wustatus .st { white-space: normal; }
.wubtns2 { display: flex; gap: 2px; }
.wufoot { position: relative; }
.wutile { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid #2A2A2E; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.wutile.big { width: 100%; height: auto; aspect-ratio: 1; }
.wutile img, .wutile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wutile video { opacity: 0; transition: opacity .15s; }
.wutile video.on { opacity: 1; }
.wutile.none { border: 1.5px dashed #9A6A2E; background: #111113; flex-direction: column; gap: 4px; }
.wutile .draftbadge { left: 6px; top: 6px; z-index: 1; }
.wutile:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.wumenu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; display: flex; flex-direction: column; padding: 6px; border-radius: 10px; background: #1C1C20; border: 1px solid #333338; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.wumenu button { text-align: left; padding: 8px 10px; border-radius: 7px; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.wumenu button:hover, .wumenu button:focus-visible { background: #2A2A30; outline: none; }
.shadowgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.shadowtile { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shadowtile .st { white-space: normal; }
@media (max-width: 760px) { .shadowgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .wurowhead { display: none; }
  /* two lines: name and label, then seconds and the move / remove buttons */
  .wurow2 { grid-template-columns: 28px 76px minmax(0, 1fr) minmax(0, 1fr); }
  .wurow2 > .letter, .wurow2 > .wufoot { grid-row: span 2; }
  .wurow2 > .field:nth-of-type(4) { grid-column: 3; }
  .wurow2 .wubtns2 { grid-column: 4; justify-self: end; align-self: start; }
}

/* Assignment 016: the workout workspace (five programming sections, the editor, the reference timeline strip) and
   the Boxing editor */
.workspace { flex: 1; min-width: 0; display: flex; }
.seclist { width: 236px; flex-shrink: 0; border-right: 1px solid var(--border-chrome); background: var(--bg-chrome); padding: 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.secrow { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.secrow:hover { background: var(--bg-track); }
.secrow.on { background: var(--tint); border-color: rgba(255, 214, 0, .45); }
.secrow .secnum { font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 12px; color: var(--text-3); padding-top: 2px; }
.secrow.on .secnum, .secrow.on b { color: var(--yellow); }
.sectext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sectext b { font-size: 14.5px; }
.sectext .st { white-space: normal; font-size: 11.5px; }
.wsmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wseditor { flex: 1; min-height: 0; display: flex; }
.wsfoot { flex-shrink: 0; border-top: 1px solid var(--border-chrome); background: var(--bg-chrome); padding: 10px 18px 8px; display: flex; flex-direction: column; gap: 6px; }
.wsstriphead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wsstrip { display: flex; gap: 2px; height: 30px; }
.wsseg { min-width: 4px; border: 0; border-radius: 4px; background: var(--seg); opacity: .55; color: #F5F5F2; font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; cursor: pointer; }
.wsseg:hover { opacity: .85; }
.wsseg.insec { opacity: 1; }
.wsseg.on { outline: 2px solid var(--yellow); outline-offset: 1px; }
.wsseg.own { border: 1.5px dashed #FFD600; }
.wsrest { min-width: 3px; border-radius: 3px; background: repeating-linear-gradient(135deg, #2A2A30 0 4px, #18181B 4px 8px); }
.wsend { flex: 0 0 44px; border-radius: 4px; background: #000; border: 1px solid #3A3A40; color: var(--text-2); font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; letter-spacing: .06em; }
.wsruler { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); font-family: "IBM Plex Mono", monospace; padding-right: 48px; }
.roundcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.roundcard { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid #2A2A2E; background: #151517; color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.roundcard:hover { border-color: #3A3A40; }
.roundcard.on { border: 2px solid var(--yellow); padding: 11px 13px; }
.roundcard.own:not(.on) { border-style: dashed; border-color: #6B5320; }
.roundcard .st { white-space: normal; }
.roundcombo { font-size: 16px; font-weight: 700; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bxmain { flex: 999 1 520px; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.combochips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 46px; padding: 8px 10px; border-radius: 10px; background: #0E0E10; border: 1px solid #2A2A2E; }
.combochip { font-family: "IBM Plex Mono", monospace; font-weight: 800; font-size: 17px; padding: 4px 9px; border-radius: 7px; background: rgba(255, 214, 0, .14); color: var(--yellow); }
.combotokens { display: flex; gap: 6px; flex-wrap: wrap; }
.combotokens .btn { min-width: 44px; font-family: "IBM Plex Mono", monospace; font-weight: 700; }
#bxPrev .bxstill img { aspect-ratio: 1; }
#bxPrev .bxempty { min-height: 200px; }
@media (max-width: 1100px) { .seclist { width: 196px; } }
@media (max-width: 760px) { .roundcards { grid-template-columns: 1fr; } }

/* Assignment 017: the saved warm-up library */
.tplrow { padding: 12px 14px; }
.tplrow.on { border-color: rgba(255, 214, 0, .45); }

/* Assignment 013: the Export full workout button keeps a label at every width (shorter on narrow windows) */
.lblnarrow { display: none; }
@media (max-width: 1360px) { #btnExportClass .lblwide { display: none; } #btnExportClass .lblnarrow { display: inline; } }
#saveState { flex-shrink: 0; white-space: nowrap; }   /* the save state always reads in full; the name field gives way */
