:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei UI", "Segoe UI", sans-serif;
  color: #172033;
  background: #f7f8fc;
  --primary: #6848f5;
  --primary-dark: #5032db;
  --primary-soft: #f0edff;
  --blue: #3578e5;
  --line: #e3e6ef;
  --muted: #70798f;
  --surface: #fff;
  --success: #0d9568;
  --success-soft: #e8f8f2;
  --warning: #b8740d;
  --warning-soft: #fff6df;
  --danger: #c34455;
  --danger-soft: #fdecef;
  --shadow: 0 12px 36px rgba(34, 42, 68, .07);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f7f8fc; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 7px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; color: #fff; border-radius: 14px; background: linear-gradient(145deg, #8a6df9, #5a3cea); box-shadow: 0 10px 28px rgba(104,72,245,.28); font-weight: 850; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #ece8ff 0, transparent 34%), radial-gradient(circle at 90% 88%, #e8f2ff 0, transparent 30%), #f7f8fc; }
.login-card { width: min(460px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(40,43,78,.12); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 42px; font-size: 16px; font-weight: 800; }
.login-card h1 { margin: 0 0 12px; font-size: 30px; letter-spacing: -.5px; }
.login-copy { margin: 0 0 28px; color: var(--muted); line-height: 1.75; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: #40495e; font-size: 13px; font-weight: 750; }
.login-footnote, .password-rule { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 4px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; border-right: 1px solid #e8e9f2; background: #fff; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px; }
.brand > div { display: grid; gap: 2px; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 11px; }
.workspace-mode-switch { margin: 18px 7px 0; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border: 1px solid #e5e1fb; border-radius: 11px; background: #f7f5ff; }
.workspace-mode-option { min-width: 0; padding: 8px 6px; color: #6c6681; border-radius: 8px; text-align: center; text-decoration: none; font-size: 11px; font-weight: 800; line-height: 1.25; }
.workspace-mode-option:hover { color: #4f35d7; background: #fff; }
.workspace-mode-option.active { color: #fff; background: linear-gradient(100deg, #7658fb, #633ff0); box-shadow: 0 5px 14px rgba(104,72,245,.2); }
.workspace-mode-switch + .side-nav { margin-top: 20px; }
.side-nav { margin-top: 42px; display: grid; gap: 6px; }
.nav-item { width: 100%; padding: 12px 13px; display: flex; align-items: center; gap: 11px; color: #5f687c; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 15px; font-weight: 650; }
.nav-item span { width: 20px; color: #878fa1; text-align: center; font-size: 17px; }
.nav-item:hover { color: #34236f; background: #f7f5ff; }
.nav-item.active { color: #fff; background: linear-gradient(100deg, #7658fb, #633ff0); box-shadow: 0 9px 22px rgba(104,72,245,.22); }
.nav-item.active span { color: #fff; }
.sidebar-user { margin-top: auto; padding: 12px 8px 2px; display: grid; grid-template-columns: 36px 1fr 30px; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #5c3fe0; border-radius: 50%; background: #efecff; font-weight: 800; }
.sidebar-user div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.sidebar-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sidebar-user small { color: var(--success); font-size: 11px; }
.icon-button, .mobile-menu { border: 0; background: transparent; color: #777f91; }
.icon-button { width: 30px; height: 30px; border-radius: 8px; font-size: 18px; }
.icon-button:hover { background: #f0f1f5; }

.main-content { min-width: 0; padding: 24px 30px 64px; }
.topbar { min-height: 74px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 0 0 5px; font-size: 30px; letter-spacing: -.5px; }
.topbar p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.service-badge { padding: 8px 11px; display: inline-flex; align-items: center; gap: 7px; color: #697286; border-radius: 999px; background: #f0f2f6; font-size: 12px; font-weight: 750; white-space: nowrap; }
.service-badge i { width: 7px; height: 7px; border-radius: 50%; background: #a0a6b2; }
.service-badge.online { color: #08724f; background: var(--success-soft); }
.service-badge.online i { background: #2bc187; box-shadow: 0 0 0 3px rgba(43,193,135,.13); }
.service-badge.preparing { color: #7a5b00; background: #fff5cf; }
.service-badge.preparing i { background: #e0a600; box-shadow: 0 0 0 3px rgba(224,166,0,.13); }
.service-badge.offline { color: #a53d4b; background: var(--danger-soft); }
.service-badge.offline i { background: #d54e60; }
.mobile-menu { display: none; font-size: 22px; }

.button { min-height: 41px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: .16s ease; }
.button.primary { color: #fff; background: linear-gradient(100deg, #7658fb, #633ff0); box-shadow: 0 9px 23px rgba(104,72,245,.23); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: #4f586c; border-color: #dfe2ea; background: #fff; }
.button.warning { color: #8e5a0b; border-color: #eed99f; background: #fff8e8; }
.button:disabled { opacity: .54; cursor: not-allowed; box-shadow: none; }
.button.wide { width: 100%; margin-top: 5px; }
.text-button { padding: 7px; color: var(--primary); border: 0; background: transparent; font-weight: 700; }

.page-view { display: none; }
.page-view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-width: 0; padding: 19px 20px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 24px rgba(37,43,67,.035); }
.metric-card span { color: #596277; font-size: 14px; }
.metric-card strong { font-size: 29px; letter-spacing: -.5px; }
.metric-card small { color: #9aA1b1; font-size: 12px; }
.quick-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-card { padding: 21px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; color: inherit; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: left; box-shadow: 0 7px 24px rgba(37,43,67,.035); }
.quick-card:hover { border-color: #cfc7ff; transform: translateY(-1px); }
.quick-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; }
.quick-icon.purple { color: #6244e7; background: #efecff; }
.quick-icon.blue { color: #2d70cf; background: #eaf3ff; }
.quick-card div { display: grid; gap: 4px; }
.quick-card small { color: var(--muted); }
.quick-card b { color: #9aa1b1; font-size: 21px; }
.section-heading { margin: 30px 0 13px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.section-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.studio-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.studio-heading { padding: 21px 23px; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid #eceef4; }
.studio-heading h2 { margin: 0 0 6px; font-size: 25px; }
.studio-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.type-badge { align-self: flex-start; padding: 6px 10px; color: var(--primary); border-radius: 999px; background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.studio-layout { padding: 22px 23px; display: grid; grid-template-columns: minmax(520px, 1.1fr) minmax(390px, .9fr); grid-template-areas: "composer result"; gap: 26px; align-items: start; }
.composer-column { grid-area: composer; min-width: 0; padding-right: 26px; display: grid; align-content: start; gap: 18px; border-right: 1px solid #eceef4; }
.settings-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 15px; }
.settings-column > .field.full, .settings-column > .prompt-field { grid-column: 1 / -1; }
.settings-column > .field-grid { grid-column: 1 / -1; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { position: relative; display: grid; gap: 7px; color: #414a60; font-size: 13px; font-weight: 750; }
.field.full { width: 100%; }
.field select, .field textarea, .login-form input, .filter-row select { width: 100%; color: #182036; border: 1px solid #dfe2eb; border-radius: 9px; background: #fff; outline: none; }
.field select, .login-form input, .filter-row select { height: 43px; padding: 0 12px; }
.field textarea { min-height: 195px; padding: 13px 14px 28px; resize: vertical; line-height: 1.65; }
.field select:focus, .field textarea:focus, .login-form input:focus, .filter-row select:focus { border-color: #927efa; box-shadow: 0 0 0 3px rgba(104,72,245,.1); }
.prompt-field small { position: absolute; right: 10px; bottom: 9px; color: #a0a6b4; font-weight: 500; }
.upload-column { min-width: 0; }
.result-column { grid-area: result; min-width: 0; }
.result-column-title { min-height: 19px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; color: #40495d; font-size: 13px; }
.result-column-title span { color: var(--muted); font-size: 12px; }
.upload-title { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; color: #40495d; font-size: 13px; }
.upload-title span { color: var(--muted); }
.dropzone { min-height: 238px; padding: 24px; display: grid; place-content: center; place-items: center; gap: 8px; border: 1.5px dashed #d7d0fb; border-radius: 13px; background: #fbfaff; text-align: center; outline: none; }
.dropzone:hover, .dropzone:focus, .dropzone.dragging { border-color: var(--primary); background: #f7f4ff; }
.dropzone.disabled { opacity: .62; cursor: not-allowed; background: #f7f8fa; }
.dropzone input { display: none; }
.drop-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--primary); border-radius: 50%; background: #eeeaff; font-size: 25px; }
.dropzone strong { margin-top: 5px; font-size: 13px; }
.dropzone span { color: var(--muted); font-size: 11px; }
.preview-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.preview-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f1f2f6; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item button { position: absolute; top: 5px; right: 5px; width: 23px; height: 23px; padding: 0; color: #fff; border: 0; border-radius: 50%; background: rgba(26,28,39,.78); }
.preview-item span { position: absolute; inset: auto 4px 4px; overflow: hidden; padding: 3px 4px; color: #fff; border-radius: 4px; background: rgba(25,28,40,.7); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.studio-result-panel { min-height: 620px; max-height: 820px; padding: 14px; display: grid; align-content: start; gap: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: #fafbfe; }
.studio-result-empty { min-height: 590px; display: grid; place-items: center; padding: 24px; color: var(--muted); border: 1px dashed #d7dbe6; border-radius: 10px; text-align: center; line-height: 1.7; }
.studio-result-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.studio-result-heading > div { min-width: 0; }
.studio-result-heading strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; line-height: 1.45; }
.studio-result-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.studio-result-message { min-height: 96px; display: grid; place-items: center; padding: 18px; border-radius: 10px; text-align: center; line-height: 1.65; }
.studio-result-message.waiting { color: #6247c9; background: var(--primary-soft); }
.studio-result-message.error { color: #a43f4f; background: var(--danger-soft); }
.pending-alert { margin: 0 23px 15px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #81540f; border: 1px solid #f0d79a; border-radius: 11px; background: var(--warning-soft); }
.pending-alert p { margin: 3px 0 0; font-size: 12px; }
.submit-bar { margin: 0 23px; padding: 16px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #eceef4; }
.submit-bar > div { display: grid; gap: 4px; }
.submit-bar strong { font-size: 13px; }
.submit-bar span { color: var(--muted); font-size: 11px; }
.field-message { min-height: 20px; margin: -10px 23px 14px; color: var(--success); font-size: 12px; }
.field-message.error { color: var(--danger); }
.composer-column .pending-alert { margin: 0; }
.composer-column .submit-bar { margin: 0; padding-bottom: 0; }
.composer-column .field-message { margin: -6px 0 0; }

.job-list { display: grid; gap: 10px; }
.job-card { padding: 15px 17px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(38,43,66,.03); }
.job-kind { width: 40px; height: 40px; display: grid; place-items: center; color: var(--primary); border-radius: 10px; background: var(--primary-soft); font-size: 17px; font-weight: 800; }
.job-copy { min-width: 0; }
.job-title { display: flex; align-items: center; gap: 8px; }
.job-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.job-copy > p { margin: 5px 0 7px; display: -webkit-box; overflow: hidden; color: #4d566b; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; line-height: 1.5; }
.job-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.job-meta span { padding: 3px 7px; color: #697286; border-radius: 999px; background: #f2f3f7; font-size: 11px; }
.prompt-proof { width: max-content; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.prompt-proof.verified { color: #0d7752 !important; background: var(--success-soft) !important; }
.prompt-proof.warning { color: #8a5907 !important; background: var(--warning-soft) !important; }
.prompt-proof.pending { color: #667084 !important; background: #f0f2f6 !important; }
.job-event { margin-top: 8px !important; padding: 8px 10px; color: #7f520d !important; border-radius: 8px; background: var(--warning-soft); -webkit-line-clamp: unset !important; }
.job-event.error { color: #a33e4c !important; background: var(--danger-soft); }
.job-details { margin-top: 7px; }
.reuse-job { margin-left: 14px; }
.job-details summary { width: max-content; color: var(--primary); cursor: pointer; font-size: 11px; font-weight: 750; }
.job-details-body { margin-top: 7px; padding: 8px 10px; color: #5b6478; border-radius: 8px; background: #f7f8fb; }
.job-details-body p { margin: 3px 0; display: block; overflow: visible; color: inherit; white-space: pre-wrap; word-break: break-word; font-size: 11px; }
.job-side { min-width: 132px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.status-pill { padding: 5px 8px; color: #5c6578; border-radius: 999px; background: #f0f2f6; font-size: 11px; font-weight: 800; }
.status-pill.completed { color: #08714e; background: var(--success-soft); }
.status-pill.completed.partial { color: #8d5a08; background: var(--warning-soft); }
.status-pill.failed, .status-pill.blocked { color: #a33d4c; background: var(--danger-soft); }
.status-pill.unknown-after-submit { color: #8d5a08; background: var(--warning-soft); }
.job-time { color: #969dac; font-size: 10px; }
.asset-list { display: grid; justify-items: end; gap: 5px; }
.asset-list a { max-width: 220px; color: var(--primary); text-decoration: none; font-size: 11px; font-weight: 750; }
.asset-list small { color: #9299a8; font-size: 9px; }
.job-timeline { margin-top: 12px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.timeline-step { position: relative; min-width: 0; padding-top: 24px; color: #9aa2b1; text-align: center; }
.timeline-step::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: #e2e5ec; }
.timeline-step:first-child::before { display: none; }
.timeline-dot { position: absolute; z-index: 1; top: 2px; left: 50%; width: 16px; height: 16px; display: grid; place-items: center; color: #8e96a6; border: 2px solid #d7dbe4; border-radius: 50%; background: #fff; transform: translateX(-50%); font-size: 8px; font-weight: 850; }
.timeline-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 750; }
.timeline-step time { display: block; margin-top: 2px; overflow: hidden; color: #a1a7b3; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.timeline-step.done { color: #157853; }
.timeline-step.done::before, .timeline-step.current::before { background: #7ed6b2; }
.timeline-step.done .timeline-dot { color: #fff; border-color: #2eb781; background: #2eb781; }
.timeline-step.current { color: var(--primary); }
.timeline-step.current .timeline-dot { color: #fff; border-color: var(--primary); background: var(--primary); animation: flowPulse 1.5s ease-in-out infinite; }
.timeline-step.current.failed { color: var(--danger); }
.timeline-step.current.failed .timeline-dot { border-color: var(--danger); background: var(--danger); animation: none; }
.timeline-step.current.manual { color: var(--warning); }
.timeline-step.current.manual .timeline-dot { border-color: var(--warning); background: var(--warning); }
.result-gallery { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.studio-result-gallery { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-media-card { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fc; }
.result-media-frame { min-height: 190px; display: grid; place-items: center; overflow: hidden; background: #eef0f5; }
.result-media-frame img, .result-media-frame video { width: 100%; max-height: 420px; display: block; object-fit: contain; background: #101218; }
.result-media-frame img { aspect-ratio: 1; object-fit: cover; background: #eef0f5; cursor: zoom-in; }
.image-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto 1fr; background: rgba(8,10,18,.94); backdrop-filter: blur(5px); }
.image-lightbox.hidden { display: none; }
.image-lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; color: #fff; background: rgba(17,20,32,.96); }
.image-lightbox-toolbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.image-lightbox-toolbar div { display: flex; gap: 8px; }
.image-lightbox-toolbar button { min-width: 42px; height: 38px; padding: 0 12px; color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(255,255,255,.09); font-size: 18px; cursor: pointer; }
.image-lightbox-toolbar button:hover { background: rgba(255,255,255,.18); }
.image-lightbox-canvas { overflow: auto; display: grid; place-items: center; padding: 24px; }
.image-lightbox-canvas img { max-width: none; max-height: none; box-shadow: 0 20px 70px rgba(0,0,0,.55); user-select: none; }
body.lightbox-open { overflow: hidden; }
.preview-loading, .preview-error { padding: 18px; color: #7d8595; text-align: center; font-size: 12px; line-height: 1.55; }
.preview-error { color: var(--danger); }
.result-media-card figcaption { padding: 10px; display: grid; gap: 4px; }
.result-media-card figcaption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.result-media-card figcaption small { overflow-wrap: anywhere; color: #858d9d; font-size: 10px; }
.asset-download { width: max-content; margin-top: 3px; color: var(--primary); text-decoration: none; font-size: 11px; font-weight: 800; }
.asset-download.disabled { color: #9da4b2; pointer-events: none; }

@keyframes flowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(104,72,245,.35); }
  50% { box-shadow: 0 0 0 7px rgba(104,72,245,0); }
}
.empty-state { padding: 44px 20px; color: var(--muted); border: 1px dashed #d5d9e3; border-radius: 13px; background: rgba(255,255,255,.55); text-align: center; font-size: 13px; }
.filter-row { display: flex; gap: 8px; }
.filter-row select { width: auto; min-width: 130px; }
.date-filter { margin-bottom: 14px; padding: 10px 12px; display: flex; align-items: end; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.date-filter label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.date-filter input { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; }
.date-filter button { height: 34px; padding: 0 10px; color: #596277; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.quota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.credit-grid { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.quota-card p { margin: 14px 0 7px; color: #596277; font-size: 12px; }
.redeem-card { display: grid; gap: 10px; }
.redeem-card label { display: grid; gap: 6px; color: #596277; font-size: 12px; font-weight: 700; }
.redeem-card input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; text-transform: uppercase; }
.credit-ledger { display: grid; gap: 0; }
.credit-ledger p { margin: 0; padding: 8px 0; color: #596277; border-bottom: 1px solid #eceef4; font-size: 11px; }
.quota-card, .info-card, .api-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 25px rgba(37,43,67,.035); }
.quota-card > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.quota-card span { color: #596277; font-size: 13px; }
.quota-card strong { font-size: 22px; }
.progress { height: 8px; margin: 18px 0 10px; overflow: hidden; border-radius: 999px; background: #eceef4; }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7b5cfa, #5a3ee8); transition: width .25s ease; }
.quota-card small { color: var(--muted); }
.info-card { margin-top: 15px; }
.info-card h3, .api-card h3 { margin: 0 0 12px; }
.info-card ul { margin: 0; padding-left: 20px; color: #596277; line-height: 2; font-size: 13px; }
.api-card { display: grid; gap: 14px; }
.api-row { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 12px; }
.api-row span { color: var(--muted); font-size: 12px; }
.api-row code, .api-card pre { padding: 11px 12px; overflow: auto; color: #3e365e; border: 1px solid #ebe8fb; border-radius: 8px; background: #f8f7fd; font-family: Consolas, monospace; font-size: 11px; }
.api-card pre { margin: 0; line-height: 1.6; white-space: pre-wrap; }
.api-note { padding: 13px 15px; color: #72520e; border-radius: 10px; background: var(--warning-soft); }
.api-note p, .api-foot { margin: 4px 0 0; color: #726944; font-size: 12px; line-height: 1.6; }
.api-version-banner { margin-bottom: 16px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #3f315f; border: 1px solid #dfd8ff; border-radius: 15px; background: linear-gradient(115deg, #f5f1ff, #edf5ff); }
.api-version-banner strong { display: block; margin-bottom: 5px; font-size: 16px; }
.api-version-banner p { margin: 0; color: #716889; font-size: 12px; line-height: 1.6; }
.api-status-pill { flex: 0 0 auto; padding: 8px 12px; color: #825c0c; border-radius: 999px; background: #fff1c7; font-size: 12px; font-weight: 800; }
.api-workbench-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.api-channel-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.api-channel-card h3 { margin: 0 0 8px; }
.api-channel-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.api-channel-card dl { margin: 18px 0 0; display: grid; gap: 11px; }
.api-channel-card dl > div { padding: 11px 12px; display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; border-radius: 9px; background: #f8f8fc; }
.api-channel-card dt { color: var(--muted); font-size: 12px; }
.api-channel-card dd { margin: 0; overflow-wrap: anywhere; color: #3d3557; font-size: 12px; font-weight: 750; }
.api-step-list { margin: 14px 0 0; padding-left: 20px; color: #596277; font-size: 13px; line-height: 2; }
.api-placeholder { min-height: 360px; padding: 42px 24px; display: grid; place-items: center; border: 1px dashed #d5d0ed; border-radius: 15px; background: rgba(255,255,255,.7); text-align: center; }
.api-placeholder > div { max-width: 520px; }
.api-placeholder h2 { margin: 0 0 10px; }
.api-placeholder p { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.api-inline-link { color: var(--primary); border: 0; background: transparent; font-weight: 800; }
.permission-denied { position: relative; }
.toast { position: fixed; z-index: 100; right: 25px; bottom: 25px; max-width: min(430px, calc(100vw - 30px)); padding: 12px 16px; color: #fff; border-radius: 10px; background: #252940; box-shadow: 0 13px 36px rgba(25,28,50,.25); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a43f4e; }

/* Cloud administrator candidate. Existing customer workbench rules above remain unchanged. */
.admin-body { background: #f5f7fb; }
.admin-back-link { justify-self: center; margin-top: 5px; color: var(--primary); font-size: 13px; font-weight: 750; text-decoration: none; }
.admin-link-button { display: inline-grid; place-items: center; text-decoration: none; }
.admin-form-card { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.section-heading.compact { margin: 0 0 18px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.admin-form-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form-grid .field:last-child:nth-child(odd) { grid-column: 1 / -1; }
.admin-form-card .field input, .admin-dialog .field input, .filter-row input, .admin-dialog .field select { width: 100%; height: 43px; padding: 0 12px; color: #182036; border: 1px solid #dfe2eb; border-radius: 9px; background: #fff; outline: none; }
.admin-form-card .field input:focus, .admin-dialog .field input:focus, .filter-row input:focus, .admin-dialog .field select:focus { border-color: #927efa; box-shadow: 0 0 0 3px rgba(104,72,245,.1); }
.admin-form-actions { margin-top: 17px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.admin-form-actions .field-message { margin-right: auto; }
.admin-table-heading { align-items: center; }
.admin-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 25px rgba(37,43,67,.035); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.admin-table th { padding: 12px 14px; color: #6e778a; border-bottom: 1px solid var(--line); background: #fafbfe; text-align: left; font-size: 11px; letter-spacing: .04em; white-space: nowrap; }
.admin-table td { padding: 13px 14px; color: #40495d; border-bottom: 1px solid #eef0f5; vertical-align: middle; font-size: 12px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: #fcfcff; }
.admin-user-cell { min-width: 190px; display: grid; gap: 3px; }
.admin-user-cell strong { color: #172033; font-size: 13px; }
.admin-user-cell small { color: var(--muted); overflow-wrap: anywhere; }
.admin-status { display: inline-flex; width: max-content; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.admin-status.active, .admin-status.unused { color: #08724f; background: var(--success-soft); }
.admin-status.frozen { color: #8b5c0d; background: var(--warning-soft); }
.admin-status.disabled, .admin-status.expired { color: #a53d4b; background: var(--danger-soft); }
.admin-status.redeemed { color: #5d46c8; background: var(--primary-soft); }
.admin-row-actions { min-width: 260px; display: flex; flex-wrap: wrap; gap: 6px; }
.admin-row-actions button { min-height: 31px; padding: 0 9px; color: #535d72; border: 1px solid #dfe2ea; border-radius: 8px; background: #fff; font-size: 11px; font-weight: 700; }
.admin-row-actions button:hover { color: var(--primary); border-color: #cfc7ff; }
.admin-row-actions button.danger { color: var(--danger); border-color: #f0cbd1; }
.admin-pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.admin-price-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 25px rgba(37,43,67,.035); }
.admin-price-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.admin-price-card h3 { margin: 0 0 5px; font-size: 17px; }
.admin-price-card code { color: #766a97; font-size: 11px; overflow-wrap: anywhere; }
.admin-price-main { margin: 17px 0; display: flex; align-items: end; gap: 7px; }
.admin-price-main strong { color: var(--primary-dark); font-size: 31px; }
.admin-price-main span { padding-bottom: 5px; color: var(--muted); font-size: 12px; }
.admin-price-detail { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-price-detail div { padding: 9px 10px; border-radius: 8px; background: #f8f8fc; }
.admin-price-detail dt { color: var(--muted); font-size: 10px; }
.admin-price-detail dd { margin: 4px 0 0; color: #3f485b; font-size: 12px; font-weight: 750; }
.admin-price-card-foot { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-price-card-foot small { color: var(--muted); }
.admin-check { min-height: 43px; display: flex; align-items: center; gap: 9px; color: #414a60; font-size: 13px; font-weight: 750; }
.admin-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.admin-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 18px; background: transparent; box-shadow: 0 28px 90px rgba(28,30,48,.28); }
.admin-dialog::backdrop { background: rgba(28,31,46,.5); backdrop-filter: blur(2px); }
.admin-dialog-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.admin-dialog-wide { width: 100%; }
.admin-dialog-heading { margin-bottom: 19px; display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.admin-dialog-heading h2 { margin: 0; font-size: 23px; }
.admin-dialog .field + .field { margin-top: 14px; }
.admin-dialog .field textarea { min-height: 110px; }
.admin-price-sections { margin-top: 18px; display: grid; gap: 12px; }
.admin-price-sections fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.admin-price-sections legend { padding: 0 6px; color: #596277; font-size: 12px; font-weight: 750; }
.admin-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.admin-mini-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.admin-mini-grid input { width: 100%; height: 38px; padding: 0 9px; border: 1px solid #dfe2eb; border-radius: 8px; }
.admin-secret-note { color: #74520e; line-height: 1.65; }
.admin-secret-output { min-height: 90px; max-height: 310px; margin: 12px 0 0; padding: 15px; overflow: auto; color: #30294f; border: 1px solid #dfd9fb; border-radius: 10px; background: #f8f6ff; font-family: Consolas, monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.admin-details { display: block; max-width: 340px; overflow: hidden; color: #666f82; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, monospace; font-size: 10px; }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr); }
  .main-content { padding-inline: 20px; }
  .studio-layout { grid-template-columns: 1fr; grid-template-areas: "composer" "result"; }
  .composer-column { padding-right: 0; border-right: 0; }
  .settings-column { grid-template-columns: 1fr; }
  .settings-column > * { grid-column: 1 !important; }
  .dropzone { min-height: 190px; }
  .studio-result-panel { min-height: 300px; max-height: none; }
  .studio-result-empty { min-height: 270px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid-three, .admin-pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -238px; width: 226px; transition: left .2s ease; box-shadow: 10px 0 30px rgba(30,33,50,.14); }
  .app-shell.menu-open .sidebar { left: 0; }
  .main-content { padding: 16px 14px 48px; }
  .mobile-menu { display: block; }
  .topbar { align-items: flex-start; gap: 10px; }
  .topbar > div:nth-child(2) { flex: 1; }
  .topbar h1 { font-size: 21px; }
  .topbar #pageSubtitle { display: none; }
  .top-actions .button { display: none; }
  .service-badge { padding: 7px 9px; }
  .metric-grid, .quick-grid, .quota-grid, .credit-grid, .field-grid { grid-template-columns: 1fr; }
  .studio-heading, .studio-layout { padding: 17px; }
  .submit-bar { align-items: stretch; flex-direction: column; }
  .pending-alert { align-items: stretch; flex-direction: column; }
  .job-card { grid-template-columns: 36px minmax(0, 1fr); }
  .job-kind { width: 36px; height: 36px; }
  .job-side { grid-column: 2; min-width: 0; align-items: flex-start; }
  .job-timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 10px; }
  .timeline-step:nth-child(5)::before { display: none; }
  .studio-result-gallery, .result-gallery { grid-template-columns: 1fr; }
  .asset-list { justify-items: start; }
  .history-heading { align-items: stretch; flex-direction: column; }
  .filter-row select { min-width: 0; width: 50%; }
  .admin-table-heading { align-items: stretch; flex-direction: column; }
  .admin-table-heading .filter-row { width: 100%; }
  .admin-table-heading .filter-row input { min-width: 0; width: 100%; }
  .admin-form-grid, .admin-form-grid-three { grid-template-columns: 1fr; }
  .admin-form-grid .field:last-child:nth-child(odd) { grid-column: auto; }
  .admin-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .admin-form-actions .field-message { margin-right: 0; }
  .admin-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-actions { grid-template-columns: 1fr; }
  .date-filter { flex-wrap: wrap; }
  .api-row { grid-template-columns: 1fr; }
  .api-workbench-grid { grid-template-columns: 1fr; }
  .api-version-banner { align-items: flex-start; flex-direction: column; }
  .api-channel-card dl > div { grid-template-columns: 1fr; gap: 5px; }
  .login-card { padding: 30px 23px; }
}
