@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/admin/fonts/poppins-400.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/admin/fonts/poppins-500.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/admin/fonts/poppins-600.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/admin/fonts/poppins-700.ttf') format('truetype'); }

:root {
  color-scheme: light;
  --bg0: #ffffff;
  --bg1: #f8faf7;
  --panel: #ffffff;
  --panel2: #ffffff;
  --elev: #f4f6f2;
  --line: #e7ebe4;
  --line2: #d5ddd0;
  --text: #242c23;
  --text2: #626d5f;
  --muted: #65725f;
  --accent: #3d712c;
  --accent2: #a8ee78;
  --violet: #61894e;
  --cyan: #416d59;
  --ok: #327240;
  --warn: #986416;
  --err: #8c4f3f;
  --radius: 16px;
  --radius-sm: 9px;
  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --shadow: 0 3px 16px rgb(31 49 21 / 3%);
  --glow: 0 0 0 3px rgb(111 164 74 / 12%);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg1); }
body { min-height: 100vh; font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #dcf5c9; color: #253d19; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .94em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tiny { font-size: .75rem; }
.break { overflow-wrap: anywhere; }
.error { color: var(--err); margin: .55rem 0 0; }
.ok { color: var(--ok); margin: .55rem 0 0; }
.hidden, [hidden] { display: none !important; }
svg { flex-shrink: 0; stroke-width: 1.7; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Sign in */
.login-wrap { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 80px 24px; background: #f7f9f5; position: relative; }
.login-wordmark { position: absolute; top: 30px; left: 36px; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.04em; }
.login-wordmark svg { width: 20px; height: 20px; color: var(--accent); }
.login-card { width: min(440px, 100%); border-radius: 20px; padding: 38px; box-shadow: 0 12px 50px rgb(35 53 26 / 5%); }
.login-card .brand { display: block; margin-bottom: 28px; }
.login-card .logo { margin-bottom: 24px; }
.login-card h1 { margin-top: 8px; font-size: 27px; font-weight: 600; letter-spacing: -.055em; }
.login-card .brand p { margin-top: 8px; font-size: 14px; line-height: 1.8; }
.login-footnote { text-align: center; font-size: 12px; color: var(--muted); margin: 24px 0 0; display: flex; justify-content: center; align-items: center; gap: 6px; }
.login-footnote svg { width: 13px; height: 13px; }
.login-footer { max-width: calc(100% - 40px); text-align: center; position: absolute; bottom: 25px; color: var(--muted); font-size: 12px; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand h1 { margin: 0; }
.brand p, .brand small { margin: 0; display: block; color: var(--text2); }
.brand.compact { padding: 4px 7px 23px; border-bottom: 1px solid var(--line); }
.brand.compact strong { font-size: 16px; letter-spacing: -.055em; font-weight: 600; }
.brand.compact small { font-size: 11px; margin-top: 1px; }
.logo { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent2); color: #294c1c; }
.logo svg { width: 24px; height: 24px; }
.logo.sm { width: 34px; height: 34px; border-radius: 10px; }
.logo.sm svg { width: 19px; height: 19px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text2); }
label span { display: inline-flex; align-items: center; gap: 6px; }
label span svg { width: 13px; height: 13px; }
input, textarea, select { width: 100%; min-width: 0; background-color: #fff; border: 1px solid var(--line2); color: var(--text); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; line-height: 1.6; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #8b9387; opacity: 1; }
textarea { resize: vertical; line-height: 1.85; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23626d5f' stroke-width='1.7'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-position: right 11px center; background-repeat: no-repeat; padding-right: 34px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #729b58; box-shadow: var(--glow); }
input[type='checkbox'] { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.btn { min-height: 40px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; appearance: none; border: 1px solid var(--line2); background: #fff; color: var(--text); border-radius: var(--radius-sm); padding: 9px 14px; cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.6; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--elev); border-color: #a8b49e; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #243c1a; font-weight: 600; }
.btn.primary:hover { background: #97df66; border-color: #97df66; }
.btn.accent { background: #edf5e7; border-color: #d6e5ca; color: #3d632d; }
.btn.accent:hover { background: #dfedD4; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--elev); }
.btn.danger { color: var(--err); border-color: #ddcbbf; background: #faf4ee; }
.btn.lg { width: 100%; padding: 12px 16px; margin-top: 4px; }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: min(220px, 100%); }
.wrap-settings { margin-bottom: 16px; }

/* Workspace */
.shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); background: #fff; }
.sidebar { overflow-y: auto; overscroll-behavior: contain; border: 0; border-right: 1px solid var(--line); box-shadow: none; padding: 26px 14px 18px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh; background: #f9fbf7; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { margin: 0 12px 10px; }
.nav-btn { appearance: none; width: 100%; border: 1px solid transparent; background: transparent; color: var(--text2); border-radius: 8px; padding: 11px 12px; display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: 13px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav-btn svg { width: 17px; height: 17px; }
.nav-btn:hover { background: #eef2e9; color: var(--text); }
.nav-btn.active { background: #e7efdf; color: #355528; border-color: #b9d1a9; }
.sidebar-bottom { margin-top: auto; }
.workspace-note { padding: 15px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.workspace-note > span { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; }
.workspace-note svg { width: 14px; height: 14px; color: var(--accent); }
.workspace-note p { margin: 7px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.sidebar-logout { width: 100%; justify-content: flex-start; font-size: 13px; }
.workspace { min-width: 0; }
.workspace-bar { min-height: 73px; padding: 16px 32px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.breadcrumb { display: flex; align-items: center; gap: 11px; font-size: 13px; color: var(--muted); }
.breadcrumb svg { width: 13px; height: 13px; }
.breadcrumb strong { font-weight: 500; color: var(--text); }
.workspace-actions { display: flex; align-items: center; gap: 15px; }
.workspace-pill { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.workspace-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7b9a68; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; background: #edf1e8; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-weight: 600; }
.content { padding: 28px 32px; width: 100%; max-width: none; margin: 0; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 25px; letter-spacing: -.055em; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; line-height: 1.4; }
.page-head h2 svg { width: 22px; height: 22px; color: var(--accent); }
.page-head p { margin: 8px 0 0; color: var(--text2); max-width: 72ch; font-size: 13px; line-height: 1.8; }
.page-head .row { align-items: center; }
.grid.two { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border-radius: var(--radius); padding: 23px; min-width: 0; background: var(--panel2); }
.card > label + label { margin-top: 18px; }
.card > label + .row { margin-top: 18px; }
.card h3 { margin: 0 0 16px; font-size: 13px; font-weight: 500; letter-spacing: -.015em; display: inline-flex; align-items: center; gap: 8px; }
.card h3 svg { width: 16px; height: 16px; color: var(--accent); }
.card-head > * { min-width: 0; overflow-wrap: anywhere; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.code { background: #f6f8f3; border: 1px solid var(--line); border-radius: 10px; padding: 18px; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; color: #53614b; }
.code.curl { border-left: 3px solid #a3cb89; }
.code.resp { border-left: 3px solid #c6d4bc; color: #59674f; }

/* Studio */
.paste-hero { border-radius: var(--radius); padding: 25px; margin-bottom: 25px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 18px; align-items: start; background: #fbfcf9; box-shadow: none; }
.paste-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: #eaf3e3; color: var(--accent); border: 1px solid #dce8d2; }
.paste-icon svg { width: 19px; height: 19px; }
.paste-label { grid-column: 2; margin: 0; }
.paste-label > span { color: var(--text); font-size: 14px; margin-bottom: 3px; }
.paste-hero textarea { min-height: 105px; margin-top: 5px; font-size: 13px; }
.paste-tip { grid-column: 2; font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.detect-badge { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-top: 12px; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; background: #edf6e7; color: var(--ok); border: 1px solid #cfe2c3; }
.detect-badge.warn { color: #806238; background: #faf6eb; border-color: #e5d8bc; }
.detect-badge svg { width: 13px; height: 13px; }
.section-caption { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.section-caption h3 { font-size: 14px; font-weight: 500; margin: 0; }
.section-caption span { font-size: 12px; color: var(--muted); }
.studio-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.shortcut-card { text-align: left; padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; color: var(--text); transition: border-color .15s, background .15s; }
.shortcut-card:hover { border-color: #a9c395; background: #fbfdf8; }
.shortcut-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.shortcut-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: #f0f5ea; color: var(--accent); }
.shortcut-icon svg { width: 18px; height: 18px; }
.shortcut-top > svg { width: 15px; height: 15px; color: #8c9685; }
.shortcut-card strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.shortcut-description { display: block; color: var(--muted); margin: 0; font-size: 12px; line-height: 1.8; }
.studio-help { display: flex; align-items: center; gap: 8px; padding: 15px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.studio-help svg { width: 14px; height: 14px; }
#tab-studio:has(#studio-image-panel:not([hidden])) .studio-welcome { display: none; }
.preview-wrap { border-radius: 11px; overflow: hidden; background: repeating-conic-gradient(#f0f3ed 0% 25%, #fafbf8 0% 50%) 50% / 24px 24px; border: 1px solid var(--line); min-height: 240px; display: grid; place-items: center; }
.preview-wrap img { max-width: 100%; max-height: 440px; display: block; }
.result-box { margin-top: 20px; }
.result-box a { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }
.result-box img, .result-box video { margin-top: 12px; max-width: 100%; border-radius: 11px; border: 1px solid var(--line); }

/* Profiles */
.profiles-layout { display: grid; gap: 20px; grid-template-columns: clamp(280px, 28%, 420px) minmax(0, 1fr); align-items: start; }
.profiles-aside, .profiles-editor { min-height: 460px; }
.profile-grid { display: flex; flex-direction: column; gap: 10px; max-height: 64vh; overflow: auto; padding-right: 3px; }
.profile-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.profile-card:hover { border-color: #afc29f; background: #fbfcf9; }
.profile-card.selected { border-color: #a0bd8a; background: #f3f8ed; }
.profile-card-top > .row { flex-shrink: 0; }
.profile-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.profile-card-top strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.profile-card .meta { color: var(--muted); font-size: 12px; margin: 8px 0 12px; line-height: 1.8; overflow-wrap: anywhere; }
.profile-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; letter-spacing: .04em; padding: 3px 8px; border-radius: 5px; background: #eff4e9; color: var(--accent); font-weight: 500; }
.badge-live { background: #e5f3e6; color: var(--ok); }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.editor-actions { align-items: center; margin-top: 16px; }

/* Monitor and stats */
.nav-badge { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 5px; background: #f9eac8; color: var(--warn); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.inline-check { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; font-size: 13px; color: var(--text2); cursor: pointer; user-select: none; }
.grid.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.monitor-stat.ok { margin-top: 0; }
.monitor-stat .stat-label { display: flex; align-items: center; gap: 8px; color: var(--text2); font-size: 12px; font-weight: 500; }
.monitor-stat .stat-label svg { width: 15px; height: 15px; }
.monitor-stat .stat-value { font-size: 32px; line-height: 1.3; letter-spacing: -.05em; font-weight: 500; margin-top: 17px; font-variant-numeric: tabular-nums; color: var(--text); }
.monitor-stat.running .stat-label svg { color: var(--warn); }
.monitor-stat.ok .stat-label svg { color: var(--ok); }
.monitor-stat.failed .stat-label svg { color: var(--err); }
.monitor-layout { display: grid; grid-template-columns: clamp(320px, 32%, 560px) minmax(0, 1fr); gap: 20px; align-items: start; }
.monitor-layout:has(.monitor-detail[hidden]) { grid-template-columns: minmax(0, 1fr); }
.monitor-list { display: flex; flex-direction: column; gap: 9px; max-height: min(62vh, 720px); overflow: auto; padding-right: 3px; }
.monitor-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 15px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.monitor-row:hover { border-color: #b6cba6; background: #fafcf7; }
.monitor-row.selected { border-color: #8daf76; background: #f0f6e9; }
.monitor-detail-meta { margin-bottom: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.monitor-instructions-pre, .monitor-log { border-radius: 9px; border: 1px solid var(--line); background: #f7f9f4; font-family: var(--mono); font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text2); overflow: auto; }
.monitor-instructions-pre { margin: 6px 0 0; padding: 12px; max-height: 160px; }
.monitor-log { margin: 0; max-height: min(62vh, 720px); padding: 16px; }
.monitor-log .ll-error { color: var(--err); }
.monitor-log .ll-warn { color: var(--warn); }
.monitor-log .ll-info { color: var(--cyan); }
.monitor-log .ll-stream { color: #465b3b; }
.monitor-log .ll-debug, .monitor-log .ll-t { color: var(--muted); }
.monitor-log .ll-t { margin-right: 7px; }
.monitor-row.is-running { border-left: 3px solid #dbbb75; }
.monitor-row.is-failed { border-left: 3px solid #c8a391; }
.monitor-row.is-ok { border-left: 3px solid #9dbd8c; }
.badge-status { font-size: 11px; padding: 4px 8px; border-radius: 5px; font-weight: 500; white-space: nowrap; margin: 0; }
.badge-status.running { background: #fcf2dc; color: var(--warn); }
.badge-status.ok { background: #eaf4e5; color: var(--ok); }
.badge-status.failed { background: #f5ece4; color: var(--err); }
.monitor-main strong { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; overflow-wrap: anywhere; }
.monitor-main .summary { color: var(--text2); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.monitor-main .meta-line { margin-top: 7px; color: var(--muted); font-size: 11px; }
.monitor-main .error-line { margin-top: 6px; color: var(--err); font-size: 12px; overflow-wrap: anywhere; }
.monitor-side { text-align: right; color: var(--muted); font-size: 11px; white-space: nowrap; }
.monitor-side a { display: inline-block; margin-top: 6px; font-size: 12px; }
.stats-filters { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; padding: 20px 23px; border-radius: var(--radius); margin-bottom: 20px; background: #fbfcf9; }
.stats-filters label { min-width: 145px; }
.stats-filters label span { font-size: 12px; color: var(--text2); font-weight: 500; margin-bottom: 2px; }
.stats-filters select { padding-block: 8px; }
.stats-table-wrap { min-width: 0; max-width: 100%; overscroll-behavior-inline: contain; overflow: auto; max-height: min(58vh, 640px); }
.stats-table { min-width: 600px; width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th, .stats-table td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stats-table th { position: sticky; top: 0; background: #f7f9f4; color: var(--text2); font-size: 11px; font-weight: 500; z-index: 1; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table tbody .stats-model-row { cursor: pointer; }
.stats-table tbody tr:hover { background: #f8fbf4; }
.stats-table tbody tr.selected { background: #edf5e5; }
.stats-table .prompt-cell { max-width: 42rem; color: var(--text2); line-height: 1.7; overflow-wrap: anywhere; }
.rate-cell { min-width: 130px; }
.rate-wrap { display: flex; align-items: center; gap: 10px; }
.rate-bar { flex: 1; height: 5px; border-radius: 99px; background: #eee9e4; overflow: hidden; }
.rate-bar > span { display: block; height: 100%; border-radius: 99px; background: #90b96f; }
.rate-pct { width: 40px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.doc h3 { margin-bottom: 10px; }
#tab-docs > article + article { margin-top: 20px; }
.toast { position: fixed; top: 20px; right: 20px; z-index: 50; width: min(420px, calc(100vw - 32px)); box-shadow: 0 8px 30px rgb(31 49 21 / 9%); }
* { scrollbar-width: thin; scrollbar-color: #d3dbcc transparent; }
/* Accessible controls and responsive navigation */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--accent2); color: var(--text); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
body:has(#view-dash[hidden]) .skip-link { display: none; }
.sidebar-header { min-width: 0; }
.nav-toggle { display: none; }
.brand.compact > div:last-child { min-width: 0; }
.breadcrumb, .workspace-actions { min-width: 0; }
.breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-actions { flex-shrink: 0; }
[aria-busy='true'] .btn.primary { cursor: progress; }
#login-connection { margin: 0; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 65px; }
.password-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; min-width: 58px; padding: 5px 10px; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; background: #f6f8f3; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 500; }
.profile-select, .model-filter { appearance: none; border: 0; border-radius: 5px; font: inherit; font-weight: 500; color: var(--accent); background: transparent; cursor: pointer; text-align: left; overflow-wrap: anywhere; padding: 5px 0; }
.profile-select { min-width: 0; font-size: 14px; }
.model-filter { min-height: 40px; }
.profile-select:hover, .model-filter:hover { text-decoration: underline; }
.filter-summary { align-items: center; }
.code-block { min-width: 0; margin-block: 14px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.code-toolbar { display: flex; justify-content: flex-end; padding: 8px; background: #f0f4eb; border-bottom: 1px solid var(--line); }
.code-block > .code { margin: 0; border: 0; border-radius: 0; }

.tab-pane h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
#main-content:focus { outline: none; }
@media (min-width: 1600px) { .content { padding: 32px; } }
@media (max-width: 1150px) {
  .monitor-layout { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 28px; }
  .workspace-bar { padding-inline: 28px; }
  .monitor-row { grid-template-columns: auto minmax(0, 1fr); }
  .monitor-side { grid-column: 2; text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px 12px; }
  .monitor-side a { margin: 0; }
}
@media (max-width: 980px) {
  .profiles-layout, .editor-grid, .grid.two { grid-template-columns: minmax(0, 1fr); }
  .studio-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .shortcut-card { padding: 20px; }
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .workspace-pill { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; max-height: 85dvh; padding: 12px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .brand.compact { padding: 0; border: 0; }
  .nav-toggle { display: inline-flex; min-height: 44px; }
  .nav { display: none; }
  .sidebar-bottom { display: none; margin-top: 0; position: static; }
  .sidebar[data-expanded='true'] .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sidebar[data-expanded='true'] .sidebar-bottom { display: block; }
  .nav-btn { min-height: 48px; padding: 11px; gap: 8px; font-size: 13px; }
  .nav-label, .workspace-note { display: none; }
  .sidebar-logout { min-height: 44px; border-top: 1px solid var(--line); border-radius: 0; }
  .workspace-bar { padding: 12px 20px; min-height: 60px; gap: 10px; }
  .workspace-actions { gap: 8px; }
  .content { padding: 26px 20px; scroll-margin-top: 86px; }
  .tab-pane h2 { scroll-margin-top: 90px; }
  .page-head { gap: 16px; margin-bottom: 24px; }
  .page-head h2 { font-size: 24px; }
  .page-head p { font-size: 13px; }
  .paste-hero { padding: 20px; gap: 10px; grid-template-columns: minmax(0, 1fr); }
  .paste-icon { display: none; }
  .paste-label, .paste-tip, .detect-badge { grid-column: 1; }
  input, textarea, select, .paste-hero textarea { font-size: 16px; }
  input:not([type='checkbox']), select { min-height: 48px; }
  .btn, .btn.sm, .password-toggle, .profile-select, .model-filter { min-height: 44px; }
  .btn.sm { font-size: 12px; }
  .grid.three { gap: 12px; }
  .monitor-stat { padding: 18px 14px; }
  .monitor-stat .stat-label { flex-wrap: wrap; }
  .monitor-stat .stat-value { font-size: 28px; }
  .card { padding: 20px; }
  .profiles-aside, .profiles-editor { min-height: auto; }
  .profile-grid { max-height: 46dvh; }
  .profile-card .actions { gap: 10px; }
  .monitor-list, .monitor-log { max-height: 55dvh; }
  .stats-filters label { flex: 1 1 145px; }
  .toast { top: auto; right: 16px; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: none; font-size: 13px; }
}
@media (max-width: 600px) {
  .studio-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .shortcut-top { margin-bottom: 16px; }
  .section-caption > span { display: none; }
  .grid.three { grid-template-columns: minmax(0, 1fr); }
  .monitor-stat { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
  .monitor-stat .stat-value { margin-top: 0; font-size: 27px; }
  .page-head > .row, .page-head > .btn { width: 100%; }
  .page-head > .row .btn { flex: 1 1 auto; }
  .editor-actions > .row { width: 100%; margin-left: 0 !important; }
  .editor-actions > .row .btn { flex: 1; }
  #studio-image-panel .card > .row > .btn { flex: 1 1 100%; }
  .profile-card-top { flex-wrap: wrap; }
  .studio-help { align-items: flex-start; line-height: 1.8; }
  .studio-help svg { margin-top: 4px; }
}
@media (max-width: 400px) {
  .content { padding: 22px 14px; }
  .workspace-bar { padding: 10px 14px; }
  .breadcrumb > span, .breadcrumb > svg, .avatar { display: none; }
  .card, .paste-hero { padding: 16px; }
  .login-wrap { padding: 88px 16px 64px; }
  .login-card { padding: 24px; }
  .login-wordmark { top: 24px; left: 20px; }
  .login-card h1 { font-size: 25px; }
  .stats-filters { padding: 16px; }
  .stats-filters label { min-width: 100%; }
  .monitor-row { grid-template-columns: minmax(0, 1fr); }
  .monitor-row > .badge-status { justify-self: start; }
  .monitor-side { grid-column: 1; }
}
@media (max-height: 650px) and (min-width: 761px) { .workspace-note { display: none; } .sidebar { gap: 12px; padding-top: 16px; } .brand.compact { padding-bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* Feedback is part of the workspace design, including failure and empty states. */
.feedback {
  --feedback-bg: #f3f6ef; --feedback-border: #dce5d3;
  --feedback-ink: #4c6540; --feedback-icon-bg: #e8eedf;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px; margin: 16px 0 0; border: 1px solid var(--feedback-border);
  border-radius: 11px; background: var(--feedback-bg); color: var(--feedback-ink);
  font-size: 12px; font-weight: 400; line-height: 1.7; text-align: left;
}
.feedback--error { --feedback-bg: #faf5ef; --feedback-border: #e5d7c9; --feedback-ink: #80503e; --feedback-icon-bg: #f0e4d7; }
.feedback--success { --feedback-bg: #f1f7eb; --feedback-border: #d5e4c7; --feedback-ink: #3c6230; --feedback-icon-bg: #e2eed6; }
.feedback--warning { --feedback-bg: #faf7ec; --feedback-border: #e6dcbe; --feedback-ink: #796035; --feedback-icon-bg: #f1e9d3; }
.feedback-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: var(--feedback-icon-bg); margin-top: 1px; }
.feedback-icon svg { width: 17px; height: 17px; }
.feedback-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feedback-title { display: block; margin: 0 0 3px; color: inherit; font-size: 12px; font-weight: 600; line-height: 1.6; }
.feedback-message { margin: 0; color: inherit; font-size: 12px; line-height: 1.8; }
.feedback-dismiss { flex-shrink: 0; min-width: 32px; min-height: 32px; padding: 6px; margin: -5px -5px 0 0; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; }
.feedback-dismiss:hover { background: var(--feedback-icon-bg); }
.feedback-dismiss svg { width: 16px; height: 16px; }
.toast.feedback { margin: 0; }
.stack > .feedback { margin: 0; }
input[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: #b58e72; }
input[aria-invalid='true']:focus, textarea[aria-invalid='true']:focus { box-shadow: 0 0 0 3px rgb(181 142 114 / 12%); }
#login-connection.feedback { margin: 0; }
#studio-status.feedback { margin-top: 18px; }
.monitor-main .error-line { padding: 7px 10px; border-left: 2px solid #d1b69e; border-radius: 4px; background: #faf5ef; color: #80503e; }
.stats-load-error.feedback, .result-warning.feedback { margin: 0; }
.confirm-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 30px; border: 1px solid var(--line2); border-radius: 18px; background: #fff; color: var(--text); box-shadow: 0 22px 70px rgb(35 49 26 / 17%); font-family: var(--font); }
.confirm-dialog::backdrop { background: rgb(35 44 30 / 28%); backdrop-filter: blur(3px); }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 12px; background: #faf1e7; color: #8c6243; }
.confirm-icon svg { width: 21px; height: 21px; }
.confirm-dialog h2 { margin: 8px 0 10px; font-size: 21px; font-weight: 600; letter-spacing: -.04em; }
.confirm-dialog p { margin: 0; font-size: 13px; color: var(--text2); line-height: 1.85; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.confirm-actions .btn { min-height: 44px; }
@media (max-width: 760px) { .feedback-dismiss { min-width: 44px; min-height: 44px; margin-top: -5px; } .toast.feedback { width: auto; } }
@media (max-width: 400px) { .feedback { gap: 10px; padding: 13px; } .confirm-dialog { padding: 24px; } .confirm-actions .btn { flex: 1; } }

/* Use the available workspace for editors, previews and request details. */
#studio-image-panel { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
#studio-image-panel > .card { min-width: 0; }
.profiles-editor textarea { min-height: 320px; }
.monitor-detail { scroll-margin-top: 24px; }
.monitor-detail .monitor-log { max-height: 68dvh; min-height: 240px; }
.result-box > div, .result-box a { min-width: 0; max-width: 100%; }
.result-box img, .result-box video { display: block; width: auto; max-height: 72dvh; object-fit: contain; }
.profile-card, .profile-grid, .monitor-main, .paste-label, .stats-filters, .workspace-bar > * { min-width: 0; }
.profile-card .meta, .monitor-main .meta-line { overflow-wrap: anywhere; }
.page-head > div { min-width: 0; }
.card .row > .btn { max-width: 100%; }
@media (max-width: 980px) { #studio-image-panel { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .monitor-detail { scroll-margin-top: 90px; }
  .monitor-detail .monitor-log { min-height: 180px; max-height: 60dvh; }
  .profiles-editor { scroll-margin-top: 90px; }
  .profiles-editor textarea { min-height: 240px; }
  .preview-wrap { min-height: 160px; }
  .preview-wrap img { max-height: 55dvh; }
  .result-box img, .result-box video { max-height: 65dvh; }
}
@media (max-width: 400px) { .confirm-actions { flex-direction: column-reverse; } .confirm-actions .btn { width: 100%; } }
