:root {
    --ink: #253047;
    --muted: #79869b;
    --soft: #f7f9fd;
    --paper: #ffffff;
    --line: #e8edf5;
    --line-strong: #d9e2f0;
    --brand: #3474ff;
    --brand-dark: #225ce0;
    --brand-soft: #eef4ff;
    --mint: #bad3ff;
    --amber: #bc7318;
    --amber-soft: #fff1db;
    --red: #bf4545;
    --red-soft: #ffebeb;
    --blue: #3474ff;
    --blue-soft: #eef4ff;
    --shadow: 0 14px 40px rgba(47, 76, 120, .08);
    --radius: 12px;
    --frontend-title-size: 26px;
    --frontend-section-size: 17px;
    --frontend-card-title-size: 18px;
    --frontend-input-size: 15px;
    --frontend-article-size: 15px;
    --frontend-emphasis-size: 20px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--soft);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--soft); }
body { font-size: 14px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell:has(> .boot-screen), .app-shell:has(> .auth-wrap) { min-height: 100dvh; }
.boot-screen {
    position: relative; isolation: isolate; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 24px; width: 100%;
    min-height: 100vh; min-height: 100dvh; padding: 48px 20px;
    color: #243751; background: radial-gradient(ellipse at 22% 20%, #e5efff 0, transparent 48%), radial-gradient(ellipse at 82% 82%, #e8f1ff 0, transparent 46%), #f5f8fd;
}
.boot-panel { width: min(440px, 100%); padding: 32px 38px 28px; border: 1px solid #e2eaf6; border-radius: 22px; background: #ffffffed; box-shadow: 0 20px 70px #315c9810, 0 2px 8px #315c9804; text-align: center; }
.boot-emblem { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 16px; border: 1px solid #e3edff; border-radius: 25px; background: linear-gradient(140deg, #f6faff, #eaf2ff); }
.boot-emblem img { display: block; width: 60px; height: 60px; filter: drop-shadow(0 5px 8px #2463ff20); }
.boot-panel h1 { margin: 0; color: #172a46; font-size: 24px; font-weight: 650; line-height: 1.45; letter-spacing: -.3px; overflow-wrap: anywhere; }
.boot-subtitle { margin: 8px 0 0; color: #7b8da8; font-size: 13px; line-height: 1.7; }
.boot-preview { margin: 24px 0 22px; border: 1px solid #e1eaf8; border-radius: 10px; background: #f7faff; overflow: hidden; }
.boot-preview-bar { display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-bottom: 1px solid #e5ecf8; background: #fff; }
.boot-preview-bar > span { width: 42px; height: 5px; margin-right: auto; border-radius: 3px; background: #d5e4fc; }
.boot-preview-bar > i { width: 4px; height: 4px; border-radius: 50%; background: #d5e1f3; }
.boot-preview-body { display: grid; grid-template-columns: 42px 1fr 1fr; gap: 10px; padding: 12px; }
.boot-preview-nav { display: grid; align-content: start; gap: 9px; padding-top: 6px; }
.boot-preview-nav i { width: 100%; height: 5px; border-radius: 3px; background: #e0e9f7; }
.boot-preview-nav i:first-child { background: #92b5ff; }
.boot-preview-nav i:last-child { width: 72%; }
.boot-preview-paper { position: relative; min-width: 0; padding: 10px; height: 82px; border: 1px solid #e4ebf8; border-radius: 6px; background: #fff; }
.boot-preview-paper b, .boot-preview-paper i { display: block; height: 4px; margin-bottom: 7px; border-radius: 3px; background: #e8eef8; }
.boot-preview-paper b { width: 48%; height: 5px; margin-bottom: 10px; background: #c9daf7; }
.boot-preview-paper i:nth-child(3) { width: 84%; }
.boot-preview-paper i:nth-child(4) { width: 62%; }
.boot-preview-paper > span { position: absolute; right: 9px; bottom: 9px; width: 25px; height: 8px; border-radius: 3px; background: #dce8ff; }
.boot-preview-result { border-color: #cfdef9; }
.boot-preview-result b { background: #8fb4fc; }
.boot-preview-result > span { display: grid; place-items: center; width: 17px; height: 17px; color: #fff; background: #7ca6f8; border-radius: 50%; font-size: 11px; line-height: 1; }
.boot-progress { width: min(200px, 100%); height: 3px; margin: 0 auto; border-radius: 3px; overflow: hidden; background: #eaf0fb; }
.boot-progress > span { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #95b8ff, #3474ff); animation: boot-loading 1.7s ease-in-out infinite; }
.boot-status { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0 0; color: #47648b; font-size: 14px; line-height: 1.7; }
.boot-dots { display: inline-flex; gap: 3px; }
.boot-dots i { width: 3px; height: 3px; border-radius: 50%; background: #5287ea; animation: boot-dot 1.4s ease-in-out infinite; }
.boot-dots i:nth-child(2) { animation-delay: .15s; }
.boot-dots i:nth-child(3) { animation-delay: .3s; }
.boot-caption { margin: 6px 0 0; color: #8999af; font-size: 12px; line-height: 1.7; }
.boot-signature { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 0; color: #8495ae; font-size: 12px; line-height: 1.7; }
.boot-signature > span { color: #b7c6dc; }
@keyframes boot-loading { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes boot-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (max-width: 480px) {
    .boot-screen { padding: 28px 20px; gap: 20px; }
    .boot-panel { padding: 26px 24px; border-radius: 18px; }
    .boot-emblem { width: 76px; height: 76px; border-radius: 22px; }
    .boot-emblem img { width: 54px; height: 54px; }
    .boot-panel h1 { font-size: 22px; }
    .boot-preview-body { grid-template-columns: 30px 1fr 1fr; gap: 7px; padding: 10px; }
    .boot-preview-paper { padding: 9px 7px; }
}
@media (prefers-reduced-motion: reduce) {
    .boot-progress > span { animation: none; transform: translateX(75%); }
    .boot-dots i { animation: none; opacity: .6; }
}
.boot-mark, .logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--brand); border-radius: 7px; font-weight: 800; letter-spacing: 0; }

.topbar { height: 68px; flex: 0 0 68px; display: flex; align-items: center; padding: 0 32px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 220px; font-size: 16px; font-weight: 750; letter-spacing: 0; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 1px; }
.topnav { display: flex; align-items: center; gap: 4px; height: 100%; }
.topnav a, .topnav button { border: 0; background: transparent; padding: 8px 12px; color: var(--muted); border-radius: 6px; }
.topnav a:hover, .topnav a.active { color: var(--brand-dark); background: var(--brand-soft); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.user-menu { position: relative; }
.user-trigger { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 5px 8px 5px 5px; border-radius: 22px; color: var(--ink); }
.user-trigger:hover, .user-menu:focus-within .user-trigger { background: var(--soft); }
.avatar { width: 30px; height: 30px; display: inline-grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50%; font-size: 12px; font-weight: 700; }
.chevron { font-size: 11px; color: var(--muted); }
.user-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 174px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.user-dropdown::before { content: ""; position: absolute; right: 0; bottom: 100%; left: 0; height: 9px; }
.user-menu:hover .user-dropdown, .user-menu:focus-within .user-dropdown { display: block; }
.user-dropdown button { display: block; width: 100%; padding: 9px 10px; text-align: left; border: 0; background: transparent; border-radius: 5px; color: var(--ink); }
.user-dropdown button:hover { background: var(--soft); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; font-weight: 650; transition: background .16s, border-color .16s, color .16s, transform .16s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--brand); }
.button-primary:hover:not(:disabled) { background: var(--brand-dark); }
.button-secondary { color: var(--brand-dark); background: var(--brand-soft); border-color: #d9e6ff; }
.button-secondary:hover:not(:disabled) { background: #e4eeff; }
.button-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button-ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); background: var(--paper); }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f3cdcd; }
.button-danger:hover:not(:disabled) { background: #ffdede; }
.button-small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.button-icon { min-width: 34px; padding: 0 8px; font-size: 17px; }

.auth-wrap { flex: 1; display: grid; place-items: center; padding: 40px 20px; background: var(--soft); }
.auth-panel { width: min(430px, 100%); padding: 34px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.auth-header { margin-bottom: 26px; }
.auth-header .logo-mark { margin-bottom: 16px; }
.auth-header h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: 0; }
.auth-header p { margin: 0; color: var(--muted); }
.auth-switch { margin-top: 22px; text-align: center; color: var(--muted); }
.auth-switch button { border: 0; background: transparent; color: var(--brand); font-weight: 650; padding: 0 3px; }
.auth-switch button:hover { text-decoration: underline; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 650; color: #56647b; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; color: var(--ink); background: #fff; padding: 10px 11px; transition: border-color .16s, box-shadow .16s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52, 116, 255, .12); }
.field textarea { min-height: 120px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 12px; }
.field .check-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.field .check-line input[type="checkbox"] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brand); box-shadow: none; }
.required { color: var(--red); }
.captcha-line { display: grid; grid-template-columns: 1fr 112px; gap: 8px; align-items: end; }
.captcha-visual { width: 112px; height: 40px; display: block; }
.captcha-image { width: 112px; height: 40px; border: 1px solid var(--line-strong); border-radius: 5px; background: #f2f5f1; object-fit: cover; cursor: pointer; }
.captcha-placeholder { width: 112px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; background: #f2f5f1; color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; }
.captcha-placeholder.is-error { color: var(--red); background: var(--red-soft); }
.captcha-image:focus-visible, .captcha-placeholder:focus-visible { outline: 3px solid rgba(52, 116, 255, .2); outline-offset: 1px; }
.form-error { min-height: 20px; margin: -5px 0 12px; color: var(--red); font-size: 13px; }
.full-button { width: 100%; }
.quota-get-code { margin-top: 12px; }

.workspace-layout { width: min(1480px, 100%); margin: 0 auto; padding: 28px 32px 42px; display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 26px; flex: 1; }
.my-rewrites-layout { grid-template-columns: minmax(0, 1fr); }
.side-panel { align-self: start; position: sticky; top: 95px; }
.side-heading { margin: 0 0 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
.mode-list { display: grid; gap: 8px; }
.mode-button { width: 100%; min-height: 76px; display: flex; align-items: flex-start; gap: 10px; padding: 13px 12px; text-align: left; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .72); color: var(--muted); transition: background .16s, border-color .16s, box-shadow .16s, transform .16s; }
.mode-button:hover { background: var(--paper); color: var(--ink); border-color: var(--line-strong); box-shadow: 0 4px 12px rgba(47, 76, 120, .06); transform: translateY(-1px); }
.mode-button.active { color: var(--brand-dark); background: var(--brand-soft); border-color: #c8dbff; box-shadow: 0 4px 12px rgba(52, 116, 255, .08); }
.mode-button.active::after { content: "✓"; margin-left: auto; color: var(--brand); font-size: 15px; font-weight: 800; line-height: 24px; }
.mode-symbol { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border-radius: 6px; background: #edf3fd; color: var(--brand-dark); font-size: 15px; font-weight: 750; }
.mode-button.active .mode-symbol { background: var(--brand); color: #fff; }
.mode-copy strong { display: block; font-size: 14px; }
.mode-copy small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; }
.side-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.side-note strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 13px; }
.side-note p { margin: 0 0 6px; }
.side-note p:last-child { margin-bottom: 0; }

.content-column { min-width: 0; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 24px; letter-spacing: 0; }

.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.usage-layout { max-width: 1120px; }
.usage-page { min-width: 0; }
.usage-priority { padding: 22px 24px 20px; border: 1px solid #b9d8c5; border-left: 4px solid var(--brand); border-radius: 8px; background: #edf8f1; box-shadow: 0 5px 16px rgba(52, 116, 255, .06); }
.usage-priority-heading { display: flex; align-items: flex-start; gap: 12px; }
.usage-priority-heading h2 { margin: 0; color: var(--brand-dark); font-size: 18px; }
.usage-priority-heading p { margin: 3px 0 0; color: #557264; font-size: 13px; }
.usage-priority-icon { width: 26px; height: 26px; display: inline-grid; place-items: center; flex: 0 0 26px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 15px; font-weight: 800; }
.usage-priority ol { display: grid; gap: 12px; margin: 19px 0 0; padding-left: 23px; color: #314a3d; }
.usage-priority li { padding-left: 4px; line-height: 1.7; }
.usage-priority strong { color: var(--brand-dark); }
.usage-sections { display: grid; gap: 0; margin-top: 28px; }
.usage-section { padding: 25px 0 27px; border-top: 1px solid var(--line); }
.usage-section h2 { margin: 0 0 16px; font-size: 18px; color: var(--ink); }
.usage-section > p { max-width: 880px; margin: 0; color: #536159; line-height: 1.8; }
.usage-steps { display: grid; gap: 17px; margin: 0; padding: 0; list-style: none; }
.usage-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.usage-step-number { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid #bfdacc; border-radius: 50%; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; font-weight: 750; }
.usage-steps strong { display: block; margin-top: 2px; color: var(--ink); }
.usage-steps p { margin: 3px 0 0; color: var(--muted); line-height: 1.7; }
.usage-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.usage-feature { display: flex; gap: 11px; min-width: 0; padding: 2px 0 4px; }
.usage-feature-mark { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: 0 0 30px; border-radius: 6px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 750; }
.usage-feature h3 { margin: 1px 0 4px; font-size: 14px; }
.usage-feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.usage-intensity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.usage-intensity > div { padding: 15px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fcfdff; }
.usage-intensity strong { color: var(--brand-dark); }
.usage-intensity p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.usage-callout { display: flex; align-items: center; gap: 10px; margin-top: 17px; padding: 12px 14px; border: 1px solid #d7e4db; border-radius: 6px; color: #536159; background: #f7faf8; font-size: 13px; }
.usage-callout strong { color: var(--brand-dark); white-space: nowrap; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.editor-surface { overflow: hidden; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 440px; }
.editor-pane { min-width: 0; display: flex; flex-direction: column; }
.editor-pane + .editor-pane { border-left: 1px solid var(--line); }
.pane-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); color: #52627d; font-weight: 700; }
.pane-head small { color: var(--muted); font-size: 12px; font-weight: 500; }
.editor-textarea { flex: 1; width: 100%; min-height: 380px; padding: 18px; border: 0; outline: 0; resize: none; color: var(--ink); background: #fff; line-height: 1.8; }
.result-area { flex: 1; min-height: 380px; padding: 18px; white-space: pre-wrap; overflow: auto; color: #485b78; line-height: 1.8; }
.result-placeholder { display: grid; place-items: center; min-height: 330px; color: #8e9bb0; text-align: center; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; border-top: 1px solid var(--line); background: #fcfdff; }
.counter { color: var(--muted); font-size: 12px; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.processing-plan-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.processing-plan-select { min-width: 116px; height: 38px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; color: var(--ink); background: #fff; }
.processing-plan-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52, 116, 255, .12); }
.progress-wrap { display: none; align-items: center; gap: 10px; min-width: min(320px, 50%); }
.progress-wrap.visible { display: flex; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border: 0; border-radius: 5px; background: #edf2fa; appearance: none; }
.progress-track::-webkit-progress-bar { background: #edf2fa; border-radius: 5px; }
.progress-track::-webkit-progress-value { background: var(--brand); border-radius: 5px; transition: width .35s ease; }
.progress-track::-moz-progress-bar { background: var(--brand); border-radius: 5px; }
.progress-value { min-width: 38px; color: var(--brand-dark); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.generation-surface { overflow: hidden; }
.generation-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 390px; }
.generation-pane { min-width: 0; display: flex; flex-direction: column; }
.generation-pane + .generation-pane { border-left: 1px solid var(--line); }
.generation-textarea { flex: 1; width: 100%; min-height: 340px; padding: 18px; border: 0; outline: 0; resize: vertical; color: var(--ink); background: #fff; line-height: 1.75; }
.generation-textarea:focus { box-shadow: inset 0 0 0 2px rgba(52, 116, 255, .14); }
.generation-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; border-top: 1px solid var(--line); background: #fcfdff; }

.upload-surface { padding: 20px; }
.dropzone { display: grid; place-items: center; min-height: 154px; padding: 22px; border: 1.5px dashed #bfd1f0; border-radius: 7px; color: var(--muted); text-align: center; background: #fafcff; transition: border-color .16s, background .16s; }
.dropzone.dragging, .dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.drop-symbol { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; color: var(--brand); background: #eaf2ff; font-size: 22px; }
.dropzone strong { display: block; color: var(--ink); }
.dropzone p { margin: 5px 0 12px; font-size: 12px; }
.file-input { display: none; }
.file-list { margin-top: 18px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.file-list-scroll { max-height: 250px; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); background: #fafcff; font-size: 12px; font-weight: 650; }
.table-sort { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.table-sort:hover, .table-sort.active { color: var(--brand-dark); }
.data-table td { color: #52627d; font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .align-right { text-align: right; }
.filename { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.empty-row { padding: 26px !important; color: var(--muted) !important; text-align: center !important; }
.upload-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.batch-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 11px; }
.section-head h2 { margin: 0; font-size: 16px; }
.section-head small { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.task-table .progress-cell { min-width: 160px; }
.mini-progress { position: relative; width: 150px; height: 20px; overflow: hidden; border-radius: 4px; background: #eef3fb; }
.mini-progress > progress { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #eef3fb; appearance: none; }
.mini-progress > progress::-webkit-progress-bar { background: #eef3fb; }
.mini-progress > progress::-webkit-progress-value { background: var(--red); transition: width .3s; }
.mini-progress > progress::-moz-progress-bar { background: var(--red); }
.mini-progress.done > progress::-webkit-progress-value { background: #40946c; }
.mini-progress.done > progress::-moz-progress-bar { background: #40946c; }
.mini-progress.has-error { box-shadow: inset 0 0 0 1px #d99a58; }
.mini-progress em { position: absolute; inset: 0; display: grid; place-items: center; color: #415575; font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.result-error { min-height: 100%; display: grid; place-items: center; padding: 24px; color: var(--red); text-align: center; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9da8a1; }
.status-queued::before { background: var(--amber); }
.status-processing::before, .status-running::before { background: var(--red); }
.status-completed::before { background: #40946c; }
.status-error::before, .status-completed_error::before { background: var(--red); }
.status-stopped::before { background: #77837c; }
.inline-actions { display: inline-flex; align-items: center; gap: 6px; }
.text-button { padding: 3px 2px; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.text-button.danger { color: var(--red); }
.muted { color: var(--muted); }
.info-note { margin-top: 13px; color: var(--muted); font-size: 12px; }

.account-layout { display: block; }
.account-nav { display: grid; align-content: start; gap: 4px; }
.account-nav button { padding: 10px 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; }
.account-nav button:hover, .account-nav button.active { color: var(--brand-dark); background: var(--brand-soft); }
.account-panel { padding: 25px; }
.account-panel h2 { margin: 0 0 5px; font-size: 18px; }
.account-panel > p { margin: 0 0 24px; color: var(--muted); }
.form-actions { display: flex; gap: 8px; padding-top: 5px; }

.admin-layout { width: min(1480px, 100%); margin: 0 auto; padding: 28px 32px 42px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; }
.admin-nav { align-self: start; position: sticky; top: 95px; display: grid; gap: 4px; }
.admin-nav button { padding: 10px 12px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; }
.admin-nav button:hover, .admin-nav button.active { color: var(--brand-dark); background: var(--brand-soft); }
.admin-nav-label { margin: 2px 12px 6px; color: var(--muted); font-size: 11px; letter-spacing: 0; text-transform: uppercase; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat { padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 5px; font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; }
.admin-surface { margin-top: 22px; padding: 20px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.toolbar h2 { margin: 0; font-size: 17px; }
.toolbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar input, .toolbar select { min-height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.history-surface { overflow: hidden; }
.history-surface-flush { margin-top: 0; }
.history-loading { display: inline-flex; align-items: center; gap: 7px; }
.history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; color: var(--muted); font-size: 12px; }
.history-range { min-height: 30px; display: inline-flex; align-items: center; }
.history-pagination-controls { display: inline-flex; align-items: center; gap: 9px; }
.history-page-count { min-width: 54px; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.setting-full { grid-column: 1 / -1; }
.form-section-title { margin: 4px 0 0; font-size: 16px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; background: rgba(18, 30, 24, .46); }
.modal { width: min(900px, 100%); max-height: min(760px, calc(100vh - 44px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 8px; background: var(--paper); box-shadow: 0 24px 80px rgba(12, 24, 18, .24); }
.modal-compact { width: min(520px, 100%); }
.modal-wide { width: min(1180px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { overflow: auto; padding: 0 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #fcfdff; }
.close-button { width: 32px; height: 32px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 20px; }
.close-button:hover { color: var(--ink); background: var(--soft); }
.admin-task-table td { vertical-align: top; }
.admin-task-bulk-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 16px 20px; background: #f6f8fd; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-task-bulk-toolbar .inline-actions { flex-wrap: wrap; gap: 10px; }
.admin-task-bulk-toolbar strong { color: var(--ink); font-size: 13px; }
.admin-task-bulk-toolbar .muted { font-size: 12px; }
.admin-task-table .task-select-cell { width: 42px; min-width: 42px; padding-right: 8px; }
.task-select-cell input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); cursor: pointer; }
.task-bulk-modal .modal-body { overflow-wrap: anywhere; }
.task-bulk-modal .task-bulk-scope { padding: 12px 14px; background: var(--brand-soft); border-radius: 10px; font-weight: 600; }
.task-bulk-progress { display: grid; gap: 10px; padding: 16px 0; }
.task-bulk-progress progress { width: 100%; height: 8px; accent-color: var(--brand); }
.task-bulk-progress span { color: var(--muted); font-size: 13px; }
.task-bulk-issues { margin-top: 14px; font-size: 13px; }
.task-bulk-issues ul { max-height: 180px; overflow: auto; padding-left: 22px; }
.task-bulk-issues li { margin: 8px 0; }
.task-submitter { display: grid; gap: 2px; min-width: 130px; }
.task-submitter small { color: var(--muted); font-size: 11px; }
.task-count { display: grid; gap: 2px; }
.task-count small { color: var(--muted); font-size: 11px; }
.admin-task-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 16px 0 13px; color: var(--muted); font-size: 12px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 6px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); font-size: 13px; animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.spinner { width: 15px; height: 15px; border: 2px solid #cbdcff; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
    .topbar { padding: 0 18px; }
    .brand { min-width: 0; }
    .brand small, .topnav { display: none; }
    .workspace-layout, .admin-layout { padding: 22px 18px 36px; grid-template-columns: 1fr; gap: 18px; }
    .side-panel, .admin-nav { position: static; }
    .mode-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .side-note { display: none; }
    .account-layout { grid-template-columns: 1fr; gap: 13px; }
    .account-nav { display: flex; overflow-x: auto; }
    .account-nav button { white-space: nowrap; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .topbar { height: 60px; flex-basis: 60px; padding: 0 12px; }
    .brand { min-width: 0; flex: 1; }
    .user-trigger { padding: 4px; }
    .user-trigger > span:nth-child(2), .user-trigger .chevron { display: none; }
    .topbar-actions .button { min-height: 32px; padding: 0 9px; font-size: 12px; }
    .workspace-layout, .admin-layout { padding: 17px 12px 30px; }
    .page-heading { display: block; }
    .heading-actions { margin-top: 12px; }
    .editor-grid { grid-template-columns: 1fr; }
    .editor-pane + .editor-pane { border-top: 1px solid var(--line); border-left: 0; }
    .editor-textarea, .result-area { min-height: 250px; }
    .mode-list { grid-template-columns: 1fr; }
    .generation-grid { grid-template-columns: 1fr; }
    .generation-pane + .generation-pane { border-top: 1px solid var(--line); border-left: 0; }
    .generation-textarea { min-height: 220px; }
    .generation-actions { align-items: stretch; flex-direction: column; }
    .editor-footer { align-items: stretch; flex-direction: column; }
    .progress-wrap { min-width: 0; width: 100%; }
    .editor-actions { justify-content: flex-end; }
    .upload-surface { padding: 12px; }
    .data-table th, .data-table td { padding: 9px 8px; }
    .filename { max-width: 180px; }
    .batch-actions { justify-content: stretch; }
    .batch-actions .processing-plan-control { flex: 1 0 100%; justify-content: flex-end; }
    .batch-actions .button { flex: 1; }
    .auth-panel { padding: 25px 20px; }
    .stat-grid { gap: 8px; }
    .stat { padding: 12px; }
    .stat-value { font-size: 21px; }
    .settings-grid { grid-template-columns: 1fr; }
    .setting-full { grid-column: auto; }
    .usage-priority { padding: 18px 16px 16px; }
    .usage-feature-grid, .usage-intensity { grid-template-columns: 1fr; gap: 14px; }
    .usage-callout { align-items: flex-start; flex-direction: column; gap: 3px; }
    .history-pagination { align-items: stretch; flex-direction: column; }
    .history-pagination-controls { justify-content: space-between; }
    .history-pagination-controls .button { flex: 1; }
    .history-page-count { flex: 0 0 auto; }
}
/* Full articles scroll continuously inside the comparison panes. */
.review-modal { width: min(1120px, 100%); }
.comparison-modal { width: min(1360px, 100%); }
.review-modal .modal-body { padding-top: 20px; }
/* Compact announcement marquee, using the same blue palette as the workbench. */
.workspace-notice { display: flex; align-items: stretch; min-width: 0; height: 48px; margin: 0 0 24px; overflow: hidden; border: 1px solid #ccdafa; border-radius: 10px; background: linear-gradient(90deg, #eef4ff, #f8faff); color: #345581; }
.workspace-notice-label { position: relative; z-index: 1; display: inline-flex; align-items: center; flex: 0 0 auto; gap: 8px; padding: 0 15px; border-right: 1px solid #ccdafa; background: #e7efff; color: var(--brand-dark); }
.workspace-notice-label strong { font-size: 13px; font-weight: 650; white-space: nowrap; }
.workspace-notice-icon { display: inline-flex; align-items: center; color: var(--brand); }
.workspace-notice-icon .ui-icon { width: 19px; height: 19px; stroke-width: 1.8; }
.workspace-notice-viewport { min-width: 0; flex: 1; display: flex; align-items: center; overflow: hidden; outline: 0; }
.workspace-notice-viewport:focus-visible { box-shadow: inset 0 0 0 2px #8bb3ff; }
.workspace-notice-track { flex: 0 0 auto; display: inline-block; padding-left: 100%; white-space: nowrap; font-size: 14px; font-weight: 500; line-height: 1.6; animation: workspace-notice-scroll var(--workspace-notice-duration, 22s) linear infinite; }
.workspace-notice:hover .workspace-notice-track, .workspace-notice:focus-within .workspace-notice-track { animation-play-state: paused; }
@keyframes workspace-notice-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (max-width: 760px) {
    .workspace-notice { height: 44px; margin-bottom: 20px; border-radius: 9px; }
    .workspace-notice-label { gap: 6px; padding: 0 11px; }
    .workspace-notice-icon .ui-icon { width: 17px; height: 17px; }
    .workspace-notice-track { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .workspace-notice-viewport { overflow-x: auto; scrollbar-width: thin; }
    .workspace-notice-track { animation: none; padding: 0 14px; }
}

.review-summary { color: var(--muted, #53665a); line-height: 1.7; margin: 0 0 18px; }
.comparison-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.comparison-pane { min-width: 0; }
.comparison-pane label { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.comparison-pane select { max-width: 100%; padding: 8px 12px; border: 1px solid #d9e3f2; border-radius: 8px; background: #fff; color: #405675; }
.comparison-text { min-height: 220px; max-height: 48vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; padding: 16px; border: 1px solid #e0e8f5; border-radius: 10px; background: #fcfdff; }
.comparison-text mark { color: #493300; background: #ffedb0; border-radius: 2px; }
.comparison-pane:last-child mark { color: #315e9e; background: #e4eeff; }
.comparison-modal .comparison-text { height: min(60vh, 720px); max-height: none; margin-bottom: 0; }
.comparison-text:focus-visible { outline: 2px solid #3474ff; outline-offset: 2px; }
@media (min-width: 721px) {
    .comparison-modal { height: min(900px, calc(100dvh - 44px)); max-height: calc(100dvh - 44px); }
    .comparison-modal .modal-head { flex-shrink: 0; }
    .comparison-modal .modal-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
    .comparison-modal .comparison-grid { flex: 1; min-height: 0; }
    .comparison-modal .comparison-pane { display: flex; flex-direction: column; min-height: 0; }
    .comparison-modal .comparison-text { flex: 1; min-height: 0; height: auto; }
}




@media (max-width: 720px) {
    .comparison-grid { grid-template-columns: minmax(0, 1fr); }
    .comparison-text { min-height: 160px; max-height: 30vh; }
    .comparison-modal .comparison-text { height: 45vh; min-height: 160px; }
}
.workflow-editor { display: grid; gap: 20px; }
.flow-overview, .flow-generation, .flow-step-card { padding: 24px; }
.flow-overview h2, .flow-generation h2, .flow-step-card h2 { font-size: 18px; margin: 0; }
.flow-overview-head, .flow-step-head, .flow-step-head > div, .flow-prompt-head, .flow-save-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.flow-overview-head label { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.flow-overview select, .flow-step-card select { border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 12px; background: #fff; color: var(--ink); max-width: 100%; }
.flow-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 12px; }
.flow-preview-step { display: flex; flex-direction: column; gap: 9px; padding: 16px; background: #eff5ff; border: 1px solid #dce7f9; border-radius: 8px; overflow-wrap: anywhere; }
.flow-preview-step.is-off { background: #f5f7fa; border-style: dashed; color: var(--muted); }
.flow-source { max-width: 520px; margin-top: 18px; }
.flow-variables { padding-top: 16px; color: var(--muted); line-height: 1.7; }
.flow-variables summary { cursor: pointer; color: var(--brand); }
.worker-history { margin-top: 20px; border-top: 1px solid var(--line-strong); padding-top: 16px; }
.worker-history > summary { cursor: pointer; color: var(--brand); padding: 8px 0; font-size: 13px; line-height: 1.7; }
.worker-history > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }
.worker-history > .muted { font-size: 12px; line-height: 1.8; }
.worker-history > .table-scroll { max-height: 320px; overflow: auto; }
.flow-step-card { background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; }
.flow-step-card.is-off { border-style: dashed; background: #fcfdff; }
.flow-step-head { margin-bottom: 20px; }
.flow-step-head > div { justify-content: flex-start; }
.flow-number { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; }
.flow-state { font-size: 12px; color: var(--muted); }
.flow-toggle { display: flex; gap: 8px; align-items: center; color: var(--brand); cursor: pointer; }
.flow-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.flow-step-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.flow-step-card fieldset:disabled { opacity: .55; }
.flow-step-card textarea { width: 100%; min-height: 135px; resize: vertical; }
.flow-step-card .settings-grid { margin-bottom: 16px; }
.flow-service-settings { padding: 16px; margin: 0 0 16px; background: #f7f9fd; border-radius: 8px; }
.flow-service-settings h3 { margin: 0 0 12px; font-size: 14px; }
.flow-service-settings .settings-grid { margin-bottom: 0; }
.flow-service-note { color: var(--muted); line-height: 1.7; margin-bottom: 0; }
.flow-save-bar { padding: 18px 24px; gap: 16px; position: sticky; bottom: 12px; box-shadow: 0 4px 20px #2530470d; z-index: 3; }
.flow-save-bar > span { font-size: 13px; color: var(--muted); }
.active-workflow { padding: 14px 18px; border: 1px solid #dce7f9; background: #eff5ff; border-radius: 8px; line-height: 1.8; overflow-wrap: anywhere; }
.saved-workflow { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 0; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
    .flow-preview-grid { grid-template-columns: minmax(0, 1fr); }
    .flow-overview, .flow-generation, .flow-step-card { padding: 18px; }
    .flow-save-bar { position: static; padding: 18px; }
    .flow-overview-head, .flow-step-head { align-items: flex-start; }
    .flow-step-card .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

/* V2: bright tool workspace. Business event hooks and admin layouts are retained. */
:root { --shadow: 0 10px 36px #3767ad0a; }
body { line-height: 1.6; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #3474ff; outline-offset: 3px; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.brand-mark { width: 36px; height: 36px; flex-shrink: 0; }
.topbar { height: 76px; flex-basis: 76px; padding: 0 max(32px, calc((100vw - 1380px) / 2)); gap: 34px; }
.brand { min-width: 205px; font-weight: 650; font-size: 18px; letter-spacing: -.4px; }
.brand small { font-size: 10px; color: #8b98ac; font-weight: 400; }
.topnav { display: flex; gap: 28px; white-space: nowrap; }
.topnav a { height: 100%; border-radius: 0; padding: 0 2px; display: flex; align-items: center; position: relative; font-size: 13px; }
.topnav a:hover, .topnav a.active { color: var(--brand); background: none; }
.topnav a.active::after { content: ''; height: 3px; border-radius: 3px; background: var(--brand); position: absolute; bottom: 0; left: 0; right: 0; }
.avatar { color: var(--brand); background: #edf3ff; font-weight: 500; width: 32px; height: 32px; }
.user-trigger { font-size: 12px; gap: 10px; }
.mobile-menu-button { display: none; }
.button { font-weight: 500; border-radius: 7px; min-height: 39px; font-size: 13px; }
.button-primary { box-shadow: 0 4px 10px #3474ff19; }
.button:disabled { box-shadow: none; }
.workspace-layout { width: min(1340px, 100%); padding: 30px 30px 24px; gap: 24px; }
.tool-workspace { display: block; padding-top: 0; }
.workspace-hero { text-align: center; padding: 30px 0 27px; }
.hero-tag { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #e0eaff; border-radius: 20px; color: #6391d9; background: #f0f6ff; padding: 3px 10px; font-size: 10px; }
.hero-tag .ui-icon { width: 13px; height: 13px; }
.workspace-hero h1 { margin: 12px 0 8px; font-size: 32px; font-weight: 650; letter-spacing: -.7px; }
.workspace-hero h1 span, .auth-intro h1 span { color: var(--brand); }
.workspace-hero p { color: var(--muted); margin: 0; font-size: 12px; letter-spacing: .6px; }
.tool-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 25px; }
.tool-choices .mode-button { align-items: center; min-height: 84px; padding: 17px 24px; gap: 17px; background: white; border-radius: 10px; box-shadow: 0 3px 12px #3767ad03; }
.tool-choices .mode-button.active { border-color: #b9d1ff; background: #f3f7ff; box-shadow: 0 0 0 1px #e6efff; }
.tool-choices .mode-symbol { width: 40px; height: 40px; flex-basis: 40px; background: #edf3ff; color: #4b84ed; border-radius: 10px; }
.tool-choices .mode-symbol.batch { background: #eaf8fb; color: #38a6bc; }
.tool-choices .mode-symbol.generate { background: #f2eefe; color: #9270d5; }
.mode-copy strong { font-weight: 550; font-size: 14px; color: #4b5b74; }
.mode-button.active strong { color: #346dd2; }
.mode-copy small { font-size: 11px; color: #8b98ae; margin-top: 5px; }
.mode-button.active::after { font-size: 12px; border-radius: 50%; border: 1px solid #cadbfa; width: 19px; height: 19px; display: grid; place-items: center; line-height: 1; font-weight: 500; }
.surface { box-shadow: 0 5px 20px #3767ad03; }
.workspace-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 57px; padding: 0 25px; border-bottom: 1px solid var(--line); background: #fff; }
.workspace-top h2 { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 550; margin: 0; }
.workspace-top h2 .ui-icon { width: 18px; color: #77a0e4; }
.workspace-top > span { font-size: 11px; color: #8e9eb6; }
.workspace-top a { font-size: 11px; }
.editor-grid, .generation-grid { min-height: 385px; }
.editor-pane + .editor-pane { background: #fcfdff; }
.pane-head { border: 0; min-height: 54px; padding: 14px 26px 0; font-size: 12px; font-weight: 550; gap: 12px; }
.pane-head small { font-size: 11px; font-weight: 400; }
.pane-tools { display: flex; align-items: center; gap: 14px; }
.pane-tools .text-button { font-size: 11px; }
.editor-textarea, .generation-textarea { padding: 17px 26px 14px; min-height: 293px; height: 293px; line-height: 2; font-size: 14px; color: #485b78; resize: vertical; }
.editor-textarea::placeholder, .generation-textarea::placeholder { color: #98a7bf; }
.editor-textarea:focus { box-shadow: inset 0 0 0 2px #3474ff12; }
.result-area { padding: 17px 26px 14px; min-height: 293px; height: 293px; line-height: 2; overflow-wrap: anywhere; }
.result-placeholder { min-height: 256px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; font-size: 12px; white-space: normal; }
.result-placeholder strong { font-size: 14px; font-weight: 500; color: #778fb4; }
.result-placeholder > span:last-child { font-size: 11px; color: #96a8c2; }
.empty-symbol { background: #f1f6ff; border: 1px solid #e4ecfa; width: 57px; height: 64px; display: grid; place-items: center; border-radius: 12px; color: #92b3e8; margin-bottom: 6px; }
.empty-symbol .ui-icon { width: 29px; height: 29px; }
.pane-bottom { padding: 4px 26px 17px; color: #8b9bb3; font-size: 10px; }
.editor-footer, .generation-actions, .batch-actions { padding: 18px 25px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; background: #fff; border-top: 1px solid var(--line); }
.editor-options { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; }
.editor-actions { margin: 0; gap: 10px; }
.editor-actions .button-primary, .editor-actions .button-danger { min-width: 142px; }
.processing-plan-control { font-size: 11px; gap: 9px; }
.processing-plan-select { min-width: 112px; height: 35px; font-size: 12px; border-color: #dfe7f4; color: #637695; }
.editor-options > .text-button { font-size: 11px; }
.editor-surface > .progress-wrap { margin: 0 25px 15px; width: auto; }
.under-editor { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: #8b99af; margin: 14px 1px 0; }
.mobile-panes { display: none; }
.upload-surface { padding: 0; overflow: hidden; }
.upload-surface .dropzone { margin: 24px; min-height: 200px; border-width: 1px; }
.upload-surface .file-list { margin: 0 24px 24px; }
.drop-symbol { background: #edf4ff; color: #74a0e9; border-radius: 12px; width: 48px; height: 48px; }
.dropzone p { max-width: 580px; line-height: 1.9; color: #8c9cb4; }
.generation-actions .counter { order: 0; flex: 1 1 240px; width: auto; margin: 0; font-size: 13px; line-height: 1.7; }
.generation-actions .progress-wrap.visible { order: 4; width: 100%; }
.generation-textarea { min-height: 327px; height: 327px; }
.recent-task-section { margin-top: 29px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 14px; font-weight: 550; }
.section-head a { margin-left: auto; font-size: 11px; }
.data-table th { font-weight: 450; font-size: 11px; padding: 12px 18px; }
.data-table td { padding: 17px 18px; font-size: 12px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcff; }
.table-scroll { border-radius: 10px; }
.task-table td:first-child { color: #526a8c; font-weight: 500; }
.task-table td:nth-child(2), .task-table td:nth-child(5), .task-table td:nth-child(6) { font-size: 11px; color: #8a99af; }
.task-table .mini-progress { width: 100px; }
.status { font-size: 11px; font-weight: 400; }
.info-note { font-size: 10px; color: #8f9db2; margin-top: 12px; }
.page-heading h1 { font-size: 28px; letter-spacing: -.5px; }

.eyebrow { color: #92a2bb; font-size: 10px; letter-spacing: 2px; }
.records-page .toolbar { padding: 23px 25px; }
.history-surface-flush { padding: 0; }
.history-surface .toolbar h2 { font-size: 15px; font-weight: 550; }
.site-footer { display: flex; justify-content: space-between; width: min(1340px, 100%); padding: 20px 30px 28px; margin: auto auto 0; color: #91a0b6; font-size: 10px; }
.account-layout { grid-template-columns: minmax(0, 1fr); }
.account-layout > div:empty { display: none; }
.account-panel { max-width: 780px; padding: 32px; }
.field label { font-weight: 500; font-size: 13px; }
.field input { border-color: #dfe7f3; border-radius: 7px; min-height: 43px; }
.auth-wrap { background: radial-gradient(ellipse at 20% 45%, #eef5ff, #f7faff44 45%, transparent 65%), #fff; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 90px; padding: 44px max(40px, calc((100vw - 1150px) / 2)) 60px; align-items: center; }
.auth-intro { justify-self: start; padding: 0; }
.auth-intro h1 { color: #3d5376; font-size: 39px; line-height: 1.7; letter-spacing: -.8px; margin: 16px 0 15px; font-weight: 650; }
.auth-intro > p { color: #8399b9; line-height: 2; font-size: 13px; }
.auth-panel { padding: 32px 35px; width: 390px; max-width: 100%; justify-self: end; box-shadow: 0 12px 48px #3267b708; border-radius: 16px; border-color: #e7edf8; }
.auth-header h1 { color: #415879; font-size: 25px; font-weight: 600; }
.auth-header p { font-size: 12px; margin-top: 8px; color: #8b9db8; }
.auth-header { margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 25px; }
.auth-tabs button { background: none; border: 0; padding: 0 0 12px; font-size: 12px; color: #8596b0; }
.auth-tabs .active { color: var(--brand); border-bottom: 2px solid var(--brand); }
.auth-panel .field label { font-size: 12px; color: #647b9e; }
.auth-panel input { font-size: 12px; }
.auth-panel .field-hint { font-size: 10px; }
.auth-switch { font-size: 11px; }
.auth-panel .full-button { min-height: 43px; }
.product-art { position: relative; width: 410px; max-width: 100%; height: 276px; margin: 30px 0 0; }
.art-orbit { position: absolute; border: 1px dashed #d8e7fa; border-radius: 50%; width: 365px; height: 206px; top: 26px; transform: rotate(-18deg); }
.paper { position: absolute; width: 180px; height: 224px; padding: 24px; background: white; border: 1px solid #e0eafb; border-radius: 14px; transform: rotate(-11deg); top: 12px; left: 20px; box-shadow: 0 15px 40px #3474ff08; }
.paper small { font-size: 10px; color: #a0b4d2; }
.paper strong { display: block; font-size: 26px; margin: 23px 0 20px; color: #799cca; font-weight: 550; }
.paper i { height: 4px; background: #edf2fa; border-radius: 3px; display: block; margin-bottom: 10px; }
.paper i:nth-last-of-type(2) { width: 80%; }.paper i:last-of-type { width: 56%; }
.paper.front { transform: rotate(9deg); left: 178px; top: 33px; background: linear-gradient(130deg,#fff,#f8fbff); border-color: #d6e5ff; }
.paper.front strong { color: #3474ff; }.paper.front i { background: #e3edff; }.paper.front > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eef5ff; color: #74a4ed; position: absolute; right: 17px; bottom: 16px; }
.login-features { display: flex; gap: 26px; font-size: 10px; color: #8da3c1; margin-top: 23px; }
.login-features .ui-icon { width: 13px; height: 13px; margin-right: 5px; }
.help-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.help-card { padding: 28px; }.help-card h2 { font-size: 17px; font-weight: 550; }.help-card p { font-size: 13px; line-height: 1.9; color: var(--muted); }.help-card .mode-symbol { width: 38px; height: 38px; background: #edf4ff; color: var(--brand); border-radius: 10px; }
.help-wide { margin-top: 25px; }.help-wide h2:not(:first-child) { margin-top: 26px; }.usage-callout { background: #f1f6ff; color: #657fa7; border-color: #dce8fb; line-height: 1.9; }
.modal-backdrop { background: #243e6430; backdrop-filter: blur(3px); }
.modal { border-radius: 15px; box-shadow: 0 20px 70px #2d558d22; }
.modal-head { padding: 22px 25px; }.modal-head h2 { font-weight: 550; font-size: 18px; }.modal-head small { font-weight: 400; font-size: 12px; }
.modal-body { padding: 24px; }.review-summary { font-size: 12px; }.comparison-pane h3 { margin: 0; font-size: 15px; font-weight: 550; }.comparison-pane .muted { font-size: 11px; }
.comparison-text { border-radius: 9px; padding: 20px; line-height: 2.1; }.comparison-text mark { background: #fff1df; color: #947249; }.comparison-pane:last-child mark { background: #e8f1ff; color: #517bbd; }
.review-pagination { font-size: 12px; }
@media (max-width: 1100px) {
 .topbar { padding: 0 25px; gap: 23px; }.topnav { gap: 17px; }.brand { min-width: 185px; font-size: 16px; }.topnav a { font-size: 12px; }
 .tool-choices .mode-button { padding: 15px 18px; gap: 13px; }.mode-copy small { font-size: 10px; }
 .auth-wrap { gap: 45px; padding: 40px; }.auth-intro h1 { font-size: 33px; }.product-art { transform: scale(.88); transform-origin: left center; width: 360px; }.auth-panel { padding: 29px; }
 .task-table th:nth-child(5), .task-table td:nth-child(5), .task-table th:nth-child(6), .task-table td:nth-child(6) { display: none; }
}
@media (max-width: 800px) {
 .topbar { gap: 15px; }.topnav { gap: 12px; }.brand { min-width: 165px; }.brand small { display: none; }.user-trigger > span:not(.avatar) { display: none; }
 .workspace-layout { padding-left: 22px; padding-right: 22px; }.mode-copy strong { font-size: 12px; }.tool-choices { gap: 12px; }.mode-copy small { font-size: 9px; }
 .editor-options { gap: 10px; }.processing-plan-control { gap: 6px; }.processing-plan-select { min-width: 96px; }.editor-footer, .generation-actions, .batch-actions { padding: 16px 20px; }
 .auth-wrap { gap: 25px; padding: 35px 28px; }.auth-intro h1 { font-size: 28px; }.product-art { transform: scale(.72); width: 280px; margin-bottom: -50px; }.login-features { gap: 12px; }.auth-panel { padding: 25px; }
}
@media (max-width: 680px) {
 .topbar { height: 64px; flex-basis: 64px; padding: 0 17px; gap: 10px; flex-wrap: nowrap; }.brand { min-width: 0; font-size: 16px; gap: 8px; }.brand-mark { width: 30px; height: 30px; }.topbar-actions { margin-left: auto; }.avatar { width: 29px; height: 29px; }.topbar-actions .button { font-size: 11px; padding: 0 8px; }
 .mobile-menu-button { display: grid; place-items: center; border: 0; background: none; padding: 5px; color: #6c84aa; margin-left: auto; }.mobile-menu-button + .topnav + .topbar-actions { margin-left: 0; }
 .topnav { display: none; }.topnav.is-open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 64px; left: 0; right: 0; width: 100%; height: auto; gap: 3px; padding: 12px 17px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 12px 20px #3767ad08; }.topnav.is-open a { padding: 11px 14px; border-radius: 7px; }.topnav a.active { background: #f1f6ff; }.topnav a.active::after { display: none; }
 .workspace-layout { padding: 22px 16px; display: block; }.tool-workspace { padding-top: 0; padding-bottom: 86px; }.workspace-hero { padding: 24px 0 23px; text-align: left; }.workspace-hero h1 { font-size: 25px; margin: 10px 0 8px; }.workspace-hero p { font-size: 10px; letter-spacing: 0; }.hero-tag { font-size: 9px; }
 .tool-choices { gap: 8px; margin-bottom: 18px; }.tool-choices .mode-button { min-height: 85px; flex-direction: column; justify-content: center; padding: 12px 4px; gap: 7px; text-align: center; border-radius: 8px; }.tool-choices .mode-symbol { width: 28px; height: 28px; flex-basis: 28px; border-radius: 7px; }.mode-symbol .ui-icon { width: 17px; height: 17px; }.mode-copy strong { font-size: 11px; }.mode-copy small, .mode-button.active::after { display: none; }
 .workspace-top { min-height: 49px; padding: 0 17px; }.workspace-top h2 { font-size: 12px; gap: 7px; }.workspace-top > span { display: none; }
 .mobile-panes { display: flex; background: #f1f5fd; border-radius: 6px; margin: 14px 16px 0; padding: 3px; gap: 3px; }.mobile-panes button { flex: 1; background: none; border: 0; border-radius: 4px; padding: 7px 0; font-size: 11px; color: #7c92b3; }.mobile-panes .active { color: #5687d8; background: #fff; box-shadow: 0 1px 3px #2861ae07; }
 .editor-grid, .generation-grid { display: block; min-height: 0; }.mobile-input .editor-pane:nth-child(2), .mobile-result .editor-pane:first-child { display: none; }.editor-pane + .editor-pane { border: 0; }.pane-head { padding: 13px 17px 0; min-height: 42px; font-size: 11px; }.pane-head small { font-size: 10px; }.pane-tools { gap: 12px; }
 .editor-textarea, .result-area { min-height: 275px; height: 275px; padding: 17px; font-size: 13px; }.pane-bottom { padding: 7px 17px 17px; font-size: 9px; }.result-placeholder { min-height: 235px; }.result-placeholder strong { font-size: 13px; }.result-placeholder > span:last-child { font-size: 10px; }
 .editor-footer, .batch-actions, .generation-actions { padding: 17px; display: block; }.editor-options { display: flex; justify-content: space-between; gap: 11px; }.processing-plan-control { display: grid; flex: 1; gap: 7px; font-size: 10px; }.processing-plan-select { width: 100%; min-width: 0; font-size: 11px; }.editor-options > .text-button { align-self: flex-end; font-size: 10px; height: 35px; padding: 0; }
 .tool-workspace .editor-actions { position: fixed; bottom: 0; left: 0; right: 0; z-index: 24; display: flex; gap: 10px; padding: 11px 16px max(11px,env(safe-area-inset-bottom)); background: #fffffffa; border-top: 1px solid #e4ecf9; box-shadow: 0 -4px 15px #3974cc05; }.tool-workspace .editor-actions .button { min-height: 42px; font-size: 12px; }.tool-workspace .editor-actions .button-primary, .tool-workspace .editor-actions .button-danger { flex: 1; min-width: 0; }
 .under-editor { font-size: 9px; }.under-editor > span:last-child { display: none; }.editor-surface > .progress-wrap { margin: 0 17px 16px; min-width: 0; }
 .upload-surface .dropzone { margin: 17px; padding: 20px 15px; }.upload-surface .file-list { margin: 0 17px 17px; }.dropzone p { font-size: 10px; }.dropzone strong { font-size: 13px; }.generation-textarea { min-height: 225px; height: 225px; padding: 17px; font-size: 13px; }.generation-actions .counter { display: block; margin: 0; }.generation-actions .progress-wrap.visible { margin-top: 14px; }
 .section-head { flex-wrap: wrap; gap: 6px; }.section-head h2 { font-size: 13px; }.section-head a { font-size: 10px; }.recent-task-section { margin-top: 26px; }
 .task-table { min-width: 0; }.task-table th, .task-table td { padding: 14px 12px; }.task-table th:nth-child(2), .task-table td:nth-child(2), .task-table th:nth-child(3), .task-table td:nth-child(3), .task-table th:nth-child(7), .task-table td:nth-child(7) { display: none; }.task-table td:first-child { max-width: 110px; overflow-wrap: anywhere; white-space: normal; font-size: 10px; }.task-table .inline-actions { flex-wrap: wrap; gap: 8px; }.task-table .text-button { font-size: 10px; white-space: nowrap; }.task-table .status { font-size: 10px; white-space: nowrap; }.task-table td:last-child { white-space: normal; }.data-table td { font-size: 11px; }.records-page .toolbar { padding: 18px 16px; }.toolbar-controls { gap: 8px; flex-wrap: wrap; }.toolbar-controls input { max-width: 100%; }.history-pagination { flex-wrap: wrap; gap: 15px; padding: 16px; }
 .page-heading { gap: 15px; }.page-heading h1 { font-size: 25px; }.page-heading > .button { font-size: 11px; }.site-footer { padding: 20px 17px 80px; font-size: 9px; }
 .auth-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 38px 22px 60px; background: radial-gradient(ellipse at 25% 40%,#eff6ff,transparent 80%),#fff; }.auth-intro { display: none; }.auth-panel { padding: 29px 24px; margin-top: 10px; }.auth-panel input { min-height: 44px; }.auth-panel .field label { font-size: 12px; }
 .help-grid { grid-template-columns: 1fr; gap: 15px; }.help-card { padding: 24px; }.help-wide { margin-top: 20px; }.account-panel { padding: 24px; }.side-panel { margin-bottom: 20px; }
 .modal { max-height: calc(100dvh - 28px); }.modal-head { padding: 18px; }.modal-head h2 { font-size: 15px; overflow-wrap: anywhere; }.modal-head small { font-size: 10px; display: block; }.modal-body { padding: 18px; }.comparison-grid { grid-template-columns: 1fr; }.comparison-text { min-height: 0; max-height: 45vh; padding: 16px; }.modal-foot { flex-wrap: wrap; }.review-pagination { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 680px) { .toast-region { bottom: 82px; right: 16px; width: calc(100vw - 32px); pointer-events: none; } .toast { font-size: 12px; } .batch-actions .processing-plan-control { flex: 1; justify-content: start; } }

.status-processing::before, .status-running::before { background: var(--brand); }
@media (max-width: 680px) {
 .records-page .toolbar { flex-direction: column; align-items: stretch; gap: 16px; }
 .records-page .toolbar > div:first-child { display: flex; align-items: baseline; gap: 12px; }
 .records-page .toolbar h2 { margin: 0; white-space: nowrap; }
 .records-page .toolbar-controls { display: flex; width: 100%; justify-content: flex-start; }
 .records-page .toolbar-controls input { width: 100%; }
}
/* Quota account, redemption and administrative controls. */
.quota-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}.quota-stat>strong{overflow-wrap:anywhere}.quota-admin-grid input:not([type]),.quota-adjust-modal input:not([type]){height:44px;padding:10px 12px}.quota-code-input{height:52px!important}
@media(max-width:650px){.quota-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
.quota-layout .content-column{min-width:0}.quota-hero{display:flex;align-items:center;justify-content:space-between;gap:28px;padding:32px 36px;background:radial-gradient(ellipse at 98% 10%,#dce8ff 0,transparent 55%),linear-gradient(120deg,#fff,#f1f6ff);border-color:#dce6fd;position:relative;overflow:hidden}.quota-eyebrow,.quota-step-label{display:block;color:#6683b4;font-size:11px;letter-spacing:1.5px;font-weight:600;margin-bottom:14px}.quota-hero h2{font-size:14px;color:#627391;font-weight:500;margin:0 0 12px}.quota-balance{font-size:44px;line-height:1.2;font-weight:700;letter-spacing:-1.6px;color:#173264;font-variant-numeric:tabular-nums}.quota-balance>span{font-size:14px;font-weight:500;color:#6b7e9f;margin-left:12px;letter-spacing:0}.quota-hero p{color:#8090aa;font-size:13px;margin:12px 0 0}.quota-hero-actions{display:flex;align-items:flex-end;flex-direction:column;gap:24px}.quota-account{display:inline-flex;gap:8px;align-items:center;color:#58729b;font-size:13px}.quota-account .ui-icon{color:#3974ee}.quota-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:22px 0}.quota-stat{padding:22px 26px}.quota-stat>span{color:#8090aa;font-size:13px}.quota-stat>strong{display:block;margin-top:12px;font-size:23px;font-variant-numeric:tabular-nums;color:#203e6b}.quota-stat small,.quota-adjust-balance small{font-size:12px;color:#8392a9;font-weight:400;margin-left:8px}.quota-recharge-grid,.quota-admin-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:22px;margin-top:24px}.quota-redeem-panel,.quota-guide{padding:30px 32px;min-width:0}.quota-redeem-panel h2,.quota-guide h2{font-size:19px;margin:0 0 12px;color:#203b61}.quota-redeem-panel>p{font-size:13px;color:#8491a7;line-height:1.8;margin:0 0 28px}.quota-code-input{font-family:ui-monospace,SFMono-Regular,Consolas,monospace!important;font-size:13px!important;letter-spacing:.4px;text-transform:uppercase;min-height:52px;background:#fbfcff}.quota-guide ul{padding:0;list-style:none;margin:26px 0;display:grid;gap:22px}.quota-guide li{display:flex;flex-direction:column;gap:7px;padding-left:19px;border-left:2px solid #dce7ff}.quota-guide li strong{font-size:14px;color:#355079;font-weight:600}.quota-guide li span{font-size:13px;color:#8692a6;line-height:1.8}.quota-success{display:flex;gap:12px;background:#edf8f4;border:1px solid #d3ece1;border-radius:12px;padding:18px;margin-top:22px;color:#277c60}.quota-success strong{font-size:14px}.quota-success p{font-size:13px;margin:7px 0}.quota-success>.ui-icon{flex-shrink:0;width:20px;height:20px}.quota-success .text-button{color:#277c60;padding-left:0}.quota-warning{border:1px solid #f0dfb6;background:#fffbf0;padding:14px 18px;border-radius:10px;font-size:13px;line-height:1.8;color:#957126;margin:18px 0}.quota-explainer{padding:23px 4px;line-height:1.85;font-size:12px;color:#8a97aa}.quota-explainer strong{font-size:13px;color:#687d9e;font-weight:500}.quota-explainer p{margin:5px 0}.quota-records{overflow:hidden;margin-top:22px}.quota-records .toolbar{padding:22px 26px}.quota-records .toolbar h2{font-size:17px;margin:0 0 8px}.quota-records .toolbar .muted{font-size:12px}.quota-table{min-width:750px}.quota-table th{font-size:12px;font-weight:500}.quota-table td{font-size:13px;vertical-align:middle;font-variant-numeric:tabular-nums}.quota-table td>strong{display:block;font-size:13px;font-weight:500;color:#334f75}.quota-table td small{display:block;font-size:11px;color:#8e9ab0;line-height:1.6;margin-top:5px;max-width:245px;overflow-wrap:anywhere}.quota-table .quota-positive{color:#278360}.quota-tabs{display:flex;padding:3px;border-radius:9px;background:#f0f4fa;gap:3px}.quota-tabs button{border:0;background:transparent;border-radius:7px;padding:7px 13px;font:inherit;font-size:12px;color:#7789a6;cursor:pointer}.quota-tabs button.active{background:white;box-shadow:0 1px 5px #19346c0d;color:#3672ed}.quota-fieldset{padding:0;border:0;margin:0;min-width:0}.quota-generated{display:block;width:calc(100% - 52px);margin:0 26px 26px;resize:vertical;border:1px solid #e3eafa;border-radius:10px;background:#f8faff;padding:16px;line-height:2;font-size:13px;font-family:ui-monospace,Consolas,monospace;color:#3f5d8c}.quota-code-cell{display:block;max-width:235px;overflow-wrap:anywhere;white-space:normal;font-size:11px;line-height:1.7;color:#34588b}.quota-adjust-balance{padding:20px 24px;background:#f0f5ff;border-radius:12px;margin-bottom:22px;display:flex;align-items:center;justify-content:space-between;gap:16px;color:#547198;font-size:13px}.quota-adjust-balance strong{font-size:28px;color:#224571;line-height:1.4;font-variant-numeric:tabular-nums}.quota-error-pad{padding:0 26px}.quota-adjust-modal .modal-body{max-height:75vh;overflow:auto}.quota-wait-message{display:block;color:#a08031;font-size:12px;margin-top:4px}.quota-records .history-pagination{padding:18px 26px}.quota-adjust-modal h3{font-size:15px;color:#4b6286;margin:28px 0 16px}
@media(max-width:1100px){.quota-recharge-grid,.quota-admin-grid{grid-template-columns:1fr}.quota-guide ul{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.quota-hero{padding:28px}.quota-records .toolbar{flex-wrap:wrap;gap:15px}.quota-records .toolbar-controls{flex-wrap:wrap}.quota-hero-actions{gap:18px}.quota-balance{font-size:36px}}
@media(max-width:650px){.quota-hero{padding:24px;align-items:flex-start;flex-direction:column;gap:20px}.quota-hero-actions{width:100%;flex-direction:row;align-items:center;justify-content:space-between;gap:12px}.quota-balance{font-size:34px;overflow-wrap:anywhere;letter-spacing:-1px}.quota-stats{gap:8px;margin:16px 0}.quota-stat{padding:16px 12px}.quota-stat>span{font-size:11px}.quota-stat>strong{font-size:18px}.quota-stat small{display:block;margin:6px 0 0;font-size:10px}.quota-redeem-panel,.quota-guide{padding:24px 20px}.quota-guide ul{grid-template-columns:1fr}.quota-recharge-grid,.quota-admin-grid{gap:16px;margin-top:16px}.quota-records .toolbar{padding:20px 16px}.quota-records .inline-actions{flex-wrap:wrap}.quota-tabs button{padding:7px 10px}.quota-records .history-pagination{padding:16px;flex-wrap:wrap;gap:14px}.quota-adjust-balance{padding:18px;flex-wrap:wrap}.quota-adjust-balance strong{font-size:24px}.quota-generated{width:calc(100% - 32px);margin:0 16px 20px;padding:12px;font-size:11px}.quota-records .toolbar-controls input{width:100%;min-width:0}.quota-code-input{font-size:11px!important;letter-spacing:0}.quota-warning{padding:12px 14px}.quota-eyebrow{font-size:10px;letter-spacing:1px}}

/* V4 — approved light workspace, compact type and content positioning. Presentation only. */
:root {
    --ink: #17243a; --muted: #58677d; --soft: #f4f6fa; --paper: #fff;
    --line: #dce3ed; --line-strong: #cbd5e3; --brand: #2563eb;
    --brand-dark: #1d4ed8; --brand-soft: #edf3ff; --blue: #2563eb;
    --blue-soft: #edf3ff; --red: #b43d48; --red-soft: #fff0f1;
    --amber: #936015; --amber-soft: #fff3dd; --radius: 12px;
    --shadow: 0 8px 30px #192b450a;
}
body { font-size: 14px; line-height: 1.65; }
[hidden] { display: none !important; }
button, input, select, textarea { color: inherit; }
button, input, select, textarea, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #8bb3ff; outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: #738096; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); }
.button { min-height: 40px; padding: 9px 15px; border-radius: 9px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.button-small { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.button-ghost { color: #374962; background: #fff; border-color: var(--line); }
.button-secondary { border-color: #d7e3fa; }
.button-primary { box-shadow: 0 4px 10px #2563eb17; }
.text-button { font-size: 14px; line-height: 1.6; padding: 4px; }
.topbar { min-height: 68px; height: auto; flex-basis: auto; padding: 0 28px; gap: 28px; background: #fff; }
.brand { font-size: 18px; font-weight: 700; min-width: 0; gap: 11px; letter-spacing: -.4px; }
.brand-mark { width: 39px; height: 39px; }
.brand small { display: none; }
.topnav { gap: 4px; align-self: stretch; height: auto; }
.topnav a { min-height: 68px; padding: 18px 11px; font-size: 14px; color: #536078; }
.topnav a.active { color: var(--brand); font-weight: 600; }
.topnav a.active::after { left: 8px; right: 8px; border-radius: 0; }
.topbar-actions { min-width: 0; }
.user-trigger { font-size: 14px; max-width: 210px; }
.user-trigger > span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; flex-shrink: 0; color: #405578; background: #e8eef8; font-size: 14px; font-weight: 600; }
.user-dropdown { width: 195px; border-radius: 12px; box-shadow: 0 12px 35px #1c35521c; }
.user-dropdown button { min-height: 42px; padding: 9px 12px; }
.workspace-layout, .admin-layout { display: grid; width: 100%; max-width: none; margin: 0; padding: 0; grid-template-columns: 224px minmax(0,1fr); gap: 0; flex: 1; }
.workspace-layout > .content-column, .admin-layout > .content-column { padding: 28px 32px 36px; min-width: 0; }
.workspace-layout > .side-panel, .admin-nav { position: static; align-self: stretch; margin: 0; padding: 28px 16px; background: #fff; border-right: 1px solid var(--line); }
.admin-nav { display: flex; flex-direction: column; gap: 6px; }
.side-heading, .admin-nav-label { font-size: 12px; font-weight: 600; color: #637187; letter-spacing: .6px; margin: 26px 12px 10px; }
.side-heading:first-child, .admin-nav-label:first-child { margin-top: 4px; }
.tool-choices { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; }
.tool-choices .mode-button, .account-nav button, .admin-nav button { display: flex; align-items: center; gap: 10px; min-height: 42px; width: 100%; padding: 11px 13px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: #55647b; font-size: 14px; text-align: left; }
.tool-choices .mode-button:hover, .account-nav button:hover, .admin-nav button:hover { background: #f4f6fa; transform: none; }
.tool-choices .mode-button.active, .account-nav button.active, .admin-nav button.active { color: var(--brand); background: var(--brand-soft); border: 0; box-shadow: none; font-weight: 600; }
.tool-choices .mode-button.active::after { content: ''; border: 0; background: var(--brand); width: 5px; height: 5px; flex: 0 0 5px; margin-left: auto; }
.tool-choices .mode-symbol, .tool-choices .mode-button.active .mode-symbol { width: 20px; height: 20px; flex: 0 0 20px; background: none; color: inherit; border-radius: 0; }
.tool-choices .mode-copy strong { font-size: 14px; font-weight: inherit; color: inherit; }
.account-nav { display: grid; gap: 6px; overflow: visible; }
.side-credit { margin-top: 30px; padding: 17px; background: #f5f8fe; border: 1px solid #e0e8f6; border-radius: 12px; }
.side-credit > span { font-size: 13px; color: var(--muted); }
.side-credit strong { display: block; font-size: 23px; line-height: 1.4; font-weight: 650; font-variant-numeric: tabular-nums; margin: 5px 0 15px; overflow-wrap: anywhere; }
.side-credit .button { padding-left: 8px; padding-right: 8px; font-size: 14px; }
.page-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 26px; line-height: 1.35; font-weight: 750; letter-spacing: -.7px; }

.page-heading > .button { flex: 0 0 auto; }
.eyebrow { color: var(--muted); font-size: 13px; }
.surface { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 8px #192b4503; background: #fff; }
.site-footer { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 20px 32px; background: #fbfcfe; color: #637187; font-size: 13px; border-top: 1px solid var(--line); }
.my-rewrites-layout { grid-template-columns: minmax(0,1fr); }

/* Workbench — a clear configuration bar, generous editors and one primary action. */
.editor-config { display: flex; align-items: center; padding: 14px 20px; min-height: 68px; border-bottom: 1px solid var(--line); background: #fff; }
.editor-options { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; min-width: 0; }
.processing-plan-control { display: inline-flex; align-items: center; gap: 10px; color: #536078; font-size: 14px; flex: 0 1 auto; }
.processing-plan-select { width: auto; min-width: 124px; height: 40px; font-size: 14px; padding: 8px 12px; border-radius: 9px; color: var(--ink); }
.editor-options > .text-button { font-size: 14px; min-height: 42px; }
.workspace-top { padding: 20px 24px; min-height: 72px; }
.workspace-top h2 { font-size: 18px; font-weight: 650; }
.workspace-top > span, .workspace-top a { font-size: 13px; color: var(--muted); }
.editor-grid, .generation-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); min-height: 410px; }
.pane-head { padding: 19px 24px 7px; min-height: 58px; font-size: 16px; font-weight: 600; gap: 12px; flex-wrap: wrap; color: var(--ink); }
.pane-head small { font-size: 13px; color: #637187; }
.pane-tools { gap: 12px; flex-wrap: wrap; }
.pane-tools .text-button { font-size: 14px; }
.editor-textarea, .result-area, .generation-textarea { font-size: 16px; line-height: 1.95; padding: 18px 24px; min-height: 330px; height: 360px; color: #304059; }
.editor-textarea { resize: vertical; }
.result-area { background: #fafcff; overflow-wrap: anywhere; }
.editor-pane + .editor-pane { background: #fafcff; border-left: 1px solid var(--line); }
.generation-pane + .generation-pane { border-left: 1px solid var(--line); }
.editor-textarea:focus-visible, .generation-textarea:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #93b4f2; }
.result-placeholder { min-height: 284px; gap: 12px; padding: 28px; color: var(--muted); display: flex; flex-direction: column; justify-content: center; align-items: center; white-space: normal; }
.result-placeholder strong { font-size: 16px; color: var(--ink); font-weight: 600; }
.result-placeholder > span:last-child { max-width: 320px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.editor-textarea::placeholder, .generation-textarea::placeholder { color: #738096; }
.empty-symbol { width: 62px; height: 70px; display: grid; place-items: center; background: #fff; border: 1px solid #dce5f3; border-radius: 12px; box-shadow: 7px 7px 0 #eef3fb; color: #6285b9; margin-bottom: 6px; }
.empty-symbol .ui-icon { width: 28px; height: 28px; }
.pane-bottom { padding: 13px 24px; font-size: 13px; color: #637187; border-top: 1px solid #eef1f6; }
.editor-footer, .generation-actions, .batch-actions { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 19px 24px; gap: 18px; border-top: 1px solid var(--line); background: #fff; margin: 0; }
.editor-credit { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.editor-credit strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.editor-actions { display: flex; gap: 10px; margin-left: auto; }
.editor-actions .button { min-height: 48px; }
.editor-actions .button-primary { padding-left: 24px; padding-right: 24px; }
.counter { font-size: 13px; color: var(--muted); }
.under-editor, .info-note { font-size: 13px; color: var(--muted); line-height: 1.75; margin-top: 13px; }
.progress-wrap { min-width: 0; }
.editor-surface > .progress-wrap { margin: 0 24px 20px; }
.generation-actions .progress-wrap.visible { flex-basis: 100%; }
.progress-value { font-size: 13px; }
.upload-surface { padding: 0; overflow: hidden; }
.upload-surface .dropzone { margin: 24px; padding: 32px 26px; min-height: 240px; background: #fafcff; border: 1.5px dashed #b9cbed; border-radius: 12px; }
.dropzone strong { font-size: 18px; font-weight: 650; }
.dropzone p { margin: 12px auto 19px; max-width: 660px; font-size: 14px; line-height: 1.8; }
.dropzone .button { min-height: 44px; font-size: 14px; }
.drop-symbol { width: 45px; height: 45px; margin-bottom: 15px; font-size: 23px; border-radius: 12px; }
.upload-surface .file-list { margin: 0 24px 24px; border-radius: 12px; }
.upload-summary { margin: 0; padding: 14px 20px; font-size: 13px; border-top: 1px solid var(--line); }
.file-list-scroll { max-height: 330px; overflow: auto; }
.file-list .data-table { min-width: 620px; }
.section-head { margin: 30px 0 16px; }
.section-head h2 { font-size: 18px; font-weight: 650; }
.section-head a, .section-head small { font-size: 14px; }

/* Records and statuses retain every column, filter and operation. */
.data-table { width: 100%; min-width: 660px; font-size: 14px; }
.data-table th { padding: 15px 20px; font-size: 13px; font-weight: 500; background: #fafbfd; color: #5f6f86; }
.data-table td { padding: 15px 18px; font-size: 14px; color: #33465f; }
.data-table td strong { color: var(--ink); font-weight: 600; }
.data-table td small { display: block; font-size: 13px; color: #637187; line-height: 1.7; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table td .text-button { font-size: 14px; }
.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.task-table { min-width: 1120px; }
.task-table th:nth-child(n), .task-table td:nth-child(n) { display: table-cell; }
.task-table td:first-child { max-width: 300px; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.task-table .inline-actions { flex-wrap: nowrap; gap: 10px; }
.task-table .progress-cell { min-width: 125px; }
.mini-progress { width: 108px; height: 24px; border-radius: 6px; background: #edf2fa; }
.mini-progress > progress::-webkit-progress-value { background: #bed3ff; }
.mini-progress > progress::-moz-progress-bar { background: #bed3ff; }
.mini-progress.done > progress::-webkit-progress-value { background: #cee9dc; }
.mini-progress.done > progress::-moz-progress-bar { background: #cee9dc; }
.mini-progress em { font-size: 12px; color: #244366; }
.status { font-size: 13px; padding: 4px 9px; line-height: 1.5; border-radius: 6px; background: #f0f3f7; color: #546277; white-space: nowrap; }
.status-completed { color: #12714f; background: #e8f6ef; }
.status-processing, .status-running { color: #245dc8; background: #edf3ff; }
.status-queued { color: #936015; background: #fff3dd; }
.status-error, .status-completed_error { color: #b43d48; background: #fff0f1; }
.status::before { background: currentColor; }
.task-table .status, .task-table .text-button { font-size: 13px; }
.toolbar { align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar h2 { font-size: 18px; font-weight: 650; }
.toolbar .muted { font-size: 13px; }
.toolbar-controls { gap: 12px; flex-wrap: wrap; min-width: 0; }
.toolbar input, .toolbar select { min-height: 44px; padding: 10px 12px; border-radius: 9px; font-size: 14px; max-width: 100%; }
.toolbar input { width: 260px; }
.history-pagination { gap: 20px; padding: 20px 0 0; font-size: 13px; line-height: 1.6; }
.records-page .toolbar { padding: 24px; margin: 0; border-bottom: 1px solid var(--line); }
.records-page .history-pagination { padding: 20px 24px; border-top: 1px solid var(--line); }
.history-surface { padding: 0; }
.history-pagination-controls { flex-wrap: wrap; }
.inline-actions { flex-wrap: wrap; gap: 10px; }

/* Forms and account pages. */
.field { gap: 9px; margin-bottom: 22px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; color: #354760; }
.field input, .field textarea, .field select { font-size: 14px; font-weight: 400; min-height: 40px; padding: 9px 12px; border-radius: 9px; line-height: 1.6; }
.field-hint, .field .check-line { font-size: 13px; line-height: 1.75; color: var(--muted); }
.field .check-line input { min-height: 0; width: 17px; height: 17px; }
.form-error { font-size: 14px; overflow-wrap: anywhere; }
.settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; }
.form-actions { gap: 12px; padding-top: 12px; }
.account-panel { padding: 28px; }
.account-panel h2 { font-size: 18px; margin-bottom: 8px; }
.account-panel > p { margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.account-panel form, [data-form="admin-password"] { max-width: 760px; }
.account-layout { display: block; }
.quota-hero { padding: 32px; border-color: #cddcff; background: linear-gradient(110deg,#eef3ff,#f8faff); gap: 24px; }
.quota-eyebrow, .quota-step-label { font-size: 12px; letter-spacing: .7px; color: #50688d; }
.quota-hero h2 { font-size: 15px; color: #304a72; }
.quota-balance { font-size: 34px; line-height: 1.25; color: #203f70; }
.quota-balance > span, .quota-hero p, .quota-account { font-size: 14px; color: #5a6d88; }
.quota-stats { gap: 18px; margin: 24px 0; }
.quota-stat { padding: 22px 24px; }
.quota-stat > span { font-size: 14px; color: var(--muted); }
.quota-stat > strong { font-size: 23px; color: var(--ink); margin-top: 10px; }
.quota-stat small, .quota-adjust-balance small { font-size: 13px; color: var(--muted); }
.quota-redeem-panel, .quota-guide { padding: 28px; }
.quota-redeem-panel h2, .quota-guide h2 { font-size: 18px; color: var(--ink); }
.quota-redeem-panel > p { font-size: 14px; color: var(--muted); }
.quota-code-input { font-size: 14px !important; letter-spacing: .2px; }
.quota-guide li strong, .quota-success strong { font-size: 15px; color: #334c70; }
.quota-guide li span, .quota-success p { font-size: 14px; color: var(--muted); }
.quota-guide ul { grid-template-columns: 1fr; }
.quota-warning { color: #835b1b; font-size: 14px; }
.quota-explainer, .quota-explainer strong { color: var(--muted); font-size: 13px; }
.quota-records .toolbar h2 { font-size: 18px; }
.quota-records .toolbar .muted { font-size: 13px; }
.quota-table td, .quota-table td > strong { font-size: 14px; }
.quota-table th, .quota-table td small { font-size: 13px; color: #5e6f86; }
.quota-tabs button { min-height: 40px; font-size: 14px; padding: 8px 14px; color: #52647d; }
.quota-code-cell { font-size: 13px; max-width: 270px; color: #335983; }
.quota-generated { font-size: 14px; color: #304965; }
.quota-adjust-balance { font-size: 14px; color: #3e5b83; }
.quota-adjust-balance strong { font-size: 26px; }
.quota-adjust-modal h3 { font-size: 16px; color: var(--ink); }
.quota-wait-message { font-size: 13px; }

/* Administration: grouped navigation, service categories and step cards. */
.admin-surface { margin-top: 24px; padding: 26px; }
.admin-layout .page-heading + .admin-surface { margin-top: 0; }
.stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.stat { border-radius: 16px; padding: 24px; }
.stat-label { font-size: 14px; color: var(--muted); }
.stat-value { font-size: 28px; line-height: 1.35; margin-top: 13px; color: var(--ink); }
.stat:nth-child(3) { border-color: #c5d8ff; background: #edf3ff; }
.stat:nth-child(3) .stat-value { color: var(--brand); }
.worker-history > summary { font-size: 14px; }
.interface-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.interface-tab { border: 1px solid var(--line); border-radius: 13px; text-align: left; padding: 19px; background: #fff; display: grid; gap: 9px; color: var(--ink); }
.interface-tab strong { font-size: 15px; font-weight: 600; }
.interface-tab > span { font-size: 13px; color: var(--muted); }
.interface-tab.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #f7faff; }
.interface-tab.active strong { color: var(--brand-dark); }
.interface-panel { margin: 22px 0 0; }
.form-section-title { font-size: 18px; line-height: 1.4; color: var(--ink); margin: 0 0 4px; }
.interface-advanced { margin: 4px 0 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.interface-advanced > summary { color: #354e71; font-weight: 600; cursor: pointer; padding: 5px 0 18px; }
.interface-save-bar { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 20px 24px; margin-top: 20px; }
.interface-save-bar .muted { font-size: 13px; }
.settings-section-heading { color: var(--ink); font-size: 18px; padding: 24px 0 19px; margin: 10px 0 22px; border-top: 1px solid var(--line); }
.settings-section-heading:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.workflow-editor { gap: 20px; }
.flow-overview, .flow-generation { padding: 25px; }
.flow-overview h2, .flow-generation h2 { font-size: 18px; }
.flow-mode-select { display: none !important; }
.flow-mode-tabs { display: inline-flex; flex-wrap: wrap; background: #edf1f7; padding: 4px; gap: 4px; border-radius: 11px; margin: 18px 0 4px; }
.flow-mode-tabs button { border: 0; border-radius: 8px; background: transparent; color: #53657f; min-height: 43px; padding: 9px 19px; }
.flow-mode-tabs button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 4px #1a345c0d; }
.flow-mode-tabs button[draggable="true"] { cursor: grab; position: relative; }
.flow-mode-tabs button[draggable="true"]::before { content: '⋮⋮'; margin-right: 8px; color: #7b8ba3; letter-spacing: -3px; }
.flow-mode-tabs button.flow-dragging { opacity: .45; cursor: grabbing; }
.flow-mode-tabs button.flow-drop-before { box-shadow: inset 3px 0 0 var(--brand); }
.flow-mode-tabs button.flow-drop-after { box-shadow: inset -3px 0 0 var(--brand); }
.flow-preview-grid { margin-top: 18px; gap: 12px; }
.flow-preview-step { background: #f4f7fd; border-color: #e0e7f1; padding: 16px; font-size: 14px; }
.flow-preview-step > strong { font-size: 14px; }
.flow-source { max-width: 560px; }
.flow-variables { font-size: 13px; padding-top: 8px; }
.flow-step-card { border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: #fff; }
.flow-step-card:has([aria-expanded="true"]) { border-color: #b7cdfb; }
.flow-step-head { flex-wrap: nowrap; justify-content: flex-start; margin-bottom: 0; gap: 15px; }
.flow-step-head > div { flex: 1; justify-content: flex-start; gap: 10px; }
.flow-step-head h2 { font-size: 18px; }
.flow-number { width: 33px; height: 33px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); }
.flow-provider-name { color: #285bbd; background: #edf3ff; border-radius: 6px; padding: 3px 9px; font-size: 13px; }
.flow-state { font-size: 13px; }
.flow-step-summary { margin: 8px 0 0 43px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.flow-toggle { white-space: nowrap; font-size: 14px; color: #354760; }
.flow-toggle input { appearance: none; width: 36px; height: 22px; border-radius: 15px; border: 1px solid #c0ccdc; background: #d7dfeb; position: relative; margin: 0; cursor: pointer; }
.flow-toggle input::after { content: ''; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #22395b1a; }
.flow-toggle input:checked { background: var(--brand); border-color: var(--brand); }
.flow-toggle input:checked::after { left: 16px; }
.flow-step-card fieldset { padding-top: 24px; margin-top: 20px; border-top: 1px solid var(--line); }
.flow-step-card .settings-grid { margin-bottom: 0; }
.flow-service-settings { padding: 20px; border: 1px solid #e1e7f0; background: #f7f9fd; margin-bottom: 20px; }
.flow-service-settings h3 { font-size: 16px; margin-bottom: 18px; }
.flow-service-note { font-size: 14px; }
.flow-prompt-head { gap: 12px; }
.flow-save-bar { padding: 20px 24px; background: #fff; border-color: #cfdbee; bottom: 16px; box-shadow: 0 4px 20px #192b4512; }
.flow-save-bar > span { font-size: 14px; color: #4d5e78; flex: 1; }
.admin-task-meta, .saved-workflow { font-size: 13px; }
.task-submitter small, .task-count small { font-size: 13px; }

/* Login, registration, help and dialogs follow the same type scale. */
.auth-wrap { width: 100%; display: grid; grid-template-columns: minmax(0,480px) minmax(0,480px); align-items: stretch; align-content: center; justify-content: center; gap: 0; padding: 50px 30px; background: var(--soft); }
.auth-intro { display: flex; justify-self: stretch; flex-direction: column; padding: 40px; border: 1px solid #d6e3fb; border-right: 0; border-radius: 20px 0 0 20px; background: linear-gradient(145deg,#edf3ff,#e5efff); }
.auth-eyebrow { color: var(--brand); font-size: 13px; font-weight: 600; letter-spacing: 1px; }
.auth-intro h1, .auth-intro h1 span { font-size: 26px; line-height: 1.55; margin: 18px 0; color: var(--ink); letter-spacing: -.5px; }
.auth-intro > p { font-size: 14px; line-height: 1.9; color: #526885; }
.login-features { display: grid; gap: 22px; margin: 45px 0; font-size: 14px; color: #354d70; }
.login-features span { display: flex; gap: 12px; align-items: center; }
.auth-intro > small { font-size: 13px; color: #5c7291; margin-top: auto; padding-top: 30px; }
.auth-panel { width: 100%; max-width: none; margin: 0; padding: 38px; border: 1px solid var(--line); border-radius: 0 20px 20px 0; box-shadow: none; }
.auth-header h1 { font-size: 22px; font-weight: 700; color: var(--ink); }
.auth-header p { font-size: 14px; color: var(--muted); }
.auth-panel .field label { font-size: 14px; color: #354760; }
.auth-panel .field-hint { font-size: 13px; }
.auth-panel input { min-height: 46px; font-size: 14px; }
.auth-panel .full-button { min-height: 49px; }
.auth-switch { font-size: 14px; }
.captcha-line { align-items: center; }
.captcha-image, .captcha-placeholder, .captcha-visual { height: 44px; }
.captcha-placeholder { font-size: 12px; }
.help-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.help-card { padding: 27px; }
.help-card h2 { font-size: 18px; color: var(--ink); margin: 18px 0 12px; }
.help-card p, .help-card .text-button { font-size: 14px; color: var(--muted); line-height: 1.9; }
.help-card .text-button { color: var(--brand); }
.help-wide { margin-top: 24px; }
.help-wide h2:first-child { margin-top: 0; }
.usage-callout { padding: 16px 18px; font-size: 14px; background: #f4f7fd; color: #4b627d; border-color: #dde6f3; }
.modal-backdrop { background: #21314d66; padding: 24px; }
.modal { border-radius: 18px; box-shadow: 0 25px 100px #10214333; max-height: calc(100dvh - 48px); }
.modal-head { padding: 22px 26px; gap: 20px; flex-shrink: 0; }
.modal-head h2 { font-size: 18px; line-height: 1.4; }
.modal-head small, .modal-subtitle { font-size: 13px; }
.close-button { width: 40px; height: 40px; font-size: 24px; flex-shrink: 0; }
.modal-body { padding: 24px 26px; }
.modal-foot { padding: 18px 26px; }
.review-summary { font-size: 14px; color: var(--muted); line-height: 1.75; }
.comparison-pane h3 { font-size: 18px; margin: 0 0 9px; }
.comparison-pane > .muted { font-size: 13px; margin: 0 0 15px; }
.comparison-text { font-size: 16px; line-height: 1.95; padding: 22px; border-color: #dce5f2; background: #fcfdff; }
.comparison-text mark { background: #fff0db; color: #946126; }
.comparison-pane:last-child mark { background: #e6efff; color: #2156a4; }


.toast { padding: 15px 18px; font-size: 14px; border-radius: 10px; }

@media (max-width: 1200px) {
    .topbar { gap: 16px; padding: 0 22px; }
    .brand { font-size: 18px; }
    .topnav a { padding-left: 9px; padding-right: 9px; font-size: 14px; }
    .user-trigger > span:not(.avatar) { display: none; }
    .workspace-layout, .admin-layout { grid-template-columns: 198px minmax(0,1fr); }
    .workspace-layout > .content-column, .admin-layout > .content-column { padding: 28px; }
    .workspace-layout > .side-panel, .admin-nav { padding: 25px 12px; }
    .interface-tabs, .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .quota-recharge-grid, .quota-admin-grid { grid-template-columns: 1fr; }
    .help-grid { grid-template-columns: 1fr; }
    .help-card { padding: 24px; }
    .flow-preview-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 980px) {
    .topbar { flex-wrap: wrap; column-gap: 18px; }
    .topnav { display: flex; }
    .topnav a { font-size: 13px; padding: 18px 7px; }
    .brand { font-size: 16px; }
    .workspace-layout, .admin-layout { grid-template-columns: 178px minmax(0,1fr); }
    .workspace-layout > .content-column, .admin-layout > .content-column { padding: 26px 22px; }
    .tool-choices .mode-button, .account-nav button, .admin-nav button { padding: 11px 10px; gap: 8px; }
    .tool-choices .mode-copy strong, .account-nav button, .admin-nav button { font-size: 14px; }
    .pane-head { padding: 18px 18px 7px; }
    .editor-textarea, .generation-textarea, .result-area { padding: 18px; }
    .settings-grid { grid-template-columns: 1fr; }
    .flow-step-head { flex-wrap: wrap; }
    .auth-wrap { padding: 36px 26px; }
    .auth-intro, .auth-panel { padding: 28px; }
    .auth-intro h1 { font-size: 26px; }
}
@media (max-width: 760px) {
    .topbar { min-height: 70px; height: 70px; flex-basis: 70px; flex-wrap: nowrap; padding: 0 16px; gap: 10px; }
    .brand { font-size: 16px; flex: 0 1 auto; min-width: 0; }
    .brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .brand-mark { width: 34px; height: 34px; }
    .mobile-menu-button { display: grid; width: 38px; height: 40px; margin-left: auto; padding: 8px; color: #3e5779; background: none; border: 0; }
    .topnav { display: none; }
    .topnav.is-open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 70px; left: 0; right: 0; width: 100%; height: auto; background: #fff; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 4px; box-shadow: 0 12px 20px #3767ad12; }
    .topnav.is-open a { min-height: 46px; font-size: 14px; padding: 10px 14px; border-radius: 8px; }
    .topnav a.active { background: var(--brand-soft); }
    .topnav a.active::after { display: none; }
    .topbar-actions, .mobile-menu-button + .topnav + .topbar-actions { margin-left: 0; gap: 6px; }
    .topbar-actions .button { font-size: 13px; min-height: 38px; padding: 8px 10px; }
    .topbar:not(:has(.mobile-menu-button)) { height: auto; min-height: 70px; flex-wrap: wrap; padding: 12px 16px; justify-content: space-between; }
    .avatar { width: 34px; height: 34px; }
    .workspace-layout, .admin-layout { display: block; padding: 0; }
    .workspace-layout > .content-column, .admin-layout > .content-column { padding: 25px 18px 32px; }
    .workspace-layout > .side-panel, .admin-nav { position: static; padding: 18px 18px 0; margin: 0; background: var(--soft); border: 0; }
    .side-panel .side-heading, .side-credit { display: none; }
    .side-panel .account-nav, .admin-nav { display: flex; flex-wrap: wrap; gap: 8px; }
    .side-panel .account-nav { margin-top: 8px; }
    .side-panel .account-nav:last-of-type { margin-bottom: 0; }
    .tool-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
    .tool-choices .mode-button, .account-nav button, .admin-nav button { width: auto; min-height: 44px; padding: 10px 12px; border: 1px solid #dce3ed; border-radius: 10px; background: #fff; flex-direction: row; gap: 8px; }
    .tool-choices .mode-copy strong, .account-nav button, .admin-nav button { font-size: 14px; }
    .tool-choices .mode-button.active, .account-nav button.active, .admin-nav button.active { border: 1px solid #c7d8fc; }
    .tool-choices .mode-button.active::after { display: none; }
    .mode-symbol .ui-icon, .account-nav .ui-icon, .admin-nav .ui-icon { width: 17px; height: 17px; }
    .admin-nav-label { flex-basis: 100%; margin: 12px 2px 2px; font-size: 12px; }
    .admin-nav-label:first-child { margin-top: 0; }
    .page-heading { flex-wrap: wrap; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
    .page-heading h1 { font-size: 23px; letter-spacing: -.5px; }
    
    .page-heading > .button { font-size: 14px; }
    .editor-config { padding: 17px; }
    .editor-options { flex-wrap: wrap; gap: 13px; width: 100%; justify-content: flex-start; }
    .processing-plan-control { display: grid; gap: 7px; flex: 1; font-size: 13px; }
    .processing-plan-select { width: 100%; min-width: 0; font-size: 14px; }
    .editor-options > .text-button { min-height: 44px; font-size: 13px; align-self: flex-end; }
    .editor-grid, .generation-grid { display: block; min-height: 0; }
    .mobile-panes { display: flex; gap: 4px; padding: 4px; margin: 17px 17px 0; background: #edf1f7; border-radius: 9px; }
    .mobile-panes button { flex: 1; font-size: 14px; min-height: 42px; border: 0; background: none; border-radius: 6px; color: #53647d; }
    .mobile-panes button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px #223b630d; }
    .mobile-input .editor-pane:nth-child(2), .mobile-result .editor-pane:first-child { display: none; }
    .editor-pane + .editor-pane { border: 0; }
    .pane-head { font-size: 15px; padding: 17px 18px 8px; min-height: 52px; }
    .pane-head small { font-size: 13px; }
    .pane-tools { gap: 10px; }
    .pane-tools .text-button { font-size: 13px; }
    .editor-textarea, .result-area, .generation-textarea { font-size: 16px; height: 310px; min-height: 280px; padding: 17px 18px; }
    .generation-pane + .generation-pane { border-left: 0; border-top: 1px solid var(--line); }
    .pane-bottom { padding: 13px 18px; font-size: 13px; }
    .result-placeholder { min-height: 250px; padding: 20px; }
    .result-placeholder strong { font-size: 16px; }
    .result-placeholder > span:last-child { font-size: 14px; }
    .editor-footer, .batch-actions, .generation-actions { padding: 18px; gap: 16px; align-items: stretch; }
    .tool-workspace { padding-bottom: 78px; }
    .tool-workspace .editor-actions { position: fixed; left: 0; right: 0; bottom: 0; display: flex; z-index: 24; gap: 10px; margin: 0; padding: 12px 18px max(12px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -4px 15px #3974cc0a; }
    .tool-workspace .editor-actions .button { min-height: 46px; font-size: 14px; }
    .tool-workspace .editor-actions .button-primary, .tool-workspace .editor-actions .button-danger { flex: 1; }
    .editor-credit { font-size: 13px; }
    .under-editor, .info-note { font-size: 13px; }
    .under-editor > span:last-child { display: none; }
    .editor-surface > .progress-wrap { margin: 0 18px 18px; }
    .workspace-top { padding: 18px; }
    .workspace-top h2 { font-size: 18px; }
    .workspace-top > span { display: none; }
    .upload-surface .dropzone { margin: 18px; padding: 24px 18px; }
    .dropzone strong { font-size: 18px; }
    .dropzone p { font-size: 14px; }
    .upload-surface .file-list { margin: 0 18px 18px; }
    .batch-actions .processing-plan-control { flex: 1; }
    .counter { margin: 0; font-size: 13px; }
    .section-head { gap: 12px; flex-wrap: wrap; }
    .section-head h2 { font-size: 18px; }
    .section-head a { font-size: 13px; }
    .data-table th { padding: 14px 16px; }
    .data-table td { padding: 17px 16px; font-size: 14px; }
    .task-table th:nth-child(n), .task-table td:nth-child(n) { display: table-cell; }
    .task-table td:first-child { max-width: 260px; font-size: 14px; }
    .task-table .text-button, .task-table .status { font-size: 13px; }
    .toolbar, .records-page .toolbar { flex-direction: column; align-items: stretch; padding: 0; gap: 18px; }
    .records-page .toolbar { padding: 20px; }
    .toolbar-controls, .records-page .toolbar-controls { width: 100%; gap: 10px; }
    .toolbar input, .toolbar select { width: 100%; }
    .toolbar-controls .button { font-size: 13px; }
    .history-pagination, .records-page .history-pagination { flex-wrap: wrap; gap: 16px; font-size: 13px; }
    .records-page .history-pagination { padding: 18px; }
    .settings-grid { grid-template-columns: 1fr; }
    .setting-full { grid-column: 1 / -1; }
    .account-panel, .admin-surface { padding: 22px; }
    .quota-hero { flex-direction: column; align-items: flex-start; padding: 25px; }
    .quota-balance { font-size: 34px; }
    .quota-hero-actions { flex-direction: row; flex-wrap: wrap; gap: 14px; width: 100%; align-items: center; }
    .quota-stats { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 12px; }
    .quota-stat { padding: 18px; }
    .quota-stat > span { font-size: 13px; }
    .quota-stat > strong { font-size: 22px; }
    .quota-stat small { display: block; font-size: 13px; margin: 5px 0 0; }
    .quota-redeem-panel, .quota-guide { padding: 24px; }
    .quota-guide ul { grid-template-columns: 1fr; }
    .quota-records .toolbar { padding: 22px; }
    .quota-code-input { font-size: 14px !important; }
    .quota-tabs { flex-wrap: wrap; }
    .quota-tabs button { font-size: 13px; }
    .quota-generated { font-size: 13px; }
    .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .stat { padding: 19px; }
    .stat-value { font-size: 26px; }
    .interface-tabs { gap: 10px; }
    .interface-tab { padding: 16px; }
    .interface-tab strong { font-size: 14px; }
    .interface-tab span { font-size: 12px; }
    .interface-save-bar { flex-direction: column; align-items: stretch; padding: 20px; }
    .flow-overview, .flow-generation, .flow-step-card { padding: 20px; }
    .flow-preview-grid { grid-template-columns: 1fr; }
    .flow-step-head { flex-wrap: wrap; gap: 12px; }
    .flow-step-head > div { flex-basis: 100%; }
    .flow-step-head h2 { font-size: 18px; }
    .flow-collapse { margin-left: auto; }
    .flow-step-summary { margin-left: 0; }
    .flow-step-card .settings-grid { grid-template-columns: minmax(0,1fr); }
    .flow-service-settings { padding: 17px; }
    .flow-save-bar { position: static; padding: 20px; flex-direction: column; align-items: stretch; }
    .flow-save-bar .inline-actions { justify-content: flex-end; }
    .flow-mode-tabs button { padding: 9px 14px; font-size: 14px; }
    .auth-wrap { display: grid; grid-template-columns: minmax(0,520px); padding: 28px 20px 36px; }
    .auth-intro { display: flex; padding: 28px; border: 1px solid #d6e3fb; border-radius: 16px 16px 0 0; }
    .auth-intro h1 { font-size: 25px; margin: 12px 0; }
    .auth-intro > p { margin: 0; font-size: 14px; }
    .login-features, .auth-intro > small { display: none; }
    .auth-panel { padding: 28px; border-radius: 0 0 16px 16px; }
    .auth-panel .field label { font-size: 14px; }
    .help-grid { grid-template-columns: 1fr; }
    .help-card { padding: 24px; }
    .modal-backdrop { padding: 14px; }
    .modal { max-height: calc(100dvh - 28px); border-radius: 16px; }
    .modal-head { padding: 19px 20px; gap: 12px; }
    .modal-head h2 { font-size: 18px; overflow-wrap: anywhere; }
    .modal-head small { font-size: 13px; }
    .modal-body { padding: 20px; }
    .modal-foot { padding: 17px 20px; flex-wrap: wrap; }
    .comparison-grid { grid-template-columns: minmax(0,1fr); }
    .comparison-text { font-size: 16px; padding: 18px; }
    .comparison-modal .modal-body { overflow: auto; display: block; }
    .comparison-modal .comparison-text { height: 45vh; min-height: 160px; }
    .review-summary { font-size: 13px; }
    .site-footer { padding: 20px 18px; flex-wrap: wrap; font-size: 13px; }
    .app-shell:has(.tool-workspace) .site-footer { padding-bottom: 90px; }
    .toast-region { bottom: 88px; right: 16px; width: calc(100vw - 32px); }
    .toast { font-size: 14px; }
}
@media (max-width: 380px) {
    .tool-choices .mode-symbol { display: none; }
    .tool-choices .mode-button { padding: 10px; }
    .editor-options > .text-button { flex-basis: 100%; text-align: left; }
    .stat-grid, .interface-tabs { grid-template-columns: 1fr; }
    .quota-hero, .quota-guide, .quota-redeem-panel, .auth-panel, .auth-intro { padding: 22px; }
    .flow-mode-tabs button { padding: 9px 11px; }
    .flow-save-bar .inline-actions { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .flow-toggle input, .flow-toggle input::after { transition: none; }
}

/* Supporting content and input sizing for the V4 copy. */
.background-notice { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 0; color: #526780; font-size: 13px; line-height: 1.75; }
.background-notice .ui-icon { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 3px; }
.background-notice strong { font-weight: 600; }
.help-section-title { font-size: 18px; margin: 24px 0 16px; }
.scenario-card h2 { margin-top: 0; }
.help-faq details { border-bottom: 1px solid var(--line); padding: 15px 0; }
.help-faq details:last-child { border-bottom: 0; }
.help-faq summary { color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.help-faq p { margin: 10px 0 0; }
.site-footer { font-size: 12px; }
.brand { font-size: 19px; }
.brand-mark { width: 34px; height: 34px; }
.editor-textarea, .result-area, .generation-textarea, .comparison-text { font-size: 16px; line-height: 1.85; }
.editor-actions .button-primary { min-height: 42px; font-size: 14px; }
.side-credit strong { font-size: 24px; }
.flow-mode-tabs button { font-size: 14px; }
.auth-panel input { font-size: 14px; min-height: 40px; }
.auth-intro > small { line-height: 1.8; }
.quota-code-input { font-size: 14px !important; }
@media (max-width: 760px) {
    .background-notice { font-size: 13px; }
    .page-heading h1 { font-size: 23px; }
    .auth-intro > small { display: block; padding-top: 14px; font-size: 12px; }
    .field input, .field select, .field textarea, .auth-panel input,
    .toolbar input, .toolbar select, .processing-plan-select,
    .quota-code-input { font-size: 16px !important; }
    .editor-textarea, .generation-textarea, .result-area, .comparison-text { font-size: 16px; }
}
@media (pointer: coarse) {
    .button, .text-button, .mode-button, .account-nav button, .admin-nav button,
    .flow-mode-tabs button, .mobile-panes button, .topnav a, .user-dropdown button,
    .field input:not([type="checkbox"]):not([type="radio"]), .field select, .processing-plan-select { min-height: 44px; }
    .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { font-size: 16px; }
}

/* Both authentication views inherit the original login card and type scale.
   Registration pairs its four account fields into the same two rows as login. */
.auth-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.auth-wrap .captcha-line { grid-template-columns: minmax(0, 1fr) 112px; }
.auth-wrap .field input { min-width: 0; }

/* Reduce only spacing when the available viewport is shorter. */
@media (max-height: 850px) and (min-width: 761px) {
    .auth-wrap { padding: 16px 30px; }
    .auth-intro, .auth-panel { padding: 28px; }
}
@media (max-height: 740px) and (min-width: 761px) {
    .auth-wrap { padding: 12px 30px; }
    .auth-intro, .auth-panel { padding: 24px; }
    .auth-intro h1 { margin: 16px 0; }
    .auth-intro > p { margin: 0; }
    .auth-wrap .login-features { gap: 18px; margin: 24px 0; }
    .auth-intro > small { padding-top: 18px; }
    .auth-header { margin-bottom: 18px; }
    .auth-wrap .field { gap: 8px; margin-bottom: 14px; }
    .auth-wrap .form-error:empty { display: none; }
    .auth-switch { margin-top: 16px; }
}
@media (max-height: 640px) and (min-width: 761px) {
    .auth-wrap { padding: 10px 24px; }
    .auth-intro, .auth-panel { padding: 16px 24px; }
    .auth-wrap .login-features { gap: 14px; margin: 18px 0; }
    .auth-header { margin-bottom: 12px; }
    .auth-header p { margin-top: 5px; }
    .auth-wrap .field { gap: 6px; margin-bottom: 10px; }
    .auth-switch { margin-top: 12px; }
    .app-shell:has(> .auth-wrap) > .site-footer { padding: 8px 24px; }
}
@media (max-width: 760px) {
    .auth-wrap { grid-template-columns: minmax(0, 520px); padding: 16px; }
    .auth-intro { display: none; }
    .auth-panel { padding: 24px; border-radius: 16px; }
    .auth-header { margin-bottom: 16px; }
    .auth-wrap .field { gap: 7px; margin-bottom: 12px; }
    .auth-wrap .field input { height: 44px; min-height: 44px; }
    .auth-wrap .form-error:empty { display: none; }
    .auth-switch { margin-top: 14px; }
    .auth-field-row { column-gap: 12px; }
    .app-shell:has(> .auth-wrap) > .topbar { height: auto; min-height: 60px; flex: 0 0 auto; flex-wrap: nowrap; padding: 8px 16px; gap: 12px; }
    .app-shell:has(> .auth-wrap) > .topbar .brand { font-size: 17px; }
    .app-shell:has(> .auth-wrap) > .topbar .topbar-actions { flex-shrink: 0; }
    .app-shell:has(> .auth-wrap) > .topbar .topbar-actions > a[href="#usage"] { display: none; }
    .app-shell:has(> .auth-wrap) > .site-footer { gap: 5px 12px; padding: 8px 16px; font-size: 11px; }
}
@media (max-width: 380px) {
    .auth-wrap { padding: 12px; }
    .auth-panel { padding: 20px 16px; }
    .auth-field-row { column-gap: 10px; }
}
@media (max-width: 319px) {
    .auth-field-row { grid-template-columns: minmax(0, 1fr); }
}

/* Dynamic processing modes: names wrap while the article editor retains its own layout. */
.processing-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; max-width: 100%; }
.processing-controls .processing-plan-control { min-width: 0; max-width: 100%; }
.processing-controls select { max-width: min(280px, 100%); }
.processing-mode-hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.single-task-picker { padding: 0 24px 16px; min-width: 0; }
.single-task-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: #536078; font-size: 13px; }
.single-task-picker-head .text-button { font-size: 13px; white-space: nowrap; }
.single-task-picker select { width: 100%; min-width: 0; max-width: 100%; height: 42px; padding: 8px 32px 8px 12px; border: 1px solid #d5e2f7; border-radius: 9px; background-color: #fff; color: var(--ink); font-size: 14px; text-overflow: ellipsis; }
.single-task-meta { display: flex; flex-direction: column; gap: 5px; padding: 0 24px 13px; overflow-wrap: anywhere; }
.single-task-meta strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.single-task-meta > span { font-size: 12px; color: var(--muted); }
.single-task-progress { margin: 0 24px 14px; width: auto; min-width: 0; }
.single-task-progress .progress-track { flex: 1; min-width: 0; }
.single-result-pane .result-area { min-height: 250px; height: 300px; border-top: 1px solid #e8eef8; }
.single-result-pane .result-placeholder { min-height: 210px; }
.single-result-pane .result-area:focus-visible { outline: 2px solid #93b4f2; outline-offset: -2px; }
.single-result-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; min-height: 60px; }
.single-result-actions .pane-tools { gap: 13px; }
.single-submit-error { margin-top: 8px; color: #b42318; overflow-wrap: anywhere; }
.single-result-message { color: #a44718; }
@media (max-width: 640px) {
    .processing-mode-hint { flex-basis: 100%; }
    .single-task-picker { padding: 0 18px 14px; }
    .single-task-picker select { font-size: 16px; }
    .single-task-meta { padding: 0 18px 12px; }
    .single-task-progress { margin: 0 18px 14px; }
    .single-result-actions .text-button { min-height: 36px; }
}
.flow-mode-management { margin: 20px 0; padding: 20px; background: #f7f9fe; border: 1px solid var(--border); border-radius: 12px; }
.flow-mode-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .75fr); gap: 20px; align-items: start; }
.flow-mode-fields > .field { min-width: 0; margin: 0; }
.generation-single-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.generation-compose { display: flex; flex-direction: column; min-width: 0; }
.generation-title-field { display: grid; gap: 10px; padding: 22px 24px 8px; }
.generation-title-field > label, .generation-result-picker > label { font-size: 13px; color: #637187; }
.generation-title-field input, .generation-result-picker select { width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; font: inherit; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.generation-title-field input:focus, .generation-result-picker select:focus { outline: 2px solid #93b4f2; outline-offset: 1px; }
.generation-compose .generation-prompt-pane { flex: 1; }
.generation-compose .generation-textarea { height: 260px; min-height: 220px; }
.generation-compose .generation-actions { gap: 12px; }
.generation-compose .generation-actions .counter { flex-basis: 100%; }
.generation-result-pane { border-left: 1px solid var(--line); background: #fbfcff; }
.generation-result-pane .result-area { height: 360px; min-height: 260px; flex: 1; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.generation-result-picker { display: grid; gap: 8px; padding: 14px 24px 0; }
.generation-result-meta { padding: 10px 24px 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.generation-current-progress { padding: 12px 24px 0; }
.generation-result-actions { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.generation-surface .editor-config { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.generation-surface .pane-head { flex-wrap: wrap; gap: 8px 12px; }
.generation-count { padding: 6px 11px; border-radius: 7px; color: #345f9e; background: #edf4ff; font-size: 13px; font-variant-numeric: tabular-nums; }
.generation-batch-status { padding: 20px 24px; margin-top: 22px; }
.generation-batch-status > div:first-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.generation-batch-status > p { margin: 12px 0; color: var(--muted); font-size: 14px; }
.generation-batch-status .inline-actions { margin-top: 14px; }
.generation-batch-status strong { overflow-wrap: anywhere; }
@media (max-width: 800px) {
    .generation-single-grid { grid-template-columns: minmax(0, 1fr); }
    .generation-result-pane { border-left: 0; border-top: 1px solid var(--line); }
    .generation-title-field, .generation-result-picker { padding-left: 18px; padding-right: 18px; }
    .generation-result-meta, .generation-current-progress { padding-left: 18px; padding-right: 18px; }
    .generation-result-pane .result-area { flex: auto; height: 320px; }
}
@media (max-width: 600px) {
    .flow-mode-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .generation-surface .processing-controls { width: 100%; }
    .generation-surface .editor-config { padding: 16px 18px; }
    .generation-compose .generation-actions .editor-actions { width: 100%; margin: 0; flex-wrap: wrap; }
    .generation-compose .generation-actions .button-primary { flex: 1; }
    .generation-batch-status { padding: 18px; }
}
.flow-mode-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 8px; }
.flow-mode-tabs { max-width: 100%; }
.flow-mode-tabs button, [data-flow-current-name] { overflow-wrap: anywhere; max-width: 100%; }
.flow-mode-select { max-width: 100%; flex-wrap: wrap; }
.flow-mode-select select { max-width: min(360px, 100%); }
.flow-step-head .flow-step-actions { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.flow-step-actions .flow-toggle { margin: 0; }
.interface-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.interface-panel .settings-grid, .flow-step-card .settings-grid { align-items: start; }
.interface-panel .field, .flow-step-card .field { align-self: start; align-content: start; gap: 8px; }
.interface-panel .field input:not([type="checkbox"]):not([type="radio"]),
.interface-panel .field select, .flow-step-card .field input:not([type="checkbox"]):not([type="radio"]),
.flow-step-card .field select { height: 44px; min-height: 44px; min-width: 0; }
.model-services-heading, .model-service-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.model-services-heading { margin-bottom: 22px; }
.model-services-heading > div { flex: 1; min-width: min(260px, 100%); }
.model-services-heading p { margin: 6px 0 0; }
.model-services-heading > .button { flex-shrink: 0; }
.model-service-card { padding: 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.model-service-head { margin-bottom: 22px; }
.model-service-head h3 { font-size: 16px; font-weight: 650; margin: 0; }
.model-default-badge { padding: 4px 10px; border-radius: 6px; background: #f0f5ff; font-size: 12px; color: #49688e; }
.model-remove { color: #b14d4d; }
.model-service-card .settings-grid { row-gap: 22px; }
.model-service-card .field { margin-bottom: 0; }
.model-service-note { margin: 0; }
.model-key-controls { display: grid; gap: 8px; }
.model-key-shared { display: flex; align-items: center; min-height: 44px; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #f8faff; font-size: 14px; }
.flow-language-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; min-width: 0; }
.flow-text-input { min-width: 0; }
.flow-step-head > .flow-step-actions { flex: 0 1 auto; }
@media (max-width: 640px) {
    .model-service-card { padding: 16px; }
    .model-services-heading > .button { width: 100%; }
    .flow-language-inputs { grid-template-columns: minmax(0, 1fr); }
}
.flow-delete-step { color: #ad4545; }
.flow-delete-step:hover { color: #942e2e; background: #fff3f3; border-color: #efcaca; }
.flow-step-management { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 22px 24px; border-style: dashed; }
.flow-step-management > div { flex: 1; min-width: min(260px, 100%); }
.flow-step-management h2 { margin: 0 0 7px; font-size: 16px; }
.flow-step-management h2 span { margin-left: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.flow-step-management .field-hint { margin: 0; }
.flow-empty-steps { width: 100%; margin: 0; padding: 13px 16px; color: #405e87; background: var(--brand-soft); border-radius: 8px; font-size: 13px; }
@media (max-width: 600px) {
    .flow-step-head .flow-step-actions { width: 100%; justify-content: flex-start; margin: 4px 0 0; gap: 8px; }
    .flow-step-actions .flow-toggle { margin-right: auto; }
    .flow-step-management { padding: 18px; }
    .flow-step-management > .button { width: 100%; }
}
@media (max-width: 600px) { .flow-mode-management { padding: 14px; } .flow-mode-actions .button { flex: 1 1 120px; } }

/* Personal keyword rules use the same restrained blue palette as the workspace. */
.replacement-badge { padding: 7px 12px; border: 1px solid #d6e4fc; border-radius: 999px; color: #3968ac; background: #eff5ff; font-size: 12px; white-space: nowrap; }
.replacement-overview { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 24px; margin-bottom: 20px; border-top: 3px solid #719bec; }
.replacement-overview h2, .replacement-toolbar h2, .replacement-help h2 { margin: 0 0 8px; font-size: 17px; line-height: 1.5; }
.replacement-overview p, .replacement-toolbar p, .replacement-help p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.replacement-overview > div { max-width: 690px; }
.replacement-toggle { display: flex; align-items: center; gap: 9px; flex-shrink: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.replacement-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.replacement-editor { overflow: hidden; margin-bottom: 20px; }
.replacement-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 22px 24px; }
.replacement-toolbar h2 small { color: var(--muted); font-size: 12px; margin-left: 12px; font-weight: 400; }
.replacement-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.replacement-fields { border: 0; padding: 0 24px 20px; margin: 0; min-width: 0; }
.replacement-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 24px minmax(0, 1fr) 44px; align-items: center; gap: 14px; padding: 9px 0; }
.replacement-row label { min-width: 0; }
.replacement-row input { width: 100%; height: 42px; border: 1px solid #dce5f3; border-radius: 8px; padding: 10px 12px; background: #fcfdff; color: var(--ink); font: inherit; font-size: 14px; }
.replacement-row input:focus { outline: none; border-color: #7ba3ef; box-shadow: 0 0 0 3px #eaf1ff; background: #fff; }
.replacement-row input::placeholder { color: #9aa8be; font-size: 12px; }
.replacement-row input:disabled { opacity: .65; }
.replacement-table-head { margin-bottom: 5px; border-bottom: 1px solid #e6edf7; font-size: 12px; color: var(--muted); }
.replacement-index, .replacement-arrow { text-align: center; font-size: 13px; color: #8a9bb7; }
.replacement-remove { color: #a95959; font-size: 12px; }
.replacement-mobile-label { display: none; }
.replacement-empty { padding: 34px 18px; text-align: center; border: 1px dashed #dce5f3; border-radius: 10px; background: #fcfdff; color: var(--muted); }
.replacement-empty > .mode-symbol { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; }
.replacement-empty h3 { font-size: 15px; color: var(--ink); margin: 12px 0 6px; }
.replacement-empty p { font-size: 13px; margin: 0; }
.replacement-savebar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 18px 24px; border-top: 1px solid #e5ecf7; background: #f8faff; }
.replacement-savebar > span { color: #657e9f; font-size: 13px; }
.replacement-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.replacement-help { padding: 24px; min-width: 0; }
.replacement-help pre { font-family: inherit; font-size: 13px; line-height: 1.9; padding: 12px 16px; border-radius: 8px; background: #f3f6fc; color: #506886; white-space: pre-wrap; overflow-wrap: anywhere; }
.replacement-help .text-button { margin-top: 12px; font-size: 13px; }
.replacement-plan-list { display: grid; gap: 10px; margin: 12px 0 18px; }
.replacement-plan-list > div { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.replacement-plan-list > div > span:first-child { overflow-wrap: anywhere; }
.replacement-plan-list > div > span:last-child { flex-shrink: 0; font-size: 12px; }
.replacement-supported { color: #377a78; }
.replacement-error { border: 1px solid #efcece; color: #a34545; background: #fff6f6; border-radius: 10px; padding: 13px 18px; margin-bottom: 16px; font-size: 13px; overflow-wrap: anywhere; }
.replacement-import-preview { border-top: 1px solid #dce7fa; background: #f5f8ff; }
.replacement-import-preview h3 { font-size: 15px; margin: 0 0 6px; overflow-wrap: anywhere; }
.replacement-preview-list { max-height: 300px; overflow: auto; padding: 0 24px 18px; }
.replacement-preview-row { grid-template-columns: 42px minmax(0, 1fr) 24px minmax(0, 1fr); font-size: 13px; border-top: 1px solid #e4ebf7; }
.replacement-preview-row > span { overflow-wrap: anywhere; }
@media (max-width: 1000px) { .replacement-overview { align-items: flex-start; flex-direction: column; gap: 16px; } .replacement-help-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .replacements-layout .page-heading { align-items: flex-start; }
    .replacement-badge { display: none; }
    .replacement-overview, .replacement-toolbar, .replacement-help, .replacement-savebar { padding: 18px; }
    .replacement-fields { padding: 0 18px 18px; }
    .replacement-row { grid-template-columns: 24px minmax(0, 1fr) 40px; gap: 8px; padding: 14px 0; border-top: 1px solid #e8edf5; }
    .replacement-table-head, .replacement-row > .replacement-arrow { display: none; }
    .replacement-row > .replacement-index { grid-row: span 2; align-self: start; padding-top: 28px; }
    .replacement-row > label { grid-column: 2; }
    .replacement-row > label:nth-of-type(2) { grid-row: 2; }
    .replacement-row > .replacement-remove { grid-row: 1 / 3; grid-column: 3; }
    .replacement-mobile-label { display: block; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
    .replacement-row input { font-size: 16px; }
    .replacement-savebar > .replacement-actions { width: 100%; }
    .replacement-savebar .button { flex: 1; }
    .replacement-preview-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
    .replacement-preview-row > .replacement-index { grid-row: auto; padding-top: 0; }
}

/* Readable lists: group related fields; use the page scroll and keep every action visible. */
.readable-list { container-type: inline-size; width: 100%; min-width: 0; max-width: 100%; }
.table-scroll.readable-list, .file-list-scroll.readable-list { overflow: visible; max-height: none; }
.readable-list .readable-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 14px; }
.readable-list .readable-table th, .readable-list .readable-table td:nth-child(n) {
    display: table-cell; min-width: 0; max-width: none; padding: 18px 12px;
    white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip;
    vertical-align: top; font-size: 14px; line-height: 1.65; text-align: left;
}
.readable-list .readable-table th { padding-top: 12px; padding-bottom: 12px; font-size: 12px; font-weight: 600; color: #657897; background: #f5f8fd; }
.readable-list .readable-table td > strong { font-size: 14px; font-weight: 600; color: #293e5b; }
.readable-list .readable-table small { display: block; max-width: none; margin-top: 4px; font-size: 12px; color: #6b7d97; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.readable-list .readable-table .task-submitter { min-width: 0; gap: 0; }
.readable-list .readable-table .task-submitter strong { font-weight: 600; }
.readable-list .readable-table .task-count { min-width: 0; }
.readable-list .readable-table .status { max-width: 100%; font-size: 12px; white-space: normal; line-height: 1.65; height: auto; }
.readable-list .readable-table .mini-progress { width: 100%; max-width: 132px; min-width: 0; margin-top: 10px; height: 22px; }
.readable-list .readable-table .mini-progress em { font-size: 12px; }
.readable-list .readable-table .inline-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 12px; max-width: 100%; }
.readable-list .readable-table .record-actions > .inline-actions + .inline-actions { margin-top: 4px; }
.readable-list .readable-table .text-button { font-size: 13px; line-height: 1.8; padding: 2px 0; white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.task-times { display: grid; gap: 6px; font-size: 12px; color: #536987; font-variant-numeric: tabular-nums; }
.task-times > div { display: grid; grid-template-columns: 2em minmax(0,1fr); gap: 8px; }
.task-times > div > span:first-child { color: #7c8ba2; }
.list-sorting { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12px; color: #73849c; }
.list-sorting .table-sort { padding: 4px 0; line-height: 1.6; font-size: 12px; }
.list-sorting .table-sort.active { color: var(--brand); font-weight: 600; }
.task-select-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #4d6383; cursor: pointer; }
.task-select-all input, .readable-table [data-admin-task-select] { width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 16px; }
.readable-list .admin-task-table .task-select-cell { width: auto; min-width: 0; padding-left: 8px; padding-right: 4px; text-align: center; }
.readable-list .task-table th:nth-child(1) { width: 23%; }
.readable-list .task-table th:nth-child(2) { width: 9%; }
.readable-list .task-table th:nth-child(3) { width: 17%; }
.readable-list .task-table th:nth-child(4) { width: 13%; }
.readable-list .task-table th:nth-child(5) { width: 23%; }
.readable-list .task-table th:nth-child(6) { width: 15%; }
.readable-list .task-table .record-charge { font-variant-numeric: tabular-nums; }
.readable-list .files-table th:nth-child(1) { width: 7%; }
.readable-list .files-table th:nth-child(2) { width: 49%; }
.readable-list .files-table th:nth-child(3), .readable-list .files-table th:nth-child(4) { width: 15%; }
.readable-list .files-table th:nth-child(5) { width: 14%; }
.readable-list .ledger-table th:nth-child(1) { width: 18%; }
.readable-list .ledger-table th:nth-child(2) { width: 13%; }
.readable-list .ledger-table th:nth-child(3) { width: 23%; }
.readable-list .ledger-table th:nth-child(4), .readable-list .ledger-table th:nth-child(5) { width: 13%; }
.readable-list .ledger-table th:nth-child(6) { width: 20%; }
.readable-list .quota-tasks-table th:nth-child(1) { width: 29%; }
.readable-list .quota-tasks-table th:nth-child(2) { width: 18%; }
.readable-list .quota-tasks-table th:nth-child(3) { width: 17%; }
.readable-list .quota-tasks-table th:nth-child(n+4) { width: 12%; }
.readable-list .document-table th:nth-child(1) { width: 5%; }
.readable-list .document-table th:nth-child(2) { width: 28%; }
.readable-list .document-table th:nth-child(3), .readable-list .document-table th:nth-child(4) { width: 8%; }
.readable-list .document-table th:nth-child(5) { width: 16%; }
.readable-list .document-table th:nth-child(6) { width: 21%; }
.readable-list .document-table th:nth-child(7) { width: 14%; }
.readable-list .stage-diagnostics, .readable-list details, .readable-list details > * { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.replacement-preview-list { max-height: none; overflow: visible; }

/* Respond to the actual content width, including the space taken by the sidebar. */
@container (max-width: 940px) {
    .readable-list .admin-task-table, .readable-list .admin-task-table tbody,
    .readable-list .document-table, .readable-list .document-table tbody { display: block; }
    .readable-list .admin-task-table colgroup, .readable-list .document-table colgroup { display: none; }
    .readable-list .admin-task-table thead, .readable-list .document-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .readable-list .admin-task-table tbody > tr, .readable-list .document-table tbody > tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 20px; padding: 20px; border-bottom: 1px solid var(--line); }
    .readable-list .admin-task-table td:nth-child(n), .readable-list .document-table td:nth-child(n) { display: block; padding: 0; border: 0; text-align: left; width: auto; }
    .readable-list .admin-task-table td[data-label]::before, .readable-list .document-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 12px; font-weight: 400; color: #7a8ba3; }
    .readable-list .admin-task-table .record-primary, .readable-list .document-table .record-primary,
    .readable-list .admin-task-table .record-times { grid-column: span 2; }
    .readable-list .document-table .record-wide, .readable-list .document-table .record-actions,
    .readable-list .admin-task-table .empty-row, .readable-list .document-table .empty-row { grid-column: 1 / -1; }
    .readable-list .admin-task-table tbody > tr { position: relative; }
    .readable-list .admin-task-table td.task-select-cell { position: absolute; top: 20px; left: 20px; }
    .readable-list .admin-task-table td.task-select-cell::before { display: none; }
    .readable-list .admin-task-table td.record-primary { grid-column: 1 / -1; padding-left: 30px; }
}
@container (max-width: 700px) {
    .readable-list .readable-table, .readable-list .readable-table tbody { display: block; }
    .readable-list .readable-table colgroup { display: none; }
    .readable-list .readable-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .readable-list .readable-table tbody > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
    .readable-list .readable-table tbody > tr:last-child { border-bottom: 0; }
    .readable-list .readable-table td:nth-child(n) { display: block; width: auto; min-width: 0; max-width: none; padding: 0; border: 0; font-size: 14px; text-align: left; }
    .readable-list .admin-task-table td.record-primary { padding-left: 30px; }
    .readable-list .readable-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 12px; font-weight: 400; color: #7a8ba3; }
    .readable-list .readable-table .record-primary, .readable-list .readable-table .record-times,
    .readable-list .readable-table .record-actions, .readable-list .readable-table .record-wide,
    .readable-list .readable-table .empty-row { grid-column: 1 / -1; }
    .readable-list .readable-table .record-actions > .inline-actions { display: inline-flex; vertical-align: top; margin: 0 14px 0 0; }
    .readable-list .readable-table .task-times { gap: 5px; }
    .readable-list .task-table .record-status { grid-column: 1 / -1; grid-row: 3; }
    .readable-list .readable-table .text-button { min-height: 32px; }
    .list-sorting { padding: 12px 20px; }
}
/* Pricing remains beside the plan selector and wraps naturally on small screens. */
.processing-controls { flex-wrap: wrap; }
.points-price { margin-left: auto; display: grid; gap: 3px; text-align: right; color: #52616d; font-size: 13px; padding: 5px 0 5px 22px; }
.points-price strong { font-size: 19px; color: var(--brand-dark); }
.points-price strong small { font-size: 12px; font-weight: 500; }
.points-price > small { font-size: 11px; }
.single-input-stats { display: grid; gap: 3px; justify-items: end; margin-left: auto; min-width: 0; max-width: 100%; text-align: right; line-height: 1.5; overflow-wrap: anywhere; }
.single-input-stats strong { font-size: 14px; font-weight: 650; color: var(--brand-dark); }
.single-input-stats .single-points-pending { font-size: 12px; font-weight: 500; color: var(--muted); }
.points-unpriced { color: #985a16; }
@media (max-width: 620px) { .points-price { width: 100%; margin: 6px 0 0; padding: 10px 0 0; text-align: left; border-top: 1px solid #e5ebe8; } }

/* Approved blue-and-white workspace: separate configuration, content and actions.
   Scoped to the signed-in frontend; authentication and administration retain their styles. */
.app-shell.clear-panels-ui {
    --ink: #202e45;
    --muted: #63728b;
    --soft: #f5f7fb;
    --paper: #fff;
    --line: #dfe6f1;
    --line-strong: #cdd9ed;
    --workspace-head: #f8faff;
    --workspace-gap: 20px;
    --workspace-pad: 20px;
    background: var(--soft);
}
.clear-panels-ui .page-heading { margin-bottom: 22px; }
.clear-panels-ui .page-heading h1 { font-size: 27px; font-weight: 650; letter-spacing: -.3px; }
.clear-panels-ui .workspace-notice { margin-bottom: 20px; }
.clear-panels-ui .surface { border-color: var(--line); box-shadow: 0 3px 12px #23385a06; }
.clear-panels-ui .editor-surface,
.clear-panels-ui .upload-surface,
.clear-panels-ui .generation-surface {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.clear-panels-ui .editor-config {
    display: flex;
    align-items: center;
    min-height: 80px;
    padding: 17px var(--workspace-pad);
    margin-bottom: var(--workspace-gap);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 3px 12px #23385a06;
}
.clear-panels-ui .editor-options { width: 100%; min-width: 0; }
.clear-panels-ui .processing-controls {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 24px;
}
.clear-panels-ui .processing-config-main {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    min-width: 0;
    max-width: 100%;
}
.clear-panels-ui .processing-plan-control { display: flex; flex: 0 1 auto; align-items: center; gap: 12px; min-width: 0; font-size: 14px; color: var(--ink); }
.clear-panels-ui .processing-plan-control > span { flex-shrink: 0; }
.clear-panels-ui .processing-plan-select {
    width: 240px;
    min-width: 150px;
    max-width: 100%;
    height: 44px;
    margin: 0;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    background: var(--paper);
    font-size: 14px;
}
.clear-panels-ui .processing-mode-hint { flex-basis: auto; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.clear-panels-ui .points-price { display: flex; align-items: center; min-height: 30px; padding: 0 0 0 22px; margin: 0 0 0 auto; border-left: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: right; max-width: 100%; }
.clear-panels-ui .points-price > span { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.clear-panels-ui .points-price strong { font-size: 18px; font-weight: 600; line-height: 1.4; }
.clear-panels-ui .points-unpriced { color: var(--amber); }
.clear-panels-ui .editor-grid,
.clear-panels-ui .generation-single-grid,
.clear-panels-ui .generation-grid,
.clear-panels-ui .batch-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--workspace-gap);
    min-height: 0;
    align-items: stretch;
}
.clear-panels-ui .batch-panels { align-items: start; }
.clear-panels-ui .editor-pane,
.clear-panels-ui .workspace-card,
.clear-panels-ui .generation-compose,
.clear-panels-ui .generation-result-pane,
.clear-panels-ui .generation-grid > .generation-pane,
.clear-panels-ui .replacement-editor,
.clear-panels-ui .replacement-support-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    overflow: hidden;
    box-shadow: 0 3px 12px #23385a06;
}
.clear-panels-ui .pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 10px;
    min-height: 78px;
    padding: 16px var(--workspace-pad);
    border-bottom: 1px solid var(--line);
    background: var(--workspace-head);
    color: var(--ink);
}
.clear-panels-ui .workspace-panel-title { display: flex; align-items: center; gap: 9px; margin: 0; min-width: 0; font-size: 18px; font-weight: 600; line-height: 1.5; }
.clear-panels-ui .workspace-panel-title .ui-icon { width: 19px; height: 19px; color: var(--brand); flex-shrink: 0; }
.clear-panels-ui .pane-head small { font-size: 13px; line-height: 1.6; font-weight: 400; color: var(--muted); }
.clear-panels-ui .single-input-stats { gap: 2px; }
.clear-panels-ui .single-input-stats strong { font-size: 13px; }
.clear-panels-ui .workspace-panel-body { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 16px; padding: var(--workspace-pad); }
.clear-panels-ui .workspace-panel-body > .editor-textarea,
.clear-panels-ui .workspace-panel-body > .generation-textarea,
.clear-panels-ui .generation-prompt-body > .generation-textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 340px;
    min-height: 340px;
    flex: 1;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.85;
    resize: vertical;
}
.clear-panels-ui .workspace-field-hint,
.clear-panels-ui .generation-prompt-note small { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.75; }
.clear-panels-ui .workspace-panel-body > .single-submit-error { margin: 0; font-size: 13px; }
.clear-panels-ui .result-panel-body .single-task-picker,
.clear-panels-ui .result-panel-body .single-task-meta,
.clear-panels-ui .result-panel-body .generation-result-picker,
.clear-panels-ui .result-panel-body .generation-result-meta,
.clear-panels-ui .result-panel-body .generation-current-progress { margin: 0; padding: 0; }
.clear-panels-ui .result-panel-body .single-task-progress { margin: 0; }
.clear-panels-ui .single-task-picker-head { margin-bottom: 7px; }
.clear-panels-ui .generation-result-picker { gap: 0; }
.clear-panels-ui .generation-result-picker label { font-size: 13px; color: var(--muted); }
.clear-panels-ui .single-task-picker select,
.clear-panels-ui .generation-result-picker select { height: 44px; min-height: 44px; border-radius: 8px; font-size: 15px; padding: 8px 32px 8px 12px; border-color: var(--line-strong); }
.clear-panels-ui .single-result-pane .result-area,
.clear-panels-ui .generation-result-pane .result-area {
    flex: 1 1 260px;
    height: 300px;
    min-height: 260px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow: auto;
    overflow-wrap: anywhere;
}
.clear-panels-ui .single-result-pane .result-placeholder,
.clear-panels-ui .generation-result-pane .result-placeholder { min-height: 225px; height: 100%; padding: 18px 8px; gap: 11px; }
.clear-panels-ui .result-placeholder strong { font-size: 16px; font-weight: 600; }
.clear-panels-ui .result-placeholder > span:last-child { font-size: 13px; max-width: 280px; }
.clear-panels-ui .result-placeholder .empty-symbol { width: 40px; height: 40px; min-height: 40px; margin: 0 0 3px; border: 0; border-radius: 10px; color: var(--brand); background: var(--brand-soft); box-shadow: none; }
.clear-panels-ui .result-placeholder .empty-symbol .ui-icon { width: 22px; height: 22px; }
.clear-panels-ui .result-secondary-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.clear-panels-ui .result-secondary-actions .text-button { color: var(--muted); font-size: 13px; }
.clear-panels-ui .result-secondary-actions .danger { color: var(--red); }
.clear-panels-ui .editor-footer,
.clear-panels-ui .single-result-actions,
.clear-panels-ui .generation-result-actions,
.clear-panels-ui .generation-actions,
.clear-panels-ui .batch-actions,
.clear-panels-ui .workspace-panel-footer,
.clear-panels-ui .replacement-savebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 10px;
    min-height: 70px;
    margin: 0;
    padding: 12px var(--workspace-pad);
    border-top: 1px solid var(--line);
    background: var(--paper);
}
.clear-panels-ui .editor-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; width: 100%; margin: 0; }
.clear-panels-ui .editor-actions .button { min-height: 44px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.clear-panels-ui .editor-actions .button-primary { margin-left: auto; }
.clear-panels-ui .single-result-actions .pane-tools { display: flex; width: 100%; align-items: center; gap: 8px 14px; }
.clear-panels-ui .single-result-actions [data-action="download-doc"],
.clear-panels-ui .generation-result-actions [data-action="download-doc"] { margin-left: auto; }
.clear-panels-ui .single-result-actions .text-button,
.clear-panels-ui .generation-result-actions .text-button { font-size: 14px; }
.clear-panels-ui .under-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 13px; }
.clear-panels-ui .under-editor > .editor-credit { margin-left: auto; font-size: 13px; }
.clear-panels-ui .workspace-review-note { flex-basis: 100%; }
.clear-panels-ui .under-editor > span:last-child { display: inline; }
.clear-panels-ui .generation-compose-body { gap: 18px; }
.clear-panels-ui .generation-title-field { padding: 0; gap: 8px; }
.clear-panels-ui .generation-title-field > label { font-size: 14px; color: var(--ink); }
.clear-panels-ui .generation-title-field input { min-height: 46px; font-size: 16px; border-color: var(--line-strong); padding: 10px 12px; }
.clear-panels-ui .generation-compose .generation-prompt-pane { display: flex; flex: 1; flex-direction: column; gap: 9px; min-width: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.clear-panels-ui .generation-field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.clear-panels-ui .generation-field-head label { font-size: 14px; }
.clear-panels-ui [data-action="generation-default-prompt"] { font-size: 13px; }
.clear-panels-ui .generation-prompt-body { display: flex; flex: 1; }
.clear-panels-ui .generation-compose .generation-textarea { min-height: 225px; height: 240px; }
.clear-panels-ui .generation-prompt-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.clear-panels-ui .generation-batch-surface > .generation-actions { margin-top: var(--workspace-gap); border: 1px solid var(--line); border-radius: 12px; padding: 16px var(--workspace-pad); }
.clear-panels-ui .generation-batch-surface > .generation-actions .editor-actions { width: auto; margin-left: auto; }
.clear-panels-ui .generation-grid > .generation-pane > .workspace-panel-footer small { font-size: 13px; font-weight: 400; color: var(--muted); }
.clear-panels-ui .upload-surface .dropzone { margin: 0; padding: 24px 16px; min-height: 210px; border: 1px dashed #b8caeb; border-radius: 9px; background: var(--workspace-head); }
.clear-panels-ui .dropzone strong { font-size: 15px; font-weight: 600; }
.clear-panels-ui .dropzone p { margin: 9px 0 16px; font-size: 13px; line-height: 1.75; }
.clear-panels-ui .drop-symbol { width: 32px; height: 32px; margin-bottom: 9px; font-size: 22px; }
.clear-panels-ui .upload-surface .file-list { margin: 0; border-color: var(--line); border-radius: 8px; }
.clear-panels-ui .upload-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; font-size: 13px; }
.clear-panels-ui .upload-summary .text-button { font-size: 13px; }
.clear-panels-ui .batch-files-panel .files-table,
.clear-panels-ui .batch-files-panel .files-table tbody { display: block; width: 100%; min-width: 0; }
.clear-panels-ui .batch-files-panel .files-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.clear-panels-ui .batch-files-panel .files-table tbody > tr { display: grid; grid-template-columns: 22px max-content minmax(0, 1fr) auto; align-items: center; gap: 5px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(n) { display: block; width: auto; padding: 0; border: 0; font-size: 13px; text-align: left; line-height: 1.75; }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(n)::before { display: none; }
.clear-panels-ui .batch-files-panel .files-table td:first-child { grid-column: 1; grid-row: 1 / 3; align-self: start; color: var(--muted); }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(2) { grid-column: 2 / 4; grid-row: 1; font-size: 14px; color: var(--ink); }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--muted); }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(3)::before { display: inline; content: '大小 '; font-size: inherit; margin: 0; }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(4) { grid-column: 3; grid-row: 2; color: var(--muted); }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(4)::before { display: inline; content: '字符 '; font-size: inherit; margin: 0; }
.clear-panels-ui .batch-files-panel .files-table td:nth-child(4) small { display: inline; margin: 0 0 0 8px; font-size: 12px; }
.clear-panels-ui .batch-files-panel .files-table td:last-child { grid-column: 4; grid-row: 1 / 3; }
.clear-panels-ui .batch-files-panel .files-table td:last-child .text-button { min-height: 36px; font-size: 13px; }
.clear-panels-ui .batch-files-panel .files-table td.file-validation-cell { grid-column: 2 / -1; grid-row: 3; }
.clear-panels-ui .batch-files-panel .files-table td.file-validation-cell[hidden] { display: none; }
.clear-panels-ui .batch-files-panel .file-validation { margin: 5px 0 0; padding: 8px 10px; border: 1px solid #f4d6d6; border-radius: 6px; background: #fff6f6; color: #b53636; font-size: 12px; line-height: 1.7; }
.clear-panels-ui .batch-files-panel .files-table .file-check-error { color: #b53636; }
@container (max-width: 420px) {
    .clear-panels-ui .batch-files-panel .files-table tbody > tr { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px 8px; padding: 12px; }
    .clear-panels-ui .batch-files-panel .files-table td:nth-child(2) { grid-column: 2; }
    .clear-panels-ui .batch-files-panel .files-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
    .clear-panels-ui .batch-files-panel .files-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
    .clear-panels-ui .batch-files-panel .files-table td:last-child { grid-column: 3; grid-row: 1 / 3; }
    .clear-panels-ui .batch-files-panel .files-table td.file-validation-cell { grid-column: 1 / -1; grid-row: 4; }
}
.clear-panels-ui .batch-summary { display: grid; margin: 0; }
.clear-panels-ui .batch-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.clear-panels-ui .batch-summary dt { color: var(--muted); font-size: 14px; }
.clear-panels-ui .batch-summary dd { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.clear-panels-ui .workspace-support-note { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--workspace-head); }
.clear-panels-ui .workspace-support-note h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.clear-panels-ui .workspace-support-note p { margin: 0; font-size: 13px; line-height: 1.85; color: var(--muted); }
.clear-panels-ui .replacement-workspace-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: var(--workspace-gap); align-items: start; }
.clear-panels-ui .replacement-editor { margin-bottom: 0; }
.clear-panels-ui .replacement-toggle { font-size: 13px; font-weight: 400; color: var(--muted); gap: 7px; }
.clear-panels-ui .replacement-toggle input { width: 16px; height: 16px; margin: 0; }
.clear-panels-ui .replacement-toolbar { padding: 18px var(--workspace-pad) 12px; gap: 10px; }
.clear-panels-ui .replacement-toolbar > small { color: var(--muted); font-size: 13px; }
.clear-panels-ui .replacement-fields { padding: 0 var(--workspace-pad) 6px; }
.clear-panels-ui .replacement-row { grid-template-columns: 30px minmax(0, 1fr) 18px minmax(0, 1fr) 36px; gap: 8px; }
.clear-panels-ui .replacement-preview-row { grid-template-columns: 30px minmax(0, 1fr) 18px minmax(0, 1fr); }
.clear-panels-ui .replacement-row input { height: 44px; background: var(--paper); border-color: var(--line-strong); }
.clear-panels-ui .replacement-limits { padding: 10px var(--workspace-pad) 20px; }
.clear-panels-ui .replacement-help-grid { display: flex; flex-direction: column; gap: 22px; }
.clear-panels-ui .replacement-help { padding: 0; }
.clear-panels-ui .replacement-help.workspace-support-note { padding: 15px; }
.clear-panels-ui .replacement-help h3 { margin: 0 0 8px; font-size: 15px; }
.clear-panels-ui .replacement-help pre { margin: 10px 0; border: 1px solid var(--line); }
.clear-panels-ui .replacement-help .text-button { margin-top: 8px; }
.clear-panels-ui .replacement-import-area { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 14px; text-align: center; border: 1px dashed #b8caeb; background: var(--workspace-head); border-radius: 9px; }
.clear-panels-ui .replacement-import-area strong { font-size: 15px; font-weight: 600; }
.clear-panels-ui .replacement-import-area p { margin: 0; color: var(--muted); font-size: 13px; }
.clear-panels-ui .replacement-plan-list > div { flex-wrap: wrap; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.clear-panels-ui .replacement-preview-list { padding-left: var(--workspace-pad); padding-right: var(--workspace-pad); }
.clear-panels-ui .replacement-savebar { margin-top: auto; }
.clear-panels-ui .replacement-savebar > span { font-size: 13px; }
.clear-panels-ui .replacement-savebar .replacement-actions { margin-left: auto; }
.clear-panels-ui .records-page .toolbar,
.clear-panels-ui .quota-records .toolbar { border-bottom: 1px solid var(--line); background: var(--workspace-head); }
.clear-panels-ui .recent-task-section .section-head { margin-top: 28px; }
.clear-panels-ui .data-table th { background: var(--workspace-head); }
.clear-panels-ui .account-panel > h2 { margin: -26px -26px 0; padding: 20px 26px; border-bottom: 1px solid var(--line); background: var(--workspace-head); font-size: var(--frontend-section-size); }
.clear-panels-ui .account-panel { padding: 26px; overflow: hidden; }
.clear-panels-ui .account-panel > p { margin-top: 20px; }
.clear-panels-ui .account-panel .form-actions { padding-top: 18px; border-top: 1px solid var(--line); }
.clear-panels-ui .quota-recharge-grid { gap: var(--workspace-gap); }
.clear-panels-ui .quota-redeem-panel,
.clear-panels-ui .quota-guide { border-color: var(--line); }
.clear-panels-ui .help-card h2 { color: var(--ink); }

@media (max-width: 1200px) {
    .clear-panels-ui .processing-plan-select { width: 190px; }
}
@media (max-width: 1000px) {
    .clear-panels-ui .replacement-workspace-grid { grid-template-columns: minmax(0, 1fr); }
    .clear-panels-ui .replacement-support-panel .replacement-help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .clear-panels-ui .replacement-support-panel .workspace-support-note { grid-column: 1 / -1; }
}
@media (min-width: 761px) and (max-width: 980px) {
    .clear-panels-ui .editor-grid,
    .clear-panels-ui .generation-single-grid,
    .clear-panels-ui .generation-grid,
    .clear-panels-ui .batch-panels { grid-template-columns: minmax(0, 1fr); }
    .clear-panels-ui .processing-config-main { flex: 1 1 100%; }
    .clear-panels-ui .points-price { width: 100%; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; justify-content: flex-end; }
}
@media (max-width: 760px) {
    .app-shell.clear-panels-ui { --workspace-pad: 16px; --workspace-gap: 18px; }
    .clear-panels-ui .page-heading h1 { font-size: 25px; }
    .clear-panels-ui .workspace-layout > .content-column { padding: 22px 16px 30px; }
    .clear-panels-ui .tool-workspace { padding-bottom: 0; }
    .clear-panels-ui .editor-grid,
    .clear-panels-ui .generation-single-grid,
    .clear-panels-ui .generation-grid,
    .clear-panels-ui .batch-panels { display: grid; grid-template-columns: minmax(0, 1fr); }
    .clear-panels-ui .mobile-input .editor-pane:nth-child(2),
    .clear-panels-ui .mobile-result .editor-pane:first-child { display: none; }
    .clear-panels-ui .mobile-panes { margin: 0 0 14px; }
    .clear-panels-ui .tool-workspace .editor-actions { position: static; z-index: auto; padding: 0; border: 0; box-shadow: none; background: transparent; }
    .clear-panels-ui .editor-actions .button { min-height: 44px; }
    .clear-panels-ui .pane-head { min-height: 74px; padding-top: 15px; padding-bottom: 15px; }
    .clear-panels-ui .workspace-panel-title { font-size: 17px; }
    .clear-panels-ui .pane-head small { font-size: 12px; }
    .clear-panels-ui .workspace-panel-body > .editor-textarea,
    .clear-panels-ui .workspace-panel-body > .generation-textarea { height: 280px; min-height: 280px; }
    .clear-panels-ui .single-result-pane .result-area,
    .clear-panels-ui .generation-result-pane .result-area { flex: auto; height: 320px; }
    .clear-panels-ui .generation-batch-surface > .generation-actions .editor-actions { width: 100%; margin-left: 0; }
    .clear-panels-ui .processing-config-main { flex: 1 1 100%; gap: 9px 14px; }
    .clear-panels-ui .processing-plan-control { display: flex; flex: 0 1 auto; min-width: 0; gap: 10px; }
    .clear-panels-ui .processing-plan-select { height: 44px; min-width: 0; max-width: 100%; }
    .clear-panels-ui .points-price { width: 100%; margin: 0; border-left: 0; border-top: 1px solid var(--line); padding: 11px 0 0; justify-content: flex-end; }
    .clear-panels-ui .points-price strong { font-size: 18px; }
    .clear-panels-ui .under-editor > .editor-credit { margin-left: 0; }
    .clear-panels-ui .replacement-support-panel .replacement-help-grid { display: flex; }
}
@media (max-width: 600px) {
    .clear-panels-ui .processing-plan-control { width: 100%; }
    .clear-panels-ui .processing-plan-select { flex: 1; width: 0; font-size: 16px; }
    .clear-panels-ui .processing-mode-hint { flex-basis: 100%; }
    .clear-panels-ui .replacement-row { grid-template-columns: 24px minmax(0, 1fr) 40px; gap: 8px; }
    .clear-panels-ui .replacement-preview-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
    .clear-panels-ui .replacement-table-head { display: none; }
    .clear-panels-ui .replacement-row input { font-size: 16px; }
    .clear-panels-ui .single-task-picker select,
    .clear-panels-ui .generation-result-picker select { font-size: 16px; }
    .clear-panels-ui .replacement-savebar > .replacement-actions { width: 100%; }
    .clear-panels-ui .replacement-savebar .button { flex: 1; }
    .clear-panels-ui .pane-head .single-input-stats { max-width: 100%; margin-left: auto; }
}

/* Unified full-width administration; compact groups live inside the full page. */
.admin-layout.admin-unified { grid-template-columns: 200px minmax(0, 1fr); }
.admin-unified > .content-column { width: 100%; max-width: none; padding: 24px 28px 32px; }
.admin-unified > .admin-nav { padding: 22px 10px; gap: 3px; }
.admin-unified .admin-nav button { min-height: 38px; padding: 8px 11px; border-radius: 6px; font-size: 14px; }
.admin-unified .admin-nav-label { margin: 22px 10px 7px; font-size: 12px; }
.admin-unified .admin-nav-label:first-child { margin-top: 3px; }
.admin-unified .page-heading { margin-bottom: 18px; }
.admin-unified .page-heading h1 { font-size: 24px; }
.admin-unified .surface, .admin-unified .flow-step-card { border-radius: 10px; box-shadow: none; }
.admin-unified .admin-surface { padding: 20px; margin-top: 16px; }
.admin-unified .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
.admin-unified .field { gap: 7px; margin: 0; min-width: 0; align-content: start; }
.admin-unified .field > label { font-size: 14px; font-weight: 500; }
.admin-unified .field input:not([type="checkbox"]):not([type="radio"]),
.admin-unified .field select { height: 40px; min-height: 40px; padding: 8px 11px; border-radius: 6px; font-size: 14px; line-height: 1.5; }
.admin-unified .field textarea { min-height: 104px; padding: 9px 11px; border-radius: 5px; font-size: 14px; line-height: 1.6; }
.admin-unified .field input[type="number"] { width: 112px; max-width: 100%; font-variant-numeric: tabular-nums; }
.admin-unified .field input[type="url"] { width: 100%; }
.admin-unified .field input[type="password"], .admin-unified .model-service-card .field input:not([type]) { width: 100%; }

.admin-unified .model-service-card .field input[type="text"] { width: 100%; }
.admin-unified .field select { width: 100%; }
.admin-unified .field-hint, .admin-unified .field .check-line { font-size: 12px; line-height: 1.65; font-weight: 400; }
.admin-unified .field-hint:empty { display: none; }
.admin-unified .field .check-line input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; padding: 0; }
.admin-unified .button { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 6px; }
.admin-unified .button-small, .admin-unified .text-button { min-height: 32px; font-size: 13px; }
.admin-unified .form-section-title { margin: 0; font-size: 16px; }
.admin-unified .admin-help { min-width: 0; padding: 12px 0 0; border-top: 1px solid var(--line); color: #64758c; font-size: 12px; }
.admin-unified .admin-help > summary { cursor: pointer; width: fit-content; max-width: 100%; }
.admin-unified .admin-help p { margin: 9px 0 0; line-height: 1.75; overflow-wrap: anywhere; }
.admin-unified .settings-main-card { padding: 0; margin: 0; }
.admin-unified .settings-block { padding: 20px; }
.admin-unified .settings-block + .settings-block { border-top: 1px solid var(--line); }
.admin-unified .settings-section-heading { font-size: 16px; padding: 0; border: 0; margin: 0 0 16px; }
.admin-unified .settings-primary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-unified .settings-primary-grid .field-hint { max-width: 290px; }
.admin-unified .admin-quota-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.admin-unified .admin-quota-table th, .admin-unified .admin-quota-table td { padding: 8px 8px 8px 0; text-align: left; border-bottom: 1px solid var(--line); font-weight: 400; }
.admin-unified .admin-quota-table thead th { padding-top: 0; color: #64758c; font-size: 13px; }
.admin-unified .admin-quota-table tr:last-child td, .admin-unified .admin-quota-table tbody tr:last-child th { padding-bottom: 0; border-bottom: 0; }
.admin-unified .admin-quota-table th:first-child { width: 40%; }
.admin-unified .admin-settings-group { padding: 0 20px; border-top: 1px solid var(--line); }
.admin-unified .admin-settings-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; list-style: none; cursor: pointer; font-size: 14px; font-weight: 500; }
.admin-unified .admin-settings-group > summary::-webkit-details-marker { display: none; }
.admin-unified .admin-settings-group > summary::after { content: '+'; color: #64758c; font-size: 18px; }
.admin-unified .admin-settings-group[open] > summary::after { content: '−'; }
.admin-unified .settings-advanced-section { padding: 18px 0; border-top: 1px solid var(--line); }
.admin-unified .settings-advanced-section h3 { margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.admin-unified .settings-advanced-section > .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-unified .settings-advanced-section:has(#registration-bonus-enabled) > .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.admin-unified .settings-editor .form-actions { padding: 0; margin: 16px 0 0; border: 0; justify-content: flex-end; }
.admin-unified .settings-editor .form-error:not(:empty) { margin: 12px 0; }
.admin-unified .settings-editor .form-error:empty { display: none; }
.admin-unified .settings-editor #registration-bonus-characters { width: 180px; }
.admin-unified .settings-editor #allow-register { width: 112px; }
.admin-unified .interface-tabs { display: flex; flex-wrap: wrap; gap: 8px 24px; border-bottom: 1px solid var(--line); }
.admin-unified .interface-tab { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 36px; padding: 3px 0 11px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.admin-unified .interface-tab strong { font-size: 14px; font-weight: 500; }
.admin-unified .interface-tab.active { background: transparent; box-shadow: inset 0 -2px var(--brand); }
.admin-unified .interface-tab .interface-service-status { font-size: 11px; padding: 1px 5px; border-radius: 4px; background: #eaf0fa; color: #526783; }
.admin-unified .interface-panel { margin-top: 18px; }
.admin-unified #interface-panel-model { padding: 0; border: 0; background: transparent; }
.admin-unified .model-service-card { margin: 0; padding: 20px; border-radius: 10px; container: admin-model / inline-size; }
.admin-unified .model-service-head { gap: 12px; margin-bottom: 18px; }
.admin-unified .model-service-title { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.admin-unified .model-service-head h3 { font-size: 16px; }
.admin-unified .model-default-badge { padding: 2px 7px; border-radius: 4px; font-size: 12px; }
.admin-unified .model-service-card .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.admin-unified .model-service-card .field { grid-column: auto; }
.admin-unified .model-service-card .field.setting-full { grid-column: 1 / -1; }
.admin-unified .model-service-card .field:has([name="provider_stream"], [data-model-field="stream"]) select { width: 104px; }
.admin-unified .model-key-shared { min-height: 36px; padding: 6px 10px; border-radius: 5px; font-size: 13px; }
.admin-unified .model-key-controls { gap: 7px; }
.admin-unified .model-service-note { margin: 0; padding-top: 12px; }
.admin-unified .interface-advanced { margin: 0; padding-top: 14px; }
.admin-unified .interface-advanced > summary { padding: 0 0 14px; font-size: 14px; }
.admin-unified .interface-pricing-help { margin-top: 16px; }
.admin-unified .interface-save-bar { margin-top: 16px; padding: 0; gap: 12px; border: 0; background: transparent; }
.admin-unified .interface-save-bar .muted { font-size: 12px; }
.admin-unified .workflow-editor { gap: 12px; }
.admin-unified .flow-overview, .admin-unified .flow-generation { padding: 18px 20px; }
.admin-unified .flow-overview h2, .admin-unified .flow-generation h2 { font-size: 16px; }
.admin-unified .flow-mode-tabs { margin: 14px 0 0; gap: 3px; border-radius: 6px; }
.admin-unified .flow-mode-tabs button { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 4px; }
.admin-unified .flow-mode-management { padding: 0; margin: 14px 0; border: 0; background: transparent; }
.admin-unified .flow-mode-fields { grid-template-columns: minmax(0, 300px) minmax(0, 320px); gap: 20px; }
.admin-unified .flow-mode-actions { gap: 8px; margin: 12px 0 0; }
.admin-unified .flow-preview-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 12px; margin: 14px 0; background: #f5f8fd; border-radius: 5px; }
.admin-unified .flow-preview-grid:empty { display: none; }
.admin-unified .flow-preview-step { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; border-radius: 0; font-size: 13px; }
.admin-unified .flow-preview-step > strong { font-size: 12px; font-weight: 500; color: #64758c; }
.admin-unified .flow-preview-step:not(:last-child)::after { content: '→'; margin-left: 6px; color: #8493a8; }
.admin-unified .flow-preview-step.is-off { opacity: .65; }
.admin-unified .flow-source { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; max-width: none; }
.admin-unified .flow-source input { width: 150px; }
.admin-unified .flow-step-card { padding: 13px 18px; }
.admin-unified .flow-step-head { gap: 10px; flex-wrap: wrap; }
.admin-unified .flow-step-head > div { gap: 8px; min-width: 0; flex-wrap: wrap; }
.admin-unified .flow-step-head h2 { font-size: 15px; }
.admin-unified .flow-number { width: 24px; height: 24px; border-radius: 5px; font-size: 13px; }
.admin-unified .flow-provider-name { font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.admin-unified .flow-step-card:not(.is-off) .flow-state { display: none; }
.admin-unified .flow-step-summary { font-size: 12px; margin: 5px 0 0 32px; }
.admin-unified .flow-step-head .flow-step-actions { flex: 0 1 auto; margin-left: auto; gap: 8px; }
.admin-unified .flow-toggle { font-size: 13px; }
.admin-unified .flow-toggle input { width: 30px; height: 18px; }
.admin-unified .flow-toggle input::after { width: 12px; height: 12px; }
.admin-unified .flow-toggle input:checked::after { left: 14px; }
.admin-unified .flow-step-card fieldset { padding-top: 14px; margin-top: 12px; }
.admin-unified .flow-step-fields { grid-template-columns: 140px minmax(170px, 1fr) 160px minmax(210px, 1fr); gap: 16px; }
.admin-unified .flow-language-inputs { grid-template-columns: minmax(0, 1fr) 116px; gap: 7px; }
.admin-unified .flow-service-settings { padding: 14px 0; margin: 14px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.admin-unified .flow-service-settings h3 { margin: 0 0 12px; font-size: 14px; }
.admin-unified .flow-step-card fieldset > .field { margin-top: 14px; }
.admin-unified .flow-prompt-head { gap: 8px; }
.admin-unified .flow-step-management { padding: 12px 18px; gap: 12px; }
.admin-unified .flow-step-management h2 { margin: 0; font-size: 14px; }
.admin-unified .flow-generation h2 { margin: 0 0 14px; }
.admin-unified .flow-save-bar { position: static; padding: 14px 18px; gap: 12px; border-color: var(--line); box-shadow: none; }
.admin-unified .flow-save-bar > span { font-size: 13px; overflow-wrap: anywhere; }


.admin-unified .admin-input-unit { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.admin-unified .admin-input-unit > input { flex: 0 1 auto; }
.admin-unified .admin-input-unit > span, .admin-unified .field-label-note { font-size: 12px; font-weight: 400; color: #64758c; }
.admin-unified .field-label-note { display: inline-block; }
.admin-unified .model-parameters { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: start; }
.admin-unified .model-parameters > .field { flex: 0 1 auto; min-width: 120px; }
.admin-unified .model-parameters input[type="number"] { width: 112px; }
.admin-unified .model-service-head [data-action="model-add"] { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.admin-unified .model-service-card .field select { max-width: none; }
.admin-unified .model-parameters .field:has([name="provider_stream"], [data-model-field="stream"]) select { width: 104px; }

/* Shared frame and control sizes apply to every administration page. */
.admin-unified { --admin-gap: 20px; }
.admin-unified .content-column > * { min-width: 0; }
.admin-unified .stat, .admin-unified .quota-redeem-panel, .admin-unified .quota-guide { padding: 20px; border-radius: 10px; }
.admin-unified .toolbar { padding: 20px; }
.admin-unified .toolbar h2, .admin-unified .quota-guide h2, .admin-unified .quota-redeem-panel h2 { font-size: 16px; }
.admin-unified .toolbar input, .admin-unified .toolbar select { min-height: 40px; height: 40px; font-size: 14px; border-radius: 6px; }
.admin-unified .model-key-shared { min-height: 40px; padding: 8px 11px; }
.admin-unified [data-form="admin-password"] { display: grid; grid-template-columns: repeat(3, minmax(0, 420px)); gap: 20px; max-width: none; }
.admin-unified .form-error:empty { display: none; }
.admin-unified [data-form="admin-password"] > .form-error, .admin-unified [data-form="admin-password"] > .form-actions { grid-column: 1 / -1; margin: 0; }
.admin-unified .settings-block { container: admin-section / inline-size; }
.admin-unified .settings-advanced-section { min-width: 0; }
.admin-unified [data-action="admin-local-mt-check"] { justify-self: start; }
.admin-unified .flow-step-card fieldset > .field, .admin-unified .flow-step-fields > .field { min-width: 0; }

/* Wide pages use available space for related groups, rather than stretching short controls. */
@media (min-width: 1280px) {
    .admin-unified #interface-panel-model > .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
    .admin-unified #interface-panel-model > .settings-grid > .model-service-card { grid-column: auto; }
    .admin-unified #interface-panel-model > .settings-grid > .model-service-card:only-child { grid-column: 1 / -1; }
    .admin-unified .settings-main-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
    .admin-unified .settings-main-card > .settings-block + .settings-block { border-top: 0; border-left: 1px solid var(--line); }
    .admin-unified .settings-main-card > .admin-settings-group { grid-column: 1 / -1; }
    .admin-unified .settings-advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
    .admin-unified .settings-advanced-section > .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-unified .flow-mode-management { display: flex; align-items: end; flex-wrap: wrap; gap: 16px 24px; }
    .admin-unified .flow-mode-fields { flex: 1 1 620px; grid-template-columns: minmax(0, 300px) minmax(0, 320px); }
    .admin-unified .flow-mode-actions { margin: 0; }
    .admin-unified .flow-step-card fieldset { display: grid; grid-template-columns: minmax(380px, .85fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
    .admin-unified .flow-step-card fieldset[hidden] { display: none; }
    .admin-unified .flow-step-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-unified .flow-step-card fieldset > .field { margin: 0; }
    .admin-unified .flow-service-settings { margin: 0; padding: 0 0 0 20px; border-top: 0; border-left: 1px solid var(--line); }
    .admin-unified .flow-service-settings + .field { grid-column: 1 / -1; }
    .admin-unified .flow-step-card textarea { min-height: 144px; }
    .admin-unified .interface-panel:not(#interface-panel-model) > .settings-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .admin-unified .interface-panel:not(#interface-panel-model) > .settings-grid > .field { grid-column: span 3; }
    .admin-unified .interface-panel:not(#interface-panel-model) > .settings-grid > .field.setting-full { grid-column: 1 / -1; }
    .admin-unified #interface-panel-aliyun > .settings-grid > .field:has(#aliyun-engine, #aliyun-source, #aliyun-chunk),
    .admin-unified #interface-panel-baidu > .settings-grid > .field:has(#baidu-general-chunk, #baidu-general-qps, #baidu-general-intervene) { grid-column: span 2; }
    .admin-unified #interface-panel-aliyun > .settings-grid > .field.setting-full:has(input[type="url"]),
    .admin-unified #interface-panel-local > .settings-grid > .field.setting-full:has(input[type="url"], input[type="password"]) { grid-column: span 3; }
    .admin-unified #interface-panel-baidu input[type="url"] { max-width: 900px; }
}
@container admin-model (min-width: 960px) {
    .admin-unified .model-service-card .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-unified .model-service-card .field.setting-full { grid-column: auto; }
    .admin-unified .model-service-card .model-parameters { grid-column: 1 / -1; }
}
@container admin-section (max-width: 590px) {
    .admin-unified .settings-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 1099px) {
    .admin-layout.admin-unified { grid-template-columns: 180px minmax(0, 1fr); }
    .admin-unified .flow-step-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-unified [data-form="admin-password"] { grid-template-columns: minmax(0, 1fr); }
    .admin-unified .settings-primary-grid, .admin-unified .settings-advanced-section > .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .admin-layout.admin-unified { grid-template-columns: minmax(0, 1fr); }
    .admin-unified > .content-column { padding: 18px 16px 26px; }
    .admin-unified > .admin-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .admin-unified .admin-nav-label { display: none; }
    .admin-unified .admin-nav button { width: 100%; padding: 6px 5px; gap: 4px; font-size: 12px; }
    .admin-unified .admin-nav .ui-icon { width: 14px; height: 14px; flex: 0 0 14px; }
    .admin-unified [data-form="admin-password"] { grid-template-columns: minmax(0, 1fr); }
    .admin-unified .flow-step-head .flow-step-actions { width: auto; margin-left: auto; }
    .admin-unified .flow-step-head > div { flex-basis: auto; }
    .admin-unified .flow-step-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-unified .flow-language-inputs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .admin-unified > .content-column { padding: 18px 12px 24px; }
    .admin-unified .admin-surface, .admin-unified .model-service-card, .admin-unified .flow-overview, .admin-unified .flow-generation { padding: 16px; }
    .admin-unified .settings-main-card { padding: 0; margin: 0; }
    .admin-unified .settings-grid, .admin-unified .settings-advanced-section > .settings-grid, .admin-unified .settings-advanced-section:has(#registration-bonus-enabled) > .settings-grid, .admin-unified .flow-mode-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .admin-unified .settings-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .admin-unified .settings-block { padding: 16px; }
    .admin-unified .admin-settings-group { padding: 0 16px; }
    .admin-unified .admin-quota-table th:first-child { width: 32%; }
    .admin-unified .admin-quota-table th, .admin-unified .admin-quota-table td { padding-right: 8px; font-size: 13px; }
    .admin-unified .admin-quota-table th:last-child, .admin-unified .admin-quota-table td:last-child { padding-right: 0; }
    .admin-unified .admin-quota-table input[type="number"] { width: 100%; }
    .admin-unified .interface-tabs { gap: 4px 16px; }
    .admin-unified .interface-tab strong { font-size: 13px; }
    .admin-unified .interface-tab .interface-service-status { display: none; }
    .admin-unified .model-service-card .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .admin-unified .model-service-card .field, .admin-unified .model-service-card .field.setting-full { grid-column: 1 / -1; }
    .admin-unified .interface-save-bar { padding: 0; flex-direction: row; align-items: center; flex-wrap: wrap; }
    .admin-unified .interface-save-bar .muted { flex: 1 1 130px; }
    .admin-unified .flow-step-card { padding: 13px; }
    .admin-unified .flow-step-head > div { flex-basis: 100%; }
    .admin-unified .flow-step-head .flow-step-actions { width: 100%; margin: 4px 0 0; }
    .admin-unified .flow-step-summary { margin-left: 0; }
    .admin-unified .flow-step-card .flow-step-fields { grid-template-columns: minmax(0, 1fr); }
    .admin-unified .flow-language-inputs { grid-template-columns: minmax(0, 1fr) 112px; }
    .admin-unified .flow-prompt-head { flex-wrap: wrap; }
    .admin-unified .flow-step-management { padding: 12px 14px; }
    .admin-unified .flow-save-bar { padding: 14px; align-items: stretch; }
    .admin-unified .flow-save-bar .inline-actions { flex-direction: row; flex-wrap: wrap; }
    .admin-unified .flow-save-bar .button { flex: 1; }
}
@media (max-width: 380px) {
    .admin-unified .settings-primary-grid { grid-template-columns: minmax(0, 1fr); }
    .admin-unified .flow-language-inputs { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse), (max-width: 760px) {
    .admin-unified .field input:not([type="checkbox"]):not([type="radio"]), .admin-unified .field select { height: 44px; min-height: 44px; font-size: 16px; }
    .admin-unified .field textarea { font-size: 16px; }
    .admin-unified .toolbar input, .admin-unified .toolbar select, .admin-unified .button, .admin-unified .model-service-head [data-action="model-add"], .admin-unified .text-button, .admin-unified .interface-tab, .admin-unified .flow-mode-tabs button, .admin-unified .admin-nav button { min-height: 44px; }
    .admin-unified .flow-toggle, .admin-unified .field .check-line, .admin-unified .admin-help > summary { min-height: 44px; display: flex; align-items: center; }
    .admin-unified .admin-help > summary { display: list-item; align-content: center; }
}

/* Frontend type scale stays bounded on wide screens and readable on touch devices. */
@media (max-width: 760px) {
    :root {
        --frontend-title-size: 22px;
        --frontend-section-size: 16px;
        --frontend-card-title-size: 17px;
        --frontend-input-size: 16px;
        --frontend-article-size: 16px;
        --frontend-emphasis-size: 18px;
    }
}

/* Approved full-screen workspace mockup. Authentication and admin remain independent. */
@media (pointer: coarse) {
    :root { --frontend-input-size: 16px; }
}
.app-shell.workspace-ui {
    --workspace-nav: 216px;
    --workspace-pad: 20px;
    --workspace-gap: 16px;
    --workspace-editor-height: clamp(360px, calc(100dvh - 500px), 500px);
    --ink: #172a46;
    --muted: #657796;
    --line: #e0e8f5;
    --line-strong: #d3dff1;
    --brand: #2463ff;
    --brand-dark: #1854e8;
    --workspace-head: #f8faff;
    --soft: #f4f7fc;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #152a43;
}
.workspace-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
.workspace-ui .topbar { height: 64px; min-height: 64px; flex-basis: 64px; padding: 0 28px 0 0; gap: 28px; }
.workspace-ui .brand { align-self: stretch; flex: 0 0 var(--workspace-nav); width: var(--workspace-nav); min-width: 0; gap: 12px; padding: 0 20px; color: #fff; background: #14283f; font-size: 19px; letter-spacing: 0; }
.workspace-ui .brand-mark { width: 38px; height: 38px; }
.workspace-ui .brand > span { min-width: 0; overflow-wrap: anywhere; }
.workspace-ui .topnav { gap: 28px; }
.workspace-ui .topnav a { min-height: 64px; padding: 0 2px; font-size: 14px; }
.workspace-ui .topnav a.active::after { left: 0; right: 0; }
.workspace-ui .avatar { width: 36px; height: 36px; color: #466080; background: #eaf0fa; }
/* Account trigger and grouped menu share the workspace's blue-white palette. */
.topbar .user-trigger {
    width: 152px;
    height: 44px;
    max-width: 100%;
    padding: 6px 10px;
    gap: 10px;
    border: 1px solid #e1e9f7;
    border-radius: 8px;
    color: #203b65;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
}
.topbar .user-trigger .avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #3474ff;
    background: #eaf1ff;
    font-size: 16px;
    font-weight: 600;
}
.topbar .user-display-name { display: block; flex: 1; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user-menu-chevron { display: inline-flex; flex-shrink: 0; color: #7186a5; }
.topbar .user-menu-chevron .ui-icon { width: 14px; height: 14px; }
.topbar .user-menu:hover .user-trigger, .topbar .user-menu:focus-within .user-trigger { border-color: #cddfff; background: #f1f6ff; }
.topbar .user-menu:hover .user-menu-chevron, .topbar .user-menu:focus-within .user-menu-chevron { color: #3474ff; }
.topbar .user-trigger:focus-visible { outline: 2px solid #8baeff; outline-offset: 2px; }
.topbar .user-dropdown {
    width: 246px;
    max-width: calc(100vw - 32px);
    padding: 0;
    border: 1px solid #dce6f5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px #223e6d14, 0 2px 6px #223e6d06;
}
/* Scroll inside the panel so its existing hover bridge remains reachable. */
.topbar .user-dropdown-scroll {
    max-height: calc(100vh - 88px);
    max-height: calc(100dvh - 88px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border-radius: inherit;
    scrollbar-width: thin;
    scrollbar-color: #c6d5ec transparent;
}
.topbar .user-menu-header { display: grid; gap: 3px; padding: 8px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid #e7edf7; }
.topbar .user-menu-header strong { overflow: hidden; color: #203b65; font-size: 14px; font-weight: 650; line-height: 21px; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user-menu-header > span { color: #8796ad; font-size: 12px; line-height: 18px; }
.topbar .user-menu-group { display: grid; gap: 2px; }
.topbar .user-menu-group + .user-menu-group { padding-top: 6px; margin-top: 6px; border-top: 1px solid #e7edf7; }
.topbar .user-dropdown button {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 6px;
    color: #344b6b;
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}
.topbar .user-dropdown .ui-icon { flex-shrink: 0; width: 18px; height: 18px; }
.topbar .user-menu-label { flex: 1; min-width: 0; text-align: left; }
.topbar .user-dropdown button:hover, .topbar .user-dropdown button:focus-visible { color: #2463ff; background: #edf4ff; }
.topbar .user-dropdown button:focus-visible { outline: 2px solid #a3beff; outline-offset: -2px; }
.topbar .user-dropdown .user-menu-logout { color: #d55259; }
.topbar .user-dropdown .user-menu-logout:hover, .topbar .user-dropdown .user-menu-logout:focus-visible { color: #c23e47; background: #fff2f3; }
@media (max-width: 1024px) {
    .topbar .user-trigger { width: 44px; padding: 6px; gap: 0; justify-content: center; }
    .topbar .user-display-name, .topbar .user-menu-chevron { display: none; }
}
@media (pointer: coarse), (max-width: 760px) {
    .topbar .user-dropdown button { min-height: 44px; }
}
.workspace-ui .workspace-layout { width: 100%; max-width: none; grid-template-columns: var(--workspace-nav) minmax(0, 1fr); gap: 0; margin: 0; padding: 0; background: linear-gradient(to right, #152a43 var(--workspace-nav), var(--soft) var(--workspace-nav)); }
.workspace-ui .workspace-layout > .content-column { padding: 22px 30px 28px; }
.workspace-ui .workspace-layout > .side-panel { display: flex; flex-direction: column; position: sticky; top: 64px; align-self: start; height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3c526d #152a43; padding: 28px 12px 24px; border: 0; color: #dce8fa; background: linear-gradient(160deg, #14283f, #132b43 64%, #162f48); box-shadow: inset -1px 0 0 #749ac422; --paper: #152a43; }
@media (min-width: 761px) {
    /* Keep navigation anchored even when the document reaches its footer. */
    .workspace-ui .workspace-layout > .side-panel { position: fixed; left: 0; width: var(--workspace-nav); z-index: 15; }
    .workspace-ui .workspace-layout > .side-panel > * { flex-shrink: 0; }
    .workspace-ui .workspace-layout > .content-column { grid-column: 2; }
}
.workspace-ui .side-heading { display: flex; align-items: center; gap: 14px; color: #9db6d1; margin: 24px 12px 8px; font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: 0; }
.workspace-ui .side-heading::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #6688af70, #6688af10); }
.workspace-ui .side-heading:first-child { margin-top: 4px; }
.workspace-ui .mode-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.workspace-ui .side-panel .mode-button, .workspace-ui .side-panel .account-nav button { position: relative; display: flex; align-items: center; min-height: 50px; width: 100%; gap: 14px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #dce7f5; box-shadow: none; transform: none; font-size: 14px; font-weight: 500; text-align: left; }
.workspace-ui .side-panel .mode-copy strong { color: inherit; font-size: 14px; font-weight: 500; }
.workspace-ui .side-panel .side-nav-label { min-width: 0; white-space: nowrap; }
.workspace-ui .side-panel :is(.mode-button, .account-nav button) .side-nav-symbol { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #648cb333; border-radius: 8px; color: #d5e7fa; background: linear-gradient(145deg, #315779a3, #203e5b9c); box-shadow: inset 0 1px 0 #c6e4ff0c, 0 2px 5px #071a2c1a; }
.workspace-ui .side-panel .ui-icon { width: 21px; height: 21px; flex-shrink: 0; }
.workspace-ui .side-panel .mode-button:hover, .workspace-ui .side-panel .account-nav button:hover { background: #2d4e6d66; border-color: #709bc126; color: #fff; }
.workspace-ui .side-panel .mode-button.active, .workspace-ui .side-panel .account-nav button.active { background: linear-gradient(110deg, #245798, #203f66); border-color: #4e86c466; color: #fff; box-shadow: inset 0 1px 0 #b2d8ff14, 0 3px 10px #071a3026; }
.workspace-ui .side-panel .mode-button.active::before, .workspace-ui .side-panel .account-nav button.active::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 4px; border-radius: 8px 0 0 8px; background: linear-gradient(180deg, #55d4e4, #38add6); }
.workspace-ui .side-panel .mode-button.active .side-nav-symbol, .workspace-ui .side-panel .account-nav button.active .side-nav-symbol { color: #f3faff; border-color: #6ba7eb40; background: linear-gradient(145deg, #3877bd8c, #2b5b967a); }
.workspace-ui .side-panel .mode-button.active strong { color: #fff; }
.workspace-ui .side-panel :is(.mode-button, .account-nav button):focus-visible { outline: 2px solid #88c9ef; outline-offset: 2px; }
.workspace-ui .side-panel .mode-button.active::after { display: none; }
.workspace-ui .side-panel .account-nav { gap: 4px; }
.workspace-ui .side-panel .account-nav[aria-label="帮助支持"] { padding-top: 0; margin-top: 0; border-top: 0; }
/* Sidebar balance card: native gradients and SVG keep the approved design lightweight. */
.workspace-ui .side-credit { position: relative; isolation: isolate; container-type: inline-size; overflow: hidden; margin: auto 2px 0; padding: 16px 14px 14px; flex-shrink: 0; border: 1px solid #3b5e89; border-radius: 13px; background: radial-gradient(ellipse at 100% 0, #347fbf4d, transparent 60%), linear-gradient(135deg, #1b3553, #172e49 55%, #1b3960); box-shadow: inset 0 1px 0 #a6d8ff0d, 0 6px 18px #08182b1a; }
.workspace-ui .side-credit::before, .workspace-ui .side-credit::after { content: ''; position: absolute; z-index: -1; pointer-events: none; border: 1px solid #6bafff24; border-radius: 50%; }
.workspace-ui .side-credit::before { width: 210px; height: 210px; top: -166px; right: -88px; }
.workspace-ui .side-credit::after { width: 170px; height: 170px; top: -144px; right: -66px; }
.workspace-ui .side-credit-heading { display: flex; align-items: center; gap: 9px; color: #b9d6f7; font-size: 13px; font-weight: 500; line-height: 20px; }
.workspace-ui .side-credit-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid #7098c74a; border-radius: 8px; color: #b9ddff; background: linear-gradient(145deg, #375b824d, #27466866); box-shadow: inset 0 1px 0 #d0e8ff0a; }
.workspace-ui .side-credit-icon .ui-icon { width: 20px; height: 20px; }
.workspace-ui .side-credit-balance { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; min-width: 0; margin-top: 12px; }
.workspace-ui .side-credit-balance > strong { min-width: 0; max-width: 100%; margin: 0; color: #fff; font-size: 28px; font-size: clamp(24px, 17cqi, 28px); font-weight: 700; line-height: 1.2; letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.workspace-ui .side-credit-balance > span { color: #96b4d7; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.workspace-ui .side-credit-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid #5c8bc33d; }
.workspace-ui .side-credit .side-credit-recharge { justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 10px; border: 1px solid #528fdd; border-radius: 8px; color: #f5faff; background: linear-gradient(155deg, #3b80ce, #2c60ac 72%, #28579d); box-shadow: inset 0 1px 0 #c8e5ff38, 0 3px 8px #081d3b29; font-size: 13px; font-weight: 600; }
.workspace-ui .side-credit-action-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.workspace-ui .side-credit-action-label .ui-icon { width: 20px; height: 20px; }
.workspace-ui .side-credit-recharge > .ui-icon { width: 15px; height: 15px; transform: rotate(-90deg); }
.workspace-ui .side-credit .side-credit-recharge:hover:not(:disabled) { color: #fff; border-color: #7bb6f5; background: linear-gradient(155deg, #468bd8, #346cbc 72%, #2d60ab); }
.workspace-ui .side-credit .side-credit-recharge:focus-visible { outline: 2px solid #b9ddff; outline-offset: 3px; }
.workspace-ui .site-footer { width: calc(100% - var(--workspace-nav)); margin-left: var(--workspace-nav); padding: 12px 30px; background: var(--soft); font-size: 12px; }
.workspace-ui .page-heading { min-height: 40px; margin: 0 0 16px; gap: 16px; }
.workspace-ui .page-heading h1 { margin: 0; font-size: var(--frontend-title-size); line-height: 1.4; font-weight: 650; letter-spacing: -.5px; }
.workspace-ui .toolbar h2, .workspace-ui .quota-redeem-panel h2, .workspace-ui .quota-guide h2,
.workspace-ui .modal-head h2, .workspace-ui .comparison-pane h3 { font-size: var(--frontend-section-size); }
.workspace-ui .comparison-text { font-size: var(--frontend-article-size); }
.workspace-ui .quota-balance { font-size: 32px; }
.workspace-ui .quota-stat > strong { font-size: 21px; }
.workspace-ui .workspace-notice { height: 44px; min-height: 44px; margin: 0 0 14px; border: 0; border-radius: 8px; background: #e7efff; box-shadow: none; }
.workspace-ui .workspace-notice-label { padding: 0 16px; border-right-color: #d7e4fd; }
.workspace-ui .workspace-notice-track { font-size: 14px; animation-delay: var(--workspace-notice-delay, 0s); }
.workspace-ui .editor-config { min-height: 68px; padding: 12px var(--workspace-pad); margin-bottom: 16px; border-radius: 10px; box-shadow: none; }
.workspace-ui .processing-plan-control {
    position: relative;
    display: flex;
    flex: 0 1 366px;
    align-items: stretch;
    gap: 0;
    width: 366px;
    height: 44px;
    border-radius: 8px;
    background: #eef4ff;
    font-size: 13px;
}
.workspace-ui .processing-plan-control > span {
    display: flex;
    flex: 0 0 96px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: #334d70;
    font-weight: 500;
}
.workspace-ui .processing-plan-control::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 18px;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.5px solid #365376;
    border-bottom: 1.5px solid #365376;
    transform: rotate(45deg);
    pointer-events: none;
}
.workspace-ui .processing-plan-select {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    max-width: none;
    height: 44px;
    min-height: 44px;
    padding: 0 40px 0 16px;
    border: 1px solid #d7e3f6;
    border-radius: 8px;
    color: #203b65;
    background: #fff;
    box-shadow: 0 1px 2px #203b6504;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    appearance: none;
    cursor: pointer;
    opacity: 1;
}
.workspace-ui .processing-plan-select:hover:not(:disabled) { border-color: #9db8eb; }
.workspace-ui .processing-plan-select:focus { border-color: #7297ed; box-shadow: 0 0 0 3px #2463ff12; }
.workspace-ui .processing-plan-select:disabled { color: #657993; background-color: #f9fbff; cursor: default; }
.workspace-ui .processing-plan-control:has(.processing-plan-select:disabled)::after { border-color: #8e9fb6; }
.workspace-ui .editor-grid, .workspace-ui .generation-single-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 16px; }
.workspace-ui .generation-grid, .workspace-ui .batch-panels { gap: 16px; }
.workspace-ui .editor-pane, .workspace-ui .workspace-card, .workspace-ui .generation-compose, .workspace-ui .generation-result-pane, .workspace-ui .generation-grid > .generation-pane { border-radius: 10px; box-shadow: none; }
.workspace-ui .generation-single-grid > *, .workspace-ui .editor-grid > * { min-height: var(--workspace-editor-height); }
.workspace-ui .pane-head { min-height: 60px; padding: 12px var(--workspace-pad); gap: 10px; background: #f8faff; }
.workspace-ui .workspace-panel-title { font-size: var(--frontend-section-size); font-weight: 650; line-height: 1.5; white-space: nowrap; }
.workspace-ui .workspace-panel-title .ui-icon { width: 22px; height: 22px; }
.workspace-ui .workspace-panel-body { padding: 16px var(--workspace-pad) 8px; gap: 14px; min-height: 0; }
.workspace-ui .generation-compose-body { gap: 20px; }
.workspace-ui .generation-title-field { gap: 8px; }
.workspace-ui .generation-title-field input { height: 46px; min-height: 46px; font-size: var(--frontend-input-size); border-radius: 7px; }
.workspace-ui .generation-title-field > label, .workspace-ui .generation-field-head label { color: var(--ink); font-size: 14px; }
.workspace-ui .generation-prompt-body { min-height: 0; }
.workspace-ui .generation-compose .generation-prompt-pane { gap: 8px; }
.workspace-ui .generation-compose .generation-textarea { height: 100%; min-height: 120px; font-size: var(--frontend-input-size); line-height: 1.8; padding: 12px 16px; border-radius: 7px; resize: vertical; }
.workspace-ui .generation-prompt-note { justify-content: flex-end; line-height: 1.3; }
.workspace-ui .generation-prompt-note small { color: #7a8fb0; font-size: 13px; }
.workspace-ui .workspace-panel-body > .editor-textarea, .workspace-ui .workspace-panel-body > .generation-textarea { height: 240px; min-height: 180px; font-size: var(--frontend-input-size); }
.workspace-ui .result-pane-head { justify-content: flex-start; }
.workspace-ui .result-pane-head > .status { font-size: 12px; padding: 3px 8px; white-space: nowrap; }
.workspace-ui .result-pane-head .generation-result-picker, .workspace-ui .result-pane-head .single-task-picker { display: flex; flex: 1 1 200px; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; margin: 0 0 0 auto; padding: 0; }
.workspace-ui .result-pane-head select { width: 100%; max-width: 245px; min-width: 0; flex: 1 1 120px; height: 38px; min-height: 38px; padding: 6px 26px 6px 12px; font-size: 14px; border-radius: 6px; opacity: 1; }
.workspace-ui .result-pane-head .text-button { flex-shrink: 0; font-size: 13px; white-space: nowrap; }
.workspace-ui .result-pane-head .single-task-picker-head { order: 2; margin: 0; }
.workspace-ui .result-pane-head .single-task-picker-head label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.workspace-ui .single-result-pane .result-area, .workspace-ui .generation-result-pane .result-area { flex: 1 1 0; height: auto; min-height: 160px; padding: 8px 4px; border: 0; border-radius: 0; color: #4b5c78; font-size: var(--frontend-article-size); line-height: 1.75; }
.workspace-ui .result-area.has-article::first-line { color: var(--ink); font-size: 18px; font-weight: 600; line-height: 1.4; }
.workspace-ui .single-result-pane .result-placeholder, .workspace-ui .generation-result-pane .result-placeholder { min-height: 180px; padding: 20px 8px; gap: 14px; }
.workspace-ui .result-placeholder .empty-symbol { width: 64px; height: 64px; min-height: 64px; margin-bottom: 6px; border-radius: 16px; background: #edf3ff; }
.workspace-ui .result-placeholder .empty-symbol .ui-icon { width: 32px; height: 32px; }
.workspace-ui .result-placeholder strong { font-size: 16px; line-height: 1.5; font-weight: 650; }
.workspace-ui .result-placeholder > span:last-child { max-width: 100%; font-size: 14px; color: #7a8eaf; }
.workspace-ui .single-task-meta { gap: 4px; }
.workspace-ui .single-task-meta strong { font-size: 14px; }
.workspace-ui .single-task-meta span, .workspace-ui .generation-result-meta { font-size: 12px; color: var(--muted); }
.workspace-ui .result-secondary-actions { gap: 8px 16px; }
.workspace-ui .single-input-pane .pane-head .single-input-stats { line-height: 18px; }
.workspace-ui .single-task-overview { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.workspace-ui .single-task-overview .single-task-meta { flex: 1 1 0; min-width: 0; }
.workspace-ui .single-task-overview .single-task-meta strong { display: block; max-width: 100%; }
.workspace-ui .single-task-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.workspace-ui .single-task-actions .text-button { white-space: nowrap; }
/* Share the header row so the input stays aligned when the result picker wraps. */
@supports (grid-template-rows: subgrid) {
    @media (min-width: 1001px) {
        .workspace-ui .editor-grid,
        .workspace-ui .generation-single-grid { grid-template-rows: auto minmax(0, 1fr) auto; row-gap: 0; }
        .workspace-ui .editor-grid > .editor-pane,
        .workspace-ui .generation-single-grid > .generation-compose,
        .workspace-ui .generation-single-grid > .generation-result-pane { display: grid; grid-row: 1 / span 3; grid-template-rows: subgrid; row-gap: 0; }
        .workspace-ui .editor-grid > .single-input-pane,
        .workspace-ui .generation-single-grid > .generation-compose { grid-column: 1; }
        .workspace-ui .editor-grid > .single-result-pane,
        .workspace-ui .generation-single-grid > .generation-result-pane { grid-column: 2; }
    }
}
@media (max-width: 760px) {
    .workspace-ui .single-task-overview { flex-direction: column; align-items: stretch; gap: 8px; }
    .workspace-ui .single-task-actions { justify-content: flex-end; }
}
.workspace-ui .editor-footer, .workspace-ui .single-result-actions, .workspace-ui .generation-result-actions, .workspace-ui .generation-actions { min-height: 66px; padding: 12px var(--workspace-pad); border-top: 0; gap: 12px; }
.workspace-ui .single-result-actions .pane-tools, .workspace-ui .generation-result-actions { justify-content: flex-end; }
.workspace-ui .single-result-actions [data-action="download-doc"], .workspace-ui .generation-result-actions [data-action="download-doc"] { margin: 0; }
.workspace-ui .pane-bottom .button, .workspace-ui .editor-actions .button { min-height: 44px; padding: 8px 16px; font-size: 14px; border-radius: 7px; }
.workspace-ui .pane-bottom .button-ghost, .workspace-ui .editor-actions .button-ghost { color: #314a6b; border-color: #d3dff1; background: #fff; }
.workspace-ui .button .ui-icon { width: 18px; height: 18px; flex-shrink: 0; }
.workspace-ui .editor-actions .button-primary { min-width: 42%; background: #2463ff; box-shadow: 0 3px 8px #2463ff14; }
.workspace-ui .editor-actions .button-primary:hover:not(:disabled) { background: #1854e8; }
.workspace-ui .editor-actions .button-ghost { min-width: 24%; }
.workspace-ui .under-editor { margin-top: 8px; gap: 5px 16px; font-size: 12px; }
.workspace-ui .workspace-review-note { flex-basis: auto; }
.workspace-ui .recent-task-section { margin-top: 16px; }
.workspace-ui .recent-task-card { border: 1px solid #e1e9f6; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #243f6b04; }
.workspace-ui .recent-task-section .section-head { min-height: 64px; margin: 0; padding: 14px 20px; border-bottom: 1px solid #e4ebf6; }
.workspace-ui .recent-task-section h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: var(--frontend-section-size); font-weight: 650; }
.workspace-ui .recent-task-section h2 .ui-icon { width: 20px; height: 20px; color: var(--brand); }
.workspace-ui .recent-task-section .section-head .text-button { font-size: 13px; }
.workspace-ui .recent-task-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; min-width: 0; }
.workspace-ui .recent-task-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 8px; background: #edf3ff; }
.workspace-ui .recent-task-count { color: #7489a8; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.workspace-ui .recent-task-all { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-weight: 500; }
.workspace-ui .recent-task-all .ui-icon { width: 15px; height: 15px; }
.workspace-ui .recent-task-card .table-scroll { border: 0; border-radius: 0 0 12px 12px; box-shadow: none; }
.workspace-ui .recent-task-card .readable-table th { padding: 12px 16px; font-size: 13px; background: #f7f9fd; color: #627a9e; white-space: nowrap; }
.workspace-ui .recent-task-card .readable-table th:nth-child(1) { width: 19%; }
.workspace-ui .recent-task-card .readable-table th:nth-child(2) { width: 7%; }
.workspace-ui .recent-task-card .readable-table th:nth-child(3) { width: 14%; }
.workspace-ui .recent-task-card .readable-table th:nth-child(4) { width: 8%; }
.workspace-ui .recent-task-card .readable-table th:nth-child(5) { width: 19%; }
.workspace-ui .recent-task-card .readable-table th:nth-child(6) { width: 33%; }
.workspace-ui .recent-task-card .readable-table td:nth-child(n) { padding: 18px 16px; font-size: 14px; vertical-align: middle; border-color: #e8eef7; }
.workspace-ui .recent-task-card .readable-table td > strong { font-size: 14px; font-weight: 500; color: #253e63; }
.workspace-ui .recent-task-card .readable-table tbody > tr:last-child td { border-bottom: 0; }
.workspace-ui .recent-task-card .readable-table tbody > tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.workspace-ui .recent-task-card .readable-table tbody > tr:last-child td:last-child { border-bottom-right-radius: 12px; }
.workspace-ui .recent-task-card tr[data-task-status="processing"] { background: #f7faff; }
.workspace-ui .recent-task-card .readable-table tbody > tr:hover { background: #f5f8fe; }
.workspace-ui .recent-task-card .recent-task-code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.workspace-ui .recent-task-card .record-count { color: #657c9e; white-space: nowrap; }
.workspace-ui .recent-task-card .record-charge strong { overflow-wrap: anywhere; }
.workspace-ui .recent-task-card .readable-table .empty-row { text-align: center; padding: 18px 16px; color: #8193af; }
.workspace-ui .recent-task-card .empty-row::before { content: ''; display: block; width: 18px; height: 22px; border: 2px solid #a4b5cd; border-radius: 3px; margin: 0 auto 8px; background: linear-gradient(#a4b5cd,#a4b5cd) 4px 7px / 8px 1px no-repeat, linear-gradient(#a4b5cd,#a4b5cd) 4px 12px / 6px 1px no-repeat; }
.workspace-ui .recent-task-card .task-times { gap: 1px; color: #657d9f; font-size: 12px; line-height: 20px; }
.workspace-ui .recent-task-card .task-times > div { gap: 6px; }
.workspace-ui .recent-task-card .task-times > div > span:last-child { white-space: nowrap; }
.workspace-ui .recent-task-card .task-row-progress { width: 100%; max-width: 180px; --task-progress-color: #4b8cff; }
.workspace-ui .recent-task-card .task-row-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.workspace-ui .recent-task-card .task-row-status .status { display: inline-flex; gap: 6px; padding: 3px 8px; border: 0; border-radius: 6px; font-size: 12px; font-weight: 400; line-height: 20px; white-space: nowrap; color: #b87e17; background: #fff7e8; }
.workspace-ui .recent-task-card .task-row-status .status::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.workspace-ui .recent-task-card .task-row-status .status-processing { color: #316ff1; background: #eaf1ff; }
.workspace-ui .recent-task-card .task-row-status .status-completed { color: #148666; background: #e8f6ef; }
.workspace-ui .recent-task-card .task-row-status .status-completed_error { color: #b57d20; background: #fff5e3; }
.workspace-ui .recent-task-card .task-row-status .status-error { color: #d34d60; background: #fdefF2; }
.workspace-ui .recent-task-card .task-row-status .status-stopped { color: #697e9f; background: #eef2f8; }
.workspace-ui .recent-task-card .task-row-percent { color: #4b6285; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.workspace-ui .recent-task-card [data-task-status="completed"] .task-row-progress { --task-progress-color: #25a47d; }
.workspace-ui .recent-task-card [data-task-status="completed_error"] .task-row-progress, .workspace-ui .recent-task-card [data-task-status="queued"] .task-row-progress { --task-progress-color: #d5a13c; }
.workspace-ui .recent-task-card [data-task-status="error"] .task-row-progress { --task-progress-color: #dd7687; }
.workspace-ui .recent-task-card [data-task-status="stopped"] .task-row-progress { --task-progress-color: #a0b1cc; }
.workspace-ui .recent-task-card .task-row-progress > progress { display: block; width: 100%; height: 4px; overflow: hidden; border: 0; border-radius: 4px; background: #eaf0f8; color: var(--task-progress-color); appearance: none; }
.workspace-ui .recent-task-card .task-row-progress > progress::-webkit-progress-bar { background: #eaf0f8; border-radius: 4px; }
.workspace-ui .recent-task-card .task-row-progress > progress::-webkit-progress-value { background: var(--task-progress-color); border-radius: 4px; }
.workspace-ui .recent-task-card .task-row-progress > progress::-moz-progress-bar { background: var(--task-progress-color); border-radius: 4px; }
.workspace-ui .recent-task-card .task-row-actions, .workspace-ui .recent-task-card .task-row-links, .workspace-ui .recent-task-card .task-row-controls { display: flex; align-items: center; gap: 10px; }
.workspace-ui .recent-task-card .task-row-links { gap: 12px; }
.workspace-ui .recent-task-card .task-row-controls { gap: 6px; padding-left: 12px; border-left: 1px solid #e0e8f5; }
.workspace-ui .recent-task-card .text-button.task-row-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; min-height: 32px; padding: 4px 0; border: 1px solid transparent; border-radius: 6px; color: #2c67e5; background: transparent; font-size: 13px; font-weight: 500; line-height: 20px; white-space: nowrap; }
.workspace-ui .recent-task-card .task-row-controls .task-row-button { padding: 4px 8px; }
.workspace-ui .recent-task-card .task-row-button .ui-icon { flex: 0 0 14px; width: 14px; height: 14px; }
.workspace-ui .recent-task-card .task-row-button.task-row-download { color: #316ff1; border-color: #cbdcff; background: #f1f6ff; }
.workspace-ui .recent-task-card .task-row-button.task-row-stop { min-width: 65px; color: #b47b17; border-color: #edcf92; background: #fff9ec; }
.workspace-ui .recent-task-card .task-row-button.task-row-delete { color: #d45a69; border-color: #f0c5cc; background: #fff; }
.workspace-ui .recent-task-card .task-row-button:hover:not(:disabled) { background: #eaf1ff; color: #2359d1; }
.workspace-ui .recent-task-card .task-row-stop:hover:not(:disabled) { background: #fff0ce; color: #996411; }
.workspace-ui .recent-task-card .task-row-delete:hover:not(:disabled) { background: #fff0f3; color: #bd3d51; }
.workspace-ui .recent-task-card .task-row-button:focus-visible { outline: 2px solid #88afff; outline-offset: 2px; }
.workspace-ui .recent-task-card .task-row-button:disabled { opacity: 1; cursor: not-allowed; color: #a5b1c5; border-color: #e2e8f1; background: #f6f8fb; }
.workspace-ui .background-notice { margin: 0 0 12px; font-size: 12px; }
.workspace-ui .recent-task-section .info-note { margin: 8px 0 0; font-size: 12px; }
.workspace-ui .batch-summary > div { padding: 12px 0; }
.workspace-ui .workspace-support-note { padding: 12px; }
.workspace-ui .batch-panels .workspace-panel-body { padding-bottom: 16px; }
.workspace-ui .generation-grid > .generation-pane > .workspace-panel-body { min-height: 250px; }
.workspace-ui .generation-batch-surface > .generation-actions { min-height: 66px; margin-top: 16px; padding: 12px 20px; }
@media (min-width: 1001px) {
    .workspace-ui .generation-single-grid, .workspace-ui .editor-grid { align-items: stretch; }
    .workspace-ui .generation-compose-body { flex-basis: 0; }
    .workspace-ui .generation-prompt-body { flex-basis: 0; }
    .workspace-ui .result-panel-body { flex-basis: 0; }
}
@media (max-width: 1200px) and (min-width: 761px) {
    .app-shell.workspace-ui { --workspace-nav: 192px; --workspace-pad: 16px; }
    .workspace-ui .workspace-layout > .content-column { padding: 22px; }
    .workspace-ui .brand { padding: 0 14px; gap: 9px; font-size: 18px; }
    .workspace-ui .topbar { gap: 22px; padding-right: 18px; }
    .workspace-ui .topnav { gap: 20px; }
    .workspace-ui .result-pane-head .generation-result-picker, .workspace-ui .result-pane-head .single-task-picker { flex-basis: 100%; }
    .workspace-ui .result-pane-head select { max-width: none; }
    .workspace-ui .result-placeholder strong { font-size: 16px; }
}
@media (max-width: 1000px) {
    .workspace-ui .editor-grid, .workspace-ui .generation-single-grid, .workspace-ui .generation-grid, .workspace-ui .batch-panels { grid-template-columns: minmax(0, 1fr); }
    .workspace-ui .generation-compose .generation-textarea { height: 190px; }
    .workspace-ui .single-result-pane .result-area, .workspace-ui .generation-result-pane .result-area { height: 320px; flex: auto; }
}
@media (max-height: 950px) and (min-width: 761px) {
    .workspace-ui .workspace-layout > .side-panel { padding-top: 22px; }
    .workspace-ui .side-heading { margin-top: 16px; margin-bottom: 6px; }
    .workspace-ui .side-panel .mode-button, .workspace-ui .side-panel .account-nav button { min-height: 46px; padding-top: 5px; padding-bottom: 5px; gap: 12px; }
    .workspace-ui .side-panel :is(.mode-button, .account-nav button) .side-nav-symbol { width: 34px; height: 34px; flex-basis: 34px; }
}
@media (max-height: 850px) and (min-width: 761px) {
    .workspace-ui .workspace-layout > .side-panel { padding-top: 12px; padding-bottom: 12px; }
    .workspace-ui .side-heading { margin-top: 12px; margin-bottom: 6px; }
    .workspace-ui .side-panel .mode-button, .workspace-ui .side-panel .account-nav button { min-height: 40px; padding-top: 5px; padding-bottom: 5px; gap: 10px; }
    .workspace-ui .side-panel :is(.mode-button, .account-nav button) .side-nav-symbol { width: 28px; height: 28px; flex-basis: 28px; border-radius: 7px; }
    .workspace-ui .side-panel .side-nav-symbol .ui-icon { width: 19px; height: 19px; }
}
@media (max-height: 800px) and (min-width: 761px) {
    .workspace-ui .side-credit { margin-top: 20px; padding: 12px; }
    .workspace-ui .side-credit-heading { gap: 8px; }
    .workspace-ui .side-credit-icon { width: 26px; height: 26px; flex-basis: 26px; border-radius: 7px; }
    .workspace-ui .side-credit-icon .ui-icon { width: 18px; height: 18px; }
    .workspace-ui .side-credit-balance { margin-top: 8px; }
    .workspace-ui .side-credit-footer { margin-top: 10px; padding-top: 10px; }
    .workspace-ui .side-credit .side-credit-recharge { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
}
@media (max-width: 760px) {
    .app-shell.workspace-ui { --workspace-nav: 0px; --workspace-pad: 16px; background: var(--soft); }
    .workspace-ui .topbar { padding: 0 16px; height: 60px; min-height: 60px; flex-basis: 60px; gap: 12px; }
    .workspace-ui .brand { flex: 0 1 auto; align-self: auto; width: auto; padding: 0; color: var(--ink); background: transparent; font-size: 18px; gap: 9px; }
    .workspace-ui .brand-mark { width: 34px; height: 34px; }
    .workspace-ui .topnav { gap: 0; background: #fff; top: 60px; }
    .workspace-ui .topnav a { min-height: 44px; padding: 10px 14px; font-size: 14px; }
    .workspace-ui .workspace-layout { grid-template-columns: minmax(0, 1fr); background: var(--soft); }
    .workspace-ui .workspace-layout > .side-panel { position: static; display: block; height: auto; padding: 12px; overflow: visible; }
    .workspace-ui .side-panel .side-heading { display: none; }
    .workspace-ui .side-panel .mode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .workspace-ui .side-panel .mode-button { min-height: 42px; padding: 8px 10px; }
    .workspace-ui .side-panel .mode-list > .mode-button:last-child { grid-column: 1 / -1; }
    .workspace-ui .side-panel .account-nav { display: flex; flex-wrap: wrap; margin-top: 8px; gap: 4px; }
    .workspace-ui .side-panel .account-nav button { flex: 1 1 120px; width: auto; min-height: 42px; padding: 8px 10px; }
    .workspace-ui .side-panel .account-nav[aria-label="帮助支持"] { margin-top: 4px; padding-top: 0; border: 0; }
    .workspace-ui .side-panel .mode-button, .workspace-ui .side-panel .account-nav button { gap: 8px; padding: 6px 8px; }
    .workspace-ui .side-panel :is(.mode-button, .account-nav button) .side-nav-symbol { width: 28px; height: 28px; flex-basis: 28px; border-radius: 7px; }
    .workspace-ui .side-panel .side-nav-symbol .ui-icon { width: 18px; height: 18px; }
    .workspace-ui .side-credit { display: none; }
    .workspace-ui .workspace-layout > .content-column { padding: 20px 14px 24px; }
    .workspace-ui .site-footer { width: 100%; margin-left: 0; padding: 14px; }
    .workspace-ui .page-heading h1 { font-size: var(--frontend-title-size); }
    .workspace-ui .workspace-notice-label { padding: 0 10px; }
    .workspace-ui .workspace-notice-track { font-size: 13px; }
    .workspace-ui .editor-config { min-height: 64px; padding: 12px 16px; }
    .workspace-ui .processing-plan-control { flex-basis: 100%; width: 100%; }
    .workspace-ui .processing-plan-control > span { flex-basis: 84px; padding: 0 12px; }
    .workspace-ui .processing-plan-control::after { right: 14px; }
    .workspace-ui .processing-plan-select { padding-right: 34px; padding-left: 12px; font-size: 16px; }
    .workspace-ui .pane-head { min-height: 60px; }
    .workspace-ui .result-pane-head .generation-result-picker, .workspace-ui .result-pane-head .single-task-picker { flex-basis: 100%; }
    .workspace-ui .result-pane-head select { max-width: none; min-height: 44px; height: 44px; font-size: 14px; }
    .workspace-ui .workspace-panel-title { font-size: var(--frontend-section-size); }
    .workspace-ui .generation-title-field input, .workspace-ui .generation-compose .generation-textarea { font-size: 16px; }
    .workspace-ui .result-placeholder strong { font-size: 16px; }
    .workspace-ui .result-placeholder > span:last-child { font-size: 13px; }
    .workspace-ui .recent-task-section h2 { gap: 6px; font-size: var(--frontend-section-size); }
    .workspace-ui .recent-task-section .section-head { padding: 12px 16px; gap: 10px; }
    .workspace-ui .pane-bottom .button, .workspace-ui .editor-actions .button { padding: 8px 12px; }
}
@container (max-width: 700px) {
    .workspace-ui .recent-task-card .readable-table td:nth-child(n) { padding: 0; }
    .workspace-ui .recent-task-card .readable-table .empty-row { padding: 12px 0; }
}
@container (max-width: 1320px) {
    .workspace-ui .recent-task-card .readable-table th, .workspace-ui .recent-task-card .readable-table td:nth-child(n) { padding-left: 12px; padding-right: 12px; }
    .workspace-ui .recent-task-card .readable-table th { font-size: 12px; }
    .workspace-ui .recent-task-card .text-button.task-row-button { gap: 4px; font-size: 12px; }
    .workspace-ui .recent-task-card .task-row-controls .task-row-button { padding-left: 6px; padding-right: 6px; }
    .workspace-ui .recent-task-card .task-row-links { gap: 8px; }
    .workspace-ui .recent-task-card .task-row-controls { padding-left: 8px; }
    .workspace-ui .recent-task-card .task-row-stop { min-width: 60px; }
}
@container (max-width: 1040px) {
    .workspace-ui .recent-task-card .readable-table, .workspace-ui .recent-task-card .readable-table tbody { display: block; }
    .workspace-ui .recent-task-card .readable-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .workspace-ui .recent-task-card .readable-table tbody > tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; padding: 18px 20px; border-bottom: 1px solid #e8eef7; }
    .workspace-ui .recent-task-card .readable-table tbody > tr:last-child { border-bottom: 0; }
    .workspace-ui .recent-task-card .readable-table td:nth-child(n) { display: block; width: auto; min-width: 0; padding: 0; border: 0; }
    .workspace-ui .recent-task-card .readable-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #7c8fac; font-size: 12px; font-weight: 400; }
    .workspace-ui .recent-task-card .readable-table .record-primary { grid-column: 1 / 3; grid-row: 1; }
    .workspace-ui .recent-task-card .readable-table .record-status { grid-column: 3; grid-row: 1; }
    .workspace-ui .recent-task-card .readable-table .record-count { grid-column: 1; grid-row: 2; }
    .workspace-ui .recent-task-card .readable-table .record-charge { grid-column: 2; grid-row: 2; }
    .workspace-ui .recent-task-card .readable-table .record-times { grid-column: 3; grid-row: 2; }
    .workspace-ui .recent-task-card .readable-table .record-actions { grid-column: 1 / -1; grid-row: 3; padding-top: 12px; border-top: 1px solid #edf1f8; }
    .workspace-ui .recent-task-card .readable-table td.record-actions::before { display: none; }
    .workspace-ui .recent-task-card .task-row-actions { justify-content: flex-end; }
    .workspace-ui .recent-task-card .text-button.task-row-button { font-size: 13px; }
    .workspace-ui .recent-task-card .readable-table .empty-row { grid-column: 1 / -1; padding: 16px 0; }
}
@container (max-width: 600px) {
    .workspace-ui .recent-task-card .readable-table tbody > tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px 16px; }
    .workspace-ui .recent-task-card .readable-table .record-primary { grid-column: 1 / -1; }
    .workspace-ui .recent-task-card .readable-table .record-status { grid-column: 1 / -1; grid-row: 3; }
    .workspace-ui .recent-task-card .readable-table .record-times { grid-column: 1 / -1; grid-row: 4; }
    .workspace-ui .recent-task-card .readable-table .record-actions { grid-row: 5; }
    .workspace-ui .recent-task-card .task-row-progress { max-width: none; }
    .workspace-ui .recent-task-card .task-row-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px 12px; }
    .workspace-ui .recent-task-card .task-row-links { flex-basis: 100%; gap: 20px; }
    .workspace-ui .recent-task-card .task-row-controls { padding: 0; border: 0; gap: 8px; }
    .workspace-ui .recent-task-card .text-button.task-row-button { min-height: 40px; }
    .workspace-ui .recent-task-card .task-row-controls .task-row-button { min-width: 66px; }
}

/* Keep the four tool composers on the first screen and task records below it. */
@media (min-width: 1001px) {
    .workspace-ui .workspace-first-screen {
        display: flex;
        flex-direction: column;
        min-height: calc(100dvh - 64px - 22px - 16px);
    }
    .workspace-ui .workspace-first-screen > .page-heading,
    .workspace-ui .workspace-first-screen > .workspace-notice,
    .workspace-ui .workspace-first-screen > .under-editor { flex-shrink: 0; }
    .workspace-ui .workspace-first-screen > .surface { display: flex; flex: 1; flex-direction: column; min-height: 0; }
    .workspace-ui .workspace-first-screen .editor-config,
    .workspace-ui .workspace-first-screen .generation-actions { flex-shrink: 0; }
    .workspace-ui .workspace-first-screen .editor-grid,
    .workspace-ui .workspace-first-screen .batch-panels,
    .workspace-ui .workspace-first-screen .generation-single-grid,
    .workspace-ui .workspace-first-screen .generation-grid { flex: 1; align-items: stretch; }
    .workspace-ui .workspace-first-screen .generation-compose .generation-textarea { height: auto; }
    .workspace-ui .workspace-first-screen .generation-grid > .generation-pane > .workspace-panel-body { flex-basis: 0; }
    .workspace-ui .workspace-first-screen .batch-files-panel .workspace-panel-body { flex-basis: 0; min-height: min-content; }
    .workspace-ui .workspace-first-screen .batch-files-panel .dropzone,
    .workspace-ui .workspace-first-screen .batch-files-panel .upload-summary { flex-shrink: 0; }
    .workspace-ui .workspace-first-screen .batch-files-panel .file-list { display: flex; flex: 1; flex-direction: column; min-height: 0; }
    .workspace-ui .workspace-first-screen .batch-files-panel .file-list-scroll { flex: 1 1 0; height: 0; min-height: 120px; max-height: none; overflow: auto; }
}

/* Recharge: approved blue hero and floating redemption card; art is a compact WebP. */
.workspace-ui:has(> .recharge-page) { min-height: 100dvh; }
.workspace-ui .recharge-page > .content-column { display: flex; flex-direction: column; min-height: max(580px, calc(100dvh - 110px)); padding: 26px 28px 18px; }
.workspace-ui .recharge-page .page-heading { flex-shrink: 0; align-items: center; margin-bottom: 20px; }
.recharge-page .page-heading p { margin: 6px 0 0; color: #6b7d98; font-size: 14px; }
.recharge-page .recharge-history-link { display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex-shrink: 0; min-height: 42px; padding: 10px 16px; border: 1px solid #d8e3f3; border-radius: 10px; background: #fff; color: #283e61; box-shadow: 0 3px 7px #123a6b06; font-size: 14px; font-weight: 500; }
.recharge-page .recharge-history-link:hover { border-color: #aec8fc; color: #2463ff; }
.recharge-page .recharge-history-link .ui-icon { width: 18px; height: 18px; }
.recharge-page .recharge-history-link .ui-icon:last-child { width: 14px; }
.recharge-page .recharge-card { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); flex: 1 0 auto; min-height: 460px; gap: 24px; padding: clamp(24px, 2.2vw, 38px); border: 1px solid #ffffffb0; border-radius: 24px; background: radial-gradient(ellipse at 100% 0%, #fff 0%, #e5f0ff 18%, #9ac7fd 33%, #3975c3a6 52%, transparent 70%), radial-gradient(ellipse at 60% 115%, #83b1ed 0, transparent 48%), linear-gradient(115deg, #081d35 2%, #0b284c 34%, #225798 60%, #dfedff 90%); box-shadow: 0 12px 35px #24558c0e, inset 0 1px 1px #ffffff70; }
.recharge-page .recharge-card::before, .recharge-page .recharge-card::after { content: ''; position: absolute; z-index: -1; pointer-events: none; inset: 0; border-radius: inherit; }
.recharge-page .recharge-card::before { background: linear-gradient(155deg, transparent 47%, #579ff911 47.3%, #5dbaff40 48%, transparent 53%), linear-gradient(17deg, transparent 29%, #4eacff50 29.2%, #78b7f52b 31%, transparent 37%), radial-gradient(ellipse at 49% 49%, #76c2ff47, transparent 43%); }
.recharge-page .recharge-card::after { right: 44%; background: linear-gradient(164deg, transparent 57%, #0b22394d 57.2%, #081e3773 65%, transparent 65.4%); opacity: .65; }
.recharge-page .recharge-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: clamp(20px, 2.3vh, 32px) 2px 0; }
.recharge-page .recharge-hero-copy { position: relative; z-index: 2; pointer-events: none; }
.recharge-page .recharge-eyebrow { margin: 0 0 20px; color: #bdd4f6; font-size: 14px; letter-spacing: 3px; }
.recharge-page .recharge-hero h2 { margin: 0; color: #fff; font-size: clamp(32px, 2.65vw, 52px); font-weight: 650; letter-spacing: -.8px; line-height: 1.4; text-shadow: 0 2px 12px #0a244a20; }
.recharge-page .recharge-hero-caption { margin: 18px 0 0; color: #d2e4ff; font-size: 15px; letter-spacing: .5px; }
.recharge-page .recharge-art { position: absolute; z-index: 1; width: 63%; max-width: 425px; right: -15px; bottom: calc(clamp(32px, 3vw, 52px) * 1.25 + 80px); pointer-events: none; }
.recharge-page .recharge-art img { position: relative; display: block; width: 100%; height: auto; filter: drop-shadow(0 20px 20px #0018344d); }
.recharge-page .recharge-art-orbit { position: absolute; width: 80%; height: 80%; left: -5%; top: -5%; border: 1px solid #84c9ff35; border-radius: 50%; outline: 1px solid #84c9ff24; outline-offset: 12px; transform: rotate(-35deg) scaleX(.8); }
.recharge-page .recharge-wallet { position: relative; z-index: 2; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 18px; margin-top: 150px; padding: 19px 20px; border: 1px solid #adcdf42e; border-radius: 16px; color: #fff; background: linear-gradient(115deg, #eff7ff12, #c2dbff29); box-shadow: inset 0 1px 0 #d9eaff0a; backdrop-filter: blur(16px); }
.recharge-page .recharge-wallet::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 1px; background: linear-gradient(90deg, #c8e2ff9c, #d7e9ff30); }
.recharge-page .recharge-wallet-top { flex: 1 1 auto; min-width: 0; }
.recharge-page .recharge-wallet h3 { margin: 0 0 4px; font-size: 13px; font-weight: 400; color: #d9e8fc; }
.recharge-page .quota-balance { margin: 0; color: #fff; font-size: clamp(32px, 3vw, 52px); font-weight: 600; line-height: 1.25; letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.recharge-page .quota-balance > span { display: inline-block; color: #d5e5fb; font-size: 13px; font-weight: 400; letter-spacing: 0; margin-left: 10px; }
.recharge-page .recharge-wallet-link { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 0; margin-left: auto; flex-shrink: 0; border: 0; background: transparent; color: #edf5ff; font-size: 13px; white-space: nowrap; }
.recharge-page .recharge-wallet-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.recharge-page .recharge-wallet-link .ui-icon { width: 15px; height: 15px; }
.recharge-page .recharge-form-panel { position: relative; z-index: 3; display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; min-width: 0; padding: clamp(26px, 3vw, 44px); border: 1px solid #fff; border-radius: 20px; background: linear-gradient(135deg, #fff, #fcfdff); box-shadow: 0 20px 55px #1945781a; }
.recharge-page .recharge-form-heading { display: flex; align-items: center; gap: 18px; margin: 0 0 24px; }
.recharge-page .recharge-icon-tile { display: grid; place-items: center; flex: 0 0 58px; width: 58px; height: 58px; border: 1px solid #e9f1ff; border-radius: 16px; color: #2463ff; background: linear-gradient(135deg, #eef5ff, #e7f0ff); }
.recharge-page .recharge-icon-tile .ui-icon { width: 30px; height: 30px; }
.recharge-page .recharge-form-title { min-width: 0; }
.recharge-page .recharge-form-title h2 { margin: 0 0 6px; color: #15233b; font-size: 22px; font-weight: 650; line-height: 1.4; }
.recharge-page .recharge-form-title p { margin: 0; color: #6d7f99; font-size: 13px; line-height: 1.6; }
.recharge-page .recharge-account-badge { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0 0 24px; padding: 10px 12px; border: 1px solid #e2eaf5; border-radius: 10px; background: #f5f8fc; color: #6a7d9a; font-size: 13px; }
.recharge-page .recharge-account-badge > span:not(.avatar) { flex-shrink: 0; }
.recharge-page .recharge-account-badge .avatar, .recharge-page .recharge-side-account .avatar { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; color: #2463ff; background: linear-gradient(135deg, #d8eaff, #bad7ff); font-size: 15px; }
.recharge-page .recharge-account-badge strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #304461; font-weight: 500; }
.recharge-page [data-form="quota-redeem"] { margin: 0; }
.recharge-page [data-form="quota-redeem"] .field { gap: 8px; margin: 0; }
.recharge-page [data-form="quota-redeem"] label { color: #233551; font-size: 14px; font-weight: 600; }
.recharge-page .recharge-code-control { position: relative; }
.recharge-page .recharge-code-control > .ui-icon { position: absolute; top: 50%; left: 17px; z-index: 1; width: 22px; height: 22px; color: #7185a4; transform: translateY(-50%); pointer-events: none; }
.recharge-page .recharge-code-control input { width: 100%; height: 54px; min-height: 54px; padding: 12px 16px 12px 50px; border: 1px solid #cedcf0; border-radius: 10px; background: #fff; box-shadow: 0 2px 4px #16396705; font-family: inherit !important; font-size: 14px !important; letter-spacing: .2px; }
.recharge-page .recharge-code-control input::placeholder { color: #93a0b5; font-family: inherit; }
.recharge-page .recharge-code-control input:focus { border-color: #5087ff; outline: 0; box-shadow: 0 0 0 3px #3474ff14; }
.recharge-page .recharge-code-control input[aria-invalid="true"] { border-color: #d98484; }
.recharge-page .form-error { min-height: 0; margin: 8px 0 0; color: #bd4545; font-size: 13px; }
.recharge-page .form-error:empty { display: none; }
.recharge-page .recharge-actions { margin-top: 18px; }
.recharge-page .recharge-actions .button { display: flex; justify-content: center; width: 100%; min-height: 50px; gap: 16px; border: 1px solid #276dff; border-radius: 10px; background: linear-gradient(180deg, #287dff, #1057f4); box-shadow: 0 6px 14px #2463ff1c, inset 0 1px 1px #ffffff40; color: #fff; font-size: 16px; font-weight: 600; }
.recharge-page .recharge-actions .button:hover:not(:disabled) { background: linear-gradient(180deg, #1c6df4, #0f4ce0); box-shadow: 0 8px 18px #2463ff30; }
.recharge-page .recharge-actions .ui-icon { width: 20px; height: 20px; }
.recharge-page .recharge-purchase { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 24px; border-top: 1px solid #dce5f2; }
.recharge-page .recharge-purchase > div { flex: 1 1 auto; min-width: 0; }
.recharge-page .recharge-purchase .recharge-icon-tile { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
.recharge-page .recharge-purchase .recharge-icon-tile .ui-icon { width: 24px; height: 24px; }
.recharge-page .recharge-purchase h3 { margin: 0 0 4px; color: #24344e; font-size: 15px; font-weight: 600; line-height: 1.5; }
.recharge-page .recharge-purchase p { margin: 0; color: #7e8ca3; font-size: 12px; line-height: 1.6; }
.recharge-page .quota-get-code { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; min-height: 44px; padding: 10px 14px; border: 1px solid #5685ff; border-radius: 9px; color: #2463ff; background: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.recharge-page .quota-get-code:hover { background: #eef4ff; border-color: #2463ff; }
.recharge-page .quota-get-code .ui-icon { width: 16px; height: 16px; }
.recharge-page .quota-success { align-items: center; gap: 8px; padding: 10px 12px; margin: 14px 0 0; border-radius: 9px; }
.recharge-page .quota-success > div { flex: 1; min-width: 0; }
.recharge-page .quota-success strong, .recharge-page .quota-success p { font-size: 12px; color: #277c60; overflow-wrap: anywhere; }
.recharge-page .quota-success p { margin: 2px 0 0; }
.recharge-page .quota-success .text-button { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 6px 0; font-size: 12px; }
.recharge-page .quota-success .text-button .ui-icon { width: 13px; height: 13px; }
.recharge-page .recharge-form-panel:has(.quota-success) .recharge-form-heading, .recharge-page .recharge-form-panel:has(.quota-success) .recharge-account-badge { margin-bottom: 14px; }
.recharge-page .recharge-form-panel:has(.quota-success) .recharge-purchase { margin-top: 14px; padding-top: 14px; }
.recharge-page .quota-warning, .recharge-page .content-column > .form-error { flex-shrink: 0; padding: 9px 12px; margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.recharge-page .recharge-side-account { display: flex; align-items: center; gap: 12px; margin: auto 10px 0; padding-top: 20px; border-top: 1px solid #2a4360; }
.recharge-page .recharge-side-account .avatar { width: 36px; height: 36px; }
.recharge-page .recharge-side-account > div { min-width: 0; display: grid; gap: 3px; }
.recharge-page .recharge-side-account strong { color: #e8f2ff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.recharge-page .recharge-side-account > div > span { color: #99b0ce; font-size: 12px; }
.recharge-page button:focus-visible, .recharge-page a:focus-visible { outline: 2px solid #74a3ff; outline-offset: 3px; }
@media (min-width: 1600px) and (min-height: 901px) {
    .recharge-page .recharge-form-panel { padding: 42px; }
    .recharge-page .recharge-form-heading { margin-bottom: 32px; }
    .recharge-page .recharge-account-badge { margin-bottom: 30px; }
    .recharge-page .recharge-code-control input { height: 62px; }
    .recharge-page .recharge-actions .button { min-height: 56px; }
    .recharge-page .recharge-purchase { margin-top: 32px; padding-top: 30px; }
}
@media (max-width: 1399px) and (min-width: 1001px) {
    .recharge-page .recharge-card { gap: 22px; padding: 24px; }
    .recharge-page .recharge-form-panel { padding: 26px; }
    .recharge-page .recharge-purchase { gap: 10px; }
    .recharge-page .recharge-purchase > .recharge-icon-tile { display: none; }
    .recharge-page .recharge-wallet { padding: 16px; }
}
@media (max-height: 800px) and (min-width: 1001px) {
    .workspace-ui .recharge-page > .content-column { padding-top: 20px; padding-bottom: 14px; }
    .workspace-ui .recharge-page .page-heading { margin-bottom: 16px; }
    .recharge-page .recharge-card { min-height: 440px; padding: 22px; }
    .recharge-page .recharge-hero { padding-top: 12px; }
    .recharge-page .recharge-eyebrow { margin-bottom: 14px; }
    .recharge-page .recharge-hero h2 { font-size: 34px; }
    .recharge-page .recharge-art { bottom: 116px; width: 58%; }
    .recharge-page .recharge-wallet { padding: 15px 17px; margin-top: 110px; }
    .recharge-page .quota-balance { font-size: 36px; }
    .recharge-page .recharge-form-panel { padding: 24px 28px; }
    .recharge-page .recharge-form-panel:has(.quota-success) { padding-top: 18px; padding-bottom: 18px; }
    .recharge-page .recharge-form-heading, .recharge-page .recharge-account-badge { margin-bottom: 18px; }
    .recharge-page .recharge-purchase { margin-top: 20px; padding-top: 18px; }
}
@media (max-width: 1000px) {
    .workspace-ui .recharge-page > .content-column { padding: 20px; min-height: max(650px, calc(100dvh - 110px)); }
    .recharge-page .recharge-card { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px; min-height: 0; background: radial-gradient(ellipse at 100% 100%, #c1ddff, transparent 60%), linear-gradient(125deg, #0a213e, #16467c); }
    .recharge-page .recharge-hero { display: block; padding: 0; }
    .recharge-page .recharge-hero-copy, .recharge-page .recharge-art { display: none; }
    .recharge-page .recharge-wallet { margin: 0; padding: 16px 20px; }
    .recharge-page .recharge-wallet::before { display: none; }
    .recharge-page .quota-balance { font-size: 32px; }
    .recharge-page .recharge-form-panel { padding: 26px; justify-content: center; }
    .recharge-page .recharge-form-heading, .recharge-page .recharge-account-badge { margin-bottom: 20px; }
}
@media (max-width: 760px) {
    .workspace-ui .recharge-page > .side-panel { padding: 7px 8px; }
    .workspace-ui .recharge-page .account-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0; }
    .workspace-ui .recharge-page .account-nav button { flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 3px 2px; font-size: 12px; white-space: nowrap; }
    .workspace-ui .recharge-page .side-panel .account-nav .side-nav-symbol { width: 22px; height: 22px; flex-basis: 22px; border-radius: 6px; }
    .workspace-ui .recharge-page .account-nav .ui-icon { width: 18px; height: 18px; }
    .workspace-ui .recharge-page > .content-column { height: auto; min-height: 0; padding: 16px 12px 12px; }
    .workspace-ui .recharge-page .page-heading { gap: 8px; margin-bottom: 14px; }
    .recharge-page .page-heading p { font-size: 12px; margin-top: 4px; }
    .recharge-page .recharge-history-link { gap: 5px; min-height: 40px; padding: 8px 10px; font-size: 12px; }
    .recharge-page .recharge-history-link .ui-icon:last-child { display: none; }
    .recharge-page .recharge-card { gap: 12px; padding: 12px; border-radius: 18px; }
    .recharge-page .recharge-wallet { gap: 8px; padding: 10px 12px; border-radius: 10px; }
    .recharge-page .recharge-wallet h3 { font-size: 12px; }
    .recharge-page .quota-balance { font-size: 28px; }
    .recharge-page .quota-balance > span { font-size: 12px; margin-left: 5px; }
    .recharge-page .recharge-wallet-link { min-height: 40px; font-size: 12px; gap: 3px; }
    .recharge-page .recharge-form-panel { padding: 20px 18px; border-radius: 13px; }
    .recharge-page .recharge-form-heading { gap: 12px; margin-bottom: 18px; }
    .recharge-page .recharge-form-title h2 { font-size: 19px; }
    .recharge-page .recharge-form-title p { font-size: 12px; }
    .recharge-page .recharge-icon-tile { flex-basis: 44px; width: 44px; height: 44px; border-radius: 12px; }
    .recharge-page .recharge-icon-tile .ui-icon { width: 26px; height: 26px; }
    .recharge-page .recharge-account-badge { margin-bottom: 18px; padding: 8px 10px; gap: 9px; font-size: 12px; }
    .recharge-page .recharge-code-control input { height: 50px; min-height: 50px; font-size: 16px !important; padding-left: 42px; }
    .recharge-page .recharge-code-control > .ui-icon { left: 13px; width: 20px; }
    .recharge-page .recharge-actions { margin-top: 14px; }
    .recharge-page .recharge-actions .button { min-height: 46px; font-size: 15px; }
    .recharge-page .recharge-purchase { margin-top: 20px; padding-top: 18px; gap: 8px; }
    .recharge-page .recharge-purchase .recharge-icon-tile { display: none; }
    .recharge-page .recharge-purchase h3 { font-size: 13px; }
    .recharge-page .recharge-purchase p { font-size: 12px; }
    .recharge-page .quota-get-code { padding: 8px 10px; font-size: 12px; }
    .recharge-page .recharge-side-account { display: none; }
    .recharge-page .recharge-form-panel:has(.quota-success) { padding-top: 14px; padding-bottom: 14px; }
    .recharge-page .recharge-form-panel:has(.quota-success) .recharge-form-heading, .recharge-page .recharge-form-panel:has(.quota-success) .recharge-account-badge { margin-bottom: 12px; }
    .recharge-page .recharge-form-panel:has(.quota-success) .quota-success { margin-top: 10px; }
    .workspace-ui:has(> .recharge-page) > .site-footer { padding: 8px 12px; gap: 4px 10px; }
}
@media (max-width: 380px), (max-width: 760px) and (max-height: 760px) {
    .workspace-ui .recharge-page > .content-column { padding-top: 12px; }
    .recharge-page .page-heading p { display: none; }
    .recharge-page .recharge-card { padding: 10px; gap: 10px; }
    .recharge-page .recharge-form-panel { padding: 12px; }
    .recharge-page .recharge-form-heading, .recharge-page .recharge-account-badge { margin-bottom: 14px; }
    .recharge-page .recharge-form-title h2 { font-size: 18px; }
    .recharge-page .recharge-form-heading > .recharge-icon-tile { display: none; }
    .recharge-page .recharge-purchase { margin-top: 14px; padding-top: 14px; }
    .recharge-page .recharge-purchase p { max-width: 120px; }
    .recharge-page .quota-success { flex-wrap: wrap; }
}

/* Per-plan billing and shared free-plan controls. */
.admin-unified .free-plan-settings { grid-column: 1 / -1; }
.admin-unified .settings-main-card > .free-plan-settings { border-left: 0; border-top: 1px solid var(--line); }
.admin-unified .free-plan-rules { margin-top: 16px; }
.clear-panels-ui .plan-summary {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 0;
    max-width: 100%;
    min-height: 64px;
    margin-left: auto;
    padding: 12px 18px;
    border: 1px solid #e4ebf8;
    border-radius: 10px;
    background: linear-gradient(105deg, #f0f5ff, #f8faff);
    text-align: left;
}
.plan-summary-identity { display: flex; align-items: center; gap: 10px; padding-right: 22px; flex-shrink: 0; }
.plan-summary-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 36px; color: #3167f4; }
.plan-summary-icon .ui-icon { width: 27px; height: 27px; }
.points-free .plan-summary-icon .ui-icon path:first-child { fill: #e1ebff; }
.plan-summary-badge { display: grid; gap: 4px; min-width: 0; max-width: 180px; }
.plan-summary-badge > strong { color: #2d59bb; font-size: 13px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.plan-summary-badge > span { color: #70829c; font-size: 11px; line-height: 15px; }
.clear-panels-ui .plan-summary .points-price { display: block; min-height: 0; margin: 0; padding: 0; border: 0; text-align: left; color: #70829c; font-size: 11px; line-height: 15px; }
.clear-panels-ui .plan-summary .points-price > span { display: inline; }
.clear-panels-ui .plan-summary .points-price strong { color: #2d59bb; font-size: 11px; font-weight: 600; line-height: inherit; }
.clear-panels-ui .plan-summary .points-unpriced, .plan-summary-badge > .plan-summary-unpriced { color: var(--amber); }
.plan-summary-metrics { display: grid; grid-template-columns: repeat(4, minmax(max-content, 1fr)); align-items: start; margin: 0; }
.plan-summary-metrics > div { position: relative; display: grid; gap: 5px; min-width: 102px; padding: 0 20px; }
.plan-summary-metrics > div::before { content: ''; position: absolute; left: 0; top: 5px; width: 1px; height: 30px; background: #dce5f4; }
.plan-summary-metrics > div:last-child { padding-right: 2px; }
.plan-summary-metrics dt { color: #70829c; font-size: 11px; font-weight: 400; line-height: 15px; white-space: nowrap; }
.plan-summary-metrics dd { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 5px; margin: 0; color: #203b65; font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; font-size: 17px; font-weight: 650; line-height: 21px; font-variant-numeric: tabular-nums; }
.plan-summary-metrics dd.plan-limit-unlimited { font-family: inherit; font-size: 14px; font-weight: 600; }
.plan-summary-metrics dd span { color: #72839b; font-family: 'Microsoft YaHei', sans-serif; font-size: 11px; font-weight: 400; white-space: nowrap; }
@media (max-width: 1200px) {
    .clear-panels-ui .plan-summary { flex: 1 1 100%; width: 100%; margin: 0; padding: 12px 16px; justify-content: space-between; }
    .plan-summary-metrics { flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .plan-summary-metrics > div { min-width: 0; padding: 0 16px; }
}
@media (max-width: 1000px) {
    .clear-panels-ui .plan-summary { align-items: stretch; flex-direction: column; }
    .plan-summary-identity { padding: 0 0 10px; margin-bottom: 12px; border-bottom: 1px solid #dce5f4; }
    .plan-summary-icon { width: 24px; height: 24px; }
    .plan-summary-icon .ui-icon { width: 23px; height: 23px; }
    .plan-summary-badge { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: none; }
    .plan-summary-metrics { width: 100%; }
    .plan-summary-metrics > div:first-child { padding-left: 0; }
    .plan-summary-metrics > div:first-child::before { display: none; }
}
@media (max-width: 600px) {
    .clear-panels-ui .plan-summary { padding: 12px 14px; }
    .plan-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
    .plan-summary-metrics > div { padding: 0 0 0 16px; }
    .plan-summary-metrics > div:nth-child(odd) { padding: 0 12px 0 0; }
    .plan-summary-metrics > div:nth-child(odd)::before { display: none; }
}
@media (min-width: 761px) {
    .admin-unified .flow-mode-fields { flex-basis: 800px; grid-template-columns: minmax(0, 300px) minmax(0, 320px) minmax(100px, 140px); }
    .admin-unified .free-plan-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .admin-unified .free-plan-settings-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Shared frontend palette for tools, personal rules, records and account panels. */
.workspace-ui {
    --workspace-input-fill: linear-gradient(115deg, #2456aa, #3473d8);
    --workspace-output-fill: linear-gradient(115deg, #156c79, #248c94);
    --workspace-submit-fill: linear-gradient(180deg, #3976ce, #2c61b2);
    --workspace-download-fill: linear-gradient(180deg, #388992, #2b757f);
}
.workspace-ui .tool-workspace .processing-plan-control { flex-basis: 390px; width: 390px; background: #183c67; box-shadow: 0 2px 6px #183c670c; }
.workspace-ui .tool-workspace .processing-plan-control > span { flex-basis: 120px; gap: 9px; border-radius: 8px 0 0 8px; background: linear-gradient(120deg, #234e83, #183c67); color: #fff; font-weight: 600; --paper: #214674; }
.workspace-ui .tool-workspace .processing-plan-control > span .ui-icon { flex: 0 0 20px; width: 20px; height: 20px; }
.workspace-ui .tool-workspace .processing-plan-control::after { border-color: #376bb7; }
.workspace-ui .tool-workspace .processing-plan-select { border-color: #6e95d3; border-radius: 0 8px 8px 0; color: #203b65; background: #fff; font-weight: 600; }
.workspace-ui .tool-workspace .processing-plan-select:hover:not(:disabled) { border-color: #346dc7; }
.workspace-ui .tool-workspace .processing-plan-select:focus { border-color: #2b65bd; box-shadow: 0 0 0 3px #3473d824; }
.workspace-ui .tool-workspace .processing-plan-select:disabled { color: #536b8b; background: #f3f7fd; }
.workspace-ui .tool-workspace .processing-plan-control:has(.processing-plan-select:disabled)::after { border-color: #8094af; }
.workspace-ui .tool-workspace .plan-summary { align-items: stretch; padding: 0; border-color: #c5d8f2; background: linear-gradient(105deg, #f1f6ff, #eaf2ff); box-shadow: 0 2px 6px #183c6705; }
.workspace-ui .tool-workspace .plan-summary-identity { align-self: stretch; padding: 11px 16px; margin: 0; gap: 10px; border: 0; border-radius: 9px 0 0 9px; background: linear-gradient(120deg, #234e83, #183c67); }
.workspace-ui .tool-workspace .plan-summary-icon { color: #f1f7ff; }
.workspace-ui .tool-workspace .points-free .plan-summary-icon .ui-icon path:first-child { fill: transparent; }
.workspace-ui .tool-workspace .plan-summary-badge > strong { color: #fff; font-size: 14px; font-weight: 650; }
.workspace-ui .tool-workspace .plan-summary-badge > span, .workspace-ui .tool-workspace .plan-summary .points-price { color: #d8e6fa; font-size: 12px; line-height: 17px; }
.workspace-ui .tool-workspace .plan-summary .points-price strong { color: #fff; font-size: 12px; }
.workspace-ui .tool-workspace .plan-summary .points-unpriced, .workspace-ui .tool-workspace .plan-summary-badge > .plan-summary-unpriced { color: #ffe1a6; }
.workspace-ui .tool-workspace .plan-summary-metrics { align-self: center; align-items: center; padding: 10px 0; }
.workspace-ui .tool-workspace .plan-summary-metrics > div { padding-right: 16px; padding-left: 16px; }
.workspace-ui .tool-workspace .plan-summary-metrics > div::before { height: 30px; background: #c5d8ef; }
.workspace-ui .tool-workspace .plan-summary-metrics > div:first-child::before { display: none; }
.workspace-ui .tool-workspace .plan-summary-metrics dt { color: #506c92; font-size: 12px; line-height: 17px; }
.workspace-ui .tool-workspace .plan-summary-metrics dd { color: #17365e; font-size: 18px; font-weight: 700; line-height: 22px; }
.workspace-ui .tool-workspace .plan-summary-metrics dd.plan-limit-unlimited { font-size: 15px; }
.workspace-ui .tool-workspace .plan-summary-metrics dd span { color: #526f93; font-size: 12px; font-weight: 400; }
.workspace-ui .pane-head { color: #fff; background: var(--workspace-input-fill); border-bottom-color: #2459a9; border-radius: 9px 9px 0 0; --paper: #2860b6; }
.workspace-ui :is(.single-result-pane, .generation-result-pane, .batch-summary-panel, .replacement-support-panel) > .pane-head,
.workspace-ui .tool-workspace .generation-grid > .generation-prompt-pane > .pane-head { background: var(--workspace-output-fill); border-bottom-color: #146c77; --paper: #1b7d87; }
.workspace-ui .pane-head .workspace-panel-title { color: #fff; }
.workspace-ui .pane-head .workspace-panel-title > .ui-icon { width: 32px; height: 32px; padding: 6px; border: 1px solid #ffffff1a; border-radius: 7px; color: #fff; background: #ffffff1c; }
.workspace-ui .pane-head small, .workspace-ui .pane-head .single-points-pending { color: #e2edff; }
.workspace-ui .pane-head .single-input-stats strong { color: #fff; }
.workspace-ui .pane-head .text-button { color: #f1f9ff; border-radius: 6px; }
.workspace-ui .pane-head .text-button:hover:not(:disabled) { color: #fff; background: #ffffff17; }
.workspace-ui .tool-workspace .result-pane-head select { color: #203b59; border-color: #c6e3e6; background-color: #fff; }
.workspace-ui .tool-workspace .result-pane-head select:disabled { color: #607887; background-color: #f1f7f8; }
.workspace-ui .tool-workspace .result-pane-head select:focus { border-color: #a6d9de; box-shadow: 0 0 0 3px #ffffff3d; }
.workspace-ui .tool-workspace .result-pane-head > .status { border: 1px solid #d6e6ee; background: #edf3f8; color: #3a5d77; }
.workspace-ui .tool-workspace .result-pane-head > .status-processing { border-color: #c0e0ff; background: #e8f3ff; color: #275b94; }
.workspace-ui .tool-workspace .result-pane-head > .status-completed { border-color: #b8e3d4; background: #e6f6ee; color: #176b50; }
.workspace-ui .tool-workspace .result-pane-head > :is(.status-completed_error, .status-queued) { border-color: #ead59e; background: #fff4d9; color: #89620c; }
.workspace-ui .tool-workspace .result-pane-head > .status-error { border-color: #edbdc2; background: #fdecef; color: #a3384c; }
.workspace-ui .tool-workspace :is([data-action="single-clear"], [data-action="generation-clear"], [data-action="clear-files"], [data-action="choose-files"]) { color: #365c8a; border: 1px solid #bed1eb; background: #e9f1fc; box-shadow: none; }
.workspace-ui .tool-workspace :is([data-action="single-clear"], [data-action="generation-clear"], [data-action="clear-files"], [data-action="choose-files"]):hover:not(:disabled) { color: #234c82; border-color: #9bb8de; background: #dce9fa; }
.workspace-ui .tool-workspace :is([data-action="single-start"], [data-action="batch-start"], [data-action="generation-start"]) { color: #fff; border: 1px solid #2e64b4; background: var(--workspace-submit-fill); box-shadow: 0 3px 8px #2c61b21c, inset 0 1px 0 #ffffff1c; }
.workspace-ui .tool-workspace :is([data-action="single-start"], [data-action="batch-start"], [data-action="generation-start"]):hover:not(:disabled) { border-color: #275aa4; background: linear-gradient(180deg, #326bc0, #2557a5); box-shadow: 0 4px 10px #2c61b22b; }
.workspace-ui .tool-workspace :is(.single-result-actions, .generation-result-actions) .button { color: #2a6973; border: 1px solid #b7d6d7; background: #e5f2f2; box-shadow: none; }
.workspace-ui .tool-workspace :is(.single-result-actions, .generation-result-actions) .button:hover:not(:disabled) { color: #205b65; border-color: #98c4c9; background: #d7eaea; }
.workspace-ui .tool-workspace :is(.single-result-actions, .generation-result-actions) [data-action="download-doc"] { color: #fff; border-color: #2b757f; background: var(--workspace-download-fill); box-shadow: 0 3px 8px #2b757f1a; }
.workspace-ui .tool-workspace :is(.single-result-actions, .generation-result-actions) [data-action="download-doc"]:hover:not(:disabled) { border-color: #256871; background: linear-gradient(180deg, #307f88, #246771); }
.workspace-ui .tool-workspace .recent-task-card .task-row-download { color: #2a6973; border-color: #b7d6d7; background: #e5f2f2; }
.workspace-ui .tool-workspace .recent-task-card .task-row-download:hover:not(:disabled) { color: #205b65; border-color: #98c4c9; background: #d7eaea; }
.workspace-ui .tool-workspace .generation-batch-status [data-action="download-batch"] { padding: 6px 12px; border: 1px solid #b7d6d7; border-radius: 7px; color: #2a6973; background: #e5f2f2; }
.workspace-ui .tool-workspace :is([data-action="single-clear"], [data-action="generation-clear"], [data-action="clear-files"], [data-action="choose-files"]):disabled,
.workspace-ui .tool-workspace :is(.single-result-actions, .generation-result-actions) .button:disabled,
.workspace-ui .tool-workspace .recent-task-card .task-row-download:disabled { opacity: 1; color: #8595a9; border-color: #dce4ed; background: #f0f4f8; box-shadow: none; }
.workspace-ui .tool-workspace :is([data-action="single-start"], [data-action="batch-start"], [data-action="generation-start"]):disabled { opacity: 1; color: #536c90; border-color: #b9cbe5; background: #c5d5ee; box-shadow: none; }
.workspace-ui .tool-workspace :is(.editor-actions, .pane-bottom, .workspace-panel-footer, .pane-head) :is(button, a):focus-visible { outline: 2px solid #729ad6; outline-offset: 3px; }
.workspace-ui .tool-workspace .pane-head :is(button, a):focus-visible { outline-color: #fff; }
@media (max-width: 1200px) {
    .workspace-ui .tool-workspace .plan-summary { padding: 0; }
    .workspace-ui .tool-workspace .plan-summary-metrics > div { padding-right: 12px; padding-left: 12px; }
}
@media (max-width: 1000px) {
    .workspace-ui .tool-workspace .plan-summary-identity { padding: 10px 14px; border-radius: 9px 9px 0 0; }
    .workspace-ui .tool-workspace .plan-summary-metrics { padding: 12px 2px; }
}
@media (max-width: 760px) {
    .workspace-ui .tool-workspace .processing-plan-control { flex-basis: 100%; width: 100%; }
    .workspace-ui .tool-workspace .processing-plan-control > span { flex-basis: 110px; padding: 0 9px; gap: 7px; }
    .workspace-ui .tool-workspace .processing-plan-control > span .ui-icon { flex-basis: 18px; width: 18px; height: 18px; }
    .workspace-ui .pane-head .workspace-panel-title > .ui-icon { width: 28px; height: 28px; padding: 4px; }
}

/* Apply the same hierarchy to every signed-in frontend section. */
.workspace-ui .records-page .history-surface { padding: 0; }
.workspace-ui .records-page .history-pagination { padding: 16px 22px; }
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar,
.workspace-ui .recent-task-section .section-head,
.workspace-ui .feedback-layout .fb-list > .fb-card-head {
    color: #fff; background: var(--workspace-output-fill); border-bottom-color: #146c77;
}
.workspace-ui .recent-task-section .section-head { border-radius: 11px 11px 0 0; }
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar { margin-bottom: 0; }
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar h2,
.workspace-ui .recent-task-section .section-head h2 { color: #fff; }
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar .muted,
.workspace-ui .recent-task-section .recent-task-count { color: #dceff2; }
.workspace-ui .recent-task-section .recent-task-icon { background: #ffffff1c; border: 1px solid #ffffff1a; }
.workspace-ui .recent-task-section .recent-task-icon .ui-icon { color: #fff; }
.workspace-ui .recent-task-section .recent-task-all { color: #f1f9ff; }
.workspace-ui .recent-task-section .recent-task-all:hover { color: #fff; text-decoration: underline; }
.workspace-ui .replacement-toggle { color: #eef5ff; }
.workspace-ui .replacement-toggle input { accent-color: #183c67; }
.workspace-ui .account-panel > h2 { min-height: 60px; padding-top: 18px; padding-bottom: 18px; color: #fff; border-bottom-color: #2459a9; background: var(--workspace-input-fill); }
.workspace-ui .modal > .modal-head { color: #fff; border-bottom-color: #2459a9; background: var(--workspace-input-fill); }
.workspace-ui .modal > .modal-head h2 { color: #fff; }
.workspace-ui .modal > .modal-head :is(small, .modal-subtitle) { color: #e2edff; }
.workspace-ui .modal > .modal-head .close-button { color: #fff; border-radius: 6px; background: #ffffff17; }
.workspace-ui .modal > .modal-head .close-button:hover { background: #ffffff2b; }
.workspace-ui .modal > .modal-head .close-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.workspace-ui .feedback-layout .fb-work > .fb-card-head { color: #fff; background: var(--workspace-input-fill); border-bottom-color: #2459a9; }
.workspace-ui .feedback-layout .fb-card-head { min-height: 78px; }
.workspace-ui .feedback-layout .fb-card-head h2 { color: #fff; }
.workspace-ui .feedback-layout .fb-card-head p { color: #e0eff7; }
.workspace-ui .feedback-layout .fb-section-icon { color: #fff; }
.workspace-ui .feedback-layout :is(.fb-private, .fb-list-count) { color: #eef7ff; background: #ffffff1c; }
.workspace-ui .feedback-layout .fb-unread-filter { color: #effbfc; border-color: #ffffff4d; background: #ffffff14; }
.workspace-ui .feedback-layout .fb-unread-filter b { color: #fff; background: #ffffff26; }
.workspace-ui .feedback-layout .fb-unread-filter.active { color: #175b65; border-color: #d2ebed; background: #e5f2f2; }
.workspace-ui .feedback-layout .fb-unread-filter.active b { color: #175b65; background: #cde5e8; }
.workspace-ui :is(.records-page, .quota-layout) .toolbar :is(input, select) { color: #203b59; border-color: #c6e3e6; background: #fff; }
.workspace-ui .quota-records .quota-tabs { background: #ffffff1c; }
.workspace-ui .quota-records .quota-tabs button { color: #e2f0f2; }
.workspace-ui .quota-records .quota-tabs button.active { color: #205b65; background: #edf7f8; }

/* Primary/secondary actions share colors; destructive actions retain their meaning. */
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) .button-primary,
.workspace-ui .feedback-layout .button-primary { color: #fff; border: 1px solid #2e64b4; background: var(--workspace-submit-fill); box-shadow: 0 3px 8px #2c61b21c, inset 0 1px 0 #ffffff1c; }
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) .button-primary:hover:not(:disabled),
.workspace-ui .feedback-layout .button-primary:hover:not(:disabled) { border-color: #275aa4; background: linear-gradient(180deg, #326bc0, #2557a5); }
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) :is(.button-ghost, .button-secondary),
.workspace-ui .feedback-layout .button-ghost { color: #365c8a; border: 1px solid #bed1eb; background: #e9f1fc; box-shadow: none; }
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) :is(.button-ghost, .button-secondary):hover:not(:disabled),
.workspace-ui .feedback-layout .button-ghost:hover:not(:disabled) { color: #234c82; border-color: #9bb8de; background: #dce9fa; }
.workspace-ui .replacement-support-panel [data-action="replacement-import"],
.workspace-ui :is(.modal-foot, .replacement-help) :is([data-action="download-batch"], [data-action="replacement-template"]) { color: #fff; border: 1px solid #2b757f; background: var(--workspace-download-fill); box-shadow: 0 3px 8px #2b757f1a; }
.workspace-ui .replacement-help [data-action="replacement-template"] { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 12px; border-radius: 7px; }
.workspace-ui .replacement-support-panel [data-action="replacement-import"]:hover:not(:disabled),
.workspace-ui :is(.modal-foot, .replacement-help) :is([data-action="download-batch"], [data-action="replacement-template"]):hover:not(:disabled) { color: #fff; border-color: #256871; background: linear-gradient(180deg, #307f88, #246771); }
.workspace-ui :is(.records-page, .quota-layout, .modal) .record-actions .text-button,
.workspace-ui .feedback-layout .fb-ticket-actions .text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 9px; border: 1px solid #bed1eb; border-radius: 6px; color: #365c8a; background: #e9f1fc; line-height: 1.6; }
/* Keep rewrite-history download, stop and delete controls together. */
.readable-list .rewrite-history-table th:nth-child(5) { width: calc(38cqw - max(15cqw, 188px)); }
.readable-list .rewrite-history-table th:nth-child(6) { width: max(15cqw, 188px); }
.readable-list .rewrite-history-table .record-actions > .inline-actions { display: flex; flex-wrap: nowrap; gap: 6px; margin-right: 0; }
.readable-list .rewrite-history-table .record-actions .text-button { flex-shrink: 0; white-space: nowrap; }
.workspace-ui :is(.records-page, .quota-layout, .modal) .record-actions .text-button:hover:not(:disabled),
.workspace-ui .feedback-layout .fb-ticket-actions .text-button:hover:not(:disabled) { color: #234c82; border-color: #9bb8de; background: #dce9fa; }
.workspace-ui :is(.records-page, .modal) .record-actions :is([data-action="download-single"], [data-action="download-batch"], [data-action="download-doc"], [data-action="compare-doc"]) { color: #2a6973; border-color: #b7d6d7; background: #e5f2f2; }
.workspace-ui :is(.records-page, .modal) .record-actions :is([data-action="download-single"], [data-action="download-batch"], [data-action="download-doc"], [data-action="compare-doc"]):hover:not(:disabled) { color: #205b65; border-color: #98c4c9; background: #d7eaea; }
.workspace-ui .records-page .record-actions [data-action="stop-task"] { color: #996b1b; border-color: #e5d1a6; background: #fbf4e6; }
.workspace-ui .records-page .record-actions [data-action="stop-task"]:hover:not(:disabled) { color: #805612; border-color: #d5b87e; background: #f5e9d1; }
.workspace-ui .replacement-remove,
.workspace-ui .records-page .record-actions [data-action="delete-task"],
.workspace-ui .feedback-layout .fb-ticket-actions .fb-delete { color: #a45263; border: 1px solid #e9cbd2; background: #fcf2f4; }
.workspace-ui .replacement-remove { min-height: 32px; padding: 4px 0; border-radius: 6px; }
.workspace-ui .replacement-remove:hover:not(:disabled),
.workspace-ui .records-page .record-actions [data-action="delete-task"]:hover:not(:disabled),
.workspace-ui .feedback-layout .fb-ticket-actions .fb-delete:hover:not(:disabled) { color: #8e3d50; border-color: #dbaab6; background: #f6e5ea; }
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar .button,
.workspace-ui .feedback-layout .fb-card-head .text-button { color: #f1f9ff; border: 1px solid #ffffff4d; border-radius: 6px; background: #ffffff17; box-shadow: none; }
.workspace-ui .feedback-layout .fb-card-head .text-button { padding: 5px 9px; }
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar .button:hover:not(:disabled),
.workspace-ui .feedback-layout .fb-card-head .text-button:hover:not(:disabled) { color: #fff; border-color: #ffffff80; background: #ffffff2b; }
.workspace-ui .feedback-layout .fb-card-head .fb-delete { color: #ffe0e5; }
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) :is(.button, .text-button):disabled,
.workspace-ui .feedback-layout :is(.button, .text-button):disabled,
.workspace-ui :is(.records-page, .quota-layout, .modal) .record-actions .text-button:disabled,
.workspace-ui .replacements-layout fieldset:disabled .replacement-remove,
.workspace-ui :is(.records-page .history-surface, .quota-records) > .toolbar .button:disabled { opacity: 1; cursor: not-allowed; color: #8595a9; border-color: #dce4ed; background: #f0f4f8; box-shadow: none; }
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) .button-primary:disabled,
.workspace-ui .feedback-layout .button-primary:disabled { color: #536c90; border-color: #b9cbe5; background: #c5d5ee; }
.workspace-ui :where(.workspace-layout:not(.recharge-page), .modal) :is(.button, .text-button, .table-sort):focus-visible { outline: 2px solid #729ad6; outline-offset: 3px; }
.workspace-ui :is(.pane-head, .toolbar, .section-head, .fb-card-head) :is(button, a, input, select):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) {
    .workspace-ui .replacement-editor > .pane-head { align-items: flex-start; flex-direction: column; }
    .workspace-ui .feedback-layout .fb-ticket-actions > div { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
}

/* Approved usage guide: eight cards on one desktop screen, all artwork is native SVG/CSS. */
.app-shell:has(.usage-cards-page) { --usage-header: 68px; }
.app-shell.workspace-ui:has(.usage-cards-page) { --usage-header: 64px; }
.app-shell .usage-cards-page { max-width: none; width: 100%; margin: 0; background-color: #f4f7fc; font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
.app-shell .usage-cards-page.usage-public { grid-template-columns: minmax(0, 1fr); }
.app-shell .usage-cards-page > .content-column { display: flex; flex-direction: column; padding: 22px 30px 12px; min-width: 0; }
.usage-cards-page .page-heading { flex-shrink: 0; min-height: 44px; margin-bottom: 18px; }
.usage-cards-page .usage-back { min-height: 42px; padding: 8px 16px; color: #2463ff; border-color: #8aacff; background: #fff; font-size: 14px; white-space: nowrap; }
.usage-cards-page .usage-back .ui-icon { width: 19px; height: 19px; }
.usage-cards-page .page-heading h1 { font-size: var(--frontend-title-size); }
.usage-cards-page .usage-grid { display: grid; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(min-content, 1fr)); gap: 32px; min-width: 0; }
.usage-cards-page .usage-card { --usage-card-pad: 20px; position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; padding: var(--usage-card-pad); border: 1px solid #dfe9fa; border-radius: 12px; box-shadow: 0 4px 14px #22478604; background: #fff; overflow: hidden; }
.usage-cards-page .usage-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-shrink: 0; }
.usage-cards-page .usage-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; color: #2463ff; background: linear-gradient(140deg, #eef7ff, #e6f1ff); }
.usage-cards-page .usage-card-icon .ui-icon { width: 31px; height: 31px; stroke-width: 1.8; }
.usage-cards-page .usage-card-number { color: #d1e0fc; font-size: 24px; line-height: 1.5; font-weight: 700; font-variant-numeric: tabular-nums; }
.usage-cards-page .usage-title-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.usage-cards-page .usage-card h2 { min-width: 0; margin: 0; color: #14243f; font-size: var(--frontend-card-title-size); line-height: 1.4; font-weight: 700; }
.usage-cards-page .usage-card p { margin: 0; color: #566d91; font-size: 14px; line-height: 1.6; }
.usage-cards-page .usage-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.usage-cards-page .usage-tags > span, .usage-cards-page .usage-mode-tags > span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 15px; color: #1460f9; border-radius: 10px; background: #eaf3ff; font-size: 14px; font-weight: 650; line-height: 1.4; }
.usage-cards-page .usage-impact-list { display: grid; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.usage-cards-page .usage-impact-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 12px; border-radius: 8px; background: #f0f6ff; color: #355580; font-size: 14px; line-height: 1.5; }
.usage-cards-page .usage-impact-list li::before { content: ''; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #2463ff; }
.usage-cards-page .usage-detection { margin-top: auto; border: 1px solid #e1efff; border-radius: 11px; background: linear-gradient(120deg, #eef6ff, #e9f3ff); }
.usage-cards-page .usage-detection > strong { display: block; padding: 14px 18px; color: #203d67; font-size: 16px; }
.usage-cards-page .usage-detection-result { position: relative; padding: 14px 18px 18px; border-radius: 11px; background: linear-gradient(120deg, #effbf5, #f2fcf9); color: #098c74; }
.usage-cards-page .usage-detection-result > span:first-child { display: block; font-size: 14px; font-weight: 650; }
.usage-cards-page .usage-detection-result b { display: block; margin-top: 3px; font-size: 32px; line-height: 1.3; letter-spacing: -1px; }
.usage-cards-page .usage-result-check { display: inline-flex; align-items: center; justify-content: center; position: absolute; right: 18px; top: 30px; width: 42px; height: 42px; color: #fff; border-radius: 50%; background: linear-gradient(130deg, #8cebb6, #5dd6ac); }
.usage-cards-page .usage-result-check .ui-icon { width: 26px; height: 26px; stroke-width: 2.8; }
.usage-cards-page .usage-trial-badge { flex-shrink: 0; margin-left: auto; padding: 6px 9px; color: #2463ff; background: #eaf3ff; border-radius: 9px; font-size: 12px; line-height: 1.5; font-weight: 600; }
.usage-cards-page .usage-card .usage-feature { color: #1460fa; font-size: var(--frontend-emphasis-size); font-weight: 700; line-height: 1.5; }
.usage-cards-page .usage-card-trial .usage-feature { font-size: 22px; letter-spacing: -.5px; }
.usage-cards-page .usage-card .usage-trial-text { margin-top: 6px; font-size: 16px; }
.usage-cards-page .usage-cost-compare { margin: auto 0 0; border: 1px solid #dce9fc; border-radius: 10px; background: #fff; }
.usage-cards-page .usage-cost-compare > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 15px; background: linear-gradient(100deg, #f3f7ff, #edf4ff); }
.usage-cards-page .usage-cost-compare > div:first-child { border-radius: 9px 9px 0 0; }
.usage-cards-page .usage-cost-compare > div:last-child { border-radius: 0 0 9px 9px; color: #1460fa; background: #fff; }
.usage-cards-page .usage-cost-compare dt { flex-shrink: 0; font-size: 14px; font-weight: 600; }
.usage-cards-page .usage-cost-compare dd { margin: 0; font-size: 14px; white-space: nowrap; }
.usage-cards-page .usage-cost-compare > div:last-child dd { font-size: 20px; font-weight: 700; }
.usage-cards-page .usage-mode-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.usage-cards-page .usage-mode-tags > span { flex: 1; padding: 10px 8px; white-space: nowrap; }
.usage-cards-page .usage-mode-tags .ui-icon { width: 24px; height: 24px; flex-shrink: 0; }
.usage-cards-page .usage-task-flow { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: auto 0 0; padding: 18px 0 0; list-style: none; }
.usage-cards-page .usage-task-flow li { position: relative; display: flex; align-items: center; flex-direction: column; gap: 8px; min-width: 0; color: #4f668a; font-size: 14px; white-space: nowrap; }
.usage-cards-page .usage-task-flow li + li::before { content: '→'; position: absolute; top: 10px; right: calc(100% + 5px); color: #2463ff; font-size: 18px; }
.usage-cards-page .usage-task-flow li > span { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; color: #2463ff; background: #edf5ff; }
.usage-cards-page .usage-task-flow .ui-icon { width: 23px; height: 23px; }
.usage-cards-page .usage-card-background > .usage-feature { margin-bottom: 5px; }
.usage-cards-page .usage-card-scenarios::after, .usage-cards-page .usage-card-trial::after, .usage-cards-page .usage-card-modes::after, .usage-cards-page .usage-card-batch::after { content: ''; position: absolute; z-index: -1; left: -5%; bottom: -80px; width: 125%; height: 170px; border-radius: 50%; transform: rotate(-16deg); background: linear-gradient(120deg, #ecf5ff, #f9fcff); pointer-events: none; }
.usage-cards-page .usage-paper-art { position: relative; align-self: center; width: 152px; height: 138px; min-height: 60px; margin: auto 0 calc(-1 * var(--usage-card-pad) + 12px); pointer-events: none; }
.usage-cards-page .usage-paper { position: absolute; width: 98px; height: 118px; max-height: 100%; bottom: 0; left: 6px; padding: 26px 15px; border: 4px solid #fff; border-radius: 15px; background: linear-gradient(135deg, #e7f3ff, #dfeeff); box-shadow: 0 5px 9px #a1c1f512; overflow: hidden; }
.usage-cards-page .usage-paper i { display: block; height: 7px; margin-bottom: 11px; border-radius: 4px; background: #b6d2ff; }
.usage-cards-page .usage-paper i:last-child { width: 65%; }
.usage-cards-page .usage-paper-art > .ui-icon { position: absolute; right: 0; bottom: 4px; width: 60px; height: 60px; color: #3274ff; stroke-width: 2.8; }
.usage-cards-page .usage-card-modes .usage-paper-art { align-self: flex-end; height: 90px; min-height: 50px; margin-bottom: calc(-1 * var(--usage-card-pad)); }
.usage-cards-page .usage-card-modes .usage-paper { height: 84px; padding-top: 18px; }
.usage-cards-page .usage-card-modes .usage-paper-art > .ui-icon { width: 38px; height: 38px; right: 5px; top: 0; bottom: auto; stroke-width: 1.8; }
.usage-cards-page .usage-gift-art { align-self: flex-end; width: 160px; height: 126px; margin: auto 0 calc(-1 * var(--usage-card-pad) + 8px); flex-shrink: 1; min-height: 50px; pointer-events: none; }
.usage-cards-page .usage-batch-art { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: auto 0 22px; padding-top: 22px; color: #2463ff; }
.usage-cards-page .usage-batch-art > span { display: flex; gap: 4px; padding: 10px 6px; border-radius: 10px; background: #edf5ff; }
.usage-cards-page .usage-batch-art > span .ui-icon { width: 30px; height: 38px; }
.usage-cards-page .usage-batch-art > .ui-icon { flex-shrink: 0; width: 24px; height: 24px; }
.usage-cards-page .usage-batch-art > .ui-icon:last-child { width: 60px; height: 60px; padding: 4px; border-radius: 10px; background: #f0f7ff; }
.app-shell:has(.usage-cards-page) .site-footer { height: 42px; min-height: 42px; flex: 0 0 42px; padding: 8px 30px; border: 0; background: #f4f7fc; font-size: 12px; }
@media (min-width: 1200px) {
    .app-shell .usage-cards-page > .content-column { height: calc(100dvh - var(--usage-header) - 42px); min-height: 580px; }
    .workspace-ui .usage-cards-page > .side-panel { height: calc(100dvh - var(--usage-header) - 42px); padding-bottom: 4px; }
    /* Keep cards compact on tall displays without narrowing the full-width page. */
    .usage-cards-page .usage-grid { min-height: 0; max-height: 692px; grid-template-rows: repeat(2, minmax(0, 1fr)); }
    .usage-cards-page .usage-title-row, .usage-cards-page .usage-card > p, .usage-cards-page .usage-tags, .usage-cards-page .usage-impact-list, .usage-cards-page .usage-detection, .usage-cards-page .usage-cost-compare, .usage-cards-page .usage-mode-tags, .usage-cards-page .usage-task-flow { flex-shrink: 0; }
}
@media (min-width: 1200px) and (max-width: 1499px), (min-width: 1200px) and (max-height: 850px) {
    .app-shell .usage-cards-page > .content-column { padding: 16px 24px 12px; }
    .usage-cards-page .page-heading { min-height: 40px; margin-bottom: 14px; }
    .usage-cards-page .usage-grid { gap: 24px; max-height: 560px; }
    .usage-cards-page .usage-card { --usage-card-pad: 16px; }
    .usage-cards-page .usage-card-head { margin-bottom: 8px; }
    .usage-cards-page .usage-card-icon { width: 36px; height: 36px; border-radius: 10px; }
    .usage-cards-page .usage-card-icon .ui-icon { width: 25px; height: 25px; }
    .usage-cards-page .usage-card-number { font-size: 24px; }
    .usage-cards-page .usage-title-row { margin-bottom: 8px; gap: 6px; }
    .usage-cards-page .usage-card h2 { font-size: var(--frontend-card-title-size); line-height: 1.3; }
    .usage-cards-page .usage-card p { font-size: 14px; line-height: 1.5; }
    .usage-cards-page .usage-tags { gap: 6px; }
    .usage-cards-page .usage-tags > span { padding: 7px 12px; min-height: 34px; font-size: 14px; }
    .usage-cards-page .usage-impact-list { margin-top: 8px; gap: 3px; }
    .usage-cards-page .usage-impact-list li { gap: 8px; padding: 2px 9px; font-size: 14px; }
    .usage-cards-page .usage-detection > strong { padding: 12px 14px; font-size: 16px; }
    .usage-cards-page .usage-detection-result { padding: 12px 14px; }
    .usage-cards-page .usage-detection-result > span:first-child { font-size: 14px; }
    .usage-cards-page .usage-detection-result b { font-size: 32px; }
    .usage-cards-page .usage-result-check { width: 34px; height: 34px; right: 12px; top: 28px; }
    .usage-cards-page .usage-result-check .ui-icon { width: 22px; height: 22px; }
    .usage-cards-page .usage-card .usage-feature { font-size: var(--frontend-emphasis-size); }
    .usage-cards-page .usage-card-trial .usage-feature { font-size: 22px; }
    .usage-cards-page .usage-card .usage-trial-text { font-size: 16px; }
    .usage-cards-page .usage-trial-badge { padding: 5px 7px; font-size: 12px; }
    .usage-cards-page .usage-cost-compare > div { padding: 10px 12px; }
    .usage-cards-page .usage-cost-compare dt, .usage-cards-page .usage-cost-compare dd { font-size: 14px; }
    .usage-cards-page .usage-cost-compare > div:last-child dd { font-size: 20px; }
    .usage-cards-page .usage-mode-tags { gap: 6px; margin-bottom: 14px; }
    .usage-cards-page .usage-mode-tags > span { gap: 5px; padding: 8px 5px; font-size: 14px; }
    .usage-cards-page .usage-mode-tags .ui-icon { width: 19px; height: 19px; }
    .usage-cards-page .usage-task-flow { padding-top: 12px; }
    .usage-cards-page .usage-task-flow li { gap: 6px; font-size: 12px; }
    .usage-cards-page .usage-task-flow li > span { width: 38px; height: 38px; }
    .usage-cards-page .usage-task-flow li + li::before { right: calc(100% + 2px); top: 5px; }
    .usage-cards-page .usage-paper-art { height: 110px; }
    .usage-cards-page .usage-paper { width: 88px; height: 100px; padding: 22px 12px; }
    .usage-cards-page .usage-gift-art { width: 130px; height: 104px; }
    .usage-cards-page .usage-batch-art { gap: 8px; margin-bottom: 18px; padding-top: 16px; }
    .usage-cards-page .usage-batch-art > span { gap: 0; padding: 7px 4px; }
    .usage-cards-page .usage-batch-art > span .ui-icon { width: 24px; height: 32px; }
    .usage-cards-page .usage-batch-art > .ui-icon:last-child { width: 46px; height: 46px; }
}
@media (min-width: 1200px) and (max-height: 850px) {
    .workspace-ui .usage-cards-page > .side-panel { padding-top: 10px; }
    .workspace-ui .usage-cards-page .side-panel .mode-button, .workspace-ui .usage-cards-page .side-panel .account-nav button { min-height: 40px; padding-top: 5px; padding-bottom: 5px; }
    .workspace-ui .usage-cards-page .side-heading { margin-top: 12px; margin-bottom: 8px; }
    .workspace-ui .usage-cards-page .side-heading:first-child { margin-top: 4px; }
    .workspace-ui .usage-cards-page .side-credit { margin-top: auto; padding: 12px; }
    .workspace-ui .usage-cards-page .side-credit-balance { margin-top: 8px; }
    .workspace-ui .usage-cards-page .side-credit-footer { margin-top: 10px; padding-top: 10px; }
}
@media (min-width: 1200px) and (max-height: 760px) {
    .app-shell .usage-cards-page > .content-column { padding: 12px 20px 10px; }
    .usage-cards-page .page-heading { min-height: 38px; margin-bottom: 10px; }
    .usage-cards-page .page-heading h1 { font-size: var(--frontend-title-size); }
    .usage-cards-page .usage-back { min-height: 36px; padding: 6px 12px; font-size: 14px; }
    .usage-cards-page .usage-grid { gap: 20px; max-height: 540px; }
    .usage-cards-page .usage-card { --usage-card-pad: 12px; }
    .usage-cards-page .usage-card-icon { width: 32px; height: 32px; border-radius: 8px; }
    .usage-cards-page .usage-card-icon .ui-icon { width: 23px; height: 23px; }
}
@media (max-width: 1199px) {
    .app-shell .usage-cards-page > .content-column { height: auto; }
    .usage-cards-page .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; gap: 28px; }
    .usage-cards-page .usage-card { min-height: 320px; }
    .usage-cards-page .usage-card h2 { font-size: var(--frontend-card-title-size); }
    .usage-cards-page .usage-card p { font-size: 14px; }
    .usage-cards-page .usage-card-trial .usage-feature { font-size: 22px; }
    .usage-cards-page .usage-card .usage-feature { font-size: var(--frontend-emphasis-size); }
    .usage-cards-page .usage-tags { gap: 7px; }
    .usage-cards-page .usage-tags > span { padding: 8px 12px; }
    .usage-cards-page .usage-detection, .usage-cards-page .usage-cost-compare { margin-top: 14px; }
}
@media (max-width: 900px) {
    .app-shell .usage-cards-page > .content-column { padding: 20px 18px; }
    .usage-cards-page .usage-card { --usage-card-pad: 20px; }
    .usage-cards-page .usage-card-icon { width: 46px; height: 46px; }
    .usage-cards-page .usage-trial-badge { font-size: 12px; padding: 5px 7px; }
    .usage-cards-page .usage-mode-tags { flex-direction: column; }
    .usage-cards-page .usage-cost-compare > div { flex-wrap: wrap; padding: 12px; }
    .usage-cards-page .usage-result-check { display: none; }
    .usage-cards-page .usage-task-flow { gap: 6px; }
    .usage-cards-page .usage-task-flow li { font-size: 12px; }
    .usage-cards-page .usage-task-flow li + li::before { right: calc(100% + 1px); }
    .usage-cards-page .usage-batch-art { gap: 8px; }
    .usage-cards-page .usage-batch-art > span .ui-icon { width: 22px; height: 28px; }
    .usage-cards-page .usage-batch-art > .ui-icon:last-child { width: 42px; height: 42px; }
}
@media (max-width: 600px) {
    .app-shell .usage-cards-page > .content-column { padding: 20px 14px; }
    .usage-cards-page .usage-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .usage-cards-page .usage-card { min-height: 290px; }
    .usage-cards-page .usage-card-reason { min-height: 320px; }
    .usage-cards-page .page-heading { gap: 8px; }
    .usage-cards-page .usage-back { min-height: 44px; padding: 8px 10px; font-size: 13px; }
    .usage-cards-page .usage-card .usage-feature { font-size: var(--frontend-emphasis-size); }
    .usage-cards-page .usage-mode-tags { flex-direction: row; }
    .usage-cards-page .usage-result-check { display: inline-flex; }
    .usage-cards-page .usage-task-flow li { font-size: 14px; }
    .usage-cards-page .usage-task-flow li + li::before { right: calc(100% + 5px); }
    .usage-cards-page .usage-cost-compare > div { flex-wrap: nowrap; }
    .app-shell:has(.usage-cards-page) .site-footer { height: auto; padding: 12px 14px; }
}

/* Workspace announcements live outside the polling-rendered application. */
html.workspace-popup-open { overflow: hidden; }
.workspace-popup { width: min(720px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; margin: auto; border: 1px solid #e2e9f4; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 28px 90px #152a4e33, 0 8px 24px #152a4e14; overflow: hidden; }
.workspace-popup::backdrop { background: #172b4663; backdrop-filter: blur(5px); }
.workspace-popup[open] { display: flex; flex-direction: column; animation: workspace-popup-enter .18s ease-out; }
.workspace-popup-head { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; min-height: 92px; padding: 20px 26px; border-bottom: 1px solid #e8eef8; background: linear-gradient(115deg, #f0f6ff, #fff 75%); }
.workspace-popup-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #dce8fc; border-radius: 13px; color: var(--brand); background: #e7f0ff; }
.workspace-popup-icon svg { width: 23px; height: 23px; }
.workspace-popup-eyebrow { display: block; margin-bottom: 2px; color: #8392aa; font-size: 11px; letter-spacing: 1px; }
.workspace-popup-head h2 { margin: 0; color: #243751; font-size: 19px; line-height: 1.5; font-weight: 650; }
.workspace-popup-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; margin-left: auto; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #7e8da4; cursor: pointer; }
.workspace-popup-close svg { width: 20px; height: 20px; }
.workspace-popup-close:hover { color: #315c9c; border-color: #e0e8f5; background: #edf3fc; }
.workspace-popup-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.workspace-popup-body { min-height: 0; overflow: hidden; }
.workspace-popup-frame { display: block; width: 100%; max-height: calc(100dvh - 144px); border: 0; background: #fff; }
.workspace-popup-frame[hidden] { display: none; }
.workspace-popup-loading { margin: 0; padding: 44px 30px; color: var(--muted); font-size: 14px; text-align: center; }
.admin-unified .settings-main-card > .workspace-popup-settings { grid-column: 1 / -1; min-width: 0; border-left: 0; border-top: 1px solid var(--line); }
.workspace-popup-settings-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 16px; }
.admin-unified .workspace-popup-settings-head .settings-section-heading { margin: 0; }
.workspace-popup-settings-head .check-line { margin: 0; color: #45658e; font-size: 13px; }
.admin-unified .workspace-popup-settings textarea { display: block; width: 100%; min-height: 154px; max-height: 440px; resize: vertical; font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace; }
@keyframes workspace-popup-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 600px) {
    .workspace-popup { width: calc(100vw - 24px); max-height: calc(100dvh - 32px); border-radius: 14px; }
    .workspace-popup-head { min-height: 82px; padding: 16px 18px; gap: 12px; }
    .workspace-popup-frame { max-height: calc(100dvh - 118px); }
}
@media (prefers-reduced-motion: reduce) { .workspace-popup[open] { animation: none; } }
