@import url("/duration-timeline.css");
/* The Codex browser may inject an annotation cursor layer into the page.
   It is a browser-tool overlay, not part of the application UI; keep it from
   obscuring the real pointer in local testing and embedded sessions. */
#codex-browser-sidebar-comments-root { display: none !important; }

/* Keep the duration control self-contained.  The composer may be served from
   cached shells, so the timeline must not depend on a separate stylesheet
   being fetched before this one. */
.duration-timeline {
  display: block;
  outline: none;
  border-radius: 18px;
  touch-action: none;
  cursor: pointer;
}
.duration-timeline:focus-visible { box-shadow: 0 0 0 2px rgba(102, 170, 255, .45); }
.duration-timeline-labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #9aa2ad;
  font-size: 12px;
}
.duration-timeline-labels strong { color: #f1f3f5; font-size: 18px; font-weight: 700; }
.duration-timeline-track { position: relative; height: 14px; border-radius: 999px; background: #2d3138; }
.duration-timeline-fill { position: absolute; top: 0; left: 0; width: 0; height: 100%; border-radius: inherit; background: #e6e8ec; opacity: .36; pointer-events: none; }
.duration-timeline-thumb { position: absolute; top: -1px; left: 0; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .95); border-radius: 50%; background: #e6e8ec; box-shadow: 0 2px 7px rgba(0, 0, 0, .38); pointer-events: none; transition: transform .12s ease; }
.duration-timeline.is-dragging { cursor: grabbing; }
.duration-timeline.is-dragging .duration-timeline-thumb { transform: scale(1.08); }
:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #f3f4f6;
  background: #0b0c0f;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

body { margin: 0; min-height: 100vh; min-height: 100dvh; background: #0b0c0f; }
.client-body { height: 100vh; height: 100dvh; min-height: 100dvh; overflow: hidden; }
.client-body #app { height: 100%; min-height: 100dvh; }
/* The iframe is mounted after the current view is replaced. Cover that paint with the canvas background. */
.client-body.canvas-navigation-pending #app::before { display: none; }

/* Authentication landing */
.auth-screen { position: relative; width: 100%; min-height: 100vh; overflow: hidden; background: var(--color-bg); color: var(--color-text); isolation: isolate; }
.auth-landing-carousel, .auth-landing-slide, .auth-landing-shade { position: absolute; inset: 0; }
.auth-landing-carousel { z-index: -3; background: var(--page-media-bg); }
.auth-landing-slide { opacity: 0; visibility: hidden; transition: opacity 700ms ease, visibility 700ms ease; }
.auth-landing-slide.active { opacity: 1; visibility: visible; }
.auth-landing-slide > img, .auth-landing-slide > video, .auth-modal-media > img, .auth-modal-media > video, .auth-slide-thumbnail > img, .auth-slide-thumbnail > video { width: 100%; height: 100%; display: block; object-fit: cover; }
/* 未登录首页的全屏动态背景：铺在图片轮播之上、遮罩之下，整屏裁切不拉伸。
   与轮播同为负层级，靠 DOM 顺序（写在轮播之后）压住轮播。
   轻量版和原片两层叠放：轻量版先起播，网速够快时原片淡入盖住它。 */
.auth-landing-backdrop { position: absolute; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.auth-landing-backdrop > video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.auth-landing-backdrop > .auth-hero-hd { opacity: 0; transition: opacity 500ms ease; }
.auth-landing-backdrop > .auth-hero-hd.ready { opacity: 1; }
/* 背景遮罩只服务顶部导航和底部输入条的可读性：中间整块留给画面本身。
   以前是整屏压一层 18%→48% 的黑，视频会被整体拉灰、暗部糊成一片。 */
.auth-landing-shade { z-index: -2; pointer-events: none; background: linear-gradient(180deg, rgba(5, 8, 12, .38) 0%, rgba(5, 8, 12, .1) 15%, rgba(5, 8, 12, .04) 34%, rgba(5, 8, 12, .05) 60%, rgba(5, 8, 12, calc(var(--auth-overlay, .32) * .78)) 100%); }
.auth-landing-header { position: absolute; z-index: 5; top: 0; right: 0; left: 0; height: 184px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-6); padding: 0 46px; }
/* 标题区自己垫一层柔和暗角，整屏遮罩就能调亮，画面不再被拉灰。
   椭圆半径取 50%，正好在盒子上边归零，不然边界会出现一圈肉眼可见的直角。 */
.auth-landing-copy::before { content: ""; position: absolute; z-index: -1; inset: -22% -18%; pointer-events: none; background: radial-gradient(50% 50% at 50% 48%, rgba(4, 7, 11, .52) 0%, rgba(4, 7, 11, .3) 44%, rgba(4, 7, 11, 0) 100%); }
.auth-landing-brand, .auth-login-brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.auth-landing-brand { color: #fff; }
.auth-landing-brand strong, .auth-login-brand strong { flex: 0 1 auto; overflow: hidden; font-size: 32px; line-height: 1.15; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.auth-landing-brand img { flex: 0 0 auto; display: block; width: 164px; height: auto; background: transparent; border: 0; padding: 0; filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .45)) drop-shadow(0 0 10px rgba(0, 0, 0, .2)); }
.brand-logo { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-base); }
.brand-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.logo-gem { display: grid; place-items: center; width: 34px; height: 34px; color: var(--color-brand); font-size: 22px; transform: rotate(16deg); text-shadow: var(--glow-medium); }
.auth-landing-nav { display: flex; align-items: center; gap: var(--space-2); }
.auth-landing-nav button { height: 40px; border: 0; border-radius: var(--radius-pill); background: transparent; color: rgba(244, 248, 251, .9); padding: 0 var(--space-4); cursor: pointer; font-size: 14px; }
.auth-landing-nav button:hover { background: rgba(255, 255, 255, .12); color: var(--color-text); }
.auth-landing-start { justify-self: end; height: 44px; display: flex; align-items: center; gap: var(--space-2); border: 1px solid rgba(187, 239, 249, .48); border-radius: var(--radius-base); background: var(--color-brand); color: var(--color-brand-ink); padding: 0 var(--space-5); font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); }
.auth-landing-start:hover { background: var(--color-brand-strong); transform: translateY(-1px); }
.auth-landing-start .ui-icon, .auth-landing-command button .ui-icon, .auth-submit .ui-icon { width: 18px; height: 18px; }
.auth-landing-copy { position: absolute; z-index: 3; top: 46%; left: 50%; width: min(900px, calc(100% - 280px)); text-align: center; transform: translate(-50%, -50%); text-shadow: 0 3px 28px rgba(0, 0, 0, .66); }
.auth-landing-copy > span, .auth-kicker, .auth-modal-visual-copy > span, .section-heading > div > span, .recharge-modal header span { color: rgba(231, 239, 244, .72); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.auth-landing-copy h1 { margin: 14px 0 var(--space-4); color: var(--auth-title-color, var(--color-text)); font-size: var(--auth-title-size, 96px); line-height: 1.06; font-weight: 750; overflow-wrap: anywhere; }
.auth-landing-copy p { max-width: 620px; margin: 0 auto; color: rgba(237, 243, 247, .8); font-size: 18px; line-height: 1.7; }
.auth-thumbnail-rail { position: absolute; z-index: 5; top: 50%; right: 28px; display: grid; gap: 14px; transform: translateY(-50%); }
.auth-slide-thumbnail { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; border: 2px solid rgba(255, 255, 255, .32); border-radius: 50%; background: var(--page-media-bg); padding: 2px; opacity: .78; cursor: pointer; box-shadow: var(--shadow-sm); }
.auth-slide-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
.auth-thumbnail-placeholder { width: 100%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(135deg, rgba(126, 203, 220, .82), rgba(67, 91, 137, .88)); }
.auth-slide-thumbnail:nth-child(2) .auth-thumbnail-placeholder { background: linear-gradient(135deg, rgba(206, 139, 123, .88), rgba(83, 55, 103, .9)); }
.auth-slide-thumbnail:nth-child(3) .auth-thumbnail-placeholder { background: linear-gradient(135deg, rgba(111, 183, 148, .88), rgba(46, 83, 115, .9)); }
.auth-slide-thumbnail:hover, .auth-slide-thumbnail.active { opacity: 1; transform: scale(1.08); }
.auth-slide-thumbnail.active { border-color: rgba(230, 248, 252, .95); box-shadow: 0 0 0 2px rgba(120, 210, 233, .28), var(--shadow-md); }
.auth-landing-command { position: absolute; z-index: 4; left: 50%; bottom: 46px; width: min(640px, calc(100% - 260px)); height: 60px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--radius-pill); background: rgba(16, 22, 30, .42); padding: 4px 4px 4px var(--space-5); transform: translateX(-50%); backdrop-filter: blur(var(--glass-blur-medium)); box-shadow: var(--shadow-md); }
.auth-landing-command-input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--color-text); font-size: 15px; }
.auth-landing-command-input::placeholder { color: rgba(239, 245, 248, .68); }
.auth-landing-command button { height: 50px; display: flex; align-items: center; gap: var(--space-2); border: 0; border-radius: var(--radius-pill); background: var(--color-brand); color: var(--color-brand-ink); padding: 0 var(--space-6); font-weight: 750; cursor: pointer; }
.auth-landing-command button:hover { background: var(--color-brand-strong); transform: translateY(-1px); }
.auth-media-placeholder { position: absolute; inset: 0; overflow: hidden; background: #111820; }
.auth-media-placeholder span, .auth-media-placeholder i, .auth-media-placeholder b { position: absolute; display: block; border: 1px solid rgba(193, 225, 234, .18); background: rgba(62, 108, 122, .22); transform: rotate(-14deg); }
.auth-media-placeholder span { width: 62vw; height: 92vh; top: -28vh; left: 8vw; }
.auth-media-placeholder i { width: 48vw; height: 58vh; right: -10vw; bottom: -12vh; background: rgba(110, 74, 92, .18); transform: rotate(18deg); }
.auth-media-placeholder b { width: 32vw; height: 32vh; left: 34vw; bottom: -14vh; background: rgba(120, 151, 109, .13); transform: rotate(4deg); }

.auth-modal-backdrop { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; background: rgba(3, 5, 8, .72); padding: 44px; backdrop-filter: blur(9px); }
.auth-modal { position: relative; width: min(1040px, calc(100vw - 88px)); height: min(620px, calc(100vh - 48px)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); overflow: hidden; border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--radius-xl); background: var(--color-bg-raised); box-shadow: var(--shadow-lg); }
.auth-modal-visual { position: relative; min-width: 0; overflow: hidden; background: var(--page-media-bg); }
.auth-modal-media { position: absolute; inset: 0; }
.auth-modal-visual-shade { position: absolute; inset: 0; background: rgba(5, 8, 12, .42); pointer-events: none; }
.auth-modal-visual-copy { position: absolute; z-index: 2; right: var(--space-6); bottom: var(--space-6); left: var(--space-6); display: grid; gap: var(--space-2); color: var(--color-text); text-shadow: 0 2px 18px rgba(0, 0, 0, .72); }
.auth-modal-visual-copy strong { font-size: 34px; line-height: 1.15; }
.auth-modal-visual-copy p { margin: 0; color: rgba(239, 245, 248, .74); font-size: 14px; line-height: 1.7; }
.auth-modal-brand-fallback { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: var(--space-4); background: var(--color-surface); color: var(--color-text-muted); }
.auth-modal-brand-fallback .brand-logo { width: 74px; height: 74px; }
.auth-login-card { position: relative; overflow: hidden; background: #f6f7f8; color: #171a1e; padding: 30px 42px 16px; }
.auth-modal-close { position: absolute; top: var(--space-5); right: var(--space-5); width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--radius-base); background: transparent; color: #2b3036; cursor: pointer; }
.auth-modal-close:hover { background: rgba(20, 25, 31, .07); }
.auth-login-brand { margin-bottom: 16px; }
.auth-login-brand .brand-logo { width: 108px; height: 72px; border-radius: 0; overflow: visible; background: transparent; }
.auth-login-card .auth-kicker { color: #52606a; }
.auth-login-card h2 { margin: 7px 0 5px; font-size: 25px; line-height: 1.2; }
.auth-login-card > p { margin: 0; color: #52606a; font-size: 13px; }
.auth-login-card .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 15px 0 14px; border-bottom: 1px solid #d9dde1; }
.auth-login-card .auth-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #52606a; padding: 9px; cursor: pointer; }
.auth-login-card .auth-tabs button.active { border-bottom-color: #22272d; color: #181c20; font-weight: 700; }
.auth-field { display: grid; gap: 4px; margin-bottom: 9px; color: #555f69; font-size: 12px; }
.auth-field input { width: 100%; height: 42px; border: 1px solid #d9dde1; border-radius: var(--radius-base); outline: none; background: #eceff1; color: #171a1e; padding: 0 var(--space-4); }
.auth-field input::placeholder { color: #969da4; }
.auth-field input:focus { border-color: #7c98a1; box-shadow: 0 0 0 3px rgba(83, 143, 157, .12); }
.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: var(--space-2); }
.auth-code-row button { min-width: 0; border: 1px solid #cbd1d6; border-radius: var(--radius-base); background: #e5e9ec; color: #424a52; font-size: 12px; cursor: pointer; }
.auth-code-row button:disabled { opacity: .6; cursor: wait; }
.forgot-link, .back-login { display: block; margin: -7px 0 12px auto; border: 0; background: transparent; color: #427b88; font-size: 12px; cursor: pointer; }
.back-login { margin: 14px auto 0; color: #69747e; }
.primary-button { border: 0; border-radius: var(--radius-base); background: #f4f6f8; color: #111318; padding: 12px 18px; font-weight: 700; cursor: pointer; }
.primary-button:hover { background: #dff7fb; }
.auth-login-card .auth-submit { width: 100%; height: 42px; display: flex; justify-content: center; align-items: center; gap: var(--space-2); margin-top: 0; background: #1b2025; color: #f5f7f8; }
.auth-login-card .auth-submit:hover { background: #30373e; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-login-card > small { display: block; margin-top: 9px; color: #52606a; font-size: 11px; line-height: 1.25; text-align: center; }
.agreement-check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; color: #68747d; font-size: 12px; line-height: 1.55; }
.agreement-check input { flex: 0 0 auto; width: 15px; height: 15px; margin: 2px 0 0; accent-color: #2c8fb0; }
.agreement-check a { color: #1f728c; text-decoration: underline; text-underline-offset: 2px; }
.payment-highlight-notice { margin: 10px 0; border-radius: 6px; background: rgba(214, 165, 70, .12); color: #d8b86b; padding: 9px 11px; font-size: 12px; line-height: 1.55; }
.payment-highlight-notice a { color: #f0cf80; text-decoration: underline; }
.payment-agreement-check { margin: 14px 0 5px; }
.legal-footer-links { grid-column: 1 / -1; justify-self: center; margin-top: 8px; color: rgba(239, 245, 248, .72); font-size: 11px; }
.legal-footer-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.studio-legal-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; padding: 16px 22px 22px; color: #788590; font-size: 11px; }
.studio-legal-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
.studio-legal-footer a { color: #98b6c4; text-decoration: underline; text-underline-offset: 2px; }
.notice { margin: 0 0 var(--space-4); padding: 10px 12px; border: 1px solid rgba(183, 86, 102, .36); border-radius: var(--radius-base); background: #f7e9ec; color: #a64354; font-size: 13px; }
.notice.success { border-color: rgba(71, 138, 118, .36); background: #e5f2ed; color: #33745f; }

/* Keep the sign-in form fully visible on short laptop and embedded windows. */
@media (max-height: 700px) {
  .auth-modal-backdrop { padding: 10px; }
  .auth-modal {
    width: min(960px, calc(100vw - 32px));
    height: calc(100vh - 20px);
    min-height: 0;
  }
  .auth-login-card { padding: 15px 32px 10px; }
  .auth-modal-close { top: 8px; right: 8px; width: 30px; height: 30px; }
  .auth-login-brand { margin-bottom: 7px; }
  .auth-login-brand .brand-logo { width: 84px; height: 54px; }
  .auth-login-card h2 { margin: 4px 0 3px; font-size: 21px; }
  .auth-login-card .auth-tabs { margin: 10px 0 9px; }
  .auth-login-card .auth-tabs button { padding: 7px; }
  .auth-field { gap: 2px; margin-bottom: 5px; }
  .auth-field input { height: 36px; }
  .auth-login-card .auth-submit { height: 36px; }
  .auth-login-card > small { margin-top: 6px; line-height: 1.2; }
}
@keyframes auth-fade-in { from { opacity: 0; } }
@keyframes auth-modal-in { from { opacity: 0; transform: translateY(12px); } }

button { position: relative; overflow: hidden; transition: transform .16s ease, border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease; }
button:not(:disabled):active { transform: scale(.975); }
button.press-feedback::after { content: ""; position: absolute; z-index: 5; left: var(--press-x); top: var(--press-y); width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .34); pointer-events: none; transform: translate(-50%, -50%) scale(0); animation: press-feedback .52s ease-out; }
@keyframes press-feedback { to { opacity: 0; transform: translate(-50%, -50%) scale(16); } }

/* Main studio shell */
.studio-shell { height: 100%; min-height: 100%; display: grid; grid-template-columns: 72px 240px minmax(0, 1fr); background: #0b0c0f; }
.studio-shell.view-inspire { grid-template-columns: 72px 0 minmax(0, 1fr); }
.view-inspire .conversation-sidebar { width: 0; min-width: 0; opacity: 0; overflow: hidden; padding-left: 0; padding-right: 0; border: 0; pointer-events: none; }
.tool-rail { position: relative; z-index: 30; display: flex; flex-direction: column; align-items: center; background: #131417; border-right: 1px solid #282a2f; padding: 22px 8px 16px; }
.rail-logo { height: 74px; display: grid; place-items: start center; }
.rail-logo .brand-logo { width: 40px; height: 40px; }
.rail-brand-spark img { width: 40px; height: 40px; display: block; object-fit: contain; filter: drop-shadow(0 2px 10px rgba(255, 255, 255, .16)); }
.tool-rail nav { width: 100%; display: grid; gap: 4px; }
.rail-button { position: relative; width: 100%; min-height: 70px; display: grid; place-items: center; align-content: center; gap: 4px; border: 0; border-radius: 6px; background: transparent; color: #9a9fa9; cursor: pointer; }
.rail-button > span:first-child { font-size: 25px; line-height: 1; }
.rail-button > span:last-child { font-size: 12px; }
.rail-button:hover { color: #f5f7fa; background: #1b1d22; }
.rail-button.active { color: #fff; }
.rail-button.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: #46e6bd; }
.rail-bottom { width: 100%; display: grid; place-items: center; gap: 16px; margin-top: auto; }
.credit-rail { width: 60px; height: 55px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid #27393e; border-radius: 7px; background: #10191b; cursor: pointer; }
.credit-rail strong { color: #6ed7e8; font-size: 11px; }
.credit-rail span { color: #7f8993; font-size: 10px; }
.avatar-button { width: 34px; height: 34px; flex: 0 0 34px; overflow: hidden; border: 1px solid #3d424b; border-radius: 50%; background: #687a8c; color: #fff; cursor: pointer; padding: 0; }

.conversation-sidebar { position: relative; z-index: 25; min-width: 0; display: flex; flex-direction: column; background: #15161a; border-right: 1px solid #292b31; padding: 0 12px 18px; transition: width .2s, opacity .2s, padding .2s; }
.conversation-sidebar header { height: 64px; display: grid; align-items: center; padding: 0 8px; }
.conversation-sidebar header > div { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #aeb3bc; cursor: pointer; }
.icon-button:hover { background: #272a31; color: #fff; }
.new-chat { width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 7px; background: transparent; color: #eef0f3; padding: 0 8px; font-size: 14px; cursor: pointer; }
.new-chat:hover { background: #202228; }
.new-chat.loading { color: #8c929d; cursor: wait; }
.new-chat-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #363941; border-radius: 7px; background: #25272e; font-size: 20px; }
.default-chat { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 7px; background: transparent; color: #d5d7dd; padding: 6px 8px; font-size: 14px; text-align: left; cursor: pointer; }
.default-chat:hover, .default-chat.active { background: #24262d; color: #fff; }
.default-chat .default-art { flex: 0 0 auto; }
.conversation-label { padding: 14px 8px 8px; color: #666c77; font-size: 11px; }
.conversation-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; scrollbar-width: thin; scrollbar-color: #3c3f47 transparent; }
.conversation-item { width: 100%; min-width: 0; min-height: 48px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; border: 0; border-radius: 7px; background: transparent; padding: 5px 8px; color: #bec2ca; text-align: left; cursor: pointer; }
.conversation-item:hover, .conversation-item.active { background: #272930; color: #fff; }
.conversation-copy { min-width: 0; display: grid; gap: 2px; }
.conversation-copy strong, .conversation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { color: #e1e3e7; font-size: 13px; font-weight: 500; }
.conversation-copy small { color: #696f79; font-size: 10px; }
.conversation-thumb { position: relative; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #242d36; color: #89d6e8; }
.conversation-thumb img, .conversation-thumb video { width: 100%; height: 100%; display: block; object-fit: cover; }
.conversation-thumb i { position: absolute; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(8, 10, 13, .72); color: #fff; font-size: 10px; font-style: normal; }
.conversation-thumb.video { background: #302924; color: #efc57f; }
.conversation-thumb.empty { border: 1px solid #343942; background: #202329; color: #bfc6cf; font-size: 14px; }
.conversation-empty { padding: 14px 8px; color: #626974; font-size: 12px; }
.sidebar-collapsed { grid-template-columns: 72px 0 minmax(0, 1fr); }
.sidebar-collapsed .conversation-sidebar { width: 0; opacity: 0; padding-left: 0; padding-right: 0; overflow: hidden; border: 0; }

.workspace { position: relative; min-width: 0; height: 100%; min-height: 100%; overflow: hidden; background: #0b0c0f; }
.workspace-toolbar { position: absolute; z-index: 20; top: 20px; right: 26px; display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 5px; border: 1px solid #2b2e35; border-radius: 8px; background: rgba(24, 26, 31, .96); box-shadow: 0 12px 30px rgba(0, 0, 0, .28); }
.announcement-button { position: relative; height: 36px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 6px; background: transparent; color: #bdc1c9; padding: 0 10px; cursor: pointer; }
.announcement-button:hover, .announcement-button:focus-visible { outline: 0; background: #292c33; color: #fff; }
.announcement-button-icon { display: grid; place-items: center; width: 22px; height: 22px; color: #9de4ee; font-size: 17px; }
.announcement-button-icon span { line-height: 1; }
.announcement-button-label { font-size: 12px; }
.announcement-button > i { position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border: 1px solid #181a1f; border-radius: 50%; background: #e8b96d; }
.search-box { width: 160px; height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border-right: 1px solid #31343b; color: #aeb4be; }
.search-box > span { font-size: 20px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: #fff; }
.search-box input::placeholder { color: #727985; }
.toolbar-filter, .toolbar-assets { height: 36px; border: 0; border-radius: 6px; background: transparent; color: #bdc1c9; padding: 0 11px; cursor: pointer; }
.toolbar-filter:hover, .toolbar-assets:hover { background: #292c33; color: #fff; }
.toolbar-select { height: 36px; display: flex; align-items: center; border-radius: 6px; padding: 0 5px; }
.toolbar-select:hover { background: #292c33; }
.toolbar-select select { max-width: 108px; border: 0; outline: 0; background: transparent; color: #bdc1c9; cursor: pointer; }
.toolbar-select option { background: #202228; color: #fff; }
.toolbar-assets { display: flex; align-items: center; gap: 7px; }
.toolbar-assets i { width: 5px; height: 5px; border-radius: 50%; background: #5cd7eb; }
.account-pill { height: 36px; display: flex; align-items: center; gap: 9px; margin-left: 2px; border: 0; border-radius: 7px; background: #24272e; padding: 0 5px 0 10px; cursor: pointer; }
.account-pill span { color: #89d9e8; font-size: 12px; }
.account-pill b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #64788a; font-size: 12px; }

.creative-stage { height: 100%; overflow-y: auto; padding: 104px 54px 250px; scrollbar-width: thin; scrollbar-color: #42454d transparent; }
.creative-stage,
.creative-stage .generation-feed,
.creative-stage .generation-item { overflow-anchor: none; }
.generation-feed { width: min(1180px, 100%); margin: 0 auto; display: grid; gap: 48px; }
.generation-older-button { justify-self: center; min-width: 156px; }
.generation-item { position: relative; scroll-margin: 120px; }
.generation-meta { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: start; margin: 0 4px 14px; }
.prompt-avatar { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #343840; border-radius: 7px; background: #1e2229; color: #80d5e8; font-size: 20px; transform: rotate(-4deg); }
.generation-meta p { margin: 1px 0 5px; color: #e8e9ed; font-size: 15px; line-height: 1.65; }
.task-prompt-summary { position: relative; min-width: 0; margin: 1px 0 7px; outline: 0; }
.task-prompt-clamped { height: 38px; display: flex; align-items: center; gap: 6px; overflow: hidden; color: #e8e9ed; font-size: 15px; line-height: 1.65; white-space: nowrap; mask-image: linear-gradient(90deg, #000 calc(100% - 52px), transparent); }
.task-prompt-clamped .reference-hover-card { flex: 0 0 auto; }
.task-prompt-full { position: absolute; z-index: 120; top: -12px; left: -12px; width: min(920px, calc(100vw - 390px)); max-height: min(410px, calc(100vh - 150px)); display: none; flex-wrap: wrap; align-items: center; gap: 7px; overflow-y: auto; border: 1px solid #393d45; border-radius: 9px; background: #1d1f24; color: #f0f1f3; padding: 14px 16px; font-size: 15px; line-height: 1.8; box-shadow: 0 22px 64px rgba(0, 0, 0, .68); }
.task-prompt-summary:hover .task-prompt-full, .task-prompt-summary:focus-within .task-prompt-full, .task-prompt-summary:focus .task-prompt-full { display: flex; animation: preview-in .16s ease-out; }
.reference-hover-card { position: relative; height: 42px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #3a414b; border-radius: 7px; background: #1a1e24; padding: 4px 9px 4px 4px; vertical-align: middle; color: #dce3e9; cursor: zoom-in; outline: 0; }
.reference-hover-card.compact { height: 38px; }
.reference-hover-card > strong { font-size: 12px; font-weight: 600; }
.reference-hover-thumb { position: relative; width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #262c34; color: #76d4e2; }
.reference-hover-thumb img, .reference-hover-thumb video { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .2s ease; }
.reference-hover-thumb i { position: absolute; font-style: normal; color: #fff; text-shadow: 0 1px 5px #000; }
.reference-hover-preview { position: absolute; z-index: 80; left: 0; top: calc(100% + 10px); width: min(360px, 66vw); max-height: 360px; display: none; overflow: hidden; border: 1px solid #454c56; border-radius: 7px; background: #111419; padding: 6px; box-shadow: 0 18px 55px rgba(0, 0, 0, .65); pointer-events: none; }
.reference-hover-preview img, .reference-hover-preview video { width: 100%; max-height: 344px; display: block; object-fit: contain; border-radius: 4px; }
.reference-hover-card:hover, .reference-hover-card:focus { z-index: 79; border-color: #70cddb; background: #202830; }
.reference-hover-card:hover .reference-hover-thumb img, .reference-hover-card:hover .reference-hover-thumb video { transform: scale(1.12); }
.reference-hover-card:hover .reference-hover-preview, .reference-hover-card:focus .reference-hover-preview { display: none; }
.inline-reference-chip:hover { z-index: 78; border-color: #70cddb; }
.inline-reference-chip:hover .reference-hover-preview { display: none; }
.inline-reference-chip.audio { cursor: pointer; }
.inline-reference-chip.audio:focus-visible { outline: 2px solid #70cddb; outline-offset: 2px; }
.reference-audio-icon { font-size: 17px; }
.reference-audio-preview { min-height: 110px; display: grid; place-items: center; align-content: center; gap: 8px; color: #dce4e9; }
.reference-audio-preview span { color: #89929d; font-size: 12px; }
.reference-audio-popover { position: fixed; z-index: 240; display: grid; gap: 8px; border: 1px solid #4d6974; border-radius: 9px; background: #1b2228; padding: 10px 11px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); color: #edf5f7; }
.reference-audio-popover strong { overflow: hidden; color: #dff6fa; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.reference-audio-popover audio { width: 100%; height: 34px; }
.resolution-pricing-editor { margin-top: 18px; border: 1px solid #313a44; border-radius: 8px; background: #151a20; padding: 18px 13px 13px; }
.resolution-pricing-editor legend { margin-left: 5px; padding: 0 7px; background: #151a20; color: #e8eef2; font-size: 14px; font-weight: 650; line-height: 1.45; }
.resolution-pricing-editor > p { margin: 0 0 10px; color: #8d99a5; font-size: 12px; }
.resolution-pricing-grid { display: grid; gap: 8px; }
.resolution-pricing-grid > label { display: grid; grid-template-columns: 90px minmax(110px, 1fr) minmax(110px, 1fr) 120px; align-items: center; gap: 8px; border: 1px solid #2b343e; border-radius: 7px; background: #1b2128; padding: 8px; color: #cbd4dc; font-size: 12px; }
.resolution-pricing-grid > label > span { display: grid; gap: 3px; color: #8d99a5; font-size: 10px; }
.resolution-pricing-grid input { width: 100%; box-sizing: border-box; border: 1px solid #394652; border-radius: 5px; background: #12171c; color: #f1f5f7; padding: 5px 6px; }
.resolution-pricing-grid small { color: #8de0af; font-size: 11px; white-space: nowrap; }
@media (max-width: 700px) { .resolution-pricing-grid > label { grid-template-columns: 1fr 1fr; } .resolution-pricing-grid > label > strong, .resolution-pricing-grid > label > small { grid-column: 1 / -1; } }
@keyframes preview-in { from { opacity: 0; transform: translateY(5px) scale(.98); } to { opacity: 1; transform: none; } }
.generation-meta small { color: #6f7580; }
.task-status { padding: 5px 8px; border: 1px solid #343941; border-radius: 6px; color: #9097a3; font-size: 11px; }
.task-status.completed { color: #73d9c1; border-color: #294a44; }
.task-status.refunded { color: #d1a0a8; }
.generation-results { display: grid; gap: 12px; margin-left: 62px; align-items: start; }
.generation-result-row { display: flex; align-items: flex-start; gap: 12px; margin-left: 62px; }
.generation-result-row .generation-results { flex: 1 1 auto; min-width: 0; margin-left: 0; }
.generation-processing-status { flex: 0 0 auto; width: 72px; padding-top: 2px; }
.generation-processing-status .task-status { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; white-space: nowrap; }
.generation-results.count-1 { grid-template-columns: minmax(0, 1fr); }
.generation-results.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.generation-results.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.generation-results.count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.generation-result-card { position: relative; width: min(100%, var(--result-fit-width, 100%)); min-width: 0; }
.generation-results.count-1 .generation-result-card { width: min(520px, 100%, var(--result-fit-width, 520px)); }
.result-index { position: absolute; z-index: 2; top: 8px; left: 8px; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 5px; background: rgba(10, 12, 16, .78); color: #dce2e8; font-size: 11px; }
.generation-output { position: relative; width: 100%; aspect-ratio: var(--result-ratio, 16 / 9); overflow: hidden; border: 1px solid #272b32; border-radius: 8px; background: #111318; }
.generation-output img, .generation-output video { width: 100%; height: 100%; display: block; object-fit: contain; background: #111318; }
.media-preview-trigger { width: 100%; height: 100%; border: 0; background: transparent; padding: 0; cursor: zoom-in; }
.generation-output.audio { aspect-ratio: 16 / 7; display: grid; place-items: center; min-height: 150px; }
.generation-audio-preview { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; border: 0; background: radial-gradient(circle at 50% 20%, rgba(83, 191, 211, .22), transparent 55%), #11181c; color: #dff7fb; cursor: pointer; }
.generation-audio-preview > span { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid rgba(116, 214, 231, .54); border-radius: 50%; color: #7fdfed; }
.generation-audio-preview > strong { font-size: 13px; font-weight: 600; }
.generation-audio-preview > small { color: #94aeb4; font-size: 11px; }
.generation-audio-preview:hover { background-color: #142329; }
.generation-loading-surface { position: relative; width: 100%; height: 100%; min-height: 180px; overflow: hidden; background: #15191f; isolation: isolate; }
.generation-loading-grid { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(rgba(123, 163, 175, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(123, 163, 175, .08) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent); animation: generation-grid-drift 8s linear infinite; }
.generation-loading-center { position: absolute; left: 50%; top: 50%; width: 116px; height: 116px; transform: translate(-50%, -54%); border: 1px solid rgba(126, 211, 222, .25); border-radius: 50%; box-shadow: 0 0 0 12px rgba(126, 211, 222, .035), 0 0 34px rgba(126, 211, 222, .13); }
.generation-loading-center::before, .generation-loading-center::after { content: ''; position: absolute; inset: 15px; border: 1px dashed rgba(126, 211, 222, .26); border-radius: 50%; animation: generation-ring 5s linear infinite; }
.generation-loading-center::after { inset: 31px; border-style: solid; border-color: rgba(215, 190, 126, .3); animation-direction: reverse; animation-duration: 3.4s; }
.generation-loading-center i { position: absolute; inset: 48px; border-radius: 50%; background: #8bd7df; box-shadow: 0 0 20px rgba(139, 215, 223, .72); animation: generation-core 1.7s ease-in-out infinite; }
.generation-loading-scan { position: absolute; z-index: 2; left: 50%; top: 5px; width: 1px; height: 106px; transform-origin: 50% 53px; background: linear-gradient(to bottom, transparent, rgba(139, 215, 223, .72), transparent); animation: generation-scan 2.6s linear infinite; }
.generation-loading-status { position: absolute; z-index: 3; top: 14px; left: 16px; display: flex; align-items: center; gap: 8px; color: #e9eef0; }
.generation-loading-status b { width: 7px; height: 7px; border-radius: 50%; background: #8bd7df; box-shadow: 0 0 0 4px rgba(139, 215, 223, .12); animation: generation-core 1.7s ease-in-out infinite; }
.generation-loading-status strong { font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.generation-loading-bar { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 42px; height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.1); }
.generation-loading-bar i { display: block; height: 100%; border-radius: inherit; background: #8bd7df; box-shadow: 0 0 12px rgba(139, 215, 223, .7); transition: width .35s ease; }
.generation-loading-surface > small { position: absolute; z-index: 3; right: 16px; bottom: 16px; color: #9ba8ae; font-size: 10px; }
@keyframes generation-grid-drift { to { background-position: 0 28px, 28px 0; } }
@keyframes generation-ring { to { transform: rotate(360deg); } }
@keyframes generation-scan { to { transform: rotate(360deg); } }
@keyframes generation-core { 50% { opacity: .55; transform: scale(.82); } }
.result-media-tools { position: absolute; z-index: 5; top: 10px; right: 10px; display: flex; align-items: center; gap: 3px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 8px; background: rgba(17, 19, 24, .84); padding: 4px; opacity: 0; transform: translateY(-5px); transition: opacity .16s ease, transform .16s ease; backdrop-filter: blur(12px); }
.generation-output:hover .result-media-tools, .generation-output:focus-within .result-media-tools { opacity: 1; transform: none; }
.generation-output.video .result-media-tools { opacity: 0; transform: translateY(-5px); pointer-events: none; }
.generation-output.video.video-hover-active .result-media-tools { opacity: 1; transform: none; pointer-events: auto; }
.generation-output.video-hover-active .result-media-tools { opacity: 1; transform: none; pointer-events: auto; }
.result-media-tools button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #eef1f4; font-size: 18px; cursor: pointer; }
.result-media-tools button:hover { background: #353940; color: #9de8f2; }
.result-media-tools button:disabled { color: #69717b; cursor: default; }
.generation-output.pending { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; align-content: center; gap: 10px; min-height: 180px; padding: 18px; background: #15171b; color: #7e8591; text-align: center; }
.generation-failure-mark { width: 56px; height: 56px; display: grid; place-items: center; border: 2px solid #664049; border-radius: 50%; color: #e6a1ad; font-size: 20px; font-weight: 700; }
.generating-orbit { width: 68px; height: 68px; display: grid; place-items: center; border: 2px solid #39404a; border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
.generating-orbit span { color: #7ad0df; font-size: 16px; font-weight: 700; }
@keyframes pulse { 50% { transform: scale(1.08); border-color: #70cbdc; } }
.generation-progress-copy { width: min(100%, 420px); display: grid; gap: 4px; }
.generation-progress-copy strong { color: #e4e7eb; font-size: 13px; }
.generation-output.pending p { margin: 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.generation-progress-copy small { color: #686f7a; }
.real-progress { grid-column: 1 / -1; width: min(350px, 82%); height: 5px; overflow: hidden; border-radius: 3px; background: #2c3037; }
.real-progress i { width: var(--progress); height: 100%; display: block; background: #75d3e2; transition: width .35s ease; }
.real-progress.unknown i { width: 36%; animation: unknown-progress 1.4s ease-in-out infinite alternate; }
@keyframes unknown-progress { from { transform: translateX(-110%); } to { transform: translateX(290%); } }
.generation-results:not(.count-1) .generation-output.pending { grid-template-columns: 1fr; }
.generation-results:not(.count-1) .generation-progress-copy { text-align: center; }
.generation-primary-actions { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.generation-primary-actions > button, .task-more-menu > summary { min-width: 0; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #2d3037; border-radius: 7px; background: #1c1e24; color: #d4d7dc; padding: 0 9px; font-size: 11px; line-height: 1; white-space: nowrap; cursor: pointer; list-style: none; }
.generation-primary-actions > button { flex: 0 1 auto; }
.generation-primary-actions > button:hover, .task-more-menu > summary:hover, .task-more-menu[open] > summary { background: #292c33; color: #fff; }
.generation-primary-actions > button:disabled { opacity: .48; cursor: wait; }
.task-more-menu { position: relative; }
.task-more-menu > summary { width: 36px; padding: 0; font-size: 13px; }
.task-more-menu > summary::-webkit-details-marker { display: none; }
.task-more-menu > div { position: absolute; z-index: 30; left: 0; bottom: calc(100% + 7px); width: 150px; border: 1px solid #3a3e46; border-radius: 7px; background: #1c1f24; padding: 5px; box-shadow: 0 14px 38px rgba(0, 0, 0, .52); }
.task-more-menu > div button { width: 100%; min-height: 36px; border: 0; border-radius: 5px; background: transparent; color: #e4a4ad; text-align: left; padding: 0 10px; cursor: pointer; }
.task-more-menu > div button:hover { background: #3a272c; color: #ffdbe0; }
.subtle-button { min-height: 38px; display: inline-flex; align-items: center; border: 1px solid #2d3037; border-radius: 7px; background: #1c1e24; color: #c7cad1; padding: 0 13px; text-decoration: none; cursor: pointer; }
.subtle-button:hover { background: #282b32; color: #fff; }

.empty-stage { height: calc(100vh - 330px); min-height: 360px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-stage.standalone { height: 100vh; }
.empty-symbol { position: relative; width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid #2d323a; border-radius: 50%; background: #16191e; color: #92dcec; font-size: 30px; }
.empty-symbol i { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: #e7c267; border: 4px solid #0b0c0f; }
.empty-stage h1 { margin: 0; font-size: 27px; font-weight: 600; }
.empty-stage p { margin: 10px 0 22px; color: #727985; font-size: 14px; }
.empty-stage.fresh-conversation { height: calc(100vh - 250px); min-height: 420px; }
.empty-stage.fresh-conversation .empty-symbol { width: 64px; height: 64px; margin-bottom: 15px; background: #121419; font-size: 25px; }
.empty-stage.fresh-conversation h1 { font-size: 24px; }
.empty-stage.fresh-conversation p { max-width: 420px; margin-bottom: 0; }
.prompt-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 680px; }
.prompt-suggestions button { border: 1px solid #292d34; border-radius: 7px; background: #15171b; color: #9da3ae; padding: 9px 13px; cursor: pointer; }
.prompt-suggestions button:hover { border-color: #49515d; color: #fff; }

.prompt-composer { position: absolute; z-index: 15; left: 50%; bottom: 24px; width: min(1080px, calc(100% - 64px)); min-height: 168px; transform: translateX(-50%); display: flex; flex-direction: column; border: 1px solid #32343a; border-radius: 18px; background: #1d1f24; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); }
.prompt-composer.expanded { width: min(1180px, calc(100% - 48px)); min-height: 260px; }
.prompt-composer.maximized { width: min(1400px, calc(100% - 32px)); height: min(620px, calc(100vh - 100px)); min-height: min(520px, calc(100vh - 100px)); }
.composer-expand-button { position: absolute; z-index: 3; top: -42px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #3c414a; border-radius: 6px; background: #25282f; color: #b7bec8; font-size: 17px; cursor: pointer; }
.composer-expand-button:hover { border-color: #69bac8; color: #e9fbff; }
.composer-back-bottom { position: absolute; z-index: 3; top: -42px; right: 56px; width: 86px; height: 34px; display: grid; place-items: center; border: 1px solid #3c414a; border-radius: 6px; background: #25282f; color: #b7bec8; font-size: 12px; cursor: pointer; white-space: nowrap; }
.composer-back-bottom:hover { border-color: #69bac8; color: #e9fbff; }
/* The author rule above sets display: grid, which would otherwise beat the
   user-agent [hidden] rule and leave the control visible at the newest task. */
.composer-back-bottom[hidden] { display: none; }
.prompt-composer.compact { width: min(900px, calc(100% - 64px)); min-height: 78px; border-radius: 39px; opacity: .98; }
.prompt-composer.compact .composer-main { min-height: 76px; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 14px; padding: 8px 18px; }
.prompt-composer.compact .prompt-rich-editor { height: 48px; min-height: 48px; overflow: hidden; white-space: nowrap; line-height: 48px; }
.prompt-composer.compact .composer-toolbar, .prompt-composer.compact .frame-upload-grid, .prompt-composer.compact .reference-strip, .prompt-composer.compact .prompt-reference-count { display: none; }
.prompt-composer.compact .composer-expand-button { display: grid; }
.prompt-composer.compact .attach-button:not(.has-reference), .prompt-composer.compact .composer-mode-icon { width: 42px; height: 52px; border-radius: 5px; background: #302e32; color: #8f929a; transform: rotate(-7deg); }
.prompt-composer.compact .attach-button svg { transform: rotate(7deg); }
.prompt-composer.compact .inline-reference-chip { height: 29px; margin-top: 9px; margin-bottom: 10px; }
.prompt-composer.expanded .composer-main { min-height: 154px; }
.prompt-composer.expanded .prompt-rich-editor { height: 132px; }
.prompt-composer.maximized .composer-main { min-height: 0; flex: 1 1 auto; }
.prompt-composer.maximized .prompt-entry { height: 100%; min-height: 0; }
.prompt-composer.maximized .prompt-rich-editor { height: 100%; min-height: 180px; }
.prompt-composer.maximized .frame-upload-grid { flex: 0 0 auto; }
.prompt-composer.maximized .composer-toolbar { flex: 0 0 auto; margin-top: auto; }
.reference-strip { display: flex; align-items: center; gap: 8px; padding: 14px 20px 0; }
.reference-strip > span { color: #777f8a; font-size: 11px; }
.reference-preview { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid #444a54; border-radius: 7px; background: #14171c; }
.reference-preview img, .reference-preview video { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 6px; }
.reference-preview > span { color: #82d6e5; font-size: 22px; }
.reference-preview > i { position: absolute; left: 4px; bottom: 4px; border-radius: 3px; background: rgba(8, 10, 13, .78); color: #e2e6eb; padding: 2px 4px; font-size: 9px; font-style: normal; }
.reference-preview button { position: absolute; top: -6px; right: -6px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #50555f; border-radius: 50%; background: #24272e; color: #fff; cursor: pointer; }
.no-model-warning { position: absolute; z-index: 15; left: 50%; bottom: 32px; transform: translateX(-50%); width: min(720px, calc(100% - 40px)); padding: 18px; border: 1px solid #644e36; border-radius: 8px; background: #241e17; color: #e4c18f; text-align: center; }
.creation-agent-context { border: 1px solid #2b343d; border-radius: 8px; background: #1b2026; color: #8b97a2; padding: 9px 11px; font-size: 11px; line-height: 1.6; }
.creation-agent-workspace { width: min(900px, 100%); min-height: min(560px, calc(100vh - 280px)); margin: 0 auto; display: flex; flex-direction: column; border: 1px solid #2c333b; border-radius: 14px; background: rgba(18, 22, 27, .86); box-shadow: 0 18px 44px rgba(0, 0, 0, .2); }
.creation-agent-workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px 18px; border-bottom: 1px solid #2b3139; }
.creation-agent-workspace-header > div { min-width: 0; }
.creation-agent-workspace-header span { color: #7c9aa4; font-size: 9px; letter-spacing: .15em; }
.creation-agent-workspace-header h1 { margin: 6px 0 5px; color: #edf5f7; font-size: 22px; line-height: 1.2; }
.creation-agent-workspace-header p { margin: 0; color: #87939e; font-size: 12px; line-height: 1.6; }
.creation-agent-workspace-header .subtle-button { flex: 0 0 auto; margin-top: 2px; }
.creation-agent-workspace > .creation-agent-context { margin: 16px 26px 0; }
.creation-agent-inline-messages { min-height: 300px; max-height: min(470px, calc(100vh - 470px)); padding: 20px 26px 26px; }
.agent-composer { width: min(900px, calc(100% - 64px)); min-height: 148px; border-radius: 14px; }
.agent-composer-main { min-height: 92px; padding: 16px 20px 4px; }
.agent-composer-main textarea { width: 100%; min-height: 72px; resize: none; border: 0; outline: 0; background: transparent; color: #f2f3f5; font: inherit; font-size: 15px; line-height: 1.6; }
.agent-composer-main textarea::placeholder { color: #858b95; }
.agent-composer-toolbar { min-height: 52px; padding-top: 4px; }
.agent-skill-tools { display: flex; gap: 6px; padding: 0 20px 8px; }
.agent-skill-trigger { border: 1px solid #36414a; border-radius: 7px; background: #202830; color: #a9dfe6; padding: 5px 9px; font: inherit; font-size: 11px; cursor: pointer; }
.agent-skill-trigger:hover { border-color: #65bcc8; background: #263841; }
.agent-active-skills { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 7px; }
.agent-skill-chip { border: 1px solid rgba(124, 203, 216, .38); border-radius: 999px; background: rgba(54, 105, 112, .24); color: #b8edf1; padding: 4px 8px; font-size: 10px; cursor: pointer; }
.agent-skill-menu { position: absolute; z-index: 60; left: 20px; bottom: 82px; width: min(310px, calc(100% - 40px)); max-height: 260px; overflow: auto; border: 1px solid #3b4650; border-radius: 9px; background: #161c22; box-shadow: 0 14px 32px rgba(0, 0, 0, .45); padding: 5px; }
.agent-skill-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; border-radius: 6px; }
.agent-skill-menu button { display: grid; gap: 2px; width: 100%; border: 0; border-radius: 6px; background: transparent; color: #dce6ea; padding: 8px 9px; text-align: left; cursor: pointer; }
.agent-skill-menu button:hover { background: #26343a; }
.agent-skill-option .agent-skill-edit { width: auto; color: #82919b; padding: 6px 8px; font-size: 10px; }
.agent-skill-option .agent-skill-edit:hover { color: #c5e8ed; }
.agent-skill-menu button strong { font-size: 12px; }
.agent-skill-menu button small, .agent-skill-menu > span { color: #8796a1; font-size: 10px; }
.agent-skill-menu-list { display: grid; gap: 2px; max-height: 210px; overflow-y: auto; }
.agent-skill-menu-list > span { display: block; padding: 8px 9px; }
.agent-skill-menu .agent-skill-create {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  border-top: 1px solid #303b44;
  border-radius: 0 0 6px 6px;
  color: #a9dfe6;
  padding: 9px;
}
.agent-skill-menu .agent-skill-create .ui-icon { width: 14px; height: 14px; }
.agent-model-select { height: 40px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #34373e; border-radius: 8px; background: transparent; color: #9ca5ae; padding: 0 9px; font-size: 11px; }
.agent-model-select span { white-space: nowrap; }
.agent-model-select select { max-width: 190px; border: 0; outline: 0; background: transparent; color: #d8dbe0; font: inherit; font-weight: 600; cursor: pointer; }
.agent-model-select select option { background: #1b1e23; color: #e8edf2; }
.agent-enter-hint { align-self: center; color: #89959d; font-size: 10px; white-space: nowrap; }
.agent-mode-menu { position: absolute; z-index: 55; left: 14px; bottom: 58px; width: 116px; overflow: hidden; border: 1px solid #3b414a; border-radius: 8px; background: #1b1e23; box-shadow: 0 14px 32px rgba(0, 0, 0, .45); }
.agent-mode-menu button { width: 100%; min-height: 34px; border: 0; background: transparent; color: #aeb6bf; padding: 0 11px; text-align: left; font: inherit; font-size: 11px; cursor: pointer; }
.agent-mode-menu button:hover, .agent-mode-menu button.active { background: #26343a; color: #b9edf3; }
.agent-chat-feed { width: min(1000px, 100%); margin: 0 auto; display: grid; gap: 22px; padding: 24px 0 26px; }
.agent-chat-message { display: flex; align-items: flex-start; gap: 11px; max-width: 880px; }
.agent-chat-message.user { flex-direction: row-reverse; margin-left: auto; }
.agent-chat-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid #343b44; border-radius: 50%; background: #20262d; color: #8cdce8; }
.agent-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-chat-spark { font-size: 17px; }
.agent-chat-body { min-width: 0; max-width: min(760px, calc(100% - 45px)); }
.agent-chat-message.user .agent-chat-body { text-align: right; }
.agent-chat-body > header { display: flex; align-items: baseline; gap: 8px; min-height: 18px; margin-bottom: 5px; }
.agent-chat-message.user .agent-chat-body > header { justify-content: flex-end; }
.agent-chat-body > header strong { color: #dce2e7; font-size: 12px; font-weight: 600; }
.agent-chat-body > header time { color: #6f7984; font-size: 10px; }
.agent-chat-bubble { display: inline-block; max-width: 100%; border: 1px solid #2f3841; border-radius: 10px 10px 10px 3px; background: #171d23; color: #e4e8ec; padding: 11px 14px; font-size: 14px; line-height: 1.7; text-align: left; overflow-wrap: anywhere; }
.agent-choice-number { display: inline-grid; width: 1.45em; height: 1.45em; margin-right: 4px; place-items: center; border: 1px solid rgba(124, 221, 232, .48); border-radius: 50%; background: #21454e; color: #c1f3f7; font-size: .86em; font-weight: 700; line-height: 1; vertical-align: .02em; }
.agent-chat-message.user .agent-chat-bubble { border-color: rgba(120, 211, 226, .28); border-radius: 10px 10px 3px 10px; background: #1a2b31; }
.agent-chat-usage { display: block; margin-top: 5px; color: #6f7984; font-size: 10px; }
.agent-chat-message .creation-agent-apply { display: block; margin-top: 6px; border: 0; background: transparent; color: #7dcbd8; padding: 0; font-size: 10px; cursor: pointer; }
.agent-chat-message.user .creation-agent-apply { display: none; }
.agent-chat-thinking { display: flex; align-items: center; gap: 8px; margin-left: 45px; color: #8d98a3; font-size: 12px; }
.agent-chat-thinking span { color: #8bdce8; }
.agent-chat-empty { display: grid; justify-items: center; gap: 8px; width: min(760px, 100%); margin: 24px auto 0; padding: 26px 18px; color: #8d98a3; text-align: center; }
.agent-chat-empty span { color: #8bdce8; font-size: 24px; }
.agent-chat-empty strong { color: #e9edf0; font-size: 18px; }
.agent-chat-empty p { margin: 0; font-size: 12px; }
.agent-generation-confirmation { margin-top: 10px; width: min(620px, 100%); border: 1px solid rgba(115, 211, 227, .28); border-radius: 8px; background: #121a20; padding: 13px; text-align: left; }
.agent-confirmation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e8eef2; font-size: 13px; }
.agent-confirmation-heading span { color: #86d9e7; font-size: 11px; }
.agent-confirmation-prompt { max-height: 68px; margin: 9px 0 12px; overflow: auto; color: #aeb8c1; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.agent-confirmation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.agent-confirmation-grid label { display: grid; gap: 5px; color: #8c98a2; font-size: 11px; }
.agent-confirmation-grid select { min-width: 0; height: 32px; border: 1px solid #35424c; border-radius: 5px; background: #0f151a; color: #e7edf1; padding: 0 8px; font: inherit; font-size: 12px; }
.agent-confirmation-references { display: grid; gap: 7px; margin-top: 10px; border-top: 1px solid #29343c; padding-top: 9px; }
.agent-confirmation-reference-title { color: #8c98a2; font-size: 11px; }
.agent-confirmation-references.is-empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-confirmation-references.is-empty strong { color: #8fd5df; font-size: 11px; font-weight: 500; }
.agent-confirmation-reference-list { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-confirmation-reference { min-width: 0; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #30414a; border-radius: 6px; background: #0f161b; color: #d8e0e5; padding: 4px 5px; font-size: 11px; }
.agent-confirmation-reference-preview { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: #172129; color: #82d5e1; }
.agent-confirmation-reference-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.agent-confirmation-reference strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-confirmation-reference button { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #7f8b95; padding: 0; cursor: pointer; }
.agent-confirmation-reference button:hover { background: rgba(255, 255, 255, .08); color: #ffffff; }
.agent-confirmation-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.agent-confirmation-actions .subtle-button, .agent-confirmation-actions .primary-button { min-height: 32px; padding: 0 12px; font-size: 12px; }
.agent-generation-confirmation-error { margin-top: 8px; color: #d99b7b; font-size: 12px; }
/* Submitted generation, kept inline in the conversation: sent prompt,
   parameters, live waiting surface and the delivered media. */
.agent-generation-task { display: grid; gap: 10px; margin-top: 10px; width: min(620px, 100%); border: 1px solid rgba(115, 211, 227, .22); border-radius: 8px; background: #121a20; padding: 13px; text-align: left; }
/* A submission message sizes itself from its card, so give the message body a
   stable width. Otherwise the waiting surface is narrower than the finished
   result and the card visibly jumps when the task completes. */
.agent-chat-message.is-generation .agent-chat-body { width: 100%; }
.agent-generation-task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agent-generation-task-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agent-generation-task-head strong { color: #e8eef2; font-size: 13px; font-weight: 600; }
.agent-generation-task-badge { flex: 0 0 auto; border-radius: 4px; background: #1c3b43; color: #9ce3ef; padding: 2px 7px; font-size: 10px; letter-spacing: .04em; }
.agent-generation-task-status { flex: 0 0 auto; border-radius: 999px; padding: 3px 9px; font-size: 11px; }
.agent-generation-task-status.is-processing { background: rgba(115, 211, 227, .14); color: #8fdce8; }
.agent-generation-task-status.is-completed { background: rgba(126, 217, 152, .14); color: #8fdcab; }
.agent-generation-task-status.is-failed { background: rgba(217, 155, 123, .16); color: #e0a887; }
.agent-generation-task-prompt { max-height: 92px; margin: 0; overflow: auto; color: #c3ccd4; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-generation-task-spec { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #7f8b95; font-size: 11px; }
.agent-generation-task-spec i { color: #4c565f; font-style: normal; }
.agent-generation-task-waiting { display: flex; align-items: center; gap: 9px; min-height: 64px; border: 1px dashed #2c3a42; border-radius: 6px; color: #8d98a3; padding: 0 12px; font-size: 12px; }
.agent-generation-task-waiting i { width: 14px; height: 14px; flex: 0 0 auto; border: 1.5px solid rgba(255, 255, 255, .18); border-top-color: #8fdce8; border-radius: 50%; animation: agentGenerationCardSpin .72s linear infinite; }
@keyframes agentGenerationCardSpin { to { transform: rotate(360deg); } }
.agent-generation-task .agent-generation-outputs { gap: 10px; }
/* One row, never wider than the card: the history feed indents its media grid
   and lets wide batches scroll, but a conversation card must stay inside the
   message column. */
.agent-generation-task .generation-results,
.agent-generation-task .generation-results:not(.count-1) {
  display: grid;
  width: 100%;
  max-width: 100%;
  margin-left: 0 !important;
  overflow: hidden;
}
.agent-generation-task .generation-results .generation-result-card {
  width: 100%;
  width: min(100%, var(--result-fit-width, 240px));
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  justify-self: start;
}
/* Create-page card rules are intentionally broad for the normal generation
   feed. Keep the inline Agent card as a generation-page thumbnail, including
   completed images, so the same click-to-preview interaction remains intact. */
.client-body:has(.studio-shell.view-create) .agent-generation-task.image-task .generation-results.count-1 .generation-result-card,
.client-body:has(.studio-shell.view-create) .agent-generation-task.video-task .generation-results.count-1 .generation-result-card {
  width: min(100%, var(--result-fit-width, 240px)) !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  justify-self: start;
}
.client-body:has(.studio-shell.view-create) .agent-generation-task .generation-results .generation-output.image:not(.pending):not(.loading),
.client-body:has(.studio-shell.view-create) .agent-generation-task .generation-results .generation-output.image:is(.pending, .loading) {
  aspect-ratio: var(--result-ratio, 16 / 9) !important;
  min-height: 0;
  overflow: hidden !important;
}
.client-body:has(.studio-shell.view-create) .agent-generation-task .generation-results .generation-output.image .media-preview-trigger,
.client-body:has(.studio-shell.view-create) .agent-generation-task .generation-results .generation-output.image img {
  width: 100%;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
}
/* 生视频向导：把「模式 / 模型 → 分镜要素 → 素材质检 → 绑定 → 报价」摊成
   可回退的步骤卡，视觉语言跟已提交的生成卡保持一致。 */
.video-wizard { display: grid; gap: 12px; margin-top: 10px; width: min(660px, 100%); scroll-margin-top: 18px; border: 1px solid rgba(115, 211, 227, .22); border-radius: 8px; background: #111a20; padding: 14px; text-align: left; }
.agent-chat-message.is-wizard .agent-chat-body { width: 100%; }
.video-wizard-head { display: grid; gap: 8px; }
.video-wizard-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.video-wizard-progress span { border-radius: 4px; background: #1c3b43; color: #9ce3ef; padding: 2px 7px; font-size: 10px; letter-spacing: .04em; }
.video-wizard-progress b { color: #7c8894; font-size: 11px; font-weight: 600; }
.video-wizard-bar { height: 3px; overflow: hidden; border-radius: 999px; background: #1d262d; }
.video-wizard-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fb6c8, #8fdce8); transition: width .24s ease; }
.video-wizard-head h3 { margin: 0; color: #eaeff3; font-size: 14px; font-weight: 600; }
.video-wizard-body { display: grid; gap: 11px; }
.video-wizard-hint { margin: 0; color: #8b97a1; font-size: 12px; line-height: 1.65; }
.video-wizard-block { display: grid; gap: 8px; }
.video-wizard-block > strong { color: #b9c4cd; font-size: 12px; font-weight: 600; }
.video-wizard-block > small { color: #7e8a94; font-size: 11px; line-height: 1.6; }
.video-wizard-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
.video-wizard-option { display: grid; gap: 3px; border: 1px solid #2c3841; border-radius: 8px; background: #151f26; color: #d6dee4; padding: 9px 10px; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.video-wizard-option:hover { border-color: #3f5d68; background: #18242c; }
.video-wizard-option.is-selected { border-color: #73cad6; background: rgba(115, 202, 214, .1); box-shadow: inset 0 0 0 1px rgba(115, 202, 214, .24); }
.video-wizard-option:disabled { opacity: .42; cursor: not-allowed; }
.video-wizard-option strong { font-size: 12.5px; font-weight: 600; }
.video-wizard-option small { color: #8694a0; font-size: 11px; line-height: 1.5; }
.video-wizard-option em { color: #8fdce8; font-size: 11px; font-style: normal; }
.video-wizard-select { min-width: 0; width: 100%; height: 34px; border: 1px solid #35424c; border-radius: 6px; background: #0f151a; color: #e7edf1; padding: 0 8px; font: inherit; font-size: 12.5px; }
.video-wizard-textarea { width: 100%; min-height: 96px; border: 1px solid #35424c; border-radius: 8px; background: #0f151a; color: #e9eef2; padding: 10px 11px; outline: none; font: inherit; font-size: 13px; line-height: 1.7; resize: vertical; }
.video-wizard-textarea:focus { border-color: #73cad6; box-shadow: 0 0 0 1px rgba(115, 202, 214, .26); }
.video-wizard-counter { color: #7c8894; font-size: 11px; }
.video-wizard-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.video-wizard-chips > span { margin-left: auto; color: #66727c; font-size: 11px; }
.video-wizard-chip { border: 1px solid #2f3d46; border-radius: 999px; background: #151f26; color: #a9b7c1; padding: 4px 10px; font: inherit; font-size: 11px; cursor: pointer; }
.video-wizard-chip:hover { border-color: #4a656f; color: #dfe9ee; }
.video-wizard-warn { display: grid; gap: 6px; border: 1px solid rgba(217, 155, 123, .28); border-radius: 8px; background: rgba(217, 155, 123, .08); color: #d8b49b; padding: 10px 12px; font-size: 12px; line-height: 1.65; }
.video-wizard-warn strong { color: #e5c1a6; font-size: 12px; }
.video-wizard-warn ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; }
.video-wizard-error { border: 1px solid rgba(217, 123, 123, .34); border-radius: 8px; background: rgba(217, 123, 123, .1); color: #e2a5a5; padding: 9px 11px; font-size: 12px; line-height: 1.6; }
.video-wizard-assets { display: grid; gap: 10px; }
.video-wizard-asset { display: grid; gap: 8px; border: 1px solid #2b3740; border-radius: 9px; background: #141d24; padding: 10px; }
.video-wizard-asset-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.video-wizard-asset-head strong { color: #dfe7ec; font-size: 12.5px; }
.video-wizard-asset-status { border-radius: 999px; padding: 3px 9px; font-size: 11px; }
.video-wizard-asset-status.is-empty { background: rgba(140, 152, 162, .14); color: #9aa6b0; }
.video-wizard-asset-status.is-processing { background: rgba(115, 211, 227, .14); color: #8fdce8; }
.video-wizard-asset-status.is-ready { background: rgba(126, 217, 152, .14); color: #8fdcab; }
.video-wizard-asset-status.is-failed { background: rgba(217, 155, 123, .16); color: #e0a887; }
.video-wizard-asset-preview { display: block; width: 100%; max-width: 340px; border: 1px solid #2b3740; border-radius: 8px; background: #0d1318; }
.video-wizard-asset-preview img { display: block; width: 100%; border-radius: 7px; }
.video-wizard-asset-preview.is-waiting { display: grid; place-items: center; min-height: 96px; color: #8d98a3; font-size: 12px; }
.video-wizard-asset-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.video-wizard-asset-actions .primary-button { min-height: 32px; padding: 0 13px; font-size: 12px; }
.video-wizard-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.video-wizard-footer-actions { display: flex; gap: 8px; margin-left: auto; }
.video-wizard-footer button { min-height: 34px; padding: 0 14px; font-size: 12.5px; }
.video-wizard-summary { display: grid; gap: 6px; border: 1px solid #26323a; border-radius: 8px; background: #131c23; padding: 10px 12px; }
.video-wizard-summary-row { display: flex; gap: 10px; color: #c6cfd7; font-size: 12px; line-height: 1.6; }
.video-wizard-summary-row strong { flex: 0 0 auto; min-width: 76px; color: #8b97a1; font-weight: 600; }
.video-wizard-summary-row span { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 640px) {
  .video-wizard { padding: 12px; }
  .video-wizard-options { grid-template-columns: 1fr; }
  .video-wizard-footer { flex-direction: column; align-items: stretch; }
  .video-wizard-footer-actions { margin-left: 0; }
  .video-wizard-footer-actions button { flex: 1; }
}
.agent-skill-editor { width: min(560px, calc(100vw - 32px)); border: 1px solid #34404a; border-radius: 12px; background: #151b20; color: #e8edf0; padding: 18px; box-shadow: 0 24px 70px rgba(0, 0, 0, .46); }
.agent-skill-editor header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.agent-skill-editor header span { color: #7cabb3; font-size: 9px; letter-spacing: .15em; }
.agent-skill-editor h2 { margin: 5px 0 0; font-size: 18px; }
.agent-skill-editor label { display: grid; gap: 6px; margin-top: 12px; color: #99a6ae; font-size: 12px; }
.agent-skill-editor input, .agent-skill-editor textarea { width: 100%; border: 1px solid #35424c; border-radius: 7px; background: #0f151a; color: #e8edf0; padding: 9px 10px; outline: none; font: inherit; font-size: 13px; }
.agent-skill-editor textarea { min-height: 150px; line-height: 1.6; resize: vertical; }
.agent-skill-editor input:focus, .agent-skill-editor textarea:focus { border-color: #73cad6; box-shadow: 0 0 0 1px rgba(115, 202, 214, .28); }
.agent-skill-editor p { margin: 10px 0 0; color: #75838c; font-size: 11px; line-height: 1.5; }
.agent-skill-editor footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 860px) and (min-width: 641px) {
  .agent-composer-toolbar { flex-wrap: wrap; align-items: center; }
  .agent-composer-toolbar .composer-options { flex: 1 1 100%; min-width: 0; }
  .agent-composer-toolbar .composer-submit { margin-left: auto; }
  .agent-model-select { max-width: min(100%, 420px); }
  .agent-model-select select { max-width: min(320px, 52vw); }
}
@media (max-width: 640px) { .creation-agent-workspace { min-height: calc(100vh - 300px); border-radius: 10px; } .creation-agent-workspace-header { padding: 18px 16px 14px; } .creation-agent-workspace-header h1 { font-size: 19px; } .creation-agent-workspace-header p { font-size: 11px; } .creation-agent-workspace > .creation-agent-context { margin: 12px 16px 0; } .creation-agent-inline-messages { max-height: calc(100vh - 490px); padding: 16px; } .agent-composer { width: calc(100% - 24px); min-height: 140px; } .agent-composer-toolbar { align-items: flex-end; padding: 6px 10px 10px; } .agent-model-select { max-width: 165px; } .agent-model-select select { max-width: 102px; } .agent-enter-hint { display: none; } .agent-confirmation-grid { grid-template-columns: 1fr; } }
.composer-main { min-height: 96px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 8px; padding: 18px 20px 6px; }
.composer-compact-submit { display: none; }
.prompt-composer.compact .composer-compact-submit { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f5f7f8; color: #111319; padding: 0; font-size: 24px; cursor: pointer; }
.prompt-composer.compact .composer-compact-submit:hover { background: #dff6fa; }
.prompt-composer.compact .composer-compact-submit:disabled { opacity: .5; cursor: wait; }
.composer-mode-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #363b44; border-radius: 50%; background: #24282e; color: #78d3e2; }
.attach-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #42464f; border-radius: 50%; background: #343840; color: #e4e7eb; cursor: pointer; }
.attach-button:hover { background: #464b55; }
.attach-button:disabled { opacity: .4; cursor: not-allowed; }
.mention-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #42464f; border-radius: 50%; background: #252930; color: #81d5e5; font-size: 16px; font-weight: 700; cursor: pointer; }
.mention-button:hover { border-color: #67b9c8; background: #30363e; }
.prompt-entry { position: relative; min-width: 0; }
.prompt-entry.is-file-drop-target { border-radius: 6px; background: rgba(102, 204, 222, .09); box-shadow: inset 0 0 0 1px rgba(126, 220, 235, .7); }
.prompt-rich-editor { width: 100%; height: 76px; overflow-y: auto; border: 0; outline: 0; background: transparent; color: #f2f3f5; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: break-word; }
.prompt-rich-editor:empty::before { content: attr(data-placeholder); color: #858b95; pointer-events: none; }
/* Rich text pasted from other pages keeps the source colours, which can vanish
   against the dark composer. Pin every non-chip node to the editor's own text
   colour and drop the inherited background so the prompt stays readable. */
.prompt-rich-editor { -webkit-text-fill-color: currentColor; }
.prompt-rich-editor :not(.inline-reference-chip):not(.inline-reference-chip *):not(.inline-prompt-preset):not(.inline-prompt-preset *) { color: inherit !important; -webkit-text-fill-color: currentColor; background-color: transparent !important; }
.prompt-rich-editor .inline-reference-chip { -webkit-text-fill-color: currentColor; }
.prompt-reference-count { position: absolute; right: 43px; bottom: -2px; color: #69717d; font-size: 10px; pointer-events: none; }
.inline-reference-chip { position: relative; height: 29px; display: inline-flex; align-items: center; gap: 5px; max-width: 150px; margin: 1px 3px 1px 1px; vertical-align: middle; border: 1px solid #3a424c; border-radius: 6px; background: #15191f; color: #dfe5ea; padding: 2px 22px 2px 2px; line-height: 1; user-select: none; }
.inline-reference-chip strong { overflow: hidden; max-width: 86px; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.inline-reference-chip > button { position: absolute; top: 6px; right: 3px; width: 16px; height: 16px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #2b3037; color: #9da5af; padding: 0; font-size: 13px; cursor: pointer; }
.inline-reference-chip > button:hover { background: #4a3137; color: #ffd8df; }
.inline-reference-thumb { position: relative; width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: #252b32; color: #76d1df; }
.inline-reference-thumb img, .inline-reference-thumb video { width: 100%; height: 100%; display: block; object-fit: cover; }
.inline-reference-thumb i { font-size: 13px; font-style: normal; }
.inline-reference-chip.video .inline-reference-thumb i { position: absolute; }
.composer-toolbar { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding: 8px 14px 14px; }
.composer-options { min-width: 0; display: flex; align-items: center; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.mode-switch { display: flex; flex: 0 0 auto; }
.mode-switch button, .option-chip { height: 40px; flex: 0 0 auto; border: 0; background: transparent; color: #adb2bc; padding: 0 11px; cursor: pointer; }
.mode-switch button { display: flex; align-items: center; }
.mode-switch button.active { color: #91e0ed; }
.option-chip { border: 1px solid #34373e; border-radius: 8px; }
.option-chip:hover { background: #292c32; color: #fff; }
.select-chip { position: relative; height: 40px; flex: 0 0 auto; display: flex; align-items: center; gap: 5px; border: 1px solid #34373e; border-radius: 8px; color: #adb2bc; padding: 0 9px; }
.select-chip::after { content: '⌄'; position: absolute; right: 10px; top: 50%; transform: translateY(-55%); color: #8f97a2; pointer-events: none; }
.select-chip select { max-width: 190px; border: 0; outline: 0; appearance: none; background: transparent; color: #d8dbe0; cursor: pointer; padding-right: 18px; }
.select-chip select option { background: #202228; color: #fff; }
.custom-select { padding: 0; overflow: visible; }
.custom-select::after { display: none; }
.custom-select-trigger { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: inherit; background: transparent; color: #d8dbe0; padding: 0 12px; font: inherit; font-weight: 600; cursor: pointer; }
.custom-select-trigger:hover, .custom-select[aria-expanded="true"] .custom-select-trigger { background: #292c32; color: #f5f7f8; }
.custom-select-trigger i { color: #8f97a2; font-style: normal; font-size: 18px; line-height: 1; }
.custom-select-menu { position: fixed; z-index: 80; left: 0; bottom: auto; min-width: 0; width: auto; display: grid; gap: 3px; border: 1px solid #3a3f48; border-radius: 9px; background: #1b1e23; padding: 5px; box-shadow: 0 18px 42px rgba(0, 0, 0, .58); }
.composer-popover[hidden] { display: none !important; }
.custom-select-option { width: 100%; min-height: 38px; display: flex; align-items: center; border: 0; border-radius: 6px; background: transparent; color: #cdd2d9; padding: 0 12px; font: inherit; font-size: 14px; text-align: left; white-space: nowrap; cursor: pointer; }
.custom-select-option:hover, .custom-select-option.active { background: #343b45; color: #fff; }
.generation-mode-select .custom-select-menu,
.reference-mode-select .custom-select-menu { width: 180px; min-width: 180px; max-width: 180px; }
.generation-mode-select { min-width: 116px; padding-right: 7px; }
.generation-mode-select select { width: 100%; min-width: 94px; font-weight: 600; }
.generation-mode-select .custom-select-trigger { justify-content: flex-start; gap: 7px; }
.generation-mode-select .custom-select-trigger-value,
.generation-mode-select .custom-select-option-main { min-width: 0; display: flex; align-items: center; gap: 9px; }
.generation-mode-select .custom-select-trigger-value > i,
.generation-mode-select .custom-select-option-main > i { flex: 0 0 auto; display: inline-flex; color: currentColor; font-style: normal; }
.generation-mode-select .custom-select-trigger-value .ui-icon { width: 15px; height: 15px; }
.generation-mode-select .custom-select-chevron { display: inline-flex; margin-left: auto; }
.generation-mode-select .custom-select-chevron .ui-icon { width: 14px; height: 14px; }
.generation-mode-select .custom-select-menu { gap: 2px; border-color: var(--page-line, #34373e); border-radius: var(--radius-xl); background: var(--page-surface-2, #25282e); padding: 8px; box-shadow: var(--shadow-depth-dialog); }
.generation-mode-menu-title { padding: 7px 12px 8px; color: var(--page-text-subtle, #858b94); font-size: 12px; font-weight: 500; line-height: 1.2; }
.generation-mode-select .custom-select-option { min-height: 48px; justify-content: space-between; gap: 12px; border-radius: var(--radius-base); color: var(--page-text, #f2f4f7); padding: 0 12px; font-size: 14px; font-weight: 500; transition: background-color var(--motion-fast) ease-out, color var(--motion-fast) ease-out; }
.generation-mode-select .custom-select-option:hover { background: var(--page-control-hover, #30343b); color: var(--page-text, #fff); }
.generation-mode-select .custom-select-option.active { background: var(--page-control-active, #3a3d43); color: var(--page-text, #fff); }
.generation-mode-select .custom-select-option-main .ui-icon { width: 19px; height: 19px; }
.generation-mode-select .custom-select-option-check { flex: 0 0 auto; display: inline-flex; color: var(--page-text, #fff); }
.generation-mode-select .custom-select-option-check .ui-icon { width: 18px; height: 18px; }
.generation-mode-select .custom-select-trigger[aria-expanded="true"] { color: var(--color-brand); }
.reference-mode-select { min-width: 110px; }
.generation-spec-chip { height: 40px; min-width: 166px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 9px; border: 1px solid #34373e; border-radius: 8px; background: transparent; color: #adb2bc; padding: 0 11px; cursor: pointer; }
.generation-spec-chip:hover, .generation-spec-chip[aria-expanded="true"] { border-color: #53616b; background: #292c32; color: #f0f2f5; }
.duration-picker-trigger { height: 40px; min-width: 92px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #34373e; border-radius: 8px; background: transparent; color: #d8dbe0; padding: 0 12px; cursor: pointer; }
.duration-picker-trigger:hover, .duration-picker-trigger[aria-expanded="true"] { border-color: #53616b; background: #292c32; color: #f0f2f5; }
.duration-picker-trigger span { color: #9ca6b2; font-size: 16px; }
.duration-picker-trigger strong { font-size: 13px; font-weight: 600; }
.duration-picker-panel { position: absolute; z-index: 55; left: 50%; bottom: 76px; width: min(460px, calc(100% - 24px)); transform: translateX(-50%); display: grid; gap: 10px; border: 1px solid #3a3f48; border-radius: 14px; background: #1b1d22; padding: 16px 18px 14px; box-shadow: 0 20px 56px rgba(0, 0, 0, .58); }
.duration-picker-panel header { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #d8dbe0; }
.duration-picker-panel header strong { font-size: 15px; }
.duration-picker-panel output { min-width: 64px; display: inline-flex; align-items: baseline; justify-content: center; gap: 4px; border-radius: 9px; background: #2a2d33; color: #f1f3f5; font-size: 20px; font-weight: 700; padding: 5px 10px; }
.duration-picker-panel output span { color: #929aa6; font-size: 13px; font-weight: 500; }
.duration-picker-panel input[type="range"] { width: 100%; accent-color: #f1f3f5; cursor: pointer; }
.duration-range-labels { display: flex; justify-content: space-between; color: #9aa2ad; font-size: 11px; }
.duration-picker-panel > small { color: #858d98; font-size: 11px; }
.generation-spec-chip strong { color: #d8dbe0; font-size: 12px; white-space: nowrap; }
.spec-ratio-glyph { width: 18px; height: 18px; display: grid; place-items: center; color: #8edce8; }
.spec-ratio-glyph i { display: block; border: 2px solid currentColor; border-radius: 3px; }
.generation-spec-panel { position: absolute; z-index: 55; left: 50%; bottom: 76px; width: min(560px, calc(100% - 28px)); max-height: min(460px, calc(100vh - 170px)); transform: translateX(-50%); display: grid; gap: 16px; overflow-y: auto; border: 1px solid #3a3f48; border-radius: 12px; background: #1b1d22; padding: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .62); }
.spec-section { display: grid; gap: 10px; }
.spec-section > strong { color: #858c97; font-size: 13px; }
.spec-ratio-grid, .spec-resolution-grid, .spec-count-grid { display: grid; gap: 5px; border-radius: 9px; background: #23262c; padding: 5px; }
.spec-ratio-grid { grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); }
.spec-resolution-grid { display: flex; justify-content: center; }
.spec-resolution-grid .spec-option { width: min(180px, 100%); flex: 0 1 180px; }
.spec-count-grid { grid-template-columns: repeat(4, 1fr); }
.spec-option { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 7px; background: transparent; color: #d6d9de; padding: 0 12px; cursor: pointer; }
.spec-option:hover { background: #2c3037; color: #fff; }
.spec-option.active { background: #343942; color: #fff; box-shadow: inset 0 0 0 1px #454b55; }
.ratio-option { min-height: 72px; flex-direction: column; gap: 7px; padding: 7px 5px; }
.ratio-option i { display: block; border: 2px solid currentColor; border-radius: 4px; }
.ratio-option span { font-size: 12px; }
.model-picker-trigger { height: 40px; min-width: 218px; max-width: 310px; flex: 0 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border: 1px solid #34373e; border-radius: 8px; background: transparent; color: #d8dbe0; padding: 0 10px; cursor: pointer; }
.model-picker-trigger:hover, .model-picker-trigger[aria-expanded="true"] { border-color: #53616b; background: #262a30; }
.model-picker-glyph { color: #89d9e6; font-size: 15px; }
.model-logo-image {
  width: 72%;
  height: 72%;
  display: block;
  box-sizing: border-box;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  object-fit: contain;
}
.create-pill-icon .model-logo-image {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  padding: 2px;
}
.model-picker-glyph .model-logo-image {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  padding: 2px;
}
.model-picker-current { min-width: 0; display: flex; align-items: center; gap: 6px; }
.model-picker-current strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-current small { flex: 0 0 auto; color: #858d98; font-size: 10px; white-space: nowrap; }
.model-picker-current .model-recent-health { flex: 0 0 auto; margin-left: auto; }
.model-picker-current i, .model-option-copy strong em { border-radius: 4px; background: #17363d; color: #82ddea; padding: 2px 4px; font-size: 9px; font-style: normal; white-space: nowrap; }
.model-health-badge { display: inline-flex; align-items: center; width: fit-content; border: 1px solid transparent; border-radius: 4px; padding: 2px 5px; font-size: 9px; font-style: normal; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.model-health-badge.good { border-color: #54b982; background: #e5f7ec; color: #167343; }
.model-health-badge.warning { border-color: #e4bd58; background: #fff5d6; color: #8b6100; }
.model-health-badge.danger { border-color: #dd777f; background: #ffeaec; color: #a02835; }
.model-health-badge.new { border-color: #7fc6de; background: #e6f6fb; color: #0b6f8f; }
.model-health-badge.muted { border-color: #aeb8c2; background: #eef1f4; color: #6d7782; }
.model-picker-current .model-health-badge { background: transparent; }
.model-picker-current .model-health-badge.good { color: #70d19a; border-color: #347d5a; }
.model-picker-current .model-health-badge.warning { color: #f2ce72; border-color: #896d2e; }
.model-picker-current .model-health-badge.danger { color: #ef9da4; border-color: #8f3a45; }
.model-picker-current .model-health-badge.new { color: #68c7e8; border-color: #3a7d94; }
.model-picker-current .model-health-badge.muted { color: #a8b0b9; border-color: #59616b; }
.model-recent-health { min-width: 0; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.model-recent-health-label { color: #d4d9df; font-size: 11px; line-height: 1.2; white-space: nowrap; }
.model-health-meter { min-width: 0; height: 14px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 3px; border: 0; border-radius: 0; padding: 0; background: transparent; }
.model-health-meter i { width: 9px; min-width: 9px; height: 9px; flex: 0 0 9px; display: block; border-radius: 50%; background: #d9dee8; }
.model-health-meter i.good { background: #62c66d; }
.model-health-meter i.warning { background: #e9a52e; }
.model-health-meter i.danger { background: #db5656; }
.model-health-meter i.new { background: #68c7e8; }
.model-health-meter i.muted { background: #d9dee8; }
.model-recent-health.compact { gap: 0; }
.model-recent-health.compact .model-recent-health-label { display: none; }
.model-recent-health.compact .model-health-meter { min-width: 0; height: 12px; gap: 3px; padding: 0; }
.model-recent-health.compact .model-health-meter i { width: 9px; min-width: 9px; height: 9px; border-radius: 50%; }
.model-recent-health-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.model-recent-health-group .model-recent-health { min-width: 0; }
.model-recent-health-group .model-recent-health-label { overflow: hidden; max-width: 100%; color: #536170; font-size: 10px; text-overflow: ellipsis; }
.model-recent-health-group .model-health-meter { width: 100%; min-width: 0; }
.model-recent-health-group .model-health-meter i { min-width: 3px; }
.model-picker-chevron { color: #8f97a2; }
.model-picker-menu { position: absolute; z-index: 45; width: min(680px, calc(100% - 24px)); max-height: min(430px, calc(100vh - 150px)); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid #3b414a; border-radius: 8px; background: #1b1e23; box-shadow: 0 18px 54px rgba(0, 0, 0, .6); }
.model-picker-category-tabs { display: flex; gap: 5px; overflow-x: auto; border-bottom: 1px solid #30353d; padding: 9px; scrollbar-width: none; }
.model-picker-category-tabs::-webkit-scrollbar { display: none; }
.model-picker-category-tabs button { flex: 0 0 auto; min-height: 30px; border: 1px solid #3a4048; border-radius: 7px; background: transparent; color: #c3cbd5; padding: 0 9px; font: inherit; font-size: 12px; cursor: pointer; }
.model-picker-category-tabs button:hover { background: #252a30; color: #dfe5e8; }
.model-picker-category-tabs button.active { border-color: #38bdf8; background: rgba(14, 116, 144, .26); color: #e0f2fe; }
.model-picker-category-tabs button:disabled { color: #4f5760; cursor: not-allowed; }
.model-picker-category-tabs button small { margin-left: 4px; color: #6f7a85; font-size: 10px; }
.model-picker-category-tabs button.active small { color: #83cfd9; }
.model-picker-empty { padding: 28px 16px; color: #7f8994; font-size: 12px; text-align: center; }
.model-picker-list { min-height: 0; display: grid; align-content: start; gap: 2px; overflow-y: auto; padding: 6px; scrollbar-width: thin; scrollbar-color: #4a5058 transparent; }
.model-picker-option { position: relative; min-width: 0; min-height: 88px; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: start; gap: 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #e3e7eb; padding: 10px 11px; text-align: left; cursor: pointer; }
.model-picker-option:hover, .model-picker-option.selected { background: #2a2e35; }
.model-picker-option.selected { border-color: #3a414a; }
.model-option-copy { min-width: 0; display: grid; gap: 4px; }
.model-option-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.model-option-copy strong { overflow: hidden; font-size: 13px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.model-option-copy small { display: block; overflow: hidden; color: #9aa5b4; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.model-success-rate { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.model-success-rate i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.model-success-rate.good { color: #71df8c; }
.model-success-rate.warning { color: #f6c94e; }
.model-success-rate.danger { color: #fa8697; }
.model-success-rate.new { color: #68c7e8; }
.model-success-rate.muted { color: #94a3b8; }
.model-option-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.model-option-tags i { border: 1px solid #59616c; border-radius: 999px; color: #c8d0d9; padding: 2px 6px; font-size: 10px; font-style: normal; line-height: 1.1; }
.model-option-side { min-width: 0; display: grid; justify-items: end; align-content: start; gap: 4px; padding-top: 1px; text-align: right; }
.model-option-side > strong { color: #8ed4ff; font-size: 13px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.model-option-price-row { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.model-option-discount { border: 1px solid #59616c; border-radius: 999px; color: #c8d0d9; padding: 2px 6px; font-size: 10px; font-style: normal; line-height: 1.1; white-space: nowrap; }
.model-option-side > small { color: #9aa5b4; font-size: 11px; text-decoration: line-through; white-space: nowrap; }
.model-unused-label { display: inline-flex; align-items: center; min-height: 18px; border: 1px solid #505861; border-radius: 4px; background: #2a2f35; color: #a7afb8; padding: 1px 6px; font-size: 9px; font-style: normal; font-weight: 700; white-space: nowrap; }
.model-picker-option > b { align-self: end; color: #8ed4ff; font-size: 16px; }
.model-picker-option .model-health-meter { min-width: 0; height: 12px; gap: 3px; padding: 0; }
.model-picker-option .model-health-meter i { min-width: 9px; width: 9px; height: 9px; border-radius: 50%; }
.video-mode-switch { display: flex; flex: 0 0 auto; }
.video-mode-switch button { height: 40px; border: 0; background: transparent; color: #929aa5; padding: 0 11px; cursor: pointer; }
.video-mode-switch button.active { color: #91e0ed; }
.segmented-control { align-items: center; overflow: hidden; border: 1px solid #343943; border-radius: 8px; background: #24272c; }
.segmented-control button { position: relative; transition: color .16s ease, background-color .16s ease; }
.segmented-control button:hover { background: #2c3036; color: #f0f3f5; }
.segmented-control button.active { background: #30353b; }
.segmented-control button + button::before { content: ''; position: absolute; left: 0; top: 11px; width: 1px; height: 18px; background: #59606a; }
.segmented-control button:focus-visible { z-index: 1; outline: 2px solid #70ccdc; outline-offset: -2px; }
.frame-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 8px; padding: 2px 20px 8px 101px; }
.frame-upload-slot { min-width: 0; height: 68px; display: grid; grid-template-columns: 54px minmax(0, 1fr); grid-template-rows: 1fr 1fr; align-items: center; column-gap: 9px; overflow: hidden; border: 1px dashed #444b55; border-radius: 7px; background: #16191e; color: #d9dee4; padding: 6px; text-align: left; cursor: pointer; }
.frame-upload-slot:hover { border-color: #6fc8d7; background: #1c2228; }
.frame-upload-slot:disabled { opacity: .45; cursor: not-allowed; }
.frame-upload-slot img, .frame-upload-slot > i { width: 54px; height: 54px; grid-row: 1 / 3; display: grid; place-items: center; object-fit: cover; border-radius: 5px; background: #252a31; color: #79d2e1; font-style: normal; }
.frame-upload-slot span { align-self: end; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.frame-upload-slot small { align-self: start; overflow: hidden; color: #777f8a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.composer-submit { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.composer-submit > span { color: #89909a; font-size: 12px; }
.composer-price { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.composer-price em { border-radius: 4px; background: #17363d; color: #86dfeb; padding: 2px 4px; font-size: 9px; font-style: normal; }
.composer-price del { color: #626a75; font-size: 10px; }
.composer-price strong { color: var(--color-text); font-size: 12px; font-weight: 650; }
.send-button { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f5f7f8; color: #111319; font-size: 26px; font-weight: 700; cursor: pointer; }
.send-button:hover { background: #dff6fa; }
.send-button:disabled { opacity: .5; cursor: wait; }

.reference-library-modal { width: min(920px, 100%); max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto auto minmax(160px, 1fr) auto; overflow: hidden; border: 1px solid #353a42; border-radius: 8px; background: #181b20; box-shadow: 0 28px 80px rgba(0, 0, 0, .62); }
.reference-library-modal > header { display: flex; justify-content: space-between; align-items: start; padding: 22px; border-bottom: 1px solid #2e3239; }
.reference-library-modal > header span { color: #78d3e2; font-size: 10px; }
.reference-library-modal h2 { margin: 4px 0; }
.reference-library-modal header p { margin: 0; color: #7c8490; font-size: 12px; }
.reference-library-filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 22px; border-bottom: 1px solid #2e3239; background: #15181d; }
.reference-library-filters > div { display: flex; align-items: center; gap: 5px; }
.reference-library-filters button { min-height: 30px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #858e99; padding: 0 10px; cursor: pointer; }
.reference-library-filters button:hover { color: #e6e9ed; }
.reference-library-filters button.active { border-color: #3c5960; background: #203238; color: #9ce4ef; }
.reference-library-filters button small { margin-left: 3px; color: inherit; opacity: .72; }
.reference-library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; gap: 10px; overflow-y: auto; padding: 18px 22px; }
.reference-library-item { position: relative; min-width: 0; border: 1px solid #30353d; border-radius: 7px; background: #121419; color: #dce0e5; }
.reference-library-select { width: 100%; min-width: 0; display: grid; gap: 6px; border: 0; background: transparent; color: inherit; padding: 7px; text-align: left; cursor: pointer; }
.reference-library-item:hover { border-color: #515a65; }
.reference-library-remove { position: absolute; z-index: 3; top: 11px; right: 11px; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(10,12,15,.78); color: #fff; font-size: 16px; cursor: pointer; }
.reference-library-remove:hover { border-color: #f0a0a8; background: #67323a; }
.reference-library-remove:disabled { opacity: .45; cursor: wait; }
.library-preview { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #0c0e11; color: #7bd3e3; font-size: 26px; }
.library-preview img, .library-preview video { width: 100%; height: 100%; display: block; object-fit: cover; }
.library-preview i { font-style: normal; }
.library-preview.video > i { position: absolute; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(4, 6, 9, .7); color: #fff; font-size: 14px; }
.reference-library-select strong, .reference-library-select small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-library-select strong { font-size: 12px; }
.reference-library-select small { color: #747c87; font-size: 10px; }
.reference-library-empty { grid-column: 1 / -1; min-height: 180px; display: grid; place-items: center; color: #747c87; text-align: center; }
.reference-library-modal > footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid #2e3239; }
.reference-library-modal > footer span { color: #858d98; font-size: 12px; }
.reference-library-modal .primary-button { min-height: 38px; }

/* Assets */
.asset-stage { height: 100%; overflow-y: auto; padding: 112px 42px 60px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; max-width: 1180px; margin: 0 auto 28px; }
.section-heading h1 { margin: 5px 0 2px; font-size: 30px; }
.section-heading p { margin: 0; color: #787f8a; }
.section-heading > strong { color: #8a929d; font-size: 13px; }
.asset-grid { max-width: 1180px; margin: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.asset-item { min-width: 0; overflow: hidden; border: 1px solid #292c32; border-radius: 8px; background: #15171b; }
.asset-item img, .asset-item video { width: 100%; height: 100%; display: block; object-fit: contain; background: transparent; }
.asset-preview { position: relative; width: 100%; display: block; overflow: hidden; border: 0; background: transparent; padding: 0; cursor: pointer; }
.asset-preview > span { position: absolute; inset: 50% auto auto 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; background: rgba(10, 12, 16, .68); color: #fff; font-size: 20px; }
.asset-item > div { padding: 12px; }
.asset-item p { overflow: hidden; margin: 0 0 5px; color: #d1d4da; text-overflow: ellipsis; white-space: nowrap; }
.asset-item small { color: #707681; }
.asset-actions { display: flex; gap: 7px; margin-top: 10px; }
.asset-actions button { min-height: 30px; border: 1px solid #30343b; border-radius: 6px; background: #202329; color: #afb5bf; padding: 0 9px; cursor: pointer; }
.asset-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 280px; border: 1px dashed #31343b; border-radius: 8px; color: #737a85; }
.asset-library-header, .asset-filter-bar, .asset-date-groups { width: min(1480px, 100%); margin-left: auto; margin-right: auto; }
.asset-library-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.asset-library-header nav { display: flex; align-items: center; gap: 18px; }
.asset-library-header nav button { position: relative; height: 46px; border: 0; background: transparent; color: #828a96; padding: 0 5px; font-size: 16px; cursor: pointer; }
.asset-library-header nav button:hover { color: #dce1e7; }
.asset-library-header nav button.active { color: #f2f4f7; font-weight: 700; }
.asset-library-header nav button.active::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: 0; height: 2px; background: #71d2e1; }
.asset-header-actions { display: flex; align-items: center; gap: 9px; }
.asset-header-actions label { width: min(280px, 30vw); height: 38px; display: flex; align-items: center; gap: 7px; border: 1px solid #30343b; border-radius: 7px; background: #17191e; color: #929aa5; padding: 0 11px; }
.asset-header-actions input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #eef1f4; }
.asset-header-actions .subtle-button { min-height: 38px; white-space: nowrap; }
.asset-filter-bar { min-height: 46px; display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 28px; border-bottom: 1px solid #24272d; }
.asset-filter-bar > div { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.asset-filter-bar button { height: 36px; flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #777f8b; padding: 0 12px; cursor: pointer; }
.asset-filter-bar button:hover { color: #d3d7dd; }
.asset-filter-bar button.active { border-bottom-color: #69cddd; color: #eef1f4; }
.asset-filter-bar > span { flex: 0 0 auto; color: #686f79; font-size: 11px; }
.asset-category-tabs { padding-left: 14px; border-left: 1px solid #30333a; }
.asset-date-groups { display: grid; gap: 38px; }
.asset-date-groups section > h2 { margin: 0 0 15px; color: #e9edf2; font-size: 22px; }
.asset-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 14px; align-items: start; }
.asset-gallery-item { position: relative; min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: 7px; background: #111318; transition: border-color .16s, background .16s; }
.asset-gallery-item:hover { border-color: #343941; background: #171a1f; }
.asset-gallery-item.selected { border-color: #69cddd; background: #172328; box-shadow: 0 0 0 1px rgba(105, 205, 221, .24); }
.asset-select-toggle { position: absolute; z-index: 5; top: 9px; right: 9px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px; background: rgba(9, 12, 15, .82); color: #081014; padding: 0; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.asset-select-toggle span { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #aeb7bf; border-radius: 4px; color: #081014; font-size: 12px; font-weight: 800; }
.asset-gallery-item.selected .asset-select-toggle { border-color: #85dce8; background: #78d4e2; }
.asset-gallery-item.selected .asset-select-toggle span { border-color: transparent; background: #eafcff; }
.asset-selection-entry.active { border-color: #69cddd; background: #20343a; color: #eaffff; }
.asset-gallery-media { position: relative; width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 6px; background: #15181d; color: #75cedd; padding: 0; cursor: pointer; }
.asset-gallery-media img, .asset-gallery-media video { width: 100%; height: 100%; display: block; object-fit: cover; }
.asset-gallery-media .asset-play { position: absolute; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(6, 8, 11, .7); color: #fff; }
.asset-duration { position: absolute; left: 7px; bottom: 7px; border-radius: 4px; background: rgba(5, 7, 10, .72); color: #e6e9ed; padding: 3px 5px; font-size: 10px; }
.audio-asset-icon { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid #35434b; border-radius: 50%; background: #1c2a30; font-size: 28px; }
.asset-gallery-meta { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; padding: 10px; }
.asset-gallery-meta strong, .asset-gallery-meta small { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-gallery-meta strong { color: #d8dce2; font-size: 12px; }
.asset-gallery-meta small { color: #6f7681; font-size: 10px; }
.asset-gallery-meta button, .asset-gallery-meta select { min-width: 0; height: 30px; border: 1px solid #30353d; border-radius: 6px; background: #1c2026; color: #aeb5bf; padding: 0 8px; font-size: 10px; cursor: pointer; }
.asset-gallery-meta button:hover { border-color: #59aeba; color: #e9fbff; }
.asset-gallery-meta button:disabled { opacity: .48; cursor: default; }
.asset-gallery-meta select option { background: #1c2026; }
.asset-empty.large { width: min(1480px, 100%); min-height: 360px; margin: 20px auto 0; }
.asset-stage:has(.asset-batch-toolbar) { padding-bottom: 140px; }
.asset-batch-toolbar { position: fixed; z-index: 38; left: 50%; bottom: 24px; width: min(760px, calc(100vw - 40px)); min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 18px; transform: translateX(-50%); border: 1px solid #3a4650; border-radius: 8px; background: rgba(22, 26, 31, .96); padding: 9px 11px 9px 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .46); backdrop-filter: blur(18px); }
.asset-batch-toolbar > div { display: flex; align-items: center; gap: 8px; }
.asset-batch-toolbar strong { color: #eef3f6; font-size: 13px; white-space: nowrap; }
.asset-batch-toolbar button { min-height: 36px; border: 1px solid #3a424b; border-radius: 6px; background: #22272d; color: #d0d6dc; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.asset-batch-toolbar button:hover:not(:disabled) { border-color: #67bdca; background: #283940; color: #f1fdff; }
.asset-batch-toolbar button:disabled { opacity: .42; cursor: default; }
.asset-batch-toolbar .asset-batch-danger { border-color: #643d43; color: #f2a9b0; }
.asset-batch-toolbar .asset-batch-danger:hover:not(:disabled) { border-color: #c96a76; background: #47272d; color: #ffd9dd; }
.batch-publish-summary { margin: -6px 0 16px; color: #89929d; font-size: 12px; line-height: 1.6; }
.save-asset-modal { width: min(500px, 100%); border: 1px solid #353a42; border-radius: 8px; background: #181b20; padding: 22px; box-shadow: 0 28px 80px rgba(0, 0, 0, .62); }
.save-asset-modal header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.save-asset-modal header span { color: #72d1df; font-size: 10px; }
.save-asset-modal h2 { margin: 4px 0 0; }
.save-asset-modal > label { display: grid; gap: 7px; margin-bottom: 15px; color: #aeb5bf; font-size: 12px; }
.save-asset-modal input, .save-asset-modal select { width: 100%; min-height: 42px; border: 1px solid #363b44; border-radius: 7px; outline: 0; background: #111318; color: #eef1f4; padding: 0 11px; }
.save-asset-modal select option { background: #171a1f; }
.save-asset-modal footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 15px; border-top: 1px solid #30343b; }
.save-asset-modal footer span { color: #777f8a; font-size: 11px; }

/* Home and inspiration */
.inspiration-stage, .profile-stage { height: 100%; overflow-y: auto; }
.publication-detail-shell .conversation-sidebar { display: none; }
.publication-detail-shell .workspace { grid-column: 2 / -1; }
.inspiration-detail-view { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 390px; background: #0d0f12; color: #eef1f4; }
.publication-detail-stage { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #090b0e; }
.publication-detail-media { max-width: calc(100% - 96px); max-height: calc(100% - 48px); width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.publication-detail-close { position: absolute; top: 18px; right: 18px; z-index: 3; width: 38px; height: 38px; border: 0; border-radius: 8px; background: rgba(28, 32, 39, .8); color: #f5f7f8; font-size: 26px; cursor: pointer; }
.publication-detail-nav { position: absolute; right: 22px; z-index: 3; width: 34px; height: 34px; border: 0; background: transparent; color: #ccd5dc; font-size: 28px; cursor: pointer; opacity: .72; }.publication-detail-nav:hover { opacity: 1; }.publication-detail-nav:disabled { visibility: hidden; }.publication-detail-nav.prev { top: calc(50% - 48px); }.publication-detail-nav.next { top: calc(50% + 14px); }
.publication-detail-panel { min-width: 0; display: flex; flex-direction: column; padding: 28px 26px; border-left: 1px solid #242930; background: #15181d; overflow-y: auto; }
.publication-detail-author { display: flex; align-items: center; gap: 9px; min-height: 42px; }.publication-author-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #466b78; color: #fff; font-size: 14px; font-weight: 700; }.publication-detail-author > strong { color: #f5f7f8; font-size: 14px; }.publication-follow { border: 0; border-radius: 5px; background: #252a32; color: #dce5e9; padding: 5px 10px; cursor: pointer; }.publication-follow.active { background: #75cbd8; color: #0a1114; }.publication-detail-panel-actions { display: flex; gap: 4px; margin-left: auto; }.publication-detail-panel-actions button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: #aab4bd; padding: 5px; cursor: pointer; }.publication-detail-panel-actions button:hover, .publication-detail-panel-actions button.active { color: #8bdce8; }.publication-detail-panel-actions svg { width: 17px; height: 17px; }
.publication-detail-meta { margin-top: 18px; padding-bottom: 18px; border-bottom: 1px solid #282d34; color: #78838d; font-size: 12px; }.publication-detail-prompt { padding: 22px 0; border-bottom: 1px solid #282d34; }.publication-detail-prompt h3 { margin: 0 0 12px; font-size: 13px; }.publication-detail-prompt p { margin: 0; color: #dce2e6; font-size: 13px; line-height: 1.75; }.publication-detail-prompt p.collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }.publication-detail-prompt > button { margin-top: 8px; border: 0; background: transparent; color: #85d9e7; padding: 0; cursor: pointer; }.publication-detail-specs { display: flex; align-items: center; gap: 12px; padding: 18px 0; color: #939da6; font-size: 12px; }.publication-detail-specs button { margin-left: auto; border: 0; background: transparent; color: #9aa5ae; cursor: pointer; }.publication-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 18px; }.publication-detail-actions button { height: 40px; border: 1px solid #343b44; border-radius: 7px; background: #20242b; color: #edf2f4; cursor: pointer; }.publication-detail-actions button:hover { background: #2b323a; }
.publication-detail-prompt p { white-space: pre-wrap; }
.publication-detail-actions.single { grid-template-columns: 1fr; }
.publication-detail-actions .publication-detail-unlock { height: 46px; border: 0; border-radius: 9px; background: #f0c04a; color: #241a03; font-size: 14px; font-weight: 750; }
.publication-detail-actions .publication-detail-unlock:hover { background: #ffd166; }
.publication-detail-title { margin: 18px 0 0; color: #f7fafb; font-size: 19px; line-height: 1.4; }
.publication-detail-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 13px 0 18px; padding-bottom: 18px; border-bottom: 1px solid #282d34; color: #b7c1c8; font-size: 12px; font-variant-numeric: tabular-nums; }
.publication-detail-stats > * { min-width: 0; display: inline-flex; align-items: center; gap: 5px; }
.publication-detail-stats .ui-icon { width: 16px; height: 16px; }
.publication-detail-stats button { min-height: 31px; margin-left: auto; border: 1px solid #343b44; border-radius: 999px; background: #20242b; color: #dce5e9; padding: 0 11px; cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
.publication-detail-stats button:hover { background: #2b323a; }
.publication-detail-stats button.active { border-color: #586d75; background: #233236; color: #8bdce8; }
.publication-prompt-locked .publication-detail-notice { margin: 0 0 11px; }
.publication-prompt-mask { position: relative; overflow: hidden; min-height: 132px; border: 1px solid #38343a; border-radius: 9px; background: #141519; }
.publication-prompt-mask-lines { display: grid; gap: 9px; padding: 17px; filter: blur(7px); opacity: .72; }
.publication-prompt-mask-lines i { display: block; height: 10px; border-radius: 999px; background: linear-gradient(90deg, rgba(182, 195, 202, .82), rgba(182, 195, 202, .1)); }
.publication-prompt-mask-lines i:nth-child(2) { width: 91%; }
.publication-prompt-mask-lines i:nth-child(3) { width: 78%; }
.publication-prompt-mask-lines i:nth-child(4) { width: 57%; }
.publication-prompt-mask-lock { position: absolute; inset: 0; display: grid; place-items: center; gap: 8px; background: rgba(13, 14, 18, .34); }
.publication-prompt-mask-lock > div { display: grid; justify-items: center; gap: 9px; width: min(92%, 250px); color: #f2f4f6; text-align: center; }
.publication-prompt-lock-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f0c04a; color: #251b04; box-shadow: 0 7px 20px rgba(0, 0, 0, .24); }
.publication-prompt-lock-icon .ui-icon { width: 18px; height: 18px; }
.publication-prompt-mask-lock strong { font-size: 13px; line-height: 1.5; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.publication-detail-comments { padding: 20px 0 24px; border-top: 1px solid #282d34; }
.publication-detail-comments h3 { margin: 0 0 13px; color: #edf2f4; font-size: 14px; }
.publication-comment-list { display: grid; align-content: start; gap: 9px; max-height: 34vh; padding-right: 3px; overflow-y: auto; }
.publication-comment-list article { border: 1px solid #2a2f36; border-radius: 8px; background: #1c2026; padding: 11px 12px; }
.publication-comment-list strong { color: #dbe3e8; font-size: 12px; }
.publication-comment-list p { margin: 5px 0; color: #ccd3d8; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.publication-comment-list small, .publication-comment-empty, .publication-comment-loading, .publication-comment-closed { display: block; color: #7d868f; font-size: 11px; }
.publication-detail-comments form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 13px; }
.publication-detail-comments textarea { width: 100%; min-height: 45px; max-height: 120px; box-sizing: border-box; border: 1px solid #363b44; border-radius: 8px; outline: 0; background: #111318; color: #eef0f3; padding: 9px 11px; resize: vertical; font: inherit; }
.publication-detail-comments form button { height: 40px; border: 0; border-radius: 8px; background: #76d1e0; color: #101419; padding: 0 15px; cursor: pointer; }
.publication-detail-comments form button:disabled { opacity: .55; cursor: default; }
.publication-detail-prompt .publication-detail-notice { margin: 0 0 12px; padding: 9px 10px; border-left: 3px solid #d5a64a; border-radius: 4px; background: rgba(213, 166, 74, .1); color: #d8bd80; font-size: 12px; line-height: 1.6; }
.publication-detail-prompt .publication-detail-empty { color: #9aa4ad; }
.publication-detail-method { padding: 20px 0; border-bottom: 1px solid #282d34; }.publication-detail-method h3 { margin: 0 0 12px; font-size: 13px; }.publication-detail-method p { margin: 0 0 8px; color: #9da8b1; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }.publication-detail-method p:last-child { margin-bottom: 0; }.publication-detail-method strong { display: block; margin-bottom: 3px; color: #78838d; font-size: 11px; font-weight: 500; }
.inspiration-top-nav { width: min(1320px, calc(100% - 64px)); min-height: 64px; display: flex; align-items: center; gap: 26px; margin: 0 auto; border-bottom: 1px solid #242930; background: #090b0e; }
.inspiration-brand { flex: 0 0 auto; color: #eef3f5; font-size: 16px; font-weight: 750; text-decoration: none; }
.inspiration-top-nav nav { align-self: stretch; display: flex; gap: 20px; }
.inspiration-top-nav nav button, .inspiration-published-link { border: 0; background: transparent; color: #8c96a2; cursor: pointer; font-size: 13px; }
.inspiration-top-nav nav button { position: relative; padding: 0 2px; }
.inspiration-top-nav nav button:hover, .inspiration-top-nav nav button.active, .inspiration-published-link:hover { color: #eef4f6; }
.inspiration-top-nav nav button.active::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: #79d6e2; }
.inspiration-top-nav > label { width: min(320px, 32vw); height: 36px; display: flex; align-items: center; gap: 8px; margin-left: 10px; border: 1px solid #2c333b; border-radius: 7px; background: #12151a; color: #7f8b98; padding: 0 11px; }
.inspiration-top-nav > label input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #eef2f5; }
.inspiration-published-link { margin-left: auto; white-space: nowrap; }
.inspiration-banner { position: relative; width: min(1440px, calc(100% - 64px)); height: clamp(220px, 32vw, 420px); margin: 28px auto 0; overflow: hidden; border-radius: 12px; background: #14181d; }
.inspiration-banner-media { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.inspiration-banner-media img, .inspiration-banner-media video { width: 100%; height: 100%; display: block; object-fit: cover; }
.inspiration-banner-media::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(3, 5, 8, .8)); }
.inspiration-banner-media > div { position: absolute; right: 28px; bottom: 26px; left: 28px; z-index: 1; display: grid; gap: 4px; text-align: left; color: #fff; }
.inspiration-banner-media strong { font-size: clamp(18px, 2.2vw, 30px); }
.inspiration-banner-media small { color: rgba(255, 255, 255, .72); }
.inspiration-banner-arrow { position: absolute; top: 50%; z-index: 2; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(0,0,0,.34); color: #fff; font-size: 25px; line-height: 1; transform: translateY(-50%); cursor: pointer; }
.inspiration-banner-arrow.prev { left: 16px; }.inspiration-banner-arrow.next { right: 16px; }
.inspiration-banner-dots { position: absolute; bottom: 12px; left: 50%; z-index: 2; display: flex; gap: 5px; transform: translateX(-50%); }
.inspiration-banner-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.45); }.inspiration-banner-dots i.active { width: 18px; border-radius: 4px; background: #fff; }
.profile-stage { padding: 112px 38px 70px; }
.view-inspire .workspace-toolbar .search-box, .view-inspire .workspace-toolbar .toolbar-select, .view-inspire .workspace-toolbar .toolbar-assets { display: none; }
.home-hero { position: relative; min-height: 520px; height: min(680px, calc(100vh - 170px)); display: grid; align-items: center; overflow: hidden; background: #111419; }
.view-inspire .home-hero { min-height: 100vh; height: 100vh; }
.home-hero-media, .home-hero-shade { position: absolute; inset: 0; }
.home-hero-media { overflow: hidden; }
.home-hero-media img, .home-hero-media video { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.015); animation: hero-media-breathe 18s ease-in-out infinite alternate; }
.home-hero-shade { background: linear-gradient(180deg, rgba(3, 7, 11, .08) 0%, rgba(3, 7, 11, .04) 48%, rgba(3, 7, 11, .2) 100%); box-shadow: inset 0 -80px 100px rgba(2, 4, 7, .14); }
.home-hero-copy { position: relative; z-index: 2; width: min(1120px, calc(100% - 80px)); margin: auto; padding: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.home-hero-copy > span { display: inline-flex; align-items: center; gap: 12px; color: #a7e4ed; font-size: 11px; font-weight: 700; text-shadow: 0 2px 16px rgba(0, 0, 0, .5); }
.home-hero-copy > span::before, .home-hero-copy > span::after { content: ""; width: 30px; height: 1px; background: rgba(167, 228, 237, .7); }
.home-section > header span { color: #85d9e7; font-size: 11px; font-weight: 700; }
.home-hero-copy h1 { max-width: 1020px; margin: 20px 0 16px; color: #fff; font-size: 62px; line-height: 1.12; text-shadow: 0 4px 30px rgba(0, 0, 0, .55); }
.home-hero-copy p { max-width: 720px; margin: 0 0 34px; color: rgba(239, 243, 247, .86); font-size: 18px; line-height: 1.7; text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
.home-hero-copy button { min-width: 190px; height: 54px; display: inline-flex; justify-content: center; align-items: center; gap: 22px; border: 1px solid rgba(255, 255, 255, .58); border-radius: 7px; background: rgba(8, 12, 17, .48); box-shadow: 0 14px 36px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .08); backdrop-filter: blur(12px); color: #fff; padding: 0 18px; font-weight: 700; cursor: pointer; transition: background .22s, border-color .22s, transform .22s, box-shadow .22s; }
.home-hero-copy button b { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; font-size: 14px; }
.home-hero-copy button:hover { transform: translateY(-3px); border-color: rgba(167, 228, 237, .9); background: rgba(13, 22, 28, .7); box-shadow: 0 18px 44px rgba(0, 0, 0, .3), 0 0 0 1px rgba(167, 228, 237, .12); }
@keyframes hero-media-breathe { from { transform: scale(1.015); } to { transform: scale(1.045); } }
.home-section { width: min(1440px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0; }
.home-section + .home-section { border-top: 1px solid #23272d; }
.home-section > header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.home-section > header h2 { margin: 6px 0 3px; font-size: 25px; }
.home-section > header p { margin: 0; color: #7f8792; }
.home-section > header > button { height: 36px; border: 0; background: transparent; color: #8e96a1; cursor: pointer; }
.home-section > header > button:hover { color: #8bdce8; }
.home-section > header > strong { color: #7d8590; font-size: 12px; }
.home-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-feature-card { position: relative; min-width: 0; min-height: 126px; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 14px; border: 1px solid #30353d; border-radius: 8px; background: #171a1f; color: #e6e9ed; padding: 18px; text-align: left; cursor: pointer; transition: transform .18s, border-color .18s, background .18s; }
.home-feature-card:hover { transform: translateY(-4px); border-color: #5a9eaa; background: #1d2228; }
.home-feature-card > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; background: #24313a; color: #82d6e4; font-size: 23px; }
.home-feature-card > div { min-width: 0; }
.home-feature-card strong { font-size: 16px; }
.home-feature-card p { margin: 6px 0 0; color: #858d98; font-size: 12px; line-height: 1.5; }
.home-feature-card > b { color: #b5bdc7; font-size: 18px; }
.home-model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-model-card { min-width: 0; min-height: 148px; display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 10px 14px; border: 1px solid #2d3239; border-radius: 8px; background: #12151a; color: #e6e9ee; padding: 18px; text-align: left; cursor: pointer; transition: transform .18s, border-color .18s; }
.home-model-card:hover { transform: translateY(-4px); border-color: #60727d; }
.home-model-card > span { grid-row: 1 / 3; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 8px; background: #24313a; color: #80d6e4; font-size: 24px; }
.home-model-card.video > span { background: #352e26; color: #f0c47c; }
.home-model-card > div { min-width: 0; }
.home-model-card small { color: #727b86; font-size: 9px; }
.home-model-card strong { display: block; overflow: hidden; margin: 5px 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.home-model-card p { display: -webkit-box; overflow: hidden; margin: 0; color: #858d98; font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-model-card > b { grid-column: 2; color: #8bd8e4; font-size: 11px; }
.inspiration-gallery-section { scroll-margin-top: 24px; padding-top: 22px; padding-bottom: 80px; }
.inspiration-filter-bar { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; border-bottom: 1px solid #292d34; }
.inspiration-filter-bar > div { display: flex; align-self: stretch; }
.inspiration-filter-bar button { min-width: 76px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #818995; cursor: pointer; }
.inspiration-filter-bar button.active { border-bottom-color: #72d1df; color: #eef1f4; }
.inspiration-filter-bar label { width: min(320px, 40vw); height: 38px; display: flex; align-items: center; gap: 8px; border: 1px solid #30353d; border-radius: 7px; background: #15181d; color: #87909b; padding: 0 11px; }
.inspiration-filter-bar input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #eef1f4; }
.inspiration-grid { display: grid; grid-template-columns: repeat(var(--inspiration-columns, 4), minmax(0, 1fr)); gap: 16px; align-items: start; }
.inspiration-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #292d34; border-radius: 8px; background: #15171b; transition: transform .18s, border-color .18s; }
.inspiration-card:hover { transform: translateY(-4px); border-color: #414852; }
.inspiration-media { position: relative; width: 100%; display: block; overflow: hidden; border: 0; background: #0d0f12; padding: 0; cursor: zoom-in; }
.inspiration-media img, .inspiration-media video { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .24s; }
.inspiration-tag { position: absolute; top: 10px; z-index: 2; border-radius: 4px; padding: 4px 7px; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0; box-shadow: 0 3px 12px rgba(0,0,0,.22); }
.inspiration-tag.pinned { left: 10px; background: #356b9d; }
.inspiration-tag.hot { right: 10px; background: #bc5a31; }
.inspiration-tag.fresh { right: 10px; background: #248a67; }
.inspiration-card:hover .inspiration-media img, .inspiration-card:hover .inspiration-media video { transform: scale(1.025); }
.video-play { position: absolute; inset: 50% auto auto 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: rgba(5, 7, 9, .72); color: #fff; }
.inspiration-copy { position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; display: grid; gap: 8px; padding: 42px 12px 10px; background: linear-gradient(transparent, rgba(5, 7, 10, .92) 35%); color: #f2f5f6; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.inspiration-card:hover .inspiration-copy, .inspiration-card:focus-within .inspiration-copy { opacity: 1; transform: translateY(0); pointer-events: auto; }
.inspiration-copy > div:first-child { min-width: 0; display: grid; gap: 4px; }
.inspiration-copy strong, .inspiration-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspiration-copy small { color: #707783; font-size: 11px; }
.inspiration-copy > p { display: -webkit-box; overflow: hidden; margin: 0; color: #aeb4bd; font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.publication-details { display: grid; gap: 4px; color: #767e89; font-size: 11px; }
.publication-access { width: fit-content; border: 1px solid #3a4048; border-radius: 5px; padding: 3px 7px; color: #aeb5be; font-size: 10px; }
.publication-access.free { border-color: #315b4b; color: #80d4ad; }
.publication-access.paid { border-color: #66542f; color: #e5c879; }
.publication-locked-copy { color: #858d98 !important; }
.publication-access-actions { display: flex; }
.publication-access-actions button { min-height: 34px; width: 100%; }
.social-actions { display: flex; gap: 6px; padding-top: 3px; border-top: 1px solid #282c32; }
.social-actions button { height: 32px; display: flex; align-items: center; gap: 5px; border: 0; border-radius: 6px; background: transparent; color: #858d98; padding: 0 8px; cursor: pointer; }
.social-actions button:hover, .social-actions button.active { background: #242930; color: #77d4e3; }
.inspiration-card .inspiration-copy button { color: #dbe5e8; }
.publication-cover-overlay {
  position: absolute; right: 0; bottom: 0; left: 0; z-index: 3;
  display: grid; gap: 11px; padding: 64px 13px 12px;
  background: linear-gradient(to top, rgba(4, 6, 9, .94) 12%, rgba(4, 6, 9, .58) 46%, transparent);
  color: #fff; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.inspiration-card:hover .publication-cover-overlay,
.inspiration-card:focus-within .publication-cover-overlay { opacity: 1; transform: translateY(0); }
.publication-cover-title {
  min-width: 0; display: grid; gap: 3px;
}
.publication-cover-title strong {
  overflow: hidden; color: #fff; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.publication-cover-title small {
  overflow: hidden; color: rgba(255, 255, 255, .68); font-size: 11px; text-overflow: ellipsis; white-space: nowrap;
}
.publication-keywords { overflow: hidden; color: rgba(151, 222, 235, .92); font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.publication-cover-stats {
  min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  color: rgba(255, 255, 255, .92); font-size: 12px; font-variant-numeric: tabular-nums;
}
.publication-cover-stats > span {
  min-width: 0; display: inline-flex; align-items: center; gap: 4px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .45); white-space: nowrap;
}
.publication-cover-stats .ui-icon { width: 15px; height: 15px; flex: 0 0 auto; }
.publication-favorite-button {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  width: 35px; height: 35px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%;
  background: rgba(8, 10, 14, .52); color: #fff; cursor: pointer;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .28); backdrop-filter: blur(10px);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.publication-favorite-button:hover { background: rgba(255, 255, 255, .2); transform: scale(1.05); }
.publication-favorite-button.active { border-color: rgba(255, 205, 90, .8); background: rgba(37, 31, 11, .74); color: #ffd166; }
.publication-favorite-button .ui-icon { width: 17px; height: 17px; }
@media (pointer: coarse) {
  .publication-cover-overlay { opacity: 1; transform: none; }
}
.publication-viewer-bar { position: absolute; right: 0; bottom: 0; left: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 22px 14px 10px; background: linear-gradient(transparent, rgba(3, 5, 8, .88)); color: #f4f7f8; pointer-events: none; }
.publication-viewer-author, .publication-viewer-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.publication-viewer-author span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #4f7180; color: #fff; font-size: 12px; font-weight: 700; }
.publication-viewer-author strong { overflow: hidden; max-width: 180px; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.publication-viewer-actions { pointer-events: auto; gap: 6px; }
.publication-viewer-actions button { height: 30px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(10, 13, 17, .42); color: rgba(255,255,255,.9); padding: 0 10px; cursor: pointer; }
.publication-viewer-actions button:hover, .publication-viewer-actions button.active { background: rgba(255,255,255,.16); color: #fff; }
.publication-viewer-actions button svg { width: 15px; height: 15px; }
.publication-viewer .viewer-surface-bottom { bottom: 62px; }
.task-focus-pulse .generation-output { animation: task-focus 1.35s ease; }
@keyframes task-focus { 0%, 100% { box-shadow: none; } 35% { box-shadow: 0 0 0 3px rgba(113, 210, 225, .72), 0 0 34px rgba(113, 210, 225, .22); } }

/* Publishing and comments */
.publish-modal, .comments-modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid #353a42; border-radius: 8px; background: #181b20; padding: 22px; box-shadow: 0 28px 80px rgba(0, 0, 0, .62); }
.publish-modal header, .comments-modal header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.publish-modal h2, .comments-modal h2 { margin: 4px 0 0; }
.publish-modal header > div > span { color: #78d3e2; font-size: 10px; }
.publish-modal label { display: grid; gap: 7px; margin-bottom: 16px; color: #aeb4bd; font-size: 12px; }
.publish-modal input, .publish-modal textarea, .comments-modal input { width: 100%; border: 1px solid #363b44; border-radius: 7px; outline: 0; background: #111318; color: #eef0f3; padding: 11px; }
.publish-modal textarea { min-height: 92px; resize: vertical; }
.publish-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.publish-options label { min-height: 38px; display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; margin: 0; border: 1px solid #343941; border-radius: 6px; padding: 0 10px; }
.publish-options input { width: 16px; }
.publish-access-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.publish-access-switch label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; margin: 0; border: 1px solid #343941; border-radius: 7px; padding: 12px; cursor: pointer; }
.publish-access-switch input { width: 16px; margin-top: 2px; }
.publish-access-switch span { display: grid; gap: 4px; }
.publish-access-switch strong { color: #eef0f3; font-size: 13px; }
.publish-access-switch small, #publicationPriceField small { color: #777f8a; line-height: 1.45; }
.publish-modal footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px; border-top: 1px solid #30343b; }
.publish-modal footer span { color: #777f8a; font-size: 11px; }
.publish-button:disabled, .asset-actions button:disabled { opacity: .5; cursor: default; }
.comments-modal { display: grid; grid-template-rows: auto minmax(100px, 1fr) auto; }
.comments-modal header p { margin: 4px 0 0; color: #777f8a; font-size: 12px; }
.comment-list { max-height: 55vh; display: grid; align-content: start; gap: 9px; overflow-y: auto; }
.comment-list article { padding: 11px; border-radius: 7px; background: #22262c; }
.comment-list article p { margin: 5px 0; color: #d1d5db; line-height: 1.5; }
.comment-list small, .comment-empty, .comment-closed { color: #777f8a; font-size: 11px; }
.comments-modal form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.comments-modal form button { border: 0; border-radius: 7px; background: #76d1e0; color: #101419; padding: 0 16px; cursor: pointer; }

/* User center */
.profile-header { max-width: 1120px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 0 auto 22px; }
.profile-avatar { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; flex: 0 0 64px; border-radius: 50%; background: #506878; color: #fff; font-size: 24px; }
.avatar-button img, .profile-avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.profile-header h1 { margin: 3px 0; font-size: 25px; }
.profile-name-row { display: flex; align-items: center; gap: 9px; }
.profile-name-row h1 { margin: 3px 0; }
.subtle-button.compact { min-height: 28px; padding: 0 9px; font-size: 11px; }
.agent-identity-badge { display: inline-flex; align-items: center; height: 23px; margin-left: 9px; border: 1px solid #4b8490; border-radius: 5px; background: #17323a; color: #9ae6f2; padding: 0 7px; vertical-align: middle; font-size: 11px; font-weight: 600; }
.profile-header p { margin: 0; color: #777f8a; }
.profile-header span { color: #72d2e1; font-size: 10px; }
.profile-metrics { max-width: 1120px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 auto 22px; }
.profile-metrics article { display: grid; gap: 5px; padding: 16px; border-bottom: 1px solid #30353d; background: #16191e; }
.profile-metrics strong { font-size: 25px; }
.profile-metrics span { color: #7c8490; font-size: 11px; }
.profile-publications { max-width: 1120px; margin: auto; }
.profile-panel { max-width: 1120px; margin: 0 auto 22px; border-top: 1px solid #30353d; background: #15181d; padding: 18px; }
.profile-panel > header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.profile-panel h2 { margin: 0 0 4px; font-size: 17px; }
.profile-panel header span, .profile-rule { color: #7b8490; font-size: 12px; }
.profile-panel header > strong { color: #7fd8e7; font-size: 20px; }
.invite-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.invite-code-grid article { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; border: 1px solid #2c323a; border-radius: 7px; background: #1b1f25; padding: 12px; }
.invite-code-grid article > span { grid-column: 1 / -1; color: #808995; font-size: 11px; }
.invite-code-grid article > strong { overflow: hidden; color: #e5e9ed; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.agent-code-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; margin-top: 10px; }
.agent-code-form label { display: grid; gap: 6px; color: #858d98; font-size: 11px; }
.agent-code-form input { min-height: 38px; border: 1px solid #343941; border-radius: 6px; outline: 0; background: #111318; color: #eef0f3; padding: 0 11px; }
.agent-management > header > strong { color: #7fd8e7; font-size: 14px; white-space: nowrap; }
.agent-child-form { display: grid; grid-template-columns: minmax(240px, 1fr) 190px auto; gap: 10px; align-items: end; margin-bottom: 15px; padding: 13px; border: 1px solid #2c323a; border-radius: 7px; background: #191d22; }
.agent-child-form label { min-width: 0; display: grid; gap: 6px; color: #9aa4ae; font-size: 11px; }
.agent-child-form label small { color: #727d88; }
.agent-child-form input { min-width: 0; height: 40px; border: 1px solid #343b45; border-radius: 6px; outline: 0; background: #101318; color: #e7eaee; padding: 0 11px; }
.agent-child-form input:focus { border-color: #77d2de; }
.agent-child-form button { height: 40px; white-space: nowrap; }
.agent-management .profile-table-wrap td > strong,
.agent-management .profile-table-wrap td > small { display: block; }
.agent-management .profile-table-wrap td > small { margin-top: 4px; color: #78828d; }
.profile-rule { margin: 12px 0; }
.profile-editor form { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px 24px; align-items: start; }
.profile-editor-avatar { display: grid; justify-items: center; gap: 8px; color: #77828d; font-size: 11px; text-align: center; }
.profile-avatar-edit { width: 92px; height: 92px; font-size: 32px; }
.profile-editor-fields { display: grid; gap: 13px; }
.profile-editor-fields label { display: grid; gap: 6px; color: #9ca6b0; font-size: 11px; }
.profile-editor-fields input, .profile-editor-fields textarea { width: 100%; border: 1px solid #303842; border-radius: 6px; outline: none; background: #11151a; color: #e8edf0; padding: 10px 11px; font: inherit; }
.profile-editor-fields textarea { min-height: 72px; resize: vertical; }
.profile-editor-fields input:focus, .profile-editor-fields textarea:focus { border-color: #77d2de; }
.profile-editor form footer { grid-column: 2; display: flex; justify-content: flex-end; }
.profile-signature { display: block; margin-top: 6px; color: #96a1aa; font-size: 12px; }
.profile-modal { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid #353d45; border-radius: 8px; background: #191d22; padding: 20px; box-shadow: 0 28px 80px rgba(0,0,0,.62); }
.profile-modal header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 17px; }
.profile-modal header h2 { margin: 5px 0 0; font-size: 19px; }
.profile-modal header p { margin: 5px 0 0; color: #7e8994; font-size: 12px; }
.profile-modal > .profile-editor-avatar { margin: 2px auto 18px; }
.profile-modal .profile-editor-fields { display: grid; gap: 12px; }
.profile-modal footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #30363d; }
.profile-modal footer span { color: #7a8590; font-size: 11px; }
.table-modal { width: min(760px, 100%); }
.table-modal .profile-table-wrap { max-height: 58vh; overflow: auto; }
.recharge-history-modal { width: min(780px, 100%); }
.invoice-type { display: flex; gap: 18px; margin: 0 0 15px; color: #dbe2e8; font-size: 13px; }
.invoice-type label { display: flex; align-items: center; gap: 7px; }
.invoice-special-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-table-wrap { overflow-x: auto; }
.profile-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.profile-table-wrap th, .profile-table-wrap td { padding: 10px 9px; border-bottom: 1px solid #292e35; text-align: left; white-space: nowrap; }
.profile-table-wrap th { color: #747e8a; font-weight: 500; }
.credit-change { font-weight: 700; }.credit-change.positive { color: #78d6b5; }.credit-change.negative { color: #ec8c99; }
.agent-profit form { display: grid; grid-template-columns: 150px minmax(220px, 1fr) auto; gap: 8px; margin-bottom: 13px; }
.agent-profit input { min-width: 0; height: 40px; border: 1px solid #343b45; border-radius: 6px; outline: 0; background: #101318; color: #e7eaee; padding: 0 11px; }
.daily-reward-modal { width: min(420px, 100%); display: grid; justify-items: center; gap: 10px; border: 1px solid #39444b; border-radius: 8px; background: #181d21; padding: 30px; text-align: center; box-shadow: 0 30px 90px rgba(0, 0, 0, .65); }
.daily-reward-modal > span { color: #72d1df; font-size: 10px; letter-spacing: 1.3px; }
.daily-reward-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: #24343a; color: #83dae6; font-size: 27px; }
.daily-reward-modal h2 { margin: 3px 0 0; }.daily-reward-modal p { margin: 0; color: #949da7; line-height: 1.7; }.daily-reward-modal > strong { color: #82d9e7; font-size: 25px; }.daily-reward-modal button { margin-top: 7px; }
.login-announcement-backdrop { z-index: 130; background: rgba(5, 8, 12, .66); backdrop-filter: blur(4px); }
.login-announcement-modal { width: min(520px, calc(100vw - 32px)); overflow: hidden; border: 1px solid #3b5661; border-radius: 10px; background: linear-gradient(145deg, #1a2229, #14181d); box-shadow: 0 28px 90px rgba(0, 0, 0, .56); color: #edf3f5; }
.login-announcement-modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.login-announcement-modal header > span { color: #7bd5e3; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.login-announcement-modal h2 { margin: 18px 20px 8px; font-size: 22px; letter-spacing: 0; }
.login-announcement-modal p { margin: 0; padding: 0 20px 20px; color: #aeb8c0; font-size: 14px; line-height: 1.8; }
.login-announcement-modal footer { display: flex; justify-content: flex-end; padding: 14px 20px 20px; border-top: 1px solid rgba(163, 184, 196, .12); }
.login-announcement-modal footer .primary-button { min-height: 38px; }
.asset-gallery-media:hover img, .asset-gallery-media:hover video, .profile-publication-list > article > button:first-child:hover img, .profile-publication-list > article > button:first-child:hover video, .inspiration-card:hover img, .inspiration-card:hover video { transform: scale(1.045); }
.asset-gallery-media img, .asset-gallery-media video, .profile-publication-list img, .profile-publication-list video, .inspiration-card img, .inspiration-card video { transition: transform .24s ease; }
.global-thumbnail-preview { position: fixed; z-index: 10000; width: min(380px, calc(100vw - 24px)); height: 288px; display: grid; place-items: center; overflow: hidden; border: 1px solid #59636f; border-radius: 8px; background: #0c0f13; padding: 7px; box-shadow: 0 22px 65px rgba(0, 0, 0, .78); pointer-events: auto; isolation: isolate; animation: preview-in .16s ease-out; }
.global-thumbnail-preview img, .global-thumbnail-preview video { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 4px; }
.global-thumbnail-preview { position: fixed; }
.thumbnail-preview-actions { position: absolute; z-index: 4; top: 12px; right: 12px; display: flex; gap: 4px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(12,15,19,.82); padding: 4px; opacity: 1; pointer-events: auto; backdrop-filter: blur(10px); }
.thumbnail-preview-actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #eef7fa; padding: 0; cursor: pointer; }
.thumbnail-preview-actions button:hover { background: rgba(115,217,234,.18); color: #fff; }
.thumbnail-preview-actions svg { width: 15px; height: 15px; }
.thumbnail-video-surface { position: relative; width: 100%; height: 100%; overflow: hidden; background: #090c11; cursor: pointer; }
.thumbnail-video-surface > video { width: 100%; height: 100%; display: block; object-fit: contain; }
.thumbnail-video-controls { position: absolute; z-index: 2; right: 7px; bottom: 7px; left: 7px; display: flex; align-items: center; gap: 4px; min-height: 32px; border: 1px solid rgba(218, 247, 252, .25); border-radius: 12px; background: rgba(12, 18, 23, .32); padding: 3px 5px; color: #ecfbff; opacity: 0; transform: translateY(5px); transition: opacity .16s ease, transform .16s ease; backdrop-filter: blur(10px); pointer-events: none; }
.thumbnail-video-surface:hover .thumbnail-video-controls, .thumbnail-video-surface.controls-visible .thumbnail-video-controls { opacity: 1; transform: translateY(0); pointer-events: auto; }
.thumbnail-video-controls button { width: 25px; min-width: 25px; height: 25px; min-height: 25px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: inherit; padding: 0; cursor: pointer; }
.thumbnail-video-controls button:hover { background: rgba(99, 211, 230, .16); }
.thumbnail-video-controls > span { min-width: 64px; color: rgba(231, 247, 251, .82); font-size: 9px; font-variant-numeric: tabular-nums; }
.thumbnail-video-controls input[type="range"] { min-width: 18px; flex: 1 1 auto; height: 3px; accent-color: #73d9ea; cursor: pointer; }
.thumbnail-video-controls button[data-thumbnail-video-fullscreen] { flex: 0 0 25px; }
.thumbnail-video-controls { max-width: calc(100% - 14px); }
.thumbnail-video-surface:fullscreen { width: 100vw; height: 100vh; background: #000; }
.thumbnail-video-surface:fullscreen .thumbnail-video-controls { right: 18px; bottom: 18px; left: 18px; }
.profile-publications > header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.profile-publications h2 { margin: 0; font-size: 17px; }
.profile-publications header span { color: #747c88; font-size: 11px; }
.profile-publication-list { display: grid; gap: 8px; }
.profile-publication-list > article { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 10px; border-bottom: 1px solid #292d34; }
.profile-publication-list > article > button:first-child { width: 88px; overflow: hidden; border: 0; border-radius: 6px; background: #101216; padding: 0; cursor: pointer; }
.profile-publication-list img, .profile-publication-list video { width: 100%; height: 100%; display: block; object-fit: contain; }
.profile-publication-list article > div { min-width: 0; display: grid; gap: 5px; }
.profile-publication-list small { color: #777f8a; }
.profile-publication-list p { margin: 0; color: #9299a3; font-size: 12px; }
.profile-publication-list .profile-publication-review { line-height: 1.55; }
.profile-publication-list .profile-publication-review.pending { color: #d8b66d; }
.profile-publication-list .profile-publication-review.rejected { color: #ef9aa5; }

/* Media viewer */
.media-viewer-backdrop { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 6, .92); }
.media-viewer { max-width: 100%; max-height: calc(100vh - 40px); display: grid; grid-template-rows: 64px minmax(0, 1fr) 58px; overflow: hidden; border: 0; border-radius: 6px; background: #111318; box-shadow: 0 30px 90px rgba(0, 0, 0, .72); }
.media-viewer header, .media-viewer footer { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid #292d34; }
.media-viewer footer { min-height: 58px; border-top: 1px solid #292d34; border-bottom: 0; }
.media-viewer header > div { min-width: 0; display: grid; gap: 3px; }
.media-viewer header small { overflow: hidden; color: #777f8b; text-overflow: ellipsis; white-space: nowrap; }
.viewer-icon { width: 38px; height: 38px; border: 1px solid #353a43; border-radius: 50%; background: #1c2026; color: #fff; font-size: 22px; cursor: pointer; }
.media-viewer-stage { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: auto; scrollbar-width: none !important; -ms-overflow-style: none; scrollbar-color: transparent transparent !important; background: transparent; }
.media-viewer-stage::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; background: transparent; }
.media-viewer-stage img, .media-viewer-stage video { width: auto; height: auto; max-width: 100%; max-height: 100%; display: block; object-fit: contain; transform-origin: center; transition: transform .18s ease; }
.media-viewer-stage.image-pan-ready { cursor: grab; }
.media-viewer-stage img.image-pan-ready { cursor: grab; touch-action: none; user-select: none; }
.media-viewer-stage img.image-pan-ready.is-panning { cursor: grabbing; transition: none; }
.media-viewer.image-viewer { position: relative; grid-template-rows: 1fr; background: transparent; box-shadow: 0 30px 90px rgba(0, 0, 0, .54); }
.media-viewer.image-viewer header { position: absolute; z-index: 3; top: 0; left: 0; right: 0; border: 0; background: linear-gradient(180deg, rgba(8, 10, 13, .75), transparent); }
.media-viewer.image-viewer .media-viewer-stage { width: 100%; height: 100%; }
.media-viewer.image-viewer footer { position: absolute; z-index: 3; right: 14px; bottom: 14px; min-height: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: rgba(18, 22, 27, .72); padding: 6px; backdrop-filter: blur(12px); }
.media-viewer.image-viewer footer > div:first-child { gap: 3px; }
.media-viewer.image-viewer footer button { min-height: 32px; border-color: transparent; background: transparent; }
.media-viewer.image-viewer footer button:hover { background: rgba(255,255,255,.1); }
.generation-inline-video { position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; background: #090c11; cursor: pointer; }
.generation-inline-video { container-type: inline-size; }
.generation-inline-video > video { width: 100%; height: 100%; display: block; object-fit: contain; cursor: pointer; }
.inline-video-controls { position: absolute; z-index: 3; right: 10px; bottom: 10px; left: 10px; min-height: 36px; display: flex; align-items: center; gap: 6px; border: 1px solid rgba(218, 247, 252, .28); border-radius: 14px; background: rgba(12, 18, 23, .34); box-shadow: 0 6px 20px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .1); padding: 3px 6px; color: #f1fcff; opacity: 0; transform: translateY(7px); transition: opacity .18s ease, transform .18s ease; backdrop-filter: blur(10px); pointer-events: none; }
.generation-inline-video:hover .inline-video-controls, .generation-inline-video.controls-visible .inline-video-controls, .generation-inline-video:focus-within .inline-video-controls { opacity: 1; transform: translateY(0); pointer-events: auto; }
.inline-video-controls button { width: 29px; min-width: 29px; height: 29px; min-height: 29px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #e9faff; padding: 0; cursor: pointer; }
.inline-video-controls button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.inline-video-controls .inline-video-download { border: 1px solid rgba(113, 211, 229, .3); background: rgba(26, 75, 87, .68); color: #d9fbff; }
.inline-video-controls > span { flex: 0 0 auto; min-width: 74px; color: rgba(231, 247, 251, .82); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inline-video-controls input[type="range"] { min-width: 20px; flex: 1 1 auto; height: 4px; accent-color: #73d9ea; cursor: pointer; }
.generation-inline-video:fullscreen { width: 100vw; height: 100vh; background: #000; }
.generation-inline-video:fullscreen > video { width: 100%; height: 100%; object-fit: contain; }
.generation-inline-video:fullscreen .inline-video-controls { right: 20px; bottom: 20px; left: 20px; }
.generation-inline-video .inline-video-controls { max-width: calc(100% - 20px); }
.generation-inline-video .inline-video-controls > span { overflow: hidden; text-overflow: ellipsis; }
.client-body .generation-output.video .inline-video-controls {
  border-color: rgba(255, 255, 255, .24) !important;
  background: rgba(255, 255, 255, .075) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12) !important;
  backdrop-filter: blur(6px) !important;
}
.client-body .generation-output.video .inline-video-controls button:hover {
  background: rgba(255, 255, 255, .14) !important;
}
@container (max-width: 240px) {
  .inline-video-controls { right: 6px; bottom: 6px; left: 6px; min-height: 32px; gap: 3px; border-radius: 11px; padding: 2px 4px; }
  .inline-video-controls button { width: 26px; min-width: 26px; height: 26px; min-height: 26px; border-radius: 7px; }
  .inline-video-controls > span,
  .inline-video-controls [data-inline-video-fullscreen] { display: none; }
  .inline-video-controls input[type="range"] { min-width: 0; height: 3px; }
}
#viewerVideo::-webkit-media-controls,
#viewerVideo::-webkit-media-controls-panel { display: none !important; }
.generation-output.video video { cursor: pointer; }
/* Video playback is controlled by the product UI, never browser chrome. */
.viewer-audio { width: min(520px, calc(100% - 40px)); display: grid; justify-items: center; gap: 24px; }
.viewer-audio > span { width: 96px; height: 96px; display: grid; place-items: center; border: 1px solid #35434b; border-radius: 50%; background: #1c2a30; color: #78d2e1; font-size: 42px; }
.viewer-audio audio { width: 100%; }
.media-viewer footer span { color: #747c87; font-size: 11px; }
.media-viewer-stage:fullscreen img, .media-viewer-stage:fullscreen video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
}
.media-viewer footer > div { display: flex; gap: 7px; }
.media-viewer footer button { min-width: 42px; min-height: 36px; border: 1px solid #343943; border-radius: 6px; background: #1d2128; color: #d3d7de; padding: 0 11px; cursor: pointer; }
.media-viewer footer .viewer-download { border-color: #4d98a7; background: #21404a; color: #dffaff; }
.media-viewer footer .viewer-enhance { border-color: #7566c7; background: #332d5b; color: #efeaff; }
.floating-media-viewer, .media-viewer.image-viewer.floating-media-viewer { display: block; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.floating-media-viewer .media-viewer-stage { position: relative; width: 100%; height: 100%; overflow: hidden; background: transparent; }
.floating-media-viewer .media-viewer-stage > img, .floating-media-viewer .media-viewer-stage > video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; background: transparent; }
.viewer-surface-actions { position: absolute; z-index: 4; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.viewer-surface-actions button { min-width: 34px; min-height: 34px; border: 0; border-radius: 6px; background: rgba(9, 11, 15, .62); color: #f4f7fa; padding: 0 10px; font-size: 12px; cursor: pointer; backdrop-filter: blur(10px); pointer-events: auto; }
.viewer-surface-actions button:hover { background: rgba(20, 25, 32, .92); }
.viewer-surface-actions .viewer-download { background: rgba(25, 58, 69, .78); color: #ddf9ff; }
.viewer-surface-top { top: 12px; right: 12px; }
.viewer-surface-bottom { right: 12px; bottom: 12px; justify-content: space-between; }
.viewer-surface-bottom > div { display: flex; gap: 6px; }
.floating-media-viewer .viewer-icon { width: 36px; height: 36px; min-width: 36px; padding: 0; border: 0; border-radius: 6px; background: rgba(9, 11, 15, .62); font-size: 20px; }
.floating-media-viewer .media-viewer-stage:fullscreen { width: 100vw; height: 100vh; display: grid; place-items: center; overflow: hidden; background: #000; }
.floating-media-viewer .media-viewer-stage:fullscreen > img, .floating-media-viewer .media-viewer-stage:fullscreen > video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center;
  background: #000;
}

/* Fullscreen video must preserve the generated frame, including 9:16 clips.
   This is intentionally specific because the client theme also contains
   thumbnail rules that use `cover`. */
.floating-media-viewer .media-viewer-stage:fullscreen > #viewerVideo {
  width: auto !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  background: #000 !important;
}

/* Images share the video's fullscreen fitting contract. This clears any
   floating-viewer pan or zoom so portrait work is never cropped. */
.floating-media-viewer .media-viewer-stage:fullscreen > #viewerImage {
  width: auto !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  background: #000 !important;
}
.viewer-video-controls { position: absolute; z-index: 5; right: 12px; bottom: 12px; left: 12px; min-height: 72px; display: grid; align-items: center; gap: 5px; border: 1px solid rgba(218, 247, 252, .28); border-radius: 14px; background: rgba(12, 18, 23, .42); box-shadow: 0 6px 20px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .1); padding: 5px 7px 6px; color: #f4fbfd; backdrop-filter: blur(10px); }
.video-viewer .viewer-video-controls { opacity: 0; transform: translateY(7px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.video-viewer .media-viewer-stage:hover .viewer-video-controls, .video-viewer .media-viewer-stage.controls-visible .viewer-video-controls, .video-viewer .viewer-video-controls:focus-within { opacity: 1; transform: translateY(0); pointer-events: auto; }
.viewer-video-timeline, .viewer-video-actions { min-width: 0; display: flex; align-items: center; }
.viewer-video-timeline { gap: 7px; }
.viewer-video-actions { justify-content: flex-end; gap: 4px; }
.viewer-video-controls button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: inherit; padding: 0; cursor: pointer; }
.viewer-video-controls button:hover { background: rgba(255,255,255,.13); }
.viewer-video-controls #viewerVideoOriginalToggle { width: auto; min-width: 56px; padding: 0 9px; border: 1px solid rgba(218, 247, 252, .28); white-space: nowrap; }
.viewer-video-controls .viewer-download { background: rgba(25, 58, 69, .78); color: #ddf9ff; }
.viewer-video-controls > .viewer-video-timeline > span { flex: 0 0 auto; min-width: 76px; color: rgba(244,247,250,.9); font-size: 12px; font-variant-numeric: tabular-nums; }
.viewer-resolution-label { min-width: 0 !important; white-space: nowrap; color: rgba(244,247,250,.78) !important; font-variant-numeric: tabular-nums; }
.viewer-surface-bottom .viewer-resolution-label { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; color: rgba(244,247,250,.78); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.viewer-video-timeline input[type="range"] { min-width: 120px; flex: 1 1 auto; height: 32px; accent-color: #83dce9; cursor: pointer; }
.video-viewer .viewer-video-controls { max-width: calc(100% - 24px); }
.media-viewer-stage:fullscreen .viewer-video-controls { right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); left: max(18px, env(safe-area-inset-left)); }
@media (max-width: 520px) {
  .viewer-video-controls { min-height: 68px; gap: 3px; padding-inline: 5px; }
  .viewer-video-timeline { gap: 5px; }
  .viewer-video-controls > .viewer-video-timeline > span { min-width: 62px; font-size: 11px; }
  .viewer-video-controls #viewerVideoTime { min-width: 58px; }
  .viewer-video-controls #viewerVideoOriginalToggle { min-width: 48px; padding-inline: 6px; }
  .viewer-video-actions { gap: 2px; }
}
.generation-primary-actions > .enhance-action { border-color: var(--brand-border); background: var(--brand-surface-soft); color: var(--color-brand); }
.generation-primary-actions > .enhance-action:hover { border-color: var(--color-brand); background: var(--page-control-hover); color: var(--page-text); }
.video-enhance-modal { width: min(430px, calc(100vw - 32px)); border: 1px solid var(--page-line-strong); border-radius: var(--radius-base); background: var(--glass-high-bg); color: var(--page-text); box-shadow: var(--shadow-depth-dialog), var(--glow-soft); backdrop-filter: blur(var(--glass-blur-high)); }
.video-enhance-modal header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--page-line-soft); }.video-enhance-modal h2 { margin: 0; font-size: 16px; }.video-enhance-modal p { margin: 6px 0 0; color: var(--page-text-muted); font-size: 12px; }
.video-enhance-options { padding: 20px; display: grid; gap: 11px; color: var(--page-text-muted); font-size: 13px; }.video-enhance-options > div { display: flex; gap: 8px; }.video-enhance-options button { min-width: 64px; height: 34px; border: 1px solid var(--page-line); border-radius: var(--radius-sm); background: var(--page-control-bg); color: var(--page-text); cursor: pointer; transition: background-color var(--motion-fast) ease-out, border-color var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out; }.video-enhance-options button:hover, .video-enhance-options button.active { border-color: var(--brand-border); background: var(--page-control-hover); box-shadow: var(--page-focus-ring); }
.video-enhance-cost { display: grid !important; grid-template-columns: auto 1fr; gap: 6px 18px !important; padding-top: 8px; border-top: 1px solid var(--page-line-soft); color: var(--page-text-muted); }.video-enhance-cost strong { color: var(--color-brand); font-weight: 600; text-align: right; }
.video-enhance-modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--page-line-soft); }.video-enhance-modal footer button { min-height: 34px; border: 1px solid var(--page-line); border-radius: var(--radius-sm); background: var(--page-control-bg); color: var(--page-text); padding: 0 13px; cursor: pointer; }.video-enhance-modal footer button:hover { border-color: var(--brand-border); background: var(--page-control-hover); }.video-enhance-modal footer .primary { border-color: var(--color-brand); background: var(--gradient-brand); color: var(--color-brand-ink); }.video-enhance-modal footer .primary:disabled { cursor: wait; opacity: .72; }

/* Recharge dialog */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(4, 5, 7, .72); }
.announcement-backdrop { z-index: 180; align-items: start; padding-top: 76px; background: rgba(4, 5, 7, .58); }
.announcement-modal { width: min(620px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 100px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #3a414b; border-radius: 10px; background: #171a1f; color: #eef1f4; box-shadow: 0 28px 90px rgba(0, 0, 0, .62); }
.announcement-modal > header { display: flex; align-items: start; justify-content: space-between; flex: 0 0 auto; border-bottom: 1px solid #2d323a; padding: 20px 22px 16px; }
.announcement-modal > header > div { display: grid; gap: 4px; }
.announcement-modal > header > div > span { color: #83d8e6; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
.announcement-modal h2 { margin: 0; font-size: 23px; font-weight: 650; }
.announcement-section { padding: 18px 22px 0; }
.announcement-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.announcement-section-heading strong { color: #f1f3f5; font-size: 13px; }
.announcement-section-heading span { color: #77808c; font-size: 11px; }
.announcement-item { border: 1px solid #303640; border-radius: 8px; background: #1d2127; padding: 14px 15px; }
.announcement-item.latest { border-color: rgba(131, 216, 230, .46); background: linear-gradient(135deg, #1c292d, #1d2127 64%); }
.announcement-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: #78828e; font-size: 10px; }
.announcement-item-meta > span { color: #8ddce8; font-size: 10px; font-weight: 700; }
.announcement-item-meta time { margin-left: auto; }
.announcement-item-meta b { border-radius: 3px; background: #d3a35e; color: #1c1710; padding: 2px 5px; font-size: 9px; font-weight: 700; }
.announcement-item h3 { margin: 9px 0 6px; color: #f2f4f5; font-size: 16px; font-weight: 650; }
.announcement-item p { margin: 0; color: #b3bac3; font-size: 13px; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; }
.announcement-target { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; margin-top: 13px; border: 1px solid #3e6871; border-radius: 5px; background: #203238; color: #a6e5ee; padding: 0 10px; cursor: pointer; }
.announcement-target:hover, .announcement-target:focus-visible { outline: 0; border-color: #78d2df; background: #29454b; }
.announcement-history { min-height: 0; display: flex; flex-direction: column; padding-bottom: 22px; }
.announcement-list { min-height: 0; display: grid; gap: 8px; overflow-y: auto; padding-right: 3px; }
.announcement-list .announcement-item { background: #1a1d22; }
.announcement-empty { display: grid; justify-items: center; gap: 8px; padding: 68px 26px 76px; text-align: center; }
.announcement-empty > span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #3a5d65; border-radius: 50%; background: #203238; color: #91deea; font-size: 20px; }
.announcement-empty strong { color: #e8edf0; font-size: 15px; }
.announcement-empty p { margin: 0; color: #7f8995; font-size: 12px; }
.session-expired-backdrop { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 10, .78); backdrop-filter: blur(8px); }
.session-expired-dialog { width: min(410px, 100%); border: 1px solid #343943; border-radius: 8px; padding: 28px; background: #15181d; box-shadow: 0 24px 80px rgba(0, 0, 0, .46); color: #f3f4f6; }
.session-expired-dialog > span { color: #78d2e9; font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
.session-expired-dialog h2 { margin: 9px 0 6px; font-size: 24px; }
.session-expired-dialog > p { margin: 0 0 20px; color: #9299a5; font-size: 13px; line-height: 1.65; }
.session-expired-dialog form, .session-expired-dialog label { display: grid; gap: 8px; }
.session-expired-dialog form { gap: 14px; }
.session-expired-dialog label { color: #b9bec7; font-size: 12px; }
.session-expired-dialog input { height: 46px; border: 1px solid #363c46; border-radius: 6px; outline: none; padding: 0 12px; background: #0e1014; color: #fff; }
.session-expired-dialog input:focus { border-color: #78d2e9; box-shadow: 0 0 0 3px rgba(120, 210, 233, .1); }
.session-expired-dialog button { height: 46px; border: 0; border-radius: 6px; background: #eef2f4; color: #111418; font-weight: 700; cursor: pointer; }
.session-expired-dialog button:disabled { opacity: .55; cursor: wait; }
.session-expired-error { margin-bottom: 14px; border: 1px solid rgba(224, 92, 104, .28); border-radius: 5px; padding: 9px 10px; background: rgba(224, 92, 104, .1); color: #f19aa3; font-size: 12px; }
.session-expired-error[hidden] { display: none; }
.customer-service-widget { position: fixed; z-index: 70; right: 18px; bottom: 18px; }
.customer-service-trigger { width: 68px; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #343941; border-radius: 10px; background: #1d2026; color: #c9d0d8; font-size: 13px; cursor: pointer; box-shadow: 0 12px 34px rgba(0,0,0,.38); }
.customer-service-trigger span { font-size: 17px; line-height: 1; }
.customer-service-trigger em { font-style: normal; font-weight: 600; letter-spacing: .02em; }
.customer-service-trigger:hover, .customer-service-trigger[aria-expanded="true"] { border-color: #5c8189; background: #263238; color: #9de5ef; }
.customer-service-panel { position: absolute; right: 0; bottom: 64px; width: min(260px, calc(100vw - 24px)); max-height: calc(100dvh - 108px); display: grid; gap: 12px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #3b424b; border-radius: 8px; background: #181b20; padding: 15px; box-shadow: 0 22px 64px rgba(0,0,0,.62); }
.customer-service-panel[hidden] { display: none; }
.customer-service-panel header { display: flex; justify-content: space-between; align-items: start; }
.customer-service-panel header div { display: grid; gap: 3px; }
.customer-service-panel header span, .customer-service-panel small { color: #78818c; font-size: 10px; }
.customer-service-panel header strong { color: #edf0f3; font-size: 15px; }
.customer-service-panel header button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #272c33; color: #aab2bc; cursor: pointer; }
.customer-service-panel > img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; border-radius: 6px; background: #fff; padding: 7px; }
.customer-service-panel > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
.customer-service-panel > div:last-child small { grid-column: 1 / -1; }
.customer-service-panel > div:last-child strong { overflow: hidden; color: #dce1e6; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.customer-service-panel > div:last-child button { min-height: 30px; border: 1px solid #3d5960; border-radius: 5px; background: #203238; color: #9de4ee; padding: 0 9px; cursor: pointer; }
.customer-service-empty { margin: 0; color: #8a929d; font-size: 12px; line-height: 1.6; }
.recharge-modal { width: min(920px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid #35383f; border-radius: 8px; background: #191b20; padding: 24px; box-shadow: 0 28px 80px rgba(0, 0, 0, .6); }
.recharge-modal header { display: flex; justify-content: space-between; align-items: start; }
.recharge-modal h2 { margin: 5px 0 0; }
.current-credit { display: flex; justify-content: flex-start; align-items: center; gap: 10px; margin: 22px 0 12px; padding: 15px; border: 1px solid #30343c; border-radius: 7px; background: #202329; }
.current-credit > div { display: grid; gap: 4px; min-width: 0; }
.current-credit span { color: #969ca6; }
.current-credit strong { color: #82d9e8; font-size: 20px; }
.current-credit > #openCreditLogs { margin-left: auto; }
.credit-recharge-entry { border-color: #4b8a7a !important; color: #9be6ca !important; }
.credit-log-filters { display: flex; align-items: end; gap: 10px; margin: 16px 0 12px; padding: 10px 12px; border: 1px solid #30343c; border-radius: 7px; background: #202329; }
.credit-log-filters label { display: grid; gap: 4px; color: #969ca6; font-size: 11px; }
.credit-log-filters select { min-width: 128px; border: 1px solid #3a4049; border-radius: 5px; background: #191b20; color: #e8edf0; padding: 7px 9px; font: inherit; }
.credit-log-count { margin-left: auto; color: #78818c; font-size: 11px; }
.credit-logs-modal { width: min(980px, 100%); }
.composer-retention-hint, .agent-retention-hint { color: #66717d; font-size: 10px; white-space: nowrap; }
@media (max-width: 640px) { .credit-log-filters { align-items: stretch; flex-wrap: wrap; } .credit-log-filters label { flex: 1 1 130px; } .credit-log-count { width: 100%; margin-left: 0; } .current-credit { flex-wrap: wrap; } .current-credit > #openCreditLogs { margin-left: 0; } .composer-retention-hint { display: none; } }
.recharge-modal > p { color: #858c97; font-size: 13px; }
.recharge-agent-benefits { display: grid; gap: 4px; margin-top: 14px; padding: 11px 13px; border: 1px solid rgba(110, 201, 219, .28); border-radius: 7px; background: rgba(110, 201, 219, .07); color: #b8c7cf; font-size: 12px; line-height: 1.55; }
.recharge-agent-benefits strong { color: #8ce3c7; font-size: 13px; }
.recharge-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.recharge-option { position: relative; min-width: 0; min-height: 178px; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 7px; border: 1px solid #343840; border-radius: 7px; background: #202228; color: #eef1f4; padding: 20px 10px 14px; cursor: pointer; text-align: center; }
.recharge-option:hover, .recharge-option.recommended { border-color: #6ec9db; background: #202a2d; }
.recharge-option .recharge-amount { color: #f5f7f9; font-size: 28px; font-weight: 750; line-height: 1; }
.recharge-option .recharge-amount small { color: inherit; font-size: 13px; }
.recharge-option strong { color: #8ce3c7; font-size: 13px; }
.recharge-option span { color: #a6adb6; font-size: 11px; }
.recharge-option > b { color: #9ce7f0; font-size: 11px; font-weight: 650; line-height: 1.4; }
.recharge-option > small { color: #747d88; font-size: 10px; line-height: 1.4; }
.recharge-option.with-pass { background: #1d282c; }
.recharge-option i { position: absolute; top: -1px; right: -1px; padding: 3px 6px; border-radius: 0 7px 0 6px; background: #6ec9db; color: #11151a; font-size: 9px; font-style: normal; }
.recharge-note { display: block; margin-top: 12px; color: #66707b; font-size: 10px; }
.credit-recharge-modal { width: min(880px, 100%); }
.credit-recharge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.credit-recharge-custom { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid #30343c; border-radius: 7px; background: #202329; }
.credit-recharge-custom label { display: grid; gap: 6px; color: #969ca6; font-size: 12px; }
.credit-recharge-custom input { border: 1px solid #3a4049; border-radius: 5px; background: #191b20; color: #e8edf0; padding: 9px 10px; font: inherit; }
.credit-recharge-quote { color: #8ce3c7; font-size: 12px; }
.credit-recharge-custom .primary-button { width: min(220px, 100%); justify-self: start; }
@media (max-width: 760px) { .credit-recharge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.composer-price.pass-active, .pass-label { color: #83dec3 !important; }
.image-pass-panel { border-top-color: #4b8a7a; background: #16221f; }
.image-pass-panel > p { margin: 0; color: #8faaa2; font-size: 12px; }
.toast { position: fixed; z-index: 120; top: 24px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border: 1px solid #385048; border-radius: 7px; background: #17231f; color: #8de1c3; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.generation-completion-toast { position: fixed; z-index: 140; right: 20px; bottom: 86px; width: min(380px, calc(100vw - 24px)); display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "icon copy action" "icon copy close"; align-items: center; gap: 3px 10px; border: 1px solid rgba(102, 211, 180, .44); border-radius: 8px; background: #17231f; color: #e9f7f2; padding: 12px 12px 12px 13px; box-shadow: 0 18px 54px rgba(0, 0, 0, .58); animation: generationCompletionToastIn .18s ease-out; }
.generation-completion-icon { grid-area: icon; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(97, 210, 174, .15); color: #83dfbe; }
.generation-completion-icon .ui-icon { width: 16px; height: 16px; }
.generation-completion-copy { grid-area: copy; min-width: 0; display: grid; gap: 3px; }
.generation-completion-copy strong { color: #eaf8f3; font-size: 13px; font-weight: 650; }
.generation-completion-copy small { color: #8fa69e; font-size: 11px; line-height: 1.35; }
.generation-completion-action { grid-area: action; align-self: center; min-height: 32px; border: 1px solid rgba(113, 218, 187, .48); border-radius: 6px; background: #21362f; color: #9be6ca; padding: 0 11px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.generation-completion-action:hover { border-color: #78dfbd; background: #29443b; color: #e8fff7; }
.generation-completion-close { grid-area: close; justify-self: end; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #778b84; cursor: pointer; }
.generation-completion-close:hover { background: rgba(255, 255, 255, .06); color: #d9e7e2; }
.generation-completion-close .ui-icon { width: 13px; height: 13px; }
@keyframes generationCompletionToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 700px) {
  .generation-completion-toast {
    top: 76px;
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
  }
}

/* Admin */
.admin-body { min-height: 100vh; color: #e9edf5; background: #0e1118; }
.admin-body .shell { max-width: 1180px; margin: auto; padding: 0 24px; }
.admin-body .topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #29314a; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #70cddd; color: #101419; }
.account-area, .actions { display: flex; gap: 10px; align-items: center; }
.admin-body .main { padding: 32px 0 70px; }
.admin-body .hero { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.admin-body .hero h1 { margin: 8px 0 0; font-size: 36px; }
.admin-body .hero p { max-width: 720px; color: #9da7bc; }
.eyebrow { color: #72d1df; font-size: 11px; letter-spacing: 1.4px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat, .panel { border: 1px solid #293452; border-radius: 8px; background: #151b28; padding: 20px; }
.stat strong { display: block; font-size: 26px; }
.stat span, .muted { color: #8f9ab7; font-size: 12px; }
.panel h2 { margin: 0 0 18px; font-size: 17px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { color: #aeb8ce; font-size: 13px; }
.field input, .field textarea { width: 100%; border: 1px solid #303b5d; border-radius: 7px; outline: none; background: #0c1222; color: #eef2ff; padding: 12px; }
.btn { border: 0; border-radius: 7px; padding: 10px 14px; background: #72cddd; color: #101419; font-weight: 700; cursor: pointer; }
.btn.secondary { background: #202a45; color: #dfe5f8; }
.btn.ghost { border: 1px solid #394767; background: transparent; color: #c7d1e7; }
.btn.danger { background: #a33b51; color: #fff; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid #27324c; text-align: left; white-space: nowrap; }
.data-table th { color: #8f9ab7; font-weight: 500; }
.admin-body .auth-wrap { max-width: 420px; margin: 70px auto; }
.admin-body .auth-tabs { margin: 22px 0 18px; }

@media (max-width: 1100px) {
  .auth-landing-header { gap: var(--space-3); padding: 0 28px; height: 156px; }
  .auth-landing-brand img { width: 112px; }
  .auth-landing-nav button { padding: 0 var(--space-3); }
  .auth-landing-copy { width: min(700px, calc(100% - 220px)); }
  .auth-thumbnail-rail { right: 24px; }
  .auth-landing-command { width: min(680px, calc(100% - 220px)); }
  .auth-modal-backdrop { padding: var(--space-6); }
  .auth-modal { width: calc(100vw - 48px); }
  .auth-login-card { padding-right: 38px; padding-left: 38px; }
  .studio-shell { grid-template-columns: 70px 240px minmax(0, 1fr); }
  .studio-shell.view-inspire { grid-template-columns: 70px 0 minmax(0, 1fr); }
  .workspace-toolbar .toolbar-filter { display: none; }
  .prompt-composer { width: calc(100% - 34px); }
  .desktop-option { display: none; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspiration-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .mobile-brand { display: flex; }
  .studio-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .studio-shell.view-inspire { grid-template-columns: 64px minmax(0, 1fr); }
  .conversation-sidebar { display: none; }
  .workspace-toolbar { left: 14px; right: 14px; justify-content: flex-end; }
  .search-box { margin-right: auto; width: min(200px, 45vw); }
  .toolbar-assets { display: none; }
  .toolbar-select select { max-width: 82px; }
  .creative-stage { padding: 92px 20px 232px; }
  .generation-results { margin-left: 0; }
  .task-prompt-full { width: min(720px, calc(100vw - 112px)); }
  .generation-spec-panel { width: calc(100% - 20px); padding: 18px; }
  .prompt-composer { bottom: 14px; width: calc(100% - 24px); min-height: 154px; border-radius: 18px; }
  .composer-main { min-height: 92px; padding: 18px 17px 5px; }
  .prompt-rich-editor { height: 64px; }
  .composer-submit > span { display: none; }
  .asset-stage { padding: 94px 20px 40px; }
  .asset-library-header { align-items: stretch; flex-direction: column; gap: 10px; }
  .asset-library-header nav { gap: 12px; }
  .asset-header-actions label { width: 100%; }
  .asset-filter-bar { align-items: stretch; flex-direction: column; gap: 4px; padding-bottom: 8px; }
  .asset-filter-bar > div { width: 100%; }
  .asset-category-tabs { padding-left: 0; border-left: 0; }
  .asset-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .profile-stage { padding: 94px 20px 40px; }
  .home-hero { min-height: 480px; height: min(600px, calc(100vh - 120px)); }
  .home-hero-copy { width: calc(100% - 42px); }
  .home-hero-copy h1 { font-size: 42px; }
  .home-section { width: calc(100% - 40px); padding: 42px 0; }
  .home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-feature-card:last-child { grid-column: 1 / -1; }
  .inspiration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-metrics { grid-template-columns: repeat(2, 1fr); }
  .recharge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .invite-code-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .inspiration-top-nav { width: calc(100% - 28px); gap: 12px; overflow-x: auto; }
  .inspiration-top-nav nav { gap: 14px; }
  .inspiration-top-nav > label { order: 3; flex: 1 0 150px; width: auto; margin-left: 0; }
  .inspiration-published-link { order: 2; }
  .inspiration-banner { width: calc(100% - 28px); height: 230px; margin-top: 14px; }
  .publication-viewer-bar { align-items: flex-end; flex-direction: column; gap: 6px; padding-top: 34px; }
  .publication-viewer-author { align-self: flex-start; }
  .publication-viewer-actions { align-self: flex-end; }
  .inspiration-detail-view { grid-template-columns: 1fr; grid-template-rows: minmax(52vh, 1fr) auto; overflow-y: auto; }
  .publication-detail-panel { border-top: 1px solid #242930; border-left: 0; padding: 20px 16px 28px; }
  .publication-detail-media { max-width: calc(100% - 48px); max-height: calc(100% - 30px); }
  .studio-shell { grid-template-columns: 1fr; }
  .studio-shell.view-inspire { grid-template-columns: 1fr; }
  .tool-rail { display: none; }
  .workspace-toolbar { min-height: 44px; top: 10px; }
  .search-box { width: calc(100% - 132px); }
  .toolbar-filter { display: none; }
  .toolbar-select:last-of-type { display: none; }
  .account-pill span { display: none; }
  .creative-stage { padding: 74px 12px 220px; }
  .empty-stage { min-height: 300px; }
  .empty-stage h1 { font-size: 23px; }
  .prompt-suggestions button:nth-child(3) { display: none; }
  .generation-meta { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .prompt-avatar { width: 38px; height: 38px; }
  .task-status { grid-column: 2; justify-self: start; }
  .task-prompt-full { position: fixed; top: 70px; left: 12px; width: calc(100vw - 24px); max-height: 50vh; }
  .result-media-tools { opacity: 1; transform: none; }
  .generation-primary-actions > button { padding: 0 10px; }
  .generation-spec-chip { min-width: 148px; }
  .generation-spec-panel { bottom: 68px; max-height: 62vh; padding: 14px; }
  .spec-ratio-grid { grid-template-columns: repeat(3, 1fr); }
  .prompt-composer { min-height: 148px; border-radius: 16px; }
  .composer-toolbar { padding: 6px 10px 10px; }
  .customer-service-widget { right: 12px; bottom: 184px; }
  .option-chip, .select-chip.desktop-option { display: none; }
  .mode-switch button { padding: 0 9px; font-size: 12px; }
  .send-button { width: 43px; height: 43px; }
  .generation-results.count-2, .generation-results.count-3, .generation-results.count-4 { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(220px, 72vw); overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  .generation-result-card { scroll-snap-align: start; }
  .reference-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .reference-library-filters { align-items: stretch; flex-direction: column; padding: 10px 14px; }
  .reference-library-filters > div { overflow-x: auto; }
  .frame-upload-grid { grid-template-columns: 1fr 1fr; padding-left: 16px; padding-right: 16px; }
  .asset-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .inline-reference-chip { max-width: 150px; }
  .asset-library-header nav button { font-size: 14px; }
  .asset-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-gallery-meta { grid-template-columns: 1fr; }
  .asset-gallery-meta strong, .asset-gallery-meta small { grid-column: 1; }
  .save-asset-modal footer { align-items: stretch; flex-direction: column; }
  .asset-item > div { padding: 9px; }
  .section-heading { display: block; }
  .section-heading > strong { display: block; margin-top: 10px; }
  .recharge-modal { padding: 18px; }
  .recharge-grid { grid-template-columns: 1fr 1fr; }
  .recharge-option { min-height: 150px; }
  .home-hero { min-height: 430px; height: calc(100vh - 100px); }
  .home-hero-copy { width: calc(100% - 28px); padding-top: 0; }
  .home-hero-copy h1 { font-size: 32px; }
  .home-hero-copy p { font-size: 14px; }
  .home-section { width: calc(100% - 24px); padding: 34px 0; }
  .home-section > header { align-items: start; flex-direction: column; }
  .home-feature-grid, .home-model-grid { grid-template-columns: 1fr; }
  .home-feature-card:last-child { grid-column: auto; }
  .inspiration-filter-bar { align-items: stretch; flex-direction: column; border-bottom: 0; }
  .inspiration-filter-bar > div { min-height: 44px; border-bottom: 1px solid #292d34; }
  .inspiration-filter-bar label { width: 100%; }
  .inspiration-grid { grid-template-columns: 1fr; }
  .profile-header { grid-template-columns: auto minmax(0, 1fr); }
  .profile-header > button { grid-column: 1 / -1; justify-self: start; }
  .profile-publication-list > article { grid-template-columns: 72px minmax(0, 1fr); }
  .profile-publication-list > article > button:first-child { width: 72px; }
  .profile-publication-list > article > .subtle-button { grid-column: 2; justify-self: start; }
  .profile-editor form { grid-template-columns: 1fr; }
  .profile-editor form footer { grid-column: 1; justify-content: stretch; }
  .profile-editor form footer button { width: 100%; }
  .agent-management > header { align-items: flex-start; flex-direction: column; }
  .agent-child-form { grid-template-columns: 1fr; }
  .agent-child-form button { width: 100%; }
  .agent-profit form { grid-template-columns: 1fr; }
  .publish-modal footer { align-items: stretch; flex-direction: column; }
  .publish-access-switch, .agent-code-form { grid-template-columns: 1fr; }
  .admin-body .shell { padding: 0 12px; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .client-body .prompt-composer.expanded:not(.maximized) { min-height: 320px; }
  .client-body .prompt-composer.expanded:not(.maximized) .composer-main { min-height: 250px; }
  .client-body .prompt-composer.expanded:not(.maximized) .prompt-rich-editor { height: 200px; }
}

/* Unified design system application: shared tokens keep legacy screens and
   the admin console visually aligned without changing their data flow. */
:where(.client-body, .admin-body) {
  color: var(--color-text);
  background: var(--color-bg);
}
:where(.client-body, .admin-body) button,
:where(.client-body, .admin-body) input,
:where(.client-body, .admin-body) textarea,
:where(.client-body, .admin-body) select { font-size: var(--font-body); }
:where(.client-body, .admin-body) :is(input, textarea, select):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-brand) 55%, transparent);
  outline-offset: 1px;
}
.client-body .studio-shell { background: var(--color-bg); }
.client-body .tool-rail,
.client-body .conversation-sidebar { background: var(--color-bg-raised); border-color: var(--color-border); }
.client-body .tool-rail .active,
.client-body .tool-rail button[aria-current="page"] { color: var(--color-brand); }
.client-body .prompt-composer,
.client-body .generation-item,
.client-body .asset-gallery,
.client-body .inspiration-card,
.admin-body .admin-card,
.admin-body .model-admin-card { border-color: var(--color-border); box-shadow: var(--shadow-sm); }
.client-body .prompt-composer { background: var(--color-surface); border-radius: var(--radius-xl); }
.client-body .composer-toolbar,
.client-body .generation-meta,
.client-body .task-status,
.client-body .task-failure-compact { min-height: 40px; }
.client-body .generation-item { min-height: 180px; }
.client-body .generation-output,
.client-body .asset-gallery-media,
.client-body .inspiration-media { aspect-ratio: 16 / 9; background: var(--color-bg-raised); }
.client-body .generation-output img,
.client-body .generation-output video,
.client-body .asset-gallery-media img,
.client-body .asset-gallery-media video,
.client-body .inspiration-media img,
.client-body .inspiration-media video { object-fit: cover; }
.client-body .media-viewer-backdrop { background: rgba(3, 4, 6, .9); }
.client-body .floating-media-viewer { border-radius: 0; box-shadow: none; }
.client-body .floating-media-viewer .media-viewer-stage { border-radius: var(--radius-base); }
.client-body .viewer-icon,
.client-body .media-viewer footer button,
.client-body .result-media-tools button { min-width: 36px; min-height: 36px; border-radius: var(--radius-sm); }
.client-body .reference-hover-preview,
.client-body .global-thumbnail-preview,
.client-body .video-enhance-modal,
.client-body .enhancement-compare-modal,
.client-body .profile-modal,
.client-body .publish-modal,
.client-body .comments-modal,
.client-body .reference-library-modal,
.client-body .announcement-modal { border-color: var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.client-body .reference-hover-preview,
.client-body .global-thumbnail-preview { background: var(--color-surface); }
.client-body .task-status[data-status="success"], .client-body .status-success { color: var(--color-success); }
.client-body .task-status[data-status="failed"], .client-body .status-failed { color: var(--color-danger); }
.client-body .task-status[data-status="processing"], .client-body .status-processing { color: var(--color-info); }
.client-body .task-status[data-status="generating"], .client-body .status-generating { color: var(--color-brand); }
.client-body .task-status[data-status="warning"], .client-body .status-warning { color: var(--color-warning); }
.client-body .inspiration-grid,
.client-body .asset-gallery-grid { gap: var(--space-4); }
.client-body .inspiration-card { overflow: hidden; border-radius: var(--radius-base); background: var(--color-surface); }
.client-body .inspiration-card .inspiration-media { border-radius: 0; }
.client-body .inspiration-card .inspiration-card-info { padding: var(--space-3) var(--space-4); }
.admin-body .admin-shell,
.admin-body .admin-main { background: var(--color-bg); }
.admin-body .admin-card,
.admin-body .model-admin-card { border-radius: var(--radius-base); background: var(--color-surface); }

@media (max-width: 1279px) {
  .client-body .studio-shell { grid-template-columns: 64px 220px minmax(0, 1fr); }
  .client-body .prompt-composer:not(.compact):not(.maximized),
  .client-body .prompt-composer.expanded:not(.maximized) { width: calc(100% - 32px); }
}
@media (max-width: 767px) {
  .client-body .studio-shell { grid-template-columns: 56px minmax(0, 1fr); }
  .client-body .conversation-sidebar { display: none; }
  .client-body .composer-main { grid-template-columns: 1fr; gap: var(--space-3); padding: var(--space-4); }
  .client-body .composer-toolbar { flex-wrap: wrap; padding: var(--space-2) var(--space-4) var(--space-4); }
  .client-body .composer-options { width: 100%; order: 2; }
  .client-body .composer-submit { margin-left: auto; }
  .client-body .generation-item { min-height: 0; }
  .client-body .generation-results { grid-template-columns: 1fr; }
  .client-body .media-viewer-backdrop { padding: var(--space-2); }
}

/* Final override: model rows must never collapse into one another. */
.client-body .model-picker-menu { height: clamp(300px, 55vh, 460px) !important; }
.client-body .model-picker-scroll { height: 100% !important; min-height: 0 !important; overflow: hidden !important; }
.client-body .model-picker-list { height: 100% !important; min-height: 0 !important; overflow-y: scroll !important; align-content: start !important; gap: 8px !important; }
.client-body .model-picker-option { box-sizing: border-box !important; height: 72px !important; min-height: 72px !important; max-height: 72px !important; overflow: hidden !important; display: grid !important; grid-template-columns: minmax(0, 1fr) auto 16px !important; align-items: center !important; }
.client-body .model-picker-option .model-option-copy { min-height: 0 !important; max-height: 52px !important; overflow: hidden !important; }
.client-body .model-picker-option .model-option-copy small { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

.client-body .model-picker-menu { width: min(720px, calc(100vw - 32px)); }
.client-body .model-picker-option { padding: 7px 9px; gap: 8px; }
.client-body .model-option-copy { gap: 2px; }
.client-body .model-option-copy strong { font-size: 12px; }
.client-body .model-option-copy small { font-size: 10px; }
.client-body .model-option-tags { min-height: 0; }
.client-body .model-option-side > strong { font-size: 12px; }

/* Model options size to their actual content instead of leaving fixed gaps. */
.client-body .model-picker-option { min-height: 0; height: auto; }
.client-body .model-option-tags { justify-content: center; }

/* The model list stays deliberately sparse: six readable rows at a time,
   with explicit controls for mouse, trackpad and touch users. */
.client-body .model-picker-menu { width: min(560px, calc(100vw - 28px)); height: clamp(300px, 55vh, 460px); max-height: calc(100vh - 120px); grid-template-rows: auto minmax(0, 1fr); }
.client-body .model-picker-scroll { position: relative; min-height: 0; height: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.client-body .model-picker-list { grid-column: 2; height: 100%; max-height: none; min-height: 0; padding: 8px 10px; gap: 7px; overflow-y: scroll; scroll-snap-type: y proximity; overscroll-behavior: contain; }
.client-body .model-picker-option { min-height: 70px; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; padding: 9px 10px; scroll-snap-align: start; }
.client-body .model-picker-option .model-option-copy { gap: 3px; }
.client-body .model-picker-option .model-option-side { align-self: center; }
.client-body .model-picker-scroll-button { z-index: 1; grid-column: 1; width: 27px; height: 27px; align-self: center; justify-self: center; border: 1px solid #48515d; border-radius: 50%; background: #252a31; color: #b9c7d5; font: 700 18px/1 system-ui, sans-serif; cursor: pointer; transition: background-color .16s ease, color .16s ease; }
.client-body .model-picker-scroll-button:hover { background: #314354; color: #e6f6ff; }
.client-body .model-picker-scroll-button.up { grid-row: 1; align-self: start; margin-top: 10px; }
.client-body .model-picker-scroll-button.down { grid-row: 1; align-self: end; margin-bottom: 10px; }

@media (max-width: 600px) {
  .client-body .model-picker-scroll { grid-template-columns: 28px minmax(0, 1fr); }
  .client-body .model-picker-scroll-button { width: 23px; height: 23px; font-size: 15px; }
  .client-body .model-picker-menu { height: min(410px, calc(100vh - 105px)); }
  .client-body .model-picker-list { padding-inline: 6px; }
}
.client-body .model-picker-option { display: flex; align-items: center; }
.client-body .model-picker-option .model-option-copy { flex: 1 1 auto; min-width: 0; }
.client-body .model-picker-option .model-option-side { flex: 0 0 auto; }
.client-body .model-picker-option > b { flex: 0 0 16px; align-self: center; }

/* Model options size to their actual content instead of leaving fixed gaps. */
.client-body .model-picker-option { min-height: 0; height: auto; }
.client-body .model-option-tags { justify-content: center; }

/* Studio visual coherence pass: shared interaction and density rules for every client workspace. */
.client-body { scrollbar-color: #3d4752 transparent; }
.client-body ::selection { background: rgba(100, 207, 224, .28); color: #f6fbfc; }
.client-body :focus-visible { outline: 2px solid rgba(112, 211, 227, .82); outline-offset: 2px; }
.client-body button:focus-visible, .client-body a:focus-visible { outline-offset: 3px; }
.client-body .tool-rail { background: #12151a; border-right-color: rgba(187, 200, 214, .12); }
.client-body .rail-button { color: #858f9a; transition: color .16s ease, background-color .16s ease, transform .16s ease; }
.client-body .rail-button:hover { background: #1c2229; color: #dfe8ec; }
.client-body .rail-button.active { background: rgba(101, 197, 214, .1); color: #c7f3f8; }
.client-body .rail-button.active::before { background: #7bd3df; box-shadow: 0 0 12px rgba(123, 211, 223, .38); }
.client-body .workspace-toolbar { border-radius: 8px; }
.client-body input:not([type="checkbox"]):not([type="radio"]),
.client-body textarea,
.client-body select { transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.client-body input:not([type="checkbox"]):not([type="radio"]):focus,
.client-body textarea:focus,
.client-body select:focus { border-color: rgba(115, 211, 227, .7); box-shadow: 0 0 0 3px rgba(91, 194, 211, .11); }
.client-body .subtle-button { border-color: var(--client-line); background: #171b20; color: #bfc8d0; }
.client-body .subtle-button:hover { border-color: rgba(145, 216, 229, .34); background: #20272e; color: #f0f6f8; }
.client-body .home-feature-card,
.client-body .home-model-card,
.client-body .inspiration-card,
.client-body .asset-gallery-item,
.client-body .profile-panel { transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.client-body .home-model-card:hover,
.client-body .inspiration-card:hover { box-shadow: 0 14px 28px rgba(0, 0, 0, .18); }
.client-body .inspiration-copy { padding: 14px; }
.client-body .inspiration-copy > p { color: #aeb8c1; }
.client-body .asset-gallery-item:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, .14); }
.client-body .profile-panel { border: 1px solid var(--client-line); border-top-color: var(--client-line); border-radius: 8px; background: var(--client-panel); }
.client-body .profile-panel:hover { border-color: var(--client-line-strong); }
.client-body .digital-human-panel { border-color: var(--client-line); background: var(--client-panel); }
.client-body .digital-human-panel:hover { border-color: var(--client-line-strong); }
.client-body .digital-human-heading p { color: #9ba7b0; }
.client-body .digital-human-avatar-card,
.client-body .digital-human-scene-card { background: #11161b; }
.client-body .digital-human-asset-grid button { border-color: var(--client-line); }
.client-body .digital-human-asset-grid button:hover { transform: translateY(-1px); }
.client-body .generation-output { transition: border-color .18s ease, box-shadow .18s ease; }
.client-body .generation-output:hover { border-color: rgba(145, 216, 229, .28); box-shadow: 0 16px 36px rgba(0, 0, 0, .22); }
@media (max-width: 600px) {
  .client-body .rail-button.active { background: transparent; }
  .client-body .home-section { width: calc(100% - 28px); padding: 34px 0; }
  .client-body .home-feature-card, .client-body .home-model-card { min-height: 108px; padding: 14px; }
  .client-body .inspiration-copy { padding: 12px; }
  .client-body .profile-header, .client-body .profile-panel { border-radius: 7px; }
}

/* Digital human studio: shares the task pipeline with video generation, with a dedicated creation layout. */
.digital-human-stage { width: min(1320px, calc(100% - 52px)); min-height: 100%; margin: 0 auto; padding: 42px 0 180px; color: #e6e9ed; }
.client-body .digital-human-stage { box-sizing: border-box; width: min(1320px, calc(100% - 68px)); margin-inline: auto; }
.client-body .digital-human-workspace { width: 100%; margin-inline: auto; }
.digital-human-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.digital-human-heading > div:first-child { min-width: 0; }
.digital-human-heading span { color: #7fcae8; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.digital-human-heading h1 { margin: 8px 0; font-size: 30px; line-height: 1.1; letter-spacing: 0; }
.digital-human-heading p { max-width: 620px; margin: 0; color: #99a2ad; font-size: 14px; line-height: 1.65; }
.digital-human-price { flex: 0 0 auto; min-width: 160px; border-left: 1px solid #3b424c; padding-left: 20px; }
.digital-human-price small { display: block; color: #89939e; font-size: 11px; }
.digital-human-price strong { display: block; margin-top: 5px; color: #8ddcf0; font-size: 19px; }
.digital-human-price s { display: block; margin-top: 4px; color: #69737d; font-size: 11px; }
.digital-human-workspace { display: grid; grid-template-columns: minmax(245px, .85fr) minmax(360px, 1.4fr) minmax(250px, .9fr); gap: 16px; align-items: stretch; }
.digital-human-panel { min-width: 0; border: 1px solid #353c46; border-radius: 7px; background: #1b1f25; padding: 18px; box-shadow: 0 12px 28px rgba(0, 0, 0, .16); }
.digital-human-panel > header { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.digital-human-panel > header > span { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid #457382; border-radius: 5px; color: #91dff0; font-size: 10px; font-weight: 700; }
.digital-human-panel header strong, .digital-human-panel label > span { display: block; color: #e3e8ed; font-size: 14px; }
.digital-human-panel header small { display: block; margin-top: 3px; color: #87929d; font-size: 11px; line-height: 1.4; }
.digital-human-avatar-card { width: 100%; min-height: 212px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #4c5764; border-radius: 6px; background: #15191e; color: #dfe6eb; cursor: pointer; }
.digital-human-avatar-card:hover { border-color: #70c9de; background: #192128; }
.digital-human-avatar-card > img { width: 100%; height: 210px; object-fit: cover; }
.digital-human-avatar-card > span { width: 100%; padding: 10px 12px; background: #20262d; text-align: left; }
.digital-human-avatar-card > span strong, .digital-human-avatar-card > span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.digital-human-avatar-card > span strong { font-size: 12px; }
.digital-human-avatar-card > span small { margin-top: 3px; color: #8da1ac; font-size: 10px; }
.digital-human-avatar-empty { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #5c7180; border-radius: 50%; color: #9ae0ef; font-size: 26px; font-weight: 300; }
.digital-human-avatar-card > .digital-human-avatar-empty + strong { margin-top: -62px; font-size: 13px; }
.digital-human-avatar-card > .digital-human-avatar-empty + strong + small { margin-top: -45px; color: #84919b; font-size: 11px; }
.digital-human-asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.digital-human-reference-target { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.digital-human-reference-target button { min-height: 32px; border: 1px solid #3c4752; border-radius: 5px; background: #15191e; color: #aab5bf; font: inherit; font-size: 11px; cursor: pointer; }
.digital-human-reference-target button:hover, .digital-human-reference-target button.active { border-color: #5fc7de; background: #193039; color: #c9f0f6; }
.digital-human-scene-card { width: 100%; min-height: 104px; display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: stretch; overflow: hidden; margin-top: 9px; border: 1px dashed #4c5764; border-radius: 6px; background: #15191e; color: #dfe6eb; padding: 0; text-align: left; cursor: pointer; }
.digital-human-scene-card:hover, .digital-human-scene-card.selected { border-color: #70c9de; background: #192128; }
.digital-human-scene-card img { width: 104px; height: 104px; object-fit: cover; }
.digital-human-scene-card > span { align-self: center; min-width: 0; padding: 12px; }
.digital-human-scene-card > span strong, .digital-human-scene-card > span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.digital-human-scene-card > span strong { font-size: 12px; }
.digital-human-scene-card > span small { margin-top: 4px; color: #8da1ac; font-size: 10px; }
.digital-human-scene-card .digital-human-avatar-empty { width: 32px; height: 32px; margin: auto 10px auto 14px; font-size: 20px; }
.digital-human-scene-card > .digital-human-avatar-empty + strong { margin-left: -44px; align-self: end; padding-bottom: 47px; font-size: 12px; }
.digital-human-scene-card > .digital-human-avatar-empty + strong + small { margin-left: -44px; align-self: end; padding-bottom: 28px; color: #84919b; font-size: 10px; }
.digital-human-asset-grid button { aspect-ratio: 1; overflow: hidden; border: 1px solid #343d47; border-radius: 5px; background: #12161a; padding: 0; cursor: pointer; }
.digital-human-asset-grid button:hover, .digital-human-asset-grid button.selected { border-color: #74d4e9; box-shadow: 0 0 0 1px rgba(116, 212, 233, .22); }
.digital-human-asset-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.digital-human-asset-empty { grid-column: 1 / -1; margin: 4px 0; color: #7f8a94; font-size: 12px; line-height: 1.5; }
.digital-human-panel textarea { box-sizing: border-box; width: 100%; min-height: 245px; resize: vertical; border: 1px solid #3a434e; border-radius: 6px; outline: none; background: #14181d; color: #e8edf0; padding: 14px; font: inherit; font-size: 14px; line-height: 1.7; }
.digital-human-panel textarea:focus { border-color: #68c9df; box-shadow: 0 0 0 2px rgba(69, 175, 199, .14); }
.digital-human-script-meta { display: flex; justify-content: space-between; gap: 12px; margin: 7px 1px 16px; color: #818b95; font-size: 11px; }
.digital-human-script-meta strong { color: #b8c4cc; font-weight: 500; }
.digital-human-voice { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 11px; }
.digital-human-panel select { width: 100%; height: 38px; border: 1px solid #3b444f; border-radius: 6px; outline: none; background: #15191e; color: #e1e7eb; padding: 0 10px; font: inherit; font-size: 12px; }
.digital-human-panel select:focus { border-color: #71cde2; }
.digital-human-submit { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 11px; margin-top: 19px; border: 0; border-radius: 6px; background: #54c1d8; color: #092126; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.digital-human-submit:hover { background: #76d4e6; }
.digital-human-submit:disabled { opacity: .62; cursor: wait; }
.digital-human-submit span { font-size: 19px; line-height: 1; }
.digital-human-panel.settings-panel { display: flex; flex-direction: column; }
.digital-human-panel.settings-panel > label { display: grid; gap: 7px; margin-bottom: 15px; color: #aeb7c0; font-size: 11px; }
.digital-human-panel.settings-panel label > select { font-size: 12px; }
.digital-human-unavailable { display: block; border: 1px solid #725931; border-radius: 5px; background: rgba(113, 84, 33, .13); color: #e2bd70; padding: 9px; line-height: 1.5; }
.digital-human-model-note { margin-top: auto; border-top: 1px solid #303740; padding-top: 14px; }
.digital-human-model-note strong { color: #cbd4db; font-size: 12px; }
.digital-human-model-note p { margin: 6px 0 0; color: #7e8993; font-size: 11px; line-height: 1.55; }
.digital-human-empty { width: min(520px, 100%); margin: 80px auto; border: 1px solid #3b424a; border-radius: 7px; background: #1b1f25; padding: 32px; text-align: center; }
.digital-human-empty strong { color: #e4ebef; }
.digital-human-empty p { color: #8b96a0; font-size: 13px; }
.video-enhancer-stage { width: min(1120px, calc(100% - 52px)); min-height: 100%; margin: 0 auto; padding: 42px 0 100px; color: #e6e9ed; }
.video-enhancer-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 28px; }.video-enhancer-heading span { color: #8ddcf0; font-size: 11px; font-weight: 700; }.video-enhancer-heading h1 { margin: 8px 0; font-size: 30px; }.video-enhancer-heading p { max-width: 620px; margin: 0; color: #97a1ac; font-size: 14px; line-height: 1.65; }.video-enhancer-price { min-width: 160px; border-left: 1px solid #3b424c; padding-left: 20px; }.video-enhancer-price small,.video-enhancer-cost small { display: block; color: #84909b; font-size: 11px; }.video-enhancer-price strong { display: block; margin-top: 5px; color: #8ddcf0; font-size: 18px; }
.video-enhancer-workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; }.video-enhancer-panel { min-width: 0; border: 1px solid #353c46; border-radius: 7px; background: #1b1f25; padding: 18px; }.video-enhancer-panel > header { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }.video-enhancer-panel > header > span { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid #457382; border-radius: 5px; color: #91dff0; font-size: 10px; font-weight: 700; }.video-enhancer-panel header strong { display:block; color:#e3e8ed; font-size:14px; }.video-enhancer-panel header small { display:block; margin-top:3px; color:#87929d; font-size:11px; }
.video-enhancer-dropzone { min-height: 310px; width: 100%; display: grid; place-items: center; align-content: center; gap: 9px; overflow: hidden; border: 1px dashed #4c5764; border-radius: 6px; background: #14181d; color: #dfe6eb; cursor: pointer; }.video-enhancer-dropzone:hover { border-color: #70c9de; background: #192128; }.video-enhancer-dropzone > i { display:grid; width:40px; height:40px; place-items:center; border:1px solid #5c7180; border-radius:50%; color:#9ae0ef; font-size:26px; font-style:normal; }.video-enhancer-dropzone > small { color:#84919b; font-size:11px; }.video-enhancer-dropzone.has-video { grid-template-columns: 1fr; align-content: stretch; place-items: stretch; }.video-enhancer-dropzone video { width:100%; height:255px; background:#080a0d; object-fit:contain; pointer-events:none; }.video-enhancer-dropzone.has-video > span { padding:12px 14px; background:#20262d; text-align:left; }.video-enhancer-dropzone.has-video strong,.video-enhancer-dropzone.has-video small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.video-enhancer-dropzone.has-video small { margin-top:4px; color:#8da1ac; font-size:11px; }
.video-enhancer-settings { display:flex; flex-direction:column; }.video-enhancer-resolution > span,.video-enhancer-cost > span { display:block; margin-bottom:10px; color:#aeb7c0; font-size:12px; }.video-enhancer-resolution > div { display:flex; gap:8px; }.video-enhancer-resolution button { min-width:64px; height:38px; border:1px solid #3b444f; border-radius:6px; background:#15191e; color:#c8d0d7; font:inherit; cursor:pointer; }.video-enhancer-resolution button.active { border-color:#5fc7de; background:#193039; color:#c9f0f6; }.video-enhancer-cost { margin-top:24px; padding:15px; border:1px solid #303a43; border-radius:6px; background:#15191e; }.video-enhancer-cost strong { display:block; margin:4px 0; color:#8ddcf0; font-size:22px; }.video-enhancer-submit { width:100%; min-height:46px; margin-top:auto; border:0; border-radius:6px; background:#54c1d8; color:#092126; font:inherit; font-size:14px; font-weight:700; cursor:pointer; }.video-enhancer-submit:disabled { opacity:.5; cursor:not-allowed; }
.video-enhancer-history { margin-top:28px; }.video-enhancer-history > header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }.video-enhancer-history h2 { margin:0; font-size:16px; }.video-enhancer-history > header span { color:#7f8a94; font-size:12px; }.video-enhancer-history > div { display:grid; gap:8px; }.video-enhancer-task { display:grid; grid-template-columns:90px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:72px; border:1px solid #303740; border-radius:6px; background:#171b20; padding:7px; }.video-enhancer-task > div { height:56px; overflow:hidden; border-radius:4px; background:#0b0d10; }.video-enhancer-task video { width:100%; height:100%; object-fit:cover; }.video-enhancer-task-placeholder { display:grid; height:100%; place-items:center; color:#8ddcf0; }.video-enhancer-task section { min-width:0; }.video-enhancer-task strong,.video-enhancer-task small,.video-enhancer-task b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.video-enhancer-task small { margin-top:5px; color:#89939e; font-size:11px; }.video-enhancer-task b { margin-top:5px; color:#77d4a3; font-size:11px; }.video-enhancer-task b.processing { color:#e4bb6d; }.video-enhancer-task b.failed { color:#ec8d92; }.video-enhancer-task a { border:1px solid #3c4752; border-radius:5px; color:#c8dbe0; padding:8px 10px; text-decoration:none; font-size:12px; }.video-enhancer-empty { border:1px dashed #3c4752; border-radius:6px; color:#85909a; padding:28px; text-align:center; font-size:13px; }
@media (max-width: 760px) { .video-enhancer-stage { width:calc(100% - 28px); padding-top:25px; }.video-enhancer-heading { align-items:flex-start; flex-direction:column; gap:14px; }.video-enhancer-price { border-left:0; border-top:1px solid #3b424c; padding:12px 0 0; }.video-enhancer-workspace { grid-template-columns:1fr; }.video-enhancer-dropzone { min-height:220px; }.video-enhancer-dropzone video { height:175px; } }
@media (max-width: 1100px) { .digital-human-workspace { grid-template-columns: minmax(250px, .9fr) minmax(350px, 1.3fr); } .digital-human-panel.settings-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } .digital-human-panel.settings-panel > header, .digital-human-model-note { grid-column: 1 / -1; } .digital-human-panel.settings-panel > label { margin: 0; } }
@media (max-width: 700px) { .digital-human-stage { width: calc(100% - 28px); padding-top: 25px; } .digital-human-heading { align-items: flex-start; flex-direction: column; gap: 14px; } .digital-human-heading h1 { font-size: 25px; } .digital-human-price { border-left: 0; border-top: 1px solid #3b424c; padding: 12px 0 0; } .digital-human-workspace { grid-template-columns: 1fr; } .digital-human-panel.settings-panel { display: block; } .digital-human-panel.settings-panel > label { margin-bottom: 15px; } .digital-human-avatar-card { min-height: 180px; } .digital-human-avatar-card > img { height: 180px; } .digital-human-panel textarea { min-height: 190px; } }

/* Operations console */
.admin-body { min-width: 1080px; background: #f4f6f8; color: #1d2735; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; display: flex; flex-direction: column; padding: 0 14px 18px; background: #111a26; color: #d7dfeb; }
.admin-brand { height: 74px; display: flex; align-items: center; gap: 11px; padding: 0 10px; border-bottom: 1px solid #25303e; }
.admin-brand > span, .admin-login-brand > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #65ccdc; color: #10202a; }
.admin-brand div, .admin-login-brand div { display: grid; }
.admin-brand small, .admin-login-brand small { color: #7f8b9a; font-size: 10px; }
.admin-sidebar nav { display: grid; gap: 4px; margin-top: 22px; }
.admin-sidebar nav button { height: 43px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 6px; background: transparent; color: #99a6b5; padding: 0 13px; cursor: pointer; text-align: left; }
.admin-sidebar nav button i { width: 20px; color: #7c8998; font-style: normal; font-size: 18px; text-align: center; }
.admin-sidebar nav button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar nav button:hover { background: #1b2735; color: #fff; }
.admin-sidebar nav button.active { background: #203444; color: #eaf9fb; }
.admin-sidebar nav button.active i { color: #73d3df; }
.admin-sidebar-bottom { display: grid; gap: 4px; margin-top: auto; }
.admin-sidebar-bottom a, .admin-sidebar-bottom button { height: 40px; display: flex; align-items: center; border: 0; border-radius: 6px; background: transparent; color: #8491a1; padding: 0 12px; text-decoration: none; cursor: pointer; }
.admin-sidebar-bottom i { width: 20px; flex: 0 0 auto; font-style: normal; }
.admin-sidebar-bottom a:hover, .admin-sidebar-bottom button:hover { background: #1b2735; color: #fff; }
.admin-content { grid-column: 2; min-width: 0; }
.admin-topbar { position: sticky; z-index: 10; top: 0; height: 74px; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; border-bottom: 1px solid #dfe3e8; background: rgba(255, 255, 255, .94); color: #202a36; }
.admin-topbar > div { display: grid; gap: 2px; }
.admin-topbar small, .admin-topbar > span { color: #8a94a1; font-size: 11px; }
.admin-topbar-actions { display: flex; align-items: center; gap: 14px; }
#adminDesktopNotify { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; border: 1px solid #c9d5de; border-radius: 6px; background: #fff; color: #29465b; font-size: 12px; font-weight: 700; padding: 0 10px; cursor: pointer; }
#adminDesktopNotify i { font-style: normal; font-size: 13px; }
#adminDesktopNotify.granted { border-color: rgba(22, 132, 98, .35); background: rgba(15, 118, 110, .08); color: #116052; }
#adminDesktopNotify.denied { border-color: rgba(220, 38, 38, .35); background: rgba(220, 38, 38, .07); color: #991b1b; }
.admin-page { padding: 20px 18px 28px; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.admin-heading h1 { margin: 0 0 5px; font-size: 24px; }
.admin-heading p { margin: 0; color: #7c8795; font-size: 13px; }
.admin-workspace-tabs { width: fit-content; display: inline-flex; align-items: center; gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid var(--admin-border, #dce1e7); border-radius: 8px; background: var(--admin-surface-raised, #f3f6f8); }
.admin-workspace-tabs button { min-height: 34px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--admin-text-muted, #536173); padding: 0 16px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.admin-workspace-tabs button:hover { border-color: var(--admin-border-strong, #cfd6dd); background: var(--admin-surface-hover, #e9edf1); color: var(--admin-text, #253748); }
.admin-workspace-tabs button.active { border-color: var(--brand-border, #9fc7d3); background: var(--admin-info-surface, #e4f1f5); color: var(--admin-accent-strong, #205d68); box-shadow: var(--glow-soft, none); }
.admin-primary { border: 0 !important; background: #152c3b !important; color: #fff !important; }
.admin-heading button, .admin-card button, .model-admin-card button, .admin-modal button { min-height: 34px; border: 1px solid #d8dde3; border-radius: 6px; background: #fff; color: #425063; padding: 0 11px; cursor: pointer; }
.admin-heading button:hover, .admin-card button:hover, .model-admin-card button:hover { border-color: #82909f; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-grid.economics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-heading-actions { display: flex; align-items: center; gap: 10px; }
.admin-spaced-card { margin-top: 18px; }
.metric-grid article { min-width: 0; display: grid; gap: 7px; padding: 18px; border: 1px solid #e0e4e9; border-radius: 7px; background: #fff; }
.metric-grid article > span { color: #7d8794; font-size: 12px; }
.metric-grid article strong { color: #172231; font-size: 29px; }
.metric-grid article small { overflow: hidden; color: #9ca5b1; text-overflow: ellipsis; white-space: nowrap; }
.metric-grid article.actual-profit { border-color: #9bcdbb; background: #f2faf7; }
.metric-grid article.actual-profit strong { color: #08785b; }
.metric-grid article.actual-profit.profit-entry { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.metric-grid article.actual-profit.profit-entry:hover, .metric-grid article.actual-profit.profit-entry:focus-visible { border-color: #08785b; box-shadow: 0 10px 24px rgba(8, 120, 91, .12); transform: translateY(-2px); outline: none; }
.metric-grid article.actual-profit.profit-entry small { white-space: normal; }
.metric-grid article.metric-entry { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.metric-grid article.metric-entry:hover, .metric-grid article.metric-entry:focus-visible { border-color: #4d8f9a; box-shadow: 0 10px 24px rgba(29, 86, 100, .12); transform: translateY(-2px); outline: none; }
.metric-grid article.metric-entry small:has(button) { display: flex; gap: 7px; overflow: visible; white-space: normal; }
.metric-grid article.metric-entry small button { min-height: 26px; border: 1px solid #cbd6de; border-radius: 5px; background: rgba(255,255,255,.72); color: #426170; padding: 0 8px; cursor: pointer; font: inherit; font-size: 11px; }
.metric-grid article.metric-entry small button:hover { border-color: #4d8f9a; color: #1c6e7d; }
.profit-detail-card { margin-bottom: 20px; }
.profit-filter-bar { display: flex; align-items: end; gap: 8px; }
.profit-filter-bar label { display: grid; gap: 4px; color: #738092; font-size: 10px; font-weight: 700; }
.profit-filter-bar input { height: 31px; border: 1px solid #d8dee5; border-radius: 5px; padding: 0 7px; color: #273446; }
.profit-filter-bar button { min-height: 31px !important; }
.profit-summary { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid #e7eaee; background: #fbfcfd; }
.profit-summary span { display: grid; gap: 3px; min-width: 136px; padding: 12px 16px; border-right: 1px solid #e7eaee; color: #7b8795; font-size: 11px; }
.profit-summary strong { color: #253748; font-size: 14px; }
.profit-summary .final { margin-left: auto; background: #f2faf7; }
.profit-summary .final strong, .profit-positive strong { color: #08785b; }
.profit-negative strong { color: #b42318; }
.profit-summary .internal-cost { background: #fff6e8; }
.profit-summary .internal-cost strong { color: #9a5b09; }
.profit-internal-row td { background: #fffcf5; }
.profit-internal-row .verification-badge.internal { border-color: #e2bd79; background: #ffedca; color: #80500e; }
.profit-detail-table { min-width: 1340px; }
.profit-detail-table td { vertical-align: top; }
.profit-detail-table time, .profit-detail-table td > small { display: block; color: #7c8795; font-size: 10px; }
.profit-detail-table .profit-calculation { min-width: 390px; white-space: normal; }
.profit-detail-table .profit-calculation strong { color: #5c6877; font-weight: 500; }
.admin-card { padding: 0; overflow: hidden; border: 1px solid #dfe3e8; border-radius: 7px; background: #fff; }
.admin-card > header { min-height: 72px; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid #e7eaee; }
.admin-card > header h2 { margin: 0 0 3px; font-size: 15px; }
.admin-card > header p { margin: 0; color: #8b95a2; font-size: 11px; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table-wrap th { background: #f8f9fb; color: #737e8b; font-weight: 600; }
.admin-table-wrap th, .admin-table-wrap td { padding: 12px 14px; border-bottom: 1px solid #ebedf0; text-align: left; white-space: nowrap; }
.admin-table-wrap tbody tr:hover { background: #fafbfc; }
.admin-recharge-table th, .admin-recharge-table td { padding: 12px 8px; }
/* 用户管理列多且带 8 个操作按钮，允许单元格换行，让表格按容器宽度自适应而不是横向溢出。 */
.admin-users-table th { padding: 10px 6px; white-space: nowrap; }
.admin-users-table td { padding: 10px 6px; vertical-align: top; }
.admin-users-table td:nth-child(1),
.admin-users-table td:nth-child(7),
.admin-users-table td:nth-child(8),
.admin-users-table td:nth-child(13) { white-space: normal; }
.admin-users-table .table-actions { flex-wrap: wrap; gap: 4px; }
.admin-users-table .table-actions button { min-height: 28px; padding: 0 6px; font-size: 10.5px; white-space: nowrap; }
.admin-users-table td:nth-child(7) > strong { word-break: keep-all; }
.admin-users-table th:nth-child(13), .admin-users-table td:nth-child(13) { width: 172px; }
.admin-table-wrap td > strong, .admin-table-wrap td > small { display: block; }
.admin-table-wrap td > small { margin-top: 3px; color: #8d97a4; }
.asset-heading { align-items: flex-start; }
.asset-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.asset-metric-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--admin-border, #dfe3e8);
  border-radius: var(--radius-base, 7px);
  background: var(--admin-surface, #fff);
  box-shadow: var(--shadow-depth-card, 0 1px 2px rgba(16, 24, 40, .04));
}
.asset-metric-card > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-metric-card > div > span { color: var(--admin-text-muted, #7d8794); font-size: 11px; font-weight: 700; }
.asset-metric-card > div > em { overflow: hidden; color: var(--admin-text-subtle, #98a2b3); font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.asset-metric-card > strong { overflow: hidden; color: var(--admin-text, #172231); font-size: 23px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.asset-metric-card > small { color: var(--admin-text-muted, #8b95a2); font-size: 10px; line-height: 1.45; }
.asset-metric-card.healthy { border-color: var(--admin-success-border, #9bcdbb); background: linear-gradient(180deg, var(--admin-success-surface, #f2faf7), var(--admin-surface, #fff)); }
.asset-metric-card.healthy > strong { color: var(--admin-success, #08785b); }
.asset-metric-card.warning { border-color: var(--admin-warning-border, #e2bd79); background: linear-gradient(180deg, var(--admin-warning-surface, #fff6e8), var(--admin-surface, #fff)); }
.asset-metric-card.warning > strong { color: var(--admin-warning, #9a5b09); }
.asset-metric-card.danger { border-color: var(--admin-danger-border, #e2abb4); background: linear-gradient(180deg, var(--admin-danger-surface, #fff1f3), var(--admin-surface, #fff)); }
.asset-metric-card.danger > strong { color: var(--admin-danger, #b42318); }
.asset-health-pill { display: inline-flex; min-height: 21px; align-items: center; padding: 0 7px; border: 1px solid var(--admin-border-strong, #d8dde3); border-radius: 999px; background: var(--admin-surface-raised, #f8f9fb); color: var(--admin-text-muted, #667085); font-size: 9px; font-style: normal; font-weight: 700; white-space: nowrap; }
.asset-health-pill.healthy, .asset-health-pill.active { border-color: var(--admin-success-border, #9bcdbb); background: var(--admin-success-surface, #eefaf5); color: var(--admin-success, #08785b); }
.asset-health-pill.warning { border-color: var(--admin-warning-border, #e2bd79); background: var(--admin-warning-surface, #fff6e8); color: var(--admin-warning, #9a5b09); }
.asset-health-pill.danger { border-color: var(--admin-danger-border, #e2abb4); background: var(--admin-danger-surface, #fff1f3); color: var(--admin-danger, #b42318); }
.asset-filter-card, .asset-queue-card, .asset-list-card, .asset-history-card { margin-bottom: 18px; }
.asset-filtered-summary { color: var(--admin-text-muted, #7c8795); font-size: 11px; white-space: nowrap; }
.asset-filter-grid { display: grid; grid-template-columns: minmax(220px, 1.55fr) repeat(5, minmax(128px, .78fr)); gap: 14px 16px; padding: 18px; }
.asset-filter-grid label { min-width: 0; display: grid; gap: 6px; color: var(--admin-text-muted, #667085); font-size: 10px; font-weight: 700; }
.asset-filter-grid input, .asset-filter-grid select { width: 100%; min-width: 0; }
.asset-filter-keyword { grid-column: span 2; }
.asset-filter-actions { display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.asset-card-actions { display: flex; align-items: center; gap: 8px; }
.asset-page-size { display: flex; align-items: center; gap: 7px; color: var(--admin-text-muted, #667085); font-size: 10px; font-weight: 700; }
.asset-page-size select { min-height: 32px; }
.asset-queue-table { min-width: 1040px; }
.asset-queue-table td { vertical-align: top; }
.asset-queue-error { max-width: 330px; color: var(--admin-danger, #b42318); white-space: normal; overflow-wrap: anywhere; }
.asset-table { min-width: 860px; table-layout: fixed; }
.asset-table th, .asset-table td { padding: 10px 8px; }
.asset-table td { vertical-align: top; }
.asset-table th:nth-child(1), .asset-table td:nth-child(1) { width: 36px; }
.asset-table th:nth-child(3), .asset-table td:nth-child(3) { width: 150px; }
.asset-table th:nth-child(4), .asset-table td:nth-child(4) { width: 160px; }
.asset-table th:nth-child(5), .asset-table td:nth-child(5) { width: 100px; }
.asset-table th:nth-child(6), .asset-table td:nth-child(6) { width: 80px; }
.asset-table th:nth-child(7), .asset-table td:nth-child(7) { width: 64px; }
.asset-check-cell { width: 36px; }
.asset-name-cell { max-width: none; }
.asset-name-cell > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-name-cell code { display: inline-block; max-width: 100%; overflow: hidden; color: var(--admin-text-subtle, #98a2b3); font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; vertical-align: bottom; }
.asset-user-cell { max-width: 150px; white-space: normal; }
.asset-user-cell > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-user-cell > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-retention-cell { min-width: 0; white-space: normal; }
.asset-retention { display: inline-flex; min-height: 22px; align-items: center; padding: 0 7px; border: 1px solid var(--admin-border-strong, #d8dde3); border-radius: 999px; background: var(--admin-surface-raised, #f8f9fb); color: var(--admin-text-muted, #667085); font-size: 10px; font-weight: 700; white-space: nowrap; }
.asset-retention.permanent { border-color: var(--admin-success-border, #9bcdbb); background: var(--admin-success-surface, #eefaf5); color: var(--admin-success, #08785b); }
.asset-retention.canvas { border-color: var(--admin-info-border, #b7d6e4); background: var(--admin-info-surface, #eff8fb); color: var(--admin-info, #176b87); }
.asset-retention.temporary { border-color: var(--admin-warning-border, #e2bd79); background: var(--admin-warning-surface, #fff6e8); color: var(--admin-warning, #9a5b09); }
.asset-risk-badge { display: inline-flex; min-height: 22px; align-items: center; padding: 0 7px; border: 1px solid var(--admin-border-strong, #d8dde3); border-radius: 999px; background: var(--admin-surface-raised, #f8f9fb); color: var(--admin-text-muted, #667085); font-size: 10px; font-weight: 700; }
.asset-risk-badge.active { border-color: var(--admin-success-border, #9bcdbb); background: var(--admin-success-surface, #eefaf5); color: var(--admin-success, #08785b); }
.asset-risk-badge.info { border-color: var(--admin-info-border, #b7d6e4); background: var(--admin-info-surface, #eff8fb); color: var(--admin-info, #176b87); }
.asset-risk-badge.warning { border-color: var(--admin-warning-border, #e2bd79); background: var(--admin-warning-surface, #fff6e8); color: var(--admin-warning, #9a5b09); }
.asset-risk-text { font-weight: 800; }
.asset-risk-text.warning { color: var(--admin-warning, #9a5b09); }
.asset-risk-text.danger { color: var(--admin-danger, #b42318); }
.asset-risk-text.info { color: var(--admin-info, #176b87); }
.asset-row-delete { min-height: 30px; padding: 0 9px; }
.asset-pagination { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--admin-border, #e7eaee); color: var(--admin-text-muted, #667085); font-size: 11px; }
.asset-pagination > div { display: flex; align-items: center; gap: 10px; }
.asset-selection-actions { min-width: 0; }
.asset-selection-actions .asset-batch-delete { min-height: 30px; padding: 0 10px; }
.asset-pagination button:disabled, .admin-heading-actions button:disabled { opacity: .48; cursor: not-allowed; }
.asset-empty-inline { padding: 18px; color: var(--admin-text-muted, #7c8795); text-align: center; white-space: normal; }
.admin-body .asset-metric-card { border-color: var(--admin-border); background: var(--admin-surface); }
.admin-body .asset-metric-card.healthy { border-color: var(--admin-success-border); background: var(--admin-success-surface); }
.admin-body .asset-metric-card.warning { border-color: var(--admin-warning-border); background: var(--admin-warning-surface); }
.admin-body .asset-metric-card.danger { border-color: var(--admin-danger-border); background: var(--admin-danger-surface); }
.admin-body .asset-metric-card > strong { color: var(--admin-text); }
.admin-body .asset-metric-card.healthy > strong { color: var(--admin-success); }
.admin-body .asset-metric-card.warning > strong { color: var(--admin-warning); }
.admin-body .asset-metric-card.danger > strong { color: var(--admin-danger); }
@media (max-width: 1500px) {
  .asset-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .asset-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .asset-filter-keyword { grid-column: span 2; }
}
@media (max-width: 900px) {
  .asset-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-filter-keyword { grid-column: span 2; }
  .asset-filter-card > header, .asset-queue-card > header, .asset-list-card > header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .asset-card-actions { width: 100%; justify-content: space-between; }
}
@media (max-width: 620px) {
  .asset-metric-grid, .asset-filter-grid { grid-template-columns: 1fr; }
  .asset-filter-keyword { grid-column: auto; }
  .asset-pagination { align-items: stretch; flex-direction: column; }
  .asset-pagination > div { justify-content: space-between; }
}
.admin-link-button { min-height: 0 !important; display: block; border: 0 !important; background: transparent !important; color: #1d536a !important; padding: 0 !important; text-align: left; }
.admin-link-button > strong, .admin-link-button > small { display: block; }
.admin-link-button > small { margin-top: 3px; color: inherit; opacity: .72; }
.admin-link-button:hover { color: #0b8197 !important; text-decoration: underline; }
.prompt-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.admin-failure-detail { display: grid; gap: 3px; max-width: 300px; color: #b42318; font-size: 12px; line-height: 1.35; }
.admin-failure-detail strong { color: #d92d20; font-size: 11px; }
.admin-failure-detail small { display: block; white-space: normal; overflow-wrap: anywhere; }
.admin-provider-submission { margin-top: 6px; color: #5d6672; font-size: 11px; }
.admin-provider-submission summary { cursor: pointer; color: #344054; font-weight: 600; }
.admin-provider-submission > small { display: block; margin: 5px 0; white-space: normal; overflow-wrap: anywhere; }
.admin-provider-submission > div { max-width: 420px; white-space: normal; overflow-wrap: anywhere; }
.admin-provider-submission code { display: inline-block; max-width: 100%; padding: 2px 4px; border-radius: 3px; background: #f2f4f7; color: #344054; font: 10px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.admin-provider-submission hr { margin: 6px 0; border: 0; border-top: 1px solid #eaecf0; }
.admin-upload-route { margin: 6px 0; padding: 6px 8px; border: 1px solid #d0d5dd; border-radius: 4px; background: #f9fafb; }
.admin-upload-route strong, .admin-upload-route small { display: block; }
.admin-upload-route a { color: #175cd3; overflow-wrap: anywhere; }
.admin-muted { color: #98a2b3; }
.admin-link-cell { display: block; max-width: 230px; overflow: hidden; color: #627183; text-overflow: ellipsis; white-space: nowrap; }
.admin-provider-task-id { display: block; max-width: 220px; overflow: hidden; color: #2457c5; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-lane-badge { display: block; color: #7c5cbf; font-size: 11px; font-weight: 500; margin-top: 2px; }
.task-management-card { overflow: visible; }
.task-filters { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.25fr) minmax(250px, 1.5fr) auto; align-items: end; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #e7eaee; background: #fbfcfd; }
.task-filters label { display: grid; gap: 5px; min-width: 0; color: #657182; font-size: 11px; font-weight: 700; }
.task-filters select, .task-filters input { min-width: 0; height: 34px; border: 1px solid #d8dee5; border-radius: 5px; background: #fff; color: #263444; padding: 0 9px; font: inherit; font-weight: 400; outline: none; }
.task-filters select:focus, .task-filters input:focus { border-color: #4c86a8; box-shadow: 0 0 0 2px rgba(76, 134, 168, .12); }
.task-filters button { height: 34px; white-space: nowrap; }
.task-table-wrap { overflow-x: hidden; }
.admin-task-table { width: 100%; table-layout: fixed; }
.admin-task-table col:nth-child(1) { width: 9%; }
.admin-task-table col:nth-child(2) { width: 10%; }
.admin-task-table col:nth-child(3) { width: 5%; }
.admin-task-table col:nth-child(4) { width: 8%; }
.admin-task-table col:nth-child(5) { width: 7%; }
.admin-task-table col:nth-child(6) { width: 13%; }
.admin-task-table col:nth-child(7) { width: 5%; }
.admin-task-table col:nth-child(8) { width: 4%; }
.admin-task-table col:nth-child(9) { width: 12%; }
.admin-task-table col:nth-child(10) { width: 9%; }
.admin-task-table col:nth-child(11) { width: 8%; }
.admin-task-table col:nth-child(12) { width: 5%; }
.admin-task-table col:nth-child(13) { width: 5%; }
.admin-task-table th, .admin-task-table td { overflow: hidden; padding: 10px 8px; text-overflow: ellipsis; vertical-align: middle; }
.admin-task-table th { font-size: 11px; }
.admin-task-table td { white-space: nowrap; }
.admin-task-table td > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-task-table td > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-task-table time { color: #455465; font-variant-numeric: tabular-nums; font-size: 11px; }
.admin-task-table .prompt-cell { max-width: none; color: #3e4a59; }
.admin-task-table .admin-provider-task-id { max-width: 100%; font-size: 11px; }
.admin-task-table button { min-height: 29px; padding: 0 7px; font-size: 11px; }
.task-failure-alert { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; border: 1px solid rgba(220, 38, 38, .28); border-left: 4px solid #dc2626; border-radius: 8px; background: rgba(220, 38, 38, .08); color: #991b1b; padding: 12px 14px; }
.task-failure-alert strong { display: block; margin-bottom: 3px; font-size: 13px; }
.task-failure-alert span { display: block; overflow: hidden; color: inherit; opacity: .82; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.task-failure-alert button { min-height: 32px; border-color: #dc2626; background: #dc2626; color: #fff; white-space: nowrap; }
#adminFailureToasts { position: fixed; right: 18px; bottom: 18px; z-index: 99999; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
#adminAttentionToasts { position: fixed; z-index: 99999; top: 18px; right: 18px; display: grid; gap: 10px; width: min(400px, calc(100vw - 36px)); }
#adminActionToast { position: fixed; z-index: 99999; top: 18px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: max-content; max-width: min(560px, calc(100vw - 32px)); border: 1px solid rgba(45, 122, 96, .42); border-left: 4px solid #2f9e6f; border-radius: 8px; background: #ffffff; color: #1f3a2f; box-shadow: 0 14px 38px rgba(15, 23, 42, .22); padding: 10px 12px; font-size: 13px; animation: adminActionToastIn .16s ease-out; }
#adminActionToast.error { border-color: rgba(220, 38, 38, .4); border-left-color: #dc2626; color: #7f1d1d; }
#adminActionToast .admin-action-toast-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #2f9e6f; color: #fff; font-size: 12px; font-weight: 700; }
#adminActionToast.error .admin-action-toast-icon { background: #dc2626; }
#adminActionToast strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adminActionToast button { min-width: 26px; min-height: 26px; border-color: #d9dfe5; background: #f8fafc; color: #64748b; font-size: 15px; padding: 0; }
@keyframes adminActionToastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.admin-failure-toast { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border: 1px solid rgba(220, 38, 38, .28); border-left: 4px solid #dc2626; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 11px 12px; }
.admin-failure-toast > div { min-width: 0; }
.admin-failure-toast strong { display: block; color: #991b1b; font-size: 13px; }
.admin-failure-toast span { display: -webkit-box; overflow: hidden; color: #556171; font-size: 12px; line-height: 1.45; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.admin-failure-toast button { min-height: 30px; padding: 0 9px; font-size: 11px; }
.admin-failure-toast .toast-close { min-width: 30px; border-color: #d9dfe5; background: #f8fafc; color: #64748b; font-size: 15px; padding: 0; }
.admin-orphan-toast { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border: 1px solid rgba(217, 119, 6, .36); border-left: 4px solid #d97706; border-radius: 8px; background: #fffdf7; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 11px 12px; }
.admin-orphan-toast > div { min-width: 0; }
.admin-orphan-toast strong { display: block; color: #92400e; font-size: 13px; }
.admin-orphan-toast span { display: -webkit-box; overflow: hidden; color: #6b5a46; font-size: 12px; line-height: 1.45; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.admin-orphan-toast button { min-height: 30px; padding: 0 9px; font-size: 11px; }
.admin-orphan-toast .toast-close { min-width: 30px; border-color: #e5d6bd; background: #fff; color: #8a7251; font-size: 15px; padding: 0; }
.admin-task-table .task-row-failed { background: rgba(220, 38, 38, .045); box-shadow: inset 3px 0 0 #dc2626; }
.admin-task-table .task-row-focus { animation: taskRowFocus 1s ease-in-out 4; }
@keyframes taskRowFocus { 50% { background: rgba(245, 158, 11, .2); box-shadow: inset 4px 0 0 #d97706; } }
.task-failure-button { margin-left: 6px; border-color: rgba(220, 38, 38, .45); color: #b91c1c; }
.task-result-preview { display: grid; place-items: center; min-height: 160px; max-height: 420px; overflow: hidden; border-radius: 8px; background: #0b1016; }
.task-result-preview a { display: block; max-width: 100%; }
.task-result-preview img, .task-result-preview video { display: block; max-width: 100%; max-height: 420px; object-fit: contain; }
.task-result-empty { margin: 0; color: #64748b; font-size: 13px; }
.task-detail-button { border-color: #a8c6d9 !important; color: #1d5c80 !important; }
.task-detail-modal { width: min(860px, calc(100vw - 44px)); max-height: min(820px, calc(100vh - 44px)); overflow-y: auto; }
.task-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-bottom: 1px solid #e5e9ed; }
.task-detail-grid > div { min-width: 0; padding: 12px 17px; border-bottom: 1px solid #eef0f2; }
.task-detail-grid > div:nth-child(odd) { border-right: 1px solid #eef0f2; }
.task-detail-grid dt { margin-bottom: 5px; color: #7b8794; font-size: 11px; }
.task-detail-grid dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #2c3948; font-size: 12px; }
.task-detail-grid dd small { display: block; margin-top: 3px; color: #86919d; }
.task-detail-grid code, .task-reference-list code { color: #2457c5; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.task-reference-url { min-width: 0; display: grid; gap: 3px; color: #2457c5; text-decoration: none; }
.task-reference-url code { text-decoration: underline; text-decoration-color: rgba(36, 87, 197, .38); text-underline-offset: 2px; }
.task-reference-url small { color: #1d5c80; font-size: 10px; font-weight: 700; }
.task-reference-url:hover code { color: #0b8197; text-decoration-color: currentColor; }
.task-detail-section { padding: 15px 17px; border-bottom: 1px solid #eef0f2; }
.task-detail-section:last-child { border-bottom: 0; }
.task-detail-section h3 { margin: 0 0 9px; color: #354455; font-size: 12px; }
.task-detail-section pre { max-height: 190px; margin: 0; overflow: auto; border: 1px solid #e0e5e9; border-radius: 5px; background: #f7f9fb; padding: 10px; color: #35414f; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.task-provider-failure { display: grid; gap: 5px; margin: 0; border-left: 3px solid #e99da9; background: #fff5f6; padding: 9px 11px; color: #982a3f; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-provider-failure small { color: #9c6b74; }
.task-reference-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.task-reference-list li { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(90px, .7fr) minmax(0, 2fr); gap: 8px; align-items: center; border: 1px solid #e5e9ed; border-radius: 5px; padding: 8px; color: #536171; font-size: 11px; }
.admin-task-table .task-user-filter { width: 100%; min-height: 0; display: grid; gap: 3px; border: 0; background: transparent; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.admin-task-table .task-user-filter strong, .admin-task-table .task-user-filter small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-task-table .task-user-filter:hover { color: #176b87; }
.admin-task-table .task-user-filter:hover strong { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 1380px) { .task-filters { grid-template-columns: 1fr 1fr; } .task-id-filter { grid-column: 1 / -1; } .task-filters button { justify-self: start; } }
.admin-badge { display: inline-block; border: 1px solid #cfd5dc; border-radius: 4px; background: #eef1f4; color: #4e5a68; padding: 3px 8px; font-size: 10px; font-weight: 700; }
.admin-badge.active, .admin-badge.approved, .admin-badge.completed { border-color: #86d2b5; background: #d7f3e7; color: #08664b; }
.admin-badge.disabled, .admin-badge.inactive, .admin-badge.rejected, .admin-badge.failed { border-color: #e9a5b1; background: #ffe0e5; color: #9e1735; }
.admin-badge.deleted { border-color: #aab2bc; background: #e1e5ea; color: #303945; }
.admin-badge.hidden, .admin-badge.unpublished { border-color: #c8ced6; background: #e8ebef; color: #4c5663; }
.admin-badge.pending, .admin-badge.processing { border-color: #e7bc70; background: #ffedc9; color: #86500a; }
.table-actions { display: flex; gap: 5px; }
.table-actions .approve { border-color: #89cbb5; color: #26775d; }
.credit-amount { font-weight: 700; }
.credit-amount.positive { color: #278261; }
.credit-amount.negative { color: #a44757; }
.admin-search { height: 38px; display: flex; align-items: center; gap: 5px; border: 1px solid #d7dce2; border-radius: 6px; background: #fff; padding: 0 10px; color: #7d8793; }
.admin-search input { width: 190px; border: 0; outline: 0; }
.admin-tabs button { min-height: 35px; border: 1px solid #dce1e7; border-radius: 6px; background: #fff; color: #536173; }
.admin-tabs button.active { border-color: #223b4d; background: #223b4d; color: #fff; }
.model-category-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -6px 0 18px; padding-bottom: 1px; }
.model-category-tabs button { min-width: 92px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #d9dee4; border-radius: 6px; background: #fff; color: #536173; cursor: pointer; }
.model-category-tabs button:hover { border-color: #8795a3; color: #263747; }
.model-category-tabs button.active { border-color: #1d3445; background: #1d3445; color: #fff; }
.model-category-tabs small { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; background: #eef1f4; color: #74808d; font-size: 10px; }
.model-category-tabs button.active small { background: rgba(255, 255, 255, .16); color: #fff; }
.model-provider-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -8px 0 18px; }
.model-provider-tabs button { min-width: 110px; height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d7dde3; border-radius: 6px; background: #fff; color: #536173; cursor: pointer; }
.model-provider-tabs button:hover { border-color: #7c8a98; color: #263747; }
.model-provider-tabs button.active { border-color: #31596d; background: #e1edf2; color: #163f53; font-weight: 700; }
.model-provider-tabs small { min-width: 20px; border-radius: 4px; background: #edf0f3; color: #667382; padding: 2px 5px; }
.model-provider-tabs button.active small { background: #c9dce5; color: #163f53; }
.model-provider-restore { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #7a8794; }
.model-provider-restore button { min-width: 0; height: 32px; padding: 0 12px; border-style: dashed; color: #7a8794; font-size: 13px; }
.model-provider-restore button:hover { border-color: #31596d; color: #163f53; border-style: solid; }
.rename-preview { display: grid; gap: 6px; margin: 2px 0 14px; border: 1px solid #d9e1e6; border-radius: 7px; background: #f7fafb; padding: 11px 12px; }
.rename-preview > strong { color: #27333d; font-size: 12px; }
.rename-preview small { display: flex; align-items: baseline; gap: 6px; overflow-wrap: anywhere; color: #7f8a97; font-size: 12px; line-height: 1.5; }
.rename-preview small > span { color: #67727f; text-decoration: line-through; }
.rename-preview small > b { color: #1f6f7d; }
.model-status-tabs { position: relative; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -7px 0 18px; padding-top: 10px; border-top: 1px solid #e2e6ea; pointer-events: auto; }
.model-status-tabs button { min-width: 92px; height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d7dde3; border-radius: 6px; background: #fff; color: #536173; cursor: pointer; }
.model-status-tabs button:hover { border-color: #7c8a98; color: #263747; }
.model-status-tabs button.active { border-color: #31596d; background: #e1edf2; color: #163f53; font-weight: 700; }
.model-status-tabs small { min-width: 20px; border-radius: 4px; background: #edf0f3; color: #667382; padding: 2px 5px; }
.model-status-tabs button.active small { background: #c9dce5; color: #163f53; }
.model-batch-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 46px; margin: -8px 0 18px; padding: 7px 9px; border: 1px solid #dbe1e6; border-radius: 6px; background: #f8fafb; color: #566474; font-size: 12px; }
.model-batch-bar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.model-batch-bar input { width: 15px; height: 15px; accent-color: #31596d; }
.model-batch-bar strong { color: #273a4a; font-size: 12px; }
.model-batch-bar > span { flex: 1 1 auto; min-width: 10px; }
.model-batch-bar button { min-height: 30px; padding: 0 10px; font-size: 12px; }
.model-batch-bar button:disabled { opacity: .48; cursor: not-allowed; }
.model-select { display: inline-flex; align-items: center; gap: 4px; color: #6a7785; font-size: 11px; cursor: pointer; white-space: nowrap; }
.model-select input { width: 14px; height: 14px; margin: 0; accent-color: #31596d; }
.model-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.model-admin-family-group { grid-column: 1 / -1; min-width: 0; padding: 12px; border: 1px solid #cbd7df; border-radius: 8px; background: rgba(238, 245, 248, .52); }
.model-admin-family-group > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; color: #29465b; }
.model-admin-family-group > header strong { font-size: 14px; }
.model-admin-family-group > header span { color: #718291; font-size: 11px; }
.model-admin-family-group > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-body .model-admin-family-group { border-color: var(--admin-border-strong); background: var(--admin-surface-raised); }
.admin-body .model-admin-family-group > header { color: var(--admin-text); }
.admin-body .model-admin-family-group > header span { color: var(--admin-text-muted); }
.model-category-empty { grid-column: 1 / -1; min-height: 280px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed #d6dce2; border-radius: 7px; background: #fafbfc; color: #8a95a1; text-align: center; }
.model-category-empty strong { color: #4d5b6a; font-size: 15px; }
.model-category-empty span { font-size: 11px; }
.model-admin-card { min-width: 0; padding: 18px; border: 1px solid #dde2e7; border-radius: 7px; background: #fff; }
.admin-body .model-admin-card { display: block; }
.admin-body .model-admin-card > header,
.admin-body .model-admin-card > h2,
.admin-body .model-admin-card > small,
.admin-body .model-admin-card > p,
.admin-body .model-admin-card > .model-monitoring-inline,
.admin-body .model-admin-card > footer { grid-column: 1 / -1; }
.admin-body .model-admin-card > dl { width: 100%; }
.admin-body .model-admin-card > h2 { max-width: none; }
.model-admin-card header { display: flex; justify-content: space-between; }
.model-card-badges { display: flex; align-items: center; gap: 5px; }
.verification-badge { display: inline-block; border: 1px solid #e2bd79; border-radius: 4px; background: #ffedca; color: #80500e; padding: 3px 8px; font-size: 10px; font-weight: 700; }
.model-trust-badge { display: inline-flex; align-items: center; border: 1px solid; border-radius: 4px; padding: 2px 6px; font-size: 10px; font-style: normal; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.model-trust-badge.official { border-color: #8db8e9; background: #e6f1ff; color: #185a9d; }
.model-trust-badge.stable { border-color: #8ac9af; background: #e6f8ef; color: #176b47; }
.model-trust-badge.special { border-color: #e7b36a; background: #fff3df; color: #9a5712; }
.model-trust-editor { margin: 0; border: 1px solid #e0e5ea; border-radius: 6px; padding: 12px; }
.model-trust-editor legend { padding: 0 5px; color: #344454; font-size: 12px; font-weight: 700; }
.model-trust-options { display: flex; flex-wrap: wrap; gap: 16px; }
.model-trust-options label { display: inline-flex; align-items: center; gap: 6px; }
.admin-modal .model-trust-options input[type="checkbox"] { flex: 0 0 auto; width: 16px; min-width: 16px; min-height: 16px; margin: 0; }
/* 后台弹窗的通用 label 是纵向 grid，会盖掉上面这行的横排写法，这里按同样优先级补回来。 */
.admin-modal .model-trust-options label { display: inline-flex; align-items: center; gap: 6px; }
.verification-badge.verified { border-color: #91b9e8; background: #dcecff; color: #145493; }
.verification-badge.discount { border-color: #dfb360; background: #ffebbe; color: #7b4a05; }
.verification-badge.incomplete, .verification-badge.test-failed { border-color: #e9a5b1; background: #ffe0e5; color: #9e1735; }
.model-type { padding: 4px 7px; border-radius: 4px; background: #e7f3f6; color: #277487; font-size: 10px; }
.model-type.video { background: #f5ecdf; color: #94652d; }
.model-type.text { background: #eceafb; color: #6558a6; }
.model-type.audio { background: #e8f5ee; color: #337b5e; }
.model-admin-card h2 { margin: 16px 0 5px; font-size: 17px; }
.model-admin-card > small { display: block; overflow: hidden; margin-bottom: 7px; color: #929ca8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-admin-card > p { height: 40px; display: -webkit-box; overflow: hidden; margin: 0 0 15px; color: #7c8795; font-size: 12px; line-height: 20px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.model-monitoring-inline { min-height: 30px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 13px; color: #7b8793; font-size: 10px; }
.model-monitoring-inline > span:first-child { color: #526170; font-weight: 700; }
.model-modal-monitoring { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; color: #89939e; font-size: 10px; }
.model-modal-monitoring strong { color: #566473; }
.model-modal-monitoring .model-recent-health-label { color: #536170; }
.model-modal-monitoring .model-health-meter { background: #252a30; }
.model-modal-monitoring .model-recent-health-group { width: 100%; }
.model-admin-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 20px; margin: 0; padding: 15px; border-radius: 6px; background: #f7f9fa; }
.model-admin-card dl div { min-width: 0; display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
.model-admin-card dt { color: #8b95a1; font-size: 11px; }
.model-admin-card dd { overflow: hidden; margin: 0; color: #445164; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-body .model-recent-health.unused { gap: 5px; }
.admin-body .model-unused-label { border-color: #cbd2d9; background: #eef1f4; color: #707b86; }
.model-admin-card footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.model-admin-card footer button:disabled { opacity: .45; cursor: not-allowed; }
.model-admin-card.deleted { border-color: #c5cbd2; background: #f0f2f4; }
.model-admin-card.deleted h2, .model-admin-card.deleted dl { opacity: .72; }
.dashboard-trend-card { margin-top: 2px; }
.model-monitoring-card { margin-top: 16px; }
.model-monitoring-card > header { gap: 14px; }
.monitoring-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #7c8792; font-size: 10px; }
.monitoring-legend i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.monitoring-legend i.good { background: #35a868; }
.monitoring-legend i.warning { background: #d4a62f; }
.monitoring-legend i.danger { background: #d35a66; }
.monitoring-legend i.muted { background: #8e99a4; }
.dashboard-trend-card > header { gap: 18px; }
.trend-range-tabs, .trend-metric-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.trend-range-tabs button, .trend-metric-tabs button { min-height: 34px; border: 1px solid #d4dae1; border-radius: 6px; background: #fff; color: #536173; padding: 0 11px; cursor: pointer; }
.trend-range-tabs button.active { border-color: #244b60; background: #244b60; color: #fff; font-weight: 700; }
.trend-content { padding: 18px; }
.trend-metric-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.trend-metric-tabs button i { width: 9px; height: 9px; border-radius: 2px; background: var(--metric-color); }
.trend-metric-tabs button.active { border-color: var(--metric-color); box-shadow: inset 0 0 0 1px var(--metric-color); color: #172433; font-weight: 700; }
.trend-summary { display: flex; gap: 28px; margin: 18px 0 4px; color: #77828f; font-size: 11px; }
.trend-summary strong { margin-left: 6px; color: #172433; font-size: 16px; }
.trend-chart-scroll { overflow-x: auto; }
.trend-chart { width: 100%; min-width: 760px; height: auto; display: block; }
.trend-grid line { stroke: #e4e8ec; stroke-width: 1; }
.trend-grid text { fill: #7b8794; font-size: 10px; }
.trend-zero { stroke: #aeb7c1; stroke-width: 1; }
.trend-line { fill: none; stroke: var(--chart-color); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.trend-points circle { fill: #fff; stroke: var(--chart-color); stroke-width: 3; transition: r .16s, fill .16s; }
.trend-points circle:hover { r: 7px; fill: var(--chart-color); }
.settings-form { max-width: 820px; padding: 22px; }
.admin-security-form { max-width: 560px; }
.admin-security-form label small { color: #8b95a2; line-height: 1.55; }
.admin-security-panel { margin-top: 18px; }
.admin-redline-form { margin-top: 18px; max-width: 820px; }
.audit-filters { display: flex; align-items: end; gap: 12px; }
.audit-filters label { display: grid; gap: 4px; color: #697585; font-size: 11px; }
.audit-filters input[type="date"] { min-height: 32px; border: 1px solid #d5dbe1; border-radius: 5px; padding: 5px 8px; color: #364354; }
.audit-filters .audit-check { display: flex; align-items: center; gap: 5px; min-height: 32px; }
.audit-filters .audit-check input { width: 15px; min-height: 15px; }
.admin-audit-redline { display: inline-block; border: 1px solid #e29a9a; border-radius: 4px; background: #fff0f0; color: #b42318; padding: 3px 7px; font-size: 10px; font-weight: 700; }
.admin-audit-normal { color: #87919c; font-size: 10px; }
.audit-redline-row { background: #fffafa; }
.audit-redline-row:hover { background: #fff2f2 !important; }
.admin-modal.user-detail-modal { width: min(1180px, 100%); }
.user-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.user-detail-summary > div { display: grid; gap: 5px; border: 1px solid #e0e5e9; border-radius: 6px; background: #f8fafb; padding: 13px 15px; }
.user-detail-summary span { color: #7b8793; font-size: 11px; }
.user-detail-summary strong { color: #172433; font-size: 20px; }
.detail-section { margin-top: 18px; border-top: 1px solid #e5e8ec; padding-top: 15px; }
.detail-section h3 { margin: 0 0 10px; color: #3b4654; font-size: 14px; }
.detail-section table { font-size: 11px; }
.detail-prompt { max-width: 330px; min-width: 220px; white-space: normal !important; line-height: 1.5; }
.user-task-detail-table td:nth-child(2) { width: 150px; min-width: 150px; }
.user-task-detail-table td:nth-child(2) img, .user-task-detail-table td:nth-child(2) video { width: 140px; height: 92px; display: block; object-fit: cover; border-radius: 5px; background: #10151b; }
.user-task-detail-table td:nth-child(2) a { display: block; width: fit-content; }
.detail-media-empty { color: #9aa3ad; }
.detail-reference { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px 4px 0; vertical-align: top; }
.detail-reference img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; background: #eef1f3; }
.detail-reference small { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-form section + section { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e5e8ec; }
.settings-form h2 { margin: 0 0 18px; font-size: 16px; }
.settings-form label, .admin-modal label { display: grid; gap: 7px; margin-bottom: 15px; color: #626e7c; font-size: 12px; }
.settings-form input, .settings-form textarea, .settings-form select, .admin-modal input, .admin-modal textarea, .admin-modal select { width: 100%; min-height: 41px; border: 1px solid #d5dbe1; border-radius: 6px; outline: none; background: #fff; color: #263241; padding: 9px 11px; }
.settings-form textarea, .admin-modal textarea { min-height: 82px; resize: vertical; }
.settings-form h3 { margin: 0 0 12px; color: #3b4654; font-size: 13px; }
.settings-help { margin: -8px 0 18px; color: #88929e; font-size: 12px; }
.admin-recharge-tiers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; }
.admin-recharge-tiers article { min-width: 0; display: grid; gap: 4px; border: 1px solid #e1e5ea; border-radius: 6px; background: #f8fafb; padding: 12px; }
.admin-recharge-tiers strong { color: #1e2936; font-size: 18px; }
.admin-recharge-tiers span { color: #0d8b69; font-size: 12px; font-weight: 650; }
.admin-recharge-tiers small { color: #7d8793; font-size: 10px; line-height: 1.5; }
.admin-tier-discounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.admin-tier-discount-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 4px 12px; border: 1px solid #e1e5ea; border-radius: 6px; background: #f8fafb; padding: 12px; }
.admin-tier-discount-row > span { display: grid; gap: 3px; min-width: 0; }
.admin-tier-discount-row strong { color: #1e2936; font-size: 14px; }
.admin-tier-discount-row small { color: #7d8793; font-size: 10px; line-height: 1.5; }
.admin-tier-discount-row input { min-width: 0; border: 1px solid #ccd4dc; border-radius: 5px; background: #fff; color: #1e2936; padding: 7px 9px; font: inherit; }
.admin-tier-discount-hint { grid-column: 1 / -1; }
@media (max-width: 760px) { .admin-tier-discounts { grid-template-columns: 1fr; } }
.membership-contact-modal { width: min(420px, calc(100vw - 32px)); }
.membership-contact-content { padding: 22px 24px; display: grid; gap: 10px; color: #5e6a78; line-height: 1.65; }
.membership-contact-content strong { color: #1e2936; font-size: 16px; }
.membership-contact-content p { margin: 0; }
.membership-contact-modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
.customer-recharge-modal { width: min(440px, calc(100vw - 32px)); }
.customer-recharge-content { padding: 18px 24px 24px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.customer-recharge-content p { margin: 0; color: #5e6a78; line-height: 1.6; }
.customer-recharge-content > img { width: min(260px, 100%); aspect-ratio: 1; object-fit: contain; border: 1px solid #e1e5ea; border-radius: 6px; background: #fff; }
.customer-recharge-content > div { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; color: #5e6a78; }
.customer-recharge-content > div strong { color: #1e2936; }
.customer-recharge-empty { min-height: 180px; padding: 24px; border: 1px dashed #cbd3dc; border-radius: 6px; }
.payment-recharge-modal { width: min(460px, calc(100vw - 32px)); }
.payment-recharge-content { padding: 18px 24px 24px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.payment-recharge-content > strong { color: #1e2936; font-size: 17px; }
.payment-recharge-content > p { margin: 0; color: #5e6a78; line-height: 1.6; }
.payment-recharge-content > small { color: #7b8794; word-break: break-all; }
.payment-qr { width: min(260px, 100%); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #dce2e8; border-radius: 7px; background: #fff; overflow: hidden; }
.payment-qr img { width: 100%; height: 100%; display: block; object-fit: contain; }
.payment-qr span { padding: 20px; color: #7b8794; font-size: 13px; }
.payment-status { min-height: 22px; color: #637180; font-size: 13px; }
.payment-status[data-state="failed"] { color: #b42318; }
.payment-success-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #e6f6ee; color: #16875c; font-size: 32px; font-weight: 800; }
.payment-history-status { display: block; color: #526170; font-size: 12px; }
.payment-recharge-content .primary-button { width: min(260px, 100%); }
.client-body .payment-recharge-content > strong,
.client-body .payment-recharge-content > p,
.client-body .payment-recharge-content > small,
.client-body .payment-status { color: #b9c5d0; }
.client-body .payment-qr { border-color: #52677a; }
.client-body .payment-success-mark { background: #173a31; color: #74d7ad; }
/* 充值到账通知：沿用生成失败卡片的视觉语言（圆形标记 + 逐行说明）。 */
.recharge-arrival-modal { width: min(440px, calc(100vw - 32px)); }
.recharge-arrival-content { padding: 20px 24px 24px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.recharge-arrival-content > strong { color: #1e2936; font-size: 17px; }
.recharge-arrival-mark { border-color: #2f8f6b; color: #16875c; }
.recharge-arrival-content .failure-reason-line,
.recharge-arrival-content .failure-suggestion-line { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin: 0; color: #526170; font-size: 12px; line-height: 1.55; text-align: left; }
.recharge-arrival-content .failure-reason-line b,
.recharge-arrival-content .failure-suggestion-line b { color: #7b8794; font-weight: 600; }
.recharge-arrival-content em { color: #637180; font-size: 11px; font-style: normal; }
.recharge-arrival-content .primary-button { width: min(240px, 100%); }
.client-body .recharge-arrival-modal { border-color: #365b7a; background: #171d25; color: #f2f6fa; }
.client-body .recharge-arrival-modal header { border-color: #2e3b48; }
.client-body .recharge-arrival-modal header span { color: #b9cad9; }
.client-body .recharge-arrival-modal h2,
.client-body .recharge-arrival-content > strong { color: #f7fafc; }
.client-body .recharge-arrival-content .failure-reason-line,
.client-body .recharge-arrival-content .failure-suggestion-line { color: #b9c5d0; }
.client-body .recharge-arrival-content .failure-reason-line b,
.client-body .recharge-arrival-content .failure-suggestion-line b { color: #8fa6b8; }
.client-body .recharge-arrival-content em { color: #8fa6b8; }
.client-body .recharge-arrival-mark { border-color: #2f8f6b !important; color: #74d7ad !important; text-shadow: none !important; }
.settings-two-columns, .site-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.settings-two-columns .wide { grid-column: 1 / -1; }
.smtp-test-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 7px; }
.smtp-test-row button { border: 1px solid #ccd4dc; border-radius: 6px; background: #f5f8fa; color: #3f4c5d; cursor: pointer; }
.site-media-grid > div { min-width: 0; padding: 16px; border: 1px solid #e1e5e9; border-radius: 7px; background: #fafbfc; }
.site-media-preview { min-height: 170px; display: grid; place-items: center; overflow: hidden; margin-bottom: 12px; border: 1px solid #dce1e6; border-radius: 7px; background: #11161d; color: #8c96a2; }
.site-media-preview img, .site-media-preview video { width: 100%; height: 210px; display: block; object-fit: cover; }
.site-media-preview#logoPreview { width: 160px; min-height: 90px; background: #f7f9fa; }
.site-media-preview#logoPreview img { height: 90px; object-fit: contain; padding: 12px; }
.site-media-preview.empty { background: #f7f9fa; }
.admin-brand-logo { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #fff; }
.admin-brand-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.switch-row { grid-template-columns: 1fr auto !important; align-items: center; padding: 12px; border: 1px solid #e1e5e9; border-radius: 6px; }
.switch-row span { display: grid; gap: 4px; }
.switch-row small { color: #919aa5; }
.switch-row input { width: 18px; min-height: auto; }
.settings-form footer { display: flex; justify-content: flex-end; margin-top: 20px; }
.settings-form footer button { min-height: 40px; border: 0; border-radius: 6px; padding: 0 18px; cursor: pointer; }
.admin-modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(10, 17, 25, .66); }
.admin-modal { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 22px; border-radius: 8px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.admin-modal.small { width: min(450px, 100%); }
.admin-modal.automation-log-modal { width: min(900px, 100%); }
.automation-log-time { margin: -10px 0 16px; color: var(--admin-text-muted, #7c8795); font-size: 12px; }
.automation-log-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.automation-log-summary > div { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid var(--admin-border, #d8dde3); border-radius: 8px; background: var(--admin-card-muted, #f8fafb); }
.automation-log-summary span { color: var(--admin-text-muted, #6b7280); font-size: 12px; }
.automation-log-summary strong { font-size: 21px; color: var(--admin-text, #263241); }
.automation-log-section { margin-top: 14px; padding: 14px; border: 1px solid var(--admin-border, #d8dde3); border-radius: 8px; }
.automation-log-section h3 { margin: 0 0 5px; font-size: 15px; }
.automation-log-section > p { margin: 0 0 12px; color: var(--admin-text-muted, #687585); font-size: 12px; line-height: 1.5; }
.automation-auto-removed { border-color: var(--admin-warning-border, #d8b46a); background: var(--admin-warning-surface, #fffbeb); }
.automation-name-list { display: flex; flex-wrap: wrap; gap: 7px; max-height: 112px; overflow: auto; }
.automation-name-list code { padding: 5px 7px; border-radius: 5px; background: rgba(0, 0, 0, .07); color: inherit; font-size: 12px; }
.automation-approval-list { max-height: 420px; overflow: auto; border-top: 1px solid var(--admin-border, #d8dde3); }
.automation-approval-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--admin-border, #d8dde3); }
.automation-approval-main { min-width: 0; display: grid; gap: 4px; }
.automation-approval-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.automation-approval-main small { color: var(--admin-text-muted, #687585); font-size: 12px; }
.automation-approval-row .table-actions { display: flex; gap: 7px; }
.automation-raw-details { margin-top: 16px; color: var(--admin-text-muted, #687585); font-size: 12px; }
.automation-completed-details { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--admin-border, #d8dde3); border-radius: 8px; color: var(--admin-text-muted, #687585); font-size: 12px; }
.automation-completed-details summary { cursor: pointer; font-weight: 700; }
.automation-completed-details .automation-name-list { margin-top: 10px; }
.automation-no-pending { text-align: center; }
.automation-raw-details summary { cursor: pointer; }
.automation-raw-details pre { max-height: 280px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 6px; background: var(--admin-card-muted, #f8fafb); color: var(--admin-text, #263241); white-space: pre-wrap; word-break: break-word; }
.admin-modal#membershipForm { width: min(520px, 100%); }
.credit-adjust-modes { display: flex; gap: 8px; margin-bottom: 14px; }
.credit-adjust-modes button { flex: 1 1 0; min-height: 40px; border: 1px solid #dce1e7; border-radius: 6px; background: #fff; color: #536173; font-weight: 700; cursor: pointer; }
.credit-adjust-modes button.active { border-color: #223b4d; background: #223b4d; color: #fff; }
.credit-adjust-modes button[data-credit-direction="decrease"].active { border-color: #b42318; background: #b42318; color: #fff; }
.credit-adjust-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 14px; }
.credit-adjust-quick button { min-height: 30px; border: 1px solid #dce1e7; border-radius: 15px; background: #f7fafb; color: #4d5b6b; padding: 0 13px; font-size: 12px; cursor: pointer; }
.credit-adjust-quick button:hover { border-color: #86b9c2; color: #2e6873; }
.credit-adjust-quick button[hidden] { display: none; }
.credit-adjust-preview { display: flex; align-items: baseline; gap: 6px; margin: 0 0 12px; border-radius: 6px; background: #f4f7f9; padding: 10px 12px; color: #63707e; font-size: 12px; }
.credit-adjust-preview strong { color: #223b4d; font-size: 16px; }
.credit-adjust-preview small { color: #8b95a1; font-size: 11px; }
.credit-adjust-preview.negative strong { color: #b42318; }
.credit-adjust-warning { margin: 0 0 12px; border: 1px solid #f0c9a0; border-radius: 6px; background: #fff6e8; padding: 9px 12px; color: #8a5309; font-size: 12px; line-height: 1.5; }
.credit-adjust-warning[hidden] { display: none; }
.credit-adjust-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 12px; }
.credit-adjust-tags > span { color: #8b95a1; font-size: 11px; }
.credit-adjust-tags button { min-height: 28px; border: 1px solid #dce1e7; border-radius: 14px; background: #f7fafb; color: #4d5b6b; padding: 0 12px; font-size: 12px; cursor: pointer; }
.credit-adjust-tags button:hover { border-color: #86b9c2; color: #2e6873; }
.credit-adjust-tags button.active { border-color: #223b4d; background: #223b4d; color: #fff; font-weight: 700; }
.credit-adjust-tags button[data-credit-tag="gift"].active { border-color: #9a5b09; background: #9a5b09; }
.credit-adjust-tags button[hidden] { display: none; }
.credit-adjust-kind { margin: 0 0 4px; border-left: 3px solid #9aa6b2; border-radius: 0 6px 6px 0; background: #f4f7f9; padding: 8px 12px; color: #5c6874; font-size: 11px; line-height: 1.55; }
.credit-adjust-kind.recharge { border-left-color: #147fa3; }
.credit-adjust-kind.gift { border-left-color: #c07f14; background: #fff6e8; color: #7d4d08; }
.credit-adjust-kind[hidden] { display: none; }
.admin-modal > header { display: flex; justify-content: space-between; margin-bottom: 22px; }
.admin-modal > header h2 { margin: 0 0 4px; font-size: 19px; }
.admin-modal > header p { margin: 0; color: #89939f; font-size: 12px; }
.admin-modal > header button { width: 34px; padding: 0; font-size: 20px; }
.model-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.model-form-grid .wide { grid-column: 1 / -1; }
.billing-editor { margin: 0 0 12px; border: 1px solid #d9e1e6; border-radius: 7px; padding: 10px 12px 8px; background: #f7fafb; }
.billing-editor legend { padding: 0 5px; color: #27333d; font-size: 12px; font-weight: 700; }
.token-pricing-editor { margin: 0 0 12px; border: 1px solid #d9e1e6; border-radius: 7px; padding: 10px 12px 8px; background: #f7fafb; }
.token-pricing-editor legend { padding: 0 5px; color: #27333d; font-size: 12px; font-weight: 700; }
.token-pricing-editor .settings-two-columns { margin: 0; }
.token-pricing-editor > small { display: block; margin-top: 8px; color: #788590; font-size: 10px; line-height: 1.5; }
.billing-mode-row { display: flex; gap: 18px; align-items: center; }
.billing-mode-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #35424d; font-size: 12px; }
/* 后台弹窗里的输入框默认占满宽度，会把单选项挤成竖排大字；这里只放行单选框本身。 */
.admin-modal .billing-mode-row label { flex: 0 0 auto; white-space: nowrap; }
.admin-modal .billing-mode-row input[type="radio"] { flex: 0 0 auto; width: 16px; min-width: 16px; min-height: 16px; margin: 0; }
.billing-editor > small { display: block; margin-top: 6px; color: #788590; font-size: 10px; }
.group-per-second-pricing-list { margin: 0 0 13px; border: 1px solid #d9e1e6; border-radius: 7px; padding: 10px 12px; background: #f7fafb; }
.group-per-second-pricing-list[hidden] { display: none !important; }
.group-per-second-pricing-list > strong { display: block; margin-bottom: 7px; color: #27333d; font-size: 12px; }
.group-per-second-pricing-list > div { display: grid; gap: 6px; }
.group-per-second-pricing-list > div > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 6px; background: #fff; color: #44515c; font-size: 11px; }
.group-per-second-pricing-list > div > div strong { color: #27333d; }
.group-per-second-pricing-list > div > span, .group-per-second-pricing-list > small { display: block; color: #788590; font-size: 10px; line-height: 1.5; }
.group-per-second-pricing-list > small { margin-top: 8px; }
.group-per-second-pricing-list > div > div.group-per-second-price-row { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; background: #fff; }
.group-per-second-pricing-list > div > div.group-per-second-price-row strong { color: #27333d; font-size: 12px; }
.group-per-second-pricing-list > div > div.group-per-second-price-row input { min-width: 0; height: 30px; padding: 0 8px; border: 1px solid #c8d4da; border-radius: 5px; background: #fff; color: #1d2933; font-size: 12px; }
.group-per-second-pricing-list > div > div.group-per-second-price-row span { min-width: 132px; color: #5c6a75; font-size: 11px; text-align: right; }
.per-second-pricing-field[hidden], .per-request-pricing-field[hidden], .billing-editor[hidden] { display: none !important; }
.model-capability-editor { display: grid; gap: 8px; margin: 4px 0 13px; border: 1px solid var(--admin-border-strong); border-radius: 7px; background: var(--admin-surface-raised); padding: 12px; }
.model-capability-editor legend { color: var(--admin-text-muted); padding: 0 5px; font-size: 12px; font-weight: 600; }
.model-capability-editor > div { display: flex; flex-wrap: wrap; gap: 8px; }
.model-capability-editor > div label { min-height: 34px; display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 7px; border: 1px solid var(--admin-border-strong); border-radius: 6px; background: var(--admin-input); color: var(--admin-text); padding: 0 10px; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease; }
.model-capability-editor > div label:hover { border-color: var(--admin-accent); background: var(--admin-surface-hover); }
.model-capability-editor > div label:has(input:checked) { border-color: var(--admin-accent); background: var(--admin-info-surface); color: var(--admin-text); }
.model-capability-editor > small { color: var(--admin-text-muted); }
.model-capability-editor input { width: 15px; min-height: 15px; margin: 0; }
.provider-model-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.provider-model-picker button { min-height: 41px; white-space: nowrap; }
.provider-model-picker button:disabled { opacity: .55; cursor: not-allowed; }
.provider-model-type-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.provider-model-type-tabs[hidden] { display: none; }
.provider-model-type-tabs button { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d9dee4; border-radius: 6px; background: #f8fafb; color: #637080; padding: 0 11px; cursor: pointer; }
.provider-model-type-tabs button:hover { border-color: #86b9c2; color: #2e6873; }
.provider-model-type-tabs button.active { border-color: #2d6672; background: #e8f4f6; color: #205d68; font-weight: 700; }
.provider-model-type-tabs small { min-width: 20px; border-radius: 10px; background: rgba(91, 112, 124, .12); padding: 2px 5px; text-align: center; }
.provider-model-details { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; border: 1px solid #d9e7ea; border-radius: 6px; background: #f4fafb; padding: 9px; }
.provider-model-details[hidden] { display: none; }
.provider-model-details strong { width: 100%; color: #277c8b; font-size: 11px; }
.provider-model-details span { border-radius: 4px; background: #e7f2f4; color: #53616e; padding: 4px 7px; font-size: 11px; line-height: 1.35; }
.admin-modal label > small { min-height: 15px; color: #89939f; line-height: 1.4; }
.admin-modal [hidden] { display: none !important; }
.membership-tier-discounts { margin: 0 0 18px; border: 1px solid #e1e5ea; border-radius: 6px; background: #f8fafb; padding: 12px; }
.membership-tier-discount-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.membership-tier-discount-grid label { margin-bottom: 0; }
.admin-modal#membershipForm #membershipFields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.admin-modal#membershipForm #membershipFields .wide { grid-column: 1 / -1; }
.membership-tier-row { display: grid; grid-template-columns: minmax(0, 1fr) 116px; align-items: center; gap: 8px 10px; border: 1px solid #dbe2ea; border-radius: 6px; background: #fff; padding: 10px; }
.membership-tier-row > input { grid-column: 2; grid-row: 1; min-width: 0; }
.membership-tier-row > small { grid-column: 1 / -1; line-height: 1.35; }
.membership-tier-row.active { border-color: var(--admin-accent); box-shadow: 0 0 0 2px var(--admin-info-surface); }
.membership-tier-choice { display: flex; align-items: center; gap: 8px; color: #263241; font-weight: 650; }
.admin-modal .membership-tier-choice { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.admin-modal .membership-tier-choice span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.membership-tier-choice input { width: 16px; min-width: 16px; min-height: 16px; margin: 0; }
.admin-modal footer { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid #e5e8eb; }
.admin-loading { min-height: 120px; display: grid; place-items: center; color: #75808e; text-align: center; }
.provider-model-list { max-height: 430px; display: grid; gap: 7px; overflow-y: auto; }
.provider-model-list button { min-height: 56px; display: grid; gap: 3px; align-content: center; border: 1px solid #dce1e6; background: #f8fafb; text-align: left; }
.provider-model-list button:hover { border-color: #65b8c6; background: #eff9fa; }
.provider-model-list small { overflow: hidden; color: #7f8a97; text-overflow: ellipsis; white-space: nowrap; }
.model-test-result { display: grid; place-items: center; min-height: 220px; margin-bottom: 18px; overflow: hidden; border-radius: 6px; background: #11161d; }
.model-test-result img, .model-test-result video { width: 100%; max-height: 420px; display: block; object-fit: contain; }
.admin-danger { border-color: #e2abb4 !important; color: #a34051 !important; }
.inspiration-settings { margin-bottom: 18px; }
.inspiration-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 20px; }
.inspiration-settings-grid > label { display: grid; gap: 7px; margin-bottom: 15px; color: #626e7c; font-size: 12px; }
.inspiration-settings-grid .wide { grid-column: 1 / -1; }
.inspiration-settings-grid input, .inspiration-settings-grid select, .inspiration-settings-grid textarea { width: 100%; min-height: 41px; border: 1px solid #d5dbe1; border-radius: 6px; outline: none; background: #fff; color: #263241; padding: 9px 11px; }
.inspiration-settings-grid textarea { min-height: 72px; resize: vertical; }
.inspiration-settings-grid .switch-row { display: grid; }
.admin-home-section { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 0 0 22px; }
.admin-home-section + .admin-home-section { padding-top: 24px; border-top: 1px solid #e5e8ec; }
.admin-home-section h3, .admin-home-section > p, .admin-home-section > .admin-hero-preview, .admin-home-section > .admin-media-actions, .admin-home-section > .admin-feature-list { grid-column: 1 / -1; }
.admin-home-section h3 { margin: 0 0 16px; font-size: 15px; }
.admin-home-section > p { margin: -8px 0 16px; color: #8a94a1; font-size: 11px; }
.admin-hero-preview { min-height: 220px; display: grid; place-items: center; overflow: hidden; margin-bottom: 10px; border: 1px solid #dce1e6; border-radius: 7px; background: #11161d; color: #8c96a2; }
.admin-hero-preview img, .admin-hero-preview video { width: 100%; max-height: 360px; display: block; object-fit: cover; }
.admin-hero-preview.empty { background: #f7f9fa; }
.admin-media-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.admin-media-actions button { min-height: 36px; border: 1px solid #ccd4dc; border-radius: 6px; background: #fff; color: #3f4c5d; padding: 0 12px; cursor: pointer; }
.admin-media-actions span { color: #929ca8; font-size: 10px; }
.admin-feature-list { display: grid; gap: 8px; }
.admin-feature-row { display: grid; grid-template-columns: 76px 1fr 1.5fr 140px; gap: 8px; align-items: center; padding: 10px; border: 1px solid #e0e4e8; border-radius: 7px; background: #f8f9fa; }
.admin-feature-row strong { color: #697584; font-size: 11px; }
.admin-feature-row input, .admin-feature-row select { min-width: 0; min-height: 38px; border: 1px solid #d5dbe1; border-radius: 6px; background: #fff; color: #263241; padding: 8px 10px; }
.publication-admin-card { margin-top: 18px; }
.publication-heading { align-items: flex-start; }
.admin-button-link { min-height: 36px; display: inline-flex; align-items: center; border: 1px solid #ccd4dc; border-radius: 6px; background: #fff; color: #34475a; padding: 0 13px; font: inherit; font-size: 12px; text-decoration: none; }
.admin-button-link:hover { border-color: #7f96a8; color: #163f53; }
.publication-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.publication-metric-grid article { min-width: 0; display: grid; gap: 8px; border: 1px solid #dfe3e8; border-radius: 7px; background: #fff; padding: 15px; }
.publication-metric-grid article > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.publication-metric-grid article span { color: #738092; font-size: 11px; font-weight: 700; }
.publication-metric-grid article em { overflow: hidden; color: #98a2b3; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.publication-metric-grid article strong { overflow: hidden; color: #172231; font-size: 23px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.publication-metric-grid article small { color: #8b95a2; font-size: 10px; line-height: 1.45; }
.publication-metric-grid article.deleted { border-color: #ebc0c6; background: #fff6f7; }
.publication-metric-grid article.deleted > strong { color: #a34051; }
.publication-metric-grid article.pending { border-color: #efd79d; background: #fffaf0; }
.publication-metric-grid article.pending > strong { color: #a46b10; }
.publication-filter-card, .publication-list-card { margin-bottom: 18px; }
.publication-filter-grid { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(5, minmax(128px, .8fr)); gap: 14px 16px; padding: 18px; }
.publication-filter-grid label { min-width: 0; display: grid; gap: 6px; color: #667085; font-size: 10px; font-weight: 700; }
.publication-filter-grid input, .publication-filter-grid select { width: 100%; min-width: 0; }
.publication-filter-keyword { grid-column: span 2; }
.publication-filter-actions { display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.publication-table { min-width: 1460px; table-layout: fixed; }
.publication-table th, .publication-table td { padding: 10px 8px; vertical-align: top; }
.publication-check-cell { width: 36px; }
.publication-work-cell { width: 330px; white-space: normal; }
.publication-author-cell { width: 150px; }
.publication-table td:nth-child(4) { width: 145px; }
.publication-table td:nth-child(5) { width: 185px; }
.publication-table td:nth-child(6) { width: 170px; }
.publication-table td:nth-child(7) { width: 135px; }
.publication-table td:nth-child(8) { width: 390px; }
.publication-work { min-width: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; align-items: center; }
.publication-work > div:last-child { min-width: 0; }
.publication-work strong, .publication-work small, .publication-work code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publication-work small { margin-top: 3px; color: #7f8b98; }
.publication-work code { margin-top: 4px; color: #9aa4af; font: 9.5px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.publication-thumb { position: relative; width: 68px; height: 68px; overflow: hidden; border: 1px solid #dce1e6; border-radius: 6px; background: #111820; }
.publication-thumb img, .publication-thumb video { width: 100%; height: 100%; display: block; object-fit: cover; }
.publication-thumb.empty { display: grid; place-items: center; background: #f2f4f7; color: #7f8b98; font-size: 10px; }
.publication-media-kind { position: absolute; right: 4px; bottom: 4px; border-radius: 3px; background: rgba(12, 20, 28, .74); color: #fff; padding: 2px 4px; font-size: 9px; line-height: 1.2; }
.publication-status-line { display: flex; flex-wrap: wrap; gap: 5px; }
.publication-row-actions { flex-wrap: wrap; gap: 4px; }
.publication-row-actions button { min-height: 28px; padding: 0 6px; font-size: 10.5px; white-space: nowrap; }
.publication-deleted-row { background: #fff8f9; }
.publication-selection-actions { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.publication-selection-actions button { min-height: 30px; padding: 0 9px; }
.publication-detail-modal { width: min(920px, 100%); }
.publication-detail-body { display: grid; gap: 16px; }
.publication-detail-preview { display: grid; place-items: center; min-height: 260px; max-height: 520px; overflow: hidden; border-radius: 7px; background: #0d141c; }
.publication-detail-media { position: relative; width: 100%; max-height: 520px; display: grid; place-items: center; }
.publication-detail-media img, .publication-detail-media video { width: 100%; max-height: 520px; display: block; object-fit: contain; }
.publication-detail-media audio { width: min(560px, calc(100% - 40px)); }
.publication-detail-media.empty { min-height: 180px; color: #91a0ae; }
.publication-detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #e3e7eb; border-radius: 7px; overflow: hidden; }
.publication-detail-summary > div { min-width: 0; display: grid; gap: 5px; border-right: 1px solid #edf0f2; border-bottom: 1px solid #edf0f2; padding: 11px 13px; }
.publication-detail-summary span { color: #82909e; font-size: 10px; }
.publication-detail-summary strong { color: #2b3a49; font-size: 12px; line-height: 1.45; }
.publication-detail-section { border-top: 1px solid #edf0f2; padding-top: 12px; }
.publication-detail-section h3 { margin: 0 0 7px; color: #354455; font-size: 12px; }
.publication-detail-section p { margin: 0; color: #516071; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.publication-detail-section.danger p { color: #a34051; }
.publication-detail-section dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.publication-detail-section dl > div { min-width: 0; }
.publication-detail-section dt { color: #8793a0; font-size: 10px; }
.publication-detail-section dd { margin: 3px 0 0; color: #354455; font-size: 12px; overflow-wrap: anywhere; }
.publication-detail-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 15px; padding: 12px; border: 1px solid #e1e5e9; border-radius: 6px; }
.publication-detail-options legend { padding: 0 6px; color: #667085; font-size: 11px; font-weight: 700; }
.publication-detail-options label { display: flex !important; align-items: center; gap: 7px; margin: 0; padding: 8px 9px; border: 1px solid #e3e7eb; border-radius: 6px; background: #f8fafc; color: #374151; cursor: pointer; }
.publication-detail-options input { width: 16px !important; min-width: 16px; min-height: 16px !important; margin: 0; padding: 0; }
@media (max-width: 1500px) {
  .publication-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .publication-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .publication-filter-keyword { grid-column: span 2; }
}
@media (max-width: 900px) {
  .publication-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publication-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publication-filter-keyword { grid-column: span 2; }
  .publication-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .publication-metric-grid, .publication-filter-grid, .publication-detail-summary, .publication-detail-section dl, .publication-detail-options { grid-template-columns: 1fr; }
  .publication-filter-keyword { grid-column: auto; }
}
.admin-login { min-height: 100vh; display: grid; place-items: center; background: #111a26; }
.admin-login form { width: 390px; padding: 32px; border: 1px solid #2e3b4b; border-radius: 8px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.admin-login-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 34px; }
.admin-login-brand .admin-brand-logo { width: 136px !important; height: 136px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.admin-login-brand strong { color: #f8fafc; font-size: 30px; line-height: 1.2; }
.admin-login-brand small { color: #c3ccd8; }
.admin-login h1 { margin: 0 0 6px; color: #1d2835; font-size: 25px; }
.admin-login > form > p { margin: 0 0 22px; color: #87919d; font-size: 12px; }
.admin-login label { display: grid; gap: 7px; margin-bottom: 15px; color: #5f6b79; font-size: 12px; }
.admin-login input { height: 44px; border: 1px solid #d5dae0; border-radius: 6px; outline: 0; padding: 0 11px; }
.admin-login form > button { width: 100%; height: 44px; border: 0; border-radius: 6px; background: #152c3b; color: #fff; cursor: pointer; }
.admin-error { margin-bottom: 14px; padding: 9px; border-radius: 5px; background: #f8e8eb; color: #a03e50; font-size: 12px; }

@media (max-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .model-admin-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .settings-two-columns, .site-media-grid { grid-template-columns: 1fr; }
  .settings-two-columns .wide { grid-column: auto; }
  .site-media-grid { gap: 14px; }
  .dashboard-trend-card > header { align-items: flex-start; flex-direction: column; }
  .trend-summary { flex-direction: column; gap: 6px; }
  .model-recent-health-group { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-body { min-width: 0; }
  .admin-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .admin-sidebar { width: 72px; padding: 0 8px 12px; }
  .admin-brand { justify-content: center; padding: 0; }
  .admin-brand > div { display: none; }
  .admin-sidebar nav { min-height: 0; overflow-y: auto; margin-top: 12px; scrollbar-width: none; }
  .admin-sidebar nav::-webkit-scrollbar { display: none; }
  .admin-sidebar nav button { width: 56px; justify-content: center; padding: 0; }
  .admin-sidebar nav button span,
  .admin-sidebar-bottom span { display: none; }
  .admin-sidebar nav button i,
  .admin-sidebar-bottom i { width: auto; margin: 0; }
  .admin-sidebar-bottom a,
  .admin-sidebar-bottom button { justify-content: center; padding: 0; }
  .admin-topbar { padding: 0 16px; }
  .admin-page { padding: 18px 16px; }
  .metric-grid,
  .metric-grid.economics,
  .model-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .admin-shell { grid-template-columns: 58px minmax(0, 1fr); }
  .admin-sidebar { width: 58px; padding: 0 5px 8px; }
  .admin-brand { height: 58px; }
  .admin-sidebar nav button { width: 48px; height: 39px; }
  .admin-topbar { height: 58px; padding: 0 12px; }
  .admin-topbar > span,
  .admin-topbar small { display: none; }
  .admin-page { padding: 12px 10px 20px; }
  .admin-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .admin-heading-actions { overflow-x: auto; }
  .metric-grid,
  .metric-grid.economics,
  .admin-modal-backdrop { align-items: start; padding: 8px; }
  .admin-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 16px 14px; }
  .automation-log-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-approval-row { grid-template-columns: minmax(0, 1fr) auto; }
  .automation-approval-row .table-actions { grid-column: 1 / -1; }
  .admin-modal > header { gap: 10px; margin-bottom: 16px; }
  .admin-modal#membershipForm #membershipFields { grid-template-columns: minmax(0, 1fr); }
  .membership-tier-discount-grid { grid-template-columns: 1fr; }
  .model-form-grid { grid-template-columns: minmax(0, 1fr); }
  .model-form-grid .wide { grid-column: auto; }
  .provider-model-picker { grid-template-columns: minmax(0, 1fr) 1fr; }
  .provider-model-picker select { grid-column: 1 / -1; }
  .provider-model-picker button { min-width: 0; white-space: normal; }
  .admin-modal footer { align-items: stretch; flex-direction: column-reverse; }
  .admin-modal footer button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .generation-loading-surface, .generation-loading-surface::before, .generation-loading-surface::after { animation-duration: 12s; }
  .home-hero-media img, .home-hero-media video { animation: none; transform: none; }
}

/* Client visual refresh */
:root {
  --client-bg: #090b0e;
  --client-panel: #12151a;
  --client-panel-raised: #171b21;
  --client-panel-hover: #1c2128;
  --client-line: rgba(187, 200, 214, .13);
  --client-line-strong: rgba(187, 200, 214, .22);
  --client-text: #f2f4f6;
  --client-muted: #818a96;
  --client-cyan: #91d8e5;
  --client-green: #6bc9a4;
  --client-warm: #d8b878;
}

.client-body,
.client-body .workspace,
.client-body .inspiration-stage,
.client-body .profile-stage,
.client-body .asset-stage { background: var(--client-bg); }

.client-body .studio-shell { grid-template-columns: 72px 228px minmax(0, 1fr); background: var(--client-bg); }
.client-body .studio-shell.view-inspire,
.client-body .studio-shell.sidebar-collapsed { grid-template-columns: 72px 0 minmax(0, 1fr); }
.client-body .studio-shell.view-canvas { grid-template-columns: 72px 0 minmax(0, 1fr); }
.client-body .studio-shell.view-canvas .conversation-sidebar { visibility: hidden; width: 0; min-width: 0; opacity: 0; overflow: hidden; padding-left: 0; padding-right: 0; border: 0; pointer-events: none; }
.client-body .studio-shell.view-canvas .workspace { grid-column: 3; }
.client-body .studio-shell.canvas-editor-active { grid-template-columns: 0 0 minmax(0, 1fr); }
.client-body .studio-shell.canvas-editor-active .tool-rail { visibility: hidden; width: 0; min-width: 0; opacity: 0; overflow: hidden; padding-left: 0; padding-right: 0; border: 0; pointer-events: none; }
.client-body .studio-shell.canvas-editor-active .conversation-sidebar { visibility: hidden; width: 0; min-width: 0; opacity: 0; overflow: hidden; padding-left: 0; padding-right: 0; border: 0; pointer-events: none; }
.client-body .studio-shell.canvas-editor-active .workspace { grid-column: 3; }
/* The embedded editor owns the full viewport. Keep the host search/filter
   toolbar out of the editor's top-right controls; it otherwise sits above
   the iframe and hides the canvas "回到主页" / "退出画布" actions. */
.client-body .studio-shell.canvas-editor-active .workspace-toolbar { visibility: hidden; opacity: 0; pointer-events: none; }
.embedded-canvas-stage { position: relative; display: flex; align-items: stretch; width: 100%; height: 100vh; overflow: hidden; background: #171817; }
.embedded-canvas-stage::before { content: ""; position: absolute; z-index: 2; inset: 0; background: #171817; pointer-events: none; opacity: 1; transition: opacity .12s ease; }
.embedded-canvas-stage.is-ready::before { opacity: 0; }
.embedded-canvas-loading { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: rgba(255,255,255,.76); font-size: 14px; pointer-events: none; opacity: 1; transition: opacity .12s ease; }
.embedded-canvas-stage.is-ready .embedded-canvas-loading { opacity: 0; }
.embedded-canvas-spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.16); border-top-color: #67e8f9; border-radius: 999px; animation: embedded-canvas-spin .8s linear infinite; }
@keyframes embedded-canvas-spin { to { transform: rotate(360deg); } }
.embedded-canvas-stage iframe { display: block; flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; border: 0; background: #171817; opacity: 0; transition: opacity .12s ease; }
.embedded-canvas-stage iframe.is-ready { opacity: 1; }
/* Migrated from the original canvas-assistant-panel: a sibling drawer that
   grows from zero width and keeps the canvas visible beside it. */
.canvas-agent-drawer { position: relative; z-index: 12; flex: 0 0 var(--canvas-agent-width, 440px); width: var(--canvas-agent-width, 440px); min-width: 0; height: 100%; overflow: hidden; animation: canvas-agent-drawer-in .5s cubic-bezier(.22,1,.36,1) both; }
.canvas-agent-drawer.is-closing { animation: canvas-agent-drawer-out .5s cubic-bezier(.4,0,.6,1) both; pointer-events: none; }
@keyframes canvas-agent-drawer-in { from { width: 0; opacity: 0; } to { width: var(--canvas-agent-width, 440px); opacity: 1; } }
@keyframes canvas-agent-drawer-out { from { width: var(--canvas-agent-width, 440px); opacity: 1; } to { width: 0; opacity: 0; } }
.canvas-agent-panel { position: relative; width: var(--canvas-agent-width, 440px); height: 100%; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid rgba(255,255,255,.12); background: #20211f; color: #f1f1ed; box-shadow: -14px 0 32px rgba(0,0,0,.2); transform-origin: right center; animation: canvas-agent-panel-slide-in .5s cubic-bezier(.22,1,.36,1) both; }
.canvas-agent-drawer.is-closing .canvas-agent-panel { animation: canvas-agent-panel-slide-out .5s cubic-bezier(.4,0,.6,1) both; }
@keyframes canvas-agent-panel-slide-in { from { transform: translateX(48px); } to { transform: translateX(0); } }
@keyframes canvas-agent-panel-slide-out { from { transform: translateX(28px); } to { transform: translateX(0); } }
.canvas-agent-resize-handle { position: absolute; inset: 0 auto 0 -5px; z-index: 3; width: 10px; border: 0; background: transparent; cursor: col-resize; }
.canvas-agent-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.1); background: #20211f; }
.canvas-agent-panel-title { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14px; font-weight: 600; }
.canvas-agent-bot-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #30332e; color: #bde4c8; font-size: 15px; }
.canvas-agent-panel-actions { display: flex; align-items: center; gap: 3px; }
.canvas-agent-icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #a7aaa4; cursor: pointer; font-size: 18px; line-height: 1; }
.canvas-agent-icon-button:hover:not(:disabled) { background: #30332e; color: #f3f5ef; }
.canvas-agent-icon-button:disabled { cursor: default; opacity: .35; }
.canvas-agent-panel-content { min-height: 0; flex: 1 1 auto; overflow: auto; padding: 0 14px; background: #20211f; }
.canvas-agent-feed { width: 100%; display: grid; gap: 18px; padding: 18px 0 20px; }
.canvas-agent-empty { display: grid; justify-items: center; gap: 8px; height: 100%; margin: 0 8px; color: #a3a69e; text-align: center; align-content: center; }
.canvas-agent-empty span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #30332e; color: #bde4c8; font-size: 21px; }
.canvas-agent-empty strong { color: #f0f2ec; font-size: 15px; }
.canvas-agent-empty p { max-width: 270px; margin: 0; font-size: 12px; line-height: 1.6; }
.canvas-agent-panel .agent-chat-avatar,
.canvas-agent-panel .agent-chat-body > header { display: none; }
.canvas-agent-panel .agent-chat-message { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.canvas-agent-panel .agent-chat-message.user { align-items: flex-end; }
.canvas-agent-panel .agent-chat-body { max-width: 100%; }
.canvas-agent-panel .canvas-agent-message-state { margin: 2px 0 6px; color: #8d98a3; font-size: 11px; }
.canvas-agent-panel .canvas-agent-message-state.is-error { color: #d79a9a; }
.canvas-agent-panel .agent-chat-bubble { border-color: rgba(255,255,255,.12); background: #2b2d29; color: #eef0ea; padding: 9px 12px; font-size: 13px; line-height: 1.65; }
.canvas-agent-panel .agent-chat-message.user .agent-chat-bubble { border-color: rgba(189,228,200,.25); background: #36443a; color: #f1f5ef; }
.canvas-agent-panel .agent-chat-thinking { margin-left: 34px; font-size: 12px; }
.canvas-agent-composer { position: relative; flex: 0 0 auto; margin: 0 10px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: #292b27; padding: 10px 11px 9px; }
.canvas-agent-composer textarea { display: block; width: 100%; min-height: 76px; max-height: 280px; resize: vertical; overflow-y: hidden; border: 0; outline: 0; background: transparent; color: #f1f3ed; font: inherit; font-size: 13px; line-height: 1.55; }
.canvas-agent-composer textarea::placeholder { color: #8e948b; }
.canvas-agent-toolbar { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.canvas-agent-model-select { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; gap: 5px; color: #8e948b; font-size: 10px; }
.canvas-agent-model-select select { min-width: 0; max-width: 180px; flex: 1 1 auto; height: 30px; border: 0; outline: 0; border-radius: 8px; background: #343730; color: #e9eee7; padding: 0 8px; font: inherit; font-size: 11px; }
.canvas-agent-tool-button { flex: 0 0 auto; height: 30px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: transparent; color: #b9beb4; padding: 0 9px; font: inherit; font-size: 11px; cursor: pointer; }
.canvas-agent-tool-button:hover { border-color: rgba(189,228,200,.45); background: #343730; color: #f1f4ed; }
.canvas-agent-send-button { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #bde4c8; color: #1b281f; cursor: pointer; font-size: 16px; }
.canvas-agent-send-button:disabled { cursor: default; opacity: .45; }
.canvas-agent-skill-menu { left: auto; right: 10px; bottom: 56px; width: min(300px, calc(100% - 20px)); border-color: rgba(255,255,255,.16); background: #2b2d29; }
.canvas-agent-history-list { display: grid; gap: 5px; padding: 16px 0; }
.canvas-agent-history-item { display: grid; gap: 3px; border: 0; border-radius: 10px; background: transparent; color: #e8ebe4; padding: 10px; text-align: left; cursor: pointer; }
.canvas-agent-history-item:hover { background: #2b2d29; }
.canvas-agent-history-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.canvas-agent-history-item time { color: #8d948a; font-size: 10px; }
.canvas-agent-history-empty { padding-top: 28px; color: #91978e; font-size: 12px; text-align: center; }
@media (max-width: 700px) { .embedded-canvas-stage { display: block; } .canvas-agent-drawer { position: absolute; inset: 0 0 0 auto; width: min(var(--canvas-agent-width, 440px), 100%); } .canvas-agent-panel { width: 100%; } .canvas-agent-panel-content { padding: 0 10px; } .canvas-agent-composer { margin: 0 8px 8px; } }

/* Keep the workspace in the visible track when the hidden sidebars are
   removed by responsive layouts. */
@media (max-width: 820px) {
  .client-body .studio-shell.view-canvas .workspace,
  .client-body .studio-shell.canvas-editor-active .workspace { grid-column: 2; }
}
@media (max-width: 600px) {
  .client-body .studio-shell.view-canvas .workspace,
  .client-body .studio-shell.canvas-editor-active .workspace { grid-column: 1; }
}
.client-body .tool-rail { background: #101216; border-right-color: var(--client-line); padding-top: 18px; }
.client-body .rail-logo { height: 72px; }
.client-body .rail-logo .brand-logo { filter: drop-shadow(0 7px 14px rgba(216, 184, 120, .16)); }
.client-body .rail-button { min-height: 66px; color: #8c949f; }
.client-body .rail-button > span:first-child { font-size: 23px; }
.client-body .rail-button > span:last-child { font-size: 11px; }
.client-body .rail-button:hover { background: transparent; color: #eef1f4; }
.client-body .rail-button.active { color: #f5f6f7; }
.client-body .rail-button.active::before { top: 15px; bottom: 15px; width: 2px; background: var(--client-green); box-shadow: 0 0 12px rgba(107, 201, 164, .42); }
.client-body .credit-rail { width: 58px; height: 52px; border-color: rgba(145, 216, 229, .2); background: #10181b; }
.client-body .credit-rail strong { color: var(--client-cyan); }
.client-body .avatar-button { background: #5f7180; }

.client-body .conversation-sidebar { background: #121418; border-right-color: var(--client-line); padding: 0 10px 16px; }
.client-body .conversation-sidebar header { height: 60px; padding: 0 8px; }
.client-body .conversation-sidebar header > div { font-size: 14px; }
.client-body .new-chat { height: 43px; padding: 0 7px; }
.client-body .new-chat-icon { width: 32px; height: 32px; background: #202329; }
.client-body .default-chat,
.client-body .conversation-item { border: 1px solid transparent; }
.client-body .default-chat:hover,
.client-body .default-chat.active,
.client-body .conversation-item:hover,
.client-body .conversation-item.active { border-color: rgba(187, 200, 214, .08); background: #202329; }
.client-body .conversation-label { padding-top: 16px; color: #666e78; }

.client-body .workspace-toolbar { top: 18px; right: 20px; min-height: 44px; padding: 4px; border-color: var(--client-line); background: rgba(18, 21, 26, .88); box-shadow: 0 10px 28px rgba(0, 0, 0, .26); backdrop-filter: blur(18px); }
.client-body .search-box,
.client-body .toolbar-filter,
.client-body .toolbar-assets,
.client-body .toolbar-select { height: 34px; }
.client-body .account-pill { height: 34px; background: #20252b; }
.client-body .account-pill span { color: var(--client-cyan); }

.client-body .creative-stage { padding: 64px 42px 208px; }
.client-body .generation-feed { width: min(1040px, 100%); gap: 38px; }
.client-body .generation-item { scroll-margin-block: 100px 190px; }
.client-body .generation-meta { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; margin: 0 2px 11px; }
.client-body .prompt-avatar { width: 40px; height: 40px; border-color: var(--client-line); background: #171c22; color: var(--client-cyan); font-size: 18px; }
.client-body .task-prompt-clamped { height: 32px; font-size: 13px; }
.client-body .generation-meta small { color: #727b87; font-size: 11px; }
.client-body .task-status { border-color: var(--client-line); background: rgba(18, 21, 26, .72); }
.client-body .task-status.completed { border-color: rgba(107, 201, 164, .3); color: var(--client-green); }
.client-body .task-failure-compact { justify-self: end; display: grid; justify-items: end; gap: 8px; }
.client-body .task-failure-badge { height: 30px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(242, 101, 112, .3); border-radius: 7px; background: rgba(92, 29, 37, .22); color: #ff9099; padding: 0 10px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.client-body .task-failure-badge b { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #e1515f; color: #fff; font-size: 12px; }
.client-body .task-failure-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.client-body .task-failure-buttons > button,
.client-body .task-failure-buttons > .task-more-menu > summary { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--client-line); border-radius: 7px; background: #15181d; color: #b8bec7; padding: 0 9px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.client-body .task-failure-buttons > button:hover,
.client-body .task-failure-buttons > .task-more-menu > summary:hover { border-color: rgba(242, 101, 112, .3); background: #24191d; color: #ffd9dd; }
.client-body .task-failure-buttons > .task-more-menu > summary { width: 34px; padding: 0; }
.client-body .task-failure-reason { max-width: 720px; display: block; overflow: hidden; margin-top: 5px; color: #ff5b68 !important; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.client-body .generation-results { gap: 10px; margin-left: 54px; }
.client-body .generation-results.count-1 .generation-result-card { width: min(560px, 100%, var(--result-fit-width, 560px)); }
.client-body .generation-output { border-color: var(--client-line); border-radius: 7px; background: #101217; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.client-body .generation-output.image:not(.pending):not(.loading) { aspect-ratio: auto !important; overflow: visible; border-color: transparent; background: transparent; box-shadow: none; }
.client-body .generation-output.image:not(.pending):not(.loading) .media-preview-trigger { height: auto; display: block; overflow: hidden; border-radius: 7px; background: transparent; }
.client-body .generation-output.image:not(.pending):not(.loading) img { width: 100%; height: auto; max-height: 620px; object-fit: contain; border-radius: 7px; background: transparent; }
.client-body .generation-output.video video { background: #0d0f12; }
.client-body .generation-primary-actions { margin-top: 7px; }
.client-body .generation-primary-actions { margin-left: 62px; }
.client-body .generation-primary-actions > button,
.client-body .task-more-menu > summary { min-height: 31px; border-color: var(--client-line); background: #15181d; color: #aeb5be; }
.client-body .generation-primary-actions > button:hover,
.client-body .task-more-menu > summary:hover,
.client-body .task-more-menu[open] > summary { background: #20252b; color: #f3f5f6; }
.client-body .result-media-tools { border-color: rgba(255, 255, 255, .16); background: rgba(12, 15, 19, .82); }

.client-body .prompt-composer { bottom: 20px; width: min(1120px, calc(100% - 40px)); min-height: 196px; border-color: #30333a; border-radius: 24px; background: rgba(28, 29, 34, .98); box-shadow: 0 20px 58px rgba(0, 0, 0, .5); backdrop-filter: blur(20px); }
.client-body .prompt-composer.expanded { width: min(1080px, calc(100% - 40px)); }
.client-body .prompt-composer.compact { width: min(820px, calc(100% - 48px)); min-height: 68px; border-radius: 14px; }
.client-body .prompt-composer.compact .composer-main { min-height: 66px; grid-template-columns: 42px minmax(0, 1fr) 44px; gap: 12px; padding: 7px 12px; }
.client-body .prompt-composer.compact .prompt-rich-editor { height: 50px; min-height: 50px; line-height: 50px; color: #d7dbe0; font-size: 14px; }
.client-body .prompt-composer.compact .attach-button:not(.has-reference),
.client-body .prompt-composer.compact .composer-mode-icon { width: 38px; height: 48px; border-color: var(--client-line); background: #25292f; }
.client-body .prompt-composer.compact .composer-compact-submit { width: 44px; height: 44px; background: #f1f3f4; }
.client-body .composer-main { min-height: 136px; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 22px 24px 8px; }
.client-body .composer-toolbar { min-height: 62px; padding: 8px 24px 18px; }
.client-body .attach-button { width: 62px; height: 72px; align-self: start; border-radius: 6px; background: #343840; }
.client-body .attach-button.has-reference { border: 0; background: transparent; }
.client-body .composer-reference-thumb { position: relative; width: 58px; height: 68px; display: block; transform: rotate(-4deg); border: 2px solid #d8dde2; border-radius: 3px; background: #252b32; box-shadow: 0 7px 14px rgba(0, 0, 0, .32); }
.client-body .composer-reference-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 2px; }
.client-body .composer-reference-thumb b { position: absolute; right: -14px; bottom: -10px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #59616c; border-radius: 50%; background: #444a54; color: #f1f3f5; font-size: 20px; font-weight: 400; line-height: 1; }
.client-body .composer-reference-stack { position: relative; width: 70px; height: 76px; display: block; overflow: visible; background: transparent; }
.client-body .attach-button.has-reference { width: 74px; min-width: 74px; border: 0; background: transparent; }
/* Keep the reference stack clear of the prompt text. The visual stack may
   overflow its grid column, so shift it left without changing the editor's
   available width or the clickable column itself. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .attach-button.has-reference {
  transform: translateX(-14px);
}
.client-body .attach-button.has-reference { overflow: visible; }
.client-body .attach-button.has-reference:focus,
.client-body .attach-button.has-reference:focus-visible { outline: none; }
.client-body .attach-button.has-reference:focus-visible .composer-reference-stack-item:first-child { box-shadow: 0 5px 12px rgba(0, 0, 0, .3), 0 0 0 2px rgba(112, 205, 220, .72); }
.client-body .attach-button.has-reference:focus,
.client-body .attach-button.has-reference:focus-visible { outline: none; }
.client-body .attach-button.has-reference:focus-visible .composer-reference-stack-item:first-child { box-shadow: 0 5px 12px rgba(0, 0, 0, .3), 0 0 0 2px rgba(112, 205, 220, .72); }
.client-body .composer-reference-stack-item { position: absolute; z-index: calc(4 - var(--stack-index)); left: calc(var(--stack-index) * 7px); top: calc(var(--stack-index) * 2px); width: 52px; height: 64px; display: block; transform: rotate(calc(-5deg + var(--stack-index) * 3deg)); border: 2px solid #d8dde2; border-radius: 3px; background: #252b32; box-shadow: 0 5px 12px rgba(0, 0, 0, .3); }
.client-body .composer-reference-stack-item img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 2px; }
.client-body .composer-reference-stack-item video { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 2px; background: #000; }
.reference-preview-fallback { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 2px; background: #252b32; color: #b8c0c9; font-size: 10px; font-weight: 600; }
.reference-upload-overlay { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: inherit; background: rgba(15, 20, 27, .76); color: #e8eef5; pointer-events: none; }
.reference-upload-overlay i { width: 17px; height: 17px; box-sizing: border-box; border: 2px solid rgba(225, 235, 247, .26); border-top-color: #a9d8ee; border-radius: 50%; animation: composer-upload-spin .8s linear infinite; }
.reference-upload-overlay b { font-size: 9px; font-weight: 600; line-height: 1; }
.frame-upload-slot.is-uploading { position: relative; }
.frame-upload-slot .reference-upload-overlay { border-radius: 5px; }
.client-body .composer-reference-remove { position: absolute; z-index: 4; top: -7px; right: -7px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #59616c; border-radius: 50%; background: #252a31; color: #f1f3f5; padding: 0; font-size: 13px; line-height: 1; cursor: pointer; }
.client-body .composer-reference-remove:hover { border-color: #e58b96; background: #63343d; color: #fff; }
.client-body .composer-reference-hover { position: absolute; z-index: 100; left: -12px; bottom: 82px; display: none; align-items: center; gap: 6px; width: max-content; max-width: 250px; border: 1px solid #3d4650; border-radius: 9px; background: #20252c; padding: 8px; box-shadow: 0 16px 38px rgba(0, 0, 0, .52); pointer-events: none; }
.client-body .composer-reference-hover img { width: 48px; height: 58px; display: block; object-fit: cover; border: 1px solid #c5ccd4; border-radius: 3px; }
.client-body .composer-reference-hover-item { position: relative; display: block; flex: 0 0 auto; }
.client-body .composer-reference-hover-item .composer-reference-remove { top: -7px; right: -7px; width: 18px; height: 18px; font-size: 12px; pointer-events: auto; }
.client-body .composer-reference-stack:hover .composer-reference-hover { display: inline-flex; }
.client-body .attach-button.has-reference:hover .composer-reference-hover { display: inline-flex; }
/* Portaled reference preview (the script moves it to body while hovered). */
.composer-reference-hover[data-reference-hover-open="true"] { z-index: 1000; align-items: center; gap: 6px; width: max-content; max-width: min(360px, calc(100vw - 20px)); border: 1px solid #3d4650; border-radius: 9px; background: #20252c; padding: 8px; box-shadow: 0 16px 38px rgba(0, 0, 0, .52); pointer-events: auto; }
.composer-reference-hover[data-reference-hover-open="true"] img { width: 48px; height: 58px; display: block; object-fit: cover; border: 1px solid #c5ccd4; border-radius: 3px; }
.composer-reference-hover[data-reference-hover-open="true"] .composer-reference-hover-item { position: relative; display: block; flex: 0 0 auto; }
.composer-reference-hover[data-reference-hover-open="true"] .composer-reference-hover-item .composer-reference-remove { top: -7px; right: -7px; pointer-events: auto; }
.client-body .prompt-rich-editor { height: 98px; font-size: 16px; line-height: 1.7; }
.client-body .prompt-composer.expanded:not(.maximized) { min-height: 360px; }
.client-body .prompt-composer.expanded:not(.maximized) .composer-main { min-height: 290px; }
.client-body .prompt-composer.expanded:not(.maximized) .prompt-rich-editor { height: 232px; }
.client-body .select-chip,
.client-body .generation-spec-chip,
.client-body .model-picker-trigger { height: 38px; border-color: var(--client-line); border-radius: 7px; background: rgba(13, 15, 19, .3); }
.client-body .model-picker-trigger { min-width: 380px; max-width: 460px; }
.client-body .send-button { width: 44px; height: 44px; }
.client-body .generation-spec-panel,
.client-body .model-picker-menu { border-color: var(--client-line-strong); border-radius: 8px; background: #181b20; }

.client-body .home-hero-shade { background: linear-gradient(180deg, rgba(3, 6, 10, .06) 0%, rgba(3, 6, 10, .04) 56%, rgba(3, 6, 10, .24) 100%); box-shadow: inset 0 -90px 110px rgba(2, 5, 9, .16); }
.client-body .home-hero-copy { width: min(1040px, calc(100% - 72px)); }
.client-body .home-hero-copy > span { color: #b8e7ea; letter-spacing: 0; }
.client-body .home-hero-copy h1 { margin: 18px 0 14px; font-size: 58px; font-weight: 680; line-height: 1.14; letter-spacing: 0; }
.client-body .home-hero-copy p { margin-bottom: 30px; font-size: 16px; }
.client-body .home-hero-copy button { min-width: 182px; height: 50px; border-color: rgba(255, 255, 255, .5); background: rgba(12, 15, 19, .5); }
.client-body .home-section { width: min(1320px, calc(100% - 64px)); padding: 48px 0; }
.client-body .home-section + .home-section { border-top-color: var(--client-line); }
.client-body .home-section > header { margin-bottom: 20px; }
.client-body .home-section > header h2 { font-size: 24px; }
.client-body .home-feature-card { min-height: 116px; border-color: var(--client-line); background: var(--client-panel-raised); }
.client-body .home-feature-card:hover { border-color: rgba(145, 216, 229, .38); background: var(--client-panel-hover); }
.client-body .home-feature-card > span { background: #223038; color: var(--client-cyan); }
.client-body .home-feature-card:nth-child(2) > span { background: #302a22; color: var(--client-warm); }
.client-body .home-feature-card:nth-child(3) > span { background: #1d3029; color: var(--client-green); }
.client-body .home-model-card { min-height: 136px; border-color: var(--client-line); background: #111419; }
.client-body .home-model-card:hover { border-color: var(--client-line-strong); background: #15191e; }
.client-body .home-model-card > b { color: var(--client-cyan); }
.client-body .inspiration-card { border-color: var(--client-line); background: var(--client-panel); }

.client-body .asset-stage { padding: 96px 34px 56px; }
.client-body .asset-library-header,
.client-body .asset-filter-bar,
.client-body .asset-date-groups { width: min(1320px, 100%); }
.client-body .asset-stage {
  box-sizing: border-box;
  padding-inline: max(34px, calc((100% - 1320px) / 2));
}
.client-body .asset-library-header,
.client-body .asset-filter-bar,
.client-body .asset-date-groups { margin-inline: auto; }
.client-body .asset-library-header { margin-bottom: 18px; }
.client-body .asset-filter-bar { margin-bottom: 24px; }
.client-body .asset-date-groups { gap: 32px; }
.client-body .asset-date-groups section > h2 { font-size: 20px; }
.client-body .asset-gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 12px; }
.client-body .asset-gallery-item { border-color: var(--client-line); background: var(--client-panel); }
.client-body .asset-gallery-item:hover { border-color: var(--client-line-strong); background: var(--client-panel-raised); transform: translateY(-2px); }
.client-body .asset-gallery-media { aspect-ratio: 4 / 3; background: #0f1216; }
.client-body .asset-gallery-media img,
.client-body .asset-gallery-media video { object-fit: cover; }

.client-body .profile-stage { padding: 96px 34px 64px; }
.client-body .profile-header,
.client-body .profile-metrics,
.client-body .profile-panel,
.client-body .profile-publications { max-width: 1200px; }
.client-body .profile-header { margin-bottom: 14px; border: 1px solid var(--client-line); border-radius: 8px; background: var(--client-panel); padding: 18px 20px; }
.client-body .profile-avatar { width: 58px; height: 58px; background: #536a79; }
.client-body .profile-header h1 { font-size: 23px; }
.client-body .profile-metrics { gap: 9px; margin-bottom: 18px; }
.client-body .profile-metrics article { min-height: 94px; align-content: center; border: 1px solid var(--client-line); border-radius: 8px; background: var(--client-panel-raised); padding: 15px 17px; }
.client-body .profile-metrics article:nth-child(1) { border-top-color: rgba(145, 216, 229, .55); }
.client-body .profile-metrics article:nth-child(2) { border-top-color: rgba(107, 201, 164, .55); }
.client-body .profile-metrics article:nth-child(3) { border-top-color: rgba(216, 184, 120, .55); }
.client-body .profile-metrics strong { font-size: 23px; }
.client-body .profile-panel { margin-bottom: 16px; border: 1px solid var(--client-line); border-radius: 8px; background: var(--client-panel); padding: 18px 20px; }
.client-body .profile-panel.image-pass-panel { border-color: rgba(107, 201, 164, .3); background: #14201c; }
.client-body .invite-code-grid article { border-color: var(--client-line); background: #171b20; }
.client-body .profile-table-wrap th,
.client-body .profile-table-wrap td { border-bottom-color: var(--client-line); }
.client-body .profile-publication-list > article { border: 1px solid var(--client-line); border-radius: 7px; background: var(--client-panel); }

.client-body .customer-service-widget { right: 18px; bottom: 18px; }
.client-body .customer-service-trigger { width: 68px; height: 42px; border-color: var(--client-line-strong); border-radius: 8px; background: rgba(24, 28, 34, .94); }
.client-body .customer-service-panel { border-color: var(--client-line-strong); background: #171b20; }
/* Keep the support control out of the canvas Agent composer while its drawer is open. */
.client-body:has(.canvas-agent-drawer) .customer-service-widget { right: auto; left: 18px; }
/* The embedded canvas gets narrower when the Agent drawer opens. Keep the
   support trigger above the canvas task dock so neither control is covered. */
.client-body:has(.studio-shell.view-canvas) .customer-service-widget { right: auto; left: 18px; bottom: 96px; z-index: 90; }
.mobile-navigation { display: none; }

/* Keep the support trigger clear of the fixed generation composer on tablet
   and desktop. The mobile rule below reserves its larger bottom safe area. */
@media (min-width: 601px) {
  .client-body:has(.studio-shell.view-create) .customer-service-widget {
    bottom: var(--client-support-safe-bottom);
  }
}

@media (min-width: 821px) and (max-width: 1200px) {
  .client-body:has(.studio-shell.view-create) .customer-service-widget {
    bottom: var(--client-support-create-bottom);
  }
  .client-body:has(.studio-shell.view-create .prompt-composer.expanded) .customer-service-widget {
    bottom: var(--client-support-create-expanded-bottom);
  }
}

@media (min-width: 601px) {
  .client-body:has(.studio-shell.publication-detail-shell) .customer-service-widget {
    right: auto;
    left: calc(var(--client-rail-width) + var(--space-2));
    bottom: var(--space-4);
  }
}

@media (max-width: 1100px) {
  .client-body .studio-shell { grid-template-columns: 68px 210px minmax(0, 1fr); }
  .client-body .studio-shell.view-inspire,
  .client-body .studio-shell.sidebar-collapsed { grid-template-columns: 68px 0 minmax(0, 1fr); }
  .client-body .creative-stage { padding-left: 26px; padding-right: 26px; }
}

@media (max-width: 820px) {
  .client-body .studio-shell,
  .client-body .studio-shell.view-inspire { grid-template-columns: 64px minmax(0, 1fr); }
  .client-body .creative-stage { padding: 84px 18px 196px; }
  .client-body .generation-result-row,
  .client-body .generation-primary-actions { margin-left: 0; }
  .client-body .generation-results { margin-left: 0; }
  .client-body:has(.studio-shell.view-create) .generation-batch-actions { margin-left: 0; }
  .client-body .home-hero-copy h1 { font-size: 42px; }
  .client-body .home-section { width: calc(100% - 36px); }
  .client-body .asset-stage,
  .client-body .profile-stage { padding: 88px 18px 40px; }
}

@media (max-width: 600px) {
  .client-body .studio-shell,
  .client-body .studio-shell.view-inspire { grid-template-columns: 1fr; }
  /* Canvas is intentionally omitted from the compact mobile navigation.
     Keep the full canvas entry available on desktop without changing its
     route or any of the existing navigation handlers. */
  .client-body .inspiration-top-nav nav button[data-view="canvas"] { display: none; }
  .mobile-navigation { z-index: 70; position: fixed; right: 0; bottom: 0; left: 0; height: 60px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--client-line); background: rgba(15, 18, 23, .97); padding: 4px max(5px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); box-shadow: 0 -12px 34px rgba(0, 0, 0, .34); backdrop-filter: blur(18px); }
  .mobile-nav-button { min-width: 0; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 6px; background: transparent; color: #747e89; font: inherit; cursor: pointer; }
  .mobile-nav-button > span:first-child { font-size: 18px; }
  .mobile-nav-button > span:last-child { overflow: hidden; max-width: 100%; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-button.active { background: #1d2529; color: var(--client-green); }
  .client-body .workspace-toolbar { top: 10px; right: 10px; left: 10px; }
  .client-body .workspace-toolbar .search-box { width: auto; min-width: 0; }
  .client-body .announcement-button { padding: 0 7px; }
  .client-body .announcement-button-label { display: none; }
  .client-body .announcement-button-icon { width: 26px; height: 26px; font-size: 18px; }
  .client-body .announcement-button > i { right: 4px; }
  .client-body .announcement-backdrop { align-items: start; padding: 68px 10px 10px; }
  .client-body .announcement-modal { width: 100%; max-height: calc(100vh - 84px); }
  .client-body .announcement-modal > header { padding: 16px 16px 13px; }
  .client-body .announcement-section { padding: 14px 16px 0; }
  .client-body .announcement-history { padding-bottom: 16px; }
  .client-body .creative-stage { padding: 62px 12px 250px; }
  .client-body .generation-feed { gap: 12px; }
  .client-body .generation-result-row,
  .client-body .generation-primary-actions { margin-left: 0; }
  .client-body .generation-results { margin-left: 0; }
  .client-body:has(.studio-shell.view-create) .generation-batch-actions { margin-left: 0; }
  .client-body .task-failure-compact { grid-column: 2; justify-self: start; justify-items: start; }
  .client-body .task-failure-buttons { justify-content: flex-start; flex-wrap: wrap; }
  .client-body .prompt-composer,
  .client-body .prompt-composer.compact { bottom: 68px; width: calc(100% - 20px); }
  .client-body .prompt-composer.compact { min-height: 62px; border-radius: 12px; }
  .client-body .prompt-composer.compact .composer-main { min-height: 60px; grid-template-columns: 38px minmax(0, 1fr) 40px; padding: 5px 9px; }
  .client-body .prompt-composer.compact .prompt-rich-editor { height: 48px; min-height: 48px; line-height: 48px; font-size: 13px; }
  .client-body .home-hero-copy { width: calc(100% - 28px); }
  .client-body .home-hero-copy h1 { font-size: 32px; }
  .client-body .home-hero-copy p { font-size: 14px; }
  .client-body .home-section { width: calc(100% - 24px); padding: 34px 0; }
  .client-body .inspiration-stage { padding-bottom: 60px; }
  .client-body .asset-stage,
  .client-body .profile-stage { padding: 72px 12px 90px; }
  .client-body .asset-stage:has(.asset-batch-toolbar) { padding-bottom: 210px; }
  .client-body .asset-library-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .client-body .asset-header-actions { width: 100%; overflow-x: auto; }
  .client-body .asset-header-actions label { min-width: 160px; flex: 1 0 160px; }
  .client-body .asset-batch-toolbar { bottom: 68px; width: calc(100vw - 20px); align-items: stretch; flex-direction: column; gap: 7px; padding: 10px; }
  .client-body .asset-batch-toolbar > div { justify-content: space-between; overflow-x: auto; }
  .client-body .asset-batch-actions button { flex: 1 0 auto; }
  .client-body .asset-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
  .client-body .profile-header { padding: 14px; }
  .profile-name-row { align-items: flex-start; flex-wrap: wrap; }
  .invoice-special-fields { grid-template-columns: 1fr; }
  .client-body .profile-metrics { grid-template-columns: repeat(2, 1fr); }
  .client-body .profile-metrics article { min-height: 82px; }
  .client-body .profile-panel { padding: 15px; }
  .client-body .customer-service-widget { right: 10px; bottom: 72px; }
  .client-body:has(.studio-shell.view-create) .customer-service-widget { bottom: 230px; }
  .client-body:has(.canvas-agent-drawer) .customer-service-widget { right: auto; left: 10px; }
  .client-body:has(.studio-shell.view-canvas) .customer-service-widget { right: auto; left: 10px; bottom: 104px; z-index: 90; }
  .client-body .customer-service-panel { max-height: calc(100dvh - 150px); }
  .client-body:has(.studio-shell.view-create) .customer-service-panel { max-height: calc(100dvh - 308px); }
  .client-body .modal-backdrop { align-items: start; padding: 8px; }
  .client-body .recharge-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 14px; }
  .client-body .recharge-grid { gap: 7px; }
  .client-body .recharge-option { min-height: 136px; padding: 17px 7px 11px; }
}

@media (max-width: 380px) {
  .client-body .recharge-grid { grid-template-columns: 1fr; }
  .client-body .recharge-option { min-height: 112px; }
}

/* Sidebar visual alignment: a calm, dense dark workspace inspired by the
   reference navigation while keeping the existing markup and interactions. */
.client-body .studio-shell:not(.view-inspire):not(.view-canvas) {
  grid-template-columns: 82px 268px minmax(0, 1fr);
}
.client-body .tool-rail {
  padding: 20px 10px 18px;
  background: #0e1013;
  border-right-color: rgba(193, 205, 218, .15);
}
.client-body .rail-logo { height: 78px; }
.client-body .rail-logo .brand-logo { width: 42px; height: 42px; }
.client-body .tool-rail nav { gap: 6px; }
.client-body .rail-button {
  min-height: 68px;
  border-radius: 9px;
  color: #7e8793;
  gap: 5px;
}
.client-body .rail-button > span:first-child { font-size: 24px; }
.client-body .rail-button > span:last-child { font-size: 11px; font-weight: 550; }
.client-body .rail-button:hover { background: #191d22; color: #f2f4f6; }
.client-body .rail-button.active {
  background: #1a2428;
  color: #f4f7f8;
  box-shadow: inset 0 0 0 1px rgba(145, 216, 229, .08);
}
.client-body .rail-button.active::before {
  left: -10px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--client-cyan);
  box-shadow: 0 0 14px rgba(145, 216, 229, .38);
}
.client-body .rail-bottom { gap: 12px; }
.client-body .credit-rail {
  width: 64px;
  height: 54px;
  border-radius: 9px;
  background: #151b1f;
}
.client-body .avatar-button { width: 38px; height: 38px; flex-basis: 38px; }

.client-body .conversation-sidebar {
  padding: 0 14px 18px;
  background: #14171b;
  border-right-color: rgba(193, 205, 218, .13);
  box-shadow: 10px 0 28px rgba(0, 0, 0, .12);
}
.client-body .conversation-sidebar header {
  height: 76px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(193, 205, 218, .11);
}
.client-body .conversation-sidebar header > div {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: .01em;
  color: #f1f3f5;
}
.client-body .conversation-sidebar header .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1e2329;
  color: #b4bec8;
}
.client-body .conversation-sidebar header .icon-button:hover { background: #293139; color: #fff; }
.client-body .new-chat {
  height: 52px;
  margin-top: 12px;
  padding: 0 9px;
  border-radius: 9px;
  background: #1a2026;
  color: #f1f4f6;
  font-size: 14px;
  font-weight: 600;
}
.client-body .new-chat:hover { background: #232b33; }
.client-body .new-chat-icon {
  width: 34px;
  height: 34px;
  border-color: rgba(193, 205, 218, .16);
  border-radius: 8px;
  background: #273039;
  color: #bce4ea;
}
.client-body .default-chat {
  min-height: 54px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #e9edf0;
  font-size: 13px;
  font-weight: 550;
}
.client-body .default-chat:hover,
.client-body .default-chat.active { background: #20282f; border-color: rgba(145, 216, 229, .15); }
.client-body .conversation-label {
  padding: 22px 9px 9px;
  color: #76818d;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.client-body .conversation-list { gap: 6px; padding: 0 1px 4px; }
.client-body .conversation-item {
  min-height: 58px;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #181c21;
  color: #d5dbe0;
}
.client-body .conversation-item:hover,
.client-body .conversation-item.active {
  border-color: rgba(145, 216, 229, .18);
  background: #222a31;
  color: var(--client-sidebar-active-text);
}
.client-body .conversation-copy { gap: 4px; }
.client-body .conversation-copy strong { color: #e7ebee; font-size: 13px; font-weight: 560; }
.client-body .conversation-copy small { color: #7f8994; font-size: 10px; }
.client-body .conversation-thumb { width: 40px; height: 40px; border-radius: 7px; background: #263039; }
.client-body .conversation-thumb.empty { border-color: rgba(193, 205, 218, .13); background: #20262d; }
.client-body .conversation-empty { padding: 18px 10px; color: #77818c; }

@media (max-width: 1100px) {
  .client-body .studio-shell:not(.view-inspire):not(.view-canvas) { grid-template-columns: 74px 238px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .client-body .studio-shell:not(.view-inspire):not(.view-canvas) { grid-template-columns: 64px minmax(0, 1fr); }
  .client-body .conversation-sidebar { display: none; }
}

/* Final layout polish: keep dense controls readable at every width. */
.client-body .workspace-toolbar { max-width: calc(100% - 32px); }
.client-body .workspace-toolbar .search-box { min-width: 150px; flex: 1 1 180px; }
.client-body .workspace-toolbar .toolbar-select { flex: 0 0 auto; }
.client-body .creative-stage { scroll-padding-bottom: 220px; }
.client-body .prompt-composer:not(.maximized) {
  left: 50%;
  bottom: clamp(12px, 3vh, 24px);
  width: min(1080px, calc(100% - clamp(24px, 6vw, 64px)));
  max-width: 100%;
}
.client-body .generation-item { padding-bottom: 26px; border-bottom: 1px solid rgba(187, 200, 214, .08); }
.client-body .generation-item:last-child { border-bottom: 0; }
.client-body .generation-meta > .task-status,
.client-body .generation-meta > .task-failure-compact { align-self: start; margin-top: 1px; }
.client-body .generation-results.count-1 .generation-result-card { max-width: 540px; }
.client-body .model-picker-menu { max-width: min(680px, calc(100vw - 32px)); }
.client-body .model-picker-option { align-items: start; }
.client-body .model-option-copy { padding-top: 2px; }
.client-body .model-monitoring-inline { align-items: start; }
.client-body .prompt-composer:not(.compact):not(.maximized) { width: min(1120px, calc(100% - 64px)); min-height: 200px; }
.client-body .prompt-composer.expanded:not(.maximized) { width: min(1120px, calc(100% - 64px)); min-height: 360px; }
.client-body .prompt-composer:not(.compact):not(.maximized) .composer-main { min-height: 140px; padding-top: 15px; }
.client-body .prompt-composer.expanded:not(.maximized) .composer-main { min-height: 290px; }
.client-body .prompt-composer:not(.compact):not(.maximized) .prompt-rich-editor { height: 116px; }
.client-body .prompt-composer.expanded:not(.maximized) .prompt-rich-editor { height: 232px; }
.client-body .composer-toolbar { display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
.client-body .composer-options { min-width: 0; flex: 0 1 auto; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.client-body .composer-options::-webkit-scrollbar { display: none; }
.client-body .generation-spec-panel { width: min(560px, calc(100% - 28px)); padding: 18px; }
.client-body .composer-options > .generation-mode-select,
.client-body .composer-options > .reference-mode-select,
.client-body .composer-options > .generation-spec-chip,
.client-body .composer-options > .select-chip { width: auto; min-width: 0; }
.client-body .composer-options > .generation-mode-select { width: 180px; min-width: 180px; }
.client-body .composer-options > .reference-mode-select { width: 180px; min-width: 180px; }
.client-body .composer-options > .generation-spec-chip { width: 176px; }
.client-body .composer-options > .duration-picker-trigger { width: 88px; }
.client-body .composer-submit { min-width: max-content; margin-left: auto; }
.client-body .model-picker-trigger { width: fit-content; min-width: 0; max-width: min(420px, 100%); }
.client-body .model-picker-current { width: fit-content; max-width: 360px; min-width: 0; justify-content: flex-start; }
.client-body .model-picker-current strong { min-width: 0; }
.client-body .model-picker-chevron { flex: 0 0 auto; color: #8f97a2; }
.admin-body .model-monitoring-inline { padding: 9px; border: 1px solid #edf0f2; border-radius: 6px; background: #fbfcfd; }
.admin-body .model-monitoring-inline .model-health-meter { border-color: #d2dbe1; background: #eef2f4; }
.admin-body .model-monitoring-inline > span { line-height: 1.35; }

/* Keep the composer toolbar inside its panel at browser zoom and narrow widths. */
.client-body .composer-toolbar { min-width: 0; overflow: visible; }
.client-body .composer-options { min-width: 0; flex: 1 1 auto; overflow-x: auto; overflow-y: visible; }
.client-body .composer-submit { flex: 0 0 auto; min-width: max-content; }

/* Match the reference composer: spacious desktop canvas, clear reference
   column, and a quieter control rail without changing available actions. */
.client-body .prompt-composer:not(.compact):not(.maximized) {
  width: min(1980px, calc(100% - 40px));
  border-radius: 26px;
}
.client-body .prompt-composer.expanded:not(.maximized) {
  width: min(1980px, calc(100% - 40px));
  border-radius: 26px;
}
.client-body .composer-main {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 28px 10px;
}
.client-body .prompt-rich-editor {
  font-size: 17px;
  line-height: 1.7;
}
.client-body .composer-toolbar { padding: 8px 28px 18px; }
.client-body .model-picker-trigger { width: clamp(210px, 26vw, 360px); min-width: 0; }
.client-body .model-picker-current { width: auto; max-width: none; min-width: 0; overflow: hidden; }
.client-body .model-picker-current strong { min-width: 0; max-width: 100%; }

/* Compact toolbar sizing keeps every control, including duration, visible. */
.client-body .composer-toolbar { gap: 6px; }
.client-body .composer-options { gap: 6px; }
.client-body .composer-options > .generation-mode-select,
.client-body .composer-options > .reference-mode-select { width: 148px; min-width: 148px; }
.client-body .composer-options > .generation-spec-chip { width: 148px; min-width: 148px; padding-left: 8px; padding-right: 8px; }
.client-body .composer-options > .duration-picker-trigger { width: 76px; min-width: 76px; padding-left: 7px; padding-right: 7px; }
.client-body .model-picker-trigger { width: clamp(180px, 22vw, 300px); }

/* Image-generation toolbar proportions from the reference layout. Keep the
   controls content-driven while giving the model and spec selectors enough
   room for their existing labels. */
.client-body .composer-options.has-image-options > .generation-mode-select {
  width: 220px;
  min-width: 220px;
}
.client-body .composer-options.has-image-options > .model-picker-trigger {
  width: clamp(240px, 24vw, 360px);
  min-width: 0;
}
.client-body .composer-options.has-image-options > .generation-spec-chip {
  width: 260px;
  min-width: 220px;
}

/* Keep focus quiet inside the rich prompt editor; the outer composer remains
   the visual boundary. The desktop reference width is reduced by roughly
   one sixth while narrow layouts continue to use the full available width. */
.client-body .prompt-composer:not(.compact):not(.maximized),
.client-body .prompt-composer.expanded:not(.maximized) {
  width: min(1650px, calc(83.333% - 33px));
}
.client-body .prompt-rich-editor:focus,
.client-body .prompt-rich-editor:focus-visible {
  outline: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}
@media (max-width: 600px) {
  .client-body .prompt-composer:not(.compact):not(.maximized),
  .client-body .prompt-composer.expanded:not(.maximized) {
    width: calc(100% - 20px);
  }
}
.client-body .composer-price { white-space: nowrap; font-size: 12px; }

@media (max-width: 1100px) {
  .model-admin-grid { grid-template-columns: 1fr; }
  .model-admin-family-group > div { grid-template-columns: 1fr; }
  .client-body .workspace-toolbar { right: 14px; }
  .client-body .workspace-toolbar .search-box { flex-basis: 140px; }
}

@media (max-width: 1200px) and (min-width: 601px) {
  .client-body .prompt-composer:not(.compact):not(.maximized) { width: calc(100% - 40px); }
  .client-body .prompt-composer.expanded:not(.maximized) { width: calc(100% - 40px); min-height: 190px; }
  .client-body .composer-options { flex: 1 1 auto; }
  .client-body .model-picker-trigger { width: fit-content; min-width: 0; max-width: min(360px, 100%); }
}

@media (max-width: 600px) {
  .admin-body .model-admin-card { display: block; }
  .client-body .prompt-composer:not(.compact):not(.maximized),
  .client-body .prompt-composer.expanded:not(.maximized) { width: calc(100% - 20px); }
  .client-body .workspace-toolbar { max-width: none; overflow-x: auto; scrollbar-width: none; }
  .client-body .workspace-toolbar::-webkit-scrollbar { display: none; }
  .client-body .workspace-toolbar .search-box { min-width: 0; flex: 1 1 auto; }
  .client-body .composer-toolbar { display: flex; gap: 8px; }
  .client-body .composer-options { display: flex; overflow-x: auto; gap: 7px; }
  .client-body .generation-item { padding-bottom: 22px; }
  .client-body .generation-meta { align-items: start; }
  .client-body .generation-meta > .task-status,
  .client-body .generation-meta > .task-failure-compact { margin-top: 8px; }
  .client-body .generation-results.count-1 .generation-result-card { max-width: none; }
  .client-body .model-picker-menu { width: calc(100vw - 24px); max-width: none; }
  .client-body .model-picker-trigger { width: fit-content; min-width: 0; max-width: min(360px, calc(100vw - 24px)); }
  .client-body .model-recent-health.compact .model-health-meter { min-width: 0; height: 12px; gap: 3px; padding: 0; }
  .client-body .model-recent-health.compact .model-health-meter i { min-width: 8px; width: 8px; height: 8px; border-radius: 50%; }
  .client-body .model-picker-option { min-height: 82px; grid-template-columns: minmax(0, 1fr) auto 15px; gap: 7px; padding: 8px; }
  .client-body .model-option-title { gap: 5px; }
  .client-body .model-success-rate { font-size: 10px; }
  .client-body .model-success-rate i { width: 7px; height: 7px; }
  .client-body .model-option-side > strong { font-size: 11px; }
  .client-body .model-option-side > small { font-size: 10px; }
  .client-body .model-option-copy strong { font-size: 12px; }
  .client-body .model-option-copy small { font-size: 11px; }
}

/* Model options size to their actual content instead of leaving fixed gaps. */
.client-body .model-picker-option { min-height: 0; height: auto; }
.client-body .model-option-tags { justify-content: center; }

@media (max-width: 1200px) {
  .client-body .prompt-composer.expanded:not(.maximized) { min-height: 320px; }
  .client-body .prompt-composer.expanded:not(.maximized) .composer-main { min-height: 250px; }
  .client-body .prompt-composer.expanded:not(.maximized) .prompt-rich-editor { height: 200px; }
}
/* Video enhancement history preview and before/after comparison */
.video-enhancer-task-preview { width:90px; height:56px; overflow:hidden; padding:0; border:0; border-radius:4px; background:#0b0d10; cursor:pointer; }
.video-enhancer-estimate { margin-top:6px; color:#8ddcf0 !important; }
.video-enhancer-task-preview video { display:block; width:100%; height:100%; object-fit:cover; }

/* The generation view is a single-column mobile workspace. The compact
   desktop rail is hidden below 600px, so a 64px grid track would squeeze the
   composer and task feed into the rail column. Canvas and inspiration keep
   their own mobile layout rules. */
@media (max-width: 600px) {
  .client-body .studio-shell.view-create {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .client-body .studio-shell.view-create .workspace {
    grid-column: 1 !important;
    min-width: 0;
  }
}

/* Create composer menus mirror the supplied compact, upward-opening panels. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-menu {
  gap: var(--space-1);
  overflow: hidden;
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--generation-popover-radius);
  background: var(--composer-popover-surface);
  padding: var(--space-2);
  box-shadow: var(--shadow-depth-dialog);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .generation-mode-select .custom-select-menu {
  width: var(--generation-mode-menu-width);
  min-width: var(--generation-mode-menu-width);
  max-width: var(--generation-mode-menu-width);
  padding: var(--space-3);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .reference-mode-select .custom-select-menu {
  width: var(--generation-reference-menu-width);
  min-width: var(--generation-reference-menu-width);
  max-width: var(--generation-reference-menu-width);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .generation-mode-menu-title {
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--page-text-muted);
  font-size: var(--font-caption);
  font-weight: 500;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option {
  min-height: var(--generation-popover-control-height);
  justify-content: space-between;
  gap: var(--space-3);
  border-radius: var(--radius-lg);
  color: var(--page-text);
  padding: 0 var(--space-4);
  font-size: var(--font-body);
  font-weight: 560;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option:hover {
  background: var(--composer-popover-control);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option.active {
  background: var(--composer-popover-control-active);
  color: var(--page-text);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .generation-mode-select .custom-select-option.active {
  color: var(--color-info);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option-main > i,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option-check {
  display: inline-flex;
  flex: 0 0 var(--icon-size-base);
  color: currentColor;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option-main .ui-icon,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option-check .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .custom-select-option-check.is-empty {
  visibility: hidden;
}

body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-menu {
  width: min(var(--generation-model-picker-width), calc(100% - (var(--space-3) * 2)));
  max-height: min(520px, calc(100vh - (var(--space-6) * 2)));
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--generation-popover-radius);
  background: var(--composer-popover-surface);
  padding: var(--space-2);
  box-shadow: var(--shadow-depth-dialog);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-menu-header {
  min-height: var(--generation-composer-control-height);
  padding: 0 var(--space-3);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-menu-header strong {
  font-size: var(--font-body);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-category-tabs {
  min-height: var(--control-height-compact);
  padding: 0 var(--space-2) var(--space-2);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-scroll,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-list {
  max-height: min(410px, calc(100vh - 210px));
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-option {
  height: var(--generation-model-picker-row-height) !important;
  min-height: var(--generation-model-picker-row-height) !important;
  max-height: var(--generation-model-picker-row-height) !important;
  grid-template-columns: var(--generation-model-picker-icon-size) minmax(0, 1fr) var(--icon-size-base) !important;
  gap: var(--space-4) !important;
  border-radius: var(--radius-xl);
  padding: var(--space-2) var(--space-4);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-glyph {
  width: var(--generation-model-picker-icon-size);
  height: var(--generation-model-picker-icon-size);
  border-color: var(--composer-popover-line);
  border-radius: var(--radius-lg);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-option.selected {
  background: var(--composer-popover-control-active) !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-copy strong {
  font-size: 15px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-copy small {
  color: var(--page-text-muted);
  font-size: var(--font-caption);
}

body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .generation-spec-panel {
  width: min(var(--generation-spec-panel-width), calc(100% - (var(--space-3) * 2)));
  max-height: min(520px, calc(100vh - (var(--space-6) * 2)));
  gap: var(--space-6);
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--generation-popover-radius);
  background: var(--composer-popover-surface);
  padding: var(--generation-popover-padding);
  box-shadow: var(--shadow-depth-dialog);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-section {
  gap: var(--space-3);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-section > strong {
  color: var(--page-text-muted);
  font-size: var(--font-body);
  font-weight: 500;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] :is(.spec-ratio-grid, .spec-resolution-grid, .spec-count-grid) {
  gap: var(--space-1);
  border-radius: var(--radius-xl);
  background: var(--composer-popover-control);
  padding: var(--space-1);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-ratio-grid {
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .ratio-option {
  min-height: 76px;
  gap: var(--space-2);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-option {
  min-height: var(--generation-popover-control-height);
  border-radius: var(--radius-lg);
  color: var(--page-text);
  font-size: var(--font-body);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-option.active {
  background: var(--composer-popover-control-active);
  box-shadow: none;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-resolution-grid .spec-option {
  width: 100%;
  max-width: none;
  flex-basis: 100%;
}

body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel {
  width: min(var(--generation-duration-panel-width), calc(100% - (var(--space-3) * 2)));
  grid-template-columns: minmax(0, 1fr) 120px;
  grid-template-rows: auto auto auto;
  column-gap: var(--space-6);
  row-gap: var(--space-3);
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--generation-popover-radius);
  background: var(--composer-popover-surface);
  padding: var(--generation-popover-padding);
  box-shadow: var(--shadow-depth-dialog);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel header {
  display: contents;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel header strong {
  grid-column: 1;
  grid-row: 1;
  color: var(--page-text-muted);
  font-size: var(--font-body);
  font-weight: 500;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel output {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  min-height: var(--generation-popover-control-height);
  align-self: center;
  border-radius: var(--radius-xl);
  background: var(--composer-popover-control-active);
  font-size: var(--font-heading);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel .duration-timeline {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel input[type="range"] {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  height: var(--space-5);
  margin: 0;
  accent-color: var(--page-text);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-range-labels {
  grid-column: 1;
  grid-row: 3;
  color: var(--page-text-muted);
  font-size: var(--font-caption);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel > small {
  display: none;
}

.client-body .inline-reference-picker-backdrop {
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.create-preset-pill {
  color: var(--page-text-subtle);
}

.create-optimize-pill {
  border-color: color-mix(in srgb, var(--accent, #73d6c8) 42%, var(--page-line, #34373e));
  color: var(--accent, #73d6c8);
}

.create-toolbar-pill.create-optimize-pill[aria-pressed="true"],
.create-toolbar-pill.create-optimize-pill.is-active {
  position: relative;
  border-color: #58c9ff !important;
  background: linear-gradient(135deg, rgba(37, 139, 245, .48), rgba(67, 205, 220, .34)) !important;
  color: #f7fdff !important;
  box-shadow: 0 0 0 1px rgba(88, 201, 255, .32) !important, 0 0 18px rgba(44, 164, 255, .28) !important;
}

.create-toolbar-pill.create-optimize-pill[aria-pressed="true"]::after,
.create-toolbar-pill.create-optimize-pill.is-active::after {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: #9cecff;
  box-shadow: 0 0 7px rgba(116, 226, 255, .95);
  content: "";
}

.create-toolbar-pill.create-optimize-pill[aria-pressed="true"] .create-pill-icon,
.create-toolbar-pill.create-optimize-pill.is-active .create-pill-icon {
  color: #c9f5ff !important;
}

.prompt-optimize-backdrop {
  background:
    radial-gradient(circle at 50% 12%, rgba(120, 210, 233, .12), transparent 42%),
    rgba(4, 8, 12, .78);
  backdrop-filter: blur(8px);
}

.prompt-optimize-modal {
  --prompt-opt-accent: var(--accent, #78d2e9);
  --prompt-opt-accent-strong: #9be3f3;
  --prompt-opt-surface: color-mix(in srgb, var(--glass-high-bg, #171a1f) 82%, #78d2e9 18%);
  --prompt-opt-surface-soft: color-mix(in srgb, var(--page-surface-2, #25282e) 74%, #78d2e9 26%);
  --prompt-opt-border: color-mix(in srgb, #78d2e9 42%, transparent);
  --prompt-opt-border-strong: color-mix(in srgb, #78d2e9 62%, transparent);
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--prompt-opt-border);
  border-radius: var(--radius-base, 12px);
  background:
    radial-gradient(circle at 10% -20%, rgba(120, 210, 233, .18), transparent 40%),
    linear-gradient(180deg, var(--prompt-opt-surface), color-mix(in srgb, var(--glass-high-bg, #171a1f) 91%, #0a1820 9%));
  color: var(--page-text, #f3f4f6);
  box-shadow: var(--shadow-depth-dialog), 0 0 38px rgba(120, 210, 233, .12);
}

.prompt-optimize-modal > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid color-mix(in srgb, #78d2e9 24%, transparent);
  background: linear-gradient(180deg, rgba(120, 210, 233, .08), transparent);
  padding: 18px 20px 15px;
}

.prompt-optimize-modal > header span {
  color: var(--prompt-opt-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.prompt-optimize-modal > header h2 {
  margin: 5px 0 0;
  font-size: 20px;
}

.prompt-optimize-body {
  display: flex;
  gap: 14px;
  padding: 20px 20px 14px;
}

.prompt-optimize-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--prompt-opt-border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, #78d2e9 16%, transparent);
  color: var(--prompt-opt-accent-strong);
}

.prompt-optimize-body strong {
  display: block;
  margin: 2px 0 7px;
  color: var(--page-text, #f3f4f6);
  font-size: 16px;
}

.prompt-optimize-body p {
  margin: 0;
  color: var(--page-muted, #9ba1ad);
  font-size: 13px;
  line-height: 1.7;
}

.prompt-optimize-model-field {
  display: grid;
  gap: 7px;
  margin: 0 20px 16px;
}

.prompt-optimize-model-field > label {
  color: color-mix(in srgb, var(--prompt-opt-accent) 72%, var(--page-muted, #9ba1ad));
  font-size: 11px;
  font-weight: 700;
}

.prompt-optimize-model-select {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.prompt-optimize-model-select select {
  min-width: 0;
  max-width: 340px;
  height: 40px;
  flex: 1 1 auto;
  border: 1px solid var(--prompt-opt-border);
  border-radius: 8px;
  outline: 0;
  background: var(--prompt-opt-surface-soft);
  color: var(--page-text, #f3f4f6);
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  color-scheme: dark;
  transition: border-color var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out, background-color var(--motion-fast) ease-out;
}

.prompt-optimize-model-select select:focus {
  border-color: var(--prompt-opt-accent-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, #78d2e9 16%, transparent);
}

.prompt-optimize-model-select select:disabled {
  cursor: wait;
  opacity: .6;
}

.prompt-optimize-model-note {
  min-width: 0;
  color: var(--page-muted, #9ba1ad);
  font-size: 11px;
  line-height: 1.45;
}

.prompt-optimize-preview {
  margin: 0 20px 16px;
  border: 1px solid color-mix(in srgb, #78d2e9 26%, transparent);
  border-radius: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--page-surface-2, #25282e) 78%, #78d2e9 22%);
}

.prompt-optimize-preview > span {
  display: block;
  margin-bottom: 7px;
  color: color-mix(in srgb, var(--prompt-opt-accent) 68%, var(--page-muted, #9ba1ad));
  font-size: 11px;
  font-weight: 700;
}

.prompt-optimize-preview p {
  max-height: 160px;
  margin: 0;
  overflow: auto;
  color: var(--page-text, #f3f4f6);
  font-size: 13px;
  line-height: 1.65;
  white-space: normal;
}

.prompt-optimize-review-modal {
  width: min(780px, calc(100vw - 32px));
}

.prompt-optimize-review-body {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 12px;
  padding: 18px 20px 0;
}

.prompt-optimize-review-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, #78d2e9 26%, transparent);
  border-radius: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--page-surface-2, #25282e) 78%, #78d2e9 22%);
}

.prompt-optimize-review-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.prompt-optimize-review-card > header span {
  color: color-mix(in srgb, var(--prompt-opt-accent) 68%, var(--page-muted, #9ba1ad));
  font-size: 11px;
  font-weight: 700;
}

.prompt-optimize-review-card > header em {
  color: var(--prompt-opt-accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.prompt-optimize-review-card p,
.prompt-optimize-review-card textarea {
  width: 100%;
  min-height: 238px;
  max-height: 330px;
  margin: 0;
  overflow: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--page-text, #f3f4f6);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-optimize-review-card textarea {
  resize: vertical;
}

.prompt-optimize-review-note {
  margin: 12px 20px 0;
  color: var(--page-muted, #9ba1ad);
  font-size: 12px;
  line-height: 1.6;
}

.prompt-optimize-error {
  margin: 0 20px 16px;
  border: 1px solid color-mix(in srgb, #ef6b6b 48%, var(--page-line, #34373e));
  border-radius: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, #ef6b6b 10%, transparent);
  color: #ff9c9c;
  font-size: 12px;
  line-height: 1.55;
}

.prompt-optimize-modal > footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid color-mix(in srgb, #78d2e9 22%, transparent);
  padding: 14px 20px 18px;
}

.prompt-optimize-modal > footer button {
  min-width: 104px;
  height: 40px;
  border: 1px solid var(--prompt-opt-border);
  border-radius: 8px;
  background: color-mix(in srgb, #78d2e9 6%, transparent);
  color: var(--page-text, #f3f4f6);
  cursor: pointer;
  font-weight: 700;
  transition: border-color var(--motion-fast) ease-out, background-color var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out;
}

.prompt-optimize-modal > footer button:hover {
  border-color: var(--prompt-opt-accent-strong);
  background: color-mix(in srgb, #78d2e9 13%, transparent);
}

.prompt-optimize-modal > footer button.primary {
  border-color: color-mix(in srgb, #b8eff8 42%, transparent);
  background: linear-gradient(135deg, var(--prompt-opt-accent), #b8eff8);
  color: #071217;
  box-shadow: 0 8px 22px rgba(120, 210, 233, .18);
}

.prompt-optimize-modal > footer button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

html[data-theme="light"] .prompt-optimize-backdrop {
  background:
    radial-gradient(circle at 50% 12%, rgba(24, 127, 162, .12), transparent 44%),
    rgba(28, 35, 42, .42);
}

html[data-theme="light"] .prompt-optimize-modal {
  --prompt-opt-accent: #187fa2;
  --prompt-opt-accent-strong: #126b8a;
  --prompt-opt-surface: #ffffff;
  --prompt-opt-surface-soft: #eef7fa;
  --prompt-opt-border: rgba(24, 127, 162, .32);
  --prompt-opt-border-strong: rgba(24, 127, 162, .52);
  background:
    radial-gradient(circle at 10% -20%, rgba(24, 127, 162, .12), transparent 40%),
    #ffffff;
  color: #171b20;
  box-shadow: 0 24px 64px rgba(25, 35, 45, .18), 0 0 28px rgba(24, 127, 162, .08);
}

html[data-theme="light"] .prompt-optimize-modal > header {
  background: linear-gradient(180deg, rgba(24, 127, 162, .08), transparent);
}

html[data-theme="light"] .prompt-optimize-modal > header h2,
html[data-theme="light"] .prompt-optimize-modal .prompt-optimize-body strong,
html[data-theme="light"] .prompt-optimize-modal .prompt-optimize-preview p {
  color: #171b20;
}

html[data-theme="light"] .prompt-optimize-model-select select {
  background: #eef7fa;
  color: #171b20;
  color-scheme: light;
}

html[data-theme="light"] .prompt-optimize-model-select select:focus {
  box-shadow: 0 0 0 3px rgba(24, 127, 162, .14);
}

html[data-theme="light"] .prompt-optimize-preview {
  background: #f4fafc;
}

html[data-theme="light"] .prompt-optimize-review-card {
  background: #f4fafc;
}

html[data-theme="light"] .prompt-optimize-review-card p,
html[data-theme="light"] .prompt-optimize-review-card textarea {
  color: #171b20;
}

html[data-theme="light"] .prompt-optimize-modal > footer button {
  background: rgba(24, 127, 162, .04);
  color: #171b20;
}

html[data-theme="light"] .prompt-optimize-modal > footer button:hover {
  background: rgba(24, 127, 162, .1);
}

html[data-theme="light"] .prompt-optimize-modal > footer button.primary {
  background: linear-gradient(135deg, #187fa2, #49a9c4);
  color: #ffffff;
}

.prompt-optimize-toast {
  position: fixed;
  z-index: 1400;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  border: 1px solid color-mix(in srgb, var(--accent, #73d6c8) 38%, var(--page-line, #34373e));
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--glass-high-bg, #171a1f);
  color: var(--page-text, #f3f4f6);
  box-shadow: var(--shadow-depth-dialog);
}

.prompt-optimize-toast > span {
  color: var(--accent, #73d6c8);
}

.prompt-optimize-toast strong {
  flex: 1;
  font-size: 13px;
}

.prompt-optimize-toast button {
  border: 0;
  background: transparent;
  color: var(--accent, #73d6c8);
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 640px) {
  .prompt-optimize-model-select {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-optimize-model-select select {
    width: 100%;
    max-width: none;
  }

  .prompt-optimize-toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
  }

  .prompt-optimize-review-body {
    grid-template-columns: 1fr;
  }

  .prompt-optimize-review-card p,
  .prompt-optimize-review-card textarea {
    min-height: 140px;
    max-height: 220px;
  }

  .prompt-optimize-review-modal > footer {
    flex-wrap: wrap;
  }

  .prompt-optimize-review-modal > footer button {
    flex: 1 1 150px;
  }
}

.prompt-preset-menu {
  position: fixed;
  z-index: 90;
  width: min(420px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 24px));
  width: min(440px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--radius-lg);
  background: var(--page-surface-2);
  box-shadow: var(--shadow-lg);
}

.prompt-preset-menu > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--composer-popover-line);
}

.prompt-preset-menu > header strong {
  font-size: 14px;
}

.prompt-preset-list {
  overflow: auto;
  padding: 8px;
}

.prompt-preset-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4ea8ff;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.prompt-preset-item:hover {
  background: rgba(255, 255, 255, .08);
}

.prompt-preset-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--page-text-subtle);
  font-size: 13px;
}

.prompt-preset-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.prompt-preset-field {
  display: grid;
  gap: 7px;
}

.prompt-preset-field label {
  color: var(--page-text-subtle);
  font-size: 12px;
  line-height: 1;
}

.prompt-preset-editor label {
  display: grid;
  gap: 6px;
  color: var(--page-text-muted);
  font-size: 12px;
}

.prompt-preset-editor input,
.prompt-preset-editor textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  border: 1px solid var(--page-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--page-text);
  padding: 9px 10px;
  font-size: 13px;
  resize: vertical;
}

.prompt-preset-editor textarea {
  min-height: 148px;
  line-height: 1.6;
}

.prompt-preset-editor footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

.inline-prompt-preset {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: min(240px, 60%);
  overflow: hidden;
  color: #4ea8ff;
  -webkit-text-fill-color: #4ea8ff;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: baseline;
}
.inline-prompt-preset-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inline-prompt-preset > button {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.inline-prompt-preset > button:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.client-body:has(.studio-shell.view-create) .reference-library-modal.create-reference-picker {
  position: fixed;
  width: min(var(--generation-reference-panel-width), calc(100vw - (var(--space-6) * 2)));
  max-height: min(440px, calc(100vh - (var(--space-6) * 2)));
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--generation-popover-radius);
  background: var(--composer-popover-surface);
  box-shadow: var(--shadow-depth-dialog);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-popover-header {
  min-height: 64px;
  align-items: center;
  border-bottom: 0;
  padding: 0 var(--generation-popover-padding);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-popover-header h2 {
  margin: 0;
  color: var(--page-text-muted);
  font-size: var(--font-body);
  font-weight: 500;
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-popover-header .icon-button {
  width: var(--control-icon-size-small);
  height: var(--control-icon-size-small);
  border: 0;
  background: transparent;
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-filters {
  display: grid;
  gap: var(--space-1);
  overflow-x: auto;
  border-color: var(--composer-popover-line);
  background: transparent;
  padding: var(--space-2) var(--generation-popover-padding);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-filters > div {
  gap: var(--space-1);
  width: max-content;
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-filters button {
  min-height: var(--control-icon-size-small);
  border-radius: var(--radius-base);
  padding: 0 var(--space-2);
  font-size: var(--font-caption);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-filters button.active {
  border-color: transparent;
  background: var(--composer-popover-control-active);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-3) var(--generation-popover-padding);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-item {
  border-color: var(--composer-popover-line);
  border-radius: var(--radius-lg);
  background: var(--composer-popover-control);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-empty strong {
  color: var(--page-text-subtle);
  font-size: var(--font-heading);
  font-weight: 600;
}
.client-body:has(.studio-shell.view-create) .create-reference-picker.is-empty {
  grid-template-rows: auto minmax(260px, 1fr);
}
.client-body:has(.studio-shell.view-create) .create-reference-picker.is-empty :is(.reference-library-filters, footer) {
  display: none;
}
.client-body:has(.studio-shell.view-create) .create-reference-picker > footer {
  min-height: var(--generation-composer-control-height);
  border-color: var(--composer-popover-line);
  padding: 0 var(--generation-popover-padding);
}
.video-enhancer-task-actions { display:flex; gap:7px; align-items:center; }
.video-enhancer-task-actions button { border:1px solid #3c4752; border-radius:5px; background:#20262d; color:#c8dbe0; padding:8px 10px; font-size:12px; cursor:pointer; white-space:nowrap; }
.enhancement-compare-modal { width:min(1120px,calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:auto; border:1px solid #303642; border-radius:8px; background:#161a21; color:#edf1f7; box-shadow:0 28px 72px rgba(0,0,0,.55); }
.enhancement-compare-modal header,.enhancement-compare-modal footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 20px; border-bottom:1px solid #2b3039; }
.enhancement-compare-modal footer { justify-content:flex-end; border-top:1px solid #2b3039; border-bottom:0; }
.enhancement-compare-modal h2 { margin:0; font-size:16px; }.enhancement-compare-modal p { margin:5px 0 0; color:#9ba4b2; font-size:12px; }
.enhancement-compare-stage { position:relative; display:grid; grid-template-columns:1fr 1fr; gap:2px; padding:12px; background:#080a0d; }
.enhancement-compare-stage video { width:100%; max-height:66vh; min-height:220px; object-fit:contain; background:#000; }
.enhancement-compare-divider { position:absolute; left:50%; top:12px; bottom:12px; display:grid; place-items:center; width:2px; transform:translateX(-50%); background:#8ddcf0; color:#092126; font-size:10px; font-weight:700; writing-mode:vertical-rl; }
.enhancement-compare-modal footer button { border:1px solid #3c4752; border-radius:5px; background:#20262d; color:#d6dce6; padding:8px 12px; cursor:pointer; }.enhancement-compare-modal footer button:last-child { background:#5c4ec2; border-color:#7566c7; color:#fff; }

/* Final token pass (kept last so legacy admin rules cannot override the
   shared surface and typography decisions). */
.admin-body { color: var(--color-text); background: var(--color-bg); }
.admin-body .admin-shell,
.admin-body .admin-sidebar,
.admin-body .admin-main,
.admin-body .admin-content { background: var(--color-bg); color: var(--color-text); }
.admin-body .admin-sidebar { border-color: var(--color-border); }
.admin-body .admin-card,
.admin-body .model-admin-card,
.admin-body .admin-modal { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); border-radius: var(--radius-base); box-shadow: var(--shadow-sm); }
.admin-body .admin-card > header { border-color: var(--color-border); }
.admin-body :is(input, textarea, select) { background: var(--color-bg-raised); color: var(--color-text); border-color: var(--color-border); border-radius: var(--radius-sm); }
.admin-body table th { color: var(--color-text-muted); border-color: var(--color-border); }
.admin-body table td { color: var(--color-text); border-color: var(--color-border); }
.admin-body .admin-heading h1,
.admin-body .admin-card h2,
.admin-body .model-admin-card h3 { color: var(--color-text); }
.admin-body .admin-heading p,
.admin-body .admin-card header p { color: var(--color-text-muted); }
.admin-body .admin-heading button,
.admin-body .admin-card button,
.admin-body .model-admin-card button { background: var(--color-surface-strong); color: var(--color-text); border-color: var(--color-border); border-radius: var(--radius-sm); }
.admin-body .admin-heading button:hover,
.admin-body .admin-card button:hover,
.admin-body .model-admin-card button:hover { border-color: var(--color-brand); color: var(--color-brand); }

/* Generation workspace technology layer. The scope is intentional: the
   first visual pass applies only to the main generation page. */
.client-body:has(.studio-shell.view-create) .studio-shell.view-create {
  --generation-glass: var(--glass-medium-bg);
  position: relative;
  isolation: isolate;
  background-color: var(--color-bg);
  background-image: var(--texture-grid), var(--page-glow);
  background-size: var(--generation-grid-size) var(--generation-grid-size), 100% 100%;
}
.client-body:has(.studio-shell.view-create) .studio-shell.view-create::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: var(--gradient-brand-glow);
  opacity: var(--generation-page-glow-opacity);
}
.client-body:has(.studio-shell.view-create) .studio-shell.view-create > :is(.tool-rail, .conversation-sidebar, .workspace) {
  position: relative;
  z-index: 1;
}
.client-body:has(.studio-shell.view-create) .workspace-toolbar {
  background: var(--glass-medium-bg);
  border-bottom: 1px solid transparent;
  border-image: var(--gradient-brand) 1;
  box-shadow: var(--shadow-depth-nav);
  backdrop-filter: blur(var(--glass-blur-medium));
}
.client-body:has(.studio-shell.view-create) .workspace-toolbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--gradient-brand);
  opacity: var(--generation-toolbar-line-opacity);
}
.client-body:has(.studio-shell.view-create) .workspace-toolbar :is(.search-box, .toolbar-select) {
  background: var(--generation-input-bg);
  border-color: var(--glass-border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-create) .workspace-toolbar :is(.search-box input, .toolbar-select select) {
  color: var(--color-text);
}
.client-body:has(.studio-shell.view-create) .modal-backdrop {
  background: var(--generation-modal-overlay);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-create) .creative-stage {
  background: transparent;
}
.client-body:has(.studio-shell.view-create) .tool-rail {
  background: var(--glass-low-bg);
  border-right-color: var(--glass-border);
  box-shadow: var(--shadow-depth-nav);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-create) .conversation-sidebar {
  background: var(--glass-low-bg);
  border-right-color: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-create) .rail-button.active {
  color: var(--color-brand);
  background: var(--brand-surface-soft);
}
.client-body:has(.studio-shell.view-create) .rail-button.active::before {
  background: var(--gradient-brand);
  box-shadow: var(--glow-soft);
}
.client-body:has(.studio-shell.view-create) .rail-button:hover,
.client-body:has(.studio-shell.view-create) .conversation-item:hover,
.client-body:has(.studio-shell.view-create) .conversation-item.active,
.client-body:has(.studio-shell.view-create) .default-chat:hover,
.client-body:has(.studio-shell.view-create) .default-chat.active {
  background: var(--brand-surface-soft);
}
.client-body:has(.studio-shell.view-create) .prompt-composer {
  background: var(--glass-high-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-depth-float), var(--glow-soft);
  backdrop-filter: blur(var(--glass-blur-high));
  transition: transform var(--motion-standard) ease-out, box-shadow var(--motion-standard) ease-out, border-color var(--motion-standard) ease-out;
}
.client-body:has(.studio-shell.view-create) .prompt-composer:focus-within {
  border-color: var(--brand-border-soft);
  box-shadow: var(--shadow-depth-float), var(--glow-medium);
}
.client-body:has(.studio-shell.view-create) button:not(:disabled):active {
  transform: scale(var(--generation-press-scale));
}
.client-body:has(.studio-shell.view-create) .prompt-rich-editor,
.client-body:has(.studio-shell.view-create) .agent-composer textarea {
  color: var(--color-text);
  caret-color: var(--color-brand);
}
.client-body:has(.studio-shell.view-create) .prompt-rich-editor:empty::before { color: var(--color-text-subtle); }
.client-body:has(.studio-shell.view-create) .composer-toolbar,
.client-body:has(.studio-shell.view-create) .composer-options {
  border-color: var(--glass-border);
}
.client-body:has(.studio-shell.view-create) .composer-toolbar {
  position: relative;
}
.client-body:has(.studio-shell.view-create) .composer-toolbar::before {
  content: "";
  position: absolute;
  top: 0;
  right: var(--space-6);
  left: var(--space-6);
  height: 1px;
  background: var(--gradient-brand);
  opacity: var(--generation-separator-opacity);
  pointer-events: none;
}
.client-body:has(.studio-shell.view-create) .composer-options > :is(button, .custom-select) {
  background: var(--glass-low-bg);
  border-color: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur-low));
  transition: background-color var(--motion-fast) ease-out, border-color var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out, transform var(--motion-fast) ease-out;
}
.client-body:has(.studio-shell.view-create) .composer-options > :is(button, .custom-select):hover,
.client-body:has(.studio-shell.view-create) .composer-options > :is(button, .custom-select):focus-within {
  background: var(--brand-surface);
  border-color: var(--brand-border);
  box-shadow: var(--glow-soft);
}
.client-body:has(.studio-shell.view-create) .send-button,
.client-body:has(.studio-shell.view-create) .composer-compact-submit {
  background: var(--gradient-brand);
  color: var(--color-brand-ink);
  box-shadow: var(--glow-soft);
  transition: transform var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out, filter var(--motion-fast) ease-out;
}
.client-body:has(.studio-shell.view-create) :is(.send-button, .composer-compact-submit):hover {
  filter: brightness(var(--generation-submit-brightness));
  box-shadow: var(--glow-medium);
  transform: translateY(var(--generation-submit-rise));
}
.client-body:has(.studio-shell.view-create) .composer-price { color: var(--color-text-muted); }
.client-body:has(.studio-shell.view-create) .model-picker-menu,
.client-body:has(.studio-shell.view-create) .generation-spec-panel,
.client-body:has(.studio-shell.view-create) .duration-picker-panel,
.client-body:has(.studio-shell.view-create) .custom-select-menu {
  background: var(--glass-high-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-depth-dialog), var(--glow-soft);
  backdrop-filter: blur(var(--glass-blur-high));
}
.client-body:has(.studio-shell.view-create) .model-picker-option,
.client-body:has(.studio-shell.view-create) .spec-option,
.client-body:has(.studio-shell.view-create) .custom-select-option {
  transition: background-color var(--motion-fast) ease-out, border-color var(--motion-fast) ease-out, transform var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out;
}
.client-body:has(.studio-shell.view-create) .model-picker-option:hover,
.client-body:has(.studio-shell.view-create) .spec-option:hover,
.client-body:has(.studio-shell.view-create) .custom-select-option:hover {
  background: var(--brand-surface-soft);
  border-color: var(--brand-border-soft);
}
.client-body:has(.studio-shell.view-create) .model-picker-option.selected,
.client-body:has(.studio-shell.view-create) .spec-option.active,
.client-body:has(.studio-shell.view-create) .custom-select-option.active {
  background: linear-gradient(var(--color-surface-strong), var(--color-surface-strong)) padding-box, var(--gradient-brand) border-box;
  border-color: transparent;
  box-shadow: var(--glow-soft);
  transform: translateY(var(--generation-selected-rise));
}
.client-body:has(.studio-shell.view-create) .generation-item {
  background: var(--glass-low-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-depth-card);
  backdrop-filter: blur(var(--glass-blur-low));
  transition: transform var(--motion-standard) ease-out, box-shadow var(--motion-standard) ease-out, border-color var(--motion-standard) ease-out;
}
.client-body:has(.studio-shell.view-create) .generation-item:hover {
  border-color: var(--brand-border-soft);
  box-shadow: var(--shadow-depth-card), var(--glow-soft);
  transform: translateY(var(--generation-hover-rise));
}
.client-body:has(.studio-shell.view-create) .generation-output {
  overflow: hidden;
  background: var(--color-bg-raised);
}
.client-body:has(.studio-shell.view-create) .generation-output::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: var(--generation-overlay);
  opacity: var(--generation-overlay-opacity);
}
.client-body:has(.studio-shell.view-create) .generation-output img,
.client-body:has(.studio-shell.view-create) .generation-output video {
  transition: transform var(--motion-standard) ease-out, filter var(--motion-standard) ease-out;
}
.client-body:has(.studio-shell.view-create) .generation-result-card:hover .generation-output img,
.client-body:has(.studio-shell.view-create) .generation-result-card:hover .generation-output video {
  filter: brightness(var(--generation-hover-brightness));
  transform: scale(var(--generation-hover-scale));
}
.client-body:has(.studio-shell.view-create) .result-media-tools { z-index: 3; }
.client-body:has(.studio-shell.view-create) .result-media-tools button:hover {
  background: var(--brand-surface-hover);
  box-shadow: var(--glow-soft);
}
.client-body:has(.studio-shell.view-create) .generation-loading-surface {
  background: var(--glass-medium-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--generation-output-shadow);
}
.client-body:has(.studio-shell.view-create) .generation-loading-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--generation-shimmer);
  transform: translateX(-100%);
  animation: generation-shimmer var(--generation-shimmer-duration) ease-in-out infinite;
}
.client-body:has(.studio-shell.view-create) .generation-loading-bar i {
  background: var(--gradient-brand);
  box-shadow: var(--glow-soft);
}
.client-body:has(.studio-shell.view-create) .task-status.processing,
.client-body:has(.studio-shell.view-create) .generation-loading-status strong { color: var(--color-info); text-shadow: var(--glow-soft); }
.client-body:has(.studio-shell.view-create) .task-status.processing {
  background: var(--state-processing-surface);
  border-color: var(--brand-border-soft);
  animation: generation-status-pulse var(--state-pulse-duration) ease-in-out infinite;
}
.client-body:has(.studio-shell.view-create) .task-status.completed {
  color: var(--color-success);
  background: var(--state-success-surface);
  border-color: var(--color-success);
  text-shadow: var(--generation-success-glow);
}
.client-body:has(.studio-shell.view-create) .task-failure-badge,
.client-body:has(.studio-shell.view-create) .generation-failure-mark { color: var(--color-danger); text-shadow: var(--generation-danger-glow); }
.client-body:has(.studio-shell.view-create) .task-failure-badge {
  background: var(--state-danger-surface);
  border-color: var(--color-danger);
}
@keyframes generation-status-pulse {
  50% { box-shadow: var(--glow-soft); }
}
@keyframes generation-shimmer { 0%, 20% { transform: translateX(-100%); } 70%, 100% { transform: translateX(100%); } }
.client-body:has(.studio-shell.view-create) :is(.send-button, .composer-compact-submit, .composer-options > button):not(:disabled):active {
  transform: scale(var(--generation-press-scale));
}
@media (prefers-reduced-motion: reduce) {
  .client-body:has(.studio-shell.view-create) * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
@supports not (backdrop-filter: blur(1px)) {
  .client-body:has(.studio-shell.view-create) .tool-rail,
  .client-body:has(.studio-shell.view-create) .conversation-sidebar,
  .client-body:has(.studio-shell.view-create) .prompt-composer,
  .client-body:has(.studio-shell.view-create) .model-picker-menu,
  .client-body:has(.studio-shell.view-create) .generation-spec-panel,
  .client-body:has(.studio-shell.view-create) .duration-picker-panel,
  .client-body:has(.studio-shell.view-create) .custom-select-menu,
  .client-body:has(.studio-shell.view-create) .modal-backdrop { backdrop-filter: none; }
}
@media (max-width: 767px) {
  .client-body:has(.studio-shell.view-create) :is(.tool-rail, .conversation-sidebar, .prompt-composer, .generation-item) {
    backdrop-filter: blur(var(--glass-blur-low));
  }
}

/* Admin contrast tuning: use a restrained charcoal scale instead of pure
   black/white so dense tables and forms remain comfortable for long sessions. */
.admin-body {
  --color-bg: #111419;
  --color-bg-raised: #171b21;
  --color-surface: #1c2128;
  --color-surface-strong: #252b34;
  --color-border: rgba(203, 214, 226, .12);
  --color-text: #cbd3db;
  --color-text-muted: #929eaa;
  --color-text-subtle: #707c88;
  --color-brand: #78b7c7;
}
.admin-body .admin-shell,
.admin-body .admin-sidebar,
.admin-body .admin-main,
.admin-body .admin-content { background: var(--color-bg); }
.admin-body .admin-card,
.admin-body .model-admin-card,
.admin-body .admin-modal { background: var(--color-surface); }
.admin-body .admin-card > header,
.admin-body .admin-card > footer,
.admin-body .model-admin-card > header { background: rgba(255, 255, 255, .018); }
.admin-body :is(input, textarea, select) { background: var(--color-bg-raised); color: var(--color-text); }
.admin-body :is(input, textarea, select)::placeholder { color: var(--color-text-subtle); }
.admin-body table tr:hover td { background: rgba(255, 255, 255, .025); }
.admin-body .admin-nav a:hover,
.admin-body .admin-nav a.active { background: rgba(128, 198, 216, .11); color: var(--color-brand); }

/* Shared client pages: the generation page already owns the first technology
   layer; these page-scoped rules extend the same tokens to discovery, assets,
   and publication details without changing their markup or event handlers. */
.client-body:has(.studio-shell.view-inspire) .inspiration-stage,
.client-body:has(.studio-shell.view-inspire) .inspiration-detail-view,
.client-body:has(.studio-shell.view-assets) .asset-stage,
.client-body:has(.studio-shell.view-profile) .profile-stage {
  background-color: var(--page-surface-0);
  background-image: var(--page-grid), var(--page-glow);
  background-size: var(--page-grid-size) var(--page-grid-size), 100% 100%;
  color: var(--page-text);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-stage {
  isolation: isolate;
}

.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav {
  position: sticky;
  z-index: 15;
  top: 0;
  width: min(1440px, calc(100% - (var(--space-8) * 2)));
  min-height: 64px;
  border-bottom: 1px solid transparent;
  border-image: var(--gradient-brand) 1;
  background: var(--glass-medium-bg);
  box-shadow: var(--shadow-depth-nav);
  backdrop-filter: blur(var(--glass-blur-medium));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-brand {
  color: var(--page-text);
  letter-spacing: .02em;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav nav button,
.client-body:has(.studio-shell.view-inspire) .inspiration-published-link {
  color: var(--page-text-muted);
  transition: color var(--page-transition) ease-out, background-color var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav nav button:hover,
.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav nav button.active,
.client-body:has(.studio-shell.view-inspire) .inspiration-published-link:hover {
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav > label {
  border-color: var(--page-line);
  background: var(--page-control-bg);
  color: var(--page-text-muted);
  transition: border-color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav > label:focus-within {
  border-color: var(--brand-border);
  box-shadow: var(--page-focus-ring);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-top-nav > label input {
  color: var(--page-text);
  caret-color: var(--color-brand);
}

.client-body:has(.studio-shell.view-inspire) .home-hero,
.client-body:has(.studio-shell.view-inspire) .inspiration-banner {
  border: 1px solid var(--page-line);
  border-radius: var(--radius-lg);
  background-color: var(--page-surface-1);
  box-shadow: var(--shadow-depth-card);
}
.client-body:has(.studio-shell.view-inspire) .home-hero-shade,
.client-body:has(.studio-shell.view-inspire) .inspiration-banner-media::after {
  background: var(--page-overlay);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-banner-arrow {
  border-color: var(--page-line-strong);
  background: var(--glass-low-bg);
  color: var(--page-text);
  box-shadow: var(--shadow-depth-float);
  backdrop-filter: blur(var(--glass-blur-low));
  transition: background-color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-banner-arrow:hover {
  background: var(--page-control-hover);
  box-shadow: var(--shadow-depth-float), var(--glow-soft);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-bar {
  border-bottom-color: var(--page-line-soft);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-bar button {
  color: var(--page-text-muted);
  transition: color var(--page-transition) ease-out, border-color var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-bar button:hover,
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-bar button.active {
  color: var(--page-text);
  border-bottom-color: var(--color-brand);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-grid {
  gap: var(--space-4);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card {
  border-color: var(--page-line);
  border-radius: var(--radius-base);
  background: var(--glass-low-bg);
  box-shadow: var(--shadow-depth-card);
  transition: transform var(--page-transition) ease-out, border-color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card:hover,
.client-body:has(.studio-shell.view-inspire) .inspiration-card:focus-within {
  border-color: var(--brand-border-soft);
  box-shadow: var(--shadow-depth-card), var(--glow-soft);
  transform: translateY(var(--generation-hover-rise));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-media {
  background: var(--page-media-bg);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-media img,
.client-body:has(.studio-shell.view-inspire) .inspiration-media video {
  transition: transform var(--page-transition) ease-out, filter var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card:hover .inspiration-media img,
.client-body:has(.studio-shell.view-inspire) .inspiration-card:hover .inspiration-media video {
  filter: brightness(var(--generation-hover-brightness));
}
.client-body:has(.studio-shell.view-inspire) .video-play {
  border: 1px solid var(--glass-border);
  background: var(--glass-medium-bg);
  box-shadow: var(--shadow-depth-float);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-tag {
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-tag.pinned {
  background: var(--state-processing-surface);
  color: var(--color-info);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-tag.hot {
  background: var(--state-warning-surface);
  color: var(--color-warning);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-copy {
  background: var(--page-overlay);
  color: var(--page-text);
  pointer-events: none;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-copy button {
  pointer-events: auto;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-copy small,
.client-body:has(.studio-shell.view-inspire) .publication-details,
.client-body:has(.studio-shell.view-inspire) .publication-locked-copy {
  color: var(--page-text-muted) !important;
}
.client-body:has(.studio-shell.view-inspire) .publication-access,
.client-body:has(.studio-shell.view-inspire) .social-actions {
  border-color: var(--page-line);
}
.client-body:has(.studio-shell.view-inspire) .publication-access.free {
  border-color: var(--page-success-border);
  color: var(--color-success);
}
.client-body:has(.studio-shell.view-inspire) .publication-access.paid {
  border-color: var(--page-warning-border);
  color: var(--color-warning);
}
.client-body:has(.studio-shell.view-inspire) .social-actions button {
  color: var(--page-text-muted);
  transition: background-color var(--page-transition) ease-out, color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .social-actions button:hover,
.client-body:has(.studio-shell.view-inspire) .social-actions button.active {
  background: var(--page-control-hover);
  color: var(--color-brand);
  box-shadow: var(--glow-soft);
}

/* Detail view keeps the public navigation rail and makes the media/panel split
   read as one quiet surface. */
.client-body:has(.publication-detail-shell) .inspiration-detail-view {
  background-image: none;
}
.client-body:has(.publication-detail-shell) .publication-detail-stage {
  background: var(--page-media-bg);
  box-shadow: var(--page-media-shadow);
}
.client-body:has(.publication-detail-shell) .publication-detail-media {
  border-radius: var(--radius-base);
  box-shadow: var(--shadow-depth-card);
}
.client-body:has(.publication-detail-shell) .publication-detail-close,
.client-body:has(.publication-detail-shell) .publication-detail-nav {
  border-color: var(--page-line);
  background: var(--glass-medium-bg);
  color: var(--page-text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.publication-detail-shell) .publication-detail-close:hover,
.client-body:has(.publication-detail-shell) .publication-detail-nav:hover {
  background: var(--page-control-hover);
  box-shadow: var(--glow-soft);
}
.client-body:has(.publication-detail-shell) .publication-detail-panel {
  border-left-color: var(--page-line);
  background: var(--glass-medium-bg);
  box-shadow: var(--shadow-depth-nav);
  backdrop-filter: blur(var(--glass-blur-medium));
}
.client-body:has(.publication-detail-shell) .publication-detail-meta,
.client-body:has(.publication-detail-shell) .publication-detail-prompt {
  border-bottom-color: var(--page-line-soft);
}
.client-body:has(.publication-detail-shell) .publication-detail-prompt p {
  color: var(--page-text);
}
.client-body:has(.publication-detail-shell) .publication-detail-actions button,
.client-body:has(.publication-detail-shell) .publication-follow {
  border-color: var(--page-line);
  background: var(--page-control-bg);
  color: var(--page-text);
  transition: background-color var(--page-transition) ease-out, border-color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.client-body:has(.publication-detail-shell) .publication-detail-actions button:hover,
.client-body:has(.publication-detail-shell) .publication-follow:hover,
.client-body:has(.publication-detail-shell) .publication-follow.active {
  border-color: var(--brand-border);
  background: var(--page-control-hover);
  box-shadow: var(--glow-soft);
}

/* Asset library: retain date groups and selection controls, but make the media
   cards and batch bar use the same glass hierarchy as generation results. */
.client-body:has(.studio-shell.view-assets) .asset-stage {
  background-image: var(--page-grid), var(--page-glow);
}
.client-body:has(.studio-shell.view-assets) .asset-library-header,
.client-body:has(.studio-shell.view-assets) .asset-filter-bar {
  border-color: var(--page-line-soft);
}
.client-body:has(.studio-shell.view-assets) .asset-header-actions label,
.client-body:has(.studio-shell.view-assets) .asset-filter-bar,
.client-body:has(.studio-shell.view-assets) .asset-gallery-item,
.client-body:has(.studio-shell.view-assets) .asset-batch-toolbar,
.client-body:has(.studio-shell.view-assets) .asset-empty.large {
  border-color: var(--page-line);
  background: var(--glass-low-bg);
  box-shadow: var(--shadow-depth-card);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-assets) .asset-header-actions label:focus-within {
  border-color: var(--brand-border);
  box-shadow: var(--page-focus-ring);
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-item {
  transition: transform var(--page-transition) ease-out, border-color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-item:hover,
.client-body:has(.studio-shell.view-assets) .asset-gallery-item.selected {
  border-color: var(--brand-border-soft);
  background: var(--brand-surface-soft);
  box-shadow: var(--shadow-depth-card), var(--glow-soft);
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-media,
.client-body:has(.studio-shell.view-assets) .library-preview {
  background: var(--page-media-bg);
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--page-overlay);
  opacity: .42;
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-media img,
.client-body:has(.studio-shell.view-assets) .asset-gallery-media video {
  transition: transform var(--page-transition) ease-out, filter var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-item:hover .asset-gallery-media img,
.client-body:has(.studio-shell.view-assets) .asset-gallery-item:hover .asset-gallery-media video {
  filter: brightness(var(--generation-hover-brightness));
  transform: scale(var(--generation-hover-scale));
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-media .asset-play,
.client-body:has(.studio-shell.view-assets) .audio-asset-icon {
  border-color: var(--glass-border);
  background: var(--glass-medium-bg);
  color: var(--page-text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-meta strong { color: var(--page-text); }
.client-body:has(.studio-shell.view-assets) .asset-gallery-meta small { color: var(--page-text-muted); }
.client-body:has(.studio-shell.view-assets) .asset-gallery-meta button,
.client-body:has(.studio-shell.view-assets) .asset-gallery-meta select,
.client-body:has(.studio-shell.view-assets) .asset-batch-toolbar button {
  border-color: var(--page-line);
  background: var(--page-control-bg);
  color: var(--page-text-muted);
  transition: background-color var(--page-transition) ease-out, border-color var(--page-transition) ease-out, color var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-assets) .asset-gallery-meta button:hover,
.client-body:has(.studio-shell.view-assets) .asset-batch-toolbar button:hover:not(:disabled) {
  border-color: var(--brand-border);
  background: var(--page-control-hover);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-assets) .asset-selection-entry.active,
.client-body:has(.studio-shell.view-assets) .asset-gallery-item.selected .asset-select-toggle {
  border-color: var(--brand-border);
  background: var(--brand-surface-strong);
  color: var(--color-brand);
  box-shadow: var(--glow-soft);
}
.client-body:has(.studio-shell.view-assets) .save-asset-modal,
.client-body:has(.studio-shell.view-assets) .reference-library-modal {
  border-color: var(--page-line);
  background: var(--glass-high-bg);
  box-shadow: var(--shadow-depth-dialog), var(--glow-soft);
  backdrop-filter: blur(var(--glass-blur-high));
}

/* Operations console: a low-contrast charcoal scale prevents the old white
   cards and bright labels from competing with live operational data. */
.admin-body {
  min-width: 0;
  background: var(--admin-bg);
  color: var(--admin-text);
  background-image: var(--page-grid), var(--page-glow);
  background-size: var(--page-grid-size) var(--page-grid-size), 100% 100%;
}
.admin-body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image: var(--page-grid), var(--page-glow);
  background-size: var(--page-grid-size) var(--page-grid-size), 100% 100%;
}
.admin-body .admin-shell { grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr); background: transparent; }
.admin-body .admin-sidebar {
  width: var(--admin-sidebar-width);
  border-right: 1px solid var(--admin-border);
  background: var(--admin-sidebar);
  box-shadow: var(--shadow-depth-nav);
}
.admin-body .admin-brand {
  height: var(--admin-topbar-height);
  border-bottom-color: var(--admin-border);
}
.admin-body .admin-brand > span,
.admin-body .admin-login-brand > span {
  background: var(--admin-brand-gradient);
  color: var(--admin-accent-ink);
  box-shadow: var(--admin-brand-glow);
}
.admin-body .admin-brand strong,
.admin-body .admin-topbar strong { color: var(--admin-text); }
.admin-body .admin-brand small,
.admin-body .admin-topbar small,
.admin-body .admin-topbar > span { color: var(--admin-text-subtle); }
.admin-body .admin-sidebar nav button,
.admin-body .admin-sidebar-bottom a,
.admin-body .admin-sidebar-bottom button {
  border: 1px solid transparent;
  color: var(--admin-text-muted);
  transition: background-color var(--page-transition) ease-out, border-color var(--page-transition) ease-out, color var(--page-transition) ease-out;
}
.admin-body .admin-sidebar nav button:hover,
.admin-body .admin-sidebar-bottom a:hover,
.admin-body .admin-sidebar-bottom button:hover {
  border-color: var(--admin-border);
  background: var(--admin-surface-hover);
  color: var(--admin-text);
}
.admin-body .admin-sidebar nav button.active {
  border-color: var(--brand-border-soft);
  background: var(--admin-info-surface);
  color: var(--admin-accent-strong);
  box-shadow: var(--glow-soft);
}
.admin-body .admin-sidebar nav button.active i { color: var(--admin-accent); }
.admin-body .admin-content { background: transparent; }
.admin-body .admin-topbar {
  height: var(--admin-topbar-height);
  border-bottom-color: var(--admin-border);
  background: var(--admin-bg);
  color: var(--admin-text);
  box-shadow: var(--shadow-depth-nav);
}
.admin-body .admin-page { color: var(--admin-text); }
.admin-body .admin-heading h1,
.admin-body .admin-card h2,
.admin-body .model-admin-card h2,
.admin-body .admin-heading p,
.admin-body .admin-card header p { color: var(--admin-text); }
.admin-body .admin-heading p,
.admin-body .admin-card header p { color: var(--admin-text-muted); }
.admin-body .admin-card,
.admin-body .model-admin-card,
.admin-body .metric-grid article,
.admin-body .admin-modal,
.admin-body .inspiration-settings,
.admin-body .admin-security-panel {
  border-color: var(--admin-border);
  border-radius: var(--radius-base);
  background: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--shadow-depth-card);
}
.admin-body .admin-card > header,
.admin-body .admin-card > footer,
.admin-body .model-admin-card > header,
.admin-body .admin-table-wrap th,
.admin-body .task-filters,
.admin-body .profit-summary {
  border-color: var(--admin-border);
  background: var(--admin-surface-raised);
}
.admin-body .admin-table-wrap th,
.admin-body .admin-table-wrap td,
.admin-body .admin-table-wrap tr,
.admin-body .profit-detail-table .profit-calculation strong { border-color: var(--admin-border); color: var(--admin-text-muted); }
.admin-body .admin-table-wrap td { color: var(--admin-text); }
.admin-body .admin-table-wrap tbody tr:hover td { background: var(--admin-surface-hover); }
.admin-body :is(input, textarea, select),
.admin-body .admin-search,
.admin-body .profit-filter-bar input {
  min-height: var(--admin-control-height);
  border-color: var(--admin-border-strong);
  border-radius: var(--radius-sm);
  background: var(--admin-input);
  color: var(--admin-text);
  outline: 0;
  transition: border-color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out, background-color var(--page-transition) ease-out;
}
.admin-body :is(input, textarea, select):focus,
.admin-body .admin-search:focus-within {
  border-color: var(--admin-accent);
  box-shadow: var(--page-focus-ring);
}
.admin-body :is(input, textarea, select)::placeholder { color: var(--admin-text-subtle); }
.admin-body .admin-search input { background: transparent; color: var(--admin-text); }
.admin-body .admin-heading button,
.admin-body .admin-card button,
.admin-body .model-admin-card button,
.admin-body .admin-modal button,
.admin-body .admin-tabs button,
.admin-body .model-category-tabs button,
.admin-body .model-provider-tabs button,
.admin-body .model-status-tabs button,
.admin-body .model-batch-bar button {
  border-color: var(--admin-border-strong);
  border-radius: var(--radius-sm);
  background: var(--admin-surface-raised);
  color: var(--admin-text-muted);
  transition: background-color var(--page-transition) ease-out, border-color var(--page-transition) ease-out, color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.admin-body .admin-heading button:hover,
.admin-body .admin-card button:hover,
.admin-body .model-admin-card button:hover,
.admin-body .admin-modal button:hover,
.admin-body .admin-tabs button:hover,
.admin-body .model-category-tabs button:hover,
.admin-body .model-provider-tabs button:hover,
.admin-body .model-status-tabs button:hover {
  border-color: var(--admin-accent);
  background: var(--admin-surface-hover);
  color: var(--admin-text);
  box-shadow: var(--glow-soft);
}
.admin-body .admin-primary {
  border-color: transparent !important;
  background: var(--admin-brand-gradient) !important;
  color: var(--admin-accent-ink) !important;
  box-shadow: var(--admin-brand-glow);
}
.admin-body .admin-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 0 24px rgba(116, 181, 199, .22);
}
.admin-body .admin-tabs button.active,
.admin-body .model-category-tabs button.active,
.admin-body .model-provider-tabs button.active,
.admin-body .model-status-tabs button.active {
  border-color: var(--brand-border);
  background: var(--admin-info-surface);
  color: var(--admin-accent-strong);
  box-shadow: var(--glow-soft);
}
.admin-body .metric-grid article > span,
.admin-body .metric-grid article small,
.admin-body .model-admin-card > small,
.admin-body .model-admin-card > p,
.admin-body .model-admin-card dt,
.admin-body .model-monitoring-inline,
.admin-body .admin-muted { color: var(--admin-text-muted); }
.admin-body .metric-grid article strong,
.admin-body .model-admin-card dd { color: var(--admin-text); }
.admin-body .metric-grid article.actual-profit {
  border-color: var(--admin-success-border);
  background: var(--admin-success-surface);
}
.admin-body .metric-grid article.actual-profit strong { color: var(--admin-success); }
.admin-body .metric-grid article.actual-profit.profit-entry { border-color: var(--admin-success-border); background: var(--admin-success-surface); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.admin-body .metric-grid article.actual-profit.profit-entry:hover, .admin-body .metric-grid article.actual-profit.profit-entry:focus-visible { border-color: var(--admin-success); box-shadow: 0 10px 24px rgba(0, 0, 0, .16); transform: translateY(-2px); outline: none; }
.admin-body .model-admin-card dl,
.admin-body .user-detail-summary > div,
.admin-body .site-media-grid > div,
.admin-body .admin-feature-row,
.admin-body .billing-editor,
.admin-body .token-pricing-editor,
.admin-body .provider-model-details,
.admin-body .provider-model-list button,
.admin-body .model-category-empty {
  border-color: var(--admin-border);
  background: var(--admin-surface-raised);
  color: var(--admin-text);
}
.admin-body .rename-preview > strong { color: var(--admin-text); }
.admin-body .rename-preview small { color: var(--admin-text-muted); }
.admin-body .rename-preview small > span { color: var(--admin-text-muted); }
.admin-body .rename-preview small > b { color: var(--admin-accent-strong); }
.admin-body .model-type { background: var(--admin-info-surface); color: var(--admin-accent-strong); }
.admin-body .model-type.video { background: var(--admin-warning-surface); color: var(--admin-warning); }
.admin-body .model-type.text { background: var(--admin-info-surface); color: var(--admin-info); }
.admin-body .model-type.audio { background: var(--admin-success-surface); color: var(--admin-success); }
.admin-body .admin-badge,
.admin-body .verification-badge,
.admin-body .model-trust-badge { border-color: var(--admin-border-strong); background: var(--admin-surface-raised); color: var(--admin-text-muted); }
.admin-body .admin-badge.active,
.admin-body .admin-badge.approved,
.admin-body .admin-badge.completed,
.admin-body .verification-badge.verified { border-color: var(--admin-success-border); background: var(--admin-success-surface); color: var(--admin-success); }
.admin-body .admin-badge.disabled,
.admin-body .admin-badge.inactive,
.admin-body .admin-badge.rejected,
.admin-body .admin-badge.failed,
.admin-body .verification-badge.incomplete,
.admin-body .verification-badge.test-failed { border-color: var(--admin-danger-border); background: var(--admin-danger-surface); color: var(--admin-danger); }
.admin-body .admin-badge.pending,
.admin-body .admin-badge.processing,
.admin-body .verification-badge.discount { border-color: var(--admin-warning-border); background: var(--admin-warning-surface); color: var(--admin-warning); }
.admin-body .admin-danger { border-color: var(--admin-danger-border-strong) !important; background: var(--admin-danger-surface) !important; color: var(--admin-danger) !important; }
.admin-body .admin-modal-backdrop { background: var(--generation-modal-overlay); backdrop-filter: blur(var(--glass-blur-low)); }
.admin-body .admin-modal > header,
.admin-body .admin-modal footer { border-color: var(--admin-border); }
.admin-body .admin-modal > header h2,
.admin-body .admin-modal label,
.admin-body .admin-modal label > small { color: var(--admin-text); }
.admin-body .admin-modal > header p { color: var(--admin-text-muted); }
.admin-body .task-provider-failure,
.admin-body .admin-error { border-color: var(--admin-danger-border); background: var(--admin-danger-surface); color: var(--admin-danger); }
.admin-body .trend-content,
.admin-body .trend-chart-scroll { color: var(--admin-text-muted); }
.admin-body .trend-grid line { stroke: var(--admin-border); }
.admin-body .trend-grid text { fill: var(--admin-text-subtle); }
.admin-body .trend-zero { stroke: var(--admin-border-strong); }
.admin-body .trend-points circle { fill: var(--admin-surface-raised); }
.admin-body .admin-login { background: var(--admin-bg); background-image: var(--page-grid), var(--page-glow); }
.admin-body .admin-login form {
  border-color: var(--admin-border);
  border-radius: var(--radius-lg);
  background: var(--admin-surface);
  box-shadow: var(--shadow-depth-dialog);
}
.admin-body .admin-login h1,
.admin-body .admin-login label { color: var(--admin-text); }
.admin-body .admin-login > form > p { color: var(--admin-text-muted); }
.admin-body .admin-login input { width: 100%; border-color: var(--admin-border-strong); background: var(--admin-input); color: var(--admin-text); }
.admin-body .admin-login form > button { background: var(--admin-brand-gradient); color: var(--admin-accent-ink); box-shadow: var(--admin-brand-glow); }

/* Remaining operations surfaces that are created by older render paths. Keep
   them inside the same charcoal scale so a legacy child cannot reintroduce a
   bright white island in the admin workspace. */
.admin-body .model-batch-bar,
.admin-body .model-monitoring-inline,
.admin-body .profit-summary,
.admin-body .user-detail-summary > div,
.admin-body .admin-home-section + .admin-home-section,
.admin-body .admin-feature-row {
  border-color: var(--admin-border);
  background: var(--admin-surface-raised);
  color: var(--admin-text-muted);
}
.admin-body .model-batch-bar strong,
.admin-body .model-monitoring-inline > span:first-child,
.admin-body .profit-summary strong,
.admin-body .user-detail-summary strong,
.admin-body .admin-feature-row strong {
  color: var(--admin-text);
}
.admin-body .model-monitoring-inline .model-health-meter {
  border-color: var(--admin-border);
  background: var(--admin-input);
}
.admin-body .model-monitoring-inline .model-health-meter i.good { background: var(--admin-success); }
.admin-body .model-monitoring-inline .model-health-meter i.warning { background: var(--admin-warning); }
.admin-body .model-monitoring-inline .model-health-meter i.danger { background: var(--admin-danger); }
.admin-body .model-monitoring-inline .model-health-meter i.muted { background: var(--admin-text-subtle); }
.admin-body .model-recent-health-label,
.admin-body .model-recent-health-group .model-recent-health-label,
.admin-body .model-modal-monitoring .model-recent-health-label { color: var(--admin-text-muted); }
.admin-body .model-unused-label {
  border-color: var(--admin-border-strong);
  background: var(--admin-input);
  color: var(--admin-text-muted);
}
.admin-body .model-category-tabs small,
.admin-body .model-provider-tabs small,
.admin-body .model-status-tabs small {
  background: var(--admin-surface-hover);
  color: var(--admin-text-muted);
}
.admin-body .model-category-tabs button.active small,
.admin-body .model-provider-tabs button.active small,
.admin-body .model-status-tabs button.active small {
  background: var(--admin-info-surface);
  color: var(--admin-accent-strong);
}
.admin-body .profit-summary span { border-color: var(--admin-border); color: var(--admin-text-muted); }
.admin-body .profit-summary .final {
  background: var(--admin-success-surface);
  color: var(--admin-text);
}
.admin-body .profit-summary .final strong,
.admin-body .profit-positive strong { color: var(--admin-success); }
.admin-body .profit-negative strong { color: var(--admin-danger); }
.admin-body .profit-summary .internal-cost { background: var(--admin-warning-surface); }
.admin-body .profit-summary .internal-cost strong { color: var(--admin-warning); }
.admin-body .profit-internal-row td { background: var(--admin-warning-surface); }
.admin-body .verification-badge.internal { border-color: var(--admin-warning-border); background: var(--admin-warning-surface); color: var(--admin-warning); }
.admin-body .credit-adjust-modes button { border-color: var(--admin-border-strong); background: var(--admin-input); color: var(--admin-text); }
.admin-body .credit-adjust-modes button.active { border-color: var(--admin-accent); background: var(--admin-info-surface); color: var(--admin-accent-strong); }
.admin-body .credit-adjust-modes button[data-credit-direction="decrease"].active { border-color: var(--admin-danger-border); background: var(--admin-danger-surface); color: var(--admin-danger); }
.admin-body .credit-adjust-quick button { border-color: var(--admin-border-strong); background: var(--admin-surface-raised); color: var(--admin-text-muted); }
.admin-body .credit-adjust-quick button:hover { border-color: var(--admin-accent); color: var(--admin-accent-strong); }
.admin-body .credit-adjust-preview { background: var(--admin-surface-raised); color: var(--admin-text-muted); }
.admin-body .credit-adjust-preview strong { color: var(--admin-text); }
.admin-body .credit-adjust-preview.negative strong { color: var(--admin-danger); }
.admin-body .credit-adjust-warning { border-color: var(--admin-warning-border); background: var(--admin-warning-surface); color: var(--admin-warning); }
.admin-body .credit-adjust-tags > span { color: var(--admin-text-muted); }
.admin-body .credit-adjust-tags button { border-color: var(--admin-border-strong); background: var(--admin-surface-raised); color: var(--admin-text-muted); }
.admin-body .credit-adjust-tags button:hover { border-color: var(--admin-accent); color: var(--admin-accent-strong); }
.admin-body .credit-adjust-tags button.active { border-color: var(--admin-accent); background: var(--admin-info-surface); color: var(--admin-accent-strong); }
.admin-body .credit-adjust-tags button[data-credit-tag="gift"].active { border-color: var(--admin-warning-border); background: var(--admin-warning-surface); color: var(--admin-warning); }
.admin-body .credit-adjust-kind { border-left-color: var(--admin-border-strong); background: var(--admin-surface-raised); color: var(--admin-text-muted); }
.admin-body .credit-adjust-kind.recharge { border-left-color: var(--admin-accent); }
.admin-body .credit-adjust-kind.gift { border-left-color: var(--admin-warning-border); background: var(--admin-warning-surface); color: var(--admin-warning); }
.admin-body .admin-home-section + .admin-home-section { border-top-color: var(--admin-border); }
.admin-body .admin-feature-row input,
.admin-body .admin-feature-row select,
.admin-body .settings-form input,
.admin-body .settings-form textarea,
.admin-body .settings-form select {
  border-color: var(--admin-border-strong);
  background: var(--admin-input);
  color: var(--admin-text);
}
.admin-body .admin-hero-preview.empty { background: var(--admin-surface-raised); }
.admin-body .admin-media-actions button,
.admin-body .provider-model-type-tabs button,
.admin-body .provider-model-details span {
  border-color: var(--admin-border-strong);
  background: var(--admin-surface-raised);
  color: var(--admin-text-muted);
}
.admin-body .provider-model-type-tabs button.active,
.admin-body .provider-model-type-tabs button:hover {
  border-color: var(--admin-accent);
  background: var(--admin-info-surface);
  color: var(--admin-accent-strong);
}
.admin-body .admin-provider-submission,
.admin-body .admin-provider-submission summary,
.admin-body .task-detail-grid dt,
.admin-body .task-detail-grid dd small,
.admin-body .admin-upload-route,
.admin-body .admin-upload-route a {
  color: var(--admin-text-muted);
}
.admin-body .admin-provider-submission code,
.admin-body .task-detail-section pre {
  border-color: var(--admin-border);
  background: var(--admin-input);
  color: var(--admin-text-muted);
}
.admin-body .admin-upload-route {
  border-color: var(--admin-border);
  background: var(--admin-surface-raised);
}
.admin-body .task-detail-grid,
.admin-body .task-detail-grid > div,
.admin-body .task-detail-section,
.admin-body .task-reference-list li { border-color: var(--admin-border); }
.admin-body .task-detail-grid dd,
.admin-body .task-detail-section h3,
.admin-body .task-reference-list li { color: var(--admin-text); }
.admin-body .task-reference-url,
.admin-body .task-reference-url code,
.admin-body .task-reference-url small { color: var(--admin-accent-strong); }
.admin-body .task-reference-url:hover code { color: var(--admin-accent); }
.admin-body .task-table-wrap { overflow-x: auto; }
.admin-body :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--admin-accent); }
.admin-body,
.admin-body * {
  scrollbar-color: var(--admin-surface-hover) var(--admin-input);
  scrollbar-width: thin;
}
.admin-body *::-webkit-scrollbar { width: 10px; height: 10px; }
.admin-body *::-webkit-scrollbar-track { background: var(--admin-input); }
.admin-body *::-webkit-scrollbar-thumb {
  border: 2px solid var(--admin-input);
  border-radius: 10px;
  background: var(--admin-surface-hover);
}
.admin-body *::-webkit-scrollbar-thumb:hover { background: var(--admin-accent); }

@media (max-width: 900px) {
  .admin-body .admin-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .admin-body .admin-sidebar { width: 72px; }
}
@media (max-width: 540px) {
  .admin-body .admin-shell { grid-template-columns: 58px minmax(0, 1fr); }
  .admin-body .admin-sidebar { width: 58px; }
  .admin-body .admin-page { padding: var(--space-3); }
  .admin-body .admin-topbar { padding: 0 var(--space-3); }
  .admin-body .metric-grid,
  .admin-body .metric-grid.economics { grid-template-columns: 1fr; }
  .admin-body .admin-task-table { min-width: 980px; }
}

/* Keep legacy admin render paths on the same calm dark scale. These selectors
   intentionally sit at the end of the stylesheet because several older
   sections still carry light-theme declarations. */
.admin-body {
  color-scheme: dark;
  background-color: var(--admin-bg);
}
.admin-body :is(a, .admin-link-button) { color: var(--admin-accent); }
.admin-body :is(a, .admin-link-button):hover { color: var(--admin-accent-strong); }
.admin-body .admin-brand-logo,
.admin-body .site-media-grid > div,
.admin-body .admin-recharge-tiers article,
.admin-body .admin-tier-discount-row,
.admin-body .smtp-test-row button,
.admin-body .admin-hero-preview,
.admin-body .admin-feature-row,
.admin-body .rename-preview,
.admin-body .billing-editor,
.admin-body .token-pricing-editor,
.admin-body .provider-model-details,
.admin-body .provider-model-list button,
.admin-body .model-category-empty {
  border-color: var(--admin-border);
  background: var(--admin-surface-raised);
  color: var(--admin-text-muted);
}
.admin-body .admin-brand-logo { background: var(--admin-surface-hover); }
.admin-body .admin-hero-preview.empty,
.admin-body .site-media-preview.empty,
.admin-body .site-media-preview#logoPreview { background: var(--admin-input); }
.admin-body .admin-recharge-tiers strong,
.admin-body .admin-tier-discount-row strong,
.admin-body .admin-feature-row strong,
.admin-body .site-media-grid strong { color: var(--admin-text); }
.admin-body .admin-recharge-tiers span { color: var(--admin-success); }
.admin-body .admin-tier-discount-row input { border-color: var(--admin-border); background: var(--admin-input); color: var(--admin-text); }
.admin-body .admin-recharge-tiers small,
.admin-body .admin-tier-discount-row small,
.admin-body .admin-media-actions span,
.admin-body .admin-feature-row small,
.admin-body .site-media-grid small { color: var(--admin-text-muted); }

/* Membership checkout lives inside the client dark workspace, so it must not
   inherit the old light-dialog text and button palette. */
.client-body .membership-contact-modal,
.client-body .customer-recharge-modal {
  border-color: #365b7a;
  background: #171d25;
  color: #f2f6fa;
}
.client-body .membership-contact-modal header,
.client-body .customer-recharge-modal header,
.client-body .membership-contact-modal footer {
  border-color: #2e3b48;
}
.client-body .membership-contact-modal header span,
.client-body .customer-recharge-modal header span { color: #b9cad9; }
.client-body .membership-contact-modal h2,
.client-body .customer-recharge-modal h2,
.client-body .membership-contact-content strong,
.client-body .customer-recharge-content strong { color: #f7fafc; }
.client-body .membership-contact-content,
.client-body .membership-contact-content p,
.client-body .customer-recharge-content p,
.client-body .customer-recharge-content > div,
.client-body .customer-recharge-content > div small { color: #b9c5d0; }
.client-body .membership-contact-modal footer button,
.client-body .customer-recharge-content .subtle-button {
  min-height: 36px;
  border: 1px solid #52677a;
  border-radius: 6px;
  background: #273341;
  color: #f2f6fa;
}
.client-body .membership-contact-modal footer .primary {
  border-color: #4aa3d8;
  background: #1677ad;
  color: #ffffff;
}
.client-body .membership-contact-modal footer button:hover,
.client-body .customer-recharge-content .subtle-button:hover { background: #344657; }
.client-body .membership-contact-modal footer .primary:hover { background: #2188c2; }
.client-body .customer-recharge-content > img { border-color: #52677a; }
.client-body .customer-recharge-empty { border-color: #60778b; color: #d5e0e8; }
.admin-body .admin-audit-redline,
.admin-body .audit-redline-row,
.admin-body .audit-redline-row:hover {
  border-color: var(--admin-danger-border);
  background: var(--admin-danger-surface);
  color: var(--admin-danger);
}
.admin-body .admin-table-wrap tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .012); }
.admin-body .admin-table-wrap tbody tr:nth-child(even):hover td { background: var(--admin-surface-hover); }
.admin-body .model-admin-card.deleted {
  border-color: var(--admin-border-strong);
  background: var(--admin-input);
}
.admin-body .admin-disabled,
.admin-body button:disabled { color: var(--admin-text-subtle); }

/* On phones the rail and conversation sidebar are hidden. View-specific
   desktop grid rules are more specific than the generic mobile rule above,
   so explicitly collapse the remaining workspace views to one column. */
@media (max-width: 600px) {
  .client-body .studio-shell:not(.view-inspire):not(.view-create),
  .client-body .studio-shell.view-canvas {
    grid-template-columns: 1fr;
  }
}

/* Keep the generation toolbar usable at the widths where the composer is
   intentionally narrower than the workspace. The controls remain the same;
   their widths simply fit beside the fixed price/submit area. */
.client-body:has(.studio-shell.view-create) .composer-options.has-image-options {
  gap: var(--generation-toolbar-gap);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-image-options > .generation-mode-select {
  flex: 0 0 var(--generation-toolbar-mode-width);
  width: var(--generation-toolbar-mode-width);
  min-width: var(--generation-toolbar-mode-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-image-options > .model-picker-trigger {
  flex: 0 0 var(--generation-toolbar-model-width);
  width: var(--generation-toolbar-model-width);
  min-width: var(--generation-toolbar-model-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-image-options > .generation-spec-chip {
  flex: 0 0 var(--generation-toolbar-spec-width);
  width: var(--generation-toolbar-spec-width);
  min-width: var(--generation-toolbar-spec-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options {
  gap: var(--generation-toolbar-video-gap);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > .generation-mode-select {
  flex: 0 0 var(--generation-toolbar-video-mode-width);
  width: var(--generation-toolbar-video-mode-width);
  min-width: var(--generation-toolbar-video-mode-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > :is(.generation-mode-select, .reference-mode-select) .custom-select-trigger,
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > :is(.generation-spec-chip, .duration-picker-trigger) {
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > :is(.generation-mode-select, .reference-mode-select) .custom-select-trigger {
  gap: 5px;
  padding-inline: 7px;
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > .model-picker-trigger {
  flex: 0 0 var(--generation-toolbar-video-model-width);
  width: var(--generation-toolbar-video-model-width);
  min-width: var(--generation-toolbar-video-model-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > .reference-mode-select {
  flex: 0 0 var(--generation-toolbar-video-reference-width);
  width: var(--generation-toolbar-video-reference-width);
  min-width: var(--generation-toolbar-video-reference-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > .generation-spec-chip {
  flex: 0 0 var(--generation-toolbar-video-spec-width);
  width: var(--generation-toolbar-video-spec-width);
  min-width: var(--generation-toolbar-video-spec-width);
}
.client-body:has(.studio-shell.view-create) .composer-options.has-video-options > .duration-picker-trigger {
  flex: 0 0 var(--generation-toolbar-video-duration-width);
  width: var(--generation-toolbar-video-duration-width);
  min-width: var(--generation-toolbar-video-duration-width);
}

/* The secondary creation pages share the same calm glass hierarchy as the
   generation workspace while keeping their existing controls and data flow. */
.client-body:has(.studio-shell.view-digitalHuman) .workspace,
.client-body:has(.studio-shell.view-videoEnhancer) .workspace {
  background-color: var(--page-surface-0);
  background-image: var(--page-grid), var(--page-glow);
  background-size: var(--page-grid-size) var(--page-grid-size), 100% 100%;
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-stage,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-stage {
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-heading p,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-heading p,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel header small,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-panel header small {
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-heading h1,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-heading h1,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel header strong,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-panel header strong {
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-price,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-price {
  border-color: var(--page-line);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-price small,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-price small,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-cost small {
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-price strong,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-price strong,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-cost strong {
  color: var(--color-brand);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-panel,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-cost {
  border-color: var(--page-line);
  background: var(--glass-medium-bg);
  box-shadow: var(--shadow-depth-card);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body:has(.studio-shell.view-digitalHuman) :is(.digital-human-avatar-card, .digital-human-scene-card, .digital-human-panel textarea, .digital-human-panel select),
.client-body:has(.studio-shell.view-videoEnhancer) :is(.video-enhancer-dropzone, .video-enhancer-resolution button) {
  border-color: var(--page-line-strong);
  background: var(--page-control-bg);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-digitalHuman) :is(.digital-human-avatar-card, .digital-human-scene-card):hover,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel textarea:focus,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel select:focus,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-dropzone:hover,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-resolution button:hover,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-resolution button.active {
  border-color: var(--brand-border);
  background: var(--page-control-hover);
  box-shadow: var(--page-focus-ring);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-reference-target button,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-asset-grid button,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task-actions button {
  border-color: var(--page-line);
  background: var(--page-control-bg);
  color: var(--page-text-muted);
  transition: background-color var(--page-transition) ease-out, border-color var(--page-transition) ease-out, color var(--page-transition) ease-out, box-shadow var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-digitalHuman) :is(.digital-human-reference-target button:hover, .digital-human-reference-target button.active, .digital-human-asset-grid button:hover, .digital-human-asset-grid button.selected),
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task-actions button:hover {
  border-color: var(--brand-border);
  background: var(--page-control-hover);
  color: var(--page-text);
  box-shadow: var(--glow-soft);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-submit,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-submit {
  border: 0;
  background: var(--gradient-brand);
  color: var(--color-brand-ink);
  box-shadow: var(--glow-soft);
  transition: filter var(--motion-fast) ease-out, transform var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out;
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-submit:hover,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-submit:hover {
  filter: brightness(var(--generation-submit-brightness));
  box-shadow: var(--glow-medium);
  transform: translateY(var(--generation-submit-rise));
}
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-history > header span,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task small,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-empty,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-script-meta,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-model-note p {
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task b.completed { color: var(--color-success); }
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task b.processing { color: var(--color-warning); }
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-task b.failed { color: var(--color-danger); }

@media (max-width: 760px) {
  .client-body:has(.studio-shell.view-digitalHuman) .digital-human-stage,
  .client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-stage {
    width: calc(100% - (var(--space-3) * 2));
    padding-top: var(--client-mobile-tool-safe-top);
  }
}

/* Reference-layout completion: icon rhythm, grouped navigation, the optional
   announcement rail, and compact discovery cards all reuse shared tokens. */
.ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  line-height: 1;
}
.ui-icon svg { width: 100%; height: 100%; display: block; }

.client-body :is(.composer-expand-button, .model-picker-scroll-button) .ui-icon,
.client-body :is(.custom-select-trigger i, .model-picker-glyph, .model-picker-chevron, .generation-spec-chip > span:last-child, .duration-picker-trigger) .ui-icon,
.client-body .composer-reference-remove .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.client-body .model-picker-option > b .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

/* Let short model lists stay compact; only the list itself scrolls after five
   fixed-height rows, so rows remain aligned without covering the composer. */
.client-body .model-picker-menu {
  height: auto !important;
  max-height: calc(100vh - 120px);
  grid-template-rows: auto minmax(0, auto);
}
.client-body .model-picker-scroll {
  height: auto !important;
  max-height: var(--model-picker-list-max-height);
}
.client-body .model-picker-list {
  height: auto !important;
  max-height: var(--model-picker-list-max-height);
}
.client-body .model-picker-option {
  height: var(--model-picker-row-height) !important;
  min-height: var(--model-picker-row-height) !important;
  max-height: var(--model-picker-row-height) !important;
}

.admin-body .admin-primary,
.admin-body .admin-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.admin-body :is(.admin-primary, .admin-search, .admin-modal header > button) .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.platform-announcement-bar {
  position: relative;
  z-index: 80;
  height: var(--client-announcement-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--brand-border-soft);
  background: var(--glass-medium-bg);
  color: var(--page-text);
  box-shadow: var(--shadow-depth-nav);
  backdrop-filter: blur(var(--glass-blur-medium));
}
.platform-announcement-content {
  min-width: 0;
  max-width: var(--client-content-max);
  height: 100%;
  /* The countdown owns the center column so it separates both activities. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: var(--client-announcement-inline-gap);
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--page-text-muted);
  padding-inline: var(--space-4);
  cursor: default;
}
.platform-announcement-content > .announcement-referral-segment { justify-self: end; }
.platform-announcement-content > .announcement-recharge-segment { justify-self: start; }
.platform-announcement-content > .announcement-countdown { justify-self: center; }
.platform-announcement-segment {
  min-width: 0;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: var(--client-announcement-inline-gap);
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.platform-announcement-segment:hover { color: var(--color-brand); }
.platform-announcement-segment:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}
.platform-announcement-segment > .ui-icon:first-child { color: var(--color-info); }
.platform-announcement-content strong {
  flex: 0 0 auto;
  color: var(--page-text);
  font-size: var(--font-caption);
}
.platform-announcement-segment > span:not(.ui-icon) {
  min-width: 0;
  overflow: hidden;
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.announcement-segment-divider {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .48);
}
.announcement-referral-mobile-label,
.announcement-recharge-mobile-label { display: none; }
.platform-announcement-dismiss {
  width: var(--client-announcement-height);
  height: var(--client-announcement-height);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--page-text-subtle);
  padding: 0;
  cursor: pointer;
}
.platform-announcement-dismiss:hover { background: var(--brand-surface-soft); color: var(--page-text); }
.platform-announcement-dismiss .ui-icon { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.platform-announcement-bar + .studio-shell { height: calc(100vh - var(--client-announcement-height)); }
.platform-announcement-bar + .studio-shell .workspace { height: 100%; }
body:has(.studio-shell.view-inspire) .platform-announcement-bar {
  border-bottom: 0;
  background: var(--gradient-brand);
  box-shadow: none;
}
/* Keep the announcement track stable when switching between inspiration and
   generation, so the left rail does not jump vertically. */
body:has(.studio-shell:is(.view-inspire, .view-create)) {
  --client-announcement-height: 40px;
}
body:has(.studio-shell.view-inspire) .platform-announcement-content,
body:has(.studio-shell.view-inspire) .platform-announcement-content strong { color: var(--color-text); }
body:has(.studio-shell.view-inspire) .platform-announcement-dismiss { color: rgba(255, 255, 255, .78); }
body:has(.studio-shell.view-inspire) .platform-announcement-content:hover,
body:has(.studio-shell.view-inspire) .platform-announcement-dismiss:hover { color: var(--color-text); background: rgba(255, 255, 255, .14); }

.client-body .tool-rail nav {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.client-body .tool-rail nav::-webkit-scrollbar { display: none; }
.client-body .rail-nav-group {
  display: grid;
  gap: var(--client-nav-group-gap);
}
.client-body .rail-nav-group + .rail-nav-group {
  margin-top: var(--client-nav-group-separator-space);
  padding-top: var(--client-nav-group-separator-space);
  border-top: 1px solid var(--page-line-soft);
}
.client-body .rail-button > .ui-icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
.client-body .mobile-nav-button > .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
.client-body .search-box > .ui-icon,
.client-body .inspiration-top-nav label > .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-card {
  border-color: transparent;
  box-shadow: var(--shadow-depth-card);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card:hover,
.client-body:has(.studio-shell.view-inspire) .inspiration-card:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow-depth-float), var(--glow-soft);
  transform: translateY(var(--client-card-hover-rise));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-media {
  aspect-ratio: var(--publication-aspect-ratio, var(--client-card-aspect-ratio)) !important;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card:hover .inspiration-media img,
.client-body:has(.studio-shell.view-inspire) .inspiration-card:hover .inspiration-media video {
  transform: scale(var(--client-card-media-scale));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card-summary {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-2);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card-summary > div {
  min-width: 0;
  display: grid;
  gap: var(--space-1);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-card-summary .publication-access {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
}

/* Discovery owns its navigation below the hero. Do not leave the task-search
   toolbar floating above that hero; the announcement remains available in the
   discovery navigation itself. */
.client-body .studio-shell.view-inspire .workspace-toolbar { display: none; }
.client-body .studio-shell.view-inspire .home-hero {
  min-height: var(--client-hero-min-height);
  height: calc(100dvh - var(--client-hero-next-section-peek));
}
.client-body:has(.studio-shell.view-inspire) .inspiration-announcement-button {
  position: relative;
  min-width: var(--control-height-compact);
  height: var(--control-height-compact);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-left: auto;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-sm);
  background: var(--page-control-bg);
  color: var(--page-text-muted);
  padding: 0 var(--space-3);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--page-transition) ease-out, border-color var(--page-transition) ease-out, color var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-announcement-button:hover {
  border-color: var(--brand-border);
  background: var(--page-control-hover);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-announcement-button .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-announcement-button i {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: var(--status-dot-size);
  height: var(--status-dot-size);
  border-radius: var(--radius-pill);
  background: var(--color-warning);
  box-shadow: 0 0 0 var(--status-dot-ring-width) var(--page-surface-1);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-published-link { margin-left: 0; }

/* Dense operational and library pages use a quiet surface. The generation
   workspace keeps its grid, while browsing and management avoid moire and
   glow artifacts behind text-heavy content. */
.client-body:has(.studio-shell.view-inspire) .inspiration-stage,
.client-body:has(.studio-shell.view-assets) .asset-stage,
.client-body:has(.studio-shell.view-profile) .profile-stage,
.client-body:has(.studio-shell.view-digitalHuman) .workspace,
.client-body:has(.studio-shell.view-videoEnhancer) .workspace,
.admin-body,
.admin-body .admin-login {
  background-image: var(--page-quiet-background);
  background-size: 100% var(--page-quiet-background-height);
  background-repeat: no-repeat;
}

.admin-body .admin-sidebar nav button i,
.admin-body .admin-sidebar-bottom i {
  display: grid;
  place-items: center;
}
.admin-body .admin-sidebar :is(nav button i, .admin-sidebar-bottom i) .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
.admin-body .admin-modal > header {
  align-items: flex-start;
  gap: var(--space-4);
}
.admin-body .admin-modal > header > button {
  width: var(--admin-control-height);
  min-width: var(--admin-control-height);
  height: var(--admin-control-height);
  min-height: var(--admin-control-height);
  align-self: flex-start;
  flex: 0 0 var(--admin-control-height);
  padding: 0;
}
.admin-body .admin-modal label > small { color: var(--admin-text-muted); }
.admin-body .admin-modal fieldset {
  border-color: var(--admin-border);
  background: var(--admin-surface-raised);
  color: var(--admin-text-muted);
}
.admin-body .admin-modal fieldset legend { color: var(--admin-text-muted); }
.admin-body .membership-tier-row { border-color: var(--admin-border); background: var(--admin-input); }
.admin-body .membership-tier-row.active { border-color: var(--admin-accent); box-shadow: none; }
.admin-body .membership-tier-choice { color: var(--admin-text); }

@media (max-width: 600px) {
  .platform-announcement-content { padding-inline: var(--space-3); }
  .announcement-red-tag,
  .announcement-recharge-text { display: none; }
  .announcement-referral-mobile-label,
  .announcement-recharge-mobile-label { display: inline; }
  .client-body .studio-shell.view-inspire .home-hero { min-height: var(--client-hero-mobile-min-height); }
  .client-body:has(.studio-shell.view-inspire) .inspiration-top-nav {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--space-2);
    overflow: visible;
    padding: var(--space-2);
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-top-nav nav { display: none; }
  .client-body:has(.studio-shell.view-inspire) .inspiration-brand {
    grid-column: 1;
    align-self: center;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-announcement-button {
    grid-column: 2;
    margin-left: 0;
    min-width: var(--control-height-compact);
    padding: 0;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-announcement-button > span:not(.ui-icon) { display: none; }
  .client-body:has(.studio-shell.view-inspire) .inspiration-published-link {
    grid-column: 3;
    align-self: center;
    margin: 0;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-top-nav > label {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }
  .client-body:has(.studio-shell.view-inspire) .customer-service-widget {
    bottom: var(--client-support-inspire-mobile-bottom);
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-copy {
    gap: var(--space-1);
    padding: var(--space-6) var(--space-2) var(--space-2);
    opacity: 1;
    transform: none;
    pointer-events: none;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-copy :is(.publication-access-actions, .social-actions) {
    display: none;
  }
}

/* Shared icon and preview finishing pass. These rules only normalize the
   existing controls; event handlers and media delivery remain unchanged. */
.client-body :is(
  .social-actions button,
  .publication-access-actions button,
  .asset-header-actions button,
  .asset-batch-actions button,
  .video-enhancer-task-actions button,
  .enhancement-compare-modal footer button,
  .agent-skill-trigger,
  .agent-skill-chip
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.client-body :is(
  .video-play,
  .asset-play,
  .audio-asset-icon,
  .reference-audio-icon,
  .inline-reference-thumb > i,
  .reference-hover-thumb > i,
  .library-preview > i,
  .conversation-thumb > i,
  .digital-human-avatar-empty,
  .video-enhancer-dropzone > i
) .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
.client-body :is(
  .inline-reference-chip button,
  .reference-library-remove,
  .agent-skill-chip
) .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.client-body .prompt-composer:focus-within {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-depth-float), var(--glow-soft);
}
.client-body .prompt-rich-editor:focus,
.client-body .prompt-rich-editor:focus-visible {
  outline: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}
.client-body .media-viewer-backdrop {
  gap: var(--media-preview-gap);
  background: var(--media-preview-backdrop);
}
.client-body .floating-media-viewer,
.client-body .floating-media-viewer .media-viewer-stage {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.client-body .viewer-surface-actions button,
.client-body .floating-media-viewer .viewer-icon {
  width: var(--control-icon-size);
  min-width: var(--control-icon-size);
  height: var(--control-icon-size);
  min-height: var(--control-icon-size);
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--control-icon-radius);
  background: var(--media-control-bg);
  color: var(--media-control-fg);
  padding: 0;
  backdrop-filter: blur(var(--glass-blur-low));
  transition: background-color var(--motion-fast) ease-out, color var(--motion-fast) ease-out, transform var(--motion-fast) ease-out;
}
.client-body .viewer-surface-actions button:hover,
.client-body .floating-media-viewer .viewer-icon:hover {
  background: var(--media-control-bg-hover);
  transform: translateY(var(--generation-hover-rise));
}
.client-body .viewer-surface-actions .viewer-download {
  background: var(--media-control-accent-bg);
  color: var(--media-control-fg);
}
.client-body .viewer-surface-actions #resetZoom,
.client-body .viewer-surface-actions #originalImageToggle {
  width: auto;
  min-width: calc(var(--control-icon-size) + var(--space-4));
  padding-inline: var(--space-2);
}
.client-body .viewer-surface-actions .ui-icon,
.client-body .viewer-audio > span .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
.client-body .media-viewer-stage:fullscreen {
  background: var(--page-media-bg);
}

/* Page-level fullscreen fallback for browsers that block the native API.
   It uses the same viewport geometry as :fullscreen while preserving the
   custom playback controls and media aspect ratio. */
.client-body .media-viewer-backdrop.viewer-page-fullscreen {
  padding: 0;
  background: #000;
}
.client-body .media-viewer-backdrop.viewer-page-fullscreen .floating-media-viewer {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw;
  max-height: 100dvh;
  border-radius: 0;
}
.client-body .media-viewer-backdrop.viewer-page-fullscreen .media-viewer-stage {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  border-radius: 0 !important;
  background: #000;
}
.client-body .media-viewer-backdrop.viewer-page-fullscreen .viewer-surface-top {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.client-body .media-viewer-backdrop.viewer-page-fullscreen .viewer-video-controls {
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
}
.client-body .media-viewer-backdrop.viewer-page-fullscreen .media-viewer-stage > #viewerVideo,
.client-body .media-viewer-backdrop.viewer-page-fullscreen .media-viewer-stage > #viewerImage {
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100dvh;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}

/* Frontend-only completion pass for secondary creation pages and dialogs.
   These selectors deliberately preserve the existing markup and event paths. */
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-stage,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-stage {
  width: min(var(--client-secondary-stage-max), calc(100% - var(--client-secondary-stage-gutter)));
  padding: var(--client-secondary-stage-top) 0 var(--client-secondary-stage-bottom);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-heading,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-heading {
  gap: var(--client-secondary-heading-gap);
  margin-bottom: var(--client-secondary-heading-gap);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-workspace,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-workspace {
  gap: var(--client-secondary-panel-gap);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-panel {
  border-radius: var(--radius-base);
  padding: var(--client-secondary-panel-padding);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-panel > header > span,
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-panel > header > span {
  border-color: var(--brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-surface-soft);
  color: var(--color-brand);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-avatar-card:not(.selected) {
  align-content: center;
  gap: var(--space-3);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-avatar-card > .digital-human-avatar-empty {
  width: var(--client-secondary-upload-icon);
  height: var(--client-secondary-upload-icon);
  padding: 0;
  border-color: var(--brand-border);
  border-radius: var(--radius-pill);
  background: var(--brand-surface-soft);
  color: var(--color-brand);
  text-align: center;
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-avatar-card > .digital-human-avatar-empty + strong,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-avatar-card > .digital-human-avatar-empty + strong + small {
  margin: 0;
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-scene-card:not(.selected) {
  grid-template-columns: calc(var(--client-secondary-upload-icon) + var(--space-4)) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  padding: var(--space-3);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-scene-card:not(.selected) .digital-human-avatar-empty {
  grid-row: 1 / 3;
  width: var(--client-secondary-upload-icon);
  height: var(--client-secondary-upload-icon);
  margin: 0;
  padding: 0;
  border-color: var(--brand-border);
  border-radius: var(--radius-pill);
  background: var(--brand-surface-soft);
  color: var(--color-brand);
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-scene-card:not(.selected) > strong,
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-scene-card:not(.selected) > small {
  grid-column: 2;
  align-self: auto;
  margin: 0;
  padding: 0;
}
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-scene-card:not(.selected) > strong { align-self: end; }
.client-body:has(.studio-shell.view-digitalHuman) .digital-human-scene-card:not(.selected) > small {
  align-self: start;
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-price {
  min-width: var(--client-secondary-price-min-width);
  max-width: var(--client-secondary-price-max-width);
}
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-price strong {
  line-height: 1.35;
  text-wrap: balance;
  word-break: keep-all;
}
.client-body:has(.studio-shell.view-videoEnhancer) .video-enhancer-provider-note {
  color: var(--page-text-muted);
  line-height: 1.55;
}

.client-body:has(.studio-shell.view-create) .agent-chat-feed {
  width: min(var(--client-agent-content-max), 100%);
}
.client-body:has(.studio-shell.view-create) .agent-chat-avatar {
  border-color: var(--page-line);
  background: var(--page-surface-2);
  color: var(--color-brand);
}
.client-body:has(.studio-shell.view-create) .agent-chat-body > header strong,
.client-body:has(.studio-shell.view-create) .agent-chat-bubble {
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-create) .agent-chat-body > header time,
.client-body:has(.studio-shell.view-create) .agent-chat-usage,
.client-body:has(.studio-shell.view-create) .agent-chat-thinking,
.client-body:has(.studio-shell.view-create) .agent-chat-empty,
.client-body:has(.studio-shell.view-create) .agent-enter-hint,
.client-body:has(.studio-shell.view-create) .agent-retention-hint {
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-create) .agent-chat-bubble {
  border-color: var(--page-line);
  background: var(--glass-medium-bg);
  box-shadow: var(--shadow-sm);
}
.client-body:has(.studio-shell.view-create) .agent-chat-message.user .agent-chat-bubble {
  border-color: var(--brand-border-soft);
  background: var(--brand-surface);
}
.client-body:has(.studio-shell.view-create) .agent-model-select,
.client-body:has(.studio-shell.view-create) .agent-skill-trigger,
.client-body:has(.studio-shell.view-create) .agent-skill-chip {
  border-color: var(--page-line);
  background: var(--page-control-bg);
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-create) .agent-model-select:focus-within,
.client-body:has(.studio-shell.view-create) .agent-skill-trigger:hover,
.client-body:has(.studio-shell.view-create) .agent-skill-chip:hover {
  border-color: var(--brand-border);
  background: var(--page-control-hover);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-create) .agent-model-select select {
  max-width: var(--client-agent-model-max-width);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-create) .agent-skill-menu,
.client-body:has(.studio-shell.view-create) .agent-mode-menu {
  border-color: var(--page-line-strong);
  background: var(--glass-high-bg);
  box-shadow: var(--shadow-depth-dialog);
  backdrop-filter: blur(var(--glass-blur-high));
}

.client-body:has(.studio-shell.view-profile) :is(.profile-header, .profile-panel, .profile-metrics, .profile-publications) {
  max-width: var(--client-profile-content-max);
}
.client-body:has(.studio-shell.view-profile) .profile-header,
.client-body:has(.studio-shell.view-profile) .profile-panel,
.client-body:has(.studio-shell.view-profile) .profile-metrics article,
.client-body:has(.studio-shell.view-profile) .invite-code-grid article,
.client-body:has(.studio-shell.view-profile) .profile-publication-list > article {
  border-color: var(--page-line);
  background: var(--glass-low-bg);
  box-shadow: var(--shadow-sm);
}
.client-body:has(.studio-shell.view-profile) :is(.profile-header, .profile-panel, .profile-metrics article) {
  border-radius: var(--radius-base);
}
.client-body:has(.studio-shell.view-profile) .profile-header p,
.client-body:has(.studio-shell.view-profile) .profile-metrics span,
.client-body:has(.studio-shell.view-profile) .profile-panel header span,
.client-body:has(.studio-shell.view-profile) .profile-rule,
.client-body:has(.studio-shell.view-profile) .profile-table-wrap th,
.client-body:has(.studio-shell.view-profile) .profile-publications header span {
  color: var(--page-text-muted);
}
.client-body:has(.studio-shell.view-profile) .profile-table-wrap :is(th, td) {
  border-bottom-color: var(--page-line-soft);
}

.client-body .modal-backdrop {
  background: var(--generation-modal-overlay);
  backdrop-filter: blur(var(--glass-blur-low));
}
.client-body :is(.profile-modal, .announcement-modal, .login-announcement-modal, .reference-library-modal, .save-asset-modal, .agent-skill-editor) {
  border-color: var(--page-line-strong);
  border-radius: var(--radius-lg);
  background: var(--glass-high-bg);
  color: var(--page-text);
  box-shadow: var(--shadow-depth-dialog), var(--glow-soft);
  backdrop-filter: blur(var(--glass-blur-high));
}
.client-body .profile-modal { width: min(var(--client-dialog-width), 100%); }
.client-body .announcement-modal { width: min(var(--client-dialog-wide-width), calc(100vw - (var(--space-4) * 2))); }
.client-body .reference-library-modal { width: min(var(--client-library-dialog-width), 100%); }
.client-body :is(.profile-modal, .save-asset-modal, .agent-skill-editor) :is(input, textarea, select),
.client-body .reference-library-filters,
.client-body .reference-library-item {
  border-color: var(--page-line);
  background: var(--page-control-bg);
  color: var(--page-text);
}
.client-body :is(.profile-modal, .announcement-modal, .reference-library-modal, .save-asset-modal, .agent-skill-editor) :is(header, footer) {
  border-color: var(--page-line-soft);
}

/* At laptop widths the structure remains unchanged; only nonessential helper
   copy yields space so the model selector and submit control never collide. */
@media (max-width: 1200px) and (min-width: 768px) {
  .client-body:has(.studio-shell.view-create) .agent-composer-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
  }
  .client-body:has(.studio-shell.view-create) .agent-composer-toolbar .composer-options,
  .client-body:has(.studio-shell.view-create) .agent-model-select {
    min-width: 0;
  }
  .client-body:has(.studio-shell.view-create) .agent-model-select {
    flex: 1 1 auto;
  }
  .client-body:has(.studio-shell.view-create) .agent-model-select select {
    width: 100%;
    min-width: 0;
    max-width: none;
    text-overflow: ellipsis;
  }
  .client-body:has(.studio-shell.view-create) .agent-retention-hint { display: none; }
  .client-body:has(.studio-shell.view-create) .agent-composer-toolbar .composer-submit {
    min-width: 0;
    gap: var(--space-2);
  }
}

/* Logged-in inspiration home: the discovery page is a compact workspace,
   while the existing create page keeps its original fixed composer. */
.client-body:has(.studio-shell.view-inspire) {
  --page-surface-0: #0b0d10;
  --page-surface-1: #171a21;
  --page-surface-2: #1f242d;
  --page-line-soft: rgba(35, 40, 50, .72);
  --page-line: #232832;
  --page-line-strong: rgba(91, 155, 255, .42);
  --page-text: #ffffff;
  --page-text-muted: #b4bcc8;
  --page-text-subtle: #6d7684;
  --page-control-bg: #1f242d;
  --page-control-hover: rgba(91, 155, 255, .16);
  --color-brand: #5b9bff;
  --brand-surface-soft: rgba(91, 155, 255, .12);
  --brand-border: rgba(91, 155, 255, .48);
  --home-content-gutter: 48px;
  --home-content-offset: 76px;
  --home-heading-size: 28px;
  --home-card-title-size: 16px;
  --home-card-title-weight: 500;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-stage {
  height: 100%;
  overflow-y: auto;
  padding: var(--space-8) var(--home-content-gutter) 72px;
  background: var(--page-surface-0);
  color: var(--page-text);
  scrollbar-color: var(--page-line-strong) transparent;
}
.client-body:has(.studio-shell.view-inspire) .conversation-sidebar {
  width: 0;
  min-width: 0;
  padding-inline: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-heading,
.client-body:has(.studio-shell.view-inspire) .inspiration-home-generation,
.client-body:has(.studio-shell.view-inspire) .inspiration-home-features,
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section {
  width: min(var(--client-content-max), 100%);
  margin-right: auto;
  margin-left: auto;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-heading { padding: 8px 0 28px; text-align: center; }
.inspiration-home-heading > span,
.inspiration-home-section-label span,
.inspiration-home-section-heading span { color: var(--color-brand); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.inspiration-home-heading h1 { margin: 0 auto; color: var(--page-text); font-size: var(--home-heading-size); font-weight: 600; line-height: 1.3; }
.inspiration-home-heading h1 span { color: var(--color-brand); }
.inspiration-home-heading h1 span .ui-icon { display: inline-block; width: .72em; height: .72em; margin-left: .14em; vertical-align: .03em; }
.inspiration-home-generation { border: 1px solid var(--page-line); border-radius: var(--radius-xl); background: var(--page-surface-1); box-shadow: var(--shadow-depth-card); padding: clamp(16px, 2vw, 24px); }
.inspiration-home-section-label,
.inspiration-home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); }
.inspiration-home-section-label > div,
.inspiration-home-section-heading { min-width: 0; }
.inspiration-home-section-label strong,
.inspiration-home-section-heading strong { display: block; margin-top: 5px; color: var(--page-text); font-size: var(--font-heading); font-weight: 650; }
.inspiration-home-section-label small { color: var(--page-text-muted); font-size: var(--font-caption); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer { position: relative; inset: auto; left: auto; bottom: auto; transform: none; width: 100%; min-height: 0; margin-top: 0; border: 0; border-radius: var(--radius-lg); background: transparent; box-shadow: none; backdrop-filter: none; }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer:focus-within { border-color: transparent; box-shadow: none; }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-main { padding-top: var(--space-5); padding-bottom: var(--space-4); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-toolbar { min-height: calc(var(--control-height-compact) + var(--space-3) + var(--space-1)); border-top: 1px solid var(--page-line-soft); padding-top: var(--space-3); padding-bottom: var(--space-2); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > :is(.generation-mode-select, .reference-mode-select, .generation-spec-chip, .duration-picker-trigger, .generation-template-placeholder, .model-picker-trigger, .home-mention-button) {
  height: calc(var(--control-height-compact) - var(--space-1));
  min-height: calc(var(--control-height-compact) - var(--space-1));
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .generation-mode-select { width: var(--generation-toolbar-mode-width); min-width: var(--generation-toolbar-mode-width); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .model-picker-trigger { width: calc(var(--generation-toolbar-model-width) - var(--space-2)); min-width: calc(var(--generation-toolbar-model-width) - var(--space-2)); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .reference-mode-select { width: var(--generation-toolbar-video-reference-width); min-width: var(--generation-toolbar-video-reference-width); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .generation-spec-chip { width: var(--generation-toolbar-spec-width); min-width: var(--generation-toolbar-spec-width); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .duration-picker-trigger { width: var(--generation-toolbar-video-duration-width); min-width: var(--generation-toolbar-video-duration-width); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .generation-template-placeholder { width: calc(var(--generation-toolbar-video-duration-width) + var(--space-1)); min-width: calc(var(--generation-toolbar-video-duration-width) + var(--space-1)); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .home-mention-button { flex-basis: calc(var(--control-height-compact) - var(--space-1)); width: calc(var(--control-height-compact) - var(--space-1)); min-width: calc(var(--control-height-compact) - var(--space-1)); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-trigger { padding-right: var(--space-2); padding-left: var(--space-2); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .model-picker-trigger { padding-right: var(--space-2); padding-left: var(--space-2); }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .model-picker-current { max-width: 120px; }
.home-prompt-composer .home-composer-material-header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--page-line-soft); }
.home-material-tabs { display: flex; align-items: center; gap: 3px; min-width: 0; }
.home-material-tabs button { height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--page-text-subtle); padding: 0 11px; font-size: var(--font-caption); cursor: pointer; }
.home-material-tabs button:hover,
.home-material-tabs button.active { background: var(--brand-surface-soft); color: var(--page-text); }
.home-material-tabs button.active { box-shadow: inset 0 -2px var(--color-brand); }
.home-clear-references { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--page-text-muted); padding: 0 8px; font-size: var(--font-caption); cursor: pointer; }
.home-clear-references:hover:not(:disabled) { background: var(--brand-surface-soft); color: var(--page-text); }
.home-clear-references:disabled { opacity: .42; cursor: default; }
.home-clear-references .ui-icon { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.home-prompt-composer .home-segment-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin: 0 var(--space-4); border-top: 1px solid var(--page-line-soft); border-bottom: 1px solid var(--page-line-soft); background: var(--page-line-soft); }
.home-segment-summary span { min-width: 0; display: grid; gap: 5px; background: var(--page-surface-0); padding: 12px 10px; }
.home-segment-summary small { overflow: hidden; color: var(--page-text-subtle); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.home-segment-summary strong { overflow: hidden; color: var(--page-text-muted); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-toolbar { border-top: 1px solid var(--page-line-soft); }
.generation-template-placeholder { min-height: var(--control-height-compact); border: 1px solid var(--page-line); border-radius: var(--radius-sm); background: var(--page-control-bg); color: var(--page-text-muted); padding: 0 var(--space-3); font-size: var(--font-caption); cursor: default; }
.generation-template-placeholder:hover { border-color: var(--page-line-strong); color: var(--page-text); }
.home-mention-button { flex: 0 0 var(--control-height-compact); width: var(--control-height-compact); min-height: var(--control-height-compact); border-color: var(--page-line); background: var(--page-control-bg); color: var(--color-brand); }
.home-mention-button:hover { border-color: var(--brand-border); background: var(--brand-surface-soft); color: var(--page-text); }
.inspiration-home-features { margin-top: 30px; }
.inspiration-home-section-heading { margin-bottom: 12px; }
.inspiration-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.inspiration-feature-grid .home-feature-card { min-height: 116px; grid-template-columns: 42px minmax(0, 1fr) auto; gap: var(--space-3); border-color: var(--page-line); border-radius: var(--radius-lg); background: var(--page-surface-1); padding: var(--space-4); box-shadow: none; }
.inspiration-feature-grid .home-feature-card:hover { border-color: var(--brand-border); background: var(--page-surface-2); transform: translateY(-2px); }
.inspiration-feature-grid .home-feature-card > span { width: 42px; height: 42px; border-radius: var(--radius-base); background: var(--brand-surface); color: var(--color-brand); font-size: 20px; }
.inspiration-feature-grid .home-feature-card:nth-child(2) > span { background: var(--admin-warning-surface); color: var(--color-warning); }
.inspiration-feature-grid .home-feature-card:nth-child(3) > span { background: var(--admin-info-surface); color: var(--color-info); }
.inspiration-feature-grid .home-feature-card:nth-child(4) > span { background: var(--admin-success-surface); color: var(--color-success); }
.inspiration-feature-grid .home-feature-card > div { min-width: 0; }
.inspiration-feature-grid .home-feature-card strong { display: block; overflow: hidden; color: var(--page-text); font-size: var(--home-card-title-size); font-weight: var(--home-card-title-weight); text-overflow: ellipsis; white-space: nowrap; }
.inspiration-feature-grid .home-feature-card p { margin: 6px 0 0; color: var(--page-text-muted); font-size: var(--font-caption); line-height: 1.45; }
.inspiration-feature-grid .home-feature-card > b { color: var(--page-text-subtle); }
.inspiration-feature-grid .home-feature-card > b .ui-icon { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section { padding-top: 42px; }
.inspiration-discovery-nav { min-height: 54px; display: flex; align-items: center; gap: var(--space-4); border-bottom: 1px solid var(--page-line); }
.inspiration-discovery-nav nav { align-self: stretch; display: flex; align-items: stretch; gap: 22px; }
.inspiration-discovery-nav nav button { position: relative; border: 0; background: transparent; color: var(--page-text-muted); padding: 0 1px; font-size: 13px; cursor: pointer; }
.inspiration-discovery-nav nav button:hover,
.inspiration-discovery-nav nav button.active { color: var(--page-text); }
.inspiration-discovery-nav nav button.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--color-brand); }
.inspiration-discovery-nav > label { width: min(260px, 28vw); height: 34px; display: flex; align-items: center; gap: 7px; margin-left: auto; border: 1px solid var(--page-line); border-radius: var(--radius-base); background: var(--page-control-bg); color: var(--page-text-subtle); padding: 0 10px; }
.inspiration-discovery-nav > label:focus-within { border-color: var(--brand-border); box-shadow: var(--page-focus-ring); }
.inspiration-discovery-nav > label input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--page-text); font-size: var(--font-caption); }
.inspiration-discovery-nav .inspiration-announcement-button { margin-left: 0; }
.inspiration-discovery-nav .inspiration-published-link { margin-left: 0; color: var(--page-text-muted); }
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-filter-bar { margin-top: var(--space-4); border-bottom-color: var(--page-line-soft); }
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-filter-bar button { min-width: 64px; color: var(--page-text-subtle); }
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-filter-bar button.active { color: var(--page-text); border-bottom-color: var(--color-brand); }
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-grid { gap: var(--space-4); }

@media (max-width: 1100px) and (min-width: 641px) {
  .inspiration-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspiration-feature-grid .home-feature-card:last-child { grid-column: auto; }
  .home-prompt-composer .home-segment-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inspiration-discovery-nav > label { width: min(220px, 24vw); }

  /* The home composer has four controls plus the submit action. At narrower
     desktop widths let its control rail wrap instead of clipping the spec and
     template controls inside the inherited horizontal scroller. */
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-toolbar {
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: wrap;
    overflow: visible;
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > :is(.generation-mode-select, .model-picker-trigger, .generation-spec-chip, .generation-template-placeholder) {
    width: auto;
    min-width: 0;
    flex: 1 1 calc(50% - var(--space-2));
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-submit {
    margin-left: auto;
  }
}

/* Tablet and laptop inspiration layouts share the desktop rail dimensions;
   only the content grid/control row adapts at these widths. */
@media (max-width: 1200px) and (min-width: 601px) {
  .client-body .studio-shell.view-inspire { grid-template-columns: 72px 0 minmax(0, 1fr); }
}

/* At the existing compact-sidebar breakpoint the conversation column is
   display:none, so the workspace correctly occupies the second grid track. */
@media (max-width: 820px) and (min-width: 601px) {
  .client-body .studio-shell.view-inspire { grid-template-columns: 72px minmax(0, 1fr); }
}

/* Inspiration home detail alignment
   Keep the shared composer markup and interactions intact, while matching the
   reference's narrow creation rail, compact feature cards and wider discovery
   canvas. These rules are scoped to the logged-in inspiration view only. */
.client-body:has(.studio-shell.view-inspire) {
  --home-rail-width: 60px;
  --home-content-max: 1090px;
  --home-discovery-max: 1292px;
  --home-heading-size: 24px;
}
.client-body .studio-shell.view-inspire {
  grid-template-columns: var(--home-rail-width) 0 minmax(0, 1fr);
}
.client-body .studio-shell.view-inspire .tool-rail {
  padding-right: 6px;
  padding-left: 6px;
}
.client-body .studio-shell.view-inspire .rail-button {
  min-height: 48px;
  gap: 3px;
  border-radius: var(--radius-base);
}
.client-body .studio-shell.view-inspire .rail-button > .ui-icon {
  width: 20px;
  height: 20px;
}
.client-body .studio-shell.view-inspire .rail-button > span:last-child {
  font-size: 11px;
}
.client-body .studio-shell.view-inspire .rail-nav-group {
  gap: 4px;
}
.client-body .studio-shell.view-inspire .rail-nav-group + .rail-nav-group {
  margin-top: 4px;
  padding-top: 4px;
}
.client-body .studio-shell.view-inspire .rail-button.active::before {
  top: 8px;
  bottom: 8px;
  width: 2px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-stage {
  padding-top: calc(88px + var(--home-content-offset));
  scrollbar-width: none;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-stage::-webkit-scrollbar {
  display: none;
}
.client-body:has(.studio-shell.view-inspire) :is(.inspiration-home-heading, .inspiration-home-generation, .inspiration-home-features) {
  width: min(var(--home-content-max), 100%);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section {
  width: min(var(--home-discovery-max), 100%);
  padding-top: 90px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-heading {
  padding-top: 0;
  padding-bottom: 36px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-expand-button {
  display: none;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-generation {
  padding: 18px 0 14px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer {
  height: 124px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-main {
  height: 90px;
  min-height: 90px;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: var(--client-rail-bottom-gap);
  padding: 0 17px 8px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .attach-button {
  width: 48px;
  height: 58px;
  grid-template-rows: 1fr auto;
  margin-top: 4px;
  padding: 7px 0 6px;
  transform: rotate(-7deg);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .attach-button:not(.has-reference)::after {
  content: "参考内容";
  color: var(--page-text-subtle);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .prompt-rich-editor {
  height: 82px;
  min-height: 0;
  color: var(--page-text-subtle);
  font-size: 13px;
  line-height: 1.55;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .prompt-rich-editor:empty::before {
  color: var(--page-text-subtle);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-toolbar {
  height: 34px;
  min-height: 34px;
  gap: 6px;
  padding: 1px 16px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options {
  gap: 6px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > :is(.generation-mode-select, .reference-mode-select, .generation-spec-chip, .duration-picker-trigger, .generation-template-placeholder, .model-picker-trigger, .home-mention-button) {
  font-size: 12px;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .generation-mode-select {
  width: 100px;
  min-width: 100px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .model-picker-trigger {
  width: 205px;
  min-width: 205px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .reference-mode-select {
  width: 96px;
  min-width: 96px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .generation-spec-chip {
  width: 132px;
  min-width: 132px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .duration-picker-trigger {
  width: 58px;
  min-width: 58px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > .generation-template-placeholder {
  width: 58px;
  min-width: 58px;
  padding-right: 8px;
  padding-left: 8px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-submit {
  height: 34px;
  gap: 8px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-price {
  font-size: 10px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .send-button {
  width: 34px;
  height: 34px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid {
  gap: 8px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card {
  min-height: 66px;
  height: 66px;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card > span {
  width: 36px;
  height: 36px;
  font-size: 18px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card strong {
  font-size: 14px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card p {
  margin-top: 2px;
  font-size: 11px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card > b {
  display: none;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-features {
  margin-top: 38px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav {
  min-height: 40px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav nav {
  gap: 26px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav nav button {
  padding-right: 6px;
  padding-left: 6px;
  font-size: 14px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav nav button.active {
  border-radius: var(--radius-base);
  background: var(--page-surface-2);
  padding-right: 16px;
  padding-left: 16px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav nav button.active::after {
  display: none;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav > label {
  width: 282px;
  height: 32px;
  margin-left: 10px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav .inspiration-published-link {
  margin-left: auto;
  font-size: 12px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-announcement-button {
  display: none;
}

@media (max-width: 1100px) and (min-width: 601px) {
  .client-body:has(.studio-shell.view-inspire) {
    --home-content-max: 100%;
    --home-discovery-max: 100%;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-home-stage {
    padding-right: 28px;
    padding-left: 28px;
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-toolbar {
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options {
    width: auto;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > * {
    flex: 0 0 auto;
  }
  .client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-submit {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

/* Shared 72px product rail. The existing destinations stay unchanged; this
   only gives the navigation, membership balance and notification center the
   same visual hierarchy as the supplied reference. */
.client-body .studio-shell:not(.view-inspire):not(.view-canvas):not(.canvas-editor-active) {
  grid-template-columns: var(--client-rail-width) var(--client-conversation-width) minmax(0, 1fr);
}
.client-body .studio-shell.view-inspire,
.client-body .studio-shell.sidebar-collapsed {
  grid-template-columns: var(--client-rail-width) 0 minmax(0, 1fr);
}
.client-body .studio-shell.view-canvas {
  grid-template-columns: var(--client-rail-width) 0 minmax(0, 1fr);
}
.client-body .studio-shell .tool-rail {
  width: var(--client-rail-width);
  min-width: var(--client-rail-width);
  box-sizing: border-box;
  padding: var(--space-5) var(--space-2) var(--space-4);
  border-right: 1px solid var(--page-line-soft);
  background: var(--color-bg-raised);
}
.client-body .studio-shell .rail-logo {
  width: 100%;
  height: 104px;
  display: grid;
  place-items: start center;
  padding-top: var(--space-2);
}
.client-body .studio-shell .rail-logo .brand-logo {
  width: var(--space-8);
  height: var(--space-8);
  border-radius: var(--radius-base);
  transform: none;
  filter: none;
}
.client-body .studio-shell .rail-logo .logo-gem,
.client-body .studio-shell.view-inspire .rail-logo .logo-gem {
  width: var(--space-8);
  height: var(--space-8);
  display: grid;
  place-items: center;
  font-size: var(--font-title);
  line-height: 1;
  transform: rotate(16deg);
}
.client-body .studio-shell .tool-rail nav {
  gap: var(--space-1);
  overflow-x: hidden;
}
.client-body .studio-shell .rail-nav-group,
.client-body .studio-shell.view-inspire .rail-nav-group {
  gap: var(--space-1);
}
.client-body .studio-shell .rail-nav-group + .rail-nav-group,
.client-body .studio-shell.view-inspire .rail-nav-group + .rail-nav-group {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 0;
}
.client-body .studio-shell .rail-button,
.client-body .studio-shell.view-inspire .rail-button {
  min-height: 52px;
  gap: var(--space-1);
  border-radius: var(--radius-base);
  color: var(--color-text-muted);
}
.client-body .studio-shell .rail-button > .ui-icon,
.client-body .studio-shell.view-inspire .rail-button > .ui-icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
.client-body .studio-shell .rail-button > span:last-child,
.client-body .studio-shell.view-inspire .rail-button > span:last-child {
  font-size: var(--font-caption);
  font-weight: 500;
}
.client-body .studio-shell .rail-button:hover,
.client-body .studio-shell .rail-button.active,
.client-body .studio-shell.view-inspire .rail-button:hover,
.client-body .studio-shell.view-inspire .rail-button.active {
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
}
.client-body .studio-shell .rail-button.active::before,
.client-body .studio-shell.view-inspire .rail-button.active::before {
  display: none;
}
.client-body .studio-shell .rail-bottom {
  gap: var(--space-3);
}
.client-body .rail-membership-card {
  width: 58px;
  display: grid;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-text);
  cursor: pointer;
}
.client-body .rail-member-discount {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--brand-surface-hover);
  color: var(--color-info);
  font-size: var(--font-caption);
  font-weight: 600;
}
.client-body .rail-credit-panel {
  min-height: 62px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-1);
  margin-top: -1px;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-sm);
}
.client-body .rail-credit-panel strong {
  max-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--space-1) / 2);
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-body .rail-credit-panel strong .ui-icon {
  width: calc(var(--icon-size-sm) - var(--space-1));
  height: calc(var(--icon-size-sm) - var(--space-1));
  flex: 0 0 auto;
}
.client-body .rail-credit-panel strong.is-compact {
  max-width: none;
  overflow: visible;
  font-size: calc(var(--font-caption) - 2px);
  text-overflow: clip;
}
.client-body .rail-credit-panel small {
  color: var(--color-text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Keep the original single-row toolbar. Video controls scroll inside their
   own available area instead of extending underneath the submit button. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options::-webkit-scrollbar {
  display: none;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-submit {
  min-width: max-content;
  margin-left: auto;
  margin-right: var(--space-2);
  padding-left: 0;
}

/* Keep the single-row controls compact and grouped from the left. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options {
  flex: 0 1 auto !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-image-options > .generation-mode-select,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .generation-mode-select {
  flex-basis: 108px !important;
  width: 108px !important;
  min-width: 108px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .custom-select-trigger,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .custom-select-trigger-value,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .custom-select-trigger-value > span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .custom-select-trigger-value {
  display: flex;
  align-items: center;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) :is(.generation-mode-select, .reference-mode-select) .custom-select-trigger-value > span {
  font-size: 11px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-image-options > .model-picker-trigger,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .model-picker-trigger {
  flex-basis: 216px !important;
  width: 216px !important;
  min-width: 216px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .model-picker-current,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .model-picker-current strong {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 11px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .reference-mode-select {
  flex-basis: 110px !important;
  width: 110px !important;
  min-width: 110px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-image-options > .generation-spec-chip,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .generation-spec-chip {
  flex-basis: 154px !important;
  width: 154px !important;
  min-width: 154px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .generation-spec-chip strong {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 11px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .duration-picker-trigger {
  flex-basis: 64px !important;
  width: 64px !important;
  min-width: 64px !important;
}

/* Detail media is independent from the 9:16 discovery thumbnails. A concrete
   viewport-bound height prevents tall source images from overflowing the grid
   track while keeping both images and videos at their native proportions. */
body.client-body:has(.publication-detail-shell) .publication-detail-media {
  width: auto !important;
  height: min(calc(100dvh - 48px), 100%) !important;
  max-width: calc(100% - 96px) !important;
  max-height: calc(100dvh - 48px) !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

@media (max-width: 600px) {
  body.client-body:has(.publication-detail-shell) .publication-detail-media {
    height: min(calc(100dvh - 30px), 100%) !important;
    max-width: calc(100% - 32px) !important;
    max-height: calc(100dvh - 30px) !important;
  }
}

/* Discovery is a uniform editorial gallery: source media is cropped only in
   its thumbnail, while opening a card still reveals the original asset. */
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid .inspiration-card,
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid .inspiration-card[data-inspiration-shape="landscape"] {
  grid-column: auto;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid .inspiration-media {
  aspect-ratio: 9 / 16 !important;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag {
  top: 10px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .54);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .36);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag.pinned {
  left: 10px;
  background: #176ca5;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag.hot {
  right: 10px;
  background: #b83c27;
}
.client-body .credit-logs-modal .profile-table-wrap {
  max-height: min(58vh, 540px);
}
.client-body .credit-logs-modal table {
  min-width: 900px;
}
.client-body .credit-logs-modal .credit-change,
.client-body .credit-logs-modal .credit-balance {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.client-body .credit-logs-modal .credit-change.positive { color: #4fc694; }
.client-body .credit-logs-modal .credit-change.negative { color: #ef7777; }
.client-body .credit-logs-modal .credit-balance { color: #dbe8ef; }

/* Final discovery-gallery rule: every image and video uses one 9:16 tile.
   This deliberately overrides earlier landscape feature-card rules. */
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid > .inspiration-card,
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid > .inspiration-card[data-inspiration-shape="landscape"] {
  grid-column: auto !important;
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid > .inspiration-card > .inspiration-media {
  aspect-ratio: 9 / 16 !important;
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag {
  top: 10px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .54);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .36);
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag.pinned {
  left: 10px;
  background: #176ca5;
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag.hot {
  right: 10px;
  background: #b83c27;
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .publication-favorite-button {
  top: 9px;
  right: 9px;
  width: 37px;
  height: 37px;
  border-color: rgba(255, 255, 255, .44);
  background: rgba(11, 13, 17, .46);
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-tag.hot { right: 56px; }
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .publication-cover-overlay {
  padding: 70px 16px 14px;
}
body.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .publication-cover-title strong { font-size: 15px; font-weight: 750; }
.client-body .rail-membership-card:hover .rail-member-discount {
  background: var(--brand-surface-strong);
}
.client-body .rail-membership-card:hover .rail-credit-panel {
  border-color: var(--brand-border-soft);
}
.client-body .rail-notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--color-text-muted);
  padding: 0;
  cursor: pointer;
}
.client-body .rail-notification-button:hover {
  background: var(--brand-surface-soft);
  color: var(--color-text);
}
.client-body .rail-notification-button .ui-icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
.client-body .rail-notification-button i {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid var(--color-bg-raised);
  border-radius: var(--radius-pill);
  background: var(--color-info);
  color: var(--color-text);
  padding: 0 var(--space-1);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  box-shadow: var(--glow-soft);
}
.client-body .studio-shell .avatar-button {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-color: var(--page-line-strong);
}

/* Composer popovers follow the supplied dark control references. Their
   existing state, model data and click handlers remain shared with Create. */
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-menu {
  gap: var(--space-1);
  overflow: hidden;
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--composer-popover-radius);
  background: var(--composer-popover-surface);
  padding: var(--space-2);
  box-shadow: var(--shadow-depth-dialog);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .generation-mode-select .custom-select-menu {
  width: var(--composer-mode-menu-width);
  min-width: var(--composer-mode-menu-width);
  max-width: var(--composer-mode-menu-width);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .reference-mode-select .custom-select-menu {
  width: var(--composer-reference-menu-width);
  min-width: var(--composer-reference-menu-width);
  max-width: var(--composer-reference-menu-width);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option {
  min-height: var(--composer-popover-control-height);
  justify-content: space-between;
  gap: var(--space-3);
  border-radius: var(--radius-lg);
  color: var(--page-text);
  padding: 0 var(--space-4);
  font-size: var(--font-body);
  font-weight: 560;
  transition: background-color var(--motion-standard) ease-out, color var(--motion-standard) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option:hover {
  background: var(--composer-popover-control);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option.active {
  background: var(--composer-popover-control-active);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .generation-mode-select .custom-select-option.active {
  color: var(--color-info);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option-main > i,
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option-check {
  display: inline-flex;
  flex: 0 0 var(--icon-size-base);
  color: currentColor;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option-main .ui-icon,
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option-check .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-option-check.is-empty {
  visibility: hidden;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .reference-mode-select .custom-select-trigger-value {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .reference-mode-select .custom-select-trigger-value > i {
  display: inline-flex;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .reference-mode-select .custom-select-trigger-value .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .generation-spec-panel {
  width: min(var(--composer-spec-panel-width), calc(100% - (var(--space-3) * 2)));
  max-height: min(560px, calc(100vh - (var(--space-6) * 2)));
  gap: calc(var(--space-6) + var(--space-1));
  overflow-y: auto;
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--composer-popover-radius);
  background: var(--composer-popover-surface);
  padding: calc(var(--composer-popover-padding) + var(--space-2));
  box-shadow: var(--shadow-depth-dialog);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-section {
  gap: var(--space-4);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-section > strong {
  color: var(--page-text-subtle);
  font-size: var(--font-heading);
  font-weight: 600;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer :is(.spec-ratio-grid, .spec-resolution-grid, .spec-count-grid) {
  gap: var(--space-1);
  border-radius: var(--radius-xl);
  background: var(--composer-popover-control);
  padding: var(--space-1);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-ratio-grid {
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-option {
  min-height: 64px;
  border-radius: var(--radius-lg);
  color: var(--page-text);
  font-size: var(--font-body);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .ratio-option {
  min-height: 106px;
  gap: var(--space-3);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-option:hover {
  background: rgba(255, 255, 255, .035);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-option.active {
  background: var(--composer-popover-control-active);
  box-shadow: none;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .spec-resolution-grid .spec-option {
  width: 100%;
  max-width: none;
  flex-basis: 100%;
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel {
  width: min(var(--composer-duration-panel-width), calc(100% - (var(--space-3) * 2)));
  grid-template-columns: minmax(0, 1fr) 148px;
  grid-template-rows: auto auto auto;
  column-gap: calc(var(--space-6) + var(--space-1));
  row-gap: var(--space-3);
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--composer-popover-radius);
  background: var(--composer-popover-surface);
  padding: calc(var(--composer-popover-padding) + var(--space-1)) calc(var(--composer-popover-padding) + var(--space-2));
  box-shadow: var(--shadow-depth-dialog);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel header {
  display: contents;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel header strong {
  grid-column: 1;
  grid-row: 1;
  color: var(--page-text-subtle);
  font-size: var(--font-heading);
  font-weight: 600;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel output {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  min-height: var(--composer-popover-control-height);
  align-self: center;
  border-radius: var(--radius-xl);
  background: var(--composer-popover-control-active);
  font-size: 20px;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel .duration-timeline {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel input[type="range"] {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  height: var(--space-5);
  margin: 0;
  accent-color: var(--page-text);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-range-labels {
  grid-column: 1;
  grid-row: 3;
  color: var(--page-text-muted);
  font-size: var(--font-caption);
}
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .duration-picker-panel > small {
  display: none;
}

.client-body:has(.studio-shell.view-inspire) .home-reference-picker-backdrop {
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}
.client-body:has(.studio-shell.view-inspire) .reference-library-modal.home-reference-picker {
  position: fixed;
  width: min(var(--composer-reference-panel-width), calc(100vw - (var(--space-6) * 2)));
  max-height: min(512px, calc(100vh - (var(--space-6) * 2)));
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  border: 1px solid var(--composer-popover-line);
  border-radius: var(--composer-popover-radius);
  background: var(--composer-popover-surface);
  box-shadow: var(--shadow-depth-dialog);
  backdrop-filter: none;
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-popover-header {
  min-height: 64px;
  align-items: center;
  border-bottom: 0;
  padding: 0 var(--composer-popover-padding);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-popover-header h2 {
  margin: 0;
  color: var(--page-text-subtle);
  font-size: var(--font-heading);
  font-weight: 600;
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-popover-header .icon-button {
  width: var(--control-icon-size-small);
  height: var(--control-icon-size-small);
  border: 0;
  background: transparent;
  color: var(--page-text-subtle);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-filters {
  align-items: center;
  gap: var(--space-2);
  border-color: var(--composer-popover-line);
  background: transparent;
  padding: var(--space-2) var(--composer-popover-padding);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-filters > div {
  gap: var(--space-1);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-filters button {
  min-height: var(--control-icon-size-small);
  border-radius: var(--radius-base);
  padding: 0 var(--space-2);
  font-size: var(--font-caption);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-filters button.active {
  border-color: transparent;
  background: var(--composer-popover-control-active);
  color: var(--page-text);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-4) var(--composer-popover-padding);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-item {
  border-color: var(--composer-popover-line);
  border-radius: var(--radius-lg);
  background: var(--composer-popover-control);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-empty {
  min-height: 228px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  color: var(--page-text-subtle);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-empty strong {
  font-size: var(--font-heading);
  font-weight: 600;
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker .reference-library-empty small {
  font-size: var(--font-caption);
}
.client-body:has(.studio-shell.view-inspire) .home-reference-picker > footer {
  min-height: 48px;
  border-color: var(--composer-popover-line);
  padding: 0 var(--composer-popover-padding);
}

/* Model picker follows the supplied compact list reference while retaining
   the existing filters, pricing, health signal and selection behavior. */
.client-body .model-picker-menu {
  width: min(var(--model-picker-width), calc(100vw - (var(--space-3) * 2)));
  height: auto !important;
  max-height: calc(100vh - (var(--space-8) * 2));
  grid-template-rows: auto auto minmax(0, auto);
  overflow: hidden;
  border-color: var(--page-line);
  border-radius: var(--radius-xl);
  background: var(--page-surface-2);
  padding: var(--space-2);
  box-shadow: var(--shadow-depth-dialog);
  backdrop-filter: none;
}
.client-body .model-picker-menu-header {
  min-width: 0;
  min-height: var(--control-height-compact);
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
}
.client-body .model-picker-menu-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--page-text-subtle);
  font-size: var(--font-caption);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-body .model-picker-menu-header strong span { color: var(--page-text-muted); }
.client-body .model-picker-category-tabs {
  min-height: var(--control-icon-size-small);
  gap: var(--space-1);
  border: 0;
  padding: 0 var(--space-1) var(--space-2);
}
.client-body .model-picker-category-tabs button {
  min-height: calc(var(--control-icon-size-small) - var(--space-1));
  border: 0;
  border-radius: var(--radius-base);
  color: var(--page-text-subtle);
  padding: 0 var(--space-2);
  font-size: 11px;
}
.client-body .model-picker-category-tabs button:hover,
.client-body .model-picker-category-tabs button.active {
  border: 0;
  background: var(--page-surface-3);
  color: var(--page-text);
}
.client-body .model-picker-category-tabs button small,
.client-body .model-picker-category-tabs button.active small { color: currentColor; opacity: .62; }
.client-body .model-picker-scroll {
  display: block;
  height: auto !important;
  max-height: var(--model-picker-list-max-height);
  overflow: hidden;
}
.client-body .model-picker-scroll-button { display: none; }
.client-body .model-picker-list {
  width: 100%;
  height: auto !important;
  max-height: var(--model-picker-list-max-height);
  display: grid;
  gap: var(--space-1) !important;
  overflow-y: auto !important;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--page-line-strong) transparent;
}
.client-body .model-picker-option {
  box-sizing: border-box;
  width: 100%;
  height: var(--model-picker-row-height) !important;
  min-height: var(--model-picker-row-height) !important;
  max-height: var(--model-picker-row-height) !important;
  display: grid !important;
  grid-template-columns: var(--model-picker-icon-size) minmax(0, 1fr) var(--icon-size-base) !important;
  align-items: center !important;
  gap: var(--space-3) !important;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--page-text);
  padding: var(--space-2);
  transition: background-color var(--motion-fast) ease-out;
}
.client-body .model-picker-option:hover,
.client-body .model-picker-option.selected {
  border-color: transparent !important;
  background: var(--page-surface-3) !important;
  box-shadow: none !important;
  transform: none !important;
}
.client-body .model-option-glyph {
  width: var(--model-picker-icon-size);
  height: var(--model-picker-icon-size);
  display: grid;
  place-items: center;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-base);
  color: var(--page-text);
}
.client-body .model-picker-option.selected .model-option-glyph { background: rgba(255, 255, 255, .06); }
.client-body .model-option-glyph .ui-icon { width: var(--icon-size-base); height: var(--icon-size-base); }
.client-body .model-picker-option .model-option-copy {
  min-width: 0;
  max-height: none !important;
  display: grid;
  gap: var(--space-1);
  overflow: hidden;
  padding: 0;
}
.client-body .model-option-title { min-width: 0; gap: var(--space-2); }
.client-body .model-option-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--page-text);
  font-size: var(--font-body);
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-body .model-option-title .model-success-rate {
  flex: 0 0 auto;
  gap: var(--space-1);
  font-size: 10px;
}
.client-body .model-option-title .model-success-rate i { width: 6px; height: 6px; }
.client-body .model-option-copy small {
  min-width: 0;
  display: flex;
  gap: var(--space-2);
  overflow: hidden;
  color: var(--page-text-subtle);
  font-size: var(--font-caption);
  line-height: 1.25;
  white-space: nowrap;
}
.client-body .model-option-copy small > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-body .model-option-description { flex: 1 1 auto; }
.client-body .model-option-meta { flex: 0 0 auto; color: var(--page-text-muted); }
.client-body .model-picker-option > b {
  width: var(--icon-size-base);
  display: grid;
  place-items: center;
  align-self: center;
  color: var(--page-text);
}
.client-body .model-picker-option > b.is-empty { visibility: hidden; }
.client-body .model-picker-option > b .ui-icon { width: var(--icon-size-base); height: var(--icon-size-base); }

@media (max-width: 820px) and (min-width: 601px) {
  .client-body .studio-shell.view-inspire {
    grid-template-columns: var(--home-rail-width) minmax(0, 1fr);
  }
}

/* Final reference calibration for the logged-in inspiration home. The
   reference uses a neutral charcoal scale rather than the blue-grey surfaces
   used by the other client views; keep the calibration scoped to this page. */
.client-body:has(.studio-shell.view-inspire) {
  --home-surface-page: #121212;
  --home-surface-card: #1e1e1e;
  --home-surface-feature: #1a1a1a;
  --home-surface-control: #1e1e1e;
  --home-line-soft: rgba(255, 255, 255, .07);
  --home-line: #303030;
  --home-line-strong: rgba(91, 157, 246, .46);
  --home-text: #f6f6f6;
  --home-text-muted: #a0a0a0;
  --home-text-subtle: #707070;
  --home-brand: #5a9df6;
  --home-announcement-bg: linear-gradient(90deg, #f4dda5 0%, #79baf2 11%, #5a9df6 23%, #5a9df6 100%);
  --page-surface-0: var(--home-surface-page);
  --page-surface-1: var(--home-surface-card);
  --page-surface-2: #262626;
  --page-line-soft: var(--home-line-soft);
  --page-line: var(--home-line);
  --page-line-strong: var(--home-line-strong);
  --page-text: var(--home-text);
  --page-text-muted: var(--home-text-muted);
  --page-text-subtle: var(--home-text-subtle);
  --page-control-bg: var(--home-surface-control);
  --page-control-hover: #262626;
  --color-brand: var(--home-brand);
  --brand-surface-soft: rgba(255, 255, 255, .07);
  --brand-border: var(--home-line-strong);
  --home-card-title-size: 16px;
  --home-card-subtitle-size: 12px;
  --home-control-size: 14px;
}

body:has(.studio-shell.view-inspire) .platform-announcement-bar {
  background: var(--home-announcement-bg);
}

/* The generation rail is the canonical shell. Do not let the inspiration
   promotion strip move or recolor the shared left navigation. */
.client-body:has(.studio-shell.view-inspire) .platform-announcement-bar {
  display: none;
}
.client-body .studio-shell.view-inspire > .tool-rail {
  width: var(--client-rail-width);
  min-width: var(--client-rail-width);
  height: 100vh;
  max-height: 100vh;
  padding: var(--space-5) var(--space-2) var(--space-4);
  border-right-color: var(--client-sidebar-line);
  background: var(--client-rail-bg);
}

.client-body .studio-shell.view-inspire,
.client-body .studio-shell.view-inspire .workspace,
.client-body:has(.studio-shell.view-inspire) .inspiration-home-stage,
.client-body:has(.studio-shell.view-inspire) .tool-rail {
  background: var(--home-surface-page);
}

.client-body .studio-shell.view-inspire .tool-rail {
  border-right-color: var(--home-line-soft);
}

.client-body .studio-shell.view-inspire .rail-button {
  color: var(--home-text-subtle);
}

.client-body .studio-shell.view-inspire .rail-button:hover,
.client-body .studio-shell.view-inspire .rail-button.active {
  background: transparent;
  color: var(--home-text);
}

.client-body .studio-shell.view-inspire .rail-button.active::before {
  display: none;
}

.client-body .studio-shell.view-inspire .rail-button:hover {
  background: rgba(255, 255, 255, .045);
}

.client-body .studio-shell.view-inspire .logo-gem {
  font-size: 42px;
}

.client-body:has(.studio-shell.view-inspire) .inspiration-home-generation {
  border-color: var(--home-line);
  background: var(--home-surface-card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .prompt-rich-editor {
  color: var(--home-text);
  /* 13px keeps the supplied reference copy on one line at the reference
     desktop width while preserving normal wrapping for user-entered text. */
  font-size: 13px;
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .prompt-rich-editor:empty::before {
  color: var(--home-placeholder);
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > :is(.generation-mode-select, .reference-mode-select, .generation-spec-chip, .duration-picker-trigger, .generation-template-placeholder, .model-picker-trigger, .home-mention-button),
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .custom-select-trigger {
  font-size: var(--home-control-size);
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-options > :is(.generation-mode-select, .reference-mode-select, .generation-spec-chip, .duration-picker-trigger, .model-picker-trigger),
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .generation-template-placeholder,
.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .home-mention-button {
  border-color: var(--home-line);
  background: var(--home-surface-control);
}

.client-body:has(.studio-shell.view-inspire) .home-prompt-composer .composer-price {
  color: var(--home-text-muted);
  font-size: 12px;
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card {
  gap: var(--space-3);
  border-color: var(--home-line);
  background: var(--home-surface-feature);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid {
  gap: var(--space-2);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card:hover {
  border-color: var(--home-line-strong);
  background: var(--page-surface-2);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card > span {
  width: 36px;
  height: 36px;
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card > div {
  transform: translateY(3px);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card strong {
  font-size: var(--home-card-title-size);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card p {
  color: var(--home-text-muted);
  font-size: var(--home-card-subtitle-size);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav,
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section .inspiration-filter-bar {
  border-color: var(--home-line);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav nav button.active {
  background: var(--page-surface-2);
}

.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav > label {
  border-color: var(--home-line);
  background: var(--home-surface-control);
}

/* Fine alignment pass against the supplied inspiration-home reference.
   Keep the shared markup and state handling intact; these are geometry-only
   adjustments for the logged-in home surface. */
.client-body:has(.studio-shell.view-inspire) {
  --home-content-max: 1082px;
  --home-line: #1f1f20;
  /* The reference heading has a slightly tighter Chinese glyph box than the
     shared 22px heading token; keep the line box stable while matching its
     rendered width and vertical optical center. */
  --home-heading-size: 21.5px;
  --home-radius-card: 22px;
  --home-radius-feature: 20px;
  --home-logo-gradient: linear-gradient(145deg, #f3d477 0%, #e8f5f4 24%, #65d9dc 51%, #5b84ff 78%);
  --home-placeholder: rgba(112, 112, 112, .83);
}

/* The reference rail occupies a 72px visual rhythm while the 60px grid track
   keeps the main content anchored to its measured x-coordinate. */
.client-body .studio-shell.view-inspire .tool-rail {
  width: 72px;
  box-sizing: border-box;
  border-right-color: transparent;
}
.client-body .studio-shell.view-inspire .rail-logo .brand-logo,
.client-body .studio-shell.view-inspire .rail-logo .logo-gem {
  transform: translateY(-16px) rotate(16deg);
}
.client-body .studio-shell.view-inspire .rail-logo .brand-logo {
  transform: translateY(-16px);
}
.client-body .studio-shell.view-inspire .rail-logo .logo-gem {
  /* Preserve the fallback mark when no admin logo is configured, but give it
     the same compact multitone silhouette as the supplied reference mark. */
  font-size: 52px;
  line-height: 1;
  color: transparent;
  background: var(--home-logo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  transform: translateY(-10px) rotate(16deg);
}
.client-body .studio-shell.view-inspire .rail-button.active {
  box-shadow: none;
}

.client-body:has(.studio-shell.view-inspire) .inspiration-home-heading h1 {
  /* Optical baseline correction only; the heading section height and card
     coordinates remain unchanged. */
  transform: translateY(1.5px);
}

.client-body:has(.studio-shell.view-inspire) :is(.inspiration-home-heading, .inspiration-home-generation, .inspiration-home-features) {
  position: relative;
  left: -4px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-heading {
  padding-bottom: 39.25px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-home-generation {
  border-radius: var(--home-radius-card);
  width: min(calc(var(--home-content-max) * 5 / 6), 100%);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-feature-grid .home-feature-card {
  border-color: transparent;
  border-radius: var(--home-radius-feature);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section {
  position: relative;
  left: -4px;
  width: calc(100% + 4px);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav > label {
  transform: translateX(4px);
}

/* Keep the existing media and sort controls available in a compact menu,
   without adding the second discovery row that is absent from the reference. */
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu {
  position: relative;
  flex: 0 0 auto;
  margin-left: -8px;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu > summary {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-base);
  color: var(--home-text-subtle);
  cursor: pointer;
  list-style: none;
  transition: background-color var(--page-transition) ease-out, color var(--page-transition) ease-out;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu > summary::-webkit-details-marker {
  display: none;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu > summary:hover,
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu[open] > summary {
  background: var(--page-surface-2);
  color: var(--home-text);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu > summary .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu .inspiration-filter-bar {
  position: absolute;
  z-index: 30;
  top: calc(100% + var(--space-2));
  left: 0;
  min-height: 40px;
  gap: 0;
  margin: 0;
  border: 1px solid var(--home-line);
  border-radius: var(--radius-base);
  background: var(--home-surface-card);
  padding: 4px;
  box-shadow: var(--shadow-lg);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu .inspiration-filter-bar > div {
  min-height: 32px;
  align-items: center;
  align-self: center;
  gap: 2px;
  border: 0;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu .inspiration-filter-bar button {
  min-width: 0;
  height: 28px;
  border: 0;
  border-radius: calc(var(--radius-base) - 2px);
  color: var(--home-text-subtle);
  padding: 0 8px;
  font-size: 12px;
  line-height: 28px;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu .inspiration-filter-bar button:hover,
.client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu .inspiration-filter-bar button.active {
  border: 0;
  background: var(--page-surface-2);
  color: var(--home-text);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 2px;
  margin-top: var(--space-2);
}
.client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid .inspiration-card[data-inspiration-shape="landscape"] {
  grid-column: span 2;
}

@media (max-width: 1100px) and (min-width: 601px) {
  .client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav {
    gap: var(--space-2);
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav nav {
    gap: var(--space-3);
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-discovery-nav > label {
    width: clamp(120px, 20vw, 220px);
    margin-left: 0;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-filter-menu {
    margin-left: -4px;
  }
  .client-body:has(.studio-shell.view-inspire) .inspiration-discovery-section > .inspiration-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Shared product rail. Existing destinations stay unchanged; this only
   aligns navigation, membership balance and notifications with the reference. */
.client-body .studio-shell:not(.view-inspire):not(.view-canvas):not(.canvas-editor-active) {
  grid-template-columns: var(--client-rail-width) var(--client-conversation-width) minmax(0, 1fr);
}
.client-body .studio-shell.view-inspire,
.client-body .studio-shell.sidebar-collapsed,
.client-body .studio-shell.view-canvas {
  grid-template-columns: var(--client-rail-width) 0 minmax(0, 1fr);
}
.client-body .studio-shell .tool-rail {
  width: var(--client-rail-width);
  min-width: var(--client-rail-width);
  box-sizing: border-box;
  padding: var(--space-5) var(--space-2) var(--space-4);
  border-right: 1px solid var(--client-sidebar-line);
  background: var(--client-rail-bg);
}
.client-body .studio-shell .rail-logo {
  width: 100%;
  height: 104px;
  display: grid;
  place-items: start center;
  padding-top: var(--space-2);
}
.client-body .studio-shell .rail-logo .brand-logo {
  width: var(--client-rail-logo-size);
  height: var(--client-rail-logo-size);
  border-radius: var(--radius-base);
  transform: none;
  filter: none;
}
.client-body .studio-shell .rail-logo .logo-gem,
.client-body .studio-shell.view-inspire .rail-logo .logo-gem {
  width: var(--client-rail-logo-size);
  height: var(--client-rail-logo-size);
  display: grid;
  place-items: center;
  font-size: var(--font-title);
  line-height: 1;
  transform: rotate(16deg);
}
.client-body .studio-shell .tool-rail nav {
  gap: var(--space-1);
  overflow-x: hidden;
}
.client-body .studio-shell .rail-nav-group,
.client-body .studio-shell.view-inspire .rail-nav-group {
  gap: var(--space-1);
}
.client-body .studio-shell .rail-nav-group + .rail-nav-group,
.client-body .studio-shell.view-inspire .rail-nav-group + .rail-nav-group {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 0;
}
.client-body .studio-shell .rail-button,
.client-body .studio-shell.view-inspire .rail-button {
  min-height: var(--client-rail-nav-height);
  gap: var(--space-1);
  border-radius: var(--radius-base);
  color: var(--client-sidebar-text);
}
.client-body .studio-shell .rail-button > .ui-icon,
.client-body .studio-shell.view-inspire .rail-button > .ui-icon {
  width: var(--client-rail-nav-icon-size);
  height: var(--client-rail-nav-icon-size);
}
.client-body .studio-shell .rail-button > span:last-child,
.client-body .studio-shell.view-inspire .rail-button > span:last-child {
  font-size: var(--font-caption);
  font-weight: 500;
}
.client-body .studio-shell .rail-button:hover,
.client-body .studio-shell .rail-button.active,
.client-body .studio-shell.view-inspire .rail-button:hover,
.client-body .studio-shell.view-inspire .rail-button.active {
  background: transparent;
  color: #fff;
  box-shadow: none;
}
.client-body .studio-shell .rail-button.active::before,
.client-body .studio-shell.view-inspire .rail-button.active::before {
  display: none;
}
.client-body .studio-shell .rail-bottom {
  gap: 14px;
}
.client-body .rail-membership-card {
  width: var(--client-membership-width);
  display: grid;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-text);
  cursor: pointer;
}
.client-body .rail-member-discount {
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--brand-surface-hover);
  color: var(--color-info);
  font-size: var(--font-caption);
  font-weight: 600;
}
.client-body .rail-credit-panel {
  min-height: 45px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-1);
  margin-top: -1px;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-sm);
}
.client-body .rail-credit-panel strong {
  max-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-body .rail-credit-panel strong .ui-icon {
  width: 12px;
  height: 12px;
}
.client-body .rail-credit-panel small {
  color: var(--color-text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.client-body .rail-membership-card:hover .rail-member-discount {
  background: var(--brand-surface-strong);
}
.client-body .rail-membership-card:hover .rail-credit-panel {
  border-color: var(--brand-border-soft);
}
.client-body .rail-notification-button {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--color-text-muted);
  padding: 0;
  cursor: pointer;
}
.client-body .rail-notification-button:hover {
  background: var(--brand-surface-soft);
  color: var(--color-text);
}
.client-body .rail-notification-button .ui-icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
.client-body .rail-notification-button i {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 2px solid var(--client-rail-bg);
  border-radius: var(--radius-pill);
  background: var(--color-info);
  color: var(--color-text);
  padding: 0 var(--space-1);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  box-shadow: var(--glow-soft);
}
.client-body .studio-shell .avatar-button {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-color: var(--page-line-strong);
}

/* Generation-page conversation rail, calibrated to the supplied reference.
   The existing conversation markup and event handlers remain unchanged. */
body.client-body .studio-shell.view-create:not(.view-inspire):not(.view-canvas) {
  /* Let the conversation track consume only the space the viewport can spare. */
  grid-template-columns: var(--client-rail-width) minmax(0, min(var(--client-create-conversation-width), calc(100vw - var(--client-rail-width) - 24px))) minmax(0, 1fr);
}
body.client-body .studio-shell.view-create.sidebar-collapsed:not(.view-inspire):not(.view-canvas) {
  grid-template-columns: var(--client-rail-width) 0 minmax(0, 1fr);
}
.client-body:has(.studio-shell.view-create) .conversation-sidebar {
  padding: 0 var(--space-4) var(--space-3);
  border-right: 1px solid var(--client-sidebar-line);
  background: var(--client-conversation-bg);
  box-shadow: none;
  backdrop-filter: none;
}
.client-body:has(.studio-shell.view-create) .conversation-sidebar header {
  height: var(--client-conversation-header-height);
  padding: 0;
  border-bottom: 0;
}
.client-body:has(.studio-shell.view-create) .conversation-sidebar header > div {
  color: var(--client-sidebar-text);
  font-size: var(--client-conversation-title-size);
  font-weight: 500;
  letter-spacing: 0;
}
.client-body:has(.studio-shell.view-create) .conversation-sidebar header .icon-button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--client-sidebar-text);
}
.client-body:has(.studio-shell.view-create) .conversation-sidebar header .icon-button:hover {
  background: var(--client-sidebar-hover);
  color: var(--client-sidebar-active-text);
}
.client-body:has(.studio-shell.view-create) .new-chat {
  height: var(--client-conversation-row-height);
  margin-top: 0;
  gap: var(--space-3);
  border-radius: var(--radius-base);
  background: transparent;
  padding: 0;
  color: var(--client-sidebar-text);
  font-size: var(--client-conversation-text-size);
  font-weight: 500;
}
.client-body:has(.studio-shell.view-create) .new-chat:hover {
  background: transparent;
}
.client-body:has(.studio-shell.view-create) .new-chat-icon {
  width: var(--client-conversation-thumb-size);
  height: var(--client-conversation-thumb-size);
  border: 0;
  border-radius: var(--radius-base);
  background: var(--client-sidebar-active);
  color: var(--client-sidebar-text);
}
.client-body:has(.studio-shell.view-create) .default-chat {
  min-height: var(--client-conversation-row-height);
  margin-top: 0;
  gap: var(--client-conversation-item-gap);
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  padding: 0;
  color: var(--client-sidebar-text);
  font-size: var(--client-conversation-text-size);
  font-weight: 500;
}
.client-body:has(.studio-shell.view-create) .default-chat:hover,
.client-body:has(.studio-shell.view-create) .default-chat.active {
  border-color: transparent;
  background: var(--client-sidebar-hover);
}
.client-body:has(.studio-shell.view-create) .conversation-label {
  padding: var(--client-conversation-label-top) 2px var(--space-2);
  color: var(--client-sidebar-subtle);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.client-body:has(.studio-shell.view-create) .conversation-list {
  gap: 0;
  padding: 0;
  scrollbar-color: var(--client-sidebar-scrollbar) transparent;
  scrollbar-width: thin;
}
.client-body:has(.studio-shell.view-create) .conversation-list::-webkit-scrollbar {
  width: 3px;
}
.client-body:has(.studio-shell.view-create) .conversation-list::-webkit-scrollbar-thumb {
  border-radius: var(--radius-pill);
  background: var(--client-sidebar-scrollbar);
}
.client-body:has(.studio-shell.view-create) .conversation-item {
  min-height: var(--client-conversation-row-height);
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: var(--space-1);
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  padding: 0;
  color: var(--client-sidebar-text);
  cursor: default;
}
.client-body:has(.studio-shell.view-create) .conversation-item:hover,
.client-body:has(.studio-shell.view-create) .conversation-item.active {
  border-color: transparent;
  background: var(--client-sidebar-active);
  color: var(--client-sidebar-active-text);
}
.client-body:has(.studio-shell.view-create) .conversation-item.active::before {
  display: none;
}
.client-body:has(.studio-shell.view-create) .conversation-item-main {
  width: 100%;
  min-width: 0;
  min-height: var(--client-conversation-row-height);
  display: grid;
  grid-template-columns: var(--client-conversation-thumb-size) minmax(0, 1fr);
  align-items: center;
  gap: var(--client-conversation-item-gap);
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.client-body:has(.studio-shell.view-create) .conversation-action-trigger {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--client-sidebar-text);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity var(--motion-standard) ease-out, visibility var(--motion-standard), background-color var(--motion-standard) ease-out, color var(--motion-standard) ease-out;
}
.client-body:has(.studio-shell.view-create) .conversation-item:hover .conversation-action-trigger,
.client-body:has(.studio-shell.view-create) .conversation-item:focus-within .conversation-action-trigger,
.client-body:has(.studio-shell.view-create) .conversation-action-trigger[aria-expanded="true"] {
  opacity: 1;
  visibility: visible;
}
.client-body:has(.studio-shell.view-create) .conversation-action-trigger:hover,
.client-body:has(.studio-shell.view-create) .conversation-action-trigger:focus-visible,
.client-body:has(.studio-shell.view-create) .conversation-action-trigger[aria-expanded="true"] {
  outline: 0;
  background: var(--client-sidebar-hover);
  color: var(--client-sidebar-active-text);
}
.client-body:has(.studio-shell.view-create) .conversation-action-trigger .ui-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
}
.client-body:has(.studio-shell.view-create) .conversation-copy {
  gap: 0;
}
.client-body:has(.studio-shell.view-create) .conversation-copy strong {
  color: currentColor;
  font-size: var(--client-conversation-text-size);
  font-weight: 500;
}
.client-body:has(.studio-shell.view-create) .conversation-thumb {
  width: var(--client-conversation-thumb-size);
  height: var(--client-conversation-thumb-size);
  border-radius: var(--radius-base);
}

.conversation-action-menu {
  position: fixed;
  z-index: 2200;
  width: 196px;
  display: grid;
  gap: var(--space-1);
  border: 1px solid var(--page-line-strong);
  border-radius: var(--radius-xl);
  background: var(--page-surface-3);
  padding: var(--space-2);
  opacity: 0;
  transform: translateY(calc(var(--space-1) * -1));
  box-shadow: var(--shadow-depth-dialog);
  transition: opacity var(--motion-standard) ease-out, transform var(--motion-standard) ease-out;
}
.conversation-action-menu.open {
  opacity: 1;
  transform: none;
}
.conversation-action-menu button {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--page-text);
  padding: 0 var(--space-3);
  font-size: var(--font-body);
  text-align: left;
  cursor: pointer;
}
.conversation-action-menu button:hover,
.conversation-action-menu button:focus-visible {
  outline: 0;
  background: var(--page-surface-2);
}
.conversation-action-menu button .ui-icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
.conversation-action-menu button[data-conversation-action="delete"]:hover,
.conversation-action-menu button[data-conversation-action="delete"]:focus-visible {
  color: var(--color-danger);
  background: var(--state-danger-surface);
}
.conversation-dialog-backdrop {
  z-index: 2300;
}
.conversation-dialog {
  width: min(440px, calc(100vw - (var(--space-6) * 2)));
  display: grid;
  gap: var(--space-5);
  border: 1px solid var(--page-line-strong);
  border-radius: var(--radius-xl);
  background: var(--page-surface-2);
  padding: var(--space-6);
  box-shadow: var(--shadow-depth-dialog);
}
.conversation-dialog header,
.conversation-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.conversation-dialog header small {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--page-text-muted);
  font-size: var(--font-caption);
}
.conversation-dialog h2 {
  margin: 0;
  color: var(--page-text);
  font-size: var(--font-title);
  font-weight: 600;
  line-height: 1.35;
}
.conversation-dialog > label {
  display: grid;
  gap: var(--space-2);
  color: var(--page-text-subtle);
  font-size: var(--font-caption);
}
.conversation-dialog input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--page-line-strong);
  border-radius: var(--radius-base);
  outline: 0;
  background: var(--page-surface-0);
  color: var(--page-text);
  padding: 0 var(--space-3);
}
.conversation-dialog input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--brand-surface-soft);
}
.conversation-dialog > p {
  margin: 0;
  color: var(--page-text-subtle);
  font-size: var(--font-body);
  line-height: 1.65;
}
.conversation-dialog footer {
  justify-content: flex-end;
}
.conversation-dialog footer button {
  min-width: 84px;
  min-height: 38px;
}
.conversation-delete-confirm {
  border: 0;
  border-radius: var(--radius-base);
  background: var(--state-danger-surface);
  color: var(--color-danger);
  padding: 0 var(--space-4);
  font-weight: 600;
  cursor: pointer;
}
.conversation-delete-confirm:hover {
  filter: brightness(1.12);
}

/* Page-specific legacy rules use :has() and otherwise outrank the shared
   rail. Keep this final compatibility layer scoped away from the canvas editor. */
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail {
  width: var(--client-rail-width);
  min-width: var(--client-rail-width);
  height: 100vh;
  min-height: 0;
  max-height: 100vh;
  align-self: start;
  overflow: hidden;
  padding: var(--space-5) var(--space-2) var(--space-4);
  border-right-color: var(--client-sidebar-line);
  background: var(--client-rail-bg);
  box-shadow: none;
  backdrop-filter: none;
}
body.client-body .platform-announcement-bar + .studio-shell:not(.canvas-editor-active) > .tool-rail {
  height: calc(100vh - var(--client-announcement-height));
  max-height: calc(100vh - var(--client-announcement-height));
}
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-bottom {
  flex: 0 0 auto;
}
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-logo .brand-logo {
  width: var(--client-rail-logo-size);
  height: var(--client-rail-logo-size);
  transform: none;
}
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-logo .logo-gem {
  width: var(--client-rail-logo-size);
  height: var(--client-rail-logo-size);
  color: var(--color-brand);
  background: none;
  font-size: var(--font-title);
  -webkit-background-clip: border-box;
  background-clip: border-box;
  transform: rotate(16deg);
}
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-button,
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-button:hover,
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-button.active {
  background: transparent;
  color: var(--client-sidebar-text);
  box-shadow: none;
}
body.client-body:has(.studio-shell) .studio-shell:not(.canvas-editor-active) > .tool-rail .rail-button.active::before {
  display: none;
}
body.client-body .studio-shell.view-create.sidebar-collapsed > .conversation-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden;
  border: 0;
  padding: 0 !important;
  pointer-events: none;
  transition: none !important;
}

.client-body .sidebar-reopen-button {
  position: absolute;
  z-index: 26;
  top: var(--space-4);
  left: var(--space-4);
  min-height: var(--control-height-compact);
  display: none;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--client-sidebar-line);
  border-radius: var(--radius-base);
  background: var(--client-panel);
  background: color-mix(in srgb, var(--client-panel) 92%, transparent);
  color: var(--client-sidebar-text);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--font-caption);
  cursor: pointer;
  box-shadow: var(--shadow-depth-card);
  backdrop-filter: blur(var(--glass-blur-medium));
}

.client-body .sidebar-reopen-button:hover {
  border-color: var(--client-line-strong);
  background: var(--client-sidebar-hover);
  color: var(--client-sidebar-active-text);
}

.client-body .sidebar-reopen-button .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

@media (min-width: 821px) {
  .client-body .studio-shell.view-create.sidebar-collapsed .sidebar-reopen-button {
    display: inline-flex;
  }
}

.admin-body .frontend-style-form {
  max-width: 1180px;
  padding: var(--space-6);
}
.admin-body .frontend-style-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--admin-border);
}
.admin-body .frontend-style-header h2,
.admin-body .frontend-style-header p { margin: 0; }
.admin-body .frontend-style-header p {
  margin-top: var(--space-1);
  color: var(--admin-text-muted);
  font-size: var(--font-caption);
}
.admin-body .frontend-style-form .site-media-preview#logoPreview,
.admin-body .frontend-style-form .site-media-preview#contactQrPreview { width: 180px; }
.admin-body .frontend-style-form .admin-hero-preview {
  min-height: 220px;
  max-height: 340px;
  margin-bottom: var(--space-3);
}
.admin-body .frontend-style-form .admin-hero-preview img,
.admin-body .frontend-style-form .admin-hero-preview video {
  width: 100%;
  max-height: 340px;
  display: block;
  object-fit: cover;
}

@media (max-width: 600px) {
  .client-body .studio-shell,
  .client-body .studio-shell.view-inspire,
  .client-body .studio-shell.view-canvas,
  .client-body .studio-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Shared generation-task layout: one open task surface, one media group and
   one action row per batch. Media keeps the ratio returned by each task. */
.client-body:has(.studio-shell.view-create) .generation-feed {
  /* Keep the task history on the same horizontal track as the fixed composer.
     The former, wider feed made result media start left of the prompt input. */
  width: min(var(--generation-composer-max-width), var(--generation-composer-responsive-width));
  max-width: 100%;
  /* The scroll container reserves one scrollbar gutter. Offset the centered
     feed by the matching grid token so result media and the composer share
     the same left edge. */
  position: relative;
  left: var(--space-2);
  gap: var(--generation-task-gap);
}
.client-body:has(.studio-shell.view-create) .creative-stage {
  padding-inline: var(--space-6);
}
.client-body:has(.studio-shell.view-create) .generation-item,
.client-body:has(.studio-shell.view-create) .generation-item:hover {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding: 0 0 var(--space-2);
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 48%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
}
.client-body:has(.studio-shell.view-create) .generation-item:last-child { border-bottom: 0; }
.client-body:has(.studio-shell.view-create) .generation-meta {
  min-height: var(--generation-reference-size);
  grid-template-columns: var(--task-reference-stack-width, var(--generation-reference-width)) minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}
.client-body:has(.studio-shell.view-create) .generation-meta.no-references {
  min-height: 32px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.client-body:has(.studio-shell.view-create) .task-reference-stack {
  position: relative;
  width: var(--task-reference-stack-width, var(--generation-reference-width));
  min-width: var(--task-reference-stack-width, var(--generation-reference-width));
  margin-right: 14px;
  display: flex;
  align-items: flex-start;
  padding: 0 0 0 var(--space-2);
}
.client-body:has(.studio-shell.view-create) .task-reference-thumb {
  position: relative;
  width: 28px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-left: -6px;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-surface-strong);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}
.client-body:has(.studio-shell.view-create) .task-reference-thumb:first-child { margin-left: 0; }
.client-body:has(.studio-shell.view-create) .task-reference-thumb:nth-child(even) { transform: rotate(3deg); }
.client-body:has(.studio-shell.view-create) .task-reference-thumb img,
.client-body:has(.studio-shell.view-create) .task-reference-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.client-body:has(.studio-shell.view-create) .task-reference-thumb i {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--color-text);
  font-style: normal;
}
.client-body:has(.studio-shell.view-create) .task-reference-stack > b {
  position: relative;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: var(--generation-reference-overlap);
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  background: var(--color-surface-strong);
  color: var(--color-text-muted);
  font-size: 10px;
}
.client-body:has(.studio-shell.view-create) .task-reference-badge {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: calc(var(--space-1) * -1);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface-strong);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
}
.client-body:has(.studio-shell.view-create) .task-reference-badge .ui-icon {
  width: 14px;
  height: 14px;
}
.client-body:has(.studio-shell.view-create) .task-generation-copy { min-width: 0; }
.client-body:has(.studio-shell.view-create) .generation-primary-actions { margin-left: 62px; }
.client-body:has(.studio-shell.view-create) .task-prompt-line {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}
.client-body:has(.studio-shell.view-create) .task-prompt-summary {
  min-width: 120px;
  max-width: 100%;
  flex: 0 1 auto;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: default;
  overflow: visible;
}
.client-body:has(.studio-shell.view-create) .task-prompt-clamped {
  height: auto;
  min-height: 28px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--generation-prompt-font-size);
  font-weight: 500;
  line-height: 1.65;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  mask-image: none;
}
.client-body:has(.studio-shell.view-create) .task-inline-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-subtle);
  font-size: var(--generation-detail-font-size);
  line-height: 28px;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-create) .task-meta-separator {
  color: var(--color-text-subtle);
  font-style: normal;
  opacity: .72;
}
.client-body:has(.studio-shell.view-create) .task-detail-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  outline: 0;
}
.client-body:has(.studio-shell.view-create) .task-detail-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  cursor: help;
}
.client-body:has(.studio-shell.view-create) .task-detail-label .ui-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.client-body:has(.studio-shell.view-create) .task-detail-popover {
  position: absolute;
  z-index: 160;
  top: calc(100% + var(--space-1));
  left: 0;
  right: auto;
  width: min(var(--generation-detail-width), calc(100vw - var(--space-8)));
  /* A transparent absolute popover still expands its ancestor's scroll
     width. Keep it out of layout until its trigger is active. */
  display: none;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-strong);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.client-body:has(.studio-shell.view-create) .task-detail-wrap:hover .task-detail-popover,
.client-body:has(.studio-shell.view-create) .task-detail-wrap:focus .task-detail-popover,
.client-body:has(.studio-shell.view-create) .task-detail-wrap:focus-within .task-detail-popover {
  display: grid;
  pointer-events: auto;
}
.client-body:has(.studio-shell.view-create) .task-prompt-line:has(.task-detail-wrap:hover),
.client-body:has(.studio-shell.view-create) .task-prompt-line:has(.task-detail-wrap:focus),
.client-body:has(.studio-shell.view-create) .task-prompt-line:has(.task-detail-wrap:focus-within) {
  z-index: 170;
}
.client-body:has(.studio-shell.view-create) .task-detail-row {
  min-height: var(--generation-detail-row-height);
  display: grid;
  grid-template-columns: var(--generation-detail-label-width) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--generation-detail-font-size);
}
.client-body:has(.studio-shell.view-create) .task-detail-row > span {
  justify-self: start;
  text-align: left;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-create) .task-detail-row strong {
  justify-self: end;
  color: var(--color-text);
  font-size: var(--generation-detail-font-size);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.client-body:has(.studio-shell.view-create) .task-prompt-full {
  z-index: 150;
  top: calc(var(--space-2) * -1);
  left: calc(var(--space-3) * -1);
  width: min(var(--generation-prompt-preview-width), calc(100vw - 400px));
  max-height: min(var(--generation-prompt-preview-max-height), calc(100vh - 160px));
  flex-wrap: nowrap;
  align-items: initial;
  gap: 0;
  border-color: var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-strong);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  font-size: var(--generation-prompt-font-size);
  font-weight: 500;
  line-height: 1.8;
  white-space: normal;
  box-shadow: var(--shadow-lg);
}
.client-body:has(.studio-shell.view-create) .task-prompt-summary:hover .task-prompt-full,
.client-body:has(.studio-shell.view-create) .task-prompt-summary:focus-within .task-prompt-full,
.client-body:has(.studio-shell.view-create) .task-prompt-summary:focus .task-prompt-full {
  display: block;
}
.client-body:has(.studio-shell.view-create) .task-prompt-preview-trigger {
  min-width: 0;
  max-width: 100%;
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.client-body:has(.studio-shell.view-create) .task-prompt-preview-trigger:focus-visible {
  border-radius: var(--radius-sm);
  outline: 1px solid var(--brand-border);
  outline-offset: var(--space-1);
}
.client-body:has(.studio-shell.view-create) .task-prompt-full-text { display: block; }
.client-body:has(.studio-shell.view-create) .task-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.client-body:has(.studio-shell.view-create) .task-prompt-action {
  min-height: var(--control-height-compact);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--font-caption);
  cursor: pointer;
  transition: background var(--motion-standard) ease-out, border-color var(--motion-standard) ease-out, color var(--motion-standard) ease-out;
}
.client-body:has(.studio-shell.view-create) .task-prompt-action .ui-icon { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.client-body:has(.studio-shell.view-create) .task-prompt-action:hover { border-color: var(--brand-border); background: var(--brand-surface); color: var(--color-text); }
.client-body:has(.studio-shell.view-create) .task-prompt-action.primary { border-color: var(--brand-border); color: var(--color-brand); }
.client-body:has(.studio-shell.view-create) .attach-button.is-uploading { cursor: wait; opacity: .66; }
.client-body:has(.studio-shell.view-create) .task-created-at,
.client-body:has(.studio-shell.view-create) .task-status.completed { display: none; }
.client-body:has(.studio-shell.view-create) .generation-results {
  width: 100%;
  display: grid;
  gap: var(--generation-result-gap);
  margin-left: 0;
  align-items: start;
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-result-card {
  width: min(var(--result-fit-width, var(--generation-single-result-max-width)), var(--generation-single-result-max-width));
  max-width: calc((100% - ((var(--result-count) - 1) * var(--generation-result-gap))) / var(--result-count));
  flex: 0 1 auto;
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-output.image {
  aspect-ratio: var(--result-ratio, 16 / 9) !important;
  min-height: 0;
  overflow: hidden !important;
  background: var(--color-surface);
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-output.image .media-preview-trigger {
  height: 100% !important;
  display: block;
  overflow: hidden;
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-output.image img {
  width: 100%;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
}
/* 结果预览按图片真实宽高缩放；请求比例只用于加载占位，不能反过来裁切成品。 */
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-output.image:not(.pending):not(.loading) {
  aspect-ratio: auto !important;
  min-height: 0;
  overflow: visible !important;
  background: transparent;
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-output.image:not(.pending):not(.loading) .media-preview-trigger {
  height: auto !important;
  overflow: visible;
}
.client-body:has(.studio-shell.view-create) .image-task .generation-results:not(.count-1) .generation-output.image:not(.pending):not(.loading) img {
  width: 100%;
  height: auto !important;
  max-height: 620px !important;
  object-fit: contain;
}
.client-body:has(.studio-shell.view-create) .generation-results.count-1 .generation-result-card {
  width: min(100%, var(--result-fit-width, var(--generation-single-result-max-width)), var(--generation-single-result-max-width));
  max-width: none;
  margin-inline: 0;
}
.client-body:has(.studio-shell.view-create) .video-task .generation-results {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
}
.client-body:has(.studio-shell.view-create) .video-task .generation-results.count-1 { display: block; }
.client-body:has(.studio-shell.view-create) .video-task .generation-result-card {
  width: min(100%, var(--result-fit-width, 100%));
  max-height: var(--generation-video-max-height);
}
.client-body:has(.studio-shell.view-create) .video-task .generation-results.count-1 .generation-result-card {
  width: min(100%, var(--result-fit-width, 100%), var(--generation-single-result-max-width));
}
.client-body:has(.studio-shell.view-create) .video-task .generation-results:not(.count-1) .generation-result-card {
  flex: 0 1 var(--result-fit-width, 100%);
  min-width: 0;
}
.client-body:has(.studio-shell.view-create) .generation-output {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
}
.client-body:has(.studio-shell.view-create) .generation-output::after { display: none; }
.client-body:has(.studio-shell.view-create) .generation-output img,
.client-body:has(.studio-shell.view-create) .generation-output video,
.client-body:has(.studio-shell.view-create) .generation-result-card:hover .generation-output img,
.client-body:has(.studio-shell.view-create) .generation-result-card:hover .generation-output video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  transform: none;
}
.client-body:has(.studio-shell.view-create) .generation-output.image:not(.pending):not(.loading) .media-preview-trigger,
.client-body:has(.studio-shell.view-create) .generation-output.image:not(.pending):not(.loading) img { border-radius: var(--radius-sm); }
.client-body:has(.studio-shell.view-create) .generation-output.image:is(.loading, .pending) {
  /* Placeholder states must use the submitted image ratio, never the legacy
     landscape minimum-height surface used by generic task feedback. */
  aspect-ratio: var(--result-ratio, 1 / 1) !important;
  min-height: 0;
}
.client-body:has(.studio-shell.view-create) .generation-output.image.loading .generation-loading-surface {
  min-height: 0;
}
.client-body:has(.studio-shell.view-create) .generation-output.video,
.client-body:has(.studio-shell.view-create) .generation-output.video video {
  aspect-ratio: var(--result-ratio, 16 / 9);
  background: transparent;
}
.client-body:has(.studio-shell.view-create) .generation-results:not(.count-1) .generation-output.pending {
  min-height: 0;
  gap: var(--space-1);
  padding: var(--space-2);
}
.client-body:has(.studio-shell.view-create) .has-partial-failure .generation-output.pending {
  background: var(--state-danger-surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-danger) 32%, transparent);
}
.client-body:has(.studio-shell.view-create) .generation-results:not(.count-1) .generation-failure-mark {
  width: 32px;
  height: 32px;
  border-width: 1px;
  font-size: var(--font-body);
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy {
  gap: var(--space-1);
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-1);
  color: var(--color-text-muted);
  text-align: left;
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy p b {
  color: var(--color-danger);
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy .failure-reason-line {
  grid-template-columns: minmax(0, 1fr);
  color: var(--color-danger);
  font-size: var(--font-body);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy .failure-reason-line b {
  font-size: var(--font-caption);
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy .failure-suggestion-line {
  color: var(--color-text-muted);
}
.client-body:has(.studio-shell.view-create) .generation-failure-copy em {
  color: var(--color-success);
  font-size: var(--font-caption);
  font-style: normal;
}
.client-body:has(.studio-shell.view-create) .generation-batch-actions {
  width: fit-content;
  margin-top: var(--space-4);
}
.client-body:has(.studio-shell.view-create) .generation-item:has(.generation-results.count-1) .generation-batch-actions {
  margin-inline: 0;
  margin-left: 62px;
}
.client-body:has(.studio-shell.view-create) .generation-batch-actions > button,
.client-body:has(.studio-shell.view-create) .generation-batch-actions > .task-more-menu > summary {
  min-height: 30px;
  border: 0;
  border-radius: var(--radius-base);
  background: var(--color-surface-strong);
  color: var(--color-text);
  padding-inline: var(--space-3);
  font-size: var(--font-caption);
}
.client-body:has(.studio-shell.view-create) .generation-batch-actions > .task-more-menu > summary {
  width: 30px;
  padding: 0;
}
@media (max-width: 980px) {
  .client-body:has(.studio-shell.view-create) .creative-stage { padding-inline: var(--space-6); }
  .client-body:has(.studio-shell.view-create) .task-prompt-line { align-items: flex-start; flex-direction: column; gap: 0; }
  .client-body:has(.studio-shell.view-create) .task-prompt-summary { max-width: 100%; }
  .client-body:has(.studio-shell.view-create) .task-inline-meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* Generation composer matched to the supplied desktop reference. This final
   layer is intentionally limited to the create surface so the inspiration
   and Agent composers keep their existing proportions and interactions. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) {
  bottom: var(--generation-composer-bottom-offset);
  width: min(var(--generation-composer-max-width), var(--generation-composer-responsive-width));
  min-height: var(--generation-composer-height);
  overflow: visible;
  border: 1px solid var(--generation-composer-border);
  border-radius: var(--generation-composer-radius);
  background: var(--generation-composer-surface);
  box-shadow: var(--shadow-depth-float);
  backdrop-filter: none;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized):focus-within {
  border-color: var(--generation-composer-border);
  box-shadow: var(--shadow-depth-float);
}

body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"],
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded:focus-within {
  background: var(--generation-composer-surface);
  border-color: var(--generation-composer-border);
}

body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:focus-within,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded:focus-within {
  box-shadow: var(--shadow-depth-float);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-main {
  min-height: 158px;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--space-5);
  padding: 26px 24px 10px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .prompt-entry {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .prompt-rich-editor {
  height: auto;
  min-height: var(--generation-composer-editor-min-height);
  max-height: var(--generation-composer-editor-max-height);
  overflow-y: auto;
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.7;
  transition: min-height var(--motion-standard) ease-out;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .prompt-rich-editor:empty::before {
  color: var(--color-text-subtle);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .attach-button:not(.has-reference) {
  width: var(--generation-composer-reference-width);
  height: var(--generation-composer-reference-height);
  align-self: start;
  grid-template-rows: 1fr auto;
  gap: var(--space-1);
  overflow: visible;
  border: 1px solid var(--generation-composer-control-border);
  border-radius: var(--radius-sm);
  background: var(--composer-popover-control);
  color: var(--color-text-subtle);
  padding: 17px 4px 11px;
  transform: rotate(-7deg);
  box-shadow: var(--shadow-sm);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .attach-button:not(.has-reference)::after {
  content: "参考内容";
  display: block;
  color: var(--color-text-subtle);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .attach-button:not(.has-reference) .ui-icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-mode-icon {
  width: var(--generation-composer-reference-width);
  height: var(--generation-composer-reference-height);
  align-self: start;
  border-radius: var(--radius-sm);
  background: var(--composer-popover-control);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-toolbar {
  min-height: 78px;
  gap: var(--space-2);
  padding: 10px 22px 18px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-toolbar::before {
  display: none;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options {
  gap: var(--space-2);
  overflow: visible;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options > :is(.custom-select, .model-picker-trigger, .generation-spec-chip, .duration-picker-trigger) {
  height: var(--generation-composer-control-height);
  min-height: var(--generation-composer-control-height);
  border: 1px solid var(--generation-composer-control-border);
  border-radius: var(--radius-base);
  background: var(--generation-composer-control);
  box-shadow: none;
  backdrop-filter: none;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .create-mention-button {
  width: var(--generation-composer-control-height);
  height: var(--generation-composer-control-height);
  min-width: var(--generation-composer-control-height);
  flex: 0 0 var(--generation-composer-control-height);
  border: 1px solid var(--generation-composer-control-border);
  border-radius: var(--radius-base);
  background: var(--generation-composer-control);
  color: var(--color-text);
  font-size: 18px;
  font-weight: 500;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .create-mention-button:hover {
  border-color: var(--brand-border);
  background: var(--brand-surface);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .custom-select-trigger {
  gap: var(--space-2);
  padding-inline: var(--space-4);
  color: var(--color-text);
  font-size: var(--font-body);
  font-weight: 500;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .model-picker-trigger {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  padding-inline: var(--space-4);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .model-picker-current strong,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .generation-spec-chip strong,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .duration-picker-trigger strong {
  color: var(--color-text);
  font-size: var(--font-body);
  font-weight: 500;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .generation-spec-chip {
  padding-inline: var(--space-4);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-image-options > .generation-mode-select,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .generation-mode-select {
  flex-basis: 146px;
  width: 146px;
  min-width: 146px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-image-options > .model-picker-trigger,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .model-picker-trigger {
  flex-basis: clamp(240px, 20vw, 302px);
  width: clamp(240px, 20vw, 302px);
  min-width: 240px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .reference-mode-select {
  flex-basis: 88px;
  width: 88px;
  min-width: 88px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-image-options > .generation-spec-chip,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .generation-spec-chip {
  flex-basis: 212px;
  width: 212px;
  min-width: 212px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options.has-video-options > .duration-picker-trigger {
  flex-basis: 80px;
  width: 80px;
  min-width: 80px;
  padding-inline: var(--space-2);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-submit {
  gap: var(--space-3);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-price {
  color: var(--color-text-muted);
  font-size: var(--font-body);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .send-button {
  width: var(--generation-composer-control-height);
  height: var(--generation-composer-control-height);
  background: var(--gradient-brand);
  color: var(--color-brand-ink);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] > .composer-expand-button {
  top: -42px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--color-text-subtle);
  opacity: .72;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] > .composer-expand-button:hover {
  background: var(--generation-composer-control);
  color: var(--color-text);
  opacity: 1;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].compact {
  /* Compact mode is a navigation input, not the full generation workspace.
     Override the normal composer track so it visibly narrows after scrolling. */
  width: min(720px, calc(100% - 160px));
  min-height: 68px;
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded:not(.maximized) {
  min-height: 368px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded:not(.maximized) .composer-main {
  min-height: 290px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded:not(.maximized) .prompt-rich-editor {
  height: auto;
  min-height: var(--generation-composer-editor-expanded-height);
  max-height: var(--generation-composer-editor-max-height);
}
body.client-body:has(.studio-shell.view-create #taskForm[data-composer-surface="create"]:not(.maximized)) .creative-stage {
  /* The feed width is derived from the workspace-sized composer track. Do not
     shrink that track again with stage padding, or the media drifts right. */
  height: calc(100% - (var(--generation-composer-live-height, var(--generation-composer-height)) + var(--generation-composer-bottom-offset) + var(--space-6)));
  padding-inline: 0;
  padding-bottom: var(--space-2);
  scroll-padding-bottom: var(--space-2);
}
body.client-body:has(.studio-shell.view-create #taskForm[data-composer-surface="create"].compact) .creative-stage {
  height: calc(100% - (var(--generation-composer-live-height, 68px) + max(var(--generation-composer-bottom-offset), env(safe-area-inset-bottom)) + var(--space-6)));
}

/* Keep desktop layout in the browser's real visual viewport. CSS zoom changes
   the coordinate system for fixed/absolute composer controls and can leave
   them outside the visible area in embedded browsers. */
@media (min-width: 981px) and (max-width: 2000px) {
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].compact {
    bottom: max(var(--generation-composer-bottom-offset), env(safe-area-inset-bottom));
    border-color: var(--generation-composer-border);
    background: var(--generation-composer-surface);
    box-shadow: var(--shadow-lg);
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].compact .composer-back-bottom {
    /* The return control stays attached to the compact input, not in the
       empty area above the generation history. */
    border-color: var(--generation-composer-border);
    background: var(--generation-composer-surface);
    box-shadow: var(--shadow-sm);
  }
}

@media (min-width: 601px) {
  body.client-body:has(.studio-shell.view-create #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized):not(.expanded)) .customer-service-widget {
    bottom: calc(var(--generation-composer-live-height, var(--generation-composer-height)) + var(--generation-composer-bottom-offset) + 64px);
  }
  body.client-body:has(.studio-shell.view-create #taskForm[data-composer-surface="create"].expanded:not(.maximized)) .customer-service-widget {
    bottom: calc(var(--generation-composer-live-height, 368px) + var(--generation-composer-bottom-offset) + 64px);
  }
}

@media (max-width: 1200px) and (min-width: 601px) {
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) {
    width: min(var(--generation-composer-max-width), var(--generation-composer-responsive-width));
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options {
    overflow-x: auto;
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].compact {
    width: min(640px, calc(100% - 80px));
  }
}

@media (max-width: 1500px) and (min-width: 601px) {
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options {
    overflow-x: auto;
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options:is(.has-image-options, .has-video-options) > .generation-mode-select {
    flex-basis: var(--generation-toolbar-mode-width);
    width: var(--generation-toolbar-mode-width);
    min-width: var(--generation-toolbar-mode-width);
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options:is(.has-image-options, .has-video-options) > .model-picker-trigger {
    flex-basis: var(--generation-composer-laptop-model-width);
    width: var(--generation-composer-laptop-model-width);
    min-width: var(--generation-composer-laptop-model-width);
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-options:is(.has-image-options, .has-video-options) > .generation-spec-chip {
    flex-basis: var(--generation-toolbar-spec-width);
    width: var(--generation-toolbar-spec-width);
    min-width: var(--generation-toolbar-spec-width);
  }
}

/* The inspiration page keeps only the primary rail. The generation page
   retains its conversation sidebar for 开启创作/最近对话. */
@media (min-width: 821px) {
  .client-body .studio-shell.view-inspire:not(.canvas-editor-active) {
    --client-primary-rail-track: 82px;
    grid-template-columns: var(--client-primary-rail-track) 0 minmax(0, 1fr);
  }
  .client-body .studio-shell.view-inspire:not(.canvas-editor-active) .conversation-sidebar {
    visibility: hidden;
    width: 0;
    min-width: 0;
    overflow: hidden;
    border: 0;
    padding-right: 0;
    padding-left: 0;
    opacity: 0;
    pointer-events: none;
  }
  .client-body .studio-shell.view-inspire:not(.canvas-editor-active) .workspace {
    grid-column: 3;
  }
}

@media (max-width: 700px) {
  body.client-body .studio-shell.view-create:not(.view-inspire):not(.view-canvas) {
    grid-template-columns: var(--client-rail-width) minmax(0, 1fr);
  }
  body.client-body .studio-shell.view-create .conversation-sidebar {
    display: none;
  }
  .client-body .prompt-composer:not(.maximized),
  .client-body .prompt-composer.expanded:not(.maximized) {
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    transform: none;
  }
  .client-body .creative-stage { padding-bottom: 240px; }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .client-body .studio-shell.view-inspire:not(.canvas-editor-active) {
    --client-primary-rail-track: 74px;
    grid-template-columns: var(--client-primary-rail-track) 0 minmax(0, 1fr);
  }
}

/* Generation workspace: a compact desktop composition for laptop-height
   screens. The prompt, task metadata, and output group share one track so
   controls never feel detached from the active conversation. */
@media (min-width: 981px) {
  .client-body:has(.studio-shell.view-create) .workspace-toolbar {
    top: var(--space-4);
    right: max(var(--space-5), calc((100% - min(var(--generation-composer-max-width), var(--generation-composer-responsive-width))) / 2));
  }
  .client-body:has(.studio-shell.view-create) .creative-stage {
    padding-top: 64px;
  }
  .client-body:has(.studio-shell.view-create) .generation-feed {
    gap: calc(var(--generation-task-gap) - var(--space-3));
  }
  .client-body:has(.studio-shell.view-create) .task-prompt-line {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-1);
  }
  .client-body:has(.studio-shell.view-create) .task-prompt-summary {
    width: min(100%, 880px);
    max-width: 100%;
  }
  .client-body:has(.studio-shell.view-create) .task-inline-meta {
    max-width: 100%;
    color: var(--color-text-muted);
    font-size: var(--font-body);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .client-body:has(.studio-shell.view-create) .generation-results.count-1 .generation-result-card {
    max-width: min(var(--generation-single-result-max-width), 100%);
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-main {
    min-height: 100px;
    grid-template-columns: var(--generation-composer-reference-width) minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5) var(--space-1);
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .prompt-rich-editor {
    font-size: 16px;
    line-height: 1.6;
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .attach-button:not(.has-reference) {
    padding: var(--space-3) var(--space-1) var(--space-2);
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .composer-toolbar {
    min-height: 64px;
    padding: var(--space-2) var(--space-5) var(--space-4);
  }
}

/* Membership contact dialogs live above the workspace's translucent theme.
   Keep their contrast independent from the generic modal layer declared above. */
.client-body .membership-contact-modal,
.client-body .customer-recharge-modal {
  background: #171d25 !important;
  border-color: #365b7a !important;
  color: #f2f6fa !important;
}
.client-body .membership-contact-modal :is(h2, strong),
.client-body .customer-recharge-modal :is(h2, strong) {
  color: #f7fafc !important;
}
.client-body .membership-contact-content,
.client-body .membership-contact-content p,
.client-body .customer-recharge-content p,
.client-body .customer-recharge-content > div,
.client-body .customer-recharge-content > div small {
  color: #c3d0da !important;
}
.client-body .membership-contact-modal footer {
  border-color: #2e3b48 !important;
}
.client-body .membership-contact-modal footer button {
  border: 1px solid #52677a !important;
  background: #273341 !important;
  color: #f2f6fa !important;
}
.client-body .membership-contact-modal footer .primary {
  border-color: #4aa3d8 !important;
  background: #1677ad !important;
  color: #ffffff !important;
}

/* The rail is deliberately narrow. Its membership summary therefore uses a
   short tier name and reserves a full row for the credit count. */
.client-body .rail-membership-card {
  width: var(--client-membership-width);
  min-width: 0;
}
.client-body .rail-credit-panel {
  min-width: 0;
  min-height: 50px;
  gap: 2px;
  padding: 3px 1px;
  box-sizing: border-box;
}
.client-body .rail-credit-panel strong,
.client-body .rail-credit-panel strong.is-compact {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.15;
  text-overflow: ellipsis;
}
.client-body .rail-credit-panel strong .ui-icon {
  width: 10px;
  height: 10px;
}
.client-body .rail-credit-panel small {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The creation toolbar remains compact. Use compact typography and padding
   instead of widening controls, but never replace the active value with an
   ellipsis. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) :is(.generation-mode-select, .reference-mode-select) .custom-select-trigger {
  gap: 5px !important;
  padding-inline: 7px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) :is(.generation-mode-select, .reference-mode-select) .custom-select-trigger-value > span {
  font-size: 9px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .model-picker-current strong {
  font-size: 10px !important;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"]:not(.compact):not(.maximized) .generation-spec-chip strong {
  font-size: 11px !important;
}

/* Prompt details stay close to the hovered task while the positioning helper
   keeps them inside the visible viewport. */
.client-body:has(.studio-shell.view-create) .task-prompt-full {
  position: fixed;
  top: 12px;
  left: 12px;
  width: min(680px, calc(100vw - 24px));
  max-width: calc(100vw - 32px);
  max-height: min(320px, calc(100dvh - 24px));
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: contain;
  transform: none;
}
.client-body:has(.studio-shell.view-create) .task-prompt-full-text {
  display: block;
  max-height: 14.4em;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.client-body:has(.studio-shell.view-create) .task-prompt-summary .task-prompt-full {
  display: none !important;
  visibility: hidden;
}
.client-body:has(.studio-shell.view-create) .task-prompt-summary.preview-open .task-prompt-full {
  display: block !important;
}
.client-body:has(.studio-shell.view-create) .task-prompt-summary.preview-open.preview-positioned .task-prompt-full {
  visibility: visible;
}

/* Generation history follows the compact editorial hierarchy: prompt first,
   quiet technical metadata second, and the output media as the focal point. */
.client-body:has(.studio-shell.view-create) .task-prompt-clamped {
  color: #d9dde3;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.client-body:has(.studio-shell.view-create) .task-prompt-full {
  font-size: 12px;
  line-height: 1.5;
}
.client-body:has(.studio-shell.view-create) .reference-hover-card.compact {
  height: 24px;
  gap: 4px;
  padding: 2px 6px 2px 2px;
}
.client-body:has(.studio-shell.view-create) .reference-hover-card.compact .reference-hover-thumb {
  width: 20px;
  height: 20px;
}
.client-body:has(.studio-shell.view-create) .reference-hover-card.compact > strong { font-size: 10px; }
.client-body:has(.studio-shell.view-create) .task-inline-meta {
  color: #8e96a2;
  font-size: 12px;
  line-height: 24px;
}
.client-body:has(.studio-shell.view-create) .task-meta-separator {
  color: #626a75;
  opacity: 1;
}
.client-body:has(.studio-shell.view-create) .task-detail-label,
.client-body:has(.studio-shell.view-create) .task-status.processing {
  color: #9ca5b0;
  text-shadow: none;
}
.client-body:has(.studio-shell.view-create) .task-status.processing {
  border-color: rgba(148, 158, 171, .28);
  background: rgba(112, 122, 136, .12);
  animation: none;
}
.client-body:has(.studio-shell.view-create) .task-detail-popover {
  width: min(460px, calc(100vw - 32px));
  gap: var(--space-3);
}
.client-body:has(.studio-shell.view-create) .task-detail-heading,
.client-body:has(.studio-shell.view-create) .task-detail-section > b {
  color: var(--color-text);
  font-size: var(--font-caption);
  font-weight: 650;
}
.client-body:has(.studio-shell.view-create) .task-detail-rows {
  display: grid;
  gap: var(--space-1);
}
.client-body:has(.studio-shell.view-create) .task-detail-section {
  display: grid;
  gap: var(--space-2);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}
.client-body:has(.studio-shell.view-create) .task-detail-prompt {
  max-height: 128px;
  overflow: auto;
  color: var(--color-text-muted);
  font-size: var(--font-caption);
  line-height: 1.65;
  text-align: left;
  white-space: pre-wrap;
}
.client-body:has(.studio-shell.view-create) .task-detail-references {
  display: grid;
  gap: var(--space-2);
}
.client-body:has(.studio-shell.view-create) .task-detail-reference {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.client-body:has(.studio-shell.view-create) .task-detail-reference-preview {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-subtle);
}
.client-body:has(.studio-shell.view-create) .task-detail-reference-preview :is(img, video) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.client-body:has(.studio-shell.view-create) .task-detail-reference-preview i {
  position: absolute;
  color: #fff;
}
.client-body:has(.studio-shell.view-create) .task-detail-reference > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: left;
}
.client-body:has(.studio-shell.view-create) .task-detail-reference strong {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--font-caption);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-create) .task-detail-reference small,
.client-body:has(.studio-shell.view-create) .task-detail-empty {
  color: var(--color-text-subtle);
  font-size: 11px;
}

/* Keep the compact detail trigger on the second prompt line.  The narrower
   create layout previously stacked it as a third line and clipped its
   absolutely-positioned hover card with overflow:hidden. */
.client-body:has(.studio-shell.view-create) .task-prompt-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: var(--space-3);
  row-gap: 0;
}
.client-body:has(.studio-shell.view-create) .task-prompt-summary {
  width: auto;
  max-width: none;
}
.client-body:has(.studio-shell.view-create) .task-inline-meta {
  max-width: none;
  align-self: end;
  overflow: visible;
  text-overflow: clip;
}
.client-body:has(.studio-shell.view-create) .task-detail-popover {
  z-index: 1000;
  left: auto;
  right: 0;
}

/* The hover card is for a quick spec check, not a second task page.  Keep the
   requested operational values in a compact two-column card and leave the
   full prompt/reference material out of this lightweight surface. */
.client-body:has(.studio-shell.view-create) .task-detail-popover {
  width: min(300px, calc(100vw - 24px));
  gap: 8px;
  border-radius: 10px;
  padding: 10px 12px;
}
.client-body:has(.studio-shell.view-create) .task-detail-heading {
  font-size: 11px;
}
.client-body:has(.studio-shell.view-create) .task-detail-rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}
.client-body:has(.studio-shell.view-create) .task-detail-row {
  min-height: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  font-size: 10px;
  line-height: 1.25;
}
.client-body:has(.studio-shell.view-create) .task-detail-row strong {
  justify-self: auto;
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-body:has(.studio-shell.view-create) .task-detail-section {
  display: none;
}

/* Processing keeps the submitted media ratio and uses a restrained moving
   blue-gray placeholder instead of a dashboard-style technical animation. */
.client-body:has(.studio-shell.view-create) .generation-loading-surface {
  min-height: 0;
  border: 0;
  background: linear-gradient(112deg, #1b3658 0%, #466d9e 36%, #7897bf 64%, #b5b8bd 100%);
  box-shadow: none;
}
.client-body:has(.studio-shell.view-create) .generation-loading-surface::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(105deg, transparent 22%, rgba(224, 235, 255, .2) 49%, transparent 72%);
  filter: blur(20px);
  transform: translateX(-48%);
  animation: generation-media-sheen 3.2s ease-in-out infinite;
}
.client-body:has(.studio-shell.view-create) .generation-loading-surface::after {
  background: rgba(8, 12, 18, .1);
  transform: none;
  animation: none;
}
.client-body:has(.studio-shell.view-create) .generation-loading-grid,
.client-body:has(.studio-shell.view-create) .generation-loading-center,
.client-body:has(.studio-shell.view-create) .generation-loading-bar {
  display: none;
}
.client-body:has(.studio-shell.view-create) .generation-loading-status {
  top: 14px;
  left: 16px;
  gap: 0;
  color: rgba(255, 255, 255, .92);
}
.client-body:has(.studio-shell.view-create) .generation-loading-status b { display: none; }
.client-body:has(.studio-shell.view-create) .generation-loading-status strong {
  color: rgba(255, 255, 255, .94);
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(8, 14, 25, .42);
}
.client-body:has(.studio-shell.view-create) .generation-loading-surface > small {
  right: auto;
  bottom: 14px;
  left: 16px;
  color: rgba(244, 248, 252, .72);
  font-size: 11px;
}
@keyframes generation-media-sheen {
  0%, 100% { opacity: .38; transform: translateX(-45%); }
  50% { opacity: .8; transform: translateX(45%); }
}

/* Reference uploads never replace or resize the composer. The busy layer is
   painted over the existing upload tile, so the surrounding page stays still. */
.client-body:has(.studio-shell.view-create) .attach-button.is-uploading {
  position: relative;
  overflow: hidden;
  opacity: 1;
  cursor: wait;
}
.client-body:has(.studio-shell.view-create) .attach-button.is-uploading .composer-upload-pending {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-radius: inherit;
  background: rgba(15, 20, 27, .82);
  color: #e8eef5;
  pointer-events: none;
}
.client-body:has(.studio-shell.view-create) .composer-upload-pending i {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid rgba(225, 235, 247, .26);
  border-top-color: #a9d8ee;
  border-radius: 50%;
  animation: composer-upload-spin .8s linear infinite;
}
.client-body:has(.studio-shell.view-create) .composer-upload-pending b {
  color: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
@keyframes composer-upload-spin { to { transform: rotate(360deg); } }

/* Composer popovers share the compact reference layout while only rendering
   options supplied by the active model and the uploaded reference library. */
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-picker-option {
  gap: var(--space-3) !important;
  padding: 10px 12px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-copy {
  gap: 5px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-title {
  justify-content: flex-start;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-copy small {
  gap: var(--space-3);
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .model-option-meta {
  margin-left: auto;
}

body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .generation-spec-panel {
  width: min(520px, calc(100% - 28px));
  gap: 14px;
  border-radius: 16px;
  padding: 16px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-section {
  gap: 9px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-section > strong {
  font-size: 12px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-ratio-grid,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-resolution-grid,
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-count-grid {
  gap: 4px;
  border-radius: 10px;
  padding: 5px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-ratio-grid {
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-resolution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-resolution-grid .spec-option {
  width: 100%;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .spec-option {
  min-height: 58px;
  border-radius: 7px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .ratio-option {
  min-height: 66px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .ratio-auto-glyph {
  width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .ratio-auto-glyph .ui-icon {
  width: 20px;
  height: 20px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel {
  width: min(500px, calc(100% - 24px));
  gap: 12px;
  border-radius: 16px;
  padding: 16px 18px 14px;
}
body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"] .duration-picker-panel output {
  min-width: 96px;
  border-radius: 9px;
  padding: 8px 14px;
}

body.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-empty {
  align-items: center;
  gap: 16px;
  text-align: center;
}
body.client-body:has(.studio-shell.view-create) .create-reference-picker .reference-library-empty strong {
  color: var(--page-text-subtle);
}
.reference-empty-illustration {
  position: relative;
  width: 78px;
  height: 68px;
  display: grid;
  place-items: center;
  color: #8a94a2;
}
.reference-empty-illustration::before,
.reference-empty-illustration::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid #3c4654;
  border-radius: 10px;
  background: #1b2028;
}
.reference-empty-illustration::before {
  transform: translate(-8px, 1px) rotate(-10deg);
}
.reference-empty-illustration::after {
  transform: translate(7px, -1px) rotate(8deg);
}
.reference-empty-illustration .ui-icon {
  position: relative;
  z-index: 2;
  width: 62px;
  height: 52px;
  box-sizing: border-box;
  border: 1px solid #455061;
  border-radius: 10px;
  background: #242a34;
  color: #697482;
  padding: 13px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
}
.reference-empty-upload {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: #34373d;
  color: #f2f4f7;
  padding: 0 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.reference-empty-upload:hover {
  background: #3d4148;
}
.reference-empty-upload .ui-icon {
  width: 18px;
  height: 18px;
}

/* Password visibility toggle + confirm-password field (auth card + profile
   change-password modal). The toggle sits inside the field so both themes can
   share one structure. */
.password-input {
  position: relative;
  display: block;
}
.auth-field .password-input input {
  padding-right: 46px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b939c;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.password-toggle:hover {
  color: #46505a;
  background: rgba(23, 26, 30, 0.06);
}
.password-toggle .ui-icon {
  width: 17px;
  height: 17px;
}
.auth-inline-error {
  margin-bottom: var(--space-3);
}

/* Email verification adds a fifth form row. Compact the fixed card so its
   complete form stays visible without introducing an inner scrollbar. */
.auth-login-card {
  overflow: hidden;
}
/* This registration variant has an extra code row. Its layout is compact at
   every viewport height, because the dialog itself deliberately stays 620px. */
.auth-modal-email-verification .auth-login-card { padding: 15px 32px 10px; }
.auth-modal-email-verification .auth-modal-close { top: 8px; right: 8px; width: 30px; height: 30px; }
.auth-modal-email-verification .auth-login-brand { margin-bottom: 7px; }
.auth-modal-email-verification .auth-login-brand .brand-logo { width: 84px; height: 54px; }
.auth-modal-email-verification .auth-login-card h2 { margin: 4px 0 3px; font-size: 21px; }
.auth-modal-email-verification .auth-login-card .auth-tabs { margin: 10px 0 9px; }
.auth-modal-email-verification .auth-login-card .auth-tabs button { padding: 7px; }
.auth-modal-email-verification .auth-field { gap: 2px; margin-bottom: 5px; }
.auth-modal-email-verification .auth-field input { height: 36px; }
.auth-modal-email-verification .auth-login-card .auth-submit { height: 36px; }
.auth-modal-email-verification .auth-login-card > small { margin-top: 6px; line-height: 1.2; }
@media (max-height: 780px) {
  .auth-modal-backdrop { padding: 10px; }
  .auth-modal {
    width: min(960px, calc(100vw - 32px));
    height: calc(100vh - 20px);
    min-height: 0;
  }
  .auth-login-card { padding: 15px 32px 10px; }
  .auth-modal-close { top: 8px; right: 8px; width: 30px; height: 30px; }
  .auth-login-brand { margin-bottom: 7px; }
  .auth-login-brand .brand-logo { width: 84px; height: 54px; }
  .auth-login-card h2 { margin: 4px 0 3px; font-size: 21px; }
  .auth-login-card .auth-tabs { margin: 10px 0 9px; }
  .auth-login-card .auth-tabs button { padding: 7px; }
  .auth-field { gap: 2px; margin-bottom: 5px; }
  .auth-field input { height: 36px; }
  .auth-login-card .auth-submit { height: 36px; }
  .auth-login-card > small { margin-top: 6px; line-height: 1.2; }
}

.profile-editor-fields .password-input input {
  padding-right: 44px;
}
.profile-modal .password-toggle {
  color: #8a949e;
}
.profile-modal .password-toggle:hover {
  color: #e8edf0;
  background: rgba(255, 255, 255, 0.07);
}
.profile-modal .password-form-error {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(214, 106, 122, 0.42);
  border-radius: 6px;
  background: rgba(122, 42, 56, 0.22);
  color: #f0aab6;
  font-size: 12px;
}

/* Composer states share the compact reference palette in dark mode. */
html:not(.theme-light) body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"],
html:not(.theme-light) body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].expanded,
html:not(.theme-light) body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].maximized,
html:not(.theme-light) body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].compact {
  --composer-surface: #1b1b1b;
  --composer-surface-soft: #1e1e1e;
  --composer-line: #414141;
  border-color: var(--composer-line);
  background: linear-gradient(180deg, var(--composer-surface), var(--composer-surface-soft));
  box-shadow: 0 20px 58px rgba(0, 0, 0, .5);
}


/* 后台特价分组：分组介绍与组内线路管理 */
.admin-body .special-group-card .special-group-description { height: auto; margin: 0 0 12px; -webkit-line-clamp: 4; }
.admin-body .special-group-lanes { display: grid; gap: 8px; margin-top: 4px; }
.admin-body .special-group-lane { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid #e4e8ec; border-radius: 6px; background: var(--color-surface-strong, #f7f9fa); }
.admin-body .special-group-lane-copy { min-width: 0; }
.admin-body .special-group-lane-copy strong { display: block; overflow: hidden; color: var(--admin-text, #2f3c4b); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-body .special-group-lane-copy small { display: block; overflow: hidden; margin-top: 2px; color: var(--admin-text-subtle, #7c8795); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.admin-body .special-group-lane-actions { display: flex; gap: 6px; }
.admin-body .special-group-lane-actions button { min-height: 28px; padding: 0 9px; font-size: 11px; }
.admin-body .special-group-pending-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-body .special-group-pending-header h2 { margin: 0 0 2px; font-size: 16px; line-height: 1.3; }
.admin-body .special-group-pending-header small { display: block; color: var(--admin-text-subtle, #7c8795); font-size: 11px; line-height: 1.5; }
.admin-body .model-billing-tabs { margin-top: -8px; }

.admin-body .special-group-spec { margin: 2px 0 10px; color: var(--admin-text-subtle, #7c8795); font-size: 11px; line-height: 1.5; }
.admin-body .group-spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.admin-body #specialGroupForm .inline-help { display: block; margin-top: 4px; }

/* Canvas editor owns the full viewport; later generic view-canvas rules must not restore the host rail. */
body.client-body .studio-shell.canvas-editor-active {
  grid-template-columns: 0 0 minmax(0, 1fr) !important;
}
/* Keep canvas support above the task dock with its own clear spacing. */
@media (min-width: 821px) {
  .client-body:has(.studio-shell.view-canvas) .customer-service-widget {
    right: 28px;
    left: auto;
    bottom: 96px;
    z-index: 90;
  }
}

/* The Agent composer already owns its input area; never place support controls inside it. */
.client-body:has(.canvas-agent-drawer) .customer-service-widget {
  display: none !important;
}

/* Auto-repair rows stay compact; full diagnosis is opt-in. */
.auto-repair-detail { display: block; min-width: 0; }
.auto-repair-detail summary { display: block; max-width: 460px; overflow: hidden; color: #2f3a46; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.auto-repair-detail summary::-webkit-details-marker, .auto-repair-detail summary::marker { color: #82909f; }
.auto-repair-detail-preview { display: block; margin-top: 3px; color: #8d97a4; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-repair-detail-body { max-height: 280px; margin-top: 8px; padding: 10px 12px; overflow: auto; border: 1px solid #e3e7eb; border-radius: 6px; background: #f8f9fb; color: #445164; font-size: 11px; line-height: 1.6; white-space: normal; }
.auto-repair-detail-body p { margin: 0 0 6px; }
.auto-repair-detail-body p > strong { margin-right: 6px; }
.auto-repair-detail-heading { margin-top: 8px !important; font-weight: 700; }
.auto-repair-detail-body ul { margin: 0 0 6px; padding-left: 18px; }
.auto-repair-detail-body li { margin-bottom: 4px; }

.admin-body .auto-repair-detail summary { color: var(--admin-text); }
.admin-body .auto-repair-detail-preview { color: var(--admin-text-muted); }
.admin-body .auto-repair-detail-body { border-color: var(--admin-border-strong); background: var(--admin-surface-raised); color: var(--admin-text-muted); }
.admin-body .auto-repair-detail-body strong, .admin-body .auto-repair-detail-heading { color: var(--admin-text); }

/* 监控维修表：固定列宽 + 单行省略，避免长报错把状态列挤出屏幕 */
.auto-repair-panel .admin-table-wrap table { table-layout: fixed; }
.auto-repair-panel .admin-table-wrap th:nth-child(1) { width: 128px; }
.auto-repair-panel .admin-table-wrap th:nth-child(2) { width: 190px; }
.auto-repair-panel .admin-table-wrap th:nth-child(3) { width: 30%; }
.auto-repair-panel .admin-table-wrap th:nth-child(4) { width: 38%; }
.auto-repair-panel .admin-table-wrap th:nth-child(5) { width: 108px; }
.auto-repair-panel .admin-table-wrap th,
.auto-repair-panel .admin-table-wrap td { padding: 10px 12px; }
.auto-repair-panel .admin-table-wrap td > strong,
.auto-repair-panel .admin-table-wrap td > small,
.auto-repair-panel .auto-repair-detail summary,
.auto-repair-panel .auto-repair-detail-preview { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Video reference selector: 146px trigger reduced by two-fifths. */
body.client-body .studio-shell.view-create #taskForm[data-composer-surface="create"] .composer-options.has-video-options > .reference-mode-select {
  flex-basis: 88px !important;
  width: 88px !important;
  min-width: 88px !important;
}
body.client-body .studio-shell.view-create #taskForm[data-composer-surface="create"] .reference-mode-select .custom-select-menu {
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
}
.prompt-preset-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 4px 6px;
}

.prompt-preset-item.pinned {
  background: rgba(78, 168, 255, .08);
}

.prompt-preset-item:hover {
  background: rgba(255, 255, 255, .06);
}

.prompt-preset-use {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #4ea8ff;
  -webkit-text-fill-color: #4ea8ff;
  padding: 8px 4px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.prompt-preset-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.prompt-preset-actions button {
  height: 26px;
  border: 1px solid var(--page-line);
  border-radius: 8px;
  background: transparent;
  color: var(--page-text-subtle);
  padding: 0 8px;
  font-size: 11px;
  cursor: pointer;
}

.prompt-preset-actions button:hover {
  color: var(--page-text);
  border-color: rgba(255, 255, 255, .24);
}

.prompt-preset-mode {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid var(--page-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--page-text);
  padding: 8px 10px;
  font-size: 13px;
}

/* Keep result-card actions compact so they do not obscure narrow thumbnails. */
.client-body .generation-output .result-media-tools {
  top: 7px;
  right: 7px;
  gap: 1px;
  border-radius: 6px;
  padding: 2px;
}

.client-body .generation-output .result-media-tools button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 4px;
  font-size: 13px;
}

.client-body .generation-output .result-media-tools button svg {
  width: 14px;
  height: 14px;
}
.client-body .studio-shell.view-canvas .studio-legal-footer,
.client-body .studio-shell.canvas-editor-active .studio-legal-footer { display: none !important; }
.seed-audio-composer .attach-button { flex-shrink: 0; }
.seed-audio-settings { position: relative; }
.seed-audio-settings summary { list-style: none; cursor: pointer; }
.seed-audio-settings summary::-webkit-details-marker { display: none; }
.seed-audio-settings summary svg { width: 18px; height: 18px; }
.seed-audio-settings-panel { position: absolute; bottom: 48px; left: 0; width: 280px; padding: 16px; display: grid; gap: 14px; border: 1px solid var(--border-color, #555); border-radius: 8px; background: var(--panel-bg, #232323); color: var(--text-primary, #eee); z-index: 80; box-shadow: 0 8px 28px #0004; }
.seed-audio-settings-panel label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.seed-audio-settings-panel input[type="range"] { width: 145px; }
.seed-audio-settings-panel output { min-width: 28px; text-align: right; }
.seed-audio-settings-panel select { margin-left: auto; color: inherit; background: transparent; border: 1px solid #777; border-radius: 4px; }
.seed-audio-composer .composer-price-wrap { white-space: nowrap; font-size: 12px; }
.seed-voice-library { width: min(1040px, calc(100vw - 64px)); max-height: calc(100vh - 80px); padding: 24px; background: var(--page-panel-bg, #252525); color: var(--page-text, #eee); border: 1px solid var(--page-line, #444); border-radius: 8px; display: flex; flex-direction: column; gap: 20px; }
.seed-voice-library header, .seed-voice-library footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.seed-voice-library h2 { margin: 0; font-size: 18px; }
.seed-voice-library nav { display: flex; gap: 28px; }
.seed-voice-library nav button { border: 0; background: transparent; color: inherit; opacity: .55; font-weight: 600; cursor: pointer; padding: 8px 0; }
.seed-voice-library nav button.active { opacity: 1; border-bottom: 2px solid var(--color-brand, #73c9c0); }
.seed-voice-filters { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 12px; }
.seed-voice-filters input[type="search"] { grid-column: span 2; }
.seed-voice-library input:not([type="checkbox"]), .seed-voice-library select { min-width: 0; height: 40px; border: 1px solid var(--page-line, #555); background: var(--page-control-bg, #303030); color: inherit; padding: 8px 12px; border-radius: 6px; }
.seed-voice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; overflow-y: auto; min-height: 220px; max-height: 410px; }
.seed-voice-row { display: flex; align-items: center; gap: 4px; min-height: 66px; padding: 4px; border-radius: 6px; }
.seed-voice-row.selected { background: var(--page-control-bg, #393939); outline: 1px solid var(--color-brand, #73c9c0); }
.seed-voice-row .icon-button { flex-shrink: 0; width: 28px; height: 28px; }
.seed-voice-row .icon-button:disabled { opacity: .25; cursor: default; }
.seed-voice-name { min-width: 0; flex: 1; text-align: left; background: transparent; color: inherit; border: 0; padding: 6px; cursor: pointer; }
.seed-voice-name strong, .seed-voice-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seed-voice-name strong { font-size: 14px; font-weight: 500; }
.seed-voice-name small { margin-top: 5px; font-size: 11px; opacity: .55; white-space: normal; line-height: 16px; overflow-wrap: anywhere; }
.seed-voice-row .favorite { color: #efbe60; }
.seed-voice-create { display: flex; align-items: center; gap: 10px; background: transparent; color: inherit; border: 0; cursor: pointer; }
.seed-voice-create svg { width: 24px; height: 24px; }
.seed-voice-selected { display: flex; flex-wrap: wrap; gap: 10px; }
.seed-voice-selected > span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.seed-voice-selected small, .seed-voice-library footer > span { opacity: .6; font-size: 12px; }
.seed-voice-create-form { width: 480px; }
.seed-voice-create-form > label { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; }
.seed-voice-create-form > label > input:not([type="checkbox"]), .seed-voice-create-form > label > select { width: 280px; }
.seed-voice-create-form .seed-voice-consent { justify-content: flex-start; }
.seed-voice-empty { grid-column: 1 / -1; opacity: .6; }

/* Compact audio results retain two equal columns without inheriting video ratios. */
body.client-body .generation-output.audio.compact-audio {
  --audio-surface: #191c20;
  --audio-text: #f1f3f5;
  --audio-muted: #a0a6af;
  --audio-line: #343a42;
  --audio-accent: #f5a397;
  --audio-accent-ink: #301d18;
  --audio-wave: #48525c;
  display: block !important;
  aspect-ratio: auto !important;
  min-height: 0 !important;
  border: 1px solid var(--audio-line) !important;
  border-radius: 7px !important;
  background: var(--audio-surface) !important;
  box-shadow: none !important;
  color: var(--audio-text);
}
html[data-theme="light"] body.client-body .generation-output.audio.compact-audio {
  --audio-surface: #ffffff;
  --audio-text: #20262b;
  --audio-muted: #68727d;
  --audio-line: #dce2e7;
  --audio-accent: #be5143;
  --audio-accent-ink: #ffffff;
  --audio-wave: #c8d4dc;
}
body.client-body .audio-task .generation-results.count-1 .generation-result-card {
  width: min(100%, 360px) !important;
  max-width: 360px !important;
}
body.client-body .audio-task .generation-results.count-2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: min(100%, 732px) !important;
  gap: 12px !important;
}
body.client-body .audio-task .generation-results.count-2 .generation-result-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 360px !important;
}
body.client-body .generation-inline-audio {
  width: 100%;
  min-width: 0;
  padding: 9px 10px 6px;
  container-type: inline-size;
  color: var(--audio-text);
  font-family: inherit;
  letter-spacing: 0;
}
body.client-body .generation-inline-audio audio { display: none; }
body.client-body .inline-audio-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
body.client-body .inline-audio-content { flex: 1; min-width: 0; }
body.client-body .inline-audio-title { display: block; font-size: 12px; line-height: 18px; font-weight: 500; }
body.client-body .generation-inline-audio button,
body.client-body .compact-audio .result-media-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  flex-shrink: 0;
  padding: 3px;
  border: 0 !important;
  border-radius: 4px;
  color: var(--audio-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}
body.client-body .generation-inline-audio button:hover,
body.client-body .compact-audio .result-media-tools button:hover { color: var(--audio-text) !important; background: var(--audio-line) !important; }
body.client-body .generation-inline-audio button svg,
body.client-body .compact-audio .result-media-tools button svg { width: 15px; height: 15px; }
body.client-body .generation-inline-audio .inline-audio-play {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 9px;
  border-radius: 50%;
  color: var(--audio-accent-ink) !important;
  background: var(--audio-accent) !important;
}
body.client-body .inline-audio-wave { position: relative; height: 30px; margin: 4px 0 2px; }
body.client-body .inline-audio-bars { display: flex; align-items: center; gap: 2px; height: 100%; width: 100%; overflow: hidden; }
body.client-body .inline-audio-bars i { display: block; flex: 1; min-width: 1px; height: var(--audio-bar-height); max-height: 100%; border-radius: 1px; background: var(--audio-wave); }
body.client-body .inline-audio-bars i.played { background: var(--audio-accent); }
body.client-body .inline-audio-playhead { position: absolute; left: clamp(0px, var(--audio-progress, 0%), calc(100% - 1px)); top: 2px; bottom: 2px; width: 1px; background: var(--audio-accent); opacity: .8; pointer-events: none; }
body.client-body .inline-audio-wave input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
body.client-body .inline-audio-wave:focus-within { outline: 2px solid var(--audio-accent); outline-offset: 2px; }
body.client-body .inline-audio-times { display: flex; justify-content: space-between; font-size: 11px; line-height: 16px; color: var(--audio-muted); font-variant-numeric: tabular-nums; }
body.client-body [data-inline-audio-current] { color: var(--audio-accent); }
body.client-body .inline-audio-footer { display: flex; align-items: center; gap: 2px; min-height: 26px; margin-top: 6px; padding-top: 3px; border-top: 1px solid var(--audio-line); }
body.client-body .inline-audio-footer > span:first-child { font-size: 11px; line-height: 16px; color: var(--audio-muted); white-space: nowrap; }
body.client-body .inline-audio-spacer { flex: 1; }
body.client-body .generation-inline-audio .inline-audio-speed { width: 28px; min-width: 28px; font-size: 11px; font-variant-numeric: tabular-nums; }
body.client-body .generation-inline-audio [data-inline-audio-loop][aria-pressed="true"] { color: var(--audio-accent) !important; }
body.client-body .inline-audio-error:not([hidden]) { display: block; font-size: 11px; line-height: 16px; padding: 4px 0 8px; color: var(--audio-accent); overflow-wrap: anywhere; }
body.client-body .compact-audio .result-media-tools {
  position: static !important;
  display: flex !important;
  justify-content: flex-end;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 1px;
  padding: 0 0 0 4px;
  margin: 0;
  border-left: 1px solid var(--audio-line) !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
}
@container (max-width: 280px) {
  body.client-body .inline-audio-sample-rate { display: none; }
}

body.client-body .seed-audio-composer:not(.compact):not(.maximized) {
  min-height: 164px;
}
body.client-body .seed-audio-composer:not(.compact):not(.maximized) .composer-main {
  min-height: 98px;
  padding: 18px 24px 8px;
}
body.client-body .seed-audio-composer:not(.compact):not(.maximized) .prompt-rich-editor {
  height: 76px;
  min-height: 76px;
  font-size: 16px;
  line-height: 1.65;
}
body.client-body .seed-audio-composer .composer-toolbar {
  min-height: 54px;
  padding: 5px 24px 11px;
}
body.client-body .seed-audio-composer .composer-options {
  overflow: visible;
  flex-wrap: wrap;
}
body.client-body .seed-audio-composer .composer-upgrade { display: none; }
body.client-body .seed-audio-composer .attach-button:not(.has-reference) {
  width: 54px;
  min-width: 54px;
  height: 62px;
  border: 0;
  border-radius: 4px;
  background: var(--page-control-bg, #292d34);
  color: var(--page-text-subtle, #9299a3);
}
body.client-body .seed-audio-composer .seed-audio-controls { gap: 5px; }
body.client-body .seed-audio-composer .seed-audio-controls .create-toolbar-pill {
  min-height: 32px;
  height: 32px;
  padding: 0 9px;
  font-size: 12px;
}
body.client-body .seed-audio-composer .seed-audio-controls .create-mention-pill {
  width: 32px;
  min-width: 32px;
  padding: 0;
}
body.client-body .seed-audio-composer .composer-submit { gap: 7px; }
.seed-audio-composer .composer-expand-button,
.seed-audio-composer .seed-audio-settings { display: none !important; }
.seed-audio-composer .attach-tile-caption { display: none; }
.seed-audio-controls { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 0 0 auto; }
.seed-audio-mode-select { position: relative; display: inline-flex; }
.seed-audio-mode { gap: 6px; }
.seed-audio-mode > .ui-icon,
.seed-audio-controls [data-seed-voice-library] > .ui-icon { width: 15px; height: 15px; }
.seed-audio-mode-menu {
  position: fixed;
  z-index: 190;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--composer-popover-line, #3b414a);
  border-radius: 8px;
  background: var(--composer-popover-surface, #26292e);
  box-shadow: var(--shadow-depth-dialog, 0 18px 44px rgba(0, 0, 0, .46));
}
.seed-audio-mode-menu[hidden] { display: none !important; }
.seed-audio-mode-menu > button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--page-text, #f1f3f5);
  padding: 0 10px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.seed-audio-mode-menu > button:hover,
.seed-audio-mode-menu > button.active { background: var(--composer-popover-control-active, #3a3d43); }
.seed-audio-mode-menu > button > .ui-icon:first-child { width: 16px; height: 16px; }
.seed-audio-mode-menu > button > .ui-icon:last-child { width: 15px; height: 15px; margin-left: auto; }
.seed-voice-popover-layer { position: fixed; z-index: 180; inset: 0; pointer-events: none; }
.seed-voice-popover-layer .seed-voice-popover { pointer-events: auto; }
.seed-voice-popover {
  position: fixed !important;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  padding: 16px;
  gap: 10px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
}
.seed-voice-popover-header { min-height: 32px; display: flex; align-items: center; gap: 10px; }
.seed-voice-popover-header h2 { flex: 0 0 auto; font-size: 16px; }
.seed-voice-popover-header input[type="search"] { flex: 1 1 auto; width: auto; height: 32px; }
.seed-voice-popover-header .icon-button { flex: 0 0 auto; width: 30px; height: 30px; }
.seed-voice-popover nav { gap: 20px; min-height: 30px; }
.seed-voice-popover nav button { padding: 5px 0; font-size: 12px; }
.seed-voice-popover .seed-voice-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seed-voice-popover .seed-voice-filters select { height: 34px; padding: 6px 8px; font-size: 12px; }
.seed-voice-popover .seed-voice-grid {
  flex: 1 1 auto;
  min-height: 170px;
  max-height: none;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: minmax(50px, auto);
  align-content: start;
  gap: 5px 10px;
  padding-right: 3px;
}
.seed-voice-popover .seed-voice-row { min-width: 0; min-height: 50px; }
.seed-voice-popover .seed-voice-name { padding: 4px; }
.seed-voice-popover .seed-voice-name strong { font-size: 12px; }
.seed-voice-popover .seed-voice-name small { margin-top: 2px; font-size: 10px; line-height: 14px; }
.seed-voice-popover .seed-voice-row .icon-button { width: 25px; height: 25px; }
.seed-voice-popover .seed-voice-row .icon-button .ui-icon { width: 14px; height: 14px; }
.seed-voice-popover .seed-voice-create {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  padding: 8px 12px;
  border: 1px dashed var(--page-line, #555);
  border-radius: 6px;
}
.seed-voice-mention-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--page-line, #555);
  border-radius: 6px;
}
.seed-voice-mention-option strong { font-size: 13px; }
.seed-voice-mention-option small { font-size: 11px; opacity: .6; }
.seed-voice-mention-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px dashed var(--page-line, #555);
  border-radius: 6px;
}
.seed-voice-popover .seed-voice-more { grid-column: 1 / -1; margin: 2px 0; color: inherit; font-size: 11px; opacity: .45; text-align: center; }
.seed-voice-popover .seed-voice-selected { max-height: 38px; overflow-y: auto; gap: 6px 10px; }
.seed-voice-popover .seed-voice-selected > span { font-size: 11px; }
.seed-voice-popover .seed-voice-selected:empty { display: none; }
.seed-voice-popover footer { min-height: 32px; }
.seed-voice-popover footer .primary-button { min-height: 32px; padding: 0 12px; }
.seed-voice-spinner { width: 13px; height: 13px; display: block; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: seed-voice-spin .7s linear infinite; }
.voice-preview-button.is-loading { color: var(--color-brand, #83d8e6); }
@keyframes seed-voice-spin { to { transform: rotate(360deg); } }
.seed-voice-popover .seed-voice-create-form { width: auto; overflow-y: auto; }
.seed-voice-popover .seed-voice-create-form > label > input:not([type="checkbox"]),
.seed-voice-popover .seed-voice-create-form > label > select { width: min(280px, 60%); }
.seed-voice-popover .seed-voice-create-form footer { margin-top: 12px; }

@media (max-width: 700px) {
  body.client-body .seed-audio-composer:not(.compact):not(.maximized) .composer-main {
    min-height: 90px;
    padding: 14px 14px 6px;
  }
  body.client-body .seed-audio-composer .composer-toolbar { padding: 5px 12px 9px; }
  body.client-body .seed-audio-composer .composer-options { gap: 5px; }
  body.client-body .seed-audio-composer .composer-submit { min-width: 0; }
  .seed-voice-popover { padding: 12px; }
  .seed-voice-popover .seed-voice-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seed-voice-popover .seed-voice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 160px; }
  .seed-voice-popover .seed-voice-row { min-height: 48px; }
}

/* Music generation stays inside the shared create composer. Lyrics and the
   style prompt share one two-column workspace, then collapse on mobile. */
.music-prompt-composer .composer-main { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 0; }
.music-prompt-composer .music-composer-main { min-width: 0; }
.music-prompt-composer .prompt-entry { min-width: 0; display: flex; flex-direction: column; }
.music-fields-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}
.music-style-field {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-bg-raised) 86%, transparent);
}
.music-style-header {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 14px;
}
.music-style-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-brand) 34%, var(--color-border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-brand) 10%, var(--color-bg-raised));
  color: var(--color-brand);
}
.music-style-icon .ui-icon { width: 15px; height: 15px; }
.music-style-copy { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.music-style-copy strong { flex: 0 0 auto; color: var(--color-text); font-size: 12px; }
.music-style-copy small { overflow: hidden; color: var(--color-text-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.music-style-requirement {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
  border-radius: 999px;
  color: var(--color-text-muted);
  padding: 3px 8px;
  font-size: 10px;
  line-height: 1.2;
}
.music-prompt-composer .prompt-rich-editor { min-height: 184px; padding: 13px 14px 16px; font-size: 13px; line-height: 1.72; }
.music-prompt-composer .composer-options.has-music-options { flex-wrap: nowrap; gap: 4px; overflow: visible; }
.music-prompt-composer .music-setting-select {
  position: relative;
  height: 38px;
  min-width: 0;
  max-width: 220px;
  overflow: visible;
  background: color-mix(in srgb, var(--color-bg-raised) 72%, transparent);
}
.music-prompt-composer .music-setting-version { max-width: 148px; }
.music-prompt-composer .music-setting-mode { max-width: 138px; }
.music-prompt-composer .music-setting-vocal { max-width: 132px; }
.music-prompt-composer .music-setting-trigger { justify-content: flex-start; gap: 8px; padding: 0 9px 0 10px; font-weight: 500; }
.music-setting-trigger-copy { min-width: 0; display: flex; align-items: baseline; gap: 5px; }
.music-setting-trigger-copy small { flex: 0 0 auto; color: var(--color-text-muted); font-size: 10px; font-weight: 600; }
.music-setting-trigger-copy strong { overflow: hidden; color: var(--color-text); font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.music-setting-trigger .custom-select-chevron { display: inline-flex; margin-left: auto; color: var(--color-text-muted); }
.music-setting-trigger .custom-select-chevron .ui-icon { width: 12px; height: 12px; }
.music-setting-menu {
  width: 304px !important;
  min-width: 304px !important;
  max-width: min(340px, calc(100vw - 24px)) !important;
  gap: 3px;
  overflow: hidden;
  z-index: 1200;
  border-color: var(--composer-popover-line, var(--color-border));
  border-radius: 13px;
  background: var(--composer-popover-surface, var(--color-bg-raised));
  padding: 8px;
  box-shadow: var(--shadow-depth-dialog);
}
.music-setting-menu-header {
  display: grid;
  gap: 2px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--composer-popover-line, var(--color-border));
  padding: 5px 9px 9px;
}
.music-setting-menu-header strong { color: var(--color-text); font-size: 12px; }
.music-setting-menu-header small { color: var(--color-text-muted); font-size: 10px; line-height: 1.35; }
.music-setting-option {
  min-height: 58px !important;
  justify-content: space-between;
  gap: 10px;
  border-radius: 9px;
  padding: 8px 10px !important;
  white-space: normal !important;
}
.music-setting-option-main { min-width: 0; display: grid; gap: 3px; padding-right: 4px; }
.music-setting-option-main strong { color: inherit; font-size: 12px; font-weight: 650; }
.music-setting-option-main small { color: var(--color-text-muted); font-size: 10px; line-height: 1.35; }
.music-setting-option.active .music-setting-option-main small { color: color-mix(in srgb, var(--color-text) 68%, var(--color-text-muted)); }
.music-setting-option .custom-select-option-check { flex: 0 0 auto; display: inline-flex; }
.music-setting-option .custom-select-option-check .ui-icon { width: 16px; height: 16px; }
.music-setting-option .custom-select-option-check.is-empty { visibility: hidden; }
.music-prompt-composer .music-setting-select.is-disabled { cursor: not-allowed; opacity: .48; }
.music-lyrics-panel {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-bg-raised) 86%, transparent);
}
.music-lyrics-panel[hidden] { display: none; }
.music-lyrics-panel > header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border);
}
.music-lyrics-panel > header > span { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.music-lyrics-panel > header strong { color: var(--color-text); font-size: 12px; }
.music-lyrics-panel > header small { color: var(--color-text-muted); font-size: 10px; }
.music-lyrics-panel > header i { font-style: normal; }
.music-lyrics-panel textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 184px;
  max-height: 260px;
  resize: vertical;
  display: block;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  padding: 13px 14px 16px;
  font: inherit;
  font-size: 13px;
  line-height: 1.72;
}
.music-lyrics-panel textarea::placeholder { color: color-mix(in srgb, var(--color-text-muted) 76%, transparent); }
.music-lyrics-panel textarea:disabled { cursor: not-allowed; opacity: .5; }
.music-composer-error {
  margin: 0 18px 10px;
  border: 1px solid color-mix(in srgb, var(--color-danger) 42%, var(--color-border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  color: var(--color-danger);
  padding: 9px 12px;
  font-size: 11px;
  line-height: 1.5;
}
.music-composer-compact-summary { display: none; }

.music-prompt-composer.compact .music-fields-grid {
  display: none !important;
}

.music-prompt-composer.compact .music-composer-compact-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.music-prompt-composer.compact .music-composer-compact-summary-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-brand) 32%, var(--color-border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-brand) 9%, transparent);
  color: var(--color-brand);
}

.music-prompt-composer.compact .music-composer-compact-summary-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.music-prompt-composer.compact .music-composer-compact-summary-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.music-prompt-composer.compact .music-composer-compact-summary-copy strong {
  flex: 0 0 auto;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 650;
}

.music-prompt-composer.compact .music-composer-compact-summary-copy small {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767px) {
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].music-prompt-composer:not(.compact):not(.maximized) .composer-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 18px 14px 8px;
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].music-prompt-composer:not(.compact):not(.maximized) .prompt-entry {
    width: 100%;
  }
  body.client-body:has(.studio-shell.view-create) #taskForm[data-composer-surface="create"].music-prompt-composer:not(.compact):not(.maximized) .prompt-rich-editor {
    min-height: 92px;
    max-height: 180px;
    font-size: 16px;
    line-height: 1.65;
  }
  .music-fields-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .music-style-field { order: -1; }
  .music-style-field .prompt-rich-editor { min-height: 150px; font-size: 16px; line-height: 1.65; }
  .music-style-header { grid-template-columns: 28px minmax(0, 1fr); }
  .music-style-copy { display: grid; gap: 1px; }
  .music-style-copy small { white-space: normal; }
  .music-style-requirement { display: none; }
  .music-prompt-composer .music-setting-select { max-width: none; }
  .music-setting-menu { width: min(304px, calc(100vw - 24px)) !important; min-width: min(304px, calc(100vw - 24px)) !important; }
  .music-lyrics-panel { margin: 0; }
  .music-composer-error { margin: 10px 0 0; }
  .music-lyrics-panel textarea { min-height: 150px; }
}

/* Legacy selectors retained below are inert after music became a create-page
   mode, but removing their layout rules keeps old cached markup from changing
   the shared workspace columns. */
.client-body .studio-shell.view-music { grid-template-columns: 72px 0 minmax(0, 1fr); }
.client-body .studio-shell.view-music .conversation-sidebar {
  visibility: hidden;
  width: 0;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  padding-right: 0;
  padding-left: 0;
  border: 0;
  pointer-events: none;
}
.client-body .studio-shell.view-music .workspace { grid-column: 3; }
.client-body .studio-shell.view-music .workspace-toolbar { display: flex; }
.music-toolbar-model {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  color: var(--color-text);
}
.music-toolbar-model > .ui-icon { width: 17px; height: 17px; color: var(--color-brand); }
.music-toolbar-model > span { display: grid; gap: 1px; min-width: 0; }
.music-toolbar-model strong { max-width: 210px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.music-toolbar-model small { color: var(--color-text-muted); font-size: 10px; }
.music-stage {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  padding: 64px 42px 84px;
  background: var(--color-bg);
  color: var(--color-text);
  scroll-padding-bottom: 48px;
}
.music-heading {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.music-heading > div:first-child { min-width: 0; }
.music-heading > div:first-child > span {
  display: block;
  margin-bottom: 7px;
  color: var(--color-brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
}
.music-heading h1 { margin: 0; font-size: clamp(25px, 3vw, 36px); line-height: 1.12; }
.music-heading p { max-width: 660px; margin: 9px 0 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.65; }
.music-heading-price {
  flex: 0 0 auto;
  min-width: 158px;
  display: grid;
  justify-items: end;
  gap: 3px;
  padding-left: 22px;
  border-left: 1px solid var(--color-border);
}
.music-heading-price small { color: var(--color-text-muted); font-size: 11px; }
.music-heading-price strong { color: var(--color-brand); font-size: 20px; }
.music-heading-price s { color: var(--color-text-muted); font-size: 11px; }
.music-workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.music-form {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .72fr);
}
.music-editor-column { min-width: 0; display: grid; grid-template-rows: minmax(190px, .72fr) minmax(320px, 1.28fr); border-right: 1px solid var(--color-border); }
.music-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
}
.music-field:last-child { border-bottom: 0; }
.music-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.music-field-heading strong { font-size: 13px; }
.music-field-heading small { color: var(--color-text-muted); font-size: 10px; }
.music-field-heading i { font-style: normal; }
.music-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-bg-raised);
  color: var(--color-text);
  padding: 12px 13px;
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  outline: 0;
}
.music-prompt-field textarea { min-height: 120px; }
.music-lyrics-field textarea { min-height: 240px; }
.music-field textarea::placeholder { color: color-mix(in srgb, var(--color-text-muted) 76%, transparent); }
.music-field textarea:focus { border-color: color-mix(in srgb, var(--color-brand) 64%, var(--color-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand) 13%, transparent); }
.music-field textarea:disabled { cursor: not-allowed; opacity: .52; }
.music-field-note { min-height: 16px; color: var(--color-text-muted); font-size: 10px; }
.music-field.is-disabled .music-field-heading,
.music-control-group.is-disabled legend { opacity: .58; }
.music-settings-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 19px;
  background: var(--color-bg-raised);
}
.music-setting-field { display: grid; gap: 7px; }
.music-setting-field > span,
.music-control-group legend { color: var(--color-text); font-size: 12px; font-weight: 700; }
.music-setting-field select {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
}
.music-setting-field > small,
.music-control-group > small { color: var(--color-text-muted); font-size: 10px; line-height: 1.45; }
.music-control-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.music-control-group legend { margin-bottom: 7px; padding: 0; }
.music-segment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.music-segment-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.music-segment-grid button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.music-segment-grid button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--color-brand) 42%, var(--color-border)); color: var(--color-text); }
.music-segment-grid button.active { border-color: color-mix(in srgb, var(--color-brand) 58%, var(--color-border)); background: color-mix(in srgb, var(--color-brand) 12%, var(--color-surface)); color: var(--color-text); }
.music-segment-grid button:disabled { cursor: not-allowed; opacity: .48; }
.music-form-error {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--color-danger) 42%, var(--color-border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  color: var(--color-danger);
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.5;
}
.music-submit-panel { margin-top: auto; display: grid; gap: 12px; padding-top: 15px; border-top: 1px solid var(--color-border); }
.music-submit-panel > div { display: grid; gap: 3px; }
.music-submit-panel small { color: var(--color-text-muted); font-size: 10px; }
.music-submit-panel span { color: var(--color-text-muted); font-size: 11px; }
.music-submit-panel b { color: var(--color-brand); font-size: 14px; }
.music-submit-panel > button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: var(--color-brand);
  color: var(--color-brand-contrast, #071014);
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.music-submit-panel > button:hover:not(:disabled) { filter: brightness(1.06); }
.music-submit-panel > button:disabled { cursor: not-allowed; opacity: .46; }
.music-submit-panel > button .ui-icon { width: 16px; height: 16px; }
.music-history { width: min(1180px, 100%); margin: 34px auto 0; }
.music-history > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 0 2px; }
.music-history > header > div { display: flex; align-items: baseline; gap: 10px; }
.music-history h2 { margin: 0; font-size: 17px; }
.music-history > header span,
.music-history > header > small { color: var(--color-text-muted); font-size: 11px; }
.music-history .generation-feed { width: 100%; gap: 22px; }
.music-history .generation-item { border-color: var(--color-border); background: var(--color-surface); }
.music-history-empty {
  min-height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  text-align: center;
}
.music-history-empty > span { color: var(--color-brand); font-size: 24px; }
.music-history-empty strong { color: var(--color-text); font-size: 13px; }
.music-history-empty small { font-size: 11px; }
.task-detail-lyrics { max-height: 150px; overflow-y: auto; }

@media (max-width: 1279px) {
  .client-body .studio-shell.view-music { grid-template-columns: 64px 0 minmax(0, 1fr); }
  .music-stage { padding-right: 28px; padding-left: 28px; }
}

@media (max-width: 900px) {
  .music-form { grid-template-columns: 1fr; }
  .music-editor-column { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .music-settings-column { min-height: 0; }
}

@media (max-width: 820px) {
  .client-body .studio-shell.view-music { grid-template-columns: 64px minmax(0, 1fr); }
  .client-body .studio-shell.view-music .workspace { grid-column: 2; }
  .music-stage { padding: 76px 18px 78px; }
}

@media (max-width: 600px) {
  .client-body .studio-shell.view-music { grid-template-columns: 1fr; }
  .client-body .studio-shell.view-music .workspace { grid-column: 1; }
  .mobile-navigation { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .client-body .studio-shell.view-music .workspace-toolbar { top: 10px; right: 10px; left: 10px; }
  .music-toolbar-model { width: 100%; justify-content: center; }
  .music-stage { padding: 66px 12px 84px; }
  .music-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .music-heading-price { width: 100%; justify-items: start; padding-top: 10px; padding-left: 0; border-top: 1px solid var(--color-border); border-left: 0; }
  .music-field { padding: 16px 14px; }
  .music-settings-column { padding: 16px 14px; }
  .music-segment-grid.three { grid-template-columns: 1fr; }
  .music-segment-grid button { min-height: 40px; }
  .music-history { margin-top: 24px; }
  .music-history > header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .music-history .generation-feed { gap: 14px; }
}

/* 灵感广场分页：首屏 36 个，滑动到底部后点击按钮加载下一批。 */
.inspiration-gallery-more { display: flex; justify-content: center; padding: var(--space-5, 24px) 0 var(--space-2, 8px); }
.inspiration-more-button { min-width: 220px; padding: 10px 20px; border-radius: 8px; border: 1px solid var(--page-line-soft, rgba(148, 163, 184, 0.24)); background: transparent; color: var(--page-text-muted, inherit); font-size: 14px; line-height: 1.4; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.inspiration-more-button:hover:not(:disabled) { border-color: var(--color-brand, #6d5efc); color: var(--page-text, inherit); }
.inspiration-more-button:disabled { opacity: 0.6; cursor: default; }
.inspiration-more-done { color: var(--page-text-muted, inherit); font-size: 13px; }

/* Activity discovery and detail channel. The fixed cover colors are
   intentionally independent from the light/dark UI, while the detail body
   continues to use shared page tokens for readability. */
.activity-nav-summary {
  width: min(260px, 28vw);
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-base);
  background: var(--page-control-bg);
  color: var(--page-text-muted);
  padding: 0 12px;
  font-size: var(--font-caption);
  white-space: nowrap;
}
.activity-nav-summary i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4fc694;
  box-shadow: 0 0 0 3px rgba(79, 198, 148, .18);
}
.activity-catalog-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 30px 0 20px;
}
.activity-catalog-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--page-text-muted);
  font-size: 12px;
  font-weight: 650;
}
.activity-catalog-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-brand);
}
.activity-catalog-intro h2 {
  margin: 12px 0 0;
  color: var(--page-text);
  font-size: 26px;
  font-weight: 760;
  line-height: 1.2;
}
.activity-catalog-intro p {
  max-width: 560px;
  margin: 9px 0 0;
  color: var(--page-text-muted);
  font-size: 14px;
  line-height: 1.55;
}
.activity-catalog-count {
  flex: 0 0 auto;
  color: var(--page-text-subtle);
  font-size: 13px;
  font-weight: 650;
}
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.activity-card {
  overflow: hidden;
  border: 1px solid var(--page-line);
  border-radius: 18px;
  background: var(--page-surface-1);
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.activity-card:hover,
.activity-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--brand-border);
  box-shadow: var(--shadow-lg);
}
.activity-card:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}
.activity-card-cover {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #111;
}
.activity-cover-art {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 24px 22px;
  z-index: 2;
}
.activity-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .35s ease;
}
.activity-card:hover .activity-cover-image {
  transform: scale(1.05);
}
.activity-art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.36) 58%, rgba(0,0,0,.72) 100%);
  pointer-events: none;
}
.activity-art-kicker,
.activity-art-secondary,
.activity-art-chip,
.activity-art-corner,
.activity-art-bug,
.activity-art-price {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.activity-art-kicker,
.activity-art-corner {
  position: absolute;
  color: rgba(255, 255, 255, .68);
}
.activity-art-kicker {
  top: 22px;
  left: 24px;
}
.activity-art-corner {
  top: 24px;
  right: 24px;
}
.activity-art-primary {
  margin-top: auto;
  color: #fff;
  font-size: 38px;
  font-weight: 820;
  line-height: .95;
}
.activity-art-secondary {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, .66);
}
.activity-art-chip {
  position: absolute;
  right: 24px;
  bottom: 24px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  padding: 7px 11px;
  backdrop-filter: blur(8px);
}
.activity-art-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 34px 34px;
}
.activity-card-card-copy,
.activity-card-copy {
  padding: 17px 18px 15px;
}
.activity-card-eyebrow {
  color: var(--page-text-subtle);
  font-size: 11px;
  font-weight: 700;
}
.activity-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.activity-card-title-row h3 {
  min-width: 0;
  margin: 0;
  color: var(--page-text);
  font-size: 20px;
  font-weight: 730;
  line-height: 1.25;
}
.activity-card-title-row .ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--page-text-muted);
  transition: transform .2s ease, color .2s ease;
}
.activity-card:hover .activity-card-title-row .ui-icon,
.activity-card:focus-visible .activity-card-title-row .ui-icon {
  color: var(--color-brand);
  transform: translate(2px, -2px);
}
.activity-card-copy p {
  margin: 9px 0 15px;
  color: var(--page-text-muted);
  font-size: 13px;
  line-height: 1.55;
}
.activity-card-copy footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--page-line-soft);
  padding-top: 12px;
}
.activity-card-copy footer strong {
  color: var(--page-text);
  font-size: 13px;
  font-weight: 730;
}
.activity-card-copy footer span {
  color: var(--page-text-subtle);
  font-size: 11px;
}

.activity-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 17px;
  background: linear-gradient(180deg, rgba(2,5,10,.04) 0%, rgba(2,5,10,.55) 52%, rgba(2,5,10,.88) 100%);
  z-index: 2;
}
.activity-card-badge {
  position: absolute;
  top: 13px;
  left: 14px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(9,11,16,.56);
  color: rgba(255,255,255,.88);
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}
.activity-card-kicker {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  color: rgba(255,255,255,.64);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .04em;
}
.activity-card-cover h3 {
  position: relative;
  z-index: 3;
  margin: 0;
  color: #fff;
  font-size: 19px;
  font-weight: 780;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0,0,0,.34);
}
.activity-card-cover p {
  position: relative;
  z-index: 3;
  margin: 6px 0 9px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.45;
}
.activity-card-points {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 11px;
  padding: 0;
  list-style: none;
}
.activity-card-points li {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.84);
  padding: 4px 7px;
  font-size: 10px;
  white-space: nowrap;
}
.activity-card-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 10px;
}
.activity-card-footer strong {
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}
.activity-card-footer span {
  color: rgba(255,255,255,.64);
  font-size: 10px;
}
.activity-card-footer-arrow {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,.76);
}
.activity-card-footer-arrow .ui-icon {
  width: 16px;
  height: 16px;
}

.activity-card-partner .activity-card-cover { background: #04192a; }
.activity-cover-art-partner .activity-art-primary { color: #f3cb78; }
.activity-art-node {
  position: absolute;
  border: 1px solid rgba(243, 203, 120, .5);
  border-radius: 50%;
}
.activity-art-node.node-a { width: 78px; height: 78px; top: 62px; right: 94px; background: rgba(243, 203, 120, .09); }
.activity-art-node.node-b { width: 38px; height: 38px; top: 98px; right: 45px; background: rgba(243, 203, 120, .16); }
.activity-art-node.node-c { width: 16px; height: 16px; top: 40px; right: 55px; background: #f3cb78; }
.activity-art-path {
  position: absolute;
  border: 0;
  background: rgba(243, 203, 120, .28);
}
.activity-art-path.path-a { width: 82px; height: 1px; top: 100px; right: 94px; transform: rotate(-18deg); }
.activity-art-path.path-b { width: 48px; height: 1px; top: 114px; right: 43px; transform: rotate(48deg); }

.activity-card-beta .activity-card-cover,
.activity-detail-hero-beta .activity-detail-visual { background: #0a1510; }
.activity-cover-art-beta .activity-art-primary { color: #a5ff64; }
.activity-art-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  top: 118px;
  background: rgba(165, 255, 100, .5);
  box-shadow: 0 0 16px rgba(165, 255, 100, .24);
}
.activity-art-bug {
  position: absolute;
  left: 24px;
  bottom: 68px;
  color: rgba(165, 255, 100, .82);
}

.activity-card-price .activity-card-cover,
.activity-detail-hero-price .activity-detail-visual { background: #16110f; }
.activity-cover-art-price .activity-art-primary { color: #ff7454; }
.activity-art-axis {
  position: absolute;
  background: rgba(255, 116, 84, .2);
}
.activity-art-axis.axis-a { width: 190px; height: 1px; left: 42%; top: 78px; transform: rotate(-16deg); }
.activity-art-axis.axis-b { width: 120px; height: 1px; left: 40%; top: 112px; transform: rotate(-16deg); }
.activity-art-price {
  position: absolute;
  left: 42%;
  bottom: 84px;
  color: #9adcd0;
}

.activity-card-creator .activity-card-cover,
.activity-detail-hero-creator .activity-detail-visual { background: #072a29; }
.activity-cover-art-creator .activity-art-primary { color: #ffbe6c; }
.activity-art-sheet {
  position: absolute;
  width: 118px;
  height: 78px;
  border: 1px solid rgba(255, 190, 108, .22);
  border-radius: 7px;
  background: rgba(126, 246, 212, .04);
}
.activity-art-sheet.sheet-a { left: 39%; top: 46px; transform: rotate(-4deg); }
.activity-art-sheet.sheet-b { left: 52%; top: 70px; transform: rotate(6deg); background: rgba(255, 190, 108, .1); }
.activity-art-sheet.sheet-c { left: 45%; top: 104px; transform: rotate(0deg); border-color: rgba(126, 246, 212, .3); }
.activity-cover-art.is-detail .activity-art-primary { font-size: 54px; }
.activity-cover-art.is-detail { padding: 30px 30px 28px; }
.activity-cover-art.is-detail .activity-art-kicker { top: 30px; left: 30px; }
.activity-cover-art.is-detail .activity-art-corner { top: 32px; right: 30px; }
.activity-cover-art.is-detail .activity-art-chip { right: 30px; bottom: 30px; }

.activity-detail-stage {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: calc(88px + var(--home-content-offset, 0px)) 0 96px;
}
.activity-detail-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.activity-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-base);
  background: var(--page-control-bg);
  color: var(--page-text);
  padding: 9px 13px;
  font-size: 13px;
  cursor: pointer;
}
.activity-detail-back:hover,
.activity-detail-back:focus-visible {
  border-color: var(--brand-border);
  background: var(--brand-surface-soft);
}
.activity-detail-back .ui-icon {
  width: 17px;
  height: 17px;
}
.activity-detail-topbar-label,
.activity-detail-topbar-state {
  color: var(--page-text-subtle);
  font-size: 12px;
  font-weight: 650;
}
.activity-detail-topbar-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.activity-detail-topbar-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4fc694;
}
.activity-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--page-line);
  border-radius: 22px;
  background: var(--page-surface-1);
}
.activity-detail-visual {
  position: relative;
  min-height: 303px;
  align-self: start;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.activity-detail-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 38px;
}
.activity-detail-kicker,
.activity-detail-section > header span,
.activity-side-award span,
.activity-side-note span {
  color: var(--page-text-subtle);
  font-size: 11px;
  font-weight: 720;
}
.activity-detail-intro h1 {
  margin: 0;
  color: var(--page-text);
  font-size: 34px;
  font-weight: 780;
  line-height: 1.16;
}
.activity-detail-intro p {
  margin: 0;
  color: var(--page-text-muted);
  font-size: 15px;
  line-height: 1.65;
}
.activity-reward-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--brand-border-soft);
  border-radius: 14px;
  background: var(--brand-surface-soft);
  padding: 18px;
}
.activity-reward-card span {
  color: var(--page-text-muted);
  font-size: 12px;
}
.activity-reward-card strong {
  color: var(--page-text);
  font-size: 24px;
  font-weight: 780;
}
.activity-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: auto;
}
.activity-primary-action,
.activity-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-base);
  background: var(--color-brand);
  color: var(--color-brand-contrast, #071014);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 730;
  cursor: pointer;
}
.activity-secondary-action {
  border: 1px solid var(--page-line-strong);
  background: transparent;
  color: var(--page-text);
}
.activity-primary-action:hover:not(:disabled),
.activity-secondary-action:hover:not(:disabled) {
  filter: brightness(1.08);
}
.activity-primary-action .ui-icon,
.activity-secondary-action .ui-icon {
  width: 17px;
  height: 17px;
}
.activity-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}
.activity-detail-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.activity-detail-section {
  border: 1px solid var(--page-line);
  border-radius: 18px;
  background: var(--page-surface-1);
  padding: 24px;
}
.activity-detail-section > header {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}
.activity-detail-section > header h2 {
  margin: 0;
  color: var(--page-text);
  font-size: 20px;
  font-weight: 750;
}
.activity-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.activity-highlight,
.activity-step {
  border: 1px solid var(--page-line-soft);
  border-radius: 13px;
  background: var(--page-surface-2);
  padding: 16px;
}
.activity-highlight > span,
.activity-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-surface-soft);
  color: var(--color-brand);
  font-size: 12px;
  font-weight: 760;
}
.activity-highlight div,
.activity-step div {
  margin-top: 12px;
}
.activity-highlight strong,
.activity-step strong {
  display: block;
  color: var(--page-text);
  font-size: 15px;
  font-weight: 740;
}
.activity-highlight p,
.activity-step p {
  margin: 7px 0 0;
  color: var(--page-text-muted);
  font-size: 13px;
  line-height: 1.55;
}
.activity-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.activity-detail-rules ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity-detail-rules li {
  position: relative;
  color: var(--page-text-muted);
  font-size: 13px;
  line-height: 1.65;
  padding-left: 20px;
}
.activity-detail-rules li + li {
  margin-top: 11px;
}
.activity-detail-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--color-brand);
  opacity: .68;
}
.activity-detail-aside {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 14px;
}
.activity-side-award,
.activity-side-note {
  overflow: hidden;
  border: 1px solid var(--page-line);
  border-radius: 18px;
  background: var(--page-surface-1);
  padding: 22px;
}
.activity-side-award {
  border-color: var(--brand-border-soft);
  background: linear-gradient(148deg, rgba(109, 94, 252, .1), transparent 46%), var(--page-surface-1);
}
.activity-side-award span,
.activity-side-note span {
  display: block;
  margin-bottom: 12px;
}
.activity-side-award strong {
  display: block;
  color: var(--page-text);
  font-size: 25px;
  font-weight: 780;
  line-height: 1.15;
}
.activity-side-award p {
  margin: 9px 0 0;
  color: var(--page-text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.activity-side-award-line {
  height: 1px;
  margin: 18px 0 14px;
  background: var(--page-line);
}
.activity-side-award small {
  color: var(--page-text-subtle);
  font-size: 11px;
}
.activity-side-note strong {
  display: block;
  color: var(--page-text);
  font-size: 18px;
  font-weight: 760;
}
.activity-side-note p {
  margin: 9px 0 16px;
  color: var(--page-text-muted);
  font-size: 13px;
  line-height: 1.55;
}
.activity-side-note button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--page-line);
  border-radius: var(--radius-base);
  background: var(--page-control-bg);
  color: var(--page-text);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.activity-side-note button:hover {
  border-color: var(--brand-border);
  color: var(--color-brand);
}
.activity-side-note .ui-icon {
  width: 16px;
  height: 16px;
}

.activity-modal-backdrop {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 10, .72);
  backdrop-filter: blur(9px);
}
.activity-modal {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(90vh, 940px);
  overflow: hidden;
  border: 1px solid var(--page-line);
  border-radius: 22px;
  background: var(--page-surface-1);
  box-shadow: var(--shadow-lg);
}
.activity-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(5, 8, 12, .56);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.activity-modal-close .ui-icon {
  width: 18px;
  height: 18px;
}
.activity-modal-scroll {
  max-height: min(90vh, 940px);
  overflow-y: auto;
  padding: 20px 20px 24px;
}
.activity-modal .activity-detail-hero {
  margin-bottom: 18px;
}
.activity-modal .activity-detail-layout {
  margin-top: 0;
}
.activity-modal .activity-detail-visual {
  min-height: 0;
  aspect-ratio: 3 / 2;
  object-position: left center;
}
.activity-modal .activity-detail-intro {
  padding: 30px;
}
.activity-modal .activity-detail-section {
  padding: 20px;
}
.activity-modal .activity-art-corner {
  display: none;
}

@media (max-width: 1100px) {
  .activity-nav-summary { width: min(220px, 24vw); }
  .activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-modal-backdrop { align-items: start; padding: 12px; }
  .activity-modal { max-height: 94vh; }
  .activity-modal-scroll { max-height: 94vh; padding: 14px 14px 18px; }
  .activity-modal .activity-detail-visual { min-height: 250px; }
  .activity-modal .activity-detail-intro { padding: 22px; }
  .activity-highlight-grid,
  .activity-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .activity-grid,
  .activity-detail-hero,
  .activity-detail-layout { grid-template-columns: 1fr; }
  .activity-catalog-intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .activity-detail-visual { min-height: 300px; }
  .activity-detail-intro { padding: 26px; }
  .activity-detail-intro h1 { font-size: 28px; }
  .activity-detail-aside { position: static; }
}
@media (max-width: 640px) {
  .activity-grid { grid-template-columns: 1fr; }
  .activity-highlight-grid,
  .activity-steps { grid-template-columns: 1fr; }
  .activity-card-title-row h3 { font-size: 18px; }
  .activity-art-primary { font-size: 30px; }
  .activity-cover-art.is-detail .activity-art-primary { font-size: 40px; }
}
.activity-detail-visual .activity-cover-image { object-position: left center; }
/* Digital human stable workbench */
.digital-human-panel.assets-panel,
.digital-human-panel.content-panel {
  height: min(calc(100dvh - var(--client-secondary-stage-top, 104px) - 150px), 860px);
  min-height: unset;
  overflow-y: auto;
}
.digital-human-option-grid { grid-template-columns: 1fr; }
.digital-human-voice-grid { max-height: min(38vh, 260px); }
.digital-human-workspace { grid-template-columns: minmax(400px, 1fr) minmax(480px, 1.3fr) minmax(300px, .75fr); align-items: start; }
.digital-human-panel { min-height: 0; }
.digital-human-option-grid { grid-template-columns: minmax(230px, 1fr); max-width: 520px; }
.digital-human-option-grid .segmented button { min-height: 34px; font-size: 12px; }
.digital-human-duration-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.digital-human-duration-grid button { min-width: 52px; min-height: 30px; padding: 0 8px; font-size: 12px; }

body.client-body:has(.studio-shell.view-digitalHuman) .creative-stage { display: none; }
