/*
 * 槿榕AI · Agent Video Studio workspace
 * Faithful responsive implementation of the approved Apple/OpenAI-inspired
 * operation-board reference. Loaded after spatial-workspace.css on purpose:
 * the earlier file owns compatibility; this file owns the final composition.
 */

body.jr-authenticated {
  --agent-accent: #168b69;
  --agent-accent-strong: #087657;
  --agent-accent-rgb: 22, 139, 105;
  --agent-cyan: #2998a8;
  --agent-bg: #eef3f3;
  --agent-surface: rgba(249, 252, 251, .82);
  --agent-surface-strong: rgba(252, 254, 253, .94);
  --agent-line: rgba(22, 65, 55, .12);
  --agent-line-strong: rgba(22, 65, 55, .2);
  --agent-text: #10211d;
  --agent-text-soft: #5f716b;
  --agent-text-faint: #85938f;
  --agent-shadow: 0 22px 60px rgba(32, 66, 58, .11), 0 2px 10px rgba(32, 66, 58, .05);
  --agent-highlight: inset 0 1px 0 rgba(255, 255, 255, .82);
}

:root[data-theme="dark"] body.jr-authenticated {
  --agent-accent: #57d9ad;
  --agent-accent-strong: #2fc291;
  --agent-accent-rgb: 87, 217, 173;
  --agent-cyan: #58c4cf;
  --agent-bg: #06100f;
  --agent-surface: rgba(6, 19, 17, .8);
  --agent-surface-strong: rgba(7, 22, 19, .94);
  --agent-line: rgba(148, 230, 205, .13);
  --agent-line-strong: rgba(148, 230, 205, .23);
  --agent-text: #edf8f4;
  --agent-text-soft: #a8bab5;
  --agent-text-faint: #748982;
  --agent-shadow: 0 25px 70px rgba(0, 0, 0, .43), 0 2px 12px rgba(0, 0, 0, .2);
  --agent-highlight: inset 0 1px 0 rgba(225, 255, 245, .09);
}

body.jr-authenticated #app,
body.jr-authenticated #app.show {
  overflow: hidden !important;
}

body.jr-authenticated::before {
  filter: blur(12px) saturate(.76) !important;
  opacity: .26 !important;
}

:root[data-theme="dark"] body.jr-authenticated::before {
  opacity: .48 !important;
}

/* Compact product control bar */
body.jr-authenticated header {
  width: min(calc(100% - 320px), 1120px) !important;
  height: 56px !important;
  min-height: 56px !important;
  margin: 8px auto 0 !important;
  padding: 0 12px !important;
  border-color: var(--agent-line) !important;
  border-radius: 17px !important;
  background: var(--agent-surface) !important;
  box-shadow: var(--agent-shadow), var(--agent-highlight) !important;
}

body.jr-authenticated .logo-img {
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
}

body.jr-authenticated .logo-wrap { gap: 8px !important; }
body.jr-authenticated .logo-main { font-size: 14px !important; letter-spacing: -.02em; }
body.jr-authenticated .logo-sub { font-size: 8px !important; letter-spacing: .055em !important; }
body.jr-authenticated .hd-right { gap: 6px !important; }

body.jr-authenticated .workspace-model-segmented {
  order: 1;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--agent-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--agent-surface-strong) 84%, transparent);
  box-shadow: var(--agent-highlight);
}

body.jr-authenticated .workspace-model-segmented button {
  min-height: 28px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--agent-text-faint);
  font: inherit;
  font-size: 10px;
  font-weight: 670;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 150ms ease;
}

body.jr-authenticated .workspace-model-segmented button:hover:not(:disabled) {
  color: var(--agent-text);
}

body.jr-authenticated .workspace-model-segmented button:active:not(:disabled) { transform: scale(.97); }
body.jr-authenticated .workspace-model-segmented button.active {
  background: rgba(var(--agent-accent-rgb), .12);
  color: var(--agent-accent-strong);
  box-shadow: inset 0 0 0 1px rgba(var(--agent-accent-rgb), .18), 0 4px 12px rgba(var(--agent-accent-rgb), .08);
}
body.jr-authenticated .workspace-model-segmented button:disabled { opacity: .42; cursor: not-allowed; }
body.jr-authenticated #model-switcher { display: none; }

body.jr-authenticated #acct-badge {
  order: 2;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
}
body.jr-authenticated #lang-toggle { order: 3; }
body.jr-authenticated header .jr-theme-toggle { order: 4; }
body.jr-authenticated .workspace-mobile-menu { display: none; order: 5; position: relative; }

/* Reference proportions: narrow creation dock / wide film stage / independent
   inspector. The inspector is a real third column on desktop, matching the
   spatial-film-stage reference instead of covering the video canvas. */
body.jr-authenticated .layout.jr-workspace {
  position: relative;
  display: grid !important;
  width: min(calc(100% - 16px), 1920px) !important;
  height: calc(100dvh - 116px) !important;
  min-height: 620px !important;
  margin: 40px auto 12px !important;
  grid-template-columns: 72px minmax(0, 1fr) 240px !important;
  gap: 10px !important;
  overflow: visible !important;
}

body.jr-authenticated .workspace-rail { grid-column: 1; grid-row: 1; }
body.jr-authenticated .workspace-main { grid-column: 2; grid-row: 1; }
body.jr-authenticated .workspace-inspector {
  grid-column: 3;
  grid-row: 1;
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 22px !important;
}

