/* =====================================================================
   Artist Studio — editor workspace redesign (layered on top of editor.css).
   Same markup & ids; new layout: captions | stage | inspector on top,
   a full-width timeline dock underneath, floating cards, glass controls.
   ===================================================================== */

/* ---------- workspace ---------- */
.ed { background:
  radial-gradient(900px 420px at 0% -10%, rgba(255, 153, 28, .07), transparent 60%),
  radial-gradient(700px 380px at 100% 0%, rgba(255, 94, 58, .05), transparent 60%), var(--bg); }

/* ---------- top bar ---------- */
.ed-top { height: 62px; gap: 10px; padding: 0 18px; background: transparent; border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.ed-top .logo .brand { height: 24px; }
.ed-div { height: 26px; margin: 0 4px; }
.ed-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-name { font-size: 15.5px; font-weight: 700; width: min(360px, 30vw); height: 38px; border-radius: 10px; padding: 0 12px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.save-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 210, 122, .15); }
.save-state[data-state="busy"]::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 153, 28, .2); animation: svPulse 1s ease-in-out infinite; }
.save-state[data-state="err"] { color: var(--danger); }
.save-state[data-state="err"]::before { background: var(--danger); box-shadow: none; }
@keyframes svPulse { 50% { opacity: .35; } }
.ed-hist { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.ed-hist .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.ed-hist .icon-btn:hover { background: var(--surface-3); }
.ed-theme { height: 38px; min-width: 38px; border-radius: 12px; }
.ed-srt { height: 38px; border-radius: 12px; padding: 0 14px; background: var(--surface-2); }
.ed-export { height: 38px; border-radius: 12px; padding: 0 18px; font-weight: 700; background: linear-gradient(135deg, #ffb347, var(--accent) 45%, #ff6a3d); border: 0; box-shadow: 0 8px 22px rgba(255, 153, 28, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.ed-export:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(255, 153, 28, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
.acct { height: 40px; background: var(--surface-2); border-color: var(--line); }

/* ---------- layout: [captions | stage | inspector] over a full-width timeline ---------- */
.ed-main, .ar-landscape .ed-main, .ar-square .ed-main {
  gap: 12px; padding: 12px 14px 14px;
  grid-template-areas: "side stage right" "tl tl right";
  grid-template-columns: 392px minmax(0, 1fr) 356px;
  grid-template-rows: minmax(0, 1fr) var(--tl-h, 236px); }
.ed.tl-big .ed-main, .ed.tl-big.ar-portrait .ed-main { grid-template-rows: minmax(0, 1fr) 420px; }
@media (max-width: 1360px) {
  .ed-main, .ar-landscape .ed-main, .ar-square .ed-main { grid-template-columns: 322px minmax(0, 1fr) 330px; }
}
/* 9:16 → captions + timeline stacked on the left, a tall full-height preview column, inspector on the right */
.ar-portrait .ed-main {
  grid-template-areas: "side stage right" "tl stage right";
  grid-template-columns: minmax(0, 1fr) var(--stage-w, 420px) 356px; }
@media (max-width: 1360px) { .ar-portrait .ed-main { grid-template-columns: minmax(0, 1fr) var(--stage-w, 400px) 330px; } }
@media (max-width: 1100px) { .ar-portrait .ed-main { grid-template-columns: minmax(0, 1fr) var(--stage-w, 380px) 306px; } }
@media (max-width: 1100px) {
  .ed-main, .ar-landscape .ed-main, .ar-square .ed-main { grid-template-columns: 290px minmax(0, 1fr) 306px; }
  .ed-srt, .ed-theme { display: none; }
}

/* ---------- panels ---------- */
.box, .stage-box { border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 14px 34px rgba(0, 0, 0, .28); }

/* ---------- left: icon rail + captions ---------- */
.side-box { grid-template-columns: 72px minmax(0, 1fr); }
.ed-rail { gap: 4px; padding: 12px 8px; background: transparent; border-right: 1px solid var(--line); }
.ed-rail button { position: relative; gap: 6px; padding: 8px 2px 10px; border-radius: 14px; font-size: 10.5px; letter-spacing: .01em; }
.ed-rail button .ic { width: 40px; height: 40px; padding: 10px; border-radius: 13px; box-sizing: border-box; transition: background .2s, color .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.ed-rail button:hover { background: transparent; }
.ed-rail button:hover .ic { background: var(--surface-2); transform: translateY(-1px); }
.ed-rail button.on { background: transparent; color: var(--text); }
.ed-rail button.on .ic { color: #fff; background: linear-gradient(135deg, #ffb347, var(--accent) 55%, #ff6a3d); box-shadow: 0 8px 18px rgba(255, 153, 28, .35); }
.ed-rail button.on::before { content: ''; position: absolute; left: -8px; top: 16px; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-panel { padding: 16px 14px 24px; }
.lp-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.round-btn { width: 38px; height: 38px; background: var(--surface-2); border-color: var(--line); }
.pill-btn { height: 38px; background: var(--surface-2); border-color: var(--line); }
.clist { gap: 3px; }
.crow-main { border-radius: 14px; padding: 7px 8px; transition: background .2s, border-color .2s; }
.crow-main:hover { background: var(--surface-2); }
.crow.playing .crow-main { background: linear-gradient(90deg, rgba(255, 153, 28, .1), transparent 75%); }
.crow.sel .crow-main { background: linear-gradient(90deg, rgba(255, 153, 28, .16), rgba(255, 153, 28, .03) 80%); border-color: rgba(255, 153, 28, .4); }
.cnum { width: 28px; height: 28px; border-radius: 9px; font: 700 12px ui-monospace, 'SFMono-Regular', Consolas, monospace; background: var(--surface-2); }
.crow.playing .cnum, .crow.sel .cnum { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(255, 153, 28, .4); }
.ctext { font-size: 15.5px; font-weight: 500; }
.cwords { margin-left: 44px; border-radius: 14px; }
/* keep caption rows on one line unless the column is really narrow */
/* row actions float over the row on hover, so the caption text gets the full width */
@container (min-width: 200px) {
  .crow-main { position: relative; grid-template-columns: 30px minmax(0, 1fr); row-gap: 0; }
  .cicons { position: absolute; right: 6px; top: 50%; transform: translateY(-50%) translateX(6px); grid-column: auto; margin: 0; padding: 3px;
    border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
    opacity: 0; pointer-events: none; transition: opacity .18s, transform .22s cubic-bezier(.2, .8, .2, 1); }
  .crow-main:hover .cicons, .crow-main:focus-within .cicons { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
  .cicons button { width: 28px; height: 28px; }
}

/* ---------- stage ---------- */
.stage-box { background:
  radial-gradient(circle at 50% 45%, rgba(255, 153, 28, .05), transparent 60%),
  radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.2px) 0 0 / 20px 20px, var(--bg-2); }
.pv-head { padding: 10px 12px; border-bottom: 0; }
.pv-kind { font-size: 12.5px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pv-chip { height: 34px; border-radius: 11px; background: var(--surface); border-color: var(--line); }
.stage-area { background: none; padding: 6px 14px; }
.player { border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 30px 70px rgba(0, 0, 0, .55); }
.pl-bar { margin: 6px 14px 14px; padding: 10px 12px 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, .25); }
.seek { accent-color: var(--accent); height: 16px; }
.pl-row { gap: 8px; margin-top: 6px; }
.pl-btn { width: 36px; height: 36px; background: var(--surface-2); border-color: var(--line); }
#playBtn { width: 44px; height: 44px; background: linear-gradient(135deg, #ffb347, var(--accent) 55%, #ff6a3d); border: 0; box-shadow: 0 8px 20px rgba(255, 153, 28, .4); transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
#playBtn:hover { transform: scale(1.06); }
.pl-time { background: var(--bg-2); border: 1px solid var(--line); font-size: 12px; letter-spacing: .02em; }
.pl-rate { height: 34px; border-radius: 10px; background: var(--surface-2); border-color: var(--line); }
.proc { background: rgba(8, 6, 4, .72); backdrop-filter: blur(4px); }
.proc-card { border-radius: 18px; }

/* ---------- canvas viewport: zoom, pan, rulers, guides ---------- */
.pv-ico { width: 34px; padding: 0; justify-content: center; }
.pv-ico.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
#zoomBtn b { min-width: 30px; font-variant-numeric: tabular-nums; }
/* the viewport runs edge to edge: rulers sit flush against the stage box's own border */
.stage-area { position: relative; display: block; padding: 0; overflow: hidden; margin: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.stage-area .player { position: absolute; left: 0; top: 0; will-change: left, top; }
.stage-area .player, .stage-area.zoomed .player, [data-theme="light"] .stage-area .player { border-radius: 0; }
.zoom-slot { display: none; }

/* Custom Fonts: drag & drop zone + the user's own fonts */
.fonts-wrap { min-height: 100%; display: flex; flex-direction: column; }
.font-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin: 4px 0 14px; padding: 22px 14px; cursor: pointer;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line-2)); border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 153, 28, .09), transparent 70%), rgba(255, 255, 255, .02);
  transition: border-color .2s, background .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }
.font-drop:hover { border-color: var(--accent); background: radial-gradient(120% 90% at 50% 0%, rgba(255, 153, 28, .15), transparent 70%), rgba(255, 255, 255, .03); }
.font-drop.over { border-style: solid; border-color: var(--accent); transform: scale(1.015); box-shadow: 0 0 0 4px rgba(255, 153, 28, .15), 0 14px 34px rgba(255, 153, 28, .18); background: radial-gradient(120% 90% at 50% 0%, rgba(255, 153, 28, .22), transparent 70%), rgba(255, 153, 28, .05); }
.font-drop-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ffb347, var(--accent) 55%, #ff6a3d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 20px rgba(255, 153, 28, .35); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.font-drop.over .font-drop-ic { transform: translateY(-4px) scale(1.08); }
.font-drop b { font-size: 13.5px; }
.font-drop small { font-size: 11.5px; color: var(--muted); }
.font-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; font-size: 10.5px; background: rgba(255, 153, 28, .16); color: var(--accent-2); letter-spacing: 0; }
/* preview glyphs: room above/below so tall display fonts (big ascenders, swashes) never get clipped */
.font-tile .font-prev { display: block; font-size: 26px; line-height: 1.35; padding: 6px 2px 2px; overflow: visible; white-space: nowrap; text-overflow: clip; max-width: calc(100% - 22px); }
.font-tile { overflow: visible; padding-top: 10px; }
.font-empty { grid-column: 1 / -1; padding: 6px 2px; line-height: 1.5; }
.ruler-grp { display: inline-flex; gap: 6px; }
.tl-tools #bgBtn { height: 34px; background: var(--surface-2); }
.tl-tools #bgBtn .pv-cap, .tl-tools #bgBtn .ic { display: inline-block !important; }
.tl-tools #zoomBtn { height: 34px; background: var(--surface-2); }
.tl-tools #zoomBtn .ic { display: inline-block !important; }
.rate-chip b { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.rate-chip.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.dd-menu.rate-menu { width: 214px; }
.rate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 2px; }
.dd-menu .rate-grid button.rate-opt { justify-content: center; padding: 9px 0; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; border-radius: 10px; }
.stage-area.panning, .stage-area.panning * { cursor: grabbing !important; }
.ruler { position: absolute; z-index: 3; display: none; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); }
.rulers-on .ruler { display: block; }
.ruler-x { left: 20px; top: 0; cursor: s-resize; }
.ruler-y { left: 0; top: 20px; cursor: e-resize; }
.ruler-corner { position: absolute; left: 0; top: 0; width: 20px; height: 20px; z-index: 4; display: none; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rulers-on .ruler-corner { display: block; }
.guides { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.gl { position: absolute; pointer-events: auto; }
.gl-v { top: 0; bottom: 0; width: 9px; margin-left: -4px; cursor: ew-resize; }
.gl-h { left: 0; right: 0; height: 9px; margin-top: -4px; cursor: ns-resize; }
.gl::before { content: ""; position: absolute; background: #21c7ff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25); }
.gl-v::before { left: 4px; top: 0; bottom: 0; width: 1px; }
.gl-h::before { top: 4px; left: 0; right: 0; height: 1px; }
.gl:hover::before { background: #7fe0ff; box-shadow: 0 0 6px #21c7ff; }
.gl-safe::before { background: none; box-shadow: none; }
.gl-safe:hover::before, .gl-safe:active::before { background: rgba(255, 153, 28, .9); box-shadow: 0 0 8px rgba(255, 153, 28, .8); }
.gl-safe b { position: absolute; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: rgba(255, 60, 90, .85); padding: 2px 6px; border-radius: 5px; opacity: 0; transition: opacity .15s; pointer-events: none; white-space: nowrap; }
.gl-safe:hover b { opacity: 1; }
.gl-safe.gl-h b { left: 50%; top: 8px; transform: translateX(-50%); }
.gl-safe.gl-v b { top: 50%; left: 8px; transform: translateY(-50%); }
.guide-tip { position: absolute; z-index: 6; pointer-events: none; font: 600 11.5px/1 Inter, system-ui, sans-serif; color: #fff; background: rgba(20, 16, 12, .92); border: 1px solid rgba(255, 255, 255, .12); padding: 6px 9px; border-radius: 8px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.sel-tag { font-style: normal; font-size: 10px; font-weight: 700; color: var(--accent); margin-left: 4px; }

/* aspect + background now live in the player bar beside the speed control */
.pl-chip { height: 34px; padding: 0 9px; gap: 5px; border-radius: 10px; background: var(--surface-2); }
.pl-chip .pv-cap { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.stage-box { container-type: inline-size; }
.pl-row { flex-wrap: wrap; row-gap: 8px; }
@container (max-width: 470px) { .pl-chip .pv-cap, .pl-chip:not(.pv-ico) .ic:last-child, #zoomBtn .ic:first-child { display: none; } .pl-time { font-size: 10.5px; padding: 0 6px; letter-spacing: 0; } .pl-row { gap: 5px; } .pl-chip { padding: 0 7px; } .pl-row > .grow { min-width: 0; } }
@container (max-width: 400px) { #muteBtn { display: none; } }

/* ---------- timeline dock ---------- */
.tl-box { border-radius: 20px; }
.tl-grip { opacity: .7; }
.tl-tools { gap: 4px; padding: 8px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.tl-sep { height: 22px; margin: 0 6px; background: var(--line); }
.tl-btn { width: 34px; height: 34px; border-radius: 10px; border-color: transparent; background: transparent; color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.tl-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.tl-btn:disabled { opacity: .35; }
.tl-btn.tog.on { background: rgba(255, 153, 28, .16); border-color: rgba(255, 153, 28, .45); color: var(--accent-2); }
.tl-add { height: 34px; border-radius: 10px; background: var(--surface-2); border-color: var(--line); }
.segctl.mini { background: var(--surface-2); }
.tl-chip { height: 32px; border-radius: 10px; background: transparent; border-color: var(--line); color: var(--muted); }
.tl-chip:hover { color: var(--text); }
.tl-labels { background: var(--bg-2); border-right: 1px solid var(--line); }
.lab { font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.tl-scroll { background:
  repeating-linear-gradient(90deg, transparent 0 59px, rgba(255, 255, 255, .025) 59px 60px); }
.tl-seg { background: linear-gradient(180deg, rgba(255, 179, 82, .32), rgba(255, 153, 28, .18)); border: 1px solid rgba(255, 153, 28, .55); border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: background .15s, border-color .15s; }
.tl-seg span { color: #fff3e0; font-weight: 600; }
.tl-seg:hover { background: linear-gradient(180deg, rgba(255, 179, 82, .45), rgba(255, 153, 28, .26)); }
.tl-seg.playing { border-color: #ffd166; box-shadow: 0 0 0 1px rgba(255, 209, 102, .35), inset 0 1px 0 rgba(255, 255, 255, .1); }
.tl-seg.sel { background: linear-gradient(180deg, #ffb347, #ff8a00); border-color: #fff; }
.tl-seg.sel span { color: #2a1400; }
.tl-seg.word { border-radius: 7px; }
.tl-vid { border-radius: 9px; }
.tl-aud { border-radius: 9px; }
.tl-head { width: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(255, 153, 28, .7); }
.tl-head::before { border-top-color: var(--accent); }

/* ---------- inspector ---------- */
.rt-top { margin: 12px 12px 6px; padding: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.rt-top button { border-radius: 10px; font-weight: 700; }
.rt-sub { gap: 6px; padding: 6px 12px 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.rt-sub button { padding: 7px 13px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; transition: background .2s, color .2s, border-color .2s; }
.rt-sub button:hover { background: var(--surface-2); }
.rt-sub button.on { color: var(--accent-2); background: rgba(255, 153, 28, .12); border-color: rgba(255, 153, 28, .35); }
.rt-foot:empty { display: none; }
.rsec header { padding: 14px 18px; }
.rsec h5 { font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.rsec:not(.closed) h5 { color: var(--text); }
.rsec-body { padding: 2px 18px 18px; }
.fmt-group { border-radius: 12px; border-color: var(--line); }
.fmt-group button { background: var(--surface-2); border-right-color: var(--line); }
.fmt-group button.on { background: linear-gradient(135deg, #ffb347, var(--accent)); color: #2a1400; }
.num, .reset-btn { border-color: var(--line); }
.reset-btn { border-radius: 10px; }

/* ---------- stacked layout (small screens) ---------- */
@media (max-width: 999px) {
  .ed-main, .ar-landscape .ed-main, .ar-square .ed-main, .ar-portrait .ed-main, .ed.tl-big .ed-main, .ed.tl-big.ar-portrait .ed-main {
    grid-template-areas: "stage" "side" "tl" "right"; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .ed-export { padding: 0 12px; }
}

/* ======================= render screen ======================= */
.rx { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 8px; animation: rxIn .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rxIn { from { opacity: 0; transform: translateY(12px); } }
.rx-stage { position: relative; width: 100%; display: grid; place-items: center; padding-bottom: 30px; }
.rx-screen { position: relative; width: 100%; aspect-ratio: var(--ar, 1.7778); max-height: 250px; border-radius: 16px; overflow: hidden; background: #000;
  border: 1px solid rgba(255, 153, 28, .35); box-shadow: 0 0 0 5px rgba(255, 153, 28, .07), 0 24px 50px rgba(0, 0, 0, .5); }
.rx-screen.tall { width: auto; height: 250px; }
.rx-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.rx-scan { position: absolute; left: 0; right: 0; top: 0; height: 34%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 153, 28, .12) 45%, rgba(255, 209, 102, .4) 50%, rgba(255, 153, 28, .12) 55%, transparent); animation: rxScan 2.6s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes rxScan { from { transform: translateY(-110%); } to { transform: translateY(310%); } }
.rx-grain { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .45)); }
.rx-rec { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font: 800 10.5px var(--font); letter-spacing: .12em; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.rx-rec i { width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; animation: blinkDot 1.1s ease-in-out infinite; }
.rx-tc { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 7px; font: 700 11.5px ui-monospace, Consolas, monospace; color: #fff; background: rgba(0, 0, 0, .55); }
.rx-ring { position: absolute; right: 10px; bottom: -6px; width: 84px; height: 84px; border-radius: 50%; background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, .4), 0 0 0 5px var(--surface); display: grid; place-items: center; }
.rx-ring svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); overflow: visible; }
.rx-track { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.rx-arc { fill: none; stroke: url(#rxGrad); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .45s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 4px rgba(255, 153, 28, .6)); }
.rx-pct { position: relative; display: flex; align-items: baseline; }
.rx-pct b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rx-pct small { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 1px; }
.rx-title { font-size: 18px; font-weight: 800; margin: 4px 0 0; letter-spacing: -.01em; }
.rx-sub { margin: -6px 0 2px; font-size: 12.5px; color: var(--muted); text-align: center; }
.rx-steps { list-style: none; margin: 0; padding: 12px 14px; width: 100%; display: flex; flex-direction: column; gap: 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.rx-steps li { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); transition: color .3s; }
.rx-steps li i { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); transition: background .3s, border-color .3s; }
.rx-steps li.on { color: var(--text); font-weight: 600; }
.rx-steps li.on i { border-color: rgba(255, 153, 28, .25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.rx-steps li.done { color: var(--text); }
.rx-steps li.done i { border-color: var(--accent); background: var(--accent); }
.rx-steps li.done i::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #2a1400; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.rx-stats div { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.rx-stats small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rx-stats b { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-cancel { width: 100%; height: 40px; border-radius: 12px; background: transparent; }
.rx-cancel:hover { border-color: rgba(255, 77, 106, .5); color: #ff8da1; background: rgba(255, 77, 106, .06); }
.rx-tip { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 0; width: 100%; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.rx-tip span { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); background: rgba(255, 153, 28, .12); }
.rx-tip em { font-style: normal; }
.rx-tip em.in { animation: tin .4s ease; }
/* done */
.rx-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: rxIn .45s cubic-bezier(.2, .8, .2, 1) both; }
.rx-badge { width: 68px; height: 68px; margin-top: 6px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 153, 28, .2), transparent 70%); }
.rx-badge svg { width: 60px; height: 60px; fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rx-badge circle { stroke: var(--accent); stroke-dasharray: 151; stroke-dashoffset: 151; animation: rxDraw .6s cubic-bezier(.65, 0, .35, 1) forwards; }
.rx-badge path { stroke: var(--accent); stroke-dasharray: 36; stroke-dashoffset: 36; animation: rxDraw .4s cubic-bezier(.65, 0, .35, 1) .5s forwards; }
@keyframes rxDraw { to { stroke-dashoffset: 0; } }
.rx-done h4 { font-size: 19px; font-weight: 800; margin: 2px 0 0; }
.rx-done > p { margin: -4px 0 4px; font-size: 12.5px; }
.rx-player { width: 100%; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.rx-player.checker { background: repeating-conic-gradient(#2a2a35 0 25%, #1b1b22 0 50%) 0 0 / 18px 18px; }
.rx-player .exp-vid { width: 100%; max-height: 260px; display: block; border-radius: 0; background: transparent; }
.rx-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.rx-meta span { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); }
.rx-dl { width: 100%; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #ffb347, var(--accent) 50%, #ff6a3d); border: 0; box-shadow: 0 10px 26px rgba(255, 153, 28, .35); }
.rx-done-row { display: flex; gap: 8px; width: 100%; }
.rx-done-row .btn { flex: 1; height: 40px; border-radius: 12px; }

/* ---------- light theme ---------- */
[data-theme="light"] .ed { background: radial-gradient(900px 420px at 0% -10%, rgba(255, 153, 28, .08), transparent 60%), var(--bg); }
[data-theme="light"] .box, [data-theme="light"] .stage-box { box-shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 12px 30px rgba(60, 40, 20, .08); }
[data-theme="light"] .stage-box { background: radial-gradient(rgba(60, 40, 20, .09) 1px, transparent 1.2px) 0 0 / 20px 20px, #fbf9f6; }
[data-theme="light"] .tl-scroll { background: repeating-linear-gradient(90deg, transparent 0 59px, rgba(60, 40, 20, .04) 59px 60px); }
[data-theme="light"] .tl-seg { background: linear-gradient(180deg, #ffe2b8, #ffd29a); border-color: #f0a040; }
[data-theme="light"] .tl-seg span { color: #5a3200; }
[data-theme="light"] .tl-seg.sel span { color: #2a1400; }
[data-theme="light"] .pl-bar, [data-theme="light"] .rx-ring { box-shadow: 0 8px 22px rgba(60, 40, 20, .1); }
[data-theme="light"] .rx-ring { box-shadow: 0 8px 22px rgba(60, 40, 20, .14), 0 0 0 5px var(--surface); }
[data-theme="light"] .player { box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 24px 50px rgba(60, 40, 20, .18); }
