:root {
  --ink: #17211b;
  --muted: #68736c;
  --line: #dde4dd;
  --line-strong: #c8d1c9;
  --paper: #fffefa;
  --canvas: #f2f4ef;
  --soft: #e8eee7;
  --green: #19684a;
  --green-dark: #0f4c35;
  --acid: #d4f055;
  --navy: #17251f;
  --danger: #b33e37;
  --warn: #8a5a10;
  --radius: 18px;
  --shadow: 0 20px 55px rgba(23, 37, 31, .1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.eyebrow, .kicker { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.form-error { min-height: 20px; margin: 7px 0 0; color: var(--danger); font-size: 13px; }
.muted { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 780; letter-spacing: -.04em; }
.brand-large { font-size: 25px; }
.brand-mark { position: relative; display: grid; grid-template-columns: repeat(3, 9px); gap: 3px; align-items: end; width: 33px; height: 30px; padding: 5px 3px; border-radius: 9px; background: var(--navy); transform: rotate(-3deg); }
.brand-mark i { display: block; border-radius: 4px 4px 2px 2px; background: var(--acid); }
.brand-mark i:nth-child(1) { height: 10px; }.brand-mark i:nth-child(2) { height: 19px; }.brand-mark i:nth-child(3) { height: 14px; }

.primary, .secondary, .text-button, .icon-button { border: 0; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease; }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 20px; min-height: 44px; padding: 0 19px; border-radius: 10px; background: var(--green); color: white; font-weight: 750; }
.primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary:disabled { cursor: wait; opacity: .55; transform: none; }
.primary span { color: var(--acid); font-size: 18px; }
.secondary { min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); font-weight: 700; }
.secondary:hover { border-color: var(--green); color: var(--green); }
.text-button { padding: 5px; background: transparent; color: var(--green); font-size: 12px; font-weight: 750; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 18px; }
.icon-button:hover { background: var(--soft); }
.wide { width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(25, 104, 74, .2); outline-offset: 2px; }

.login-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100vh; }
.login-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 7vw, 120px); background: var(--navy); color: white; }
.login-story::before { content: ""; position: absolute; inset: -18% -30% auto auto; width: 620px; height: 620px; border: 1px solid rgba(212, 240, 85, .18); border-radius: 48% 52% 68% 32%; transform: rotate(22deg); }
.login-story::after { content: ""; position: absolute; right: 12%; bottom: -130px; width: 340px; height: 340px; border-radius: 50%; background: var(--acid); opacity: .08; filter: blur(2px); }
.login-story .brand { position: absolute; top: 44px; left: clamp(40px, 7vw, 120px); color: white; }
.login-story .kicker { color: var(--acid); }
.login-story h1 { position: relative; z-index: 1; max-width: 740px; margin: 6px 0 24px; font-size: clamp(40px, 5.2vw, 76px); line-height: 1.04; letter-spacing: -.055em; }
.login-lede { position: relative; z-index: 1; max-width: 620px; margin: 0; color: #c8d1cb; font-size: 18px; line-height: 1.8; }
.login-proof { position: relative; z-index: 1; display: flex; gap: 42px; margin-top: 60px; }
.login-proof div { display: flex; flex-direction: column; gap: 4px; }
.login-proof strong { color: var(--acid); font-size: 28px; }.login-proof span { color: #b9c5bd; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: var(--paper); }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow):not(.form-error) { margin: 10px 0 32px; color: var(--muted); }
.login-card label, .dialog-card label { display: grid; gap: 8px; margin-top: 18px; font-size: 12px; font-weight: 800; }
.login-card input, .dialog-card input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; }
.login-card .primary { margin-top: 8px; }.login-card > small { display: block; margin-top: 18px; color: var(--muted); line-height: 1.6; text-align: center; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 230px 1fr auto; align-items: center; min-height: 74px; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, .94); backdrop-filter: blur(16px); }
.topbar nav { display: flex; align-items: stretch; height: 74px; }
.topbar nav button { position: relative; padding: 0 21px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 720; }
.topbar nav button::after { content: ""; position: absolute; right: 21px; bottom: 0; left: 21px; height: 3px; border-radius: 3px 3px 0 0; background: var(--green); transform: scaleX(0); transition: transform .18s ease; }
.topbar nav button.active { color: var(--ink); }.topbar nav button.active::after { transform: scaleX(1); }
.account-menu { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.role-chip { padding: 5px 8px; border-radius: 6px; background: var(--soft); color: var(--green); font-size: 10px; font-weight: 800; }

.content { width: min(1540px, 100%); margin: 0 auto; padding: 40px clamp(20px, 4vw, 64px) 80px; }
.page { display: none; }.page.active { display: block; animation: pageIn .22s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: clamp(30px, 3vw, 46px); letter-spacing: -.045em; }.page-heading p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); }
.studio-heading { align-items: center; }
.balance-panel { min-width: 200px; padding: 16px 18px; border: 1px solid #cfd9ce; border-radius: 13px; background: var(--paper); }
.balance-panel small, .balance-panel span { display: block; color: var(--muted); font-size: 10px; }.balance-panel strong { display: block; margin: 4px 0; font-size: 25px; letter-spacing: -.03em; }

.studio-grid { display: grid; grid-template-columns: minmax(470px, .82fr) minmax(520px, 1.18fr); gap: 22px; align-items: start; }
.compose-panel, .result-panel, .table-card, .ledger-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.compose-panel { padding: 28px; }
.section-title { display: flex; gap: 12px; margin: 5px 0 16px; padding-top: 21px; border-top: 1px solid var(--line); }
.section-title:first-child { padding-top: 0; border-top: 0; }
.section-title > span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 50%; background: var(--navy); color: var(--acid); font-size: 10px; font-weight: 850; }
.section-title h2 { margin: 1px 0 3px; font-size: 16px; }.section-title p { margin: 0; color: var(--muted); font-size: 11px; }
.model-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 25px; }
.model-card { position: relative; min-height: 168px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf7; cursor: pointer; text-align: left; }
.model-card.high { border-color: #c7d78c; background: #f8fbdc; }
.model-card:hover { border-color: #9db2a2; }.model-card.active { border-color: var(--green); background: #edf5ef; box-shadow: inset 0 0 0 1px var(--green); }
.model-card.active::after { content: "✓"; position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: white; font-size: 10px; }
.model-card-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: inherit; }.model-card-head b { font-size: 13px; }.model-card-head em { padding: 3px 5px; border-radius: 4px; background: var(--navy); color: var(--acid); font-size: 8px; font-style: normal; letter-spacing: .08em; }.model-card > strong { display: block; margin-top: 9px; color: var(--green); font-size: 16px; }.model-card p { min-height: 34px; margin: 8px 0 0; color: var(--muted); font-size: 9px; font-weight: 550; line-height: 1.55; }.model-card small { display: block; overflow-wrap: anywhere; margin-top: 7px; padding-right: 22px; color: var(--muted); font-size: 8px; }
.upload-zone { width: 100%; min-height: 128px; padding: 18px; border: 1.5px dashed #aab7ac; border-radius: 12px; background: #f8faf5; cursor: pointer; }
.upload-zone:hover, .upload-zone.dragging { border-color: var(--green); background: #edf5ee; }.upload-zone b, .upload-zone strong, .upload-zone small { display: block; }.upload-zone b { color: var(--green); font-size: 25px; font-weight: 400; }.upload-zone strong { margin: 5px 0; }.upload-zone small { color: var(--muted); font-size: 10px; }
.selected-uploads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.selected-upload, .recent-upload { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.selected-upload img, .recent-upload img { width: 100%; height: 100%; object-fit: cover; }.selected-upload button { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 23px; height: 23px; border: 0; border-radius: 50%; background: rgba(23, 33, 27, .8); color: white; cursor: pointer; }
.recent-wrap { margin-top: 13px; }.subhead { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 10px; }.subhead small { color: var(--muted); }
.recent-uploads { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; }.recent-upload { flex: 0 0 64px; cursor: pointer; opacity: .72; }.recent-upload:hover, .recent-upload.selected { opacity: 1; border-color: var(--green); }
.field { position: relative; display: grid; gap: 8px; margin-bottom: 16px; font-size: 12px; font-weight: 800; }
.field textarea, .field select { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: white; color: var(--ink); }
.field textarea { resize: vertical; min-height: 132px; padding: 13px; line-height: 1.65; }.field select { height: 44px; padding: 0 11px; }.field > small { color: var(--muted); font-size: 9px; font-weight: 500; }.field textarea + small { position: absolute; right: 10px; bottom: 8px; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.8); }
.cost-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 22px; padding: 15px; border-radius: 12px; background: var(--navy); color: white; }.cost-bar small { display: block; color: #aebbb3; font-size: 9px; }.cost-bar strong { display: block; margin-top: 2px; color: var(--acid); font-size: 20px; }.cost-bar p { margin: 0; color: #afbbb4; font-size: 9px; line-height: 1.5; }.cost-bar .primary { background: var(--acid); color: var(--navy); }.cost-bar .primary span { color: var(--navy); }

.result-panel { position: sticky; top: 96px; overflow: hidden; min-height: 720px; background: var(--navy); color: white; }
.result-topline { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.1); color: #c9d2cd; font-size: 11px; font-weight: 750; letter-spacing: .08em; }.result-topline .text-button { color: var(--acid); }
.empty-result { display: grid; place-items: center; align-content: center; min-height: 620px; padding: 40px; text-align: center; }.empty-result h2 { margin: 24px 0 8px; font-size: 23px; }.empty-result p { max-width: 360px; margin: 0; color: #aeb8b2; font-size: 12px; line-height: 1.7; }
.empty-art { position: relative; width: 220px; height: 220px; }.empty-art i { position: absolute; inset: 20px; border: 1px solid rgba(212,240,85,.28); border-radius: 44% 56% 55% 45%; }.empty-art i:nth-child(2) { inset: 44px; transform: rotate(40deg); }.empty-art i:nth-child(3) { inset: 67px; transform: rotate(80deg); }.empty-art span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--acid); font-size: 44px; }
.task-result { padding: 20px; }.task-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }.task-result-head h2 { margin: 3px 0 4px; font-size: 22px; }.task-result-head p { margin: 0; color: #aeb8b2; font-size: 10px; }.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.1); color: #d9e1dc; font-size: 10px; font-weight: 750; }.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }.status-chip.succeeded { color: var(--acid); }.status-chip.failed { color: #ff9b90; }.status-chip.running, .status-chip.queued { color: #ffd879; }
.progress-track { height: 5px; margin: 12px 0 18px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.09); }.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--acid); transition: width .3s ease; }
.result-frame { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 440px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: #0f1915; }.result-frame img { display: block; width: 100%; max-height: 650px; object-fit: contain; }.result-working { text-align: center; color: #bdc7c1; }.result-working b { display: block; margin-bottom: 11px; color: var(--acid); font-size: 32px; animation: pulse 1.3s ease-in-out infinite; }.result-working h3 { margin: 0 0 8px; color: white; }.result-working p { margin: 0; font-size: 11px; }.result-failed { max-width: 440px; padding: 30px; text-align: center; }.result-failed b { display: block; margin-bottom: 9px; color: #ff9b90; }.result-failed p { color: #c2cbc6; line-height: 1.7; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.92); } }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }.result-metrics div { padding: 11px; border-radius: 9px; background: rgba(255,255,255,.07); }.result-metrics small, .result-metrics strong { display: block; }.result-metrics small { color: #9eaaa3; font-size: 9px; }.result-metrics strong { margin-top: 4px; font-size: 14px; }.result-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }.result-actions .secondary { border-color: rgba(255,255,255,.25); background: transparent; color: white; }.result-actions a { text-decoration: none; }

.table-card { overflow: hidden; }.card-heading { padding: 20px 22px; border-bottom: 1px solid var(--line); }.card-heading h2 { margin: 0; font-size: 16px; }.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }th { padding: 13px 15px; background: #f3f5f0; color: var(--muted); text-align: left; font-size: 10px; letter-spacing: .04em; }td { padding: 14px 15px; border-top: 1px solid var(--line); vertical-align: middle; }tbody tr:hover { background: #fafbf7; }.table-card .status-chip { background: var(--soft); color: var(--muted); }.table-card .status-chip.succeeded { color: var(--green); }.table-card .status-chip.failed { color: var(--danger); }.table-card .status-chip.running, .table-card .status-chip.queued { color: var(--warn); }.task-link { border: 0; background: transparent; color: var(--green); cursor: pointer; font-weight: 750; }.task-id { font-family: ui-monospace, monospace; font-size: 10px; }.empty-cell { padding: 45px; color: var(--muted); text-align: center; }

.developer-grid { display: grid; grid-template-columns: 1fr minmax(390px, .75fr); gap: 20px; align-items: start; }.code-card { overflow: hidden; padding: 23px; border-radius: var(--radius); background: var(--navy); color: white; }.code-card > div { display: flex; align-items: center; gap: 10px; }.code-card > div span { padding: 4px 7px; border-radius: 4px; background: var(--acid); color: var(--navy); font-size: 9px; font-weight: 850; }.code-card pre { overflow-x: auto; margin: 22px 0; padding: 16px; border-radius: 9px; background: #0d1713; color: #dfe7e1; font-size: 11px; line-height: 1.65; white-space: pre-wrap; }.code-card p { color: #aeb8b2; font-size: 10px; line-height: 1.7; }.code-card code { color: var(--acid); }.secret-notice { display: grid; grid-template-columns: 1fr minmax(300px, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 18px; padding: 17px; border: 1px solid #b8c868; border-radius: 12px; background: #f5fbd5; }.secret-notice p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }.secret-notice code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-card { margin-top: 20px; overflow: hidden; }.ledger-list { display: grid; grid-template-columns: repeat(2, 1fr); }.ledger-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }.ledger-row:nth-child(odd) { border-right: 1px solid var(--line); }.ledger-row span { color: var(--muted); font-size: 10px; }.ledger-row strong { font-size: 12px; }.ledger-row em { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; font-weight: 800; }.ledger-row em.positive { color: var(--green); }.ledger-row em.negative { color: var(--danger); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }.stat-card { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }.stat-card small, .stat-card strong, .stat-card span { display: block; }.stat-card small { color: var(--muted); font-size: 10px; }.stat-card strong { margin: 6px 0 4px; font-size: 24px; letter-spacing: -.04em; }.stat-card span { color: var(--green); font-size: 10px; }
.admin-grid { display: grid; gap: 20px; }.wide-table { overflow-x: auto; }.wide-table table { min-width: 920px; }.inline-actions { display: flex; flex-wrap: wrap; gap: 5px; }.mini { padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; cursor: pointer; font-size: 9px; font-weight: 750; }

dialog { width: min(540px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }dialog::backdrop { background: rgba(13, 24, 19, .52); backdrop-filter: blur(4px); }.dialog-card { padding: 25px; }.dialog-head { display: flex; align-items: start; justify-content: space-between; }.dialog-head h2 { margin: 0; font-size: 25px; }.dialog-card > p { color: var(--muted); }.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }.big-secret { display: block; overflow-wrap: anywhere; margin: 18px 0; padding: 15px; border-radius: 9px; background: var(--soft); color: var(--green-dark); }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 15px; border-radius: 10px; background: var(--navy); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .studio-grid { grid-template-columns: 1fr; }.result-panel { position: relative; top: 0; min-height: 600px; }.developer-grid { grid-template-columns: 1fr; }.topbar { grid-template-columns: auto 1fr auto; }.topbar nav button { padding: 0 12px; }.topbar nav button::after { right: 12px; left: 12px; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }.login-story { min-height: 48vh; padding: 100px 28px 45px; }.login-story .brand { top: 28px; left: 28px; }.login-story h1 { font-size: 40px; }.login-lede { font-size: 14px; }.login-proof { gap: 22px; margin-top: 30px; }.login-panel { padding: 40px 24px; }
  .topbar { position: relative; grid-template-columns: 1fr auto; padding: 14px 18px; }.topbar nav { grid-column: 1 / -1; order: 3; overflow-x: auto; height: 48px; margin: 8px -18px -14px; padding: 0 9px; border-top: 1px solid var(--line); }.topbar nav button { flex: 0 0 auto; }.account-menu .role-chip, .account-menu strong { display: none; }
  .content { padding: 28px 15px 60px; }.page-heading { align-items: flex-start; }.studio-heading { display: block; }.balance-panel { margin-top: 18px; }.compose-panel { padding: 18px; }.model-options { grid-template-columns: 1fr; }.model-card { min-height: 128px; }.model-card p { min-height: 0; }.cost-bar { grid-template-columns: 1fr auto; }.cost-bar p { grid-column: 1 / -1; grid-row: 2; }.selected-uploads { grid-template-columns: repeat(3, 1fr); }.result-panel { min-height: 520px; }.empty-result { min-height: 460px; }.result-frame { min-height: 320px; }.result-metrics { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }.table-card table { min-width: 730px; }.ledger-list { grid-template-columns: 1fr; }.ledger-row:nth-child(odd) { border-right: 0; }.stats-grid { grid-template-columns: repeat(2, 1fr); }.secret-notice { grid-template-columns: 1fr; }.two-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; } }