body.jr-authenticated .workspace-rail,
body.jr-authenticated .workspace-main > .panel-left,
body.jr-authenticated .workspace-main > .panel-right,
body.jr-authenticated .workspace-inspector {
  border-color: var(--agent-line) !important;
  background: var(--agent-surface) !important;
  box-shadow: var(--agent-shadow), var(--agent-highlight) !important;
}

body.jr-authenticated .workspace-rail {
  gap: 6px !important;
  padding: 8px 5px !important;
  border-radius: 20px !important;
}

body.jr-authenticated .workspace-rail-button {
  width: 46px !important;
  min-height: 62px !important;
  padding: 6px 3px !important;
  border-radius: 14px !important;
}
body.jr-authenticated .workspace-rail-button strong {
  min-width: 27px !important;
  min-height: 27px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  line-height: 27px;
  text-align: center;
}
body.jr-authenticated .workspace-rail-button span { margin-top: 3px !important; font-size: 9px !important; }
body.jr-authenticated .workspace-rail-button.active {
  background: rgba(var(--agent-accent-rgb), .11) !important;
  color: var(--agent-accent-strong) !important;
}

body.jr-authenticated .workspace-main {
  display: grid !important;
  min-width: 0;
  min-height: 0;
  grid-template-rows: clamp(430px, 65vh, 620px) clamp(200px, 24vh, 236px) !important;
  align-content: start;
  gap: 8px !important;
}

/* Main stage */
body.jr-authenticated .workspace-main > .panel-right {
  display: grid !important;
  min-height: 0 !important;
  grid-template-rows: minmax(0, 1fr) 34px 116px;
  overflow: hidden !important;
  border-radius: 20px !important;
  background: rgba(3, 11, 10, .84) !important;
  isolation: isolate;
}

body.jr-authenticated .workspace-main > .panel-right::before {
  background:
    linear-gradient(180deg, rgba(2, 10, 9, .08), rgba(2, 10, 9, .58)),
    url("../../assets/workspace-stage.jpg") center 53% / cover no-repeat !important;
  opacity: .72;
}

body.jr-authenticated .workspace-stage-primary {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 16px 14px 10px 110px;
  overflow: hidden;
  border: 1px solid rgba(208, 255, 239, .18);
  border-radius: 17px;
  background: #030908;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 44px rgba(0, 0, 0, .24);
}

body.jr-authenticated .workspace-inspector-scroll {
  min-height: 0;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body.jr-authenticated .workspace-stage-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #020807;
}

body.jr-authenticated .workspace-stage-media::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 7, 6, .26), transparent 35%, rgba(1, 7, 6, .32)),
    url("../../assets/workspace-stage.jpg") center / cover no-repeat;
  content: "";
  transform: scale(1.012);
}

body.jr-authenticated #workspace-stage-video {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #020605;
  object-fit: contain;
}
body.jr-authenticated #workspace-stage-video[hidden] { display: none !important; }

body.jr-authenticated .workspace-stage-empty {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 104px 22% 76px;
  background: linear-gradient(180deg, rgba(1, 8, 7, .08), rgba(1, 8, 7, .34));
  color: #eef9f5;
  text-align: center;
}
body.jr-authenticated .workspace-stage-empty[hidden] { display: none !important; }
body.jr-authenticated .workspace-stage-empty > span {
  color: rgba(112, 226, 187, .82);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: .14em;
}
body.jr-authenticated .workspace-stage-empty h2 {
  max-width: 560px;
  margin: 8px 0 7px;
  color: #f4fbf8;
  font-size: clamp(18px, 2.1vw, 26px);
  font-weight: 680;
  letter-spacing: -.025em;
}
body.jr-authenticated .workspace-stage-empty p {
  max-width: 540px;
  margin: 0;
  color: rgba(226, 242, 236, .66);
  font-size: 11px;
  line-height: 1.65;
}

