:root {
    --bg: #070912;
    --bg-soft: #0b0e19;
    --panel: rgba(16, 19, 33, .78);
    --panel-solid: #111521;
    --panel-raised: #151a29;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .15);
    --text: #f6f7fb;
    --muted: #9299ad;
    --muted-2: #697187;
    --violet: #8b5cf6;
    --blue: #5577ff;
    --cyan: #21c4c2;
    --green: #36d399;
    --red: #ff657a;
    --orange: #ffb45b;
    --shadow: 0 28px 80px rgba(0, 0, 0, .34);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.app-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 45% -20%, rgba(94, 70, 255, .14), transparent 42%),
        linear-gradient(180deg, #080a13 0%, #060810 100%);
    overflow-x: hidden;
}

.noise-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.ambient { position: fixed; width: 560px; height: 560px; border-radius: 999px; filter: blur(110px); opacity: .11; pointer-events: none; z-index: 0; }
.ambient-one { background: #6b47ff; top: -220px; right: 8%; }
.ambient-two { background: #19b8c2; bottom: -280px; left: 25%; opacity: .07; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; display: flex; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 254px;
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    background: rgba(8, 10, 18, .82);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(22px);
    z-index: 20;
}

.brand-lockup, .admin-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; }
.brand-mark svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 8px 18px rgba(96, 78, 255, .28)); }
.brand-lockup strong, .admin-brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand-lockup span span, .admin-brand small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.side-nav { display: grid; gap: 7px; margin-top: 36px; }
.side-link, .side-admin-link {
    display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 13px;
    border: 1px solid transparent; border-radius: 13px; color: var(--muted); font-size: 13px; font-weight: 600;
    transition: .2s ease;
}
.side-link svg, .side-admin-link svg { width: 20px; height: 20px; }
.side-link:hover, .side-admin-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.side-link.is-active { color: #fff; background: linear-gradient(135deg, rgba(104,82,255,.18), rgba(55,106,255,.08)); border-color: rgba(122,101,255,.18); box-shadow: inset 0 1px rgba(255,255,255,.03); }
.sidebar-spacer { flex: 1; }

.usage-card {
    padding: 16px; border: 1px solid var(--line); border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
    box-shadow: inset 0 1px rgba(255,255,255,.04);
}
.usage-card-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.usage-card-head strong { color: #fff; font-size: 15px; letter-spacing: 0; text-transform: none; }
.usage-track { height: 5px; margin: 13px 0 10px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.usage-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--blue), var(--cyan)); box-shadow: 0 0 18px rgba(81,110,255,.55); transition: width .3s ease; }
.usage-card p { margin: 0; color: var(--muted-2); font-size: 10.5px; line-height: 1.55; }
.side-admin-link { margin-top: 10px; color: var(--muted-2); }

