/* Creator workspace. Loaded after the legacy portal styles; no admin selectors. */
html.portal-studio {
  --sa-bg: #f3f5f9;
  --sa-bg-2: #e9edf5;
  --sa-card: #ffffff;
  --sa-soft: #f5f7fb;
  --sa-soft-2: #e9eef7;
  --sa-ink: #202b42;
  --sa-ink-2: #42516b;
  --sa-muted: #606f86;
  --sa-line: #dfe5ef;
  --sa-line-2: #ebeff5;
  --sa-brand: #3458d4;
  --sa-brand-soft: #eaf0ff;
  --sa-brand-line: #b9c9f9;
  --sa-grad: #3458d4;
  --sa-r: 14px;
  --sa-sh-sm: 0 2px 4px #22365604;
  --sa-sh-md: 0 14px 40px #22365612;
  --tblr-primary: #3458d4;
  --tblr-primary-rgb: 52, 88, 212;
  --tblr-link-color: #3458d4;
  --tblr-link-hover-color: #2344b0;
  --sa-font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --sa-display: "Segoe UI Variable Display", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
html.portal-studio[data-bs-theme="dark"] {
  --sa-bg: #141a26;
  --sa-bg-2: #1b2332;
  --sa-card: #1e2737;
  --sa-soft: #242f43;
  --sa-soft-2: #303d54;
  --sa-ink: #edf2ff;
  --sa-ink-2: #c4cfe4;
  --sa-muted: #a0afc7;
  --sa-line: #354158;
  --sa-line-2: #2b374b;
  --sa-brand: #a7bbff;
  --sa-brand-soft: #2a395c;
  --sa-brand-line: #536aa4;
  --sa-grad: #4565df;
  --sa-sh-sm: 0 2px 5px #060c191c;
  --sa-sh-md: 0 14px 40px #060c1940;
  --tblr-primary: #a7bbff;
  --tblr-primary-rgb: 167, 187, 255;
  --tblr-link-color: #a7bbff;
  --tblr-link-hover-color: #c8d5ff;
}
.portal-studio body { font-family: var(--sa-font); font-size: 14px; line-height: 1.6; }
.portal-studio button, .portal-studio input, .portal-studio textarea, .portal-studio select { font-family: inherit; }
.portal-studio ::selection { background: var(--sa-brand-line); color: var(--sa-ink); }
.portal-studio :focus-visible { outline: 3px solid var(--sa-brand); outline-offset: 3px; }
.portal-studio .sa-skip { position: fixed; top: -100px; left: 16px; z-index: 2000; padding: 12px 20px; background: var(--sa-card); color: var(--sa-brand); border-radius: 8px; }
.portal-studio .sa-skip:focus { top: 12px; }
.portal-studio .sa-skip:not(:focus) { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.portal-studio .container-xl { max-width: 1520px; padding-inline: 32px; }
.portal-studio .page-body { margin-top: 28px; }
.portal-studio .page-wrapper { min-width: 0; }
.portal-studio .navbar-vertical { border-right: 1px solid var(--sa-line); background: var(--sa-card); }
.portal-studio .navbar-vertical .container-fluid { padding: 24px 16px; }
.portal-studio .navbar-vertical .navbar-brand { padding: 0 8px 24px !important; }
.portal-studio .sa-brand { gap: 10px; font-family: var(--sa-display); font-size: 17px; font-weight: 700; }
.portal-studio .sa-brand small { margin-top: 5px; font: 11px/1.4 var(--sa-font); color: var(--sa-muted); }
.portal-studio .sa-studio-mark { background: var(--sa-grad); color: #fff; border-radius: 11px; box-shadow: none; position: relative; }
.portal-studio .sa-studio-mark::after { content: ""; position: absolute; inset: 6px; border: 1px solid #ffffff70; border-radius: 4px; }
.portal-studio .sa-studio-mark .ti { font-size: 19px; }
.portal-studio .sa-studio-mark img { filter: hue-rotate(-15deg); }
.portal-studio .sa-logo { width: 36px; height: 36px; }
.portal-studio .sa-nav-cap { padding: 8px 12px; font-size: 11px; font-weight: 500; }
.portal-studio .sa-nav-account { margin-top: 22px; }
.portal-studio .navbar-vertical .navbar-nav { width: 100%; gap: 3px; }
.portal-studio .navbar-vertical .navbar-nav .nav-link { position: relative; min-height: 44px; margin: 0; padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; }
.portal-studio .navbar-vertical .navbar-nav .nav-link.active { color: var(--sa-brand); background: var(--sa-brand-soft); font-weight: 650; }
.portal-studio .navbar-vertical .navbar-nav .nav-link.active::after { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; margin-left: auto; }
.portal-studio .navbar-vertical .navbar-nav .nav-link .nav-link-icon { font-size: 19px; opacity: 1; margin-right: 12px; }
.portal-studio .sa-nav-sep { margin-block: 14px; }
.portal-studio .sa-topbar, .portal-studio .sa-topbar-in { min-height: 64px; }
.portal-studio .sa-topbar { background: var(--sa-card); }
.portal-studio .sa-topbar-title { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.portal-studio .sa-topbar-title > .ti { font-size: 17px; }
.portal-studio #saPageTitle { color: var(--sa-ink-2); }
.portal-studio .sa-iconbtn { width: 36px; height: 36px; border-radius: 9px; background: transparent; border-color: transparent; }
.portal-studio .sa-sidebar-toggle { display: none; flex: none; }
.portal-studio .sa-sidebar-toggle:hover { background: var(--sa-brand-soft); color: var(--sa-brand); }
.portal-studio[data-sidebar-collapsed="1"] .sa-sidebar-arrow { transform: translateX(29px) scaleX(-1); }
.portal-studio .sa-user { border-color: var(--sa-line); border-radius: 20px; padding: 4px 12px 4px 5px; background: transparent; font-weight: 500; }
.portal-studio .sa-avatar { border-radius: 50%; background: var(--sa-brand-soft); color: var(--sa-brand); }
.portal-studio .sa-pagehead { margin-bottom: 24px; }
.portal-studio .sa-pagehead h2 { font-family: var(--sa-display); font-size: 28px; font-weight: 650; line-height: 1.4; }
.portal-studio .sa-page-description { margin: 7px 0 0; color: var(--sa-muted); font-size: 13px; line-height: 1.65; }
.portal-studio .sa-panel .card { background: var(--sa-card); border: 1px solid var(--sa-line); border-radius: var(--sa-r); box-shadow: var(--sa-sh-sm); overflow: hidden; }
.portal-studio .sa-panel .card-header { padding: 18px 20px; min-height: 66px; border-bottom: 1px solid var(--sa-line-2); gap: 8px; }
.portal-studio .sa-panel .card-body { padding: 20px; }
.portal-studio .card-title { font-size: 15px; font-weight: 650; gap: 9px; }
.portal-studio .sa-card-sub { color: var(--sa-muted); font-size: 11px; }
.portal-studio .sa-ctic { width: 28px; height: 28px; border-radius: 8px; color: var(--sa-brand); background: var(--sa-brand-soft); font-size: 17px; }
.portal-studio .sa-btn { min-height: 38px; padding: 8px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s; }
.portal-studio .sa-btn-primary { background: var(--sa-grad); color: #fff; }
.portal-studio .sa-btn-primary:hover:not(:disabled) { background: #294ac0; }
.portal-studio .sa-btn:disabled { opacity: .45; cursor: not-allowed; }
.portal-studio .sa-refreshing { color: var(--sa-brand); background: var(--sa-brand-soft); cursor: progress; }
.portal-studio .sa-refreshing > .ti { animation: studio-refresh .8s linear infinite; }
@keyframes studio-refresh { to { transform: rotate(360deg); } }
.portal-studio .form-label { font-size: 12px; font-weight: 600; color: var(--sa-ink-2); margin-bottom: 7px; }
.portal-studio .form-control, .portal-studio .form-select { min-height: 42px; border-radius: 8px; border-color: var(--sa-line); background-color: var(--sa-card); color: var(--sa-ink); font-size: 13px; box-shadow: none; }
.portal-studio textarea.form-control { line-height: 1.85; padding: 13px 14px; }
.portal-studio .form-control::placeholder { color: var(--sa-muted); opacity: 1; }
.portal-studio .form-control:focus, .portal-studio .form-select:focus { border-color: var(--sa-brand); box-shadow: 0 0 0 3px var(--sa-brand-soft); }
.portal-studio .sa-prompt-editor textarea { min-height: 170px; padding: 14px 48px 28px 14px; background: var(--sa-soft); }
.portal-studio .sa-prompt-expand { width: 30px; height: 30px; top: 8px; right: 8px; border-radius: 7px; color: var(--sa-muted); }
.portal-studio .sa-count { font-size: 11px; bottom: 8px; right: 12px; }
.portal-studio .sa-drop { border: 1px dashed var(--sa-brand-line); background: var(--sa-soft); border-radius: 10px; padding: 16px; }
.portal-studio .sa-drop > .d-flex { align-items: flex-start !important; }
.portal-studio .sa-drop-hint { font-size: 11px; line-height: 1.7; flex-basis: 100%; color: var(--sa-muted); }
.portal-studio .sa-thumbs:empty { margin: 0; }
.portal-studio .sa-submit-bar { padding-top: 18px; margin-top: 20px !important; border-top: 1px solid var(--sa-line-2); }
.portal-studio .sa-submit-bar > .sa-btn-primary { min-height: 46px; width: 100%; flex-basis: 100%; }
.portal-studio .sa-submit-bar > .sa-chip { background: transparent; border: 0; padding: 2px 0 0; width: 100%; text-align: center; display: block; color: var(--sa-muted); font-weight: 400; font-size: 12px; }
.portal-studio .sa-hint, .portal-studio .sa-neterr { border-radius: 9px; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.portal-studio .sa-neterr.show { align-items: center; }
.portal-studio .sa-neterr > span { flex: 1; min-width: 0; }
.portal-studio .sa-toast { border-radius: 10px; line-height: 1.6; box-shadow: var(--sa-sh-md); max-width: calc(100vw - 32px); }
.portal-studio .sa-pill { border-radius: 6px; font-size: 11px; padding: 4px 8px; }
.portal-studio .sa-chip { border-radius: 5px; font-size: 11px; font-weight: 400; }
.portal-studio .sa-live { border-radius: 6px; font-size: 11px; }
.portal-studio .sa-dl { min-height: 34px; padding: 6px 10px; border-radius: 7px; font-size: 12px; }
.portal-studio .sa-empty { padding: 60px 20px; display: grid; justify-items: center; gap: 7px; }
.portal-studio .sa-empty > .ti { display: grid; place-items: center; margin-bottom: 7px; background: var(--sa-soft); color: var(--sa-brand); width: 64px; height: 64px; border: 1px solid var(--sa-line); border-radius: 18px; opacity: 1; font-size: 26px; }
.portal-studio .sa-empty .t { font-size: 14px; font-weight: 600; }
.portal-studio .sa-empty p { display: block; max-width: 270px; margin: 0; color: var(--sa-muted); line-height: 1.8; font-size: 12px; }
.portal-studio #panel-video .sa-table, .portal-studio #panel-jobs .sa-table { min-width: 0; }
.portal-studio .sa-table thead th { color: var(--sa-muted); font-size: 11px; font-weight: 500; background: var(--sa-soft); }
.portal-studio .sa-table tbody td { font-size: 12px; }
.portal-studio :is(.sa-task-feed, .sa-task-history) .sa-chip { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-studio .sa-table .sa-errtxt { font-size: 12px; }
.portal-studio .table-responsive { border-bottom: 0; }
/* Latest tasks read as a compact production queue. Keep the table semantics. */
.portal-studio .sa-task-feed { display: block; }
.portal-studio .sa-task-feed thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.portal-studio .sa-task-feed tbody { display: block; }
.portal-studio .sa-task-feed tr { display: block; }
.portal-studio .sa-task-feed tr.sa-job-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "time status" "prompt prompt" "config config" "result result"; gap: 9px 12px; padding: 18px 20px; border-bottom: 1px solid var(--sa-line-2); }
.portal-studio .sa-task-feed td { display: block; padding: 0; border: 0; min-width: 0; }
.portal-studio .sa-job-time { grid-area: time; font-variant-numeric: tabular-nums; }
.portal-studio .sa-job-status { grid-area: status; }
.portal-studio .sa-job-config { grid-area: config; }
.portal-studio .sa-job-prompt { grid-area: prompt; }
.portal-studio .sa-job-result { grid-area: result; }
.portal-studio .sa-task-feed .sa-prompt { max-width: none; white-space: normal; overflow-wrap: anywhere; font-size: 13px; line-height: 1.75; color: var(--sa-ink); }
.portal-studio .sa-task-feed .sa-empty { padding-block: 90px; }
.portal-studio .sa-task-history { table-layout: fixed; }
.portal-studio .sa-task-history th:nth-child(1) { width: 100px; }
.portal-studio .sa-task-history th:nth-child(2) { width: 100px; }
.portal-studio .sa-task-history th:nth-child(3) { width: 21%; }
.portal-studio .sa-task-history th:nth-child(5) { width: 23%; }
.portal-studio .sa-task-history .sa-prompt { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.75; }
.portal-studio .sa-task-filters { padding-bottom: 16px !important; }
.portal-studio #overview { border: 1px solid var(--sa-line); border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.portal-studio .sa-stat { padding: 22px; }
.portal-studio .sa-stat-vl { font-family: var(--sa-display); font-size: 30px; }
.portal-studio .sa-stat-ic { color: var(--sa-brand); }
.portal-studio .sa-quick { padding: 20px; min-height: 90px; border: 1px solid var(--sa-line); border-radius: 12px; background: var(--sa-card); }
.portal-studio .sa-quick small { display: block; margin-top: 4px; }
.portal-studio .sa-quick .sa-ctic { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.portal-studio .sa-integration-notice { border-radius: 10px; }
.portal-studio .ia-jobs-grid { gap: 12px; }
.portal-studio .ia-jc { border-radius: 10px; }
.portal-studio .ia-jc-body { padding: 12px; gap: 8px; }
.portal-studio .ia-jc-err { max-height: none; line-height: 1.65; }
.portal-studio .ia-jc-meta { font-size: 11px; }
.portal-studio .ia-jc-del { width: 30px; height: 30px; line-height: 30px; border-radius: 8px; }
.portal-studio .sa-footer { padding: 20px 32px; font-size: 11px; color: var(--sa-muted); }
.portal-studio .footer { margin-top: 12px; }
.portal-studio .auth-card { border-radius: 18px; padding: 36px; border-color: var(--sa-line); box-shadow: var(--sa-sh-md); }
.portal-studio .auth-logo { display: grid; place-items: center; }
.portal-studio .auth-logo .ti { font-size: 30px; }
.portal-studio .auth-card h1 { font-family: var(--sa-display); font-weight: 650; font-size: 25px; }
.portal-studio .auth-sub { color: var(--sa-muted); }
.portal-studio .auth-foot { color: var(--sa-muted); }
.portal-studio #panel-multiref .mr-layout { gap: 20px; }
.portal-studio #panel-multiref .mr-layout > div { min-width: 0; padding: 20px; border: 1px solid var(--sa-line); border-radius: 14px; background: var(--sa-card); }
.portal-studio #panel-multiref .mr-history { padding: 20px; border-left: 1px solid var(--sa-line); }
.portal-studio #panel-multiref .mr-upload { border-radius: 9px; }
.portal-studio #panel-multiref .mr-notice { border-radius: 0 8px 8px 0; font-size: 12px; }
@media (min-width: 992px) {
  .portal-studio .navbar-vertical { width: 224px; }
  .portal-studio .navbar-vertical ~ .page-wrapper, .portal-studio .navbar-vertical ~ .sa-topbar { margin-left: 224px; }
  .portal-studio .sa-sidebar-toggle { display: inline-flex; }
  .portal-studio[data-sidebar-collapsed="1"] #portalSidebar { display: none !important; }
  .portal-studio[data-sidebar-collapsed="1"] #portalSidebar ~ .page-wrapper,
  .portal-studio[data-sidebar-collapsed="1"] #portalSidebar ~ .sa-topbar { margin-left: 0; }
  .portal-studio[data-sidebar-collapsed="1"] .page-wrapper .container-xl { max-width: none; }
}
@media (min-width: 1200px) {
  .portal-studio #panel-video > .row, .portal-studio #panel-imageai > .row { --tblr-gutter-x: 20px; }
  .portal-studio #panel-video > .row > :first-child, .portal-studio #panel-imageai > .row > :first-child { width: 44%; padding-inline: 10px; }
  .portal-studio #panel-video > .row > :last-child, .portal-studio #panel-imageai > .row > :last-child { width: 56%; padding-inline: 10px; border: 0; }
}
@media (max-width: 1199.98px) and (min-width: 992px) {
  .portal-studio #panel-imageai > .row > div { width: 100%; }
  .portal-studio .container-xl { padding-inline: 24px; }
}
@media (max-width: 991.98px) {
  .portal-studio .navbar-vertical .container-fluid { padding: 8px 16px; grid-template-columns: 40px minmax(0, 1fr) 88px; gap: 6px; }
  .portal-studio .navbar-vertical .navbar-brand { padding: 0 !important; }
  .portal-studio .navbar-vertical .navbar-toggler { width: 40px; height: 44px; padding: 8px; border-radius: 8px; }
  .portal-studio .navbar-vertical .navbar-collapse { width: 100%; }
  .portal-studio .navbar-vertical .navbar-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 0 !important; }
  .portal-studio .sa-nav-cap, .portal-studio #saNav > li:has(.sa-nav-sep) { grid-column: 1 / -1; }
  .portal-studio .sa-nav-cap { padding: 4px 12px; }
  .portal-studio .sa-nav-account { margin-top: 8px; }
  .portal-studio .sa-nav-sep { margin-block: 4px; }
  .portal-studio .sa-brand { font-size: 15px; gap: 8px; }
  .portal-studio .sa-logo { width: 30px; height: 32px; border-radius: 8px; }
  .portal-studio .sa-topbar { top: 8px; right: 16px; width: 88px; min-height: 44px; background: transparent; }
  .portal-studio .sa-topbar-title { display: none; }
  .portal-studio .sa-topbar-in { min-height: 44px; padding: 0; }
  .portal-studio .sa-topbar-right { gap: 0; }
  .portal-studio .sa-iconbtn, .portal-studio .sa-topbar .sa-iconbtn { width: 44px; height: 44px; }
  .portal-studio .container-xl { padding-inline: 16px; }
  .portal-studio .page-body { margin-top: 14px; }
  .portal-studio .sa-pagehead { margin-bottom: 12px; }
  .portal-studio .sa-pagehead h2 { font-size: 24px; }
  .portal-studio .sa-page-description { font-size: 12px; }
  .portal-studio .sa-panel .card-header { padding: 10px 14px; min-height: 50px; }
  .portal-studio .sa-panel .card-body { padding: 14px; }
  .portal-studio .sa-btn, .portal-studio .sa-dl { min-height: 44px; }
  .portal-studio .form-control, .portal-studio .form-select { min-height: 46px; font-size: 16px; }
  .portal-studio .sa-prompt-editor textarea { min-height: 170px; font-size: 15px; padding-right: 52px; }
  .portal-studio .sa-prompt-expand { width: 44px; height: 44px; min-width: 44px; min-height: 44px; top: 6px; right: 6px; }
  .portal-studio .sa-drop { padding: 14px; }
  .portal-studio .sa-submit-bar { margin-top: 18px !important; padding-top: 16px; }
  .portal-studio .sa-submit-bar > .sa-btn-primary { min-height: 48px; }
  .portal-studio .sa-empty { padding: 48px 16px; }
  .portal-studio .sa-task-feed .sa-empty { padding-block: 48px; }
  .portal-studio .sa-task-feed tr.sa-job-row { padding: 16px; }
  .portal-studio .sa-task-history, .portal-studio .sa-task-history tbody, .portal-studio .sa-task-history tr { display: block; }
  .portal-studio .sa-task-history thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .portal-studio .sa-task-history tr.sa-job-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "time status" "prompt prompt" "config config" "result result"; gap: 10px 12px; padding: 16px; border-bottom: 1px solid var(--sa-line); }
  .portal-studio .sa-task-history td { display: block; padding: 0; min-width: 0; border: 0; }
  .portal-studio .sa-task-history .sa-prompt { font-size: 13px; }
  .portal-studio .sa-task-filters { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .portal-studio .sa-task-filters > span:first-child { grid-column: 1 / -1; }
  .portal-studio .sa-task-filters input { width: 100% !important; min-width: 0; }
  .portal-studio .sa-task-filters #jobsDateApply { grid-column: 1 / 3; }
  .portal-studio .sa-stat { padding: 18px 14px; }
  .portal-studio .sa-quick { padding: 14px; min-height: 88px; gap: 10px; }
  .portal-studio .sa-quick::after { display: none; }
  .portal-studio .sa-quick b { font-size: 13px; }
  .portal-studio .sa-quick small { font-size: 10px; }
  .portal-studio .sa-footer { padding: 16px; }
  .portal-studio #panel-multiref .mr-layout > div { padding: 16px; }
}
@media (max-width: 420px) {
  .portal-studio .sa-brand { font-size: 14px; }
  .portal-studio .sa-brand small { display: none; }
  .portal-studio .sa-card-sub { font-size: 10px; }
  .portal-studio .sa-page-description { display: none; }
  .portal-studio .sa-task-filters input { font-size: 14px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-studio *, .portal-studio *::before, .portal-studio *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