body.jr-authenticated .workspace-stage-progress {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: auto;
  left: 50%;
  width: min(620px, calc(100% - 20px));
  transform: translateX(-50%);
  display: grid;
  min-height: 70px;
  padding: 10px 12px;
  grid-template-columns: minmax(160px, .75fr) minmax(290px, 1.25fr);
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(213, 255, 241, .13);
  border-radius: 14px;
  background: rgba(3, 14, 12, .64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 30px rgba(0, 0, 0, .18);
  color: #eff9f6;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

/* In light mode the workbench shell is pearl glass; the video and thumbnails
   deliberately remain cinematic and dark. */
:root[data-theme="light"] body.jr-authenticated .workspace-main > .panel-right {
  background: rgba(247, 250, 249, .82) !important;
}
:root[data-theme="light"] body.jr-authenticated .workspace-main > .panel-right::before {
  opacity: .12;
  filter: saturate(.48) brightness(1.42);
}
:root[data-theme="light"] body.jr-authenticated .result-head {
  background: rgba(250, 252, 251, .92) !important;
  color: var(--agent-text) !important;
}
:root[data-theme="light"] body.jr-authenticated .result-title h2 { color: var(--agent-text) !important; }
:root[data-theme="light"] body.jr-authenticated .result-tabs,
:root[data-theme="light"] body.jr-authenticated .conc-badge {
  border-color: var(--agent-line) !important;
  background: rgba(255, 255, 255, .58) !important;
  color: var(--agent-text-soft) !important;
}
:root[data-theme="light"] body.jr-authenticated .result-tab { color: var(--agent-text-soft) !important; }
:root[data-theme="light"] body.jr-authenticated .result-tab.active {
  background: rgba(var(--agent-accent-rgb), .11) !important;
  color: var(--agent-accent-strong) !important;
}
:root[data-theme="light"] body.jr-authenticated .result-scroll,
:root[data-theme="light"] body.jr-authenticated .result-scroll:has(.task-card) {
  background: rgba(248, 251, 250, .92) !important;
}
:root[data-theme="light"] body.jr-authenticated .workspace-stage-progress {
  border-color: rgba(25, 101, 78, .16);
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 12px 30px rgba(32, 71, 62, .12);
  color: var(--agent-text);
}
:root[data-theme="light"] body.jr-authenticated .workspace-stage-progress-copy strong { color: var(--agent-text); }
:root[data-theme="light"] body.jr-authenticated .workspace-stage-progress-copy span { color: var(--agent-text-soft); }
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track::before { background: rgba(21, 104, 80, .22); }
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track > span { color: rgba(26, 61, 51, .5); }
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track > span.complete,
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track > span.active { color: #176e54; }
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track i {
  border-color: rgba(26, 92, 73, .4);
  background: #f3faf7;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .78);
}
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track > span.complete i,
:root[data-theme="light"] body.jr-authenticated .workspace-stage-step-track > span.active i {
  border-color: #299a75;
  background: #3fbd91;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .78), 0 0 14px rgba(64, 183, 142, .28);
}
body.jr-authenticated .workspace-stage-progress-copy { min-width: 0; }
body.jr-authenticated .workspace-stage-progress-copy strong {
  display: block;
  overflow: hidden;
  color: #f2fbf8;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.jr-authenticated .workspace-stage-progress-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(222, 241, 234, .58);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.jr-authenticated .workspace-stage-step-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}
body.jr-authenticated .workspace-stage-step-track::before {
  position: absolute;
  top: 6px;
  right: 10%;
  left: 10%;
  height: 1px;
  background: rgba(222, 244, 236, .22);
  content: "";
}
body.jr-authenticated .workspace-stage-step-track > span {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: rgba(220, 239, 232, .48);
}
body.jr-authenticated .workspace-stage-step-track i {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(218, 241, 233, .3);
  border-radius: 50%;
  background: #0c1b18;
  box-shadow: 0 0 0 3px rgba(3, 14, 12, .72);
}
body.jr-authenticated .workspace-stage-step-track em {
  font-size: 8px;
  font-style: normal;
  white-space: nowrap;
}
body.jr-authenticated .workspace-stage-step-track > span.complete,
body.jr-authenticated .workspace-stage-step-track > span.active { color: #dff8ef; }
body.jr-authenticated .workspace-stage-step-track > span.complete i,
body.jr-authenticated .workspace-stage-step-track > span.active i {
  border-color: #66ddb5;
  background: #37bf91;
  box-shadow: 0 0 0 3px rgba(3, 14, 12, .72), 0 0 14px rgba(83, 221, 176, .42);
}
body.jr-authenticated .workspace-stage-step-track > span.active i {
  animation: agent-stage-pulse 1.8s ease-in-out infinite;
}

body.jr-authenticated .workspace-stage-toolbar {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  min-height: 42px;
  padding: 7px 8px 7px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(214, 255, 241, .12);
  border-radius: 13px;
  background: rgba(2, 12, 10, .64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}
body.jr-authenticated .workspace-stage-toolbar[hidden] { display: none !important; }
body.jr-authenticated .workspace-stage-playback {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
}
body.jr-authenticated .workspace-stage-playback button {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(218, 251, 240, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: rgba(231, 246, 241, .84);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
body.jr-authenticated .workspace-stage-playback button:hover:not(:disabled) {
  border-color: rgba(94, 222, 180, .3);
  background: rgba(83, 210, 168, .14);
  color: #ecfbf5;
}
body.jr-authenticated .workspace-stage-playback button:disabled { opacity: .4; cursor: default; }
body.jr-authenticated .workspace-stage-time,
body.jr-authenticated .workspace-stage-resolution {
  color: rgba(231, 246, 241, .72);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body.jr-authenticated .workspace-stage-seek {
  width: min(260px, 30vw);
  min-width: 80px;
  height: 4px;
  accent-color: var(--agent-accent);
  cursor: pointer;
}
body.jr-authenticated .workspace-stage-meta { display: none !important; }
body.jr-authenticated .workspace-stage-meta { min-width: 0; }
body.jr-authenticated .workspace-stage-meta strong,
body.jr-authenticated .workspace-stage-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.jr-authenticated .workspace-stage-meta strong { color: #eef9f5; font-size: 10px; }
body.jr-authenticated .workspace-stage-meta span { margin-top: 2px; color: rgba(222, 240, 233, .56); font-size: 8px; }
body.jr-authenticated .workspace-stage-actions { display: flex; align-items: center; gap: 5px; }
body.jr-authenticated .workspace-stage-actions button,
body.jr-authenticated .workspace-stage-actions a {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(218, 251, 240, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: rgba(231, 246, 241, .78);
  font: inherit;
  font-size: 8px;
  text-decoration: none;
  white-space: nowrap;
}
body.jr-authenticated .workspace-stage-actions button:hover:not(:disabled),
body.jr-authenticated .workspace-stage-actions a:hover:not([aria-disabled="true"]) {
  border-color: rgba(94, 222, 180, .3);
  background: rgba(83, 210, 168, .14);
  color: #ecfbf5;
}
body.jr-authenticated .workspace-stage-actions button:disabled,
body.jr-authenticated .workspace-stage-actions a[aria-disabled="true"] { opacity: .36; pointer-events: none; }

/* Queue header and film strip */
body.jr-authenticated .result-head {
  position: relative !important;
  z-index: 3;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  display: flex !important;
  min-height: 34px !important;
  padding: 4px 10px !important;
  align-items: center;
  gap: 7px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(2, 12, 10, .54) !important;
  box-shadow: none !important;
  color: #eef9f5 !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}
body.jr-authenticated .result-title h2 { color: #edf8f4 !important; font-size: 10px !important; }
body.jr-authenticated .result-tabs {
  width: auto !important;
  margin-left: auto;
  padding: 2px !important;
  border-color: rgba(218, 249, 238, .08) !important;
  background: rgba(255, 255, 255, .045) !important;
}
body.jr-authenticated .result-tab {
  min-height: 23px !important;
  padding: 3px 7px !important;
  color: rgba(226, 241, 235, .57) !important;
  font-size: 8px !important;
}
body.jr-authenticated .result-tab.active {
  background: rgba(83, 211, 168, .13) !important;
  color: #72dfbb !important;
}
body.jr-authenticated .conc-badge {
  min-height: 25px !important;
  padding: 3px 8px !important;
  border-color: rgba(218, 249, 238, .1) !important;
  background: rgba(255, 255, 255, .045) !important;
  color: rgba(226, 241, 235, .64) !important;
  font-size: 8px !important;
}

body.jr-authenticated .result-scroll,
body.jr-authenticated .result-scroll:has(.task-card) {
  position: relative;
  z-index: 2;
  display: grid !important;
  height: 116px !important;
  min-height: 116px !important;
  padding: 7px 9px 9px !important;
  grid-template-columns: none !important;
  grid-template-rows: 1fr !important;
  grid-auto-flow: column !important;
  grid-auto-columns: 148px !important;
  align-items: stretch !important;
  align-content: stretch !important;
  gap: 7px !important;
  justify-content: start !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  background: linear-gradient(180deg, rgba(2, 12, 10, .54), rgba(2, 10, 9, .78)) !important;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

body.jr-authenticated .result-scroll > .task-card,
body.jr-authenticated .result-scroll > .task-card:first-of-type {
  position: relative;
  display: block !important;
  width: 148px !important;
  min-width: 148px !important;
  height: 98px !important;
  max-height: 98px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(211, 248, 236, .13) !important;
  border-radius: 12px !important;
  background: rgba(5, 17, 15, .9) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
body.jr-authenticated .result-scroll > .task-card:hover { transform: translateY(-1px); }
body.jr-authenticated .result-scroll > .task-card.workspace-selected {
  border-color: rgba(84, 221, 175, .78) !important;
  box-shadow: 0 0 0 1px rgba(84, 221, 175, .16), 0 0 20px rgba(55, 193, 145, .12) !important;
}
body.jr-authenticated .result-scroll .tc-video {
  position: absolute !important;
  inset: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #020706 !important;
}
body.jr-authenticated .result-scroll .tc-video::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(180deg, transparent, rgba(1, 7, 6, .82));
  content: "";
  pointer-events: none;
}
body.jr-authenticated .result-scroll .tc-video::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 42%, rgba(1, 7, 6, .5)),
    url("../../assets/workspace-stage.jpg") center / cover no-repeat;
  content: "";
  opacity: 1;
  pointer-events: none;
  transition: opacity 180ms ease;
}
body.jr-authenticated .result-scroll .tc-video.media-ready::before { opacity: 0; }
body.jr-authenticated .result-scroll .tc-video video { width: 100% !important; height: 100% !important; object-fit: cover !important; }
body.jr-authenticated .result-scroll .tc-video-open { display: none !important; }
body.jr-authenticated .result-scroll .tc-vinfo {
  position: absolute !important;
  z-index: 2;
  right: 7px;
  bottom: 6px;
  left: 7px;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
body.jr-authenticated .result-scroll .tc-vtitle {
  overflow: hidden;
  color: #eef9f5 !important;
  font-size: 9px !important;
  font-weight: 650 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.jr-authenticated .result-scroll .tc-vmeta { margin-top: 2px; color: rgba(225, 241, 235, .62) !important; font-size: 7px !important; }
body.jr-authenticated .result-scroll .tc-taskbar { display: none !important; }

body.jr-authenticated .result-scroll .tc-running,
body.jr-authenticated .result-scroll .tc-error,
body.jr-authenticated .result-scroll .tc-history-placeholder {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  min-height: 0 !important;
  padding: 9px !important;
  align-items: flex-end !important;
  gap: 7px !important;
  border: 0 !important;
  background:
    linear-gradient(180deg, rgba(2, 10, 9, .08), rgba(2, 10, 9, .8)),
    url("../../assets/workspace-stage.jpg") center / cover no-repeat !important;
}
body.jr-authenticated .result-scroll .ring-wrap { width: 30px !important; height: 30px !important; min-width: 30px !important; }
body.jr-authenticated .result-scroll .ring { width: 30px !important; height: 30px !important; }
body.jr-authenticated .result-scroll .ring-txt { font-size: 7px !important; }
body.jr-authenticated .result-scroll .ring-unit { display: none !important; }
body.jr-authenticated .result-scroll .tc-info { min-width: 0; }
body.jr-authenticated .result-scroll .tc-stage,
body.jr-authenticated .result-scroll .tc-error h3 {
  overflow: hidden;
  color: #eef9f5 !important;
  font-size: 9px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.jr-authenticated .result-scroll .tc-prompt,
body.jr-authenticated .result-scroll .tc-count,
body.jr-authenticated .result-scroll .tc-elapsed,
body.jr-authenticated .result-scroll .tc-error .ei,
body.jr-authenticated .result-scroll .tc-error p,
body.jr-authenticated .result-scroll .generation-steps { display: none !important; }

body.jr-authenticated .result-scroll .idle-hint {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  width: 100% !important;
  min-width: 280px;
  height: 98px;
  margin: 0 !important;
  padding: 12px 14px !important;
  flex-direction: column;
  justify-content: center;
  border: 1px dashed rgba(216, 248, 238, .15) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .035) !important;
  box-shadow: none !important;
}
body.jr-authenticated .result-scroll .idle-hint h3 { margin: 0 0 4px !important; font-size: 11px !important; }
body.jr-authenticated .result-scroll .idle-hint p { display: block !important; font-size: 8px !important; line-height: 1.45 !important; }
body.jr-authenticated .result-scroll .idle-steps { display: none !important; }

/* Prompt console: compact and subordinate to the visual stage */
body.jr-authenticated .workspace-main > .panel-left {
  position: relative !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 20px !important;
}
body.jr-authenticated .workspace-main > .panel-left::before {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 14px;
  color: var(--agent-text-soft);
  content: "提示词控制台";
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
  pointer-events: none;
}
body.jr-authenticated .workspace-main > .panel-left .form-body {
  display: grid !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 10px 10px 10px 132px !important;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 1.45fr) 148px !important;
  grid-template-areas:
    "tabs tabs tabs"
    "prompt prompt prompt"
    "material summary actions" !important;
  grid-template-rows: 34px minmax(0, 1fr) 74px !important;
  gap: 8px !important;
  overflow: hidden !important;
}
body.jr-authenticated .workspace-main .creator-tabs {
  min-width: 260px !important;
  min-height: 32px !important;
  padding: 3px !important;
}
body.jr-authenticated .workspace-main .creator-tab {
  min-height: 26px !important;
  padding: 4px 13px !important;
  font-size: 10px !important;
}
body.jr-authenticated .workspace-main .field:has(#prompt) { grid-area: prompt !important; min-height: 0; }
body.jr-authenticated .workspace-main .material-section { grid-area: material !important; min-height: 0; }
body.jr-authenticated .workspace-prompt-actions { grid-area: actions !important; }
body.jr-authenticated .workspace-prompt-summary {
  grid-area: summary !important;
  display: flex !important;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
}
body.jr-authenticated .workspace-prompt-summary span {
  min-width: 0;
  max-width: 132px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid var(--agent-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--agent-surface-strong) 78%, transparent);
  color: var(--agent-text-soft);
  font-size: 8px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.jr-authenticated .workspace-prompt-summary span:last-child {
  color: var(--agent-accent-strong);
}
body.jr-authenticated .workspace-main .field:has(#prompt) .prompt-label-row { display: none !important; }
body.jr-authenticated .workspace-main .prompt-wrap { height: 100%; }
body.jr-authenticated .workspace-main textarea.prompt-box {
  width: 100%;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  padding: 11px 12px 27px !important;
  border-radius: 13px !important;
  font-size: 11px !important;
  line-height: 1.6 !important;
  resize: none;
}
body.jr-authenticated .workspace-main .prompt-examples { display: none !important; }
body.jr-authenticated .workspace-main .material-head { min-height: 22px !important; margin-bottom: 4px !important; }
body.jr-authenticated .workspace-main .material-grid { height: calc(100% - 26px) !important; min-height: 0 !important; }
body.jr-authenticated .workspace-main .upload-card { min-height: 0 !important; height: 100% !important; border-radius: 12px !important; }
body.jr-authenticated .workspace-main .upload-empty { font-size: 7px !important; }
body.jr-authenticated .workspace-main .upload-plus { width: 25px !important; height: 25px !important; }
body.jr-authenticated .workspace-prompt-actions {
  display: flex !important;
  min-height: 0;
  padding: 8px !important;
  justify-content: flex-end;
  border-radius: 14px !important;
}
body.jr-authenticated .workspace-prompt-actions .submit-btn {
  min-height: 44px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
}
body.jr-authenticated .workspace-prompt-actions .submit-sub { margin-top: 6px !important; font-size: 7px !important; }
body.jr-authenticated .mobile-parameter-trigger { display: none; }

/* Continuous inspector */
body.jr-authenticated .workspace-inspector {
  border-radius: 20px !important;
  background: var(--agent-surface) !important;
}
body.jr-authenticated .workspace-inspector-header {
  min-height: 54px !important;
  padding: 11px 12px !important;
  border-color: var(--agent-line) !important;
}
body.jr-authenticated .workspace-inspector-title b { font-size: 13px !important; }
body.jr-authenticated .workspace-inspector-title span { display: none; }
body.jr-authenticated .workspace-inspector-scroll { padding: 7px 10px !important; }
body.jr-authenticated .workspace-inspector .section-divider {
  margin: 0 0 6px !important;
  font-size: 8px !important;
}
body.jr-authenticated .workspace-inspector .settings-block,
body.jr-authenticated .workspace-inspector .workspace-inspector-creative-field {
  margin: 0 !important;
  padding: 10px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--agent-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.jr-authenticated .workspace-inspector .settings-title,
body.jr-authenticated .workspace-inspector .workspace-inspector-creative-field > label {
  display: block;
  margin: 0 0 7px !important;
  color: var(--agent-text-soft) !important;
  font-size: 9px !important;
  font-weight: 650 !important;
}
body.jr-authenticated .workspace-inspector .choice-row { gap: 5px !important; }
body.jr-authenticated .workspace-inspector .choice-btn {
  min-height: 31px !important;
  padding: 4px 3px !important;
  border-color: var(--agent-line) !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--agent-surface-strong) 82%, transparent) !important;
  color: var(--agent-text-soft) !important;
  font-size: 8px !important;
}
body.jr-authenticated .workspace-inspector .choice-btn.active {
  border-color: rgba(var(--agent-accent-rgb), .24) !important;
  background: rgba(var(--agent-accent-rgb), .12) !important;
  color: var(--agent-accent-strong) !important;
}
body.jr-authenticated .workspace-inspector .prompt-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 5px !important;
}
body.jr-authenticated .workspace-inspector .quick-chip {
  min-height: 29px !important;
  padding: 5px 7px !important;
  border: 1px solid var(--agent-line) !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--agent-surface-strong) 82%, transparent) !important;
  color: var(--agent-text-soft) !important;
  font-size: 8px !important;
}
body.jr-authenticated .workspace-inspector .quick-chip.active {
  background: rgba(var(--agent-accent-rgb), .12) !important;
  color: var(--agent-accent-strong) !important;
}
body.jr-authenticated .inspector-actions {
  padding: 8px 10px !important;
  border-color: var(--agent-line) !important;
  background: color-mix(in srgb, var(--agent-surface-strong) 78%, transparent) !important;
}
body.jr-authenticated .inspector-actions .cost-card {
  min-height: 52px !important;
  border-radius: 12px !important;
}
body.jr-authenticated .inspector-actions .cost-icon { display: none !important; }
body.jr-authenticated .inspector-actions .cost-copy b { font-size: 9px !important; }
body.jr-authenticated .inspector-actions .cost-copy span { display: none; }
body.jr-authenticated .inspector-actions .cost-balance { font-size: 9px !important; }

body.jr-authenticated .site-icp-footer {
  bottom: max(3px, env(safe-area-inset-bottom)) !important;
  min-height: 20px !important;
  padding: 2px 9px !important;
  border-color: var(--agent-line) !important;
  background: color-mix(in srgb, var(--agent-surface-strong) 76%, transparent) !important;
  font-size: 8px !important;
}

/* Tablet: inspector becomes a bottom sheet, stage remains dominant. */
@media (max-width: 1100px) {
  body.jr-authenticated header {
    width: calc(100% - 16px) !important;
  }
  body.jr-authenticated #app,
  body.jr-authenticated #app.show { overflow: visible !important; }
  body.jr-authenticated .layout.jr-workspace {
    display: block !important;
    width: min(calc(100% - 16px), 980px) !important;
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: calc(44px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
  }
  body.jr-authenticated .workspace-main {
    display: grid !important;
    grid-template-rows: minmax(520px, 66dvh) 210px !important;
  }
  body.jr-authenticated .workspace-main > .panel-right { min-height: 520px !important; }
  body.jr-authenticated .workspace-stage-primary { margin: 9px 9px 0; }
  body.jr-authenticated .mobile-bottom-nav { display: none !important; }
  body.jr-authenticated .workspace-inspector {
    position: fixed !important;
    z-index: 2200 !important;
    top: auto !important;
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    width: auto !important;
    height: min(72dvh, 620px) !important;
    max-height: min(72dvh, 620px) !important;
    border-radius: 25px !important;
  }
  body.jr-authenticated .workspace-inspector:not(.open) {
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateY(18px) scale(.985) !important;
    clip-path: inset(100% 0 0) !important;
    pointer-events: none !important;
  }
  body.jr-authenticated .workspace-inspector.open {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: inset(0) !important;
  }
  body.jr-authenticated .mobile-parameter-trigger {
    position: relative !important;
    inset: auto !important;
    display: inline-flex !important;
    min-height: 36px !important;
    margin: 0 0 7px !important;
    padding: 6px 9px !important;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--agent-line) !important;
    border-radius: 10px !important;
    background: color-mix(in srgb, var(--agent-surface-strong) 82%, transparent) !important;
    color: var(--agent-text-soft) !important;
    box-shadow: var(--agent-highlight) !important;
    font-size: 9px;
  }
}

/* Purpose-built mobile workbench */
@media (max-width: 720px) {
  body.jr-authenticated header {
    position: sticky !important;
    top: max(6px, env(safe-area-inset-top));
    display: flex !important;
    width: calc(100% - 16px) !important;
    height: 56px !important;
    min-height: 56px !important;
    margin-top: max(6px, env(safe-area-inset-top)) !important;
    padding: 7px 8px !important;
    border-radius: 16px !important;
  }
  body.jr-authenticated .logo-img { width: 30px !important; height: 30px !important; }
  body.jr-authenticated .logo-names { display: block !important; }
  body.jr-authenticated .logo-main { font-size: 12px !important; }
  body.jr-authenticated .logo-sub { display: none !important; }
  body.jr-authenticated .hd-right { margin-left: auto; gap: 4px !important; }
  body.jr-authenticated .workspace-model-segmented { display: none !important; }
  body.jr-authenticated #model-switcher { display: block !important; order: 1; }
  body.jr-authenticated .model-switch-button {
    width: 84px !important;
    min-width: 84px !important;
    max-width: 84px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 6px 8px !important;
  }
  body.jr-authenticated #active-model-badge {
    overflow: hidden;
    font-size: 0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.jr-authenticated #active-model-badge::after {
    content: attr(data-model-short);
    font-size: 10px;
    font-weight: 720;
  }
  body.jr-authenticated #acct-badge {
    order: 2;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
  }
  body.jr-authenticated #lang-toggle,
  body.jr-authenticated header .jr-theme-toggle { display: none !important; }
  body.jr-authenticated .workspace-mobile-menu { display: block; order: 3; }
  body.jr-authenticated .workspace-mobile-menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--agent-line);
    border-radius: 50%;
    background: color-mix(in srgb, var(--agent-surface-strong) 84%, transparent);
    color: var(--agent-text-soft);
    font: inherit;
    font-size: 8px;
    font-weight: 700;
    box-shadow: var(--agent-highlight);
  }
  body.jr-authenticated .workspace-mobile-menu-popover {
    position: absolute;
    z-index: 300;
    top: 48px;
    right: 0;
    width: 168px;
    padding: 6px;
    border: 1px solid var(--agent-line);
    border-radius: 14px;
    background: var(--agent-surface-strong);
    box-shadow: var(--agent-shadow), var(--agent-highlight);
    backdrop-filter: blur(20px) saturate(1.12);
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
  }
  body.jr-authenticated .workspace-mobile-menu-popover[hidden] { display: none !important; }
  body.jr-authenticated .workspace-mobile-menu-popover button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--agent-text);
    font: inherit;
    font-size: 11px;
    text-align: left;
  }
  body.jr-authenticated .workspace-mobile-menu-popover button:hover { background: rgba(var(--agent-accent-rgb), .1); }

  body.jr-authenticated .layout.jr-workspace {
    width: calc(100% - 16px) !important;
    margin-top: 7px !important;
    margin-bottom: calc(34px + env(safe-area-inset-bottom)) !important;
  }
  body.jr-authenticated .workspace-main {
    display: flex !important;
    flex-direction: column;
    gap: 7px !important;
  }
  body.jr-authenticated .workspace-main > .panel-right {
    order: 1;
    display: grid !important;
    min-height: 438px !important;
    height: 438px !important;
    grid-template-rows: 300px 32px 106px !important;
    border-radius: 18px !important;
  }
  body.jr-authenticated .workspace-stage-primary { margin: 7px 7px 0; border-radius: 15px; }
  body.jr-authenticated .workspace-main > .panel-left::before { display: none; }
  body.jr-authenticated .workspace-main > .panel-left .form-body { padding-left: 9px !important; }
  body.jr-authenticated .workspace-stage-progress {
    top: 7px;
    right: 7px;
    left: 7px;
    transform: none;
    display: block;
    min-height: 68px;
    padding: 9px 10px;
    border-radius: 12px;
  }
  body.jr-authenticated .workspace-stage-progress-copy strong { font-size: 11px; }
  body.jr-authenticated .workspace-stage-progress-copy span { display: none; }
  body.jr-authenticated .workspace-stage-step-track { margin-top: 8px; }
  body.jr-authenticated .workspace-stage-step-track em { font-size: 7px; }
  body.jr-authenticated .workspace-stage-empty { padding: 88px 22px 52px; }
  body.jr-authenticated .workspace-stage-empty > span { font-size: 7px; }
  body.jr-authenticated .workspace-stage-empty h2 { margin: 6px 0; font-size: 16px; }
  body.jr-authenticated .workspace-stage-empty p { max-width: 280px; font-size: 9px; }
  body.jr-authenticated .workspace-stage-toolbar {
    right: 7px;
    bottom: 7px;
    left: 7px;
    min-height: 36px;
    padding: 5px 6px 5px 9px;
  }
  body.jr-authenticated .workspace-stage-meta span { display: none; }
  body.jr-authenticated .workspace-stage-actions button,
  body.jr-authenticated .workspace-stage-actions a { display: none; }
  body.jr-authenticated .workspace-stage-actions [data-stage-action="view"] { display: inline-flex; min-height: 30px; align-items: center; }
  body.jr-authenticated .result-title h2 { font-size: 9px !important; }
  body.jr-authenticated .result-tabs { display: none !important; }
  body.jr-authenticated .conc-badge { margin-left: auto; }
  body.jr-authenticated .result-scroll,
  body.jr-authenticated .result-scroll:has(.task-card) {
    height: 106px !important;
    min-height: 106px !important;
    padding: 7px !important;
    grid-auto-columns: 116px !important;
  }
  body.jr-authenticated .result-scroll > .task-card,
  body.jr-authenticated .result-scroll > .task-card:first-of-type {
    width: 116px !important;
    min-width: 116px !important;
    height: 92px !important;
    max-height: 92px !important;
    border-radius: 11px !important;
  }

  body.jr-authenticated .workspace-main > .panel-left {
    order: 2;
    min-height: 312px !important;
    height: auto !important;
    overflow: visible !important;
    border-radius: 18px !important;
  }
  body.jr-authenticated .workspace-main > .panel-left .form-body {
    display: grid !important;
    height: auto !important;
    min-height: 312px !important;
    padding: 9px !important;
    grid-template-columns: minmax(0, 1fr) 106px !important;
    grid-template-areas:
      "tabs tabs"
      "prompt prompt"
      "material actions" !important;
    grid-template-rows: 34px 146px 96px !important;
    gap: 8px !important;
    overflow: visible !important;
  }
  body.jr-authenticated .workspace-main .creator-tabs { width: 100%; min-width: 0 !important; }
  body.jr-authenticated .workspace-main .creator-tab { flex: 1; padding: 4px 7px !important; }
  body.jr-authenticated .workspace-main textarea.prompt-box { min-height: 146px !important; font-size: 16px !important; }
  body.jr-authenticated .workspace-main .material-grid { min-height: 70px !important; }
  body.jr-authenticated .workspace-main .upload-card { min-height: 70px !important; }
  body.jr-authenticated .workspace-prompt-actions { min-height: 96px; padding: 6px !important; }
  body.jr-authenticated .workspace-prompt-summary { display: none !important; }
  body.jr-authenticated .mobile-parameter-trigger {
    display: inline-flex !important;
    min-height: 36px !important;
    margin-bottom: 6px !important;
  }
  body.jr-authenticated .workspace-prompt-actions .submit-btn { min-height: 44px !important; padding: 7px !important; font-size: 10px !important; }
  body.jr-authenticated .workspace-prompt-actions .submit-btn span { white-space: nowrap; }
  body.jr-authenticated .workspace-prompt-actions .submit-sub { display: none !important; }
  body.jr-authenticated .mobile-bottom-nav { display: none !important; }
  body.jr-authenticated .site-icp-footer { max-width: calc(100% - 126px) !important; }
  body.jr-authenticated .workspace-inspector {
    height: min(42dvh, 330px) !important;
    max-height: min(42dvh, 330px) !important;
  }
}

@media (max-width: 390px) {
  body.jr-authenticated .logo-names { display: block !important; }
  body.jr-authenticated .model-switch-button { width: 88px !important; min-width: 88px !important; max-width: 88px !important; }
  body.jr-authenticated .workspace-main > .panel-right { min-height: 418px !important; height: 418px !important; grid-template-rows: 286px 32px 100px !important; }
  body.jr-authenticated .result-scroll,
  body.jr-authenticated .result-scroll:has(.task-card) { height: 100px !important; min-height: 100px !important; }
  body.jr-authenticated .result-scroll > .task-card,
  body.jr-authenticated .result-scroll > .task-card:first-of-type { height: 86px !important; max-height: 86px !important; }
  body.jr-authenticated .workspace-main > .panel-left .form-body { grid-template-columns: minmax(0, 1fr) 102px !important; }
}

@media (min-width: 1600px) {
  body.jr-authenticated .layout.jr-workspace {
    grid-template-columns: 80px minmax(0, 1fr) 300px !important;
    gap: 12px !important;
  }
  body.jr-authenticated .workspace-main {
    grid-template-rows: clamp(470px, 65vh, 690px) clamp(220px, 24vh, 260px) !important;
  }
  body.jr-authenticated .workspace-stage-primary { margin-right: 60px; margin-left: 118px; }
  body.jr-authenticated .workspace-inspector { width: auto !important; }
  body.jr-authenticated .workspace-main > .panel-right { grid-template-rows: minmax(0, 1fr) 36px 128px; }
  body.jr-authenticated .result-scroll,
  body.jr-authenticated .result-scroll:has(.task-card) { height: 128px !important; min-height: 128px !important; grid-auto-columns: 168px !important; }
  body.jr-authenticated .result-scroll > .task-card,
  body.jr-authenticated .result-scroll > .task-card:first-of-type { width: 168px !important; min-width: 168px !important; height: 108px !important; max-height: 108px !important; }
}

@keyframes agent-stage-pulse {
  0%, 100% { transform: scale(.92); opacity: .72; }
  50% { transform: scale(1.12); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body.jr-authenticated .workspace-stage-step-track > span.active i { animation: none !important; }
  body.jr-authenticated .result-scroll > .task-card,
  body.jr-authenticated .workspace-model-segmented button { transition: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  body.jr-authenticated header,
  body.jr-authenticated .workspace-rail,
  body.jr-authenticated .workspace-main > .panel-left,
  body.jr-authenticated .workspace-inspector,
  body.jr-authenticated .workspace-mobile-menu-popover {
    background: var(--agent-surface-strong) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