.workspace { min-width: 0; flex: 1; margin-left: 254px; }
.topbar {
    position: sticky; top: 0; z-index: 15; height: 72px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 34px; background: rgba(7,9,18,.66); border-bottom: 1px solid rgba(255,255,255,.055); backdrop-filter: blur(22px);
}
.topbar-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.topbar-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(54,211,153,.08), 0 0 18px rgba(54,211,153,.45); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--muted); cursor: pointer; }
.icon-button:hover { color: #fff; border-color: var(--line-strong); }
.icon-button svg { width: 19px; height: 19px; }
.mobile-menu { display: none; }

.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 10px; padding: 4px 7px 4px 4px; border: 1px solid transparent; border-radius: 13px; background: transparent; cursor: pointer; }
.user-trigger:hover { border-color: var(--line); background: rgba(255,255,255,.025); }
.user-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: linear-gradient(135deg, #7758ff, #345eff); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 7px 18px rgba(73,76,255,.22); }
.user-copy { display: grid; min-width: 110px; text-align: left; }
.user-copy strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 650; }
.user-copy small { max-width: 130px; overflow: hidden; text-overflow: ellipsis; color: var(--muted-2); font-size: 9.5px; margin-top: 2px; }
.user-trigger > svg { width: 16px; height: 16px; color: var(--muted-2); }
.user-dropdown { position: absolute; top: calc(100% + 12px); right: 0; width: 280px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(18,21,34,.98); box-shadow: 0 24px 70px rgba(0,0,0,.45); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s ease; }
.user-menu.is-open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-label { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.dropdown-email { margin: 5px 0 14px; font-size: 12px; word-break: break-all; }
.switch-form { display: grid; gap: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.switch-form label { color: var(--muted); font-size: 10px; font-weight: 600; }
.switch-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #0c0f19; color: #fff; outline: none; font-size: 11px; }
.switch-form input:focus { border-color: rgba(107,88,255,.55); }
.switch-form button { height: 36px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #7356ff, #4c70ff); font-size: 11px; font-weight: 700; cursor: pointer; }

.workspace-inner { width: min(1120px, calc(100% - 60px)); margin: 0 auto; padding: 72px 0 38px; }
.hero-section { max-width: 780px; margin: 0 auto 36px; text-align: center; }
.hero-eyebrow, .field-kicker, .admin-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #9e91ff; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero-eyebrow span { width: 28px; height: 1px; background: linear-gradient(90deg, transparent, #8b6dff); }
.hero-section h1 { margin: 17px 0 18px; font-size: clamp(48px, 6vw, 78px); line-height: .96; letter-spacing: -.065em; font-weight: 760; }
.hero-section h1 span { background: linear-gradient(90deg, #b39bff 0%, #7195ff 48%, #5cd6ce 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-section p { max-width: 660px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.75; }

.creator-card {
    position: relative; overflow: hidden; padding: 30px; border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(22,25,41,.92), rgba(12,15,26,.92)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.045);
}
.creator-glow { position: absolute; width: 420px; height: 180px; top: -120px; left: 32%; border-radius: 50%; background: #684dff; opacity: .10; filter: blur(70px); pointer-events: none; }
.prompt-header { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.prompt-header h2, .section-heading h2, .admin-card-head h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.025em; }
.prompt-count { color: var(--muted-2); font-size: 10px; }
.prompt-input { position: relative; width: 100%; min-height: 164px; margin-top: 18px; padding: 21px 22px; resize: vertical; border: 1px solid var(--line); border-radius: 18px; outline: none; background: rgba(5,7,13,.64); color: #f5f6fb; font-size: 14px; line-height: 1.75; box-shadow: inset 0 1px 12px rgba(0,0,0,.18); transition: .2s ease; }
.prompt-input::placeholder { color: #555d72; }
.prompt-input:focus { border-color: rgba(112,87,255,.55); box-shadow: 0 0 0 4px rgba(103,78,255,.08), inset 0 1px 12px rgba(0,0,0,.18); }
.prompt-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 13px; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.prompt-chip, .surprise-button, .text-button { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); cursor: pointer; transition: .18s ease; }
.prompt-chip { padding: 8px 11px; font-size: 10px; font-weight: 600; }
.prompt-chip:hover { color: #fff; border-color: rgba(120,96,255,.35); background: rgba(112,86,255,.08); transform: translateY(-1px); }
.surprise-button { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 8px 11px; font-size: 10px; font-weight: 600; }
.surprise-button:hover { color: #fff; border-color: var(--line-strong); }
.surprise-button svg { width: 15px; height: 15px; }

.control-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.control-field > span { display: block; margin: 0 0 8px 2px; color: var(--muted); font-size: 10px; font-weight: 650; }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap > svg:first-child { position: absolute; left: 12px; width: 17px; height: 17px; color: #79829a; pointer-events: none; }
.select-wrap .chevron { position: absolute; right: 11px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.select-wrap select { appearance: none; width: 100%; height: 45px; padding: 0 32px 0 39px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: rgba(7,9,16,.6); color: #e9ebf3; font-size: 11px; cursor: pointer; }
.select-wrap select:focus { border-color: rgba(108,84,255,.5); }
.select-wrap option { background: #111522; }

.generate-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.generate-note { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 10px; }
.generate-note svg { width: 16px; height: 16px; }
.generate-button { position: relative; min-width: 235px; height: 52px; display: flex; align-items: center; justify-content: center; gap: 9px; overflow: hidden; padding: 0 16px 0 19px; border: 0; border-radius: 14px; background: linear-gradient(105deg, #7855ff 0%, #506eff 53%, #25bdb9 120%); color: #fff; box-shadow: 0 15px 35px rgba(79,81,255,.26), inset 0 1px rgba(255,255,255,.2); font-size: 12px; font-weight: 760; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.generate-button:hover { transform: translateY(-2px); box-shadow: 0 19px 42px rgba(79,81,255,.34), inset 0 1px rgba(255,255,255,.24); }
.generate-button:active { transform: translateY(0); }
.generate-button[disabled] { opacity: .7; cursor: wait; transform: none; }
.generate-button > svg { width: 19px; height: 19px; }
.button-shine { position: absolute; inset: -2px auto -2px -70px; width: 48px; transform: skewX(-20deg); background: rgba(255,255,255,.22); filter: blur(6px); transition: .5s ease; }
.generate-button:hover .button-shine { left: calc(100% + 30px); }
.button-cost { margin-left: 4px; padding: 5px 8px; border-radius: 8px; background: rgba(4,7,18,.18); font-size: 9px; font-weight: 600; }

.gallery-section { margin-top: 58px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.text-button { display: flex; align-items: center; gap: 7px; padding: 8px 12px; font-size: 10px; }
.text-button:hover { color: #fff; }
.text-button svg { width: 15px; height: 15px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; min-height: 220px; }
.creation-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(15,18,29,.78); box-shadow: inset 0 1px rgba(255,255,255,.025); transition: .22s ease; }
.creation-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.16); box-shadow: 0 18px 42px rgba(0,0,0,.22); }
.creation-preview { position: relative; width: 100%; aspect-ratio: 1 / .82; display: block; padding: 0; border: 0; overflow: hidden; background: #090b13; cursor: zoom-in; }
.creation-preview img { width: 100%; height: 100%; display: block; object-fit: cover; transition: .45s ease; }
.creation-card:hover .creation-preview img { transform: scale(1.035); }
.preview-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,7,13,.3); opacity: 0; transition: .2s ease; }
.preview-overlay svg { width: 30px; height: 30px; padding: 7px; border-radius: 10px; background: rgba(8,10,18,.72); backdrop-filter: blur(10px); }
.creation-preview:hover .preview-overlay { opacity: 1; }
.creation-body { padding: 14px; }
.creation-body > p { height: 35px; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #cdd1dd; font-size: 10.5px; line-height: 1.6; }
.creation-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.creation-meta span { padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,.035); color: var(--muted-2); font-size: 8.5px; }
.creation-actions { display: flex; justify-content: flex-end; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.mini-action { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); color: var(--muted); cursor: pointer; }
.mini-action:hover { color: #fff; border-color: var(--line-strong); }
.mini-action.danger:hover { color: var(--red); border-color: rgba(255,101,122,.25); }
.mini-action svg { width: 14px; height: 14px; }
.empty-gallery { grid-column: 1 / -1; min-height: 260px; display: grid; place-items: center; align-content: center; padding: 30px; border: 1px dashed rgba(255,255,255,.11); border-radius: 20px; background: rgba(255,255,255,.012); text-align: center; }
.empty-gallery h3 { margin: 15px 0 6px; font-size: 15px; }
.empty-gallery p { margin: 0; color: var(--muted-2); font-size: 11px; }
.empty-orbit { position: relative; width: 68px; height: 68px; display: grid; place-items: center; }
.empty-orbit span { position: absolute; inset: 0; border: 1px solid rgba(132,104,255,.22); border-radius: 50%; }
.empty-orbit span:nth-child(2) { inset: 8px; border-color: rgba(78,126,255,.23); }
.empty-orbit span:nth-child(3) { inset: 17px; border-color: rgba(43,202,194,.24); }
.empty-orbit svg { width: 22px; color: #9b83ff; }
.failed-card { min-height: 240px; }
.failed-visual { height: 130px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(255,101,122,.08), rgba(255,255,255,.01)); color: var(--red); }
.failed-visual svg { width: 35px; height: 35px; }
.error-copy { margin-top: 9px; color: #d98d9a; font-size: 9px; line-height: 1.5; }
.link-danger { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--red); font-size: 9px; cursor: pointer; }
.app-footer { display: flex; justify-content: space-between; padding-top: 48px; color: #51596c; font-size: 9px; }

.toast { position: fixed; top: 86px; right: 24px; z-index: 80; max-width: 360px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(17,21,33,.96); box-shadow: 0 20px 60px rgba(0,0,0,.4); font-size: 11px; animation: toastIn .3s ease; }
.toast-success { border-color: rgba(54,211,153,.25); color: #a3f1d1; }
.toast-error { border-color: rgba(255,101,122,.25); color: #ffb2be; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

.generation-overlay, .preview-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: .25s ease; }
.generation-overlay { background: rgba(4,5,10,.75); backdrop-filter: blur(15px); }
.generation-overlay.is-visible, .preview-modal.is-visible { opacity: 1; visibility: visible; }
.generation-modal { width: min(430px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.12); border-radius: 25px; background: linear-gradient(145deg, #151828, #0c0f19); box-shadow: 0 40px 100px rgba(0,0,0,.5); text-align: center; }
.generation-art { position: relative; height: 150px; overflow: hidden; display: grid; place-items: center; margin: -10px -10px 25px; border-radius: 19px; background: radial-gradient(circle, rgba(92,71,255,.22), transparent 60%), #090b14; }
.scan-line { position: absolute; left: 10%; right: 10%; height: 1px; top: 0; background: linear-gradient(90deg, transparent, #7e64ff, #59aaff, transparent); box-shadow: 0 0 12px #765fff; animation: scan 2s ease-in-out infinite; }
@keyframes scan { 50% { top: 100%; } }
.generation-core { position: relative; width: 90px; height: 90px; display: grid; place-items: center; }
.generation-core span { position: absolute; inset: 0; border: 1px solid rgba(129,99,255,.35); border-radius: 50%; animation: orbit 4s linear infinite; }
.generation-core span:nth-child(2) { inset: 10px; border-color: rgba(70,132,255,.35); animation-direction: reverse; animation-duration: 3s; }
.generation-core span:nth-child(3) { inset: 22px; border-color: rgba(36,196,188,.4); animation-duration: 2.4s; }
.generation-core span:after { content: ''; position: absolute; width: 5px; height: 5px; top: -3px; left: 50%; border-radius: 50%; background: #8f70ff; box-shadow: 0 0 10px #8f70ff; }
.generation-core svg { width: 34px; color: #ae98ff; filter: drop-shadow(0 0 15px rgba(140,108,255,.6)); }
@keyframes orbit { to { transform: rotate(360deg); } }
.modal-kicker { color: #9984ff; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.generation-modal h3 { margin: 9px 0 8px; font-size: 20px; letter-spacing: -.03em; }
.generation-modal p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.generation-progress { height: 5px; margin-top: 23px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }
.generation-progress span { display: block; width: 35%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7856ff, #477aff, #21c4bd); animation: loading 1.6s ease-in-out infinite; }
@keyframes loading { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

.preview-modal { background: rgba(3,4,8,.78); backdrop-filter: blur(14px); }
.preview-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: zoom-out; }
.preview-dialog { position: relative; width: min(1000px, 92vw); max-height: 90vh; display: grid; grid-template-columns: minmax(0, 1fr) 270px; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 24px; background: #0c0f19; box-shadow: 0 40px 110px rgba(0,0,0,.6); transform: scale(.96); transition: .25s ease; }
.preview-modal.is-visible .preview-dialog { transform: scale(1); }
.preview-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: rgba(8,10,16,.72); backdrop-filter: blur(10px); cursor: pointer; }
.preview-close svg { width: 18px; }
.preview-image-wrap { min-height: 420px; display: grid; place-items: center; overflow: hidden; background: #060810; }
.preview-image-wrap img { max-width: 100%; max-height: 90vh; display: block; object-fit: contain; }
.preview-info { display: flex; flex-direction: column; justify-content: flex-end; padding: 26px; border-left: 1px solid var(--line); }
.preview-info p { color: #c5c9d5; font-size: 11px; line-height: 1.65; }
.download-button { height: 43px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; border-radius: 12px; background: linear-gradient(135deg, #7256ff, #4a73ff); font-size: 11px; font-weight: 750; }
.download-button svg { width: 17px; }

.simple-state-page { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.simple-state-card { width: min(560px, 100%); padding: 48px; border: 1px solid var(--line-strong); border-radius: 28px; background: rgba(16,19,32,.86); box-shadow: var(--shadow); text-align: center; backdrop-filter: blur(18px); }
.state-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 20px; background: rgba(117,86,255,.1); color: #a38cff; }
.state-icon svg { width: 29px; }
.simple-state-card h1 { margin: 12px 0; font-size: 29px; letter-spacing: -.04em; }
.simple-state-card p { margin: 0 auto 25px; max-width: 440px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.static-button { width: fit-content; margin: 0 auto; padding: 0 22px; }
.error-code { font-size: 70px; font-weight: 850; letter-spacing: -.07em; background: linear-gradient(135deg, #9478ff, #4f88ff); -webkit-background-clip: text; color: transparent; }

/* Admin */
.admin-body { min-height: 100vh; background: #f3f5f9; color: #111827; }
.admin-shell { min-height: 100vh; display: flex; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; display: flex; flex-direction: column; padding: 25px 17px 18px; background: #0d111d; color: #fff; }
.admin-brand { padding: 0 7px; }
.admin-brand .brand-mark.small { width: 39px; height: 39px; }
.admin-brand small { color: #687185; }
.admin-nav { display: grid; gap: 5px; margin-top: 38px; }
.admin-nav a, .admin-sidebar-bottom a, .admin-sidebar-bottom button { min-height: 45px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 1px solid transparent; border-radius: 12px; background: none; color: #818a9e; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.admin-nav a svg, .admin-sidebar-bottom svg { width: 19px; height: 19px; }
.admin-nav a:hover, .admin-sidebar-bottom a:hover, .admin-sidebar-bottom button:hover { color: #fff; background: rgba(255,255,255,.035); }
.admin-nav a.is-active { color: #fff; background: linear-gradient(135deg, rgba(120,86,255,.2), rgba(59,105,255,.1)); border-color: rgba(124,94,255,.16); }
.admin-sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.admin-sidebar-bottom form { margin: 3px 0 0; }
.admin-sidebar-bottom button { width: 100%; }
.admin-main { min-width: 0; flex: 1; margin-left: 250px; }
.admin-topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; padding: 0 35px; background: #fff; border-bottom: 1px solid #e6e9f0; }
.admin-eyebrow { color: #7961ee; font-size: 9px; }
.admin-topbar h1 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.035em; }
.admin-identity { display: flex; align-items: center; gap: 10px; }
.admin-identity > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, #7655ff, #4975ff); color: #fff; font-size: 11px; font-weight: 800; }
.admin-identity div { display: grid; }
.admin-identity strong { font-size: 11px; }
.admin-identity small { margin-top: 2px; color: #9298a7; font-size: 9px; }
.admin-content { padding: 28px 34px 50px; }
.admin-alert { margin: 18px 34px 0; padding: 12px 15px; border: 1px solid; border-radius: 11px; font-size: 11px; }
.admin-alert.success { color: #12744f; background: #eafaf3; border-color: #bcebd7; }
.admin-alert.error { color: #a13a4a; background: #fff0f2; border-color: #f5c7ce; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 132px; padding: 20px; border: 1px solid #e5e8ef; border-radius: 17px; background: #fff; box-shadow: 0 8px 26px rgba(21,31,54,.035); }
.stat-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; flex: 0 0 auto; }
.stat-icon svg { width: 22px; }
.stat-icon.violet { color: #7658e8; background: #f1edff; }
.stat-icon.blue { color: #3f72df; background: #eaf1ff; }
.stat-icon.green { color: #159b70; background: #e6f8f1; }
.stat-icon.red { color: #d94f67; background: #fff0f2; }
.stat-card div:last-child { display: grid; }
.stat-card span { color: #7e8696; font-size: 10px; font-weight: 650; }
.stat-card strong { margin-top: 5px; font-size: 25px; letter-spacing: -.04em; }
.stat-card small { margin-top: 4px; color: #a4a9b4; font-size: 8.5px; }
.admin-grid-two { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; margin-top: 18px; }
.admin-card { border: 1px solid #e4e7ee; border-radius: 18px; background: #fff; box-shadow: 0 9px 30px rgba(20,31,50,.035); }
.admin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 23px; border-bottom: 1px solid #edf0f4; }
.admin-card-head > div > span { color: #8f96a4; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.admin-card-head h2 { margin: 5px 0 0; color: #161b28; font-size: 17px; }
.admin-card-head p { margin: 6px 0 0; color: #9299a8; font-size: 10px; line-height: 1.55; }
.admin-text-link { color: #6551d9; font-size: 10px; font-weight: 700; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 12px 15px; color: #969dab; background: #fafbfc; border-bottom: 1px solid #ebedf2; text-align: left; font-size: 8.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.admin-table td { padding: 13px 15px; border-bottom: 1px solid #f0f2f5; color: #596172; font-size: 9.5px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td strong { display: block; color: #252b38; font-size: 9.5px; }
.admin-table td small { display: block; margin-top: 3px; color: #a0a6b1; font-size: 8px; }
.prompt-cell { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt-cell > span { display: block; overflow: hidden; text-overflow: ellipsis; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 99px; font-size: 8px; font-weight: 750; }
.status-pill.completed { color: #15855e; background: #e9f9f2; }
.status-pill.failed { color: #c7465b; background: #fff0f2; }
.status-pill.processing { color: #4e67cd; background: #edf1ff; }
.status-pill.queued { color: #9b6b1c; background: #fff7e7; }
.empty-cell { padding: 35px !important; text-align: center !important; color: #a1a7b3 !important; }
.setup-list { padding: 10px 17px 4px; }
.setup-list a { display: grid; grid-template-columns: 31px 1fr 15px; align-items: center; gap: 10px; padding: 13px 6px; border-bottom: 1px solid #eef0f4; }
.setup-list a > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: #f0edff; color: #7159df; font-size: 9px; font-weight: 800; }
.setup-list strong { display: block; font-size: 10px; }
.setup-list small { display: block; margin-top: 3px; color: #9ba1ad; font-size: 8px; }
.setup-list b { color: #a0a6b3; font-size: 12px; }
.demo-note { margin: 16px; padding: 15px; border: 1px solid #e5defe; border-radius: 13px; background: linear-gradient(145deg, #f8f6ff, #f1f5ff); }
.demo-note strong { color: #5c48bb; font-size: 10px; }
.demo-note p { margin: 5px 0 0; color: #83899a; font-size: 8.5px; line-height: 1.55; }

.admin-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.form-card { overflow: hidden; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 23px; }
.admin-field { display: block; }
.admin-field.full { grid-column: 1 / -1; }
.admin-field > span, .compact-field > span { display: block; margin-bottom: 7px; color: #555e6e; font-size: 9.5px; font-weight: 700; }
.admin-field input, .admin-field select, .admin-field textarea, .compact-field input { width: 100%; border: 1px solid #dfe3ea; border-radius: 11px; outline: none; background: #fbfcfd; color: #202633; font-size: 10.5px; transition: .18s ease; }
.admin-field input, .admin-field select { height: 42px; padding: 0 12px; }
.admin-field textarea { padding: 11px 12px; resize: vertical; line-height: 1.55; }
.admin-field input:focus, .admin-field select:focus, .admin-field textarea:focus, .compact-field input:focus { border-color: #8c76ed; box-shadow: 0 0 0 3px rgba(112,83,225,.08); background: #fff; }
.admin-field small { display: block; margin-top: 5px; color: #a0a6b1; font-size: 8px; line-height: 1.45; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 72px; }
.input-suffix b { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #9aa0ac; font-size: 8px; font-weight: 600; }
.toggle-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 0; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; width: 38px; height: 21px; border-radius: 99px; background: #dce0e8; flex: 0 0 auto; transition: .2s ease; }
.toggle-ui:after { content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: .2s ease; }
.toggle-row input:checked + .toggle-ui { background: linear-gradient(90deg, #7357e7, #5275ec); }
.toggle-row input:checked + .toggle-ui:after { left: 20px; }
.toggle-row strong { display: block; font-size: 9.5px; }
.toggle-row small { display: block; margin-top: 3px; color: #9ca2ae; font-size: 8px; }
.danger-toggle { grid-column: 1 / -1; padding: 13px; border: 1px solid #f2d9de; border-radius: 12px; background: #fff8f9; }
.side-help { padding-bottom: 20px; align-self: start; overflow: hidden; }
.side-help > h3, .side-help > p, .side-help > ol, .side-help > .security-box { margin-left: 20px; margin-right: 20px; }
.side-help h3 { margin-top: 18px; margin-bottom: 8px; font-size: 13px; }
.side-help p, .side-help li { color: #7f8797; font-size: 9px; line-height: 1.65; }
.side-help ol { padding-left: 18px; }
.side-help code { padding: 2px 4px; border-radius: 4px; background: #f0edf9; color: #654dc7; font-size: 8px; }
.provider-visual { height: 145px; display: grid; place-items: center; background: radial-gradient(circle, rgba(113,84,231,.18), transparent 57%), linear-gradient(145deg, #f7f5ff, #eff4ff); border-bottom: 1px solid #e8e8f1; }
.provider-orbit { position: relative; width: 82px; height: 82px; display: grid; place-items: center; }
.provider-orbit span { position: absolute; inset: 0; border: 1px solid rgba(107,80,220,.24); border-radius: 50%; }
.provider-orbit span:nth-child(2) { inset: 12px; border-color: rgba(57,112,224,.25); }
.provider-orbit i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #7455e9, #4e79ed); color: #fff; font-size: 11px; font-style: normal; font-weight: 850; box-shadow: 0 10px 25px rgba(83,77,220,.22); }
.security-box { padding: 12px; border: 1px solid #dfe9f3; border-radius: 11px; background: #f7fafc; }
.security-box strong { color: #3f5266; font-size: 9px; }
.security-box p { margin: 4px 0 0; }
.limit-preview { margin: 20px; padding: 22px; border-radius: 16px; background: linear-gradient(145deg, #101725, #17233a); color: #fff; text-align: center; }
.limit-preview > span { color: #9fa9bb; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.limit-preview > strong { display: block; margin: 7px 0 1px; font-size: 36px; letter-spacing: -.05em; }
.limit-preview > small { color: #7f899c; font-size: 8px; }
.limit-preview > div { display: flex; justify-content: center; gap: 4px; margin-top: 16px; }
.limit-preview i { width: 28px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, #7759ea, #4a7bea); }
.form-submit-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border: 1px solid #e3e6ed; border-radius: 15px; background: #fff; }
.form-submit-bar div { display: grid; }
.form-submit-bar strong { font-size: 10px; }
.form-submit-bar span { margin-top: 3px; color: #9ca2ae; font-size: 8.5px; }
.admin-primary-button { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #7255e8, #4e76ed); color: #fff; box-shadow: 0 9px 22px rgba(79,82,218,.17); font-size: 10px; font-weight: 750; cursor: pointer; }
.admin-primary-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.admin-primary-button svg { width: 17px; }

.users-head, .jobs-head { align-items: center; }
.admin-search { display: flex; align-items: center; width: 300px; height: 39px; border: 1px solid #e0e4eb; border-radius: 11px; overflow: hidden; background: #fbfcfd; }
.admin-search svg { width: 16px; margin-left: 11px; color: #9ba2af; }
.admin-search input { min-width: 0; flex: 1; height: 100%; padding: 0 9px; border: 0; outline: none; background: transparent; font-size: 9.5px; }
.admin-search button { height: 31px; margin-right: 4px; padding: 0 11px; border: 0; border-radius: 8px; background: #161c29; color: #fff; font-size: 8.5px; cursor: pointer; }
.user-admin-list { padding: 6px 20px 20px; }
.user-admin-row { display: grid; grid-template-columns: minmax(260px, 1.4fr) 80px 140px 95px 90px 60px; align-items: center; gap: 14px; padding: 16px 2px; border-bottom: 1px solid #edf0f3; }
.user-admin-row:last-child { border-bottom: 0; }
.user-profile-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-avatar.large { width: 39px; height: 39px; flex: 0 0 auto; }
.user-profile-cell div { min-width: 0; }
.user-profile-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; }
.user-profile-cell small { display: block; margin-top: 4px; color: #9ba1ad; font-size: 7.5px; }
.usage-mini { display: grid; }
.usage-mini span { color: #9aa1ad; font-size: 8px; }
.usage-mini strong { margin-top: 3px; font-size: 16px; }
.compact-field input { height: 35px; padding: 0 9px; }
.check-control { display: flex; align-items: center; gap: 7px; color: #606878; font-size: 8.5px; cursor: pointer; }
.check-control input { position: absolute; opacity: 0; }
.check-control span { width: 16px; height: 16px; border: 1px solid #d7dce5; border-radius: 5px; background: #fff; }
.check-control input:checked + span { border-color: #6f56de; background: #6f56de url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.check-control.danger input:checked + span { border-color: #e55369; background-color: #e55369; }
.save-row-button { height: 32px; border: 1px solid #ded9f5; border-radius: 9px; background: #f5f2ff; color: #674ed1; font-size: 8.5px; font-weight: 750; cursor: pointer; }
.empty-admin-state { padding: 45px; color: #999faa; text-align: center; font-size: 10px; }
.status-filters { display: flex; gap: 4px; padding: 4px; border: 1px solid #e4e7ed; border-radius: 10px; background: #f8f9fb; }
.status-filters a { padding: 7px 9px; border-radius: 7px; color: #8a919e; font-size: 8.5px; font-weight: 650; }
.status-filters a.active { background: #fff; color: #5f49c4; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.jobs-table .prompt-cell { max-width: 320px; }
.row-error { color: #d45b6e !important; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.table-delete { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid #f0dce0; border-radius: 8px; background: #fff7f8; color: #d35265; cursor: pointer; }
.table-delete svg { width: 14px; }

/* Admin login */
.admin-login-body { min-height: 100vh; overflow: hidden; background: #080b13; color: #fff; }
.admin-login-glow { position: fixed; width: 580px; height: 580px; border-radius: 50%; filter: blur(120px); opacity: .14; }
.admin-login-glow.one { top: -260px; left: -100px; background: #6b48ff; }
.admin-login-glow.two { right: -180px; bottom: -280px; background: #1ab8c0; opacity: .08; }
.admin-login-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; }
.login-showcase { display: flex; flex-direction: column; justify-content: space-between; padding: 42px 7vw 45px; border-right: 1px solid rgba(255,255,255,.07); background: radial-gradient(circle at 20% 40%, rgba(110,79,255,.11), transparent 42%); }
.admin-brand.light { padding: 0; }
.admin-brand.light small { color: #737c90; }
.login-copy { max-width: 640px; }
.login-copy > span { color: #9e8bff; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.login-copy h1 { margin: 14px 0 18px; font-size: clamp(40px, 4.6vw, 67px); line-height: 1.02; letter-spacing: -.055em; }
.login-copy p { max-width: 560px; margin: 0; color: #8991a3; font-size: 13px; line-height: 1.75; }
.login-metrics { display: flex; gap: 45px; }
.login-metrics div { display: grid; }
.login-metrics strong { font-size: 14px; }
.login-metrics span { margin-top: 4px; color: #687186; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.login-panel { display: grid; place-items: center; padding: 35px; }
.admin-login-form { width: min(390px, 100%); }
.login-form-head h2 { margin: 9px 0 7px; font-size: 30px; letter-spacing: -.04em; }
.login-form-head p { margin: 0 0 26px; color: #7f879a; font-size: 11px; }
.admin-login-form .admin-field { margin-top: 15px; }
.admin-login-form .admin-field > span { color: #b1b6c2; }
.admin-login-form .admin-field input { height: 48px; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.035); color: #fff; }
.admin-login-form .admin-field input::placeholder { color: #50586b; }
.admin-login-form .admin-primary-button { width: 100%; height: 50px; margin-top: 20px; }
.back-studio { display: block; margin-top: 18px; color: #70798d; font-size: 9px; text-align: center; }
.admin-login-form .admin-alert { margin: 0 0 12px; }

@media (max-width: 1180px) {
    .control-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .user-admin-row { grid-template-columns: minmax(230px, 1.4fr) 70px 130px 90px 60px; }
    .user-admin-row .check-control.danger { grid-column: 2; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.4); }
    .sidebar.is-open { transform: translateX(0); }
    .workspace { margin-left: 0; }
    .mobile-menu { display: grid; gap: 4px; width: 36px; height: 36px; place-content: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
    .mobile-menu span { width: 15px; height: 1.5px; background: #d6d9e2; }
    .topbar-status { display: none; }
    .workspace-inner { width: min(100% - 32px, 760px); padding-top: 48px; }
    .hero-section h1 { font-size: 52px; }
    .generate-row { align-items: stretch; flex-direction: column; }
    .generate-button { width: 100%; }
    .preview-dialog { grid-template-columns: 1fr; }
    .preview-info { border-left: 0; border-top: 1px solid var(--line); }

    .admin-sidebar { width: 210px; }
    .admin-main { margin-left: 210px; }
    .admin-topbar { padding: 0 24px; }
    .admin-content { padding: 22px; }
    .admin-alert { margin-left: 22px; margin-right: 22px; }
    .admin-grid-two, .admin-form-grid { grid-template-columns: 1fr; }
    .form-submit-bar { grid-column: 1; }
    .side-help { display: none; }
    .user-admin-row { grid-template-columns: 1fr 80px 130px; }
    .user-admin-row .check-control, .user-admin-row .save-row-button { grid-row: 2; }
    .admin-login-shell { grid-template-columns: 1fr; }
    .login-showcase { display: none; }
}

@media (max-width: 680px) {
    .topbar { height: 62px; padding: 0 16px; }
    .user-copy { display: none; }
    .user-trigger { padding-right: 4px; }
    .icon-button { display: none; }
    .workspace-inner { width: calc(100% - 24px); padding-top: 36px; }
    .hero-section { margin-bottom: 27px; }
    .hero-section h1 { font-size: 43px; }
    .hero-section p { font-size: 12px; }
    .creator-card { padding: 20px; border-radius: 22px; }
    .prompt-header h2 { font-size: 18px; }
    .prompt-input { min-height: 145px; padding: 16px; }
    .prompt-actions { align-items: flex-start; flex-direction: column; }
    .control-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: center; }
    .app-footer { flex-direction: column; gap: 6px; }
    .preview-dialog { width: 96vw; }
    .preview-image-wrap { min-height: 300px; }

    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; }
    .admin-topbar { height: 78px; padding: 0 16px; }
    .admin-identity div { display: none; }
    .admin-content { padding: 16px; }
    .admin-alert { margin: 14px 16px 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-grid-two { grid-template-columns: 1fr; padding: 17px; }
    .admin-field.full, .danger-toggle { grid-column: 1; }
    .form-submit-bar { align-items: stretch; flex-direction: column; gap: 12px; }
    .admin-search { width: 100%; }
    .users-head, .jobs-head { align-items: stretch; flex-direction: column; }
    .status-filters { overflow-x: auto; }
    .user-admin-row { grid-template-columns: 1fr 70px; }
    .user-admin-row .compact-field { grid-column: 1 / -1; }
    .user-admin-row .check-control, .user-admin-row .save-row-button { grid-row: auto; }
    .login-panel { padding: 24px; }
}

/* =========================================================
   Studio V3 — fixed navigation + fixed creation panel
   ========================================================= */
.app-body:has(.studio-app) {
    min-height: 100vh;
    overflow: hidden;
    background: #18172f;
}
.app-body:has(.studio-app) .ambient,
.app-body:has(.studio-app) .noise-layer { display: none; }

.studio-app {
    --studio-bg: #1a1933;
    --studio-panel: #242340;
    --studio-nav: #111223;
    --studio-field: #18182f;
    --studio-line: rgba(255,255,255,.085);
    --studio-line-strong: rgba(255,255,255,.14);
    --studio-text: #f7f5ff;
    --studio-muted: #9a98b5;
    --studio-purple: #a24cff;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    color: var(--studio-text);
    background: var(--studio-bg);
}

.studio-nav-sidebar {
    position: relative;
    z-index: 30;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 25px 16px 17px;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,.07);
    background:
        radial-gradient(circle at 20% 0, rgba(127,72,255,.13), transparent 28%),
        linear-gradient(180deg, #121326 0%, #0f1020 100%);
    box-shadow: 18px 0 45px rgba(5,5,15,.18);
}
.studio-nav-brand { display: flex; align-items: center; gap: 12px; padding: 2px 7px; color: #fff; }
.studio-nav-mark { width: 42px; height: 42px; flex: 0 0 auto; }
.studio-nav-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 20px rgba(117,74,255,.32)); }
.studio-nav-brand > span:last-child { min-width: 0; display: grid; }
.studio-nav-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; letter-spacing: -.025em; }
.studio-nav-brand small { margin-top: 4px; color: #747891; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.studio-nav-links { display: grid; gap: 7px; margin-top: 38px; }
.studio-nav-links a,
.studio-nav-links button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: #81849d;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}
.studio-nav-links svg { width: 20px; height: 20px; flex: 0 0 auto; }
.studio-nav-links a:hover,
.studio-nav-links button:hover { color: #fff; background: rgba(255,255,255,.045); }
.studio-nav-links a.is-active {
    color: #fff;
    border-color: rgba(157,91,255,.23);
    background: linear-gradient(135deg, rgba(141,79,255,.2), rgba(77,83,225,.11));
    box-shadow: inset 0 1px rgba(255,255,255,.04), 0 10px 24px rgba(0,0,0,.12);
}
.studio-nav-spacer { flex: 1; }
.studio-nav-usage {
    padding: 15px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 15px;
    background: rgba(255,255,255,.035);
    box-shadow: inset 0 1px rgba(255,255,255,.03);
}
.studio-nav-usage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.studio-nav-usage-head span { color: #8589a2; font-size: 11px; font-weight: 700; }
.studio-nav-usage-head strong { color: #c686ff; font-size: 13px; }
.studio-nav-usage-track { height: 5px; overflow: hidden; margin-top: 12px; border-radius: 99px; background: rgba(255,255,255,.075); }
.studio-nav-usage-track span { display: block; height: 100%; min-width: 5px; border-radius: inherit; background: linear-gradient(90deg, #8354ff, #c249f0); box-shadow: 0 0 14px rgba(172,71,246,.42); transition: width .3s ease; }
.studio-nav-usage p { margin: 9px 0 0; color: #676b83; font-size: 9.5px; line-height: 1.45; }
.studio-nav-footer { display: flex; align-items: center; gap: 8px; padding: 15px 8px 1px; color: #656980; font-size: 10px; font-weight: 650; }
.studio-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #35d59a; box-shadow: 0 0 0 4px rgba(53,213,154,.08), 0 0 12px rgba(53,213,154,.32); }

.studio-main-shell { min-width: 0; height: 100vh; display: grid; grid-template-rows: 68px minmax(0,1fr); }
.studio-header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-top: 5px solid #7040aa;
    border-bottom: 1px solid var(--studio-line);
    background: rgba(31,31,58,.96);
    box-shadow: 0 10px 30px rgba(7,7,18,.08);
}
.studio-header-left { display: flex; align-items: center; gap: 12px; }
.studio-mobile-nav { display: none; width: 38px; height: 38px; place-content: center; gap: 4px; padding: 0; border: 1px solid var(--studio-line); border-radius: 11px; background: rgba(255,255,255,.03); }
.studio-mobile-nav span { width: 16px; height: 1.5px; border-radius: 2px; background: #e7e5f4; }
.studio-breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.studio-breadcrumb a { color: #77758f; }
.studio-breadcrumb span { color: #4f4d69; }
.studio-breadcrumb strong { color: #dedbea; font-weight: 750; }
.studio-header-actions { display: flex; align-items: center; gap: 13px; }
.studio-usage-inline { min-height: 34px; display: flex; align-items: center; padding: 0 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.025); color: #85829f; font-size: 11px; }
.studio-usage-inline strong { margin-left: 4px; color: #bb75ff; font-weight: 850; }
.studio-user-menu { position: relative; }
.studio-user-trigger { display: flex; align-items: center; gap: 10px; min-width: 174px; padding: 4px 7px 4px 4px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; }
.studio-user-trigger:hover { border-color: var(--studio-line); background: rgba(255,255,255,.025); }
.studio-avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, #24bae9, #6170ff); font-size: 12px; font-weight: 850; box-shadow: 0 8px 18px rgba(43,151,235,.18); }
.studio-user-copy { display: grid; min-width: 0; flex: 1; text-align: left; }
.studio-user-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.studio-user-copy small { max-width: 115px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; color: #777594; font-size: 9px; }
.studio-user-trigger > svg { width: 15px; color: #777594; }
.studio-user-dropdown { top: calc(100% + 10px); background: #20203a; border-color: var(--studio-line-strong); }

.studio-layout { min-height: 0; display: grid; grid-template-columns: 318px minmax(0, 1fr); }
.studio-control-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--studio-line);
    background: linear-gradient(180deg, #272642 0%, #24233f 100%);
}
.studio-control-heading { padding: 20px 15px 13px; }
.studio-control-heading > span { color: #9f6af5; font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.studio-control-heading h1 { margin: 5px 0 0; font-size: 19px; line-height: 1.1; letter-spacing: -.035em; }
.studio-control-heading p { margin: 5px 0 0; color: #8582a3; font-size: 11px; }
.studio-form-fixed { min-height: 0; flex: 1; padding: 3px 14px 14px; overflow: hidden; }
.studio-field-group { position: relative; }
.studio-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.studio-label-row label,
.studio-select-field > span { color: #e9e6f4; font-size: 11.5px; font-weight: 750; }
.studio-surprise { padding: 0; border: 0; background: none; color: #b86bff; font-size: 10.5px; font-weight: 800; cursor: pointer; }
.studio-field-group textarea {
    width: 100%;
    height: 126px;
    resize: none;
    padding: 13px 13px 25px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    outline: none;
    background: #18182f;
    color: #f5f3ff;
    font-size: 12.5px;
    line-height: 1.55;
    box-shadow: inset 0 1px 8px rgba(0,0,0,.14);
}
.studio-field-group textarea::placeholder { color: #74718e; }
.studio-field-group textarea:focus { border-color: rgba(170,83,255,.55); box-shadow: 0 0 0 3px rgba(154,77,255,.08); }
.studio-field-group textarea:disabled,
.studio-select-wrap select:disabled { opacity: .68; cursor: wait; }
.studio-character-count { position: absolute; left: 0; bottom: -17px; color: #777493; font-size: 9px; }
.studio-select-field { display: block; margin-top: 20px; }
.studio-select-field > span { display: block; margin-bottom: 7px; }
.studio-select-wrap { position: relative; }
.studio-select-wrap select { appearance: none; width: 100%; height: 42px; padding: 0 36px 0 12px; border: 1px solid rgba(255,255,255,.075); border-radius: 10px; outline: none; background: #18182f; color: #f3f1ff; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.studio-select-wrap select:focus { border-color: rgba(163,81,255,.52); }
.studio-select-wrap option { background: #19192f; color: #fff; }
.studio-select-wrap svg { position: absolute; top: 50%; right: 11px; width: 14px; transform: translateY(-50%); color: #797694; pointer-events: none; }
.studio-advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.studio-advanced-grid .studio-select-field { margin-top: 14px; }
.studio-generate-button { position: relative; width: 100%; height: 47px; display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; margin-top: 18px; padding: 0 13px; border: 0; border-radius: 11px; background: linear-gradient(100deg, #8150f2 0%, #b246eb 100%); color: #fff; box-shadow: 0 12px 25px rgba(137,64,221,.24), inset 0 1px rgba(255,255,255,.18); font-size: 12.5px; font-weight: 850; cursor: pointer; transition: .18s ease; }
.studio-generate-button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.studio-generate-button:disabled { opacity: .68; cursor: wait; transform: none; }
.studio-generate-button svg { width: 17px; }
.studio-generate-button small { margin-left: auto; color: rgba(255,255,255,.72); font-size: 9px; font-weight: 700; }
.studio-button-glow { position: absolute; inset: -80% 50% -80% -20%; background: rgba(255,255,255,.12); transform: rotate(22deg); filter: blur(14px); }
.studio-reset-note { margin-top: 7px; color: #76738f; font-size: 9px; line-height: 1.4; text-align: center; }
.studio-recent-section { margin-top: 17px; padding: 10px; border: 1px solid transparent; border-radius: 12px; transition: .25s ease; }
.studio-recent-section.is-highlighted { border-color: rgba(178,96,255,.4); background: rgba(168,83,255,.055); }
.studio-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.studio-section-title > span { color: #777491; font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.studio-section-title button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #777493; cursor: pointer; }
.studio-section-title button:hover { background: rgba(255,255,255,.05); color: #fff; }
.studio-section-title svg { width: 14px; }
.studio-recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.studio-recent-thumb { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 9px; background: #17172d; cursor: pointer; transition: .18s ease; }
.studio-recent-thumb:hover { transform: translateY(-1px); border-color: rgba(181,102,255,.45); }
.studio-recent-thumb.is-active { border-color: #ae5cff; box-shadow: 0 0 0 2px rgba(174,92,255,.12); }
.studio-recent-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.studio-empty-recent { grid-column: 1 / -1; min-height: 72px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 10px; border: 1px dashed rgba(255,255,255,.1); border-radius: 10px; color: #706d8d; text-align: center; font-size: 9px; }
.studio-empty-recent svg { width: 21px; }

.studio-canvas-area { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 64px; background: #191832; }
.studio-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 28px; }
.studio-stage::before { content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%; background: rgba(125,65,213,.07); filter: blur(90px); pointer-events: none; }
.studio-stage::after { content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle, #000 0%, transparent 72%); }
.studio-main-preview { position: relative; z-index: 2; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; overflow: hidden; background: #0b0b15; box-shadow: 0 28px 65px rgba(0,0,0,.36), 0 0 0 1px rgba(255,255,255,.025); cursor: zoom-in; transition: width .18s ease, height .18s ease; }
.studio-main-preview.is-hidden { display: none; }
.studio-main-preview img { width: 100%; height: 100%; display: block; object-fit: contain; background: #0b0b15; }
.studio-zoom-hint { position: absolute; right: 12px; bottom: 12px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(11,10,21,.76); color: #ddd9eb; font-size: 10px; opacity: 0; backdrop-filter: blur(8px); transition: .18s ease; }
.studio-main-preview:hover .studio-zoom-hint { opacity: 1; }
.studio-stage-empty { position: relative; z-index: 2; display: grid; place-items: center; align-content: center; text-align: center; }
.studio-stage-empty.is-hidden { display: none; }
.studio-empty-icon { width: 88px; height: 88px; display: grid; place-items: center; border: 1px solid rgba(168,87,255,.17); border-radius: 28px; background: rgba(137,71,220,.07); color: #9a5bdf; box-shadow: 0 18px 60px rgba(0,0,0,.18); }
.studio-empty-icon svg { width: 40px; }
.studio-stage-empty h2 { margin: 20px 0 7px; font-size: 23px; letter-spacing: -.035em; }
.studio-stage-empty p { margin: 0; color: #77748e; font-size: 13px; }
.studio-stage-footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 21px; border-top: 1px solid var(--studio-line); background: #1c1b36; }
.studio-result-copy { min-width: 0; display: flex; align-items: center; gap: 8px; }
.studio-result-copy p { max-width: min(39vw, 650px); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dedbea; font-size: 11px; }
.studio-result-copy p::after { content: '·'; margin-left: 8px; color: #5f5c76; }
.studio-result-copy span { flex: 0 0 auto; color: #85829e; font-size: 10px; }
.studio-result-actions { display: flex; align-items: center; gap: 8px; }
.studio-action-button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.025); color: #f4f1ff; font-size: 11px; font-weight: 800; cursor: pointer; }
.studio-action-button:hover { border-color: rgba(176,99,255,.45); background: rgba(154,77,255,.08); }
.studio-action-button svg { width: 15px; }
.studio-action-button.is-disabled { opacity: .34; pointer-events: none; }
.studio-delete-action { width: 37px; padding: 0; color: #d78aa0; }
.studio-nav-backdrop { position: fixed; inset: 0; z-index: 25; display: none; border: 0; background: rgba(5,5,15,.68); backdrop-filter: blur(4px); }

@media (max-width: 1320px) {
    .studio-app { grid-template-columns: 208px minmax(0,1fr); }
    .studio-layout { grid-template-columns: 300px minmax(0,1fr); }
    .studio-nav-links a, .studio-nav-links button { padding: 0 12px; font-size: 12px; }
    .studio-result-copy span { display: none; }
}

@media (max-width: 1060px) {
    .studio-app { display: block; }
    .studio-nav-sidebar { position: fixed; inset: 0 auto 0 0; width: 228px; transform: translateX(-105%); transition: transform .23s ease; }
    .studio-nav-sidebar.is-open { transform: translateX(0); }
    .studio-nav-backdrop.is-visible { display: block; }
    .studio-mobile-nav { display: grid; }
    .studio-main-shell { width: 100%; }
}

@media (max-height: 790px) and (min-width: 761px) {
    .studio-control-heading { padding-top: 14px; padding-bottom: 8px; }
    .studio-control-heading h1 { font-size: 17px; }
    .studio-field-group textarea { height: 104px; }
    .studio-select-field { margin-top: 16px; }
    .studio-advanced-grid .studio-select-field { margin-top: 11px; }
    .studio-select-wrap select { height: 38px; }
    .studio-generate-button { height: 43px; margin-top: 13px; }
    .studio-reset-note { margin-top: 5px; }
    .studio-recent-section { margin-top: 9px; }
    .studio-recent-thumb { max-height: 58px; }
}

@media (max-width: 760px) {
    .app-body:has(.studio-app) { overflow: auto; }
    .studio-main-shell { height: auto; min-height: 100vh; display: block; }
    .studio-header { height: 62px; padding: 0 13px; border-top-width: 4px; }
    .studio-breadcrumb { display: none; }
    .studio-usage-inline, .studio-user-copy { display: none; }
    .studio-user-trigger { min-width: 0; padding: 2px; }
    .studio-layout { display: flex; flex-direction: column; }
    .studio-control-panel { overflow: visible; border-right: 0; border-bottom: 1px solid var(--studio-line); }
    .studio-form-fixed { overflow: visible; padding-bottom: 21px; }
    .studio-field-group textarea { height: 130px; }
    .studio-recent-grid { max-width: 280px; }
    .studio-canvas-area { min-height: 610px; grid-template-rows: minmax(490px,1fr) auto; }
    .studio-stage { padding: 23px 14px; }
    .studio-stage-footer { min-height: 108px; align-items: flex-start; flex-direction: column; padding: 15px; }
    .studio-result-copy { display: block; }
    .studio-result-copy p { max-width: calc(100vw - 30px); white-space: normal; line-height: 1.5; }
    .studio-result-copy p::after { display: none; }
    .studio-result-actions { width: 100%; }
    .studio-action-button { flex: 1; }
    .studio-delete-action { flex: 0 0 38px; }
}

/* =========================================================
   Admin V3 — premium control center
   ========================================================= */
.admin-body {
    background:
        radial-gradient(circle at 84% 0, rgba(104,83,224,.07), transparent 28%),
        linear-gradient(180deg, #f4f6fb 0%, #eef1f7 100%);
}
.admin-sidebar {
    width: 282px;
    padding: 28px 20px 20px;
    border-right: 1px solid rgba(255,255,255,.05);
    background:
        radial-gradient(circle at 0 0, rgba(113,80,244,.16), transparent 30%),
        linear-gradient(180deg, #101421 0%, #0b0f1a 100%);
    box-shadow: 18px 0 50px rgba(16,22,36,.08);
}
.admin-main { margin-left: 282px; }
.admin-brand { display: flex; align-items: center; gap: 13px; padding: 0 8px; }
.admin-brand strong { font-size: 17px; letter-spacing: -.025em; }
.admin-brand small { margin-top: 4px; color: #687185; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.admin-brand .brand-mark.small { width: 44px; height: 44px; }
.admin-nav { gap: 7px; margin-top: 42px; }
.admin-nav a, .admin-sidebar-bottom a, .admin-sidebar-bottom button { min-height: 51px; padding: 0 15px; border-radius: 13px; color: #8991a4; font-size: 13px; font-weight: 700; }
.admin-nav a svg, .admin-sidebar-bottom svg { width: 21px; height: 21px; }
.admin-nav a:hover, .admin-sidebar-bottom a:hover, .admin-sidebar-bottom button:hover { color: #fff; background: rgba(255,255,255,.045); }
.admin-nav a.is-active { color: #fff; border-color: rgba(139,101,255,.22); background: linear-gradient(135deg, rgba(127,86,255,.22), rgba(58,103,236,.12)); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 11px 28px rgba(3,4,12,.12); }
.admin-sidebar-bottom { border-top-color: rgba(255,255,255,.075); }
.admin-topbar { position: sticky; top: 0; z-index: 20; height: 104px; padding: 0 39px; border-bottom: 1px solid #e2e6ef; background: rgba(255,255,255,.9); box-shadow: 0 8px 25px rgba(25,34,55,.035); backdrop-filter: blur(18px); }
.admin-topbar-copy { display: flex; align-items: center; gap: 14px; }
.admin-topbar h1 { margin-top: 7px; font-size: 29px; letter-spacing: -.045em; }
.admin-eyebrow { color: #755be4; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.admin-health-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 11px; border: 1px solid #dcebe5; border-radius: 999px; background: #f1fbf7; color: #267a5d; font-size: 11px; font-weight: 750; }
.admin-health-pill i { width: 7px; height: 7px; border-radius: 50%; background: #2ec58d; box-shadow: 0 0 0 4px rgba(46,197,141,.1); }
.admin-identity { padding: 5px 7px 5px 5px; border: 1px solid #e5e8ef; border-radius: 13px; background: #fff; box-shadow: 0 7px 20px rgba(26,35,55,.05); }
.admin-identity > span { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
.admin-identity strong { font-size: 13px; }
.admin-identity small { font-size: 10.5px; }
.admin-content { max-width: 1680px; padding: 32px 39px 60px; }
.admin-alert { margin: 20px 39px 0; padding: 14px 17px; border-radius: 13px; font-size: 13px; box-shadow: 0 8px 22px rgba(20,30,50,.04); }
.stats-grid { gap: 18px; }
.stat-card { position: relative; min-height: 150px; padding: 24px; overflow: hidden; border-color: #e2e6ef; border-radius: 20px; box-shadow: 0 12px 35px rgba(26,37,60,.055); transition: .2s ease; }
.stat-card::after { content: ''; position: absolute; inset: auto -45px -65px auto; width: 135px; height: 135px; border-radius: 50%; background: rgba(102,79,226,.045); }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 17px 42px rgba(26,37,60,.08); }
.stat-icon { width: 52px; height: 52px; border-radius: 16px; }
.stat-icon svg { width: 24px; }
.stat-card span { font-size: 12px; }
.stat-card strong { margin-top: 6px; font-size: 32px; }
.stat-card small { font-size: 10.5px; }
.admin-grid-two { grid-template-columns: minmax(0,1fr) 340px; gap: 20px; margin-top: 20px; }
.admin-card { position: relative; border-color: #e1e5ee; border-radius: 21px; box-shadow: 0 13px 38px rgba(25,36,58,.05); }
.admin-card::before { content: ''; position: absolute; inset: 0 22px auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(118,86,229,.22), transparent); }
.admin-card-head { padding: 26px 27px; }
.admin-card-head > div > span { color: #7d68d7; font-size: 10px; }
.admin-card-head h2 { margin-top: 6px; font-size: 21px; letter-spacing: -.025em; }
.admin-card-head p { margin-top: 7px; font-size: 12.5px; }
.admin-text-link { font-size: 12px; }
.admin-table th { padding: 15px 17px; color: #858d9d; font-size: 10.5px; }
.admin-table td { padding: 16px 17px; font-size: 12.5px; }
.admin-table tbody tr { transition: background .16s ease; }
.admin-table tbody tr:hover { background: #faf9ff; }
.admin-table td strong { font-size: 12.5px; }
.admin-table td small { font-size: 10.5px; }
.status-pill { padding: 6px 10px; font-size: 10.5px; }
.setup-list a { grid-template-columns: 36px 1fr 18px; padding: 16px 8px; }
.setup-list a > span { width: 32px; height: 32px; font-size: 11px; }
.setup-list strong { font-size: 12.5px; }
.setup-list small { font-size: 10.5px; }
.demo-note { padding: 18px; border-radius: 15px; }
.demo-note strong { font-size: 12.5px; }
.demo-note p { font-size: 10.5px; }
.admin-form-grid { grid-template-columns: minmax(0,1fr) 350px; gap: 21px; }
.form-grid-two { gap: 20px; padding: 27px; }
.admin-field > span, .compact-field > span { margin-bottom: 9px; color: #4d5667; font-size: 12.5px; }
.admin-field input, .admin-field select, .admin-field textarea, .compact-field input { border-color: #dbe0e9; border-radius: 12px; background: #fbfcfe; font-size: 13.5px; }
.admin-field input, .admin-field select { height: 48px; padding: 0 14px; }
.admin-field textarea { padding: 13px 14px; }
.admin-field small { margin-top: 7px; font-size: 10.5px; }
.input-suffix b { font-size: 10.5px; }
.toggle-row { min-height: 49px; }
.toggle-row strong { font-size: 12.5px; }
.toggle-row small { font-size: 10.5px; }
.side-help h3 { font-size: 15px; }
.side-help p, .side-help li { font-size: 11px; }
.security-box strong { font-size: 11px; }
.form-submit-bar { padding: 19px 21px; border-radius: 17px; box-shadow: 0 11px 30px rgba(25,36,58,.045); }
.form-submit-bar strong { font-size: 12.5px; }
.form-submit-bar span { font-size: 10.5px; }
.admin-primary-button { min-height: 47px; padding: 0 21px; border-radius: 12px; font-size: 12.5px; box-shadow: 0 11px 25px rgba(79,82,218,.2); }
.admin-search { width: 350px; height: 46px; border-radius: 12px; background: #fff; }
.admin-search input { font-size: 12.5px; }
.admin-search button { height: 37px; padding: 0 14px; font-size: 11px; }
.user-admin-list { padding: 8px 24px 24px; }
.user-admin-row { grid-template-columns: minmax(300px,1.45fr) 100px 165px 115px 105px 76px; gap: 18px; padding: 20px 3px; }
.user-admin-row:hover { background: linear-gradient(90deg, transparent, #faf9ff 5%, #faf9ff 95%, transparent); }
.user-avatar.large { width: 45px; height: 45px; font-size: 14px; }
.user-profile-cell strong { font-size: 12.5px; }
.user-profile-cell small { font-size: 10px; }
.usage-mini span { font-size: 10.5px; }
.usage-mini strong { font-size: 21px; }
.compact-field input { height: 42px; }
.check-control { font-size: 11.5px; }
.check-control span { width: 20px; height: 20px; }
.save-row-button { height: 39px; border-radius: 10px; font-size: 11.5px; }
.status-filters { border-radius: 12px; }
.status-filters a { padding: 9px 12px; font-size: 10.5px; }
.table-delete { width: 36px; height: 36px; border-radius: 10px; }

.admin-login-form .admin-field > span { font-size: 12.5px; }
.admin-login-form .admin-field input { height: 52px; font-size: 13.5px; }
.admin-login-form .admin-primary-button { height: 52px; font-size: 13.5px; }
.login-form-head p { font-size: 12.5px; }
.back-studio { font-size: 11.5px; }

@media (max-width: 1250px) {
    .admin-sidebar { width: 244px; }
    .admin-main { margin-left: 244px; }
    .admin-grid-two, .admin-form-grid { grid-template-columns: 1fr; }
    .side-help { display: none; }
    .user-admin-row { grid-template-columns: minmax(250px,1.3fr) 90px 150px 105px 76px; }
    .user-admin-row .check-control.danger { grid-column: 2; }
}
@media (max-width: 900px) {
    .admin-sidebar { width: 220px; }
    .admin-main { margin-left: 220px; }
    .admin-topbar { padding: 0 24px; }
    .admin-content { padding: 24px; }
    .admin-alert { margin-left: 24px; margin-right: 24px; }
    .admin-health-pill { display: none; }
    .user-admin-row { grid-template-columns: 1fr 95px 155px; }
}
@media (max-width: 680px) {
    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; }
    .admin-topbar { height: 86px; padding: 0 17px; }
    .admin-topbar h1 { font-size: 24px; }
    .admin-content { padding: 17px; }
    .admin-alert { margin: 15px 17px 0; }
    .admin-card-head { padding: 21px; }
    .admin-card-head h2 { font-size: 19px; }
    .form-grid-two { padding: 20px; }
    .user-admin-list { padding: 7px 18px 20px; }
    .user-admin-row { grid-template-columns: 1fr 80px; gap: 14px; }
    .user-profile-cell { grid-column: 1 / -1; }
    .user-admin-row .compact-field { grid-column: 1 / -1; }
    .admin-identity div { display: none; }
}

.single-output-notice {
    min-height: 78px;
    display: grid;
    align-content: center;
    padding: 13px 15px;
    border: 1px solid #ded8fb;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8f5ff, #f0f4ff);
}
.single-output-notice > span { color: #7a65d7; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.single-output-notice > strong { margin-top: 5px; color: #2a2346; font-size: 14px; }
.single-output-notice > small { margin-top: 4px; color: #858b9b; font-size: 10.5px; line-height: 1.45; }

/* =========================================================
   V4 — studio views, reference editing, themes and admin UI
   ========================================================= */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

.theme-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    color: #aaa7c1;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.theme-toggle:hover { color: #fff; border-color: rgba(176,99,255,.42); background: rgba(162,76,255,.1); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .theme-icon-moon,
html[data-theme="light"] .theme-icon-sun { display: none; }

.studio-account-static { display: flex; align-items: center; gap: 10px; min-width: 174px; padding: 4px 7px 4px 4px; }
.studio-view { min-width: 0; min-height: 0; display: none; }
.studio-view.is-active { display: block; }
.studio-view[data-studio-view="create"].is-active { height: 100%; }
.studio-nav-links button.is-active {
    color: #fff;
    border-color: rgba(157,91,255,.23);
    background: linear-gradient(135deg, rgba(141,79,255,.2), rgba(77,83,225,.11));
    box-shadow: inset 0 1px rgba(255,255,255,.04), 0 10px 24px rgba(0,0,0,.12);
}
.retention-note { margin: -1px 0 10px; color: #716e89; font-size: 9px; line-height: 1.5; }

.reference-upload { margin-top: 23px; }
.reference-upload-button {
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border: 1px dashed rgba(176,104,255,.3);
    border-radius: 12px;
    background: rgba(156,76,255,.055);
    color: #f0edfa;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}
.reference-upload-button:hover { border-color: rgba(185,112,255,.6); background: rgba(157,76,255,.1); }
.reference-upload-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: rgba(177,96,255,.13); color: #c483ff; }
.reference-upload-icon svg { width: 18px; }
.reference-upload-button > span:last-child { min-width: 0; display: grid; }
.reference-upload-button strong { font-size: 11px; }
.reference-upload-button small { margin-top: 3px; color: #827f9d; font-size: 8.8px; line-height: 1.4; }
.reference-preview { min-height: 60px; display: grid; grid-template-columns: 42px minmax(0,1fr) 29px; align-items: center; gap: 10px; padding: 8px; border: 1px solid rgba(177,101,255,.28); border-radius: 12px; background: rgba(157,76,255,.07); }
.reference-preview.is-hidden { display: none; }
.reference-preview img { width: 42px; height: 42px; display: block; object-fit: cover; border-radius: 9px; }
.reference-preview > div { min-width: 0; display: grid; }
.reference-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.reference-preview small { margin-top: 3px; color: #7e7b97; font-size: 8.7px; }
.reference-preview button { width: 29px; height: 29px; padding: 0; border: 0; border-radius: 9px; background: rgba(255,255,255,.05); color: #a7a3bb; font-size: 18px; cursor: pointer; }
.reference-preview button:hover { color: #fff; background: rgba(255,93,130,.12); }

.studio-main-preview img { object-fit: contain; }
.studio-main-preview[data-size="1024x1024"] img,
.studio-main-preview[data-size="2048x2048"] img { aspect-ratio: 1 / 1; }

.creations-library {
    height: calc(100vh - 68px);
    overflow: auto;
    padding: 44px clamp(24px, 4vw, 62px) 70px;
    background:
        radial-gradient(circle at 80% 0, rgba(125,76,236,.09), transparent 30%),
        #191832;
}
.creations-library-head { max-width: 1480px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 auto 28px; }
.creations-library-head > div > span { color: #a56df0; font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.creations-library-head h1 { margin: 8px 0 7px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.05em; }
.creations-library-head p { max-width: 680px; margin: 0; color: #87849e; font-size: 13px; line-height: 1.65; }
.library-create-button { min-height: 45px; padding: 0 18px; border: 1px solid rgba(184,104,255,.35); border-radius: 12px; background: linear-gradient(135deg, rgba(132,77,241,.22), rgba(174,72,237,.16)); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.library-create-button:hover { border-color: rgba(191,112,255,.62); transform: translateY(-1px); }
.creations-library-grid { max-width: 1480px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; margin: 0 auto; }
.creation-card { min-width: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.085); border-radius: 18px; background: rgba(35,34,64,.78); box-shadow: 0 18px 45px rgba(7,7,20,.15); transition: .2s ease; }
.creation-card:hover { transform: translateY(-3px); border-color: rgba(178,98,255,.32); box-shadow: 0 25px 58px rgba(7,7,20,.25); }
.creation-card-image { width: 100%; aspect-ratio: 1; display: block; padding: 0; overflow: hidden; border: 0; background: #101022; cursor: zoom-in; }
.creation-card-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .3s ease; }
.creation-card:hover .creation-card-image img { transform: scale(1.025); }
.creation-card-body { padding: 14px 15px 12px; }
.creation-card-body p { min-height: 38px; margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #eeebf7; font-size: 11.5px; line-height: 1.55; }
.creation-card-body > div { display: flex; justify-content: space-between; gap: 8px; margin-top: 11px; color: #77748f; font-size: 9px; }
.creation-card-actions { display: flex; border-top: 1px solid rgba(255,255,255,.065); }
.creation-card-actions a,
.creation-card-actions button { min-height: 40px; flex: 1; display: grid; place-items: center; border: 0; background: transparent; color: #a7a3bc; font-size: 10px; font-weight: 800; cursor: pointer; }
.creation-card-actions a:hover { color: #fff; background: rgba(158,77,255,.08); }
.creation-card-actions button { border-left: 1px solid rgba(255,255,255,.065); color: #c58294; }
.creation-card-actions button:hover { color: #ff9fb3; background: rgba(255,90,124,.07); }
.library-empty { grid-column: 1 / -1; min-height: 430px; display: grid; place-items: center; align-content: center; padding: 40px; border: 1px dashed rgba(255,255,255,.12); border-radius: 24px; background: rgba(255,255,255,.018); text-align: center; }
.library-empty > div { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 24px; background: rgba(151,78,239,.09); color: #a866ef; font-size: 27px; }
.library-empty h2 { margin: 19px 0 7px; font-size: 23px; }
.library-empty p { margin: 0; color: #77748e; font-size: 12px; }
.library-empty button { min-height: 41px; margin-top: 20px; padding: 0 17px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #8353ef, #b248e8); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }

/* User light theme */
html[data-theme="light"] .app-body:has(.studio-app) { background: #eef1f8; }
html[data-theme="light"] .studio-app {
    --studio-bg: #f1f3f9;
    --studio-panel: #fff;
    --studio-nav: #f8f9fd;
    --studio-field: #f3f4fa;
    --studio-line: rgba(30,35,52,.1);
    --studio-line-strong: rgba(30,35,52,.17);
    --studio-text: #17182a;
    --studio-muted: #6d7186;
    color: #17182a;
    background: #f1f3f9;
}
html[data-theme="light"] .studio-nav-sidebar { border-right-color: #e0e4ed; background: radial-gradient(circle at 20% 0, rgba(127,72,255,.09), transparent 28%), linear-gradient(180deg, #fbfbfe, #f5f6fb); box-shadow: 18px 0 45px rgba(25,30,50,.06); }
html[data-theme="light"] .studio-nav-brand { color: #1c1d2f; }
html[data-theme="light"] .studio-nav-brand small,
html[data-theme="light"] .studio-nav-links button,
html[data-theme="light"] .studio-nav-footer { color: #777c91; }
html[data-theme="light"] .studio-nav-links button:hover { color: #22233a; background: rgba(92,70,190,.06); }
html[data-theme="light"] .studio-nav-links button.is-active { color: #3c2d79; border-color: rgba(116,80,220,.17); background: linear-gradient(135deg, rgba(135,91,244,.14), rgba(79,111,225,.08)); }
html[data-theme="light"] .studio-nav-usage { border-color: #e0e3ec; background: #fff; box-shadow: 0 12px 30px rgba(28,35,55,.05); }
html[data-theme="light"] .studio-header { border-bottom-color: #dfe3ed; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(28,35,55,.045); }
html[data-theme="light"] .studio-breadcrumb strong,
html[data-theme="light"] .studio-account-static,
html[data-theme="light"] .studio-user-copy strong { color: #23243a; }
html[data-theme="light"] .studio-control-panel { border-right-color: #dfe3ed; background: linear-gradient(180deg, #fff, #fbfbfe); }
html[data-theme="light"] .studio-control-heading h1,
html[data-theme="light"] .studio-label-row label,
html[data-theme="light"] .studio-select-field > span { color: #25263c; }
html[data-theme="light"] .studio-control-heading p,
html[data-theme="light"] .studio-character-count,
html[data-theme="light"] .studio-reset-note,
html[data-theme="light"] .retention-note { color: #7a7e91; }
html[data-theme="light"] .studio-field-group textarea,
html[data-theme="light"] .studio-select-wrap select { border-color: #e0e3ec; background: #f5f6fa; color: #22233a; box-shadow: none; }
html[data-theme="light"] .studio-field-group textarea::placeholder { color: #969bad; }
html[data-theme="light"] .studio-select-wrap option { background: #fff; color: #22233a; }
html[data-theme="light"] .reference-upload-button { border-color: rgba(120,80,218,.24); background: #f8f5ff; color: #29243f; }
html[data-theme="light"] .reference-preview { border-color: #ded4fa; background: #f8f5ff; }
html[data-theme="light"] .studio-canvas-area,
html[data-theme="light"] .creations-library { background: radial-gradient(circle at 80% 0, rgba(125,76,236,.055), transparent 30%), #eef1f8; }
html[data-theme="light"] .studio-stage-footer { border-top-color: #dde1ea; background: #fff; }
html[data-theme="light"] .studio-result-copy p { color: #2d2e43; }
html[data-theme="light"] .studio-action-button { border-color: #d9dce6; background: #fff; color: #36374b; }
html[data-theme="light"] .studio-stage-empty h2 { color: #24253a; }
html[data-theme="light"] .creation-card { border-color: #dfe3ec; background: #fff; box-shadow: 0 16px 38px rgba(28,35,55,.06); }
html[data-theme="light"] .creation-card-body p { color: #2a2b40; }
html[data-theme="light"] .creation-card-actions { border-top-color: #e8eaf0; }
html[data-theme="light"] .creation-card-actions button { border-left-color: #e8eaf0; }
html[data-theme="light"] .creations-library-head h1,
html[data-theme="light"] .library-empty h2 { color: #202136; }
html[data-theme="light"] .theme-toggle { border-color: #dfe2ea; background: #fff; color: #676b80; }

/* Admin V4 default premium dark */
.admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% -10%, rgba(104,75,229,.14), transparent 30%),
        linear-gradient(180deg, #0d101a 0%, #090c14 100%);
    color: #f4f5fb;
}
.admin-shell { min-height: 100vh; }
.admin-sidebar { background: radial-gradient(circle at 0 0, rgba(113,80,244,.18), transparent 30%), linear-gradient(180deg, #101421, #090d17); box-shadow: 22px 0 70px rgba(0,0,0,.22); }
.admin-main { min-height: 100vh; }
.admin-topbar { border-bottom-color: rgba(255,255,255,.075); background: rgba(14,18,30,.88); box-shadow: 0 10px 35px rgba(0,0,0,.16); }
.admin-topbar h1 { color: #f7f7fc; }
.admin-header-actions { display: flex; align-items: center; gap: 12px; }
.admin-identity { border-color: rgba(255,255,255,.09); background: rgba(255,255,255,.035); box-shadow: none; }
.admin-identity strong { color: #f3f4fa; }
.admin-identity small { color: #777f94; }
.admin-health-pill { border-color: rgba(45,196,141,.2); background: rgba(45,196,141,.08); color: #78dfb9; }
.admin-content { color: #edf0f7; }
.admin-alert { border: 1px solid rgba(255,255,255,.09); background: #151a28; color: #f4f5fb; }
.admin-alert.success { border-color: rgba(54,211,153,.2); background: rgba(54,211,153,.08); color: #9ae8c9; }
.admin-alert.error { border-color: rgba(255,101,122,.2); background: rgba(255,101,122,.08); color: #ffacb9; }
.admin-card,
.stat-card,
.form-submit-bar { border-color: rgba(255,255,255,.08); background: linear-gradient(145deg, rgba(23,28,43,.96), rgba(15,19,31,.96)); box-shadow: 0 18px 50px rgba(0,0,0,.17), inset 0 1px rgba(255,255,255,.025); }
.admin-card::before { background: linear-gradient(90deg, transparent, rgba(143,101,255,.29), transparent); }
.admin-card-head { border-bottom-color: rgba(255,255,255,.075); }
.admin-card-head h2,
.stat-card strong,
.form-submit-bar strong { color: #f5f6fb; }
.admin-card-head p,
.stat-card span,
.stat-card small,
.form-submit-bar span { color: #858da1; }
.admin-table th { border-bottom-color: rgba(255,255,255,.08); background: rgba(255,255,255,.018); color: #7d869b; }
.admin-table td { border-bottom-color: rgba(255,255,255,.065); color: #dfe2eb; }
.admin-table tbody tr:hover { background: rgba(139,92,246,.05); }
.admin-table td strong { color: #f2f3f8; }
.admin-table td small { color: #778095; }
.admin-text-link { color: #a88af3; }
.status-pill.queued { background: rgba(255,180,91,.1); color: #f7bd74; }
.status-pill.processing { background: rgba(85,119,255,.11); color: #89a0ff; }
.status-pill.completed { background: rgba(54,211,153,.1); color: #79dfb9; }
.status-pill.failed { background: rgba(255,101,122,.1); color: #ff93a4; }
.admin-field > span,
.compact-field > span { color: #c9cdd8; }
.admin-field input,
.admin-field select,
.admin-field textarea,
.compact-field input { border-color: rgba(255,255,255,.085); background: #0d111c; color: #f3f4f8; }
.admin-field input::placeholder,
.admin-field textarea::placeholder,
.compact-field input::placeholder { color: #535b6d; }
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus,
.compact-field input:focus { border-color: rgba(135,96,239,.58); box-shadow: 0 0 0 3px rgba(126,86,235,.09); }
.admin-field small,
.toggle-row small { color: #747d90; }
.input-suffix b { color: #777f91; }
.toggle-row { border-color: rgba(255,255,255,.07); background: rgba(255,255,255,.018); }
.toggle-row strong { color: #e9ebf2; }
.side-help { color: #dfe2eb; }
.side-help p,
.side-help li { color: #858da0; }
.provider-visual { border-bottom-color: rgba(255,255,255,.07); background: radial-gradient(circle, rgba(113,84,231,.2), transparent 57%), linear-gradient(145deg, #191e2e, #111622); }
.security-box,
.demo-note { border-color: rgba(255,255,255,.075); background: rgba(255,255,255,.025); }
.security-box p,
.demo-note p { color: #7f8799; }
.admin-search { border-color: rgba(255,255,255,.09); background: #0d111c; }
.admin-search input { color: #f2f3f8; }
.admin-search button { background: linear-gradient(135deg, #7356ed, #506ff0); }
.user-admin-row { border-bottom-color: rgba(255,255,255,.07); }
.user-admin-row:hover { background: linear-gradient(90deg, transparent, rgba(132,87,239,.05) 6%, rgba(132,87,239,.05) 94%, transparent); }
.user-profile-cell strong,
.usage-mini strong { color: #f2f3f8; }
.user-profile-cell small,
.usage-mini span,
.usage-mini small { color: #747d91; }
.check-control { color: #aeb3c0; }
.check-control span { border-color: rgba(255,255,255,.13); background: #0d111c; }
.save-row-button { border-color: rgba(137,96,238,.27); background: rgba(126,82,235,.1); color: #b89af7; }
.status-filters { border-color: rgba(255,255,255,.075); background: rgba(255,255,255,.025); }
.status-filters a { color: #7d8598; }
.status-filters a.active { background: rgba(132,84,237,.15); color: #c2a6ff; box-shadow: none; }
.table-delete { border-color: rgba(255,101,122,.15); background: rgba(255,101,122,.06); color: #e98697; }
.setup-list a { border-bottom-color: rgba(255,255,255,.065); }
.setup-list strong { color: #e9ebf2; }
.setup-list small { color: #747d91; }

/* Readable admin scale */
.admin-nav a,
.admin-sidebar-bottom a,
.admin-sidebar-bottom button { font-size: 14px; }
.admin-eyebrow { font-size: 11px; }
.admin-card-head > div > span { font-size: 11px; }
.admin-card-head h2 { font-size: 22px; }
.admin-card-head p { font-size: 14px; }
.admin-table th { font-size: 12px; }
.admin-table td,
.admin-table td strong { font-size: 14px; }
.admin-table td small { font-size: 12px; }
.admin-field > span,
.compact-field > span { font-size: 14px; }
.admin-field input,
.admin-field select,
.admin-field textarea,
.compact-field input { font-size: 14px; }
.admin-field small,
.toggle-row small { font-size: 12px; line-height: 1.5; }
.toggle-row strong { font-size: 14px; }
.admin-primary-button { font-size: 13px; }
.user-profile-cell strong { font-size: 14px; }
.user-profile-cell small { font-size: 11px; line-height: 1.5; }
.usage-mini span,
.usage-mini small { font-size: 11px; }
.usage-mini strong { font-size: 24px; }
.check-control,
.save-row-button { font-size: 13px; }

/* Provider chain */
.provider-chain-card { margin-bottom: 22px; }
.provider-chain-list { display: grid; gap: 12px; padding: 20px 26px 27px; }
.provider-chain-row { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid rgba(255,255,255,.075); border-radius: 15px; background: rgba(255,255,255,.022); }
.provider-chain-row.is-disabled { opacity: .55; }
.provider-priority { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: rgba(127,88,235,.12); color: #b594ff; font-size: 14px; font-weight: 850; }
.provider-row-info { min-width: 0; }
.provider-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.provider-row-title strong { color: #f1f3f8; font-size: 15px; }
.provider-mode-pill,
.model-capability { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(85,119,255,.1); color: #91a4ff; font-size: 10px; font-weight: 800; }
.provider-row-info > small { display: block; margin-top: 5px; color: #747d91; font-size: 11px; }
.provider-model-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.provider-model-list span { padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.04); color: #8f97a9; font-size: 10px; }
.provider-row-actions { display: flex; align-items: center; gap: 7px; }
.provider-row-actions a,
.provider-row-actions button { min-height: 35px; padding: 0 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: rgba(255,255,255,.025); color: #b1b6c5; font-size: 11px; font-weight: 750; cursor: pointer; }
.provider-row-actions a:hover { color: #fff; border-color: rgba(142,101,246,.35); }
.provider-row-actions button { color: #d98a9a; }
.admin-model-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.model-check { min-height: 57px; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; background: rgba(255,255,255,.018); cursor: pointer; }
.model-check input { position: absolute; opacity: 0; pointer-events: none; }
.model-check > span { width: 19px; height: 19px; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; background: #0c101a; }
.model-check input:checked + span { border-color: #7c5ce8; background: #7656e7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/13px no-repeat; }
.model-check div { min-width: 0; display: grid; }
.model-check strong { color: #e9ebf2; font-size: 12px; }
.model-check small { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; color: #737c90; font-size: 10px; }

/* Model registry */
.admin-grid-models { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(350px,.55fr); gap: 22px; }
.model-admin-list { display: grid; gap: 10px; padding: 20px 25px 27px; }
.model-admin-row { display: grid; grid-template-columns: 45px minmax(0,1fr) auto; align-items: center; gap: 15px; padding: 15px; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; background: rgba(255,255,255,.02); }
.model-admin-row.is-disabled { opacity: .55; }
.model-order { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(128,87,237,.11); color: #b492ff; font-size: 12px; font-weight: 850; }
.model-info { min-width: 0; }
.model-info > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.model-info strong { color: #f2f3f8; font-size: 14px; }
.model-info > small { display: block; margin-top: 5px; color: #7e8699; font-size: 11px; }
.model-info p { margin: 8px 0 0; color: #737c90; font-size: 10px; line-height: 1.5; }
.model-editor-fields { display: grid; gap: 16px; padding: 24px; }
.model-save-button { width: 100%; }

/* User usage row with three count columns */
.user-admin-row { grid-template-columns: minmax(270px,1.35fr) 128px 118px minmax(145px,.6fr) 105px 96px 78px; }
.usage-mini small { display: block; margin-top: 4px; }

/* Admin light theme */
html[data-theme="light"] .admin-body { background: radial-gradient(circle at 84% 0, rgba(104,83,224,.07), transparent 28%), linear-gradient(180deg, #f4f6fb, #eef1f7); color: #171b26; }
html[data-theme="light"] .admin-topbar { border-bottom-color: #e2e6ef; background: rgba(255,255,255,.92); box-shadow: 0 8px 25px rgba(25,34,55,.035); }
html[data-theme="light"] .admin-topbar h1 { color: #171b26; }
html[data-theme="light"] .admin-identity { border-color: #e5e8ef; background: #fff; box-shadow: 0 7px 20px rgba(26,35,55,.05); }
html[data-theme="light"] .admin-identity strong { color: #222733; }
html[data-theme="light"] .admin-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .form-submit-bar { border-color: #e1e5ee; background: #fff; box-shadow: 0 13px 38px rgba(25,36,58,.05); }
html[data-theme="light"] .admin-card-head { border-bottom-color: #e8ebf1; }
html[data-theme="light"] .admin-card-head h2,
html[data-theme="light"] .stat-card strong,
html[data-theme="light"] .form-submit-bar strong { color: #1a1f2b; }
html[data-theme="light"] .admin-card-head p,
html[data-theme="light"] .stat-card span,
html[data-theme="light"] .stat-card small { color: #858d9e; }
html[data-theme="light"] .admin-table th { border-bottom-color: #e8ebf0; background: #fafbfc; color: #858d9d; }
html[data-theme="light"] .admin-table td { border-bottom-color: #edf0f3; color: #4f5868; }
html[data-theme="light"] .admin-table td strong { color: #252a35; }
html[data-theme="light"] .admin-table tbody tr:hover { background: #faf9ff; }
html[data-theme="light"] .admin-field > span,
html[data-theme="light"] .compact-field > span { color: #4d5667; }
html[data-theme="light"] .admin-field input,
html[data-theme="light"] .admin-field select,
html[data-theme="light"] .admin-field textarea,
html[data-theme="light"] .compact-field input { border-color: #dbe0e9; background: #fbfcfe; color: #222733; }
html[data-theme="light"] .toggle-row,
html[data-theme="light"] .provider-chain-row,
html[data-theme="light"] .model-admin-row,
html[data-theme="light"] .model-check { border-color: #e3e6ed; background: #fbfcfe; }
html[data-theme="light"] .toggle-row strong,
html[data-theme="light"] .provider-row-title strong,
html[data-theme="light"] .model-info strong,
html[data-theme="light"] .model-check strong,
html[data-theme="light"] .user-profile-cell strong,
html[data-theme="light"] .usage-mini strong { color: #252a35; }
html[data-theme="light"] .admin-search { border-color: #e0e4eb; background: #fff; }
html[data-theme="light"] .admin-search input { color: #222733; }
html[data-theme="light"] .user-admin-row { border-bottom-color: #edf0f3; }
html[data-theme="light"] .user-admin-row:hover { background: linear-gradient(90deg, transparent, #faf9ff 5%, #faf9ff 95%, transparent); }
html[data-theme="light"] .check-control { color: #606878; }
html[data-theme="light"] .check-control span,
html[data-theme="light"] .model-check > span { border-color: #d7dce5; background-color: #fff; }
html[data-theme="light"] .provider-visual { border-bottom-color: #e8e8f1; background: radial-gradient(circle, rgba(113,84,231,.18), transparent 57%), linear-gradient(145deg, #f7f5ff, #eff4ff); }
html[data-theme="light"] .security-box,
html[data-theme="light"] .demo-note { border-color: #e4e7ee; background: #fafbfc; }
html[data-theme="light"] .theme-toggle { border-color: #dfe2ea; background: #fff; color: #666d80; }

@media (max-width: 1380px) {
    .creations-library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .admin-grid-models { grid-template-columns: 1fr; }
    .user-admin-row { grid-template-columns: minmax(260px,1.3fr) 110px 105px 145px 90px 80px; }
    .user-admin-row .save-row-button { grid-column: 6; }
    .user-admin-row .check-control.danger { grid-column: 5; }
}
@media (max-width: 1050px) {
    .creations-library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .provider-chain-row,
    .model-admin-row { grid-template-columns: 45px minmax(0,1fr); }
    .provider-row-actions { grid-column: 2; justify-content: flex-start; }
    .admin-model-check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .studio-account-static { min-width: 0; padding: 2px; }
    .creations-library { height: auto; min-height: calc(100vh - 62px); padding: 28px 15px 55px; }
    .creations-library-head { align-items: flex-start; flex-direction: column; }
    .creations-library-grid { grid-template-columns: 1fr; }
    .reference-upload { margin-top: 22px; }
    .admin-header-actions { gap: 7px; }
    .admin-theme-toggle { width: 38px; height: 38px; }
    .provider-chain-list,
    .model-admin-list { padding: 15px; }
    .provider-chain-row,
    .model-admin-row { grid-template-columns: 1fr; }
    .provider-priority,
    .model-order { display: none; }
    .provider-row-actions { grid-column: 1; }
}

/* Provider view exact component names */
.provider-list-card { margin-bottom: 22px; }
.provider-admin-list { display: grid; gap: 12px; padding: 20px 26px 27px; }
.provider-admin-row { display: grid; grid-template-columns: 50px minmax(220px,1.1fr) minmax(220px,.9fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid rgba(255,255,255,.075); border-radius: 15px; background: rgba(255,255,255,.022); }
.provider-admin-row.is-disabled { opacity: .55; }
.provider-rank { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: rgba(127,88,235,.12); color: #b594ff; font-size: 14px; font-weight: 850; }
.provider-main { min-width: 0; }
.provider-main > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.provider-main strong { color: #f1f3f8; font-size: 15px; }
.provider-main > small { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; color: #747d91; font-size: 11px; }
.provider-model-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.provider-model-chips span { padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.04); color: #8f97a9; font-size: 10px; }
html[data-theme="light"] .provider-admin-row { border-color: #e3e6ed; background: #fbfcfe; }
html[data-theme="light"] .provider-main strong { color: #252a35; }
html[data-theme="light"] .provider-model-chips span { background: #f0f2f7; color: #70798a; }

@media (max-width: 1240px) {
    .provider-admin-row { grid-template-columns: 45px minmax(220px,1fr) auto; }
    .provider-model-chips { grid-column: 2; }
    .provider-admin-row .provider-row-actions { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 760px) {
    .provider-admin-row { grid-template-columns: 1fr; }
    .provider-rank { display: none; }
    .provider-model-chips,
    .provider-admin-row .provider-row-actions { grid-column: 1; grid-row: auto; }
}

.studio-layout { height: 100%; }
.studio-view[data-studio-view="creations"].is-active { height: 100%; overflow: hidden; }

@media (max-width: 1250px) and (min-width: 681px) {
    .user-admin-row {
        grid-template-columns: minmax(240px,1fr) 120px 110px 145px;
        align-items: center;
    }
    .user-profile-cell { grid-column: 1; grid-row: 1; }
    .today-usage { grid-column: 2; grid-row: 1; }
    .total-usage { grid-column: 3; grid-row: 1; }
    .limit-control { grid-column: 4; grid-row: 1; }
    .unlimited-control { grid-column: 2; grid-row: 2; }
    .user-admin-row .check-control.danger { grid-column: 3; grid-row: 2; }
    .user-admin-row .save-row-button { grid-column: 4; grid-row: 2; }
}
@media (max-width: 680px) {
    .user-admin-row { grid-template-columns: 1fr 1fr; }
    .user-profile-cell { grid-column: 1 / -1; }
    .today-usage { grid-column: 1; }
    .total-usage { grid-column: 2; }
    .limit-control { grid-column: 1 / -1 !important; }
    .unlimited-control { grid-column: 1; }
    .user-admin-row .check-control.danger { grid-column: 2; }
    .user-admin-row .save-row-button { grid-column: 1 / -1; width: 100%; }
}

.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 680px) { .stats-grid { grid-template-columns: 1fr; } }
