:root {
  --ink: #182019;
  --ink-2: #344036;
  --muted: #748077;
  --line: #dfe5de;
  --line-strong: #c9d2c9;
  --canvas: #f3f5f0;
  --paper: #fbfcf8;
  --white: #fff;
  --green: #275d42;
  --green-dark: #19472f;
  --green-soft: #e7f0e7;
  --lime: #cbe7a7;
  --peach: #f0cdb8;
  --blue: #c8dced;
  --danger: #b3463f;
  --danger-soft: #f9e9e6;
  --warning: #9b671e;
  --warning-soft: #fbf0d8;
  --sidebar: 232px;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 45px rgba(26, 45, 31, .08);
  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 { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(65, 119, 83, .2); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 8px; color: #728074; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 760; letter-spacing: -.02em; }
.brand-light { color: #eff8ee; }
.brand-mark { position: relative; display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; transform: rotate(45deg); }
.brand-mark i { position: absolute; display: block; width: 14px; height: 14px; border: 1.8px solid currentColor; border-radius: 3px; }
.brand-mark i:nth-child(1) { transform: translate(-5px, -5px); }
.brand-mark i:nth-child(2) { transform: translate(5px, 5px); opacity: .65; }
.brand-mark i:nth-child(3) { width: 7px; height: 7px; background: currentColor; border: 0; }

/* Login */
.login-view { display: grid; grid-template-columns: minmax(430px, 1.08fr) minmax(410px, .92fr); min-height: 100vh; background: var(--paper); }
.login-story { position: relative; display: flex; min-height: 100vh; flex-direction: column; padding: 42px 54px; overflow: hidden; color: #edf3ea; background: #17261c; }
.login-story::after { content: ""; position: absolute; inset: 0; opacity: .13; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 46px 46px; mask-image: linear-gradient(to bottom, transparent 3%, #000 35%, transparent 90%); }
.story-copy { position: relative; z-index: 2; max-width: 680px; margin-top: clamp(90px, 15vh, 180px); }
.story-copy .eyebrow { color: #a8bba9; }
.story-copy h1 { margin: 0; max-width: 660px; font-family: Georgia, "Songti SC", serif; font-size: clamp(40px, 4.5vw, 68px); font-weight: 500; line-height: 1.13; letter-spacing: -.045em; }
.story-copy > p:last-child { max-width: 570px; margin: 28px 0 0; color: #b9c7ba; font-size: 16px; line-height: 1.8; }
.story-canvas { position: absolute; right: -40px; bottom: -40px; width: min(58vw, 680px); height: min(52vw, 640px); }
.orb { position: absolute; border-radius: 45% 55% 62% 38% / 52% 37% 63% 48%; filter: blur(2px); }
.orb-a { right: 8%; bottom: 0; width: 72%; height: 72%; background: linear-gradient(135deg, rgba(176, 219, 130, .58), rgba(39, 93, 66, .15)); transform: rotate(-16deg); }
.orb-b { right: 31%; bottom: 14%; width: 48%; height: 48%; background: linear-gradient(150deg, rgba(190, 216, 240, .58), rgba(42, 81, 65, .1)); transform: rotate(24deg); }
.orb-c { right: 2%; bottom: 28%; width: 34%; height: 34%; background: linear-gradient(150deg, rgba(242, 198, 172, .66), rgba(235, 156, 105, .1)); transform: rotate(40deg); }
.canvas-label { position: absolute; z-index: 2; display: grid; min-width: 92px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 13px; background: rgba(21, 36, 26, .45); box-shadow: 0 15px 40px rgba(0,0,0,.12); backdrop-filter: blur(12px); }
.canvas-label span { color: #b9c7ba; font-size: 10px; letter-spacing: .12em; }
.canvas-label strong { margin-top: 3px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.label-a { right: 55%; bottom: 22%; }
.label-b { right: 15%; bottom: 53%; }
.label-c { right: 38%; bottom: 5%; }
.story-foot { position: relative; z-index: 2; margin: auto 0 0; color: #96aa99; font-size: 11px; letter-spacing: .06em; }
.login-panel { display: grid; min-height: 100vh; place-items: center; padding: 44px; }
.login-form { width: min(100%, 390px); }
.login-form h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 38px; font-weight: 500; letter-spacing: -.03em; }
.form-lead { margin: 13px 0 34px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.mobile-brand { display: none; margin-bottom: 56px; }
.field { display: grid; gap: 8px; margin: 0 0 18px; }
.field > span { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); transition: border .18s, box-shadow .18s; }
.field input { height: 48px; padding: 0 14px; }
.field input:focus, .field textarea:focus { border-color: #6f9479; box-shadow: 0 0 0 3px rgba(71, 113, 84, .1); outline: none; }
.form-error { min-height: 18px; margin: 4px 0 10px; color: var(--danger); font-size: 12px; line-height: 1.45; }
.login-help { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

/* Buttons */
.button { min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 750; transition: transform .15s, background .15s, border .15s; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(34, 87, 57, .15); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { border-color: var(--line-strong); background: var(--white); }
.button-secondary:hover { background: var(--green-soft); border-color: #aac0ae; }
.button-quiet { border-color: var(--line); background: rgba(255,255,255,.9); }
.button-wide { display: flex; width: 100%; height: 49px; align-items: center; justify-content: center; gap: 12px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 750; }
.icon-button { display: grid; width: 37px; height: 37px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.icon-button:hover { background: var(--green-soft); }

/* App shell */
.app-view { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--sidebar); flex-direction: column; padding: 27px 16px 20px; border-right: 1px solid #d7ddd6; background: #edf0ea; }
.sidebar-brand { height: 50px; padding: 0 12px 18px; }
.nav-list { display: grid; gap: 4px; margin-top: 25px; }
.nav-item { display: flex; width: 100%; height: 44px; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #59645c; font-size: 12px; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.nav-item.is-active { background: #fff; color: var(--green-dark); box-shadow: 0 5px 17px rgba(36, 58, 42, .05); font-weight: 750; }
.nav-icon { display: grid; width: 24px; height: 24px; place-items: center; color: #718078; font-size: 15px; }
.nav-item.is-active .nav-icon { color: var(--green); }
.sidebar-foot { margin: auto 4px 0; padding: 16px 12px 3px; border-top: 1px solid #d6ddd6; color: #79847c; font-size: 10px; }
.sidebar-foot p { margin: 7px 0 0; }
.status-line { display: flex; align-items: center; gap: 7px; color: #526159; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #64a475; box-shadow: 0 0 0 4px rgba(100,164,117,.14); }
.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; height: 82px; align-items: center; padding: 0 clamp(22px, 3.3vw, 52px); border-bottom: 1px solid rgba(217,224,216,.9); background: rgba(243,245,240,.88); backdrop-filter: blur(13px); }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 760; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 3px; font-size: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.balance-chip { display: grid; padding: 7px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.62); }
.balance-chip span { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.balance-chip strong { margin-top: 2px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; }
.user-chip > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--green); color: #fff; font-family: Georgia, serif; }
.user-chip div { display: grid; }
.user-chip strong { max-width: 120px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.user-chip small { color: var(--muted); font-size: 9px; }
.mobile-menu { display: none; margin-right: 12px; }
.content { width: min(100%, 1540px); margin: 0 auto; padding: clamp(25px, 3.2vw, 50px); }
.route { display: none; }
.route.is-active { display: block; animation: route-in .25s ease-out; }
@keyframes route-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Studio */
.studio-intro, .page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 25px; }
.studio-intro h2, .page-intro h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(26px, 2.5vw, 37px); font-weight: 500; letter-spacing: -.035em; }
.studio-intro p, .page-intro > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.studio-grid { display: grid; grid-template-columns: minmax(430px, .88fr) minmax(460px, 1.12fr); gap: 18px; align-items: start; }
.control-panel, .result-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.control-panel { padding: clamp(20px, 2.3vw, 34px); }
.result-panel { position: sticky; top: 100px; padding: 22px; }
.section-heading { display: flex; align-items: center; gap: 11px; margin: 0 0 15px; }
.section-heading:not(:first-child) { margin-top: 29px; padding-top: 26px; border-top: 1px solid var(--line); }
.section-heading > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.section-heading h3, .result-head h3, .recent-head h3, .panel-title h3 { margin: 0; font-size: 13px; font-weight: 780; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.model-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.model-card { position: relative; min-height: 108px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; transition: border .16s, background .16s, transform .16s; }
.model-card:hover { transform: translateY(-1px); border-color: #aac0ae; }
.model-card.is-active { border-color: #6d9279; background: #f2f8f1; box-shadow: inset 0 0 0 1px #6d9279; }
.model-card .model-check { position: absolute; top: 10px; right: 10px; display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; font-size: 10px; }
.model-card.is-active .model-check { border-color: var(--green); background: var(--green); color: #fff; }
.model-card strong { display: block; max-width: calc(100% - 14px); font-size: 11px; line-height: 1.35; }
.model-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.model-card b { display: block; margin-top: 8px; color: var(--green); font-size: 9px; }
.prompt-field { position: relative; display: block; }
.prompt-field textarea { width: 100%; min-height: 142px; resize: vertical; padding: 15px 16px 32px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 12px; line-height: 1.7; }
.prompt-field textarea:focus { border-color: #6f9479; box-shadow: 0 0 0 3px rgba(71, 113, 84, .1); outline: 0; }
.prompt-meta { position: absolute; right: 11px; bottom: 10px; color: #9aa39c; font-size: 8px; }
.reference-head { display: flex; align-items: center; justify-content: space-between; margin: 17px 1px 9px; }
.reference-head > div { display: flex; align-items: baseline; gap: 8px; }
.reference-head strong { font-size: 11px; }
.reference-head span { color: var(--muted); font-size: 8px; }
.drop-zone { display: flex; min-height: 54px; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #bfc9bf; border-radius: 10px; background: #f6f8f3; color: #67736b; font-size: 10px; }
.drop-zone small { color: #99a29a; }
.drop-zone.is-dragging { border-color: var(--green); background: var(--green-soft); }
.drop-icon { font-size: 17px; }
.upload-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 8px; }
.upload-card { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: #e9ede6; }
.upload-card img { width: 100%; height: 100%; object-fit: cover; }
.upload-card button { position: absolute; top: 5px; right: 5px; display: grid; width: 21px; height: 21px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: rgba(20,31,22,.76); color: #fff; font-size: 13px; }
.upload-card.is-uploading::after { content: "上传中"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(246,248,243,.78); color: var(--green); font-size: 9px; font-weight: 750; }
.settings-row { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; margin-top: 23px; }
.setting-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.setting-group legend { margin-bottom: 9px; font-size: 10px; font-weight: 750; }
.ratio-options { display: flex; gap: 5px; flex-wrap: wrap; }
.ratio-button { display: grid; min-width: 43px; height: 43px; padding: 5px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #647067; font-size: 8px; }
.ratio-button::before { content: ""; display: block; width: var(--rw, 18px); height: var(--rh, 13px); border: 1.2px solid currentColor; border-radius: 2px; }
.ratio-button.is-active { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 800; }
.segment-options { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #eef1ec; }
.segment-button { height: 35px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #6c776f; font-size: 9px; font-weight: 700; }
.segment-button.is-active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 7px rgba(33,54,38,.08); }
.segment-button:disabled { display: none; }
.submit-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.quote { display: grid; }
.quote span { color: var(--muted); font-size: 8px; letter-spacing: .05em; }
.quote strong { margin: 2px 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.quote small { color: #8f9991; font-size: 8px; }
.generate-button { min-width: 145px; height: 50px; }
.generate-button b { margin-left: 12px; font-size: 15px; }
.result-head, .recent-head, .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.result-index { display: block; margin-bottom: 3px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.result-stage { position: relative; display: grid; min-height: 430px; margin-top: 15px; overflow: hidden; place-items: center; border-radius: 15px; background-color: #e9ede6; background-image: linear-gradient(45deg, rgba(255,255,255,.46) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.46) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.46) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.46) 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.result-stage img { max-width: 100%; max-height: min(64vh, 680px); width: 100%; height: 100%; object-fit: contain; }
.empty-result, .result-progress, .result-failed { width: min(84%, 330px); text-align: center; }
.empty-result h4, .result-progress h4, .result-failed h4 { margin: 18px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 19px; font-weight: 500; }
.empty-result p, .result-progress p, .result-failed p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.empty-art { position: relative; width: 90px; height: 70px; margin: 0 auto; }
.empty-art span { position: absolute; display: block; width: 54px; height: 54px; border: 1px solid rgba(53,81,61,.32); border-radius: 13px; background: rgba(255,255,255,.38); transform: rotate(12deg); }
.empty-art span:nth-child(2) { left: 20px; transform: rotate(-8deg); background: rgba(205,229,175,.48); }
.empty-art span:nth-child(3) { left: 35px; top: 13px; width: 42px; height: 42px; transform: rotate(17deg); background: rgba(202,220,237,.58); }
.progress-orbit { position: relative; display: grid; width: 84px; height: 84px; margin: 0 auto; place-items: center; border: 1px solid #c4d1c6; border-radius: 50%; background: rgba(255,255,255,.65); }
.progress-orbit i { position: absolute; inset: -1px; border: 2px solid transparent; border-top-color: var(--green); border-radius: 50%; animation: spin 1.1s linear infinite; }
.progress-orbit span { font-family: Georgia, serif; font-size: 19px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 3px; margin-top: 21px; overflow: hidden; border-radius: 5px; background: #d5ddd5; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--green); transition: width .4s; }
.result-failed > span { display: grid; width: 52px; height: 52px; margin: 0 auto; place-items: center; border-radius: 50%; background: var(--danger-soft); color: var(--danger); font-family: Georgia, serif; font-size: 24px; }
.result-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.result-meta > div { display: grid; min-width: 0; padding: 9px 10px; background: #fff; }
.result-meta span { color: var(--muted); font-size: 7px; }
.result-meta strong { margin-top: 3px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.recent-head { margin: 20px 0 10px; padding-top: 17px; border-top: 1px solid var(--line); }
.recent-tasks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.recent-card { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: #edf0eb; }
.recent-card img { width: 100%; height: 100%; object-fit: cover; }
.recent-card .recent-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--muted); font-size: 9px; }
.recent-card footer { position: absolute; inset: auto 0 0; display: grid; padding: 18px 7px 6px; color: #fff; background: linear-gradient(transparent, rgba(12,20,14,.72)); }
.recent-card footer span { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

/* Tables, developer, billing */
.page-intro { align-items: center; margin-bottom: 29px; }
.filter-row { display: flex; gap: 8px; margin: -11px 0 13px; }
select { min-height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-2); font-size: 10px; }
.table-shell { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; }
th { height: 43px; padding: 0 15px; border-bottom: 1px solid var(--line); color: #7b857e; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { max-width: 320px; padding: 14px 15px; border-bottom: 1px solid #e8ece6; color: #465149; font-size: 10px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7f9f5; }
.cell-main { display: grid; gap: 3px; }
.cell-main strong { overflow: hidden; max-width: 280px; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cell-main small, .mono { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; background: #edf0eb; color: #5f6a62; font-size: 8px; font-weight: 750; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.completed, .status-badge.active { background: var(--green-soft); color: var(--green); }
.status-badge.failed, .status-badge.disabled { background: var(--danger-soft); color: var(--danger); }
.status-badge.queued { background: var(--warning-soft); color: var(--warning); }
.status-badge.processing { background: #e4edf5; color: #426d8a; }
.table-action { padding: 5px 8px; border: 0; background: transparent; color: var(--green); font-size: 9px; font-weight: 750; }
.table-empty { display: none; padding: 55px 20px; color: var(--muted); font-size: 11px; text-align: center; }
.table-empty.is-visible { display: block; }
.developer-grid { display: grid; grid-template-columns: minmax(320px, .78fr) minmax(500px, 1.22fr); gap: 20px; align-items: start; }
.developer-grid > div, .api-guide, .admin-split > section { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel-title > span { color: var(--muted); font-size: 8px; }
.key-list { display: grid; gap: 8px; margin-top: 15px; }
.key-card { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.key-symbol { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.key-card > div { display: grid; min-width: 0; }
.key-card strong { font-size: 10px; }
.key-card code { margin-top: 3px; color: var(--muted); font-size: 8px; }
.key-card button { margin-left: auto; }
.api-guide { overflow: hidden; padding: 0; background: #17211a; color: #e8eee7; }
.api-guide-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
.api-guide-head span { color: #a7b6aa; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.api-guide .text-button { color: #bddcae; }
.api-guide pre { min-height: 275px; margin: 0; padding: 22px; overflow: auto; color: #c9d7cb; font-size: 10px; line-height: 1.75; white-space: pre-wrap; }
.endpoint-list { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid rgba(255,255,255,.08); }
.endpoint-list > div { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; padding: 13px 16px; border-right: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.endpoint-list span { color: #a9d495; font-size: 8px; font-weight: 800; }
.endpoint-list code { color: #eef4ed; font-size: 8px; }
.endpoint-list p { grid-column: 1 / -1; margin: 0; color: #8fa094; font-size: 8px; }
.large-balance { display: grid; min-width: 160px; padding: 12px 17px; border: 1px solid #b9ccb9; border-radius: 12px; background: var(--green-soft); }
.large-balance span { color: var(--green); font-size: 8px; }
.large-balance strong { margin-top: 3px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.metric-row, .admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.metric-card { position: relative; min-height: 112px; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.metric-card::after { content: ""; position: absolute; right: -22px; bottom: -36px; width: 90px; height: 90px; border-radius: 50%; background: var(--metric-color, var(--green-soft)); opacity: .75; }
.metric-card span { color: var(--muted); font-size: 9px; }
.metric-card strong { position: relative; z-index: 1; display: block; margin-top: 14px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.metric-card small { color: #909a92; font-size: 8px; }
.admin-split { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 18px; }
.activity-list { display: grid; gap: 2px; margin-top: 13px; }
.activity-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 15px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-item span { color: var(--muted); font-size: 8px; }
.activity-item time { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--muted); font-size: 8px; }
.ops-note { background: #17251b !important; color: #e9f0e7; }
.ops-note .eyebrow { color: #8fa493; }
.ops-note h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 500; }
.ops-note ol { display: grid; gap: 0; margin: 17px 0 0; padding: 0; list-style: none; }
.ops-note li { display: grid; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.1); }
.ops-note li b { color: #dce9da; font-size: 10px; }
.ops-note li span { margin-top: 3px; color: #91a295; font-size: 8px; line-height: 1.5; }

/* Dialogs and toast */
.dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 30px 80px rgba(18,36,24,.23); }
.dialog::backdrop { background: rgba(18,28,20,.42); backdrop-filter: blur(4px); }
.dialog form { position: relative; padding: 28px; }
.dialog h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 500; }
.dialog form > p:not(.eyebrow):not(.form-error):not(.dialog-context) { margin: 8px 0 22px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: #edf0eb; font-size: 18px; }
.secret-value { margin: 18px 0 14px; padding: 14px; overflow-wrap: anywhere; border: 1px dashed #9bb4a0; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.6; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-context { margin: 8px 0 20px; color: var(--green); font-size: 11px; font-weight: 700; }
.toast-region { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); color: var(--ink-2); font-size: 10px; animation: toast-in .2s ease-out; }
.toast::before { content: "✓"; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.toast.error::before { content: "!"; background: var(--danger-soft); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 1180px) {
  :root { --sidebar: 204px; }
  .studio-grid { grid-template-columns: minmax(390px, .95fr) minmax(390px, 1.05fr); }
  .model-options { grid-template-columns: 1fr; }
  .model-card { min-height: 76px; }
  .recent-tasks { grid-template-columns: repeat(3, 1fr); }
  .developer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 940px) {
  .login-view { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .mobile-brand { display: flex; }
  .app-view { display: block; }
  .sidebar { transform: translateX(-105%); width: 240px; box-shadow: 15px 0 45px rgba(22,35,25,.16); transition: transform .22s; }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { width: 100%; }
  .mobile-menu { display: grid; }
  .studio-grid { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  .model-options { grid-template-columns: repeat(3, 1fr); }
  .admin-split { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-panel { padding: 28px 22px; }
  .login-form h2 { font-size: 32px; }
  .topbar { height: 69px; padding: 0 14px; }
  .topbar > div:nth-child(2) { display: none; }
  .balance-chip { padding: 6px 9px; }
  .user-chip div { display: none; }
  .content { padding: 23px 14px 38px; }
  .studio-intro, .page-intro { align-items: flex-start; }
  .studio-intro h2, .page-intro h2 { font-size: 27px; }
  .studio-intro > .text-button { display: none; }
  .control-panel, .result-panel { border-radius: 16px; }
  .control-panel { padding: 18px 15px; }
  .result-panel { padding: 15px; }
  .model-options { grid-template-columns: 1fr; }
  .model-card { min-height: 74px; }
  .settings-row { grid-template-columns: 1fr; gap: 18px; }
  .result-stage { min-height: 340px; }
  .result-meta { grid-template-columns: repeat(2, 1fr); }
  .recent-tasks { grid-template-columns: repeat(3, 1fr); }
  .upload-list { grid-template-columns: repeat(3, 1fr); }
  .drop-zone small { display: none; }
  .submit-strip { align-items: stretch; flex-direction: column; }
  .generate-button { width: 100%; }
  .page-intro { gap: 14px; }
  .page-intro > .button { flex: none; }
  .metric-row, .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .developer-grid { grid-template-columns: 1fr; }
  .api-guide pre { font-size: 9px; }
  .endpoint-list { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
