:root { color-scheme: light; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #17212b; --ink: #17212b; --muted: #6e7b87; --line: #e2e8ed; --blue: #2368d5; --teal: #13a891; --coral: #ed775d; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f5f7fa; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.boot-shell { min-height: 100vh; display: grid; place-items: center; background: #f5f7fa; color: #17212b; }
.theme-dark .boot-shell { background: #191f1d; color: #f4f7f5; }
.boot-brand { display: grid; justify-items: center; gap: 12px; }
.boot-brand img { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; }
.boot-brand strong { font-size: 22px; }
.boot-brand small { color: #6e7b87; }
.theme-dark .boot-brand small { color: #aeb9b4; }
.boot-spinner { width: 24px; height: 24px; border: 2px solid rgba(110, 123, 135, .25); border-top-color: #13a891; border-radius: 50%; animation: boot-spin .7s linear infinite; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; background: white; }
.brand-panel { position: relative; overflow: hidden; padding: 42px 54px; color: white; background: #172d3d; display: flex; flex-direction: column; justify-content: space-between; }
.brand-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, transparent 25%, rgba(19,168,145,.32), transparent 72%); pointer-events: none; }
.brand-lockup { display: flex; align-items: center; gap: 12px; font-size: 22px; position: relative; z-index: 1; }
.brand-lockup img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.brand-copy { position: relative; z-index: 1; max-width: 520px; padding: 12vh 0; }
.brand-copy h1 { margin: 0 0 16px; font-size: 48px; line-height: 1.15; letter-spacing: 0; }
.brand-copy p { margin: 0; font-size: 18px; line-height: 1.8; color: #c9d8e0; }
.art-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; position: relative; z-index: 1; transform: rotate(-8deg) translate(28px, 28px); }
.art-grid span { display: block; aspect-ratio: 1; background: #13a891; border: 1px solid rgba(255,255,255,.18); }
.art-grid span:nth-child(2) { background: #ed775d; } .art-grid span:nth-child(3) { background: #efbf4e; } .art-grid span:nth-child(4) { background: #3676cf; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-box { width: min(420px, 100%); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #eef2f5; border-radius: 8px; margin-bottom: 38px; }
.segmented button { border: 0; padding: 10px; background: transparent; color: var(--muted); border-radius: 6px; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(20,36,48,.1); font-weight: 700; }
.auth-box h2 { font-size: 28px; margin: 0 0 8px; } .subtle { color: var(--muted); margin: 0 0 30px; }
label { display: grid; gap: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
input, textarea, select { border: 1px solid #ccd6dd; border-radius: 7px; background: white; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
input { height: 46px; padding: 0 13px; } input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35,104,213,.12); }
.primary { border: 0; border-radius: 7px; background: var(--blue); color: white; font-weight: 700; padding: 12px 20px; } .primary:hover { background: #1958ba; } .wide { width: 100%; }
.primary:disabled { cursor: not-allowed; background: #aab6c3; color: #f5f7fa; }
.error { color: #c34134; min-height: 20px; font-size: 13px; }
.error.success { color: #1f7a65; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.verification-row input { min-width: 0; }
.verification-row .secondary { height: 46px; white-space: nowrap; }
.auth-text-button { display: block; margin: 8px auto 0; border: 0; background: transparent; color: var(--blue); font-size: 13px; cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 18px; background: #152a39; color: white; display: flex; flex-direction: column; }
.brand-lockup.small { padding: 0 8px 26px; font-size: 19px; } .brand-lockup.small img { width: 34px; height: 34px; }
nav { display: grid; gap: 6px; } .nav-item { display: flex; gap: 12px; align-items: center; height: 44px; border: 0; border-radius: 6px; padding: 0 14px; background: transparent; color: #b9c9d2; text-align: left; }
.nav-item.active, .nav-item:hover { background: #254353; color: white; } .nav-item span { width: 20px; text-align: center; color: #59cbb7; }
.user-card { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #2c4654; display: grid; grid-template-columns: 36px 1fr 28px; gap: 10px; align-items: center; min-width: 0; }
.user-card > span { width: 36px; height: 36px; display: grid; place-items: center; background: var(--teal); border-radius: 50%; font-weight: 700; } .user-card div { min-width: 0; } .user-card strong, .user-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .user-card small { color: #94aab6; margin-top: 3px; } .user-card button { border: 0; color: #9fb2bc; background: transparent; font-size: 19px; }
.workspace { min-width: 0; padding: 0 38px 48px; }
header { height: 94px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 28px; } header h1 { font-size: 22px; margin: 0 0 4px; } header p { margin: 0; color: var(--muted); font-size: 13px; }
.credit-button { margin-left: auto; display: grid; grid-template-columns: auto auto; gap: 0 10px; border: 1px solid var(--line); background: white; border-radius: 7px; padding: 9px 13px; text-align: left; color: var(--muted); } .credit-button strong { color: var(--coral); } .credit-button small { grid-column: 1 / -1; margin-top: 3px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: white; border-radius: 6px; font-size: 21px; color: var(--muted); } #menuButton { display: none; }
.mode-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); } .mode-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 12px 18px; color: var(--muted); } .mode-tabs button.active { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.composer { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: 0 8px 28px rgba(22,40,53,.05); }
.composer-top { display: grid; grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto; align-items: start; gap: 14px; } .composer-heading { min-width: 0; } .eyebrow { color: var(--teal); font-weight: 700; font-size: 12px; } .composer h2 { font-size: 18px; margin: 6px 0 18px; }
.composer-assets { min-width: 0; display: flex; align-items: flex-start; gap: 10px; overflow: hidden; }
.selected-asset-strip { min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 5px; }
.selected-asset { position: relative; flex: 0 0 72px; display: grid; gap: 3px; }
.selected-asset-preview { width: 72px; height: 58px; display: grid; place-items: center; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #edf4fa; color: var(--blue); font-size: 11px; }
.selected-asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.selected-asset small { color: var(--muted); font-size: 11px; text-align: center; }
.selected-asset-remove { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 1px solid #d9e0e5; border-radius: 50%; background: white; color: #c34134; line-height: 1; }
.composer-asset-actions { flex: 0 0 auto; display: grid; gap: 6px; }
.composer-asset-button { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; min-height: 32px; margin: 0; padding: 6px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.composer-asset-button.disabled { opacity: .55; cursor: not-allowed; }
textarea { width: 100%; min-height: 180px; padding: 15px; resize: vertical; line-height: 1.7; } .composer-actions { display: flex; gap: 12px; margin-top: 16px; }
.model-button { min-width: 240px; display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 10px; border: 1px solid var(--line); background: white; border-radius: 7px; padding: 8px 12px; } .model-button span { grid-column: 1; font-size: 11px; color: var(--muted); } .model-button strong { grid-column: 1; font-size: 14px; } .model-button small { grid-column: 1; color: var(--coral); font-size: 11px; } .model-button b { grid-column: 2; grid-row: 1 / 4; align-self: center; } .reasoning-control { width: 150px; min-height: 67px; display: grid; align-content: center; gap: 2px; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: white; } .reasoning-control > span { color: var(--muted); font-size: 11px; font-weight: 400; } .reasoning-control select { width: 100%; height: 30px; padding: 0 26px 0 0; border: 0; background-color: transparent; color: var(--ink); font-weight: 700; box-shadow: none; cursor: pointer; } .reasoning-control select:disabled { color: var(--muted); cursor: not-allowed; } .reasoning-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35,104,213,.12); } .generate { margin-left: auto; min-width: 130px; }
.task-message { min-height: 20px; margin: 12px 0 0; font-size: 13px; color: var(--muted); } .task-message.error { color: #c34134; }
.recent-section { margin-top: 30px; } .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; } .section-heading h2 { font-size: 18px; margin: 0; } .text-button { border: 0; background: transparent; color: var(--blue); } .secondary { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 8px 13px; }
.empty-state { min-height: 180px; border: 1px dashed #cbd5dc; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); background: rgba(255,255,255,.45); } .empty-state strong { color: var(--ink); }
.task-list, .ledger-list { display: grid; gap: 10px; } .task-row, .ledger-row { background: white; border: 1px solid var(--line); padding: 15px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; border-radius: 7px; } .task-kind { width: 42px; height: 42px; display: grid; place-items: center; background: #e9f2fd; color: var(--blue); border-radius: 6px; font-weight: 700; } .task-row p { margin: 4px 0 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .task-row small { display: block; margin-top: 5px; color: #c34134; } .task-actions { display: flex; align-items: center; gap: 8px; } .status { font-size: 12px; color: var(--muted); } .cancel-button, .result-button { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: white; color: var(--blue); } .cancel-button { color: #c34134; }
.model-dialog { width: min(520px, calc(100% - 32px)); max-height: min(620px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 22px 70px rgba(18,35,47,.22); color: var(--ink); } .model-dialog::backdrop { background: rgba(9,20,29,.45); } .dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); } .dialog-heading h2 { margin: 0 0 4px; font-size: 18px; } .dialog-heading p { margin: 0; color: var(--muted); font-size: 12px; } .model-list { display: grid; max-height: 460px; overflow: auto; } .model-option { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; border: 0; border-bottom: 1px solid var(--line); padding: 15px 20px; text-align: left; background: white; color: var(--ink); } .model-option:hover, .model-option.active { background: #f0f6fc; } .model-option.active { box-shadow: inset 3px 0 var(--blue); } .model-option span { color: var(--muted); font-size: 12px; } .model-option strong:last-child { color: var(--coral); align-self: center; grid-column: 2; grid-row: 1 / 3; }
.model-dialog-body { display: grid; }
.balance-band { padding: 24px; background: #183343; color: white; display: grid; grid-template-columns: 1fr auto; margin-bottom: 28px; } .balance-band span { color: #acc2ce; } .balance-band strong { grid-column: 1; font-size: 38px; margin-top: 8px; } .balance-band small { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #c9d7dd; }
.ledger-row strong.positive { color: var(--teal); } .ledger-row strong.negative { color: var(--coral); }
.overlay { position: fixed; inset: 0; background: rgba(9,20,29,.45); z-index: 5; }
.generation-options { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.generation-options label { margin: 0; min-width: 150px; }
.generation-options select, .chat-tools select, .asset-toolbar select { height: 40px; padding: 0 34px 0 11px; }
.chat-tools { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.chat-tools select { min-width: 180px; }
.chat-tools span { color: var(--muted); font-size: 12px; }
.chat-messages { max-height: 420px; overflow-y: auto; display: grid; gap: 10px; padding: 8px 2px 16px; }
.chat-message { max-width: 82%; padding: 12px 14px; border: 1px solid var(--line); background: #f6f9fb; border-radius: 7px; }
.chat-message.user { margin-left: auto; background: #eaf3fd; border-color: #c8dcf5; }
.chat-message strong { font-size: 12px; color: var(--muted); }
.chat-message p { margin: 5px 0 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message-assets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.chat-message-asset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: white; color: var(--blue); font-size: 12px; }
.chat-message-asset-row { display: flex; align-items: stretch; min-width: min(320px, 100%); }
.chat-message-asset-row .chat-message-asset { min-width: 0; flex: 1; border-radius: 6px 0 0 6px; }
.chat-asset-download { width: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: white; color: var(--blue); }
.chat-asset-download svg { width: 17px; height: 17px; }
.composer.chat-mode .prompt-box, .composer.chat-mode #chatComposerFooter { transition: opacity .18s ease, transform .2s ease; }
.composer.chat-mode.chat-history-browsing .prompt-box, .composer.chat-mode.chat-history-browsing #chatComposerFooter { display: none; }
.chat-composer-restore { width: 100%; min-height: 38px; align-items: center; justify-content: center; gap: 7px; margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface, #fff); color: var(--blue); font-weight: 700; }
.chat-composer-restore:not([hidden]) { display: flex; }
.chat-composer-restore svg { width: 17px; height: 17px; }
.rules-dialog-body { padding: 18px 20px; }
.rules-dialog-body textarea { min-height: 150px; resize: vertical; }
.asset-toolbar { display: grid; grid-template-columns: minmax(200px, 320px) minmax(180px, 240px); gap: 16px; align-items: end; margin-bottom: 18px; }
.asset-toolbar label { margin: 0; }
.asset-toolbar input, .asset-toolbar select { width: 100%; }
.upload-button { display: inline-flex; align-items: center; margin: 0; border: 0; border-radius: 7px; background: var(--blue); color: white; font-weight: 700; padding: 10px 16px; cursor: pointer; }
.asset-grid, .asset-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.asset-item { min-width: 0; padding: 11px; border: 1px solid var(--line); background: white; border-radius: 7px; display: grid; gap: 7px; }
.asset-item strong, .asset-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-item small { color: var(--muted); }
.asset-preview { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; border: 0; border-radius: 5px; background: #e9f2fd; color: var(--blue); }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; border-top: 1px solid var(--line); }
.asset-actions .secondary, .asset-actions .danger-text { min-width: 62px; }
.danger-text { border: 1px solid #ebc8c3; border-radius: 6px; padding: 8px 12px; background: white; color: #c34134; }
.picker-item { position: relative; cursor: pointer; }
.picker-item input { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; }
.asset-picker-categories { display: flex; gap: 7px; overflow-x: auto; padding: 13px 16px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.asset-picker-category-label { flex: 0 0 auto; align-self: center; margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.asset-picker-categories button { flex: 0 0 auto; min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); white-space: nowrap; }
.asset-picker-categories button.active { border-color: var(--blue); background: #eaf3fd; color: var(--blue); font-weight: 700; }
.asset-picker-categories small { margin-left: 4px; color: inherit; }
.asset-picker { padding: 16px; max-height: 520px; overflow: auto; }
.asset-select-dialog { width: min(760px, calc(100% - 32px)); }
.dialog-footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.media-dialog { width: min(900px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.media-dialog::backdrop { background: rgba(9,20,29,.68); }
.media-viewer { min-height: 240px; max-height: calc(100vh - 150px); display: grid; place-items: center; overflow: auto; background: #101820; }
.media-viewer img, .media-viewer video { display: block; max-width: 100%; max-height: calc(100vh - 150px); }
.media-viewer audio { width: min(620px, calc(100% - 32px)); }
.media-viewer iframe { width: 100%; height: min(720px, calc(100vh - 150px)); border: 0; background: white; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.plan-item { display: grid; gap: 9px; padding: 18px; border: 1px solid var(--line); background: white; border-radius: 7px; }
.plan-item b { font-size: 22px; } .plan-item span { color: var(--coral); } .recharge-history { margin-top: 30px; }
.payment-status-summary { margin: -2px 0 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.payment-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.payment-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.payment-status-grid > div { min-width: 0; padding: 10px 12px; background: #f8fafc; border: 1px solid #edf1f4; border-radius: 6px; }
.payment-status-grid span, .payment-status-grid strong, .payment-status-grid small { display: block; }
.payment-status-grid span { color: var(--muted); font-size: 12px; }
.payment-status-grid strong { margin-top: 5px; overflow-wrap: anywhere; }
.payment-status-grid small { margin-top: 4px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.payment-status-note { margin: 0 0 14px; padding: 10px 12px; color: #71551d; background: #fff8e6; border: 1px solid #f0d79a; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.payment-status-note:empty { display: none; }
.payment-status-note.warning { display: block; }
.form-status { grid-column: 1 / -1; margin: 0; }
.nav-item { text-decoration: none; font-size: 13.3333px; }
.admin-body { display: flow-root; background: #f5f7fa; }
.admin-header { height: 70px; padding: 0 max(24px, calc((100vw - 1200px) / 2)); background: #152a39; color: white; display: flex; align-items: center; justify-content: space-between; border: 0; margin: 0; }
.admin-header .brand-lockup { color: white; text-decoration: none; padding: 0; }
.admin-main { width: min(1200px, calc(100% - 32px)); margin: 26px auto 60px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.metric-grid article { padding: 18px; background: white; border: 1px solid var(--line); border-radius: 7px; display: grid; gap: 8px; }
.metric-grid span { color: var(--muted); } .metric-grid strong { font-size: 26px; }
.admin-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 22px; scrollbar-width: thin; }
.admin-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 11px 16px; background: transparent; color: var(--muted); }
.admin-tabs button.active { color: var(--blue); border-color: var(--blue); font-weight: 700; }
.admin-table { display: grid; gap: 8px; }
.admin-row { display: grid; grid-template-columns: minmax(220px, 1fr) 130px 90px auto; gap: 14px; align-items: center; padding: 13px 15px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.admin-row strong, .admin-row small { display: block; } .admin-row small { color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.config-state { color: var(--coral); font-size: 12px; } .config-state.ready { color: var(--teal); }
.user-admin-row { grid-template-columns: minmax(220px, 1fr) 110px auto; }
.user-admin-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-admin-identity img, .user-admin-avatar { width: 36px; height: 36px; flex: 0 0 36px; object-fit: cover; border-radius: 50%; background: var(--teal); color: white; display: grid; place-items: center; font-weight: 700; }
.user-admin-identity div { min-width: 0; }
.user-detail-body { max-height: calc(100vh - 220px); }
.user-detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.user-detail-list { max-height: 260px; overflow: auto; }
.user-detail-row { grid-template-columns: minmax(180px, 1fr) 90px 110px 150px; align-items: center; }
.user-detail-row small { color: var(--muted); }
.admin-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.admin-form { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; max-height: calc(100vh - 190px); overflow: auto; }
.admin-form label { margin: 0; } .admin-form .full { grid-column: 1 / -1; } .admin-form input, .admin-form select { height: 42px; padding: 0 11px; } .admin-form textarea { padding: 10px; min-height: 90px; font-family: Consolas, monospace; font-size: 12px; }
#modelEditDialog { width: min(1080px, calc(100% - 32px)); overflow: hidden; }
#modelForm { display: flex; flex-direction: column; max-height: calc(100dvh - 42px); min-width: 0; }
#modelForm .dialog-heading, #modelForm .dialog-footer { flex: 0 0 auto; }
#modelForm .admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; max-height: none; overflow-y: auto; overflow-x: hidden; }
#modelForm .admin-form > *, #modelForm label, #modelForm .capability-grid > * { min-width: 0; }
#modelForm input, #modelForm select, #modelForm textarea { max-width: 100%; }
#modelForm select, #modelForm textarea, #modelForm input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { width: 100%; min-width: 0; box-sizing: border-box; }
#modelForm .upstream-price-display { overflow-wrap: anywhere; }
#modelForm .billing-mode-options { flex-wrap: wrap; }
#modelForm .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 650px) {
  #modelForm .admin-form, #modelForm .model-price-notes-row, #modelForm .capability-grid { grid-template-columns: minmax(0, 1fr); }
  #modelForm .reference-limit-grid, #modelForm .token-pricing-grid, #modelForm .resolution-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.admin-form .inline-check { display: flex; align-items: center; gap: 8px; } .admin-form .inline-check input { width: 18px; height: 18px; }
.model-status-controls { display: flex; align-items: center; gap: 22px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.video-billing-mode { display: grid; gap: 7px; }
.video-billing-mode > span { font-weight: 700; }
.billing-mode-options { display: flex; gap: 8px; }
.billing-mode-options label { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }
.billing-mode-options input { width: 17px; height: 17px; margin: 0; }
.image-resolution-pricing { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.image-resolution-pricing > span { font-weight: 700; }
.image-resolution-pricing > small { color: var(--muted); font-size: 11px; }
.resolution-price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.resolution-price-grid label { min-width: 0; }
.resolution-price-grid small { display: block; margin: 5px 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.resolution-price-grid input { width: 100%; }
.upstream-price-display { display: flex; align-items: center; min-height: 42px; margin-top: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; color: var(--ink); font-weight: 700; }
.model-price-notes-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.model-price-notes-row label { min-width: 0; }
.model-price-notes-row textarea { width: 100%; height: 42px; min-height: 42px; margin-top: 7px; resize: vertical; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-bottom: 34px; }
.model-description-field { display: grid; gap: 8px; margin: 20px; }
.admin-notification { position: fixed; top: 82px; right: 20px; z-index: 1000; width: min(480px, calc(100vw - 32px)); display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; align-items: start; gap: 10px; padding: 16px; border: 1px solid #89b9c1; border-left: 4px solid #158397; border-radius: 7px; background: #fff; color: #173d46; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.admin-notification[hidden] { display: none; }
.admin-notification > svg { width: 20px; height: 20px; margin-top: 4px; }
.admin-notification p { margin: 0; align-self: center; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: min(300px, 45vh); overflow-y: auto; }
.admin-notification .icon-button { width: 32px; height: 32px; min-width: 0; padding: 6px; }
.admin-notification.error { border-color: #d98787; border-left-color: #d34949; }
html.theme-dark .admin-notification { background: #142d36; color: #e7f2f3; border-color: #4e8f95; border-left-color: #4ec8bd; }
html.theme-dark .admin-notification.error { border-color: #b76d6d; border-left-color: #ff8989; }
@media (max-width: 600px) { .admin-notification { top: 76px; right: 16px; padding: 12px; } }
.model-description-field textarea { width: 100%; min-height: 180px; resize: vertical; }
#modelDescriptionError { margin: 0 20px 12px; }
.provider-card { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 15px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.provider-card:hover, .provider-card:focus-visible { border-color: #9dbfe3; box-shadow: 0 0 0 3px rgba(54, 117, 181, .1); outline: none; }
.provider-card.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.provider-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.provider-card-title > div { flex: 1; min-width: 0; }
.provider-card-title > .config-state { flex-shrink: 0; }
.provider-card-title .config-state { display: block; margin-top: 5px; }
.provider-card-title .provider-website { flex-shrink: 0; margin: -8px -8px 0 0; padding: 6px 8px; font-size: 12px; text-decoration: none; color: #6941c6; white-space: nowrap; }
.provider-card-title strong, .provider-card-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .provider-card-title small { margin-top: 4px; color: var(--muted); }
.provider-card dl { display: grid; gap: 7px; margin: 0; min-width: 0; } .provider-card dl div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.provider-card dt { color: var(--muted); } .provider-card dd { margin: 0; overflow-wrap: anywhere; }
.provider-card dl div { grid-template-columns: max-content minmax(0, 1fr); }
.provider-card dt { min-width: 84px; white-space: nowrap; }
.provider-card .provider-actions { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); gap: 6px; align-items: center; }
.provider-card .provider-actions button { padding: 9px 7px; white-space: nowrap; }
.provider-card .provider-actions .provider-wallet { min-width: 0; max-width: none; }
.provider-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; } .provider-actions .secondary:first-child { color: var(--blue); border-color: #b8ceea; }
.provider-actions .provider-wallet { color: var(--teal); border-color: #b8ddd0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-actions a { text-decoration: none; display: inline-flex; align-items: center; }
  .provider-empty { grid-column: 1 / -1; } .model-heading { margin-top: 8px; }
  .model-heading-actions { display: flex; gap: 8px; align-items: center; }
  .model-heading-actions, .model-bulk-actions { flex-wrap: wrap; }
  .model-bulk-actions { display: flex; align-items: center; gap: 8px; }
  .model-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .model-identity > div { min-width: 0; }
  .model-identity input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--blue); }
  .model-order-list { padding: 18px 20px; display: grid; gap: 8px; max-height: min(66vh, 640px); overflow: auto; overscroll-behavior: contain; }
  .model-order-item { display: grid; grid-template-columns: 52px minmax(180px, 1.25fr) minmax(260px, 1fr) 78px; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: grab; touch-action: pan-y; transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
  .model-order-item:hover { border-color: #9dbfe3; }
  .model-order-item.dragging { cursor: grabbing; opacity: .72; border-color: var(--blue); box-shadow: 0 7px 22px rgba(29, 78, 128, .18); touch-action: none; }
  .model-order-position { display: flex; align-items: center; gap: 7px; }
  .model-order-drag-handle { color: var(--muted); font-size: 16px; line-height: 1; letter-spacing: -4px; user-select: none; }
  .model-order-index { min-width: 22px; color: var(--blue); font-weight: 800; text-align: center; }
  .model-order-name { min-width: 0; display: grid; gap: 5px; }
  .model-order-name strong, .model-order-name small { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .model-order-name small { color: var(--muted); }
  .model-order-prices { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .model-order-price { min-width: 0; display: grid; gap: 3px; padding: 8px 9px; border: 1px solid #dde5ee; border-radius: 6px; background: #f7f9fc; }
  .model-order-price span { color: var(--muted); font-size: 11px; }
  .model-order-price strong { color: var(--ink); font-size: 12px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .model-order-price.user-price strong { color: var(--coral); }
  .model-order-actions { display: flex; gap: 8px; }
.model-admin-row { grid-template-columns: minmax(0, 1fr) 145px 210px 100px 72px auto; column-gap: 10px; }
.model-admin-row .model-identity strong { white-space: normal; overflow-wrap: anywhere; }
.model-admin-row .row-actions { gap: 6px; flex-wrap: nowrap; }
@media (min-width: 801px) and (max-width: 1100px) {
  .model-admin-row { grid-template-columns: minmax(0, 1fr) 210px 100px 72px auto; }
  .model-admin-row .model-identity { grid-column: 1 / -1; }
}
.model-admin-row.public-model { border-color: #1f9d78; background: #f0fbf7; box-shadow: inset 0 0 0 1px #1f9d78; }
.model-price-column { min-width: 0; display: grid; gap: 4px; }
.model-upstream-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
/* Keep the original column order; share spare width between identity and prices. */
@media (min-width: 1101px) {
  .admin-body .model-admin-row.image-model-row { grid-template-columns: minmax(240px, 0.85fr) 130px minmax(240px, 1fr) 90px 64px auto; column-gap: clamp(6px, .6vw, 10px); }
}
.admin-body .image-model-row .model-upstream-prices { column-gap: clamp(6px, .6vw, 10px); }
.admin-body .image-model-row .model-price-column strong { line-height: 1.5; white-space: normal; word-break: normal; }
.model-sync-badge { display: inline-block; margin-top: 6px; padding: 2px 6px; border-radius: 4px; background: #edf0f3; color: #59616c; font-size: 12px; }
.model-sync-badge.available { background: #e3f5ee; color: #157451; }
.model-sync-badge.missing { background: #fde8e7; color: #b42318; }
.model-sync-meta { min-width: 0; justify-items: start; }
.model-sync-meta .model-sync-badge { margin-top: 0; }
.model-sync-meta small { margin: 0; overflow-wrap: anywhere; }
.model-price-column.price-changed { color: #b54708; }
.model-price-column small { margin: 0; }
.model-price-column strong { overflow-wrap: anywhere; font-size: 13px; }
.model-meta { display: grid; gap: 4px; color: var(--muted); font-size: 12px; } .model-credit { color: var(--coral); }
.model-runtime-warning { color: #b54708; font-weight: 700; }
.admin-placeholder { max-width: 720px; padding: 26px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.admin-placeholder h2 { margin-top: 0; } .admin-placeholder p { color: var(--muted); line-height: 1.7; } .admin-placeholder span { color: var(--coral); }
.compact-dialog { width: min(680px, calc(100% - 32px)); } #modelOrderDialog { width: min(920px, calc(100% - 32px)); } .admin-form label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.chat-billing-mode { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.chat-billing-mode > span { font-weight: 700; }
.token-pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.token-pricing-grid label { min-width: 0; }
.token-pricing-grid small { display: block; margin: 5px 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.token-pricing-grid input { width: 100%; }
.capability-fields { border: 1px solid var(--line); padding: 13px; background: #f8fafc; border-radius: 7px; }
.capability-fields h3 { margin: 0 0 11px; font-size: 14px; } .capability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; }
.capability-choice { display: grid; gap: 8px; margin-bottom: 12px; }
.capability-choice > span { color: var(--muted); font-size: 13px; font-weight: 600; }
.capability-choice-heading { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.capability-choice-heading > span { color: var(--muted); font-size: 13px; font-weight: 600; }
.capability-select-all { padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--blue); font-size: 12px; font-weight: 700; }
.capability-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.capability-button { min-width: 62px; padding: 8px 12px; border: 1px solid #cbd7e0; border-radius: 6px; background: white; color: var(--ink); }
.capability-button:hover { border-color: var(--blue); color: var(--blue); }
.capability-button.active { border-color: var(--blue); background: #eaf3fd; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); font-weight: 700; }
.capability-checks { display: flex; flex-wrap: wrap; gap: 14px; }
.reference-limit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.reference-limit-grid label { margin: 0; }
.reference-limit-grid input { width: 100%; height: 38px; }
.capability-custom-duration { display: grid; grid-template-columns: auto 110px auto; align-items: center; justify-content: start; gap: 8px; margin: -2px 0 14px; }
.capability-custom-duration label { color: var(--muted); font-size: 13px; font-weight: 600; }
.capability-custom-duration input { width: 110px; height: 38px; }
.capability-custom-duration button { height: 38px; }
.subsection-heading { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.compact-metrics { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.compact-metrics article { padding: 14px 16px; }
.compact-metrics strong { font-size: 21px; }
.admin-details { margin-top: 18px; border: 1px solid var(--line); background: white; border-radius: 7px; }
.admin-details summary { padding: 14px 16px; cursor: pointer; font-weight: 700; }
.admin-details .admin-table { padding: 0 14px 14px; }
.control-strip { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) auto; gap: 14px; align-items: end; margin-bottom: 18px; }
.control-strip label { margin: 0; }
.control-strip input { width: 100%; }
.feature-settings-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 18px; padding: 18px 20px; border: 1px solid #dbe5f0; border-radius: 12px; background: #f8fbff; }
.feature-settings-card strong { display: block; margin-bottom: 5px; font-size: 16px; }
.feature-settings-card p { margin: 0; }
.feature-toggle { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
.feature-toggle input { width: 20px; height: 20px; accent-color: #2463d4; }
.settings-form { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.settings-form label { margin: 0; }
.settings-form input, .settings-form select { width: 100%; height: 42px; padding: 0 11px; }
.settings-form textarea { min-height: 86px; padding: 10px; }
.settings-form .full { grid-column: 1 / -1; }
.settings-form .inline-check { display: flex; align-items: center; gap: 8px; }
.settings-form .inline-check input { width: 18px; height: 18px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.settings-results { margin-top: 18px; }
.legacy-account-row { grid-template-columns: minmax(240px, 1fr) 110px 100px auto; }
.license-row, .content-row { grid-template-columns: minmax(250px, 1fr) 90px 160px auto; }
.content-image-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.content-image-upload input[type="file"] { flex: 1 1 240px; min-width: 0; height: auto; padding: 8px 10px; }
.content-image-preview { display: block; width: min(360px, 100%); max-height: 180px; margin-top: 9px; border: 1px solid var(--line); border-radius: 6px; background: #f5f7fa; object-fit: contain; }
.code-row { grid-template-columns: minmax(250px, 1fr) 100px 180px; }
.ledger-admin-row { grid-template-columns: minmax(250px, 1fr) 90px 110px 180px; }
.release-row { grid-template-columns: minmax(280px, 1fr) 80px 100px 180px; }
.audit-row { grid-template-columns: minmax(260px, 1fr) minmax(180px, .7fr) 180px; }
.ledger-admin-row .positive { color: var(--teal); }
.ledger-admin-row .negative { color: var(--coral); }
@media (max-width: 800px) { .auth-shell { grid-template-columns: 1fr; } .brand-panel { min-height: 260px; padding: 28px; } .brand-copy { padding: 35px 0 20px; } .brand-copy h1 { font-size: 34px; } .art-grid { position: absolute; width: 260px; right: -40px; bottom: -60px; opacity: .55; } .auth-main { padding: 34px 22px; } .app-shell { display: block; } .sidebar { position: fixed; left: -250px; z-index: 10; width: 232px; transition: left .2s; } .sidebar.open { left: 0; } .workspace { padding: 0 16px 34px; } header { height: 82px; margin-bottom: 20px; } #menuButton { display: block; } header p { display: none; } .credit-button span, .credit-button small { display: none; } .credit-button { display: block; } .composer { padding: 17px; } .composer-top { grid-template-columns: minmax(0, 1fr) auto; } .composer-assets { grid-column: 1 / -1; grid-row: 2; } textarea { min-height: 210px; } .composer-actions { align-items: stretch; flex-wrap: wrap; } .model-button { min-width: 0; flex: 1; } .reasoning-control { width: 140px; } .generate { min-width: 108px; } }
@media (max-width: 430px) { .brand-panel { min-height: 230px; } .brand-copy h1 { font-size: 30px; } .brand-copy p { font-size: 15px; max-width: 270px; } .composer-assets { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; } .composer-asset-actions { grid-template-columns: 1fr 1fr; } .composer-actions { flex-direction: column; } .reasoning-control { width: 100%; min-height: 58px; } .generate { margin-left: 0; width: 100%; } .mode-tabs button { flex: 1; padding: 11px 4px; } .task-row { grid-template-columns: auto 1fr; } .task-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; } }
  @media (max-width: 800px) { .chat-tools { align-items: stretch; flex-direction: column; } .asset-toolbar { grid-template-columns: 1fr 1fr; } .chat-tools select { min-width: 0; width: 100%; } .metric-grid { grid-template-columns: 1fr 1fr; } .payment-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-row, .user-admin-row, .model-admin-row, .legacy-account-row, .license-row, .content-row, .code-row, .ledger-admin-row, .release-row, .audit-row { grid-template-columns: 1fr auto; } .admin-row > :nth-child(n+3) { justify-self: start; } .admin-form, .settings-form { grid-template-columns: 1fr; } .admin-form .full, .settings-form .full, .form-actions { grid-column: 1; } .admin-tabs { display: flex; } .admin-tabs button { min-width: max-content; padding-inline: 12px; white-space: nowrap; } .provider-grid, .capability-grid { grid-template-columns: 1fr; } .token-pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .control-strip { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .capability-custom-duration { grid-template-columns: 1fr auto; } .capability-custom-duration label { grid-column: 1 / -1; } .capability-custom-duration input { width: 100%; } }
@media (max-width: 800px) { .model-price-notes-row { grid-template-columns: 1fr; gap: 12px; } }
@media (max-width: 800px) { .model-order-list { padding: 12px; } .model-order-item { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 9px; } .model-order-prices { grid-column: 2 / -1; } .model-order-actions { grid-column: 3; grid-row: 1; } }
@media (max-width: 520px) { .model-order-prices { grid-template-columns: 1fr; } .model-order-actions { flex-direction: column; } }
@media (max-width: 520px) { .reference-limit-grid { grid-template-columns: 1fr; } }
  @media (max-width: 430px) { .metric-grid { grid-template-columns: 1fr; } .payment-status-grid { grid-template-columns: 1fr; } .payment-status-heading { align-items: flex-start; flex-direction: column; } .admin-header { padding: 0 16px; } .admin-header .brand-lockup strong { font-size: 15px; } .asset-grid { grid-template-columns: 1fr 1fr; } .asset-toolbar { grid-template-columns: 1fr; } }

.recent-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recent-task-card { min-width: 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.recent-task-card { position: relative; }
.video-library-toolbar { display:flex; gap:10px; margin:18px 0; }
.video-library-layout { display:grid; grid-template-columns:240px minmax(0,1fr); gap:18px; }
.video-library-tree, .video-library-entries { background:var(--surface, #fff); border:1px solid var(--line); border-radius:8px; padding:14px; }
.video-library-layout { display:block; }
.video-library-tree { margin-bottom:16px; padding:12px 14px; }
.video-library-series-tabs, .video-library-episode-tabs { display:flex; align-items:center; gap:8px; overflow-x:auto; padding:2px 0 8px; }
.video-library-episode-tabs { padding-top:8px; border-top:1px solid var(--line); }
.video-library-series-tab-wrap, .video-library-episode-tab-wrap { display:flex; align-items:center; flex:0 0 auto; gap:3px; padding:3px; border:1px solid var(--line); border-radius:8px; background:var(--surface, #fff); }
.video-library-series-tab-wrap.active, .video-library-episode-tab-wrap.active { border-color:var(--teal); background:rgba(56,189,248,.1); }
.video-library-series-tab, .video-library-episode-tab-wrap .video-library-episode { width:auto; min-width:max-content; padding:8px 12px; font-weight:700; white-space:nowrap; }
.video-library-series-tab-wrap .icon-button, .video-library-episode-tab-wrap .icon-button { width:28px; min-width:28px; height:28px; padding:0; display:grid; place-items:center; }
.video-library-series-tab-wrap .icon-button svg, .video-library-episode-tab-wrap .icon-button svg { width:14px; height:14px; }
.video-library-episode-tabs .video-library-new-episode { width:auto; min-width:max-content; padding:9px 12px; }
.video-library-series-block { display:grid; gap:6px; padding:4px 0 12px; border-bottom:1px solid var(--line); }
.video-library-series-block + .video-library-series-block { padding-top:12px; }
.video-library-series-title { display:grid; grid-template-columns:minmax(0,1fr) 30px 30px; gap:4px; align-items:center; min-height:34px; }
.video-library-series-title strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.video-library-tree button { border:0; background:transparent; color:inherit; cursor:pointer; }
.video-library-tree .video-library-series-title .icon-button,
.video-library-tree .video-library-episode-row .icon-button { display:grid; place-items:center; width:30px; min-width:30px; height:30px; padding:0; border:1px solid var(--line); border-radius:6px; }
.video-library-tree .video-library-series-title .icon-button svg,
.video-library-tree .video-library-episode-row .icon-button svg { width:15px; height:15px; }
.video-library-tree button.active, .video-library-tree button:hover { background:rgba(56,189,248,.12); }
.video-library-episode { min-width:0; width:100%; margin:0; padding:8px 9px; text-align:left; border-radius:6px; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.video-library-new-episode { width:100%; padding:8px 9px; text-align:left; border-radius:6px; color:var(--muted) !important; }
.video-library-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.video-library-card { border:1px solid var(--line); border-radius:8px; padding:10px; background:var(--surface, #fff); }
.video-library-card video { width:100%; aspect-ratio:16/9; display:block; object-fit:cover; background:#101828; border-radius:6px; }
.video-library-preview { position:relative; display:block; width:100%; border:0; padding:0; background:transparent; cursor:pointer; }
.video-library-preview > i { position:absolute; inset:50% auto auto 50%; transform:translate(-50%,-50%); color:#fff; background:rgba(0,0,0,.58); border-radius:50%; padding:8px; }
.video-library-episode-row { display:grid; grid-template-columns:minmax(0,1fr) 30px 30px; align-items:center; gap:4px; }
.video-library-card strong, .video-library-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.video-library-card small { color:var(--muted); margin-top:5px; }
.video-library-card .row-actions { display:flex; gap:6px; margin-top:8px; }
@media (max-width: 700px) { .video-library-layout { grid-template-columns:1fr; } .video-library-tree { max-height:320px; overflow:auto; } }
.recent-task-card .recent-thumbnail { position: relative; }
.recent-edit-button { position: absolute; top: 10px; right: 10px; left: auto; z-index: 3; width: 28px; height: 28px; padding: 0; }
.recent-task-copy { min-width: 0; }
.recent-task-copy strong, .recent-task-copy p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-task-copy p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.recent-task-copy small { color: var(--teal); font-size: 12px; }
.recent-task-card > .result-button { grid-column: 1 / -1; width: 100%; }
.task-thumbnail, .recent-thumbnail { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; border: 0; border-radius: 6px; background: #e9f2fd; color: var(--blue); padding: 0; }
.task-thumbnail img, .recent-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.task-row > .task-thumbnail { width: 72px; }
.task-preview-dialog { width: min(900px, calc(100% - 24px)); }
.task-detail { padding: 16px 20px 20px; background: white; }
.task-detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 15px; }
.task-preview-dialog > .dialog-heading { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(330px, .8fr) auto; align-items: center; }
.task-result-name-field { display: grid; gap: 5px; margin: 0; }
.task-result-name-field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.task-result-name-field > div { display: flex; gap: 8px; }
.task-result-name-field input { min-width: 0; flex: 1; }
.task-result-name-field em { align-self: center; min-width: 58px; color: var(--teal); font-size: 12px; font-style: normal; }
.recent-task-name { display: block; width: 100%; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
@media (max-width: 760px) { .task-preview-dialog > .dialog-heading { grid-template-columns: 1fr auto; } .task-preview-dialog > .dialog-heading .task-result-name-field { grid-column: 1 / -1; grid-row: 2; } }
.task-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; margin: 0 0 17px; }
.task-detail-list div { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; padding-bottom: 7px; border-bottom: 1px solid #eef1f3; }
.task-detail-list dt { color: var(--muted); }
.task-detail-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.task-detail h3 { margin: 0 0 7px; font-size: 14px; }
.task-detail-prompt { margin: 0; padding: 10px 12px; max-height: 150px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; background: #f5f7fa; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 800px) { .recent-tasks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .recent-tasks { grid-template-columns: 1fr; } .task-detail { padding-inline: 14px; } .task-detail-list { grid-template-columns: 1fr; } .task-detail-actions { justify-content: stretch; } .task-detail-actions button { flex: 1; } }
.model-option { position: relative; padding-right: 58px; cursor: pointer; }
.model-option > strong:nth-of-type(2) { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--coral); }
.model-option > .model-default-button { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 3px; }
.model-option > .model-default-button:hover, .model-option > .model-default-button.active { color: #e0a52b; }

.admin-voice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.admin-voice-card { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; gap: 8px; min-height: 58px; padding: 8px 10px; border: 1px solid var(--line, #d7dfdc); border-radius: 8px; background: var(--surface, #fff); }
.admin-voice-card div { min-width: 0; }
.admin-voice-card strong, .admin-voice-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-voice-card small { color: var(--muted, #66716e); }
.admin-voice-card .icon-button { width: 32px; height: 32px; justify-self: end; }
@media (max-width: 720px) { .admin-voice-list { grid-template-columns: 1fr; } }

/* Recent creation model labels: overlay only, without changing media layout. */
.recent-thumbnail .recent-model-badge { position: absolute; top: 8px; left: 8px; z-index: 2; display: block; max-width: calc(100% - 16px); width: max-content; box-sizing: border-box; overflow: hidden; padding: 4px 8px; border-radius: 5px; background: rgba(10, 20, 30, .78); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; text-align: left; white-space: nowrap; pointer-events: none; }
.recent-model-badge .recent-model-track { display: block; width: max-content; white-space: nowrap; }
.recent-model-badge.is-scrolling .recent-model-track { animation: recent-model-scroll var(--model-scroll-duration, 8s) linear infinite; }
@keyframes recent-model-scroll { 0%, 20% { transform: translateX(0); } 75%, 90% { transform: translateX(var(--model-scroll-distance, 0px)); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .recent-model-badge.is-scrolling .recent-model-track { animation: none; } }

/* Admin theme switch: keep the existing light palette and provide a readable dark workspace. */
.admin-header-actions { display: flex; align-items: center; gap: 10px; }
.admin-theme-toggle { width: 66px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.08); color: #d9f4ef; }
.admin-theme-track { position: relative; width: 54px; height: 26px; display: flex; align-items: center; justify-content: space-around; color: #a8c2ca; }
.admin-theme-track svg { position: relative; z-index: 1; width: 14px; height: 14px; }
.admin-theme-track b { position: absolute; left: 0; top: 0; width: 27px; height: 26px; border-radius: 6px 0 6px 0; background: #fff0b6; box-shadow: 0 2px 7px rgba(0,0,0,.18); transition: transform .25s ease, background-color .2s ease; }
.admin-theme-track svg:first-of-type { color: #7f5b0a; }
html.theme-dark .admin-theme-track b { transform: translateX(27px); background: #35415f; }
html.theme-dark .admin-theme-track svg:last-of-type { color: #d7defd; }
html.theme-dark .admin-body { color-scheme: dark; --ink: #e7f2f3; --muted: #9cb4bb; --line: #2b4a55; --surface: #142d36; --blue: #76b8ff; --teal: #60d4bd; --coral: #ffac91; background: #0d2028; color: var(--ink); }
html.theme-dark .admin-body .admin-header { background: #102832; border-bottom: 1px solid #294550; }
html.theme-dark .admin-body .admin-tabs { border-color: #294550; }
html.theme-dark .admin-body .admin-tabs button { color: #91aeb7; }
html.theme-dark .admin-body .admin-tabs button.active { color: #73d8ce; border-color: #4ec8bd; }
html.theme-dark .admin-body .subtle, html.theme-dark .admin-body .model-meta, html.theme-dark .admin-body .admin-row small, html.theme-dark .admin-body .provider-card-title small, html.theme-dark .admin-body .model-order-name small { color: #9cb4bb; }
html.theme-dark .admin-body .metric-grid article, html.theme-dark .admin-body .admin-row, html.theme-dark .admin-body .provider-card, html.theme-dark .admin-body .admin-placeholder, html.theme-dark .admin-body .settings-form, html.theme-dark .admin-body .admin-details, html.theme-dark .admin-body .payment-status-summary, html.theme-dark .admin-body .feature-settings-card, html.theme-dark .admin-body .admin-dialog, html.theme-dark .admin-body .task-detail { background: #142d36; border-color: #2b4a55; color: #e7f2f3; }
html.theme-dark .admin-body .feature-settings-card { background: #15333b; }
html.theme-dark .admin-body input, html.theme-dark .admin-body textarea, html.theme-dark .admin-body select, html.theme-dark .admin-body .secondary, html.theme-dark .admin-body .icon-button, html.theme-dark .admin-body .danger-text, html.theme-dark .admin-body .capability-button, html.theme-dark .admin-body .capability-select-all, html.theme-dark .admin-body .billing-mode-options label { background: #102832; border-color: #345660; color: #e7f2f3; }
html.theme-dark .admin-body input::placeholder, html.theme-dark .admin-body textarea::placeholder { color: #76939d; }
html.theme-dark .admin-body input:focus, html.theme-dark .admin-body textarea:focus, html.theme-dark .admin-body select:focus { border-color: #5ed6c9; box-shadow: 0 0 0 3px rgba(94,214,201,.14); }
html.theme-dark .admin-body .model-status-controls, html.theme-dark .admin-body .chat-billing-mode, html.theme-dark .admin-body .capability-fields, html.theme-dark .admin-body .image-resolution-pricing, html.theme-dark .admin-body .model-order-price, html.theme-dark .admin-body .payment-status-grid > div { background: #102832; border-color: #2b4a55; }
html.theme-dark .admin-body .model-order-item { background: #142d36; border-color: #2b4a55; }
html.theme-dark .admin-body .model-order-item:hover, html.theme-dark .admin-body .provider-card:hover, html.theme-dark .admin-body .provider-card:focus-visible { border-color: #4ec8bd; }
html.theme-dark .admin-body .capability-button.active { background: #123f45; border-color: #55cfc3; color: #8ce8df; }
html.theme-dark .admin-body .admin-details summary, html.theme-dark .admin-body .dialog-heading, html.theme-dark .admin-body .dialog-footer { border-color: #2b4a55; }
html.theme-dark .admin-body .admin-details summary { background: #142d36; }
html.theme-dark .admin-body .admin-row, html.theme-dark .admin-body .model-order-item, html.theme-dark .admin-body .provider-card, html.theme-dark .admin-body .admin-placeholder, html.theme-dark .admin-body .settings-form, html.theme-dark .admin-body .admin-details { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
html.theme-dark .admin-body .model-admin-row.public-model { background: #153d38; border-color: #38b89b; }
html.theme-dark .admin-body .model-sync-badge { background: #25373d; color: #b7cbd0; }
html.theme-dark .admin-body .model-sync-badge.available { background: #16453c; color: #8be1c2; }
html.theme-dark .admin-body .model-sync-badge.missing { background: #512d32; color: #ffb0aa; }
html.theme-dark .admin-body .payment-status-note { background: #3a321d; border-color: #725d2a; color: #f1d27e; }
html.theme-dark .admin-body .asset-item, html.theme-dark .admin-body .admin-details .admin-table, html.theme-dark .admin-body .content-image-preview { background: #142d36; }
html.theme-dark .admin-body .ledger-row { background: var(--surface); border-color: var(--line); color: var(--ink); }
html.theme-dark .admin-body .ledger-row small { color: var(--muted); }
html.theme-dark .admin-body .admin-form, html.theme-dark .admin-body .dialog-footer { background: #142d36; }
html.theme-dark .admin-body .admin-form small, html.theme-dark .admin-body .payment-status-grid span, html.theme-dark .admin-body .payment-status-grid small { color: #9cb4bb; }
html.theme-dark .admin-body .content-image-preview { border-color: #345660; }
html.theme-dark .admin-body .upstream-price-display { background: #102832; border-color: #345660; color: #e7f2f3; overflow-wrap: anywhere; }
html.theme-dark .admin-body .admin-dialog::backdrop { background: rgba(0, 0, 0, .72); }
@media (max-width: 520px) { .admin-header-actions { gap: 6px; } .admin-theme-toggle { width: 56px; } .admin-theme-track { transform: scale(.86); } }
html.theme-dark .admin-body .provider-card.selected { background: #183b43; border-color: #60d4bd; box-shadow: inset 0 0 0 2px #60d4bd, 0 0 0 2px rgba(96, 212, 189, .18); }
