
:root {
  color-scheme: light;
  --ink: #1d2631;
  --muted: #707c89;
  --muted-dark: #566473;
  --line: #e5e9ed;
  --line-strong: #d6dde3;
  --paper: #fff;
  --canvas: #f5f7f8;
  --sidebar: #fff;
  --accent: #236b61;
  --accent-dark: #19574f;
  --accent-soft: #e8f3f0;
  --blue-soft: #edf3f9;
  --warning: #a46a25;
  --warning-soft: #fff5e8;
  --danger: #a54343;
  --danger-soft: #fff0ef;
  --shadow: 0 12px 32px rgba(23, 44, 53, .055);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: not-allowed; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(35, 107, 97, .27); outline-offset: 2px; }
a { color: var(--accent-dark); }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { margin-bottom: 8px; font-size: clamp(25px, 3vw, 32px); line-height: 1.18; font-weight: 680; }
h2 { margin-bottom: 0; font-size: 19px; line-height: 1.35; font-weight: 660; }
h3 { margin-bottom: 0; font-size: 15px; font-weight: 650; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, .92fr); background: var(--paper); }
.auth-panel { align-self: center; justify-self: center; width: min(420px, calc(100% - 48px)); padding: 46px 0; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: inline-grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: var(--accent); color: white; font-family: Georgia, serif; font-size: 23px; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.15; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.auth-brand { margin-bottom: 72px; }
.auth-copy { margin-bottom: 32px; }
.auth-copy h1 { margin-bottom: 12px; }
.auth-copy > p:last-child { max-width: 390px; margin-bottom: 0; line-height: 1.75; }
.stack-form { display: grid; gap: 19px; }
.stack-form label, .create-user-form label, .generation-form > label { display: grid; gap: 7px; color: var(--muted-dark); font-size: 12px; font-weight: 620; }
.stack-form input, .create-user-form input, .user-edit-form select, .reset-password-form input, .control, .filter-bar input { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; color: var(--ink); background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.stack-form input:focus, .create-user-form input:focus, .user-edit-form select:focus, .reset-password-form input:focus, .control:focus, .filter-bar input:focus, textarea:focus { border-color: #7ba69f; box-shadow: 0 0 0 3px rgba(35, 107, 97, .08); outline: 0; }
.stack-form input { height: 46px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 9px 15px; font-weight: 640; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-secondary { color: var(--muted-dark); border-color: var(--line-strong); background: white; }
.button-secondary:hover:not(:disabled) { border-color: #aab7be; background: #fafbfb; }
.button-quiet { color: var(--muted-dark); background: transparent; }
.button-quiet:hover:not(:disabled) { color: var(--ink); background: var(--canvas); }
.button-small { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.field-hint { color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-aside { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 13vh 10% 36px; color: #eaf1ef; background: #1c3938; }
.auth-aside > div:last-of-type { position: relative; z-index: 1; max-width: 465px; margin: auto 0; }
.auth-aside .eyebrow { color: #a2c8be; }
.auth-aside h2 { margin: 0 0 18px; font-size: clamp(35px, 4.5vw, 55px); font-weight: 580; line-height: 1.2; letter-spacing: -.04em; }
.auth-aside p:not(.eyebrow) { max-width: 370px; color: #c0d0cd; font-size: 15px; line-height: 1.8; }
.aside-foot { position: relative; z-index: 1; margin: 0; color: #9db4b0; font-size: 11px; }
.aside-orbit { position: absolute; top: 11%; right: -8%; width: min(68vw, 570px); aspect-ratio: 1; border: 1px solid rgba(180, 213, 205, .1); border-radius: 50%; }
.aside-orbit::before, .aside-orbit::after { position: absolute; inset: 11%; border: 1px solid rgba(180, 213, 205, .09); border-radius: 50%; content: ""; }
.aside-orbit::after { inset: 23%; }
.aside-orbit span { position: absolute; top: 17%; left: 21%; width: 11px; height: 11px; border-radius: 50%; background: #82b6a8; box-shadow: 0 0 34px #82b6a8; }
.aside-orbit span:nth-child(2) { top: 66%; left: 72%; width: 7px; height: 7px; background: #b2d2c9; }
.aside-orbit span:nth-child(3) { top: 34%; left: 84%; width: 5px; height: 5px; background: #749b94; }
.notice { border-radius: 8px; padding: 11px 13px; font-size: 12px; }
.notice-error { color: #803c37; border: 1px solid #f3d1ce; background: var(--danger-soft); }
.notice-success { color: #25665a; border: 1px solid #d1e7df; background: var(--accent-soft); }
#auth-message { margin: 17px 0 0; }
.auth-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 9px; padding: 4px; background: #f7f9f9; }
.auth-mode-button { min-height: 36px; border: 0; border-radius: 6px; color: var(--muted-dark); background: transparent; font-size: 12px; font-weight: 620; }
.auth-mode-button.active { color: var(--accent-dark); background: white; box-shadow: 0 1px 4px rgba(23, 44, 53, .1); }
.registration-result { display: grid; gap: 12px; border: 1px solid #d1e7df; border-radius: 10px; padding: 18px; background: #f5faf8; }
.registration-result h2 { color: var(--accent-dark); font-size: 18px; }
.registration-result p { margin: 0; color: var(--muted-dark); font-size: 12px; line-height: 1.7; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; display: flex; width: 238px; flex-direction: column; border-right: 1px solid var(--line); padding: 24px 15px 17px; background: var(--sidebar); }
.sidebar-brand { margin: 0 7px 54px; }
.nav-label { margin: 0 9px 10px; color: #9aa4ac; font-size: 10px; font-weight: 720; letter-spacing: .12em; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; width: 100%; align-items: center; gap: 11px; border: 0; border-radius: 7px; padding: 11px 10px; color: var(--muted-dark); background: transparent; text-align: left; font-size: 13px; font-weight: 570; }
.nav-link:hover { color: var(--ink); background: #f6f8f8; }
.nav-link.active { color: var(--accent-dark); background: var(--accent-soft); font-weight: 670; }
.nav-icon { display: inline-grid; width: 20px; color: #86949d; place-items: center; font-size: 16px; }
.nav-link.active .nav-icon { color: var(--accent); }
.sidebar-bottom { display: grid; gap: 9px; margin-top: auto; }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; border-top: 1px solid var(--line); padding: 16px 9px 11px; color: var(--muted-dark); font-size: 11px; }
.sidebar-note small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-link { font-size: 12px; }
.main-column { min-height: 100vh; margin-left: 238px; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; height: 66px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 clamp(20px, 4vw, 58px); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.mobile-brand { display: none; align-items: center; gap: 8px; font-size: 13px; }
.mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 17px; }
.top-status, .account-menu { display: flex; align-items: center; gap: 9px; }
.top-status { color: var(--muted-dark); font-size: 11px; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #b2bbc1; }
.status-dot-ready { background: #4a9c7e; box-shadow: 0 0 0 3px #e6f3ed; }
.status-dot-busy { background: #5184a7; box-shadow: 0 0 0 3px #e8f0f6; }
.status-dot-error { background: #c55a52; box-shadow: 0 0 0 3px #f9e9e7; }
.status-dot-muted { background: #aeb9be; }
.account-menu { gap: 10px; }
.account-name { max-width: 180px; overflow: hidden; color: var(--muted-dark); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.role-pill { border-radius: 20px; padding: 3px 8px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; }
.icon-button { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-dark); background: white; }
.icon-button:hover { color: var(--danger); border-color: #e8c4c0; }
.global-notice { position: relative; z-index: 2; margin: 16px clamp(20px, 4vw, 58px) 0; }
.page-view { width: min(1320px, 100%); margin: 0 auto; padding: 37px clamp(20px, 4vw, 58px) 24px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 35px; }
.page-heading .muted { margin: 0; font-size: 13px; }
.queue-summary { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 15px; background: var(--paper); }
.queue-count { display: grid; min-width: 36px; height: 36px; place-items: center; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); font-size: 17px; font-weight: 700; }
.queue-summary strong, .queue-summary small { display: block; }
.queue-summary strong { font-size: 11px; }
.queue-summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.section-block { margin-bottom: 35px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-title .eyebrow { margin-bottom: 3px; }
.section-title h2 { font-size: 18px; }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.model-card { display: flex; min-height: 190px; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.model-card-active { border-color: #a7c7be; box-shadow: 0 0 0 1px rgba(35, 107, 97, .06); }
.model-card-heading { display: flex; justify-content: space-between; gap: 9px; }
.kind-label { color: var(--accent); font-size: 10px; font-weight: 680; }
.model-card-heading h3 { margin-top: 3px; font-size: 14px; }
.model-state-chip { display: inline-flex; align-items: center; align-self: flex-start; flex: 0 0 auto; border-radius: 20px; padding: 4px 8px; color: var(--muted-dark); background: #f0f2f4; font-size: 10px; font-weight: 630; white-space: nowrap; }
.state-ready, .state-succeeded { color: #25665a; background: var(--accent-soft); }
.state-busy, .state-running { color: #3c688a; background: var(--blue-soft); }
.state-loading, .state-queued { color: #8c6224; background: var(--warning-soft); }
.state-error, .state-failed { color: #963f3d; background: var(--danger-soft); }
.state-cancelled, .state-stopped { color: #687580; background: #eef1f3; }
.model-description { display: -webkit-box; min-height: 40px; margin: 11px 0 12px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.model-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.capability-tag { border: 1px solid #e6eaed; border-radius: 5px; padding: 2px 6px; color: #63717b; background: #fafbfb; font-size: 9px; }
.model-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 13px; }
.resource-label { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workbench-panel { margin-top: 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.workbench-title { padding: 22px 24px 17px; margin: 0; }
.workbench-title h2 { font-size: 20px; }
.readiness-pill { border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; color: var(--muted); font-size: 10px; }
.readiness-ready { color: var(--accent-dark); border-color: #d1e5dd; background: #f0f8f5; }
.work-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); padding: 0 24px; }
.work-tab { position: relative; border: 0; padding: 13px 1px 14px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 620; }
.work-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ""; }
.work-tab:hover { color: var(--ink); }
.work-tab.active { color: var(--accent-dark); }
.work-tab.active::after { background: var(--accent); }
.work-pane { padding: 22px 24px; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; }
.chat-main { min-width: 0; }
.conversation-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.compact-label { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.control-select { appearance: auto; min-width: 120px; min-height: 35px; padding: 6px 9px; font-size: 11px; }
.conversation-label { margin-left: 7px; }
.conversation-select { max-width: 220px; }
.chat-thread { display: flex; height: 330px; flex-direction: column; gap: 15px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; padding: 18px; background: #fbfcfc; }
.empty-thread { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; }
.empty-thread strong { color: var(--muted-dark); font-size: 13px; }
.empty-thread span { font-size: 11px; }
.message-row { max-width: 92%; border-radius: 9px; padding: 11px 13px; }
.message-user { align-self: flex-end; border: 1px solid #d7e8e2; background: #eff7f4; }
.message-assistant { align-self: flex-start; border: 1px solid var(--line); background: white; }
.message-meta { margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.message-content { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-output { font-family: inherit; }
.reasoning-details { margin-top: 10px; color: var(--muted-dark); font-size: 11px; }
.reasoning-details summary, details summary { cursor: pointer; }
.reasoning-details pre { max-height: 240px; overflow: auto; color: var(--muted); white-space: pre-wrap; }
.composer { margin-top: 12px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 12px 8px; background: white; }
.composer textarea, .generation-form textarea { display: block; width: 100%; resize: vertical; border: 0; padding: 3px 2px 9px; color: var(--ink); background: transparent; font-size: 12px; line-height: 1.65; }
.composer textarea:focus, .generation-form textarea:focus { box-shadow: none; }
.composer textarea::placeholder, .generation-form textarea::placeholder { color: #a5afb5; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #eef0f1; padding-top: 8px; }
.composer-tools { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 8px; }
.upload-button { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-dark); font-size: 10px; cursor: pointer; }
.upload-button:hover, .text-button:hover { color: var(--accent-dark); }
.upload-button span { display: grid; width: 19px; height: 19px; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 13px; }
.text-button { border: 0; padding: 3px 5px; color: var(--accent); background: transparent; font-size: 10px; font-weight: 620; }
.danger-text { color: var(--danger); }
.parameter-details { position: relative; color: var(--muted); font-size: 10px; }
.parameter-details summary { padding: 4px 2px; }
.parameter-details[open] { width: 100%; }
.parameter-details .parameter-grid { margin-top: 7px; }
.send-button { min-width: 70px; min-height: 33px; padding: 5px 10px; font-size: 11px; }
.chat-disclaimer { margin: 7px 0 0; }
.conversation-aside { border-left: 1px solid var(--line); padding-left: 17px; }
.aside-heading { display: flex; align-items: center; justify-content: space-between; margin: 1px 0 10px; }
.aside-heading h3 { font-size: 12px; }
.conversation-list { display: grid; gap: 5px; }
.conversation-item { display: grid; gap: 3px; width: 100%; border: 0; border-radius: 7px; padding: 8px; color: var(--ink); background: transparent; text-align: left; }
.conversation-item:hover, .conversation-item.selected { background: #f1f6f4; }
.conversation-item strong { overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item span { color: var(--muted); font-size: 9px; }
.generation-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 25px; }
.generation-form { display: grid; align-content: start; gap: 16px; }
.generation-form textarea { min-height: 110px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 11px; background: white; }
.parameter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.parameter-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.parameter-field { display: grid; align-content: start; gap: 6px; color: var(--muted-dark); font-size: 10px; font-weight: 600; }
.parameter-field .control { min-height: 36px; padding: 7px 9px; font-size: 11px; }
.parameter-field small { color: var(--muted); font-size: 9px; font-weight: 400; }
.parameter-field:has(.checkbox-line) { grid-column: 1 / -1; }
.checkbox-line { display: flex; min-height: 36px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--muted-dark); font-size: 10px; font-weight: 500; }
.checkbox-line input { accent-color: var(--accent); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 4px; }
.form-actions .field-hint { max-width: 260px; margin: 0; }
.generation-output { min-height: 300px; border-left: 1px solid var(--line); padding-left: 23px; }
.output-heading { margin-bottom: 13px; }
.output-heading .eyebrow { margin-bottom: 3px; }
.output-heading h3 { font-size: 13px; }
.media-output { display: grid; min-height: 220px; align-content: start; gap: 12px; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 12px; background: #fbfcfc; }
.empty-output, .empty-state { display: grid; min-height: 90px; align-items: center; justify-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.output-status { margin: 2px 0; color: var(--muted-dark); font-size: 11px; }
.file-previews { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 8px; }
.file-preview { display: grid; max-width: min(100%, 440px); gap: 6px; align-content: start; border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: white; }
.file-preview img { display: block; max-width: 100%; max-height: 420px; border-radius: 5px; object-fit: contain; }
.file-preview video { display: block; width: min(100%, 440px); max-height: 360px; border-radius: 5px; background: #161a1c; }
.file-preview .file-download { justify-self: start; font-size: 10px; }
.file-previews-compact .file-preview { max-width: min(100%, 260px); }
.file-previews-compact .file-preview img { max-height: 180px; }
.file-previews-compact .file-preview video { width: min(100%, 240px); max-height: 170px; }
.media-unavailable { min-height: 36px; }
.task-section { margin: 0; border-top: 1px solid var(--line); padding: 22px 24px 24px; }
.task-section .section-title { margin-bottom: 12px; }
.task-list { display: grid; gap: 9px; }
.task-card { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: white; }
.task-card-head, .history-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-card-head h3 { font-size: 12px; }
.task-meta { margin: -3px 0 0; }
.task-prompt { margin: 0; color: var(--muted-dark); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-result, .history-output { max-height: 300px; overflow: auto; margin: 0; border-radius: 6px; padding: 9px 10px; color: #33414a; background: #f5f7f8; font-family: inherit; font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-error { margin: 0; border-radius: 6px; padding: 9px 10px; color: #873e3a; background: var(--danger-soft); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-cancel { justify-self: end; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; }
.filter-bar > label:not(.search-control) { min-width: 145px; }
.filter-bar input { min-height: 37px; font-size: 11px; }
.search-control { flex: 1 1 230px; }
.filter-bar .control-select { width: 100%; }
.filter-bar .button { min-height: 36px; }
.result-count { margin: 13px 2px; }
.history-list { display: grid; gap: 11px; }
.history-card { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px; background: white; }
.history-info { display: grid; gap: 3px; }
.history-info strong { font-size: 12px; }
.history-info span { font-size: 10px; }
.history-prompt { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-actions { display: flex; justify-content: flex-end; gap: 12px; border-top: 1px solid #eff1f2; padding-top: 7px; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.admin-section { border: 1px solid var(--line); border-radius: 11px; padding: 19px; background: white; }
.admin-section .section-title { margin-bottom: 16px; }
.create-user-form { display: grid; grid-template-columns: 1.15fr 1.2fr .8fr auto; align-items: end; gap: 10px; }
.create-user-form input { min-height: 38px; }
.create-user-form .control-select { min-width: 0; }
.create-user-form .button { min-height: 38px; }
.admin-section > .field-hint { margin: 10px 0 14px; }
.users-list { display: grid; gap: 9px; }
.user-card { display: grid; grid-template-columns: minmax(135px, .7fr) minmax(280px, 1.4fr) minmax(250px, 1.3fr); align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 8px; padding: 11px; }
.user-summary { display: grid; gap: 4px; min-width: 0; }
.user-summary strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-summary span { font-size: 9px; }
.user-status { justify-self: start; border-radius: 20px; padding: 2px 8px; color: var(--muted-dark); background: #eef1f3; font-size: 9px !important; font-weight: 650; }
.user-status-active { color: var(--accent-dark); background: var(--accent-soft); }
.user-status-pending { color: #765722; background: #fff0d3; }
.user-status-closed, .user-status-disabled { color: #687580; background: #eef1f3; }
.user-card-pending { border-color: #ead7b6; background: #fffdf8; }
.user-card-closed { background: #f9fafb; }
.user-edit-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.user-edit-form > label:first-child { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.user-edit-form select { min-width: 108px; min-height: 32px; padding: 5px 7px; font-size: 10px; }
.active-toggle { display: flex; align-items: center; gap: 5px; padding-bottom: 8px; color: var(--muted-dark); font-size: 10px; white-space: nowrap; }
.active-toggle input { accent-color: var(--accent); }
.user-edit-form .field-hint { flex: 1 0 100%; }
.user-protection-note { flex-basis: 100%; margin: 0; line-height: 1.6; }
.reset-password-form { display: flex; gap: 7px; }
.reset-password-form input { min-width: 0; min-height: 33px; padding: 6px 8px; font-size: 10px; }
.user-actions { display: grid; min-width: 0; gap: 8px; }
.reset-password-form input { flex: 1 1 auto; }
.app-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin: 16px clamp(20px, 4vw, 58px) 0; padding: 14px 0 22px; color: #9aa4ac; font-size: 9px; }
.noscript { margin: 20px; border: 1px solid #e8c4c0; border-radius: 8px; padding: 12px; color: var(--danger); background: var(--danger-soft); }

@media (max-width: 1120px) {
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-card { grid-template-columns: minmax(120px, .7fr) minmax(240px, 1.3fr); }
  .user-actions { grid-column: 2; }
}
@media (max-width: 860px) {
  .sidebar { width: 202px; }
  .main-column { margin-left: 202px; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .conversation-aside { border-top: 1px solid var(--line); border-left: 0; padding: 13px 0 0; }
  .conversation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generation-layout { grid-template-columns: minmax(0, 1fr); }
  .generation-output { border-top: 1px solid var(--line); border-left: 0; padding: 17px 0 0; }
}
@media (max-width: 640px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-panel { width: min(420px, calc(100% - 40px)); padding: 34px 0 39px; }
  .auth-brand { margin-bottom: 43px; }
  .auth-aside { display: none; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .sidebar-brand, .nav-label, .sidebar-note { display: none; }
  .main-nav { display: flex; gap: 3px; }
  .nav-link { width: auto; gap: 6px; padding: 8px 9px; font-size: 10px; }
  .nav-icon { width: auto; font-size: 14px; }
  .sidebar-bottom { display: block; margin: 0; }
  .logout-link { width: 34px; height: 34px; justify-content: center; overflow: hidden; padding: 0; font-size: 0; }
  .logout-link .nav-icon { font-size: 16px; }
  .main-column { margin-left: 0; }
  .topbar { position: static; height: 53px; padding: 0 13px; }
  .mobile-brand { display: flex; }
  .top-status { gap: 5px; font-size: 9px; }
  .status-dot { width: 7px; height: 7px; flex-basis: 7px; }
  .account-menu { gap: 6px; }
  .account-name { max-width: 72px; font-size: 10px; }
  .role-pill { padding: 2px 5px; font-size: 8px; }
  .icon-button { width: 27px; height: 27px; font-size: 11px; }
  .page-view { padding: 25px 13px 18px; }
  .page-heading { align-items: flex-start; margin-bottom: 25px; }
  .page-heading .muted { max-width: 330px; font-size: 11px; }
  .queue-summary { display: none; }
  .model-grid { grid-template-columns: 1fr; gap: 8px; }
  .model-card { min-height: 0; padding: 13px; }
  .model-description { min-height: 0; }
  .workbench-panel { margin-top: 26px; }
  .workbench-title { align-items: center; padding: 17px 13px 13px; }
  .workbench-title h2 { font-size: 18px; }
  .readiness-pill { max-width: 48%; font-size: 9px; text-align: center; }
  .work-tabs { gap: 19px; padding: 0 13px; }
  .work-tab { font-size: 11px; }
  .work-pane { padding: 14px 12px; }
  .conversation-toolbar { flex-wrap: wrap; gap: 7px; }
  .conversation-toolbar .control-select { flex: 1; min-width: 110px; }
  .conversation-label { margin-left: 0; }
  .conversation-select { max-width: none; }
  .chat-thread { height: 300px; padding: 11px; }
  .message-row { max-width: 100%; }
  .composer { padding: 9px; }
  .conversation-list { grid-template-columns: 1fr; max-height: 160px; overflow: auto; }
  .parameter-grid, .parameter-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions { align-items: flex-start; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .task-section { padding: 17px 12px; }
  .task-section .section-title { align-items: flex-start; flex-direction: column; }
  .filter-bar { align-items: stretch; }
  .filter-bar > label:not(.search-control) { flex: 1 1 42%; min-width: 0; }
  .filter-bar .button { flex: 1 1 100%; }
  .admin-section { padding: 13px 11px; }
  .create-user-form { grid-template-columns: 1fr 1fr; }
  .create-user-form label:first-child { grid-column: 1 / -1; }
  .create-user-form .button { width: 100%; }
  .user-card { grid-template-columns: 1fr; gap: 9px; }
  .user-actions { grid-column: auto; }
  .history-pagination { gap: 7px; }
  .user-edit-form { align-items: center; }
  .user-edit-form .field-hint { flex-basis: 100%; }
  .history-card { padding: 12px; }
  .history-card-top { align-items: flex-start; }
  .app-footer { margin: 12px 13px 0; padding-bottom: 16px; }
  .global-notice { margin: 10px 13px 0; }
}
.context-details { border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted-dark); font-size: 11px; }
.context-details summary { cursor: pointer; font-weight: 620; }
.context-messages { display: grid; gap: 8px; margin-top: 9px; }
.context-message { border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: #fbfcfc; }
.context-message strong { color: var(--muted); font-size: 10px; }
.context-message pre { margin: 5px 0 0; color: var(--ink); font-family: inherit; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.context-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.context-files .file-download { font-size: 10px; }
.orphan-upload-list { display: grid; gap: 9px; }
.orphan-upload-card { display: grid; grid-template-columns: minmax(140px, .9fr) minmax(160px, 1.3fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.orphan-upload-info { display: grid; min-width: 0; gap: 3px; }
.orphan-upload-info strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.orphan-upload-info span { font-size: 9px; }
.orphan-upload-card .file-previews { margin: 0; }
.orphan-upload-card .file-preview { max-width: 160px; padding: 4px; }
.orphan-upload-card .file-preview img { max-height: 90px; }
.danger-button { color: var(--danger); }
.danger-button:hover:not(:disabled) { border-color: #e7c2bf; background: var(--danger-soft); }
@media (max-width: 640px) {
  .orphan-upload-card { grid-template-columns: minmax(0, 1fr) auto; }
  .orphan-upload-card .file-previews { grid-column: 1 / -1; grid-row: 2; }
  .orphan-upload-card .button { grid-column: 2; grid-row: 1; }
}

.gpu-admin-section > .section-title { align-items: flex-start; }
.gpu-overview { border: 1px solid var(--line); border-radius: 11px; padding: 18px; background: white; }
.gpu-overview > .section-title { align-items: flex-start; margin-bottom: 10px; }
.gpu-overview-hint { margin: 12px 0 0; line-height: 1.7; }
.gpu-safety-warning { margin: 0 0 14px; border: 1px solid #ead7b6; border-radius: 8px; padding: 10px 12px; color: #765722; background: #fff9ec; font-size: 11px; line-height: 1.65; }
.gpu-status { margin: 0 0 12px; overflow-wrap: anywhere; }
.gpu-device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 11px; }
.gpu-device-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 13px; background: #fbfcfc; }
.gpu-device-stale { border-color: #e7c991; background: #fffdf8; }
.gpu-device-header, .gpu-device-identity { display: flex; min-width: 0; }
.gpu-device-header { align-items: flex-start; justify-content: space-between; gap: 9px; }
.gpu-device-identity { flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.gpu-device-identity h3 { width: 100%; font-size: 13px; }
.gpu-index, .gpu-stale-badge, .gpu-required-count { flex: 0 0 auto; border-radius: 20px; padding: 3px 7px; color: var(--accent-dark); background: var(--accent-soft); font-size: 9px; font-weight: 650; }
.gpu-stale-badge { color: #765722; background: #fff0d3; }
.gpu-uuid { min-width: 0; color: var(--muted-dark); font-size: 9px; overflow-wrap: anywhere; }
.gpu-memory { margin-top: 11px; }
.gpu-memory-summary { color: var(--muted-dark); font-size: 10px; overflow-wrap: anywhere; }
.gpu-memory-track { height: 8px; overflow: hidden; margin-top: 7px; border-radius: 20px; background: #e8edef; }
.gpu-memory-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #43887d, #82b7a8); }
.gpu-unknown-reading, .gpu-process-empty { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.gpu-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 11px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 0; }
.gpu-metrics dt { color: var(--muted); font-size: 9px; }
.gpu-metrics dd { min-width: 0; margin: 2px 0 0; color: var(--ink); font-size: 11px; font-weight: 620; overflow-wrap: anywhere; }
.gpu-processes h4 { margin: 0 0 5px; color: var(--muted-dark); font-size: 10px; }
.gpu-process-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9px; }
.gpu-process-table th, .gpu-process-table td { border-top: 1px solid #e9edef; padding: 5px 4px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.gpu-process-table th { color: var(--muted); font-weight: 600; }
.gpu-process-table th:first-child, .gpu-process-table td:first-child { width: 44px; }
.gpu-process-table th:nth-child(3), .gpu-process-table td:nth-child(3) { width: 58px; }
.gpu-process-table th:last-child, .gpu-process-table td:last-child { width: 92px; }
.gpu-process-name { word-break: break-word; }
.gpu-ownership { color: #795e2a; }
.gpu-placement-heading { display: flex; align-items: end; margin-top: 23px; border-top: 1px solid var(--line); padding-top: 18px; }
.gpu-placement-heading .eyebrow { margin-bottom: 2px; }
.gpu-placement-heading h3 { font-size: 14px; }
.gpu-placement-hint { line-height: 1.7; }
.gpu-placement-list { display: grid; gap: 9px; }
.gpu-placement-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: #fbfcfc; }
.gpu-placement-card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.gpu-placement-card-header h4 { margin: 0; font-size: 12px; }
.gpu-required-count { color: var(--muted-dark); background: #eef2f3; }
.gpu-placement-saved, .gpu-placement-active { margin: 5px 0; color: var(--muted-dark); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.gpu-placement-active { color: var(--muted); }
.gpu-placement-active-now { color: var(--accent-dark); font-weight: 650; }
.gpu-placement-form { margin-top: 9px; border-top: 1px solid #e9edef; padding-top: 10px; }
.gpu-placement-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.gpu-role-field { display: grid; min-width: 0; gap: 5px; color: var(--muted-dark); font-size: 10px; font-weight: 620; }
.gpu-role-field .control { min-width: 0; min-height: 38px; padding: 7px 8px; font-size: 10px; }
.gpu-placement-warning, .gpu-placement-message { margin: 9px 0 0; color: #765722; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.gpu-placement-message { color: var(--muted-dark); }
.gpu-placement-warning.hidden { display: none; }
.gpu-message-error { color: var(--danger); }
.gpu-message-conflict { color: #795e2a; }
.gpu-message-warning { color: #795e2a; }
.gpu-message-success { color: var(--accent-dark); }
.gpu-placement-actions { display: flex; justify-content: flex-end; margin-top: 9px; }

@media (max-width: 640px) {
  .gpu-admin-section > .section-title { flex-wrap: wrap; }
  .gpu-admin-section > .section-title .button { width: 100%; }
  .gpu-overview { padding: 13px; }
  .gpu-overview > .section-title { flex-wrap: wrap; }
  .gpu-overview > .section-title .button { width: 100%; }
  .gpu-placement-fields { grid-template-columns: 1fr; }
  .gpu-process-table th:last-child, .gpu-process-table td:last-child { width: 86px; }
}
