:root {
  --bg: #f7f5ef;
  --surface: #fffefa;
  --surface-2: #f3f6f2;
  --ink: #1d2824;
  --muted: #718078;
  --line: #dedfd7;
  --line-strong: #c9cec5;
  --green: #0c7567;
  --green-dark: #07584f;
  --green-soft: #e7f4f0;
  --gold: #d39128;
  --gold-dark: #9b6514;
  --gold-soft: #fff4dd;
  --red: #b54b44;
  --red-soft: #fbecea;
  --blue: #386c9a;
  --shadow: 0 14px 40px rgba(29, 40, 36, .09);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible { outline: 3px solid rgba(12, 117, 103, .2); outline-offset: 2px; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 10px; color: #c9e6df; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.eyebrow.dark { color: var(--green); }
.brand-mark { width: 38px; height: 38px; display: grid; flex: none; place-items: center; border-radius: 7px; background: var(--ink); color: #fff; font-family: Georgia, serif; font-size: 22px; font-weight: 700; }
.brand-mark-large { width: 56px; height: 56px; background: #fff; color: var(--green-dark); font-size: 31px; }

.auth-view { min-height: 100dvh; display: grid; grid-template-columns: minmax(390px, 1.08fr) minmax(420px, .92fr); }
.auth-brand { min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: 54px clamp(42px, 7vw, 118px); overflow: hidden; background: #155d56; color: #fff; }
.auth-brand h1 { max-width: 700px; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(48px, 5vw, 76px); font-weight: 500; line-height: 1.08; }
.auth-intro { max-width: 590px; margin: 28px 0 0; color: #d2e8e2; font-size: 16px; line-height: 1.9; }
.auth-feature-row { display: flex; flex-wrap: wrap; gap: 25px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.18); color: #e7f4f1; font-size: 13px; }
.auth-feature-row span { display: inline-flex; align-items: center; gap: 8px; }
.auth-feature-row svg { width: 16px; }
.auth-panel { display: grid; place-items: center; padding: 36px; background: #fbfaf6; }
.auth-card { width: min(100%, 430px); }
.auth-heading h2 { margin: 0 0 9px; font-family: Georgia, "Songti SC", serif; font-size: 34px; font-weight: 600; }
.auth-heading > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.auth-tabs { height: 43px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 30px 0 24px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #eeeee8; }
.auth-tabs button { border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(29,40,36,.08); }
.auth-form { display: grid; gap: 17px; }
.auth-form label { display: grid; gap: 8px; color: #3f4d47; font-size: 12px; font-weight: 700; }
.input-shell { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.input-shell:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(12,117,103,.08); }
.input-shell > svg { width: 17px; color: #89968f; }
.input-shell input { min-width: 0; height: 100%; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.form-error { min-height: 18px; margin: -2px 0 0; color: var(--red); font-size: 12px; }
.service-check { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.status-dot { width: 8px; height: 8px; display: inline-block; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(211,145,40,.12); }
.status-dot.ok { background: #16a085; box-shadow: 0 0 0 4px rgba(22,160,133,.12); }
.status-dot.warn { background: var(--red); box-shadow: 0 0 0 4px rgba(181,75,68,.12); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); text-decoration: none; cursor: pointer; font-size: 12px; font-weight: 800; white-space: nowrap; transition: border-color .15s, background .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button svg { width: 16px; height: 16px; }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border-color: var(--line); background: var(--surface); }
.button.secondary:hover { border-color: var(--line-strong); background: #f8f8f3; }
.button.accent { background: var(--gold); color: #fff; }
.button.accent:hover { background: var(--gold-dark); }
.button.full { width: 100%; min-height: 48px; }
.button.compact { min-height: 36px; padding: 0 12px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: #53615b; cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); color: var(--green); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.bare { width: 30px; height: 30px; border: 0; background: transparent; }
.icon-button.small { width: 32px; height: 32px; }

.app-shell { min-height: 100dvh; }
.topbar { height: 68px; display: flex; align-items: center; position: sticky; z-index: 30; top: 0; padding: 0 clamp(14px, 3vw, 46px); border-bottom: 1px solid var(--line); background: rgba(255,254,250,.94); backdrop-filter: blur(12px); }
.brand-lockup { min-width: 180px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { margin-bottom: 3px; font-family: Georgia, "Songti SC", serif; font-size: 17px; }
.brand-lockup small { color: var(--muted); font-size: 9px; }
.topnav { align-self: stretch; display: flex; gap: 3px; }
.topnav button { min-width: 75px; display: inline-flex; align-items: center; justify-content: center; position: relative; gap: 7px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #66736d; cursor: pointer; font-size: 12px; font-weight: 700; }
.topnav button:hover, .topnav button.active { color: var(--green); }
.topnav button.active { border-bottom-color: var(--green); }
.topnav svg { width: 16px; }
.topnav b { min-width: 18px; padding: 2px 4px; border-radius: 8px; background: #edf0ec; font-size: 9px; }
.account-actions { min-width: 0; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.points-chip { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid #ead8b8; border-radius: 6px; background: var(--gold-soft); color: #74521b; cursor: pointer; font-size: 10px; }
.points-chip svg { width: 15px; }
.points-chip strong { font-size: 12px; }
.user-menu { max-width: 210px; display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.user-menu > span { width: 34px; height: 34px; display: grid; flex: none; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; }
.user-menu strong, .user-menu small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu strong { font-size: 10px; }
.user-menu small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.notification-dot { width: 7px; height: 7px; position: absolute; top: 6px; right: 6px; border: 2px solid #fff; border-radius: 50%; background: var(--red); }
#announcementButton { position: relative; }

.main-content { width: min(100%, 1540px); margin: 0 auto; padding: 24px clamp(16px, 3vw, 44px) 70px; }
.page { display: none; }
.page.active { display: block; }
.page-heading { min-height: 73px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.page-heading h1 { margin: 0 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 600; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.service-pill { min-height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 5px 18px rgba(29,40,36,.035); }
.announcement-banner { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e8d7b5; border-radius: 6px; background: #fff9ec; color: #634d27; font-size: 11px; line-height: 1.6; }
.announcement-banner svg { width: 16px; flex: none; margin-top: 1px; }
.announcement-banner strong { margin-right: 6px; }

.workbench-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(380px, 1fr); gap: 18px; align-items: start; }
.workbench-grid > *, .composer-panel form { min-width: 0; }
.composer-panel { padding: 21px 22px 22px; }
.composer-heading { min-height: 40px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.composer-heading h1 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.composer-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.asset-toolbar, .panel-heading, .field-heading, .submit-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.asset-toolbar h2, .panel-heading h2, .form-panel h2, .generated-panel h2, .announcement-list-panel h2 { margin: 0 0 5px; font-size: 14px; }
.asset-toolbar p, .panel-heading p, .form-panel > div > p, .generated-panel > div > p, .announcement-list-panel > div > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.asset-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.quiet-badge { min-height: 25px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 12px; background: #f8f8f4; color: var(--muted); font-size: 9px; white-space: nowrap; }
.asset-section { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.asset-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fbfcf9; }
.asset-column { min-width: 0; padding: 10px; }
.asset-column + .asset-column { border-left: 1px solid var(--line); }
.asset-column > header { height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.asset-column > header span { display: inline-flex; align-items: center; gap: 6px; }
.asset-column > header svg { width: 14px; height: 14px; color: var(--green); }
.asset-column > header b { font-size: 10px; }
.asset-column > header small { color: var(--muted); font-size: 8px; }
.asset-list { min-height: 55px; max-height: 170px; display: grid; align-content: start; gap: 6px; margin-bottom: 8px; overflow-y: auto; }
.asset-list.empty { place-items: center; align-content: center; }
.asset-list > p { margin: 0; color: #98a29c; font-size: 8px; }
.drop-zone { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px; border: 1px dashed #bbc8c0; border-radius: 5px; background: #f7faf7; color: var(--ink); cursor: pointer; text-align: left; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green); background: var(--green-soft); }
.drop-zone > svg { width: 18px; height: 18px; flex: none; color: var(--green); }
.drop-zone strong, .drop-zone small { display: block; }
.drop-zone strong { margin-bottom: 3px; font-size: 9px; }
.drop-zone span, .drop-zone small { color: var(--muted); font-size: 7px; }
.drop-zone small { color: #99a49e; }
.upload-progress { margin-top: 10px; padding: 9px 11px; border: 1px solid #cce0da; border-radius: 5px; background: var(--green-soft); }
.upload-progress > span { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--green-dark); font-size: 9px; }
.upload-progress svg { width: 13px; animation: spin 1s linear infinite; }
.upload-progress > div { height: 4px; overflow: hidden; border-radius: 2px; background: #cbded9; }
.upload-progress > div i { width: 0; height: 100%; display: block; background: var(--green); transition: width .2s; }
@keyframes spin { to { transform: rotate(360deg); } }
.asset-card { width: 100%; height: 47px; display: grid; grid-template-columns: 34px minmax(0,1fr) 24px; align-items: center; gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.asset-thumb { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: #eef2ee; color: var(--green); }
.asset-thumb img, .asset-thumb video { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb svg { width: 16px; }
.asset-card strong, .asset-card small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card strong { font-size: 9px; }
.asset-card small { margin-top: 4px; color: var(--muted); font-size: 7px; }
.asset-card button { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #8c9992; cursor: pointer; }
.asset-card button:hover { background: var(--red-soft); color: var(--red); }
.asset-card button svg { width: 12px; }

.prompt-section { margin-top: 17px; }
.field-heading { align-items: flex-end; margin-bottom: 8px; }
.field-heading b, .field-heading small { display: block; }
.field-heading b { margin-bottom: 4px; font-size: 11px; }
.field-heading small { color: var(--muted); font-size: 9px; font-weight: 400; }
.field-heading em { color: var(--muted); font-size: 9px; font-style: normal; }
.prompt-wrap { position: relative; }
.prompt-editor { min-height: 205px; max-height: 380px; padding: 14px 15px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.prompt-editor:empty:before { color: #a3aca7; content: attr(data-placeholder); pointer-events: none; }
.prompt-editor:focus { border-color: var(--green); outline: 0; box-shadow: 0 0 0 3px rgba(12,117,103,.08); }
.mention-token { display: inline-flex; align-items: center; margin: 0 2px; padding: 1px 6px; border: 1px solid #acd4ca; border-radius: 4px; background: var(--green-soft); color: var(--green-dark); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.mention-token[data-kind="audio"] { border-color: #d8c49c; background: var(--gold-soft); color: #76551c; }
.mention-token[data-kind="video"] { border-color: #b9cce0; background: #edf4fa; color: #315f86; }
.mention-menu { width: min(400px, calc(100% - 20px)); max-height: 255px; position: absolute; z-index: 20; left: 10px; top: calc(100% - 8px); padding: 6px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.mention-menu:before { display: block; padding: 6px 8px 7px; color: var(--muted); content: "按上传顺序选择素材"; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.mention-option { width: 100%; min-height: 44px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.mention-option:hover, .mention-option.active { background: var(--green-soft); }
.mention-option .asset-thumb { width: 30px; height: 30px; }
.mention-option strong, .mention-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-option strong { font-size: 9px; }
.mention-option small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.mention-option > span:last-child { color: var(--muted); font-size: 8px; }
.mention-order { min-height: 30px; display: flex; align-items: center; gap: 8px; margin-top: 7px; overflow-x: auto; }
.mention-order > span { flex: none; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.mention-order p { margin: 0; color: #9ca6a0; font-size: 8px; }
.mention-order b { min-width: 20px; min-height: 20px; display: inline-grid; place-items: center; flex: none; padding: 0 5px; border-radius: 10px; background: #edf0ec; color: var(--muted); font-size: 8px; }
.mention-order i { flex: none; color: #9da8a2; font-size: 9px; font-style: normal; }

.generation-settings { display: grid; grid-template-columns: minmax(100px, 1.05fr) minmax(150px, 1.6fr) repeat(5, minmax(82px, .8fr)); gap: 9px; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.field { display: grid; align-content: start; gap: 7px; }
.field > span { min-height: 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field b { color: #3b4842; font-size: 10px; }
.field small { color: var(--muted); font-size: 8px; }
.field input, .field select, .field textarea, .field-value, .search-field input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: #fff; color: var(--ink); font-size: 10px; }
.field-value { display: flex; align-items: center; overflow: hidden; background: #f4f5f1; color: var(--green-dark); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.field textarea { height: 105px; padding: 10px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(12,117,103,.07); }
.submit-row { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.submit-row > div { min-width: 0; }
.submit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.submit-row p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.inline-notice { display: block; color: var(--green); font-size: 10px; }
.inline-notice.error { color: var(--red); }
.generate-button { min-width: 140px; min-height: 44px; }

.activity-panel { overflow: hidden; }
.panel-heading { min-height: 64px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.task-list { max-height: 805px; overflow-y: auto; }
.task-card { padding: 14px 16px 16px; border-bottom: 1px solid var(--line); }
.task-card:last-child { border-bottom: 0; }
.task-card-head, .task-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-card-head strong { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.task-preview { aspect-ratio: 16 / 9; position: relative; margin: 11px 0; overflow: hidden; border-radius: 5px; background: #111915; }
.task-preview video { width: 100%; height: 100%; display: block; object-fit: contain; }
.task-preview-actions { display: flex; position: absolute; z-index: 2; right: 7px; top: 7px; gap: 5px; }
.task-preview-actions a { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.32); border-radius: 4px; background: rgba(16,25,21,.78); color: #fff; }
.task-preview-actions svg { width: 13px; height: 13px; }
.task-prompt { display: -webkit-box; margin: 8px 0 0; overflow: hidden; color: #56635d; font-size: 9px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-meta { margin-top: 7px; color: var(--muted); font-size: 8px; }
.task-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-bar { height: 4px; margin-top: 9px; overflow: hidden; border-radius: 2px; background: #e8ece8; }
.progress-bar i { width: 0; height: 100%; display: block; background: var(--gold); transition: width .2s; }
.task-card.completed .progress-bar i { background: var(--green); }
.status-tag { min-height: 20px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 10px; background: #edf0ec; color: #64716a; font-size: 8px; font-weight: 800; }
.status-tag.completed { background: var(--green-soft); color: var(--green); }
.status-tag.failed { background: var(--red-soft); color: var(--red); }
.status-tag.submitted, .status-tag.processing, .status-tag.queued, .status-tag.downloading, .status-tag.uploading { background: var(--gold-soft); color: var(--gold-dark); }
.task-error { margin: 8px 0 0; padding: 8px 9px; border-radius: 4px; background: var(--red-soft); color: var(--red); font-size: 8px; line-height: 1.55; }
.task-refund { display: block; margin-top: 4px; font-weight: 800; }
.panel-footer-button { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-top: 1px solid var(--line); background: #fafaf6; color: var(--green); cursor: pointer; font-size: 9px; font-weight: 800; }
.panel-footer-button svg { width: 13px; }
.empty-compact { min-height: 130px; display: grid; place-items: center; color: var(--muted); font-size: 9px; }

.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; vertical-align: middle; }
th { background: #fafaf6; color: #7c8882; font-size: 8px; font-weight: 800; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
td small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.table-progress { min-width: 90px; display: flex; align-items: center; gap: 7px; }
.table-progress .progress-bar { width: 68px; margin: 0; }
.table-link { color: var(--green); font-weight: 800; text-decoration: none; }
.danger-link, .text-button { padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; }
.danger-link { color: var(--red); }
.text-button { color: var(--green); }
.empty-state { min-height: 330px; display: none; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state.show { display: grid; }
.empty-state svg { width: 28px; }
.empty-state strong { color: var(--ink); font-size: 12px; }
.empty-state span { font-size: 9px; }

.metrics-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
.metric { min-height: 91px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.metric strong { display: block; margin-bottom: 9px; font-family: Georgia, serif; font-size: 23px; }
.metric span { color: var(--muted); font-size: 9px; }
.metric.positive { border-color: #c9ded8; background: #f5fbf8; }
.metric.warning { border-color: #eadcbd; background: #fffbf1; }
.admin-tabs { display: flex; gap: 3px; margin-bottom: 16px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: #eeeee8; }
.admin-tabs button { min-width: 92px; height: 34px; flex: 1; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.admin-tabs button.active { background: #fff; color: var(--green); box-shadow: 0 2px 8px rgba(29,40,36,.08); }
.admin-view { display: none; }
.admin-view.active { display: block; }
.admin-toolbar { min-height: 58px; display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.admin-toolbar .quiet-badge { margin-left: auto; }
.search-field { height: 39px; display: flex; align-items: center; gap: 8px; flex: 1; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.search-field svg { width: 15px; color: var(--muted); }
.search-field input { height: 100%; padding: 0; border: 0; }
.model-admin-list { display: grid; gap: 11px; }
.model-admin-card { display: grid; grid-template-columns: minmax(250px,1.3fr) minmax(180px,1fr) 150px 105px; align-items: end; gap: 13px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; background: var(--surface); }
.model-admin-card.disabled { border-left-color: #aeb6b1; background: #f8f8f4; }
.model-identity strong { display: block; margin-bottom: 7px; font-size: 12px; }
.model-identity p { margin: 0 0 6px; color: var(--muted); font: 8px/1.5 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.model-identity span { display: inline-flex; min-height: 20px; align-items: center; padding: 0 7px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 800; }
.model-controls { display: grid; grid-template-columns: minmax(0,1fr) 110px; gap: 9px; }
.switch-row { min-height: 39px; display: flex; align-items: center; gap: 8px; color: #48554f; font-size: 10px; font-weight: 700; }
.switch-row input { width: 16px; height: 16px; accent-color: var(--green); }
.split-admin { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.form-panel, .generated-panel, .announcement-list-panel { padding: 18px; }
.form-panel { display: grid; gap: 14px; }
.generated-panel, .announcement-list-panel { min-height: 260px; }
.generated-cards, .admin-announcement-list { display: grid; gap: 8px; margin-top: 14px; }
.generated-card { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #d8c59e; border-radius: 5px; background: var(--gold-soft); }
.generated-card code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: #6c4a11; font-size: 10px; font-weight: 800; }
.generated-card button { width: 28px; height: 28px; }
.ledger-positive { color: var(--green); font-weight: 800; }
.ledger-negative { color: var(--red); font-weight: 800; }
.admin-announcement { padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.admin-announcement-head { display: flex; justify-content: space-between; gap: 10px; }
.admin-announcement strong { font-size: 11px; }
.admin-announcement p { margin: 8px 0; color: var(--muted); font-size: 9px; line-height: 1.6; white-space: pre-wrap; }
.admin-announcement small { color: var(--muted); font-size: 8px; }

.dialog-backdrop { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18,29,25,.56); backdrop-filter: blur(3px); }
.dialog { width: min(100%, 470px); max-height: min(720px, 90dvh); padding: 21px; overflow-y: auto; border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.dialog-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0 0 6px; font-size: 18px; }
.dialog-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #c7ded8; border-radius: 6px; background: var(--green-soft); }
.secret-box code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--green-dark); font-size: 10px; }
.dialog-list { display: grid; gap: 9px; }
.dialog-announcement { padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.dialog-announcement.important { border-color: #ead0a1; background: #fffaf0; }
.dialog-announcement.maintenance { border-color: #e3b7b3; background: #fff7f6; }
.dialog-announcement strong { display: block; margin-bottom: 6px; font-size: 11px; }
.dialog-announcement p { margin: 0 0 7px; font-size: 10px; line-height: 1.65; white-space: pre-wrap; }
.dialog-announcement small { color: var(--muted); font-size: 8px; }
.toast-region { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { width: min(340px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; background: #fff; box-shadow: var(--shadow); font-size: 10px; line-height: 1.5; }
.toast.error { border-left-color: var(--red); }

@media (max-width: 1250px) {
  .user-menu > div, .account-actions .compact span, .points-chip span { display: none; }
  .brand-lockup { min-width: 145px; }
  .generation-settings { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .model-field { grid-column: span 2; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .model-admin-card { grid-template-columns: minmax(220px,1fr) minmax(250px,1.2fr) 105px; }
  .model-admin-card .switch-row { grid-column: 2; }
}

@media (max-width: 1120px) {
  .workbench-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-panel { order: 2; }
  .task-list { max-height: 520px; }
}

@media (max-width: 940px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-brand { min-height: 310px; padding: 34px; }
  .auth-brand h1 { font-size: 44px; }
  .auth-intro { margin-top: 17px; }
  .auth-feature-row { display: none; }
  .auth-panel { min-height: calc(100dvh - 310px); padding: 46px 24px; }
  .topbar { height: 62px; padding: 0 12px; backdrop-filter: none; }
  .brand-lockup { min-width: 52px; }
  .brand-lockup > span:last-child { display: none; }
  .topnav { position: fixed; z-index: 40; inset: auto 0 0; height: 59px; padding: 5px 8px; border-top: 1px solid var(--line); background: rgba(255,254,250,.97); backdrop-filter: blur(12px); }
  .topnav button { min-width: 0; flex: 1; flex-direction: column; gap: 2px; padding: 0; border: 0; font-size: 8px; }
  .topnav button.active { background: var(--green-soft); border-radius: 6px; }
  .topnav svg { width: 18px; }
  .topnav b { position: absolute; top: 5px; left: calc(50% + 7px); }
  .main-content { padding: 25px 14px 88px; }
  .task-list { max-height: 420px; }
  .split-admin { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .generation-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .model-field { grid-column: span 2; }
}

@media (max-width: 680px) {
  .auth-brand { min-height: 250px; }
  .auth-brand h1 { font-size: 36px; }
  .auth-intro { font-size: 12px; line-height: 1.7; }
  .auth-panel { min-height: calc(100dvh - 250px); align-items: start; padding-top: 34px; }
  .auth-heading h2 { font-size: 28px; }
  .account-actions { gap: 5px; }
  .account-actions .icon-button, .account-actions .button.compact, .points-chip { width: 34px; height: 34px; min-height: 34px; padding: 0; justify-content: center; }
  .points-chip strong, .user-menu, #announcementButton { display: none; }
  .page-heading { min-height: 62px; align-items: center; }
  .page-heading h1 { font-size: 22px; }
  .page-heading > div > p:last-child { max-width: 260px; font-size: 9px; }
  .page-heading > .button span { display: none; }
  .page-heading > .button { width: 38px; padding: 0; }
  .service-pill { display: none; }
  .composer-panel { padding: 14px; }
  .composer-heading { min-height: 36px; }
  .asset-toolbar { align-items: flex-start; }
  .asset-toolbar p { max-width: 230px; }
  .asset-toolbar-actions .quiet-badge { display: none; }
  .asset-columns { grid-template-columns: 1fr; }
  .asset-column + .asset-column { border-top: 1px solid var(--line); border-left: 0; }
  .asset-list { max-height: 145px; }
  .drop-zone { min-height: 48px; padding: 8px; }
  .drop-zone small { font-size: 7px; }
  .prompt-editor { min-height: 190px; }
  .generation-settings { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .model-field { grid-column: auto; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .submit-actions { display: grid; grid-template-columns: 1fr 1.35fr; }
  .submit-actions .button { width: 100%; min-width: 0; }
  .generate-button { width: 100%; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .model-admin-card { grid-template-columns: 1fr; align-items: stretch; }
  .model-admin-card .switch-row { grid-column: auto; }
  .model-controls { grid-template-columns: minmax(0,1fr) 110px; }
  .model-admin-card > .button { width: 100%; }
  .admin-toolbar { align-items: stretch; }
  .admin-toolbar .quiet-badge { display: none; }
  .admin-toolbar .button span { display: none; }
  .admin-toolbar .button { width: 39px; padding: 0; }
  .dialog-backdrop { align-items: end; padding: 0; }
  .dialog { width: 100%; max-height: 88dvh; border-radius: 7px 7px 0 0; }
  .toast-region { right: 12px; bottom: 70px; left: 12px; }
  .toast { width: 100%; }
}

@media (max-width: 390px) {
  .auth-brand { padding: 26px 22px; }
  .auth-brand h1 { font-size: 32px; }
  .auth-panel { padding-right: 18px; padding-left: 18px; }
  .asset-toolbar .button span { display: none; }
  .asset-toolbar .button { width: 36px; padding: 0; }
  .drop-zone > svg { width: 17px; }
  .drop-zone strong { font-size: 10px; }
  .generation-settings { grid-template-columns: 1fr 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
