:root {
  color-scheme: light;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-soft: #f7f8fd;
  --surface-strong: #eef1fb;
  --line: #e2e6f0;
  --line-strong: #ccd3e2;
  --text: #172033;
  --muted: #667085;
  --primary: #6558e8;
  --primary-dark: #4b3ed0;
  --primary-soft: #efedff;
  --green: #23a66f;
  --green-dark: #11784d;
  --green-soft: #e9f8f1;
  --cyan: #159da5;
  --cyan-soft: #e8f8f9;
  --violet: #7c5ce7;
  --amber: #c47a11;
  --amber-soft: #fff5df;
  --red: #d14655;
  --red-soft: #fff0f2;
  --shadow: 0 16px 48px rgba(28, 39, 76, .09);
  --shadow-soft: 0 8px 24px rgba(42, 52, 89, .07);
  --rail-width: 376px;
  font-family: Inter, "Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { min-width: 1920px; min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); font-size: 16px; }
button, input, select { font: inherit; }
button { color: inherit; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.workspace-link { display: inline-flex; height: 38px; align-items: center; gap: 8px; padding: 0 13px; color: var(--green-dark); border: 1px solid #c7dda7; border-radius: 9px; background: var(--green-soft); font-size: 13px; font-weight: 800; text-decoration: none; transition: .16s; }
.workspace-link:hover { color: #fff; border-color: var(--green); background: var(--green); transform: translateY(-1px); }
.workspace-link span { font-size: 16px; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 0, rgba(136, 199, 44, .14), transparent 27%),
    radial-gradient(circle at 98% 30%, rgba(20, 157, 151, .09), transparent 24%),
    linear-gradient(rgba(56, 92, 50, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 92, 50, .025) 1px, transparent 1px);
  background-size: auto, auto, 38px 38px, 38px 38px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(197, 211, 193, .85);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 4px 18px rgba(46, 72, 43, .05);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-icon { display: flex; align-items: end; gap: 4px; width: 36px; height: 36px; padding: 7px; border-radius: 10px; background: var(--green); box-shadow: 0 6px 16px rgba(114, 169, 29, .24); }
.brand-icon i { width: 5px; border-radius: 2px; background: #fff; }
.brand-icon i:nth-child(1) { height: 10px; }
.brand-icon i:nth-child(2) { height: 22px; }
.brand-icon i:nth-child(3) { height: 16px; }
.brand strong { display: block; font-size: 21px; letter-spacing: -.025em; }
.brand div > span { display: block; margin-top: 4px; color: var(--muted); font: 700 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.console-health { display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: var(--green-dark); border: 1px solid #cfdfb9; border-radius: 99px; background: var(--green-soft); font-size: 14px; font-weight: 750; }
.console-health i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(114, 169, 29, .12); }

main { width: 100%; margin: 0; padding: 14px 16px 34px; }
.cluster-bar { display: grid; grid-template-columns: 2fr 1fr .65fr; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.cluster-bar > div { min-width: 0; padding: 9px 15px; }
.cluster-bar > div + div { border-left: 1px solid var(--line); }
.cluster-bar small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 750; }
.cluster-bar strong { display: block; overflow: hidden; font: 700 13px/1.35 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
#clusterHealth { color: var(--green-dark); }

.cluster-bar, .builder, .monitor-drawer { margin-left: calc(var(--rail-width) + 16px); }
.workspace-shell { display: block; }
.deployment-overview, .builder, .progress-panel, .log-panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.deployment-overview { position: fixed; inset: 64px auto 0 0; z-index: 15; display: flex; width: var(--rail-width); height: calc(100vh - 64px); flex-direction: column; max-height: none; padding: 16px; border-bottom: 0; border-left: 0; border-radius: 0 14px 0 0; box-shadow: 8px 0 28px rgba(50, 78, 48, .09); }
.section-title, .builder-head, .parameter-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-title { flex: 0 0 auto; margin-bottom: 8px; padding: 0 2px 9px; border-bottom: 1px solid var(--line); }
.section-title span, .builder-head span, .parameter-head > div > span, .progress-panel > div:first-child > span, .log-head > div > span { display: block; margin-bottom: 5px; color: var(--green-dark); font: 800 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.section-title h1, .builder-head h1 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.section-title p, .builder-head p, .parameter-head p { margin: 0 0 2px; color: var(--muted); font-size: 12px; }

.runtime-grid { display: grid; flex: 1 1 auto; min-height: 0; grid-auto-rows: max-content; align-content: start; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; }
.runtime-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.runtime-card.active { border-color: #bcd88c; background: linear-gradient(145deg, #f8fced, #fff); }
.runtime-card.failed { border-color: #e8b9b9; background: var(--red-soft); }
.runtime-card.offline { opacity: .68; }
.runtime-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.runtime-top small { display: block; margin-bottom: 4px; color: var(--muted); font: 700 11px/1 ui-monospace, monospace; }
.runtime-top h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.runtime-top > span { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 5px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 11px; font-weight: 750; }
.runtime-top > span i { width: 6px; height: 6px; border-radius: 50%; background: #9ba69b; }
.runtime-top > span.online { color: var(--green-dark); border-color: #c7dda7; background: var(--green-soft); }
.runtime-top > span.online i { background: var(--green); }
.runtime-meta { display: flex; flex-wrap: wrap; gap: 5px 11px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.runtime-meta b { margin-left: 3px; color: var(--text); }
.runtime-card > p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.runtime-bottom { margin-top: 10px; color: var(--muted); font-size: 12px; }
.runtime-model, .runtime-actions { display: none; }
.good { color: var(--green-dark) !important; }
.bad { color: var(--red) !important; }

.resident-services { max-height: none; min-height: 0; margin-top: 7px; margin-right: 0; padding: 7px 0 1px; overflow: visible; border-top: 1px solid var(--line); }
.resident-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.resident-heading b { font-size: 13px; }
.resident-heading span { color: var(--muted); font-size: 12px; font-weight: 650; }
.resident-service { padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.resident-service + .resident-service { margin-top: 6px; }
.resident-service.running { border-color: #c5dca1; }
.resident-service.failed { border-color: #e8b9b9; }
.resident-service-main { display: flex; align-items: center; gap: 8px; }
.resident-state { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 4px 6px; color: var(--muted); border-radius: 5px; background: #edf1ec; font-size: 12px; font-weight: 800; }
.resident-state i { width: 5px; height: 5px; border-radius: 50%; background: #96a096; }
.resident-state.online { color: var(--green-dark); background: var(--green-soft); }
.resident-state.online i { background: var(--green); }
.resident-service-main > div { display: flex; min-width: 0; align-items: baseline; gap: 6px; }
.resident-service-main strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.resident-service-main code { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.resident-service > p { overflow: hidden; margin: 5px 0; color: var(--muted); font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.resident-actions { display: flex; gap: 4px; margin-top: 7px; }
.resident-actions button { min-height: 30px; flex: 1 1 48px; padding: 0 5px; color: #465147; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); font-size: 12px; font-weight: 750; cursor: pointer; }
.resident-actions button:hover:not(:disabled) { color: var(--green-dark); border-color: #adc982; background: var(--green-soft); }
.resident-actions button.danger:hover:not(:disabled) { color: var(--red); border-color: #e4b0b0; background: var(--red-soft); }
.resident-actions button:disabled { opacity: .38; cursor: not-allowed; }
.empty-services { margin-top: 10px; padding: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 8px; text-align: center; font-size: 11px; }

.builder { min-width: 0; padding: 16px; }
.builder-head { padding: 0 2px 10px; border-bottom: 1px solid var(--line); }
.build-step { min-width: 0; padding-top: 10px; }
.step-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.step-heading > b { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; color: #fff; border-radius: 9px; background: var(--green); font: 800 12px/1 ui-monospace, monospace; }
.step-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.step-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.model-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.model-card { --accent: var(--green); position: relative; min-width: 0; min-height: 108px; padding: 10px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); cursor: pointer; transition: .18s; }
.model-card[data-color="cyan"] { --accent: var(--cyan); }
.model-card[data-color="violet"] { --accent: var(--violet); }
.model-card[data-color="amber"] { --accent: var(--amber); }
.model-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.model-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent), #fff 92%); box-shadow: inset 3px 0 0 var(--accent); }
.select-indicator, .node-check { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 21px; height: 21px; color: #fff; border-radius: 50%; background: #d4ded1; font-size: 11px; font-weight: 900; }
.model-card.selected .select-indicator, .node-card.selected .node-check { background: var(--accent, var(--green)); }
.model-card > small { display: block; margin-bottom: 8px; padding-right: 21px; color: var(--accent); font: 800 11px/1 ui-monospace, monospace; overflow-wrap: anywhere; }
.model-card > strong { display: -webkit-box; min-height: 36px; overflow: hidden; padding-right: 18px; font-size: 15px; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.model-card > code { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.model-size { display: inline-block; margin-top: 6px; font: 750 11px/1 ui-monospace, monospace; }
.model-placement { display: block; margin-top: 4px; color: var(--muted); font: 650 11px/1.2 ui-monospace, monospace; }
.model-facts { display: flex; align-items: center; gap: 9px; margin-top: 8px; color: var(--muted); font: 750 11px/1 ui-monospace, monospace; white-space: nowrap; }
.model-facts span + span { position: relative; }
.model-facts span + span::before { content: "·"; position: absolute; left: -6px; color: var(--line-strong); }

.placement-grid { display: grid; grid-template-columns: minmax(250px, .68fr) minmax(500px, 1.32fr); gap: 10px; margin-top: 10px; }
.placement-grid .build-step { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.node-grid { display: grid; gap: 6px; }
.node-card { position: relative; min-width: 0; min-height: 59px; padding: 8px 11px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; transition: .16s; }
.node-card:hover:not(:disabled) { border-color: #abc77f; }
.node-card.selected { --accent: var(--green); border-color: var(--green); background: var(--green-soft); }
.node-card.offline { opacity: .55; cursor: not-allowed; }
.node-card > small { display: block; margin-bottom: 2px; color: var(--green-dark); font: 750 11px/1 ui-monospace, monospace; }
.node-card > strong { display: block; padding-right: 25px; font-size: 16px; }
.node-card > div { display: flex; gap: 9px; margin-top: 5px; color: #4f5c50; font-size: 11px; font-weight: 700; }
.node-card > .node-gpu-summary { display: none; }
.node-card > .node-gpu-summary span:last-child { color: var(--amber); }
.node-card p { display: none; }

.gpu-toolbar { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.gpu-toolbar > span { color: var(--muted); font-size: 11px; font-weight: 700; }
#gpuCountButtons { display: flex; gap: 3px; }
#gpuCountButtons button { width: 27px; height: 27px; padding: 0; color: #4e5a4f; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); font-size: 11px; font-weight: 800; cursor: pointer; }
#gpuCountButtons button:hover, #gpuCountButtons button.active { color: #fff; border-color: var(--green); background: var(--green); }
#gpuSelectionText { margin-left: auto; color: var(--green-dark); font: 700 12px/1.35 ui-monospace, monospace; }
.gpu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gpu-card { min-width: 0; padding: 7px 8px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.gpu-card:hover { border-color: #adc982; }
.gpu-card.selected { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(114, 169, 29, .08); }
.gpu-card.shared:not(.selected) { border-color: #e4c88f; background: var(--amber-soft); }
.gpu-card > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.gpu-card strong { font: 800 13px/1 ui-monospace, monospace; }
.gpu-card div span { color: var(--muted); font-size: 11px; font-weight: 800; }
.gpu-card.shared div span { color: var(--amber); }
.gpu-card.selected div span { color: var(--green-dark); }
.gpu-card p { overflow: hidden; margin: 5px 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.memory-bar { height: 4px; overflow: hidden; margin: 7px 0 6px; border-radius: 4px; background: #e1e8df; }
.memory-bar i { display: block; height: 100%; background: var(--cyan); }
.gpu-card.shared .memory-bar i { background: var(--amber); }
.gpu-card > small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.gpu-card > small b { color: var(--text); }
.empty-gpus { grid-column: 1 / -1; padding: 24px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 8px; text-align: center; font-size: 12px; }

.parameter-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.parameter-head { margin-bottom: 8px; }
.parameter-head h2 { margin: 0; font-size: 18px; }
.parameter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 6px; }
.advanced-section .parameter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.parameter-grid label { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.parameter-grid label > span { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-height: 18px; margin-bottom: 4px; }
.parameter-grid label > span b { min-width: 0; font-size: 12px; line-height: 1.3; }
.parameter-grid label > span small { display: none; }
.parameter-grid input, .parameter-grid select { width: 100%; height: 32px; padding: 0 8px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; background: #fbfdfb; font: 650 12px/1 ui-monospace, monospace; }
.parameter-grid input:focus, .parameter-grid select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(114, 169, 29, .1); }
.fixed-parameters { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-strong); }
.fixed-parameters b { margin-right: 4px; color: var(--muted); font-size: 12px; }
.fixed-parameters span { padding: 5px 7px; color: #4d594e; border: 1px solid var(--line); border-radius: 5px; background: #fff; font: 11px/1 ui-monospace, monospace; }
.official-parameters { padding: 9px; border: 1px solid #bfe1de; border-radius: 8px; background: var(--cyan-soft); }
.official-parameters b { color: #087b76; }
.official-parameters span { padding: 0; border: 0; background: transparent; }
.advanced-parameters { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.advanced-parameters > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; cursor: pointer; list-style: none; user-select: none; }
.advanced-parameters > summary::-webkit-details-marker { display: none; }
.advanced-parameters > summary b { display: block; font-size: 13px; }
.advanced-parameters > summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.advanced-parameters > summary i { color: var(--green-dark); font: normal 750 12px/1 ui-monospace, monospace; }
.advanced-parameters[open] > summary { border-bottom: 1px solid var(--line); }
.advanced-parameters[open] > summary i { font-size: 0; }
.advanced-parameters[open] > summary i::before { content: "收起"; font-size: 12px; }
.advanced-section { padding: 14px 13px; }
.advanced-section + .advanced-section { border-top: 1px solid var(--line); }
.advanced-section:nth-of-type(even) { background: var(--surface-soft); }
.advanced-title { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 7px; }
.advanced-title h3 { margin: 0; font-size: 14px; }
.advanced-title p { max-width: 480px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }

.commit-grid { display: grid; grid-template-columns: minmax(600px, 13fr) minmax(420px, 7fr); gap: 8px; margin-top: 9px; }
.preflight-panel { display: grid; grid-template-columns: 40px 1fr; gap: 10px; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.preflight-panel.passed { border-color: #afd079; background: var(--green-soft); }
.preflight-panel.failed { border-color: #e2abab; background: var(--red-soft); }
.preflight-panel.checking { border-color: #8bcfc9; background: var(--cyan-soft); }
.preflight-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; font-size: 18px; font-weight: 850; }
.passed .preflight-icon { color: #fff; border-color: var(--green); background: var(--green); }
.failed .preflight-icon { color: var(--red); border-color: #dda2a2; }
.checking .preflight-icon { color: var(--cyan); border-color: var(--cyan); animation: spin 1s linear infinite; }
.preflight-copy > small { display: block; margin-bottom: 3px; color: var(--muted); font: 750 11px/1 ui-monospace, monospace; letter-spacing: .1em; }
.preflight-copy h2 { margin: 0; font-size: 16px; }
.preflight-copy > p { display: none; }
.preflight-metrics { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 5px; margin-top: 8px; }
.preflight-metrics > div { padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.7); }
.preflight-metrics small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.preflight-metrics strong { font: 750 11px/1.2 ui-monospace, monospace; }
.preflight-copy ul { display: grid; gap: 3px; max-height: 58px; overflow-y: auto; margin: 6px 0 0; padding: 0; list-style: none; scrollbar-color: #d3aaa5 transparent; }
.preflight-copy li { position: relative; padding-left: 12px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.preflight-copy li::before { content: "•"; position: absolute; left: 1px; color: var(--amber); }
.preflight-copy li.error { color: var(--red); }

.deploy-actions { display: grid; grid-template-columns: 1fr; gap: 8px; align-content: center; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, #f7fbf4, #fff); }
.gpu-cleanup-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.68); cursor: pointer; }
.gpu-cleanup-option input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--red); cursor: pointer; }
.gpu-cleanup-option b, .gpu-cleanup-option small { display: block; }
.gpu-cleanup-option b { color: var(--text); font-size: 12px; line-height: 1.25; }
.gpu-cleanup-option small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.gpu-cleanup-option:has(input:checked) { border-color: #df9b9b; background: var(--red-soft); }
.gpu-cleanup-preview { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 9px; align-items: baseline; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface-soft); font-size: 10px; }
.gpu-cleanup-preview b { color: inherit; font-size: 11px; }
.gpu-cleanup-preview span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpu-cleanup-preview.destructive { color: var(--red); border-color: #df9b9b; background: var(--red-soft); }
.key-setting label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 750; }
.key-setting label span { margin-left: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.key-setting > div { display: flex; }
.key-setting input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 7px 0 0 7px; outline: none; background: #fbfdfb; font-size: 12px; }
.key-setting button { width: 48px; flex: 0 0 48px; color: var(--green-dark); border: 1px solid var(--line-strong); border-left: 0; background: var(--surface-soft); font-size: 12px; font-weight: 750; cursor: pointer; }
.key-setting button:hover { background: var(--green-soft); }
.key-setting button:last-child { width: 55px; flex-basis: 55px; border-radius: 0 7px 7px 0; }
.deploy-button { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #fff; border: 0; border-radius: 8px; background: linear-gradient(135deg, #7eb829, #609716); box-shadow: 0 8px 18px rgba(96,151,22,.2); font-size: 13px; font-weight: 800; cursor: pointer; }
.deploy-button b { font-size: 20px; font-weight: 400; }
.deploy-button:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }

.monitor-drawer { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.monitor-drawer > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; cursor: pointer; list-style: none; user-select: none; }
.monitor-drawer > summary::-webkit-details-marker { display: none; }
.monitor-drawer > summary b { display: block; font-size: 15px; }
.monitor-drawer > summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.monitor-drawer > summary i { color: var(--green-dark); font: normal 750 12px/1 ui-monospace, monospace; }
.monitor-drawer[open] > summary { border-bottom: 1px solid var(--line); }
.monitor-drawer[open] > summary i { font-size: 0; }
.monitor-drawer[open] > summary i::before { content: "收起"; font-size: 12px; }
.monitor-grid { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 12px; margin: 0; padding: 12px; background: var(--surface-soft); }
.monitor-grid .progress-panel, .monitor-grid .log-panel { box-shadow: none; }
.progress-panel { display: block; min-width: 0; padding: 17px; }
.progress-panel h2 { margin: 0; font-size: 18px; }
.progress-panel p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.progress-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.progress-steps > div { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); font-size: 11px; font-weight: 700; }
.progress-steps i { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; font: normal 750 11px/1 ui-monospace, monospace; }
.progress-steps > b { display: none; }
.progress-steps div.done i { color: #fff; border-color: var(--green); background: var(--green); }

.log-panel { min-width: 0; overflow: hidden; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.log-head h2 { margin: 0; font-size: 18px; }
.log-actions { display: flex; align-items: center; gap: 8px; }
.log-actions > span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.log-actions > span i { width: 6px; height: 6px; border-radius: 50%; background: #a4afa4; }
.log-actions > span.ready { color: var(--green-dark); }
.log-actions > span.ready i { background: var(--green); }
.log-actions > span.error { color: var(--red); }
.log-actions > span.error i { background: var(--red); }
.log-actions button, .log-search button { min-height: 30px; padding: 0 9px; color: #4d594e; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); font-size: 12px; font-weight: 700; cursor: pointer; }
.log-actions button:hover, .log-search button:hover { color: var(--green-dark); border-color: #adc982; }
.log-search { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto auto; align-items: center; gap: 7px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.log-search > span { color: var(--green-dark); font-size: 18px; }
.log-search input { height: 31px; padding: 0 9px; color: var(--text); border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fff; font-size: 12px; }
.log-search input:focus { border-color: var(--green); }
.log-search b { min-width: 42px; color: var(--green-dark); font: 11px/1 ui-monospace, monospace; text-align: right; }
#runtimeLogs { height: 190px; margin: 0; overflow: auto; padding: 12px 15px; color: #d7ead8; background: #172019; font: 550 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
#runtimeLogs::selection { color: #172019; background: #c7ef89; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: 520px; padding: 13px 16px; color: #fff; border-radius: 9px; background: #344936; box-shadow: 0 14px 36px rgba(32,53,32,.25); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; font-size: 12px; font-weight: 650; }
.toast.visible { opacity: 1; transform: none; }
.toast.error { background: #8f3535; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(114,169,29,.14); } }

/* 2026 desktop deployment studio */
html { scrollbar-color: #b8bfd3 transparent; }
body {
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(101, 88, 232, .22);
  outline-offset: 2px;
}

.ambient {
  background:
    radial-gradient(circle at 14% -8%, rgba(101, 88, 232, .18), transparent 31%),
    radial-gradient(circle at 94% 7%, rgba(21, 157, 165, .13), transparent 28%),
    radial-gradient(circle at 72% 96%, rgba(124, 92, 231, .08), transparent 30%),
    linear-gradient(rgba(62, 74, 122, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 74, 122, .026) 1px, transparent 1px),
    #f3f5fb;
  background-size: auto, auto, auto, 40px 40px, 40px 40px, auto;
}

.topbar {
  height: 70px;
  padding: 0 22px;
  border-bottom-color: rgba(205, 211, 228, .78);
  background: rgba(251, 252, 255, .86);
  box-shadow: 0 8px 32px rgba(29, 39, 76, .07);
  backdrop-filter: blur(20px) saturate(150%);
}
.brand { gap: 14px; }
.brand-icon {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 13px;
  background: linear-gradient(145deg, #7568f3 0%, #5a4ddd 56%, #28a8b0 130%);
  box-shadow: 0 10px 24px rgba(85, 72, 213, .28), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-icon::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: 17px;
  background: rgba(101,88,232,.12);
  filter: blur(7px);
}
.brand-icon i { width: 5px; background: rgba(255,255,255,.96); box-shadow: 0 0 8px rgba(255,255,255,.25); }
.brand strong { font-size: 21px; font-weight: 850; letter-spacing: -.035em; }
.brand div > span { margin-top: 3px; color: #7b8296; font-size: 10px; letter-spacing: .16em; }
.console-health {
  gap: 8px;
  padding: 8px 13px;
  color: var(--green-dark);
  border-color: #cce8dc;
  background: rgba(233,248,241,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  font-size: 13px;
}
.console-health i { animation: live-pulse 2.2s ease-out infinite; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #7b8296;
  border: 1px solid #d9deea;
  border-radius: 99px;
  background: rgba(255,255,255,.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 5px 16px rgba(35,45,78,.06);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.theme-toggle:hover { border-color: #bbb4ef; background: #faf9ff; box-shadow: 0 7px 18px rgba(74,62,172,.1); }
.theme-choice { font-size: 11px; font-weight: 850; letter-spacing: .04em; transition: color .2s ease, text-shadow .2s ease; }
.theme-choice-light { color: var(--primary-dark); }
.theme-switch {
  position: relative;
  width: 38px;
  height: 20px;
  padding: 2px;
  border: 1px solid #cbcfe0;
  border-radius: 99px;
  background: #e7e9f1;
  box-shadow: inset 0 2px 4px rgba(29,38,67,.08);
}
.theme-switch i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #7669f1, #4e42cd);
  box-shadow: 0 3px 8px rgba(77,63,193,.3);
  transform: translateX(18px);
  transition: transform .24s cubic-bezier(.2,.75,.25,1), background .2s ease, box-shadow .2s ease;
}
.theme-toggle[aria-pressed="false"] .theme-choice-dark { color: #6e63dc; }
.theme-toggle[aria-pressed="true"] .theme-choice-dark { color: #949aad; }
.theme-toggle[aria-pressed="true"] .theme-switch i { transform: translateX(18px); }

.logout-button {
  height: 36px;
  padding: 0 12px;
  color: #6e768a;
  border: 1px solid #d9deea;
  border-radius: 99px;
  background: rgba(255,255,255,.82);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: .18s ease;
}
.logout-button:hover { color: #b43a49; border-color: #efc8ce; background: var(--red-soft); }

body.auth-locked { overflow: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 26% 24%, rgba(101,88,232,.18), transparent 34%),
    radial-gradient(circle at 78% 70%, rgba(21,157,165,.13), transparent 32%),
    rgba(243,245,251,.88);
  backdrop-filter: blur(22px) saturate(120%);
}
.auth-orbit { position: absolute; width: 680px; height: 680px; border: 1px solid rgba(101,88,232,.12); border-radius: 50%; animation: auth-orbit 26s linear infinite; }
.auth-orbit::before, .auth-orbit::after { content: ""; position: absolute; inset: 96px; border: 1px solid rgba(21,157,165,.12); border-radius: 50%; }
.auth-orbit::after { inset: 205px; border-color: rgba(101,88,232,.18); }
.auth-orbit i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 16px rgba(101,88,232,.55); }
.auth-orbit i:nth-child(1) { left: 77px; top: 132px; }
.auth-orbit i:nth-child(2) { right: 49px; top: 303px; background: var(--cyan); }
.auth-orbit i:nth-child(3) { left: 226px; bottom: 17px; background: var(--green); }
.auth-card {
  position: relative;
  z-index: 1;
  width: 430px;
  padding: 32px;
  border: 1px solid rgba(205,211,228,.95);
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 30px 90px rgba(35,45,78,.18), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
}
.auth-mark { display: flex; justify-content: center; margin-bottom: 19px; }
.auth-mark .brand-icon { width: 48px; height: 48px; padding: 10px; border-radius: 15px; }
.auth-kicker { display: block; color: var(--primary); font: 850 10px/1 ui-monospace, monospace; text-align: center; letter-spacing: .19em; }
.auth-card h1 { margin: 11px 0 8px; color: #151d30; font-size: 26px; text-align: center; letter-spacing: -.035em; }
.auth-card > p { margin: 0 0 24px; color: #747d91; font-size: 13px; line-height: 1.65; text-align: center; }
.auth-card > label { display: block; margin-bottom: 8px; color: #414b61; font-size: 12px; font-weight: 850; }
.auth-password { display: grid; grid-template-columns: 1fr auto; overflow: hidden; border: 1px solid #d3d9e5; border-radius: 10px; background: #fafbfe; transition: .18s ease; }
.auth-password:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(101,88,232,.11); }
.auth-password input { min-width: 0; height: 45px; padding: 0 13px; color: #172033; border: 0; outline: 0; background: transparent; font-size: 15px; letter-spacing: .04em; }
.auth-password button { padding: 0 13px; color: var(--primary-dark); border: 0; border-left: 1px solid #e1e5ee; background: #f3f1ff; cursor: pointer; font-size: 11px; font-weight: 850; }
.auth-submit { display: flex; width: 100%; height: 45px; align-items: center; justify-content: space-between; margin-top: 13px; padding: 0 16px; color: #fff; border: 0; border-radius: 10px; background: linear-gradient(110deg, #7669f1, #5c4edc 60%, #168f9b 140%); box-shadow: 0 10px 24px rgba(85,70,209,.26); cursor: pointer; font-size: 13px; font-weight: 850; }
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(85,70,209,.32); }
.auth-submit:disabled { cursor: wait; opacity: .65; }
.auth-message { min-height: 18px; margin-top: 11px; color: var(--red); font-size: 12px; font-weight: 700; text-align: center; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; }

@keyframes auth-orbit { to { transform: rotate(360deg); } }

/* Always-on deployment telemetry and ordered six-stage pipeline */
.monitor-drawer {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(218,223,237,.95);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.monitor-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(101,88,232,.055), transparent 42%, rgba(21,157,165,.04));
}
.monitor-title > span, .progress-copy > span {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font: 850 10px/1 ui-monospace, monospace;
  letter-spacing: .16em;
}
.monitor-title > b { display: block; color: #222b3e; font-size: 16px; }
.monitor-live, .progress-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 850;
}
.monitor-live { padding: 7px 11px; color: var(--green-dark); border: 1px solid #c8e6d8; border-radius: 99px; background: var(--green-soft); }
.monitor-live i, .progress-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.monitor-live i { box-shadow: 0 0 0 4px rgba(35,166,111,.1); animation: live-pulse 2.2s ease-out infinite; }

.monitor-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; padding: 10px; background: #f6f7fb; }
.monitor-grid .progress-panel, .monitor-grid .log-panel { box-shadow: none; }
.progress-panel { min-width: 0; padding: 14px 15px 15px; }
.deployment-progress { margin-top: 9px; border-radius: 12px; box-shadow: none; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.progress-copy { min-width: 0; }
.progress-copy h2 { margin: 0; color: #20293d; font-size: 17px; }
.progress-copy p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.progress-state { min-width: 112px; padding: 8px 11px; border: 1px solid #dde1eb; border-radius: 99px; }
.progress-state.idle { color: #6f778a; background: #f5f6f9; }
.progress-state.active { color: var(--primary-dark); border-color: #c9c3f5; background: var(--primary-soft); }
.progress-state.active i { animation: live-pulse 1.45s ease-out infinite; }
.progress-state.ready { color: var(--green-dark); border-color: #c8e6d8; background: var(--green-soft); }
.progress-state.failed { color: #bd3e4d; border-color: #efc6cc; background: var(--red-soft); }

.progress-steps {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 30px minmax(150px, 1fr) 30px minmax(150px, 1fr) 30px minmax(150px, 1fr) 30px minmax(150px, 1fr) 30px minmax(150px, 1fr);
  align-items: center;
  gap: 0;
  margin-top: 14px;
}
.progress-steps > div {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 64px;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: #747d91;
  border: 1px solid #dfe4ed;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff, #f8f9fc);
  box-shadow: 0 4px 13px rgba(35,45,78,.035);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.progress-steps > div::before { content: ""; position: absolute; inset: 0 9px auto; height: 2px; border-radius: 99px; background: #d8dde8; }
.progress-steps > div > i {
  position: relative;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #7d8599;
  border: 1px solid #d3d9e4;
  border-radius: 50%;
  background: #f2f4f8;
  font-style: normal;
}
.progress-steps > div > i > b { font: 850 10px/1 ui-monospace, monospace; letter-spacing: .03em; }
.progress-steps > div > span { display: block; min-width: 0; }
.progress-steps > div strong { display: block; overflow: hidden; color: #344056; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.progress-steps > div small { display: block; overflow: hidden; margin-top: 4px; color: #8b93a5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.progress-steps > b { position: relative; display: block; height: 2px; background: #dce1ea; transition: background .25s ease, box-shadow .25s ease; }
.progress-steps > b::after { content: ""; position: absolute; top: 50%; right: 0; width: 6px; height: 6px; border-top: 2px solid #b6bece; border-right: 2px solid #b6bece; transform: translateY(-50%) rotate(45deg); }
.progress-steps > b.done { background: linear-gradient(90deg, var(--green), var(--cyan)); box-shadow: 0 0 8px rgba(35,166,111,.2); }
.progress-steps > b.done::after { border-color: var(--cyan); }
.progress-steps > div.done { border-color: #c5e3d6; background: linear-gradient(145deg, #f0faf5, #fbfefc); }
.progress-steps > div.done::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.progress-steps > div.done > i { color: #fff; border-color: var(--green); background: linear-gradient(145deg, #2db77b, #149b68); box-shadow: 0 6px 14px rgba(35,166,111,.2); }
.progress-steps > div.done > i > b { font-size: 0; }
.progress-steps > div.done > i::after { content: "✓"; font: 900 15px/1 system-ui, sans-serif; }
.progress-steps > div.done strong { color: var(--green-dark); }
.progress-steps.running > div:not(.done):not(.active) { opacity: .46; filter: saturate(.6); }

#runtimeLogs { height: 250px; }

main { padding: 14px 16px 34px; }
.cluster-bar, .builder, .monitor-drawer { margin-left: calc(var(--rail-width) + 16px); }
.cluster-bar {
  min-height: 57px;
  margin-bottom: 12px;
  border-color: rgba(217,222,236,.9);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}
.cluster-bar > div { position: relative; padding: 10px 16px 10px 44px; }
.cluster-bar > div::before {
  position: absolute;
  left: 15px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  transform: translateY(-50%);
  font: 850 11px/1 ui-monospace, monospace;
}
.cluster-bar > div:nth-child(1)::before { content: "N"; color: var(--primary-dark); background: var(--primary-soft); }
.cluster-bar > div:nth-child(2)::before { content: "↗"; color: #087d84; background: var(--cyan-soft); }
.cluster-bar > div:nth-child(3)::before { content: "●"; color: var(--green); background: var(--green-soft); font-size: 8px; }
.cluster-bar > div + div { border-left-color: var(--line); }
.cluster-bar small { margin-bottom: 4px; color: #80879a; font-size: 12px; letter-spacing: .035em; }
.cluster-bar strong { color: #273044; font-size: 13px; }
#clusterHealth { color: var(--green-dark); }

.deployment-overview, .builder, .progress-panel, .log-panel {
  border-color: rgba(218,223,237,.95);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.deployment-overview {
  inset: 70px auto 0 0;
  width: var(--rail-width);
  height: calc(100vh - 70px);
  padding: 16px 15px 18px;
  border-right-color: rgba(205,211,228,.92);
  border-radius: 0 18px 0 0;
  background:
    radial-gradient(circle at 0 0, rgba(101,88,232,.1), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,249,255,.96));
  box-shadow: 12px 0 42px rgba(31,42,84,.09);
  backdrop-filter: blur(18px);
}
.section-title { margin-bottom: 10px; padding: 1px 4px 11px; border-bottom-color: var(--line); }
.section-title span, .builder-head > div:first-child > span {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 10px;
  letter-spacing: .16em;
}
.section-title h1, .builder-head h1 { color: #151d30; font-size: 22px; font-weight: 850; }
.runtime-grid { gap: 9px; padding: 1px 4px 8px 1px; scrollbar-color: #c2c8d8 transparent; }
.runtime-card {
  position: relative;
  padding: 11px;
  overflow: hidden;
  border-color: #e0e4ee;
  border-radius: 12px;
  background: rgba(249,250,253,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.runtime-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #cbd1de;
}
.runtime-card.active { border-color: #cde7dc; background: linear-gradient(145deg, #f5fcf9, #fff 62%); }
.runtime-card.active::before { background: linear-gradient(180deg, #28b879, #20a0a8); }
.runtime-card.failed::before { background: var(--red); }
.runtime-top small { margin-bottom: 5px; color: #7a8295; font-size: 12px; letter-spacing: .03em; }
.runtime-top h2 { color: #182135; font-size: 18px; font-weight: 850; }
.runtime-top > span { padding: 5px 8px; border-color: #dfe3ec; background: rgba(255,255,255,.9); font-size: 11px; }
.runtime-top > span.online { border-color: #cce8dc; background: var(--green-soft); }
.runtime-meta { margin-top: 8px; color: #70788c; font-size: 12px; }
.runtime-meta b { color: #252e42; }
.runtime-capacity { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #e7eaf1; }
.runtime-capacity i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6759e9, #21a6ad); box-shadow: 0 0 9px rgba(101,88,232,.22); }
.resident-services { margin-top: 9px; padding-top: 8px; border-top-color: #e3e7ef; }
.resident-heading b { color: #3b4459; font-size: 13px; }
.resident-heading span { min-width: 21px; padding: 3px 6px; border-radius: 99px; background: #eef0f6; font-size: 11px; text-align: center; }
.resident-service {
  padding: 8px;
  border-color: #e1e5ee;
  border-radius: 9px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 3px 12px rgba(35,45,78,.035);
}
.resident-service.running { border-color: #cee6dc; }
.resident-state { padding: 4px 6px; color: #6c7488; background: #eef1f5; font-size: 11px; }
.resident-state.online { color: var(--green-dark); background: var(--green-soft); }
.resident-service-main strong { color: #273044; font-size: 13px; }
.resident-service-main code { color: #7c8496; font-size: 12px; }
.resident-actions { gap: 5px; margin-top: 8px; }
.resident-actions button {
  min-height: 31px;
  border-color: #dde2eb;
  border-radius: 7px;
  background: #f8f9fc;
  font-size: 12px;
  transition: .16s ease;
}
.resident-actions button:hover:not(:disabled) { color: var(--primary-dark); border-color: #bdb6f3; background: var(--primary-soft); transform: translateY(-1px); }

.builder {
  padding: 15px 16px 16px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}
.builder-head { min-height: 58px; padding: 0 3px 11px; border-bottom-color: var(--line); }
.builder-head h1 { font-size: 23px; }
.selection-path { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 7px; }
.builder-head .selection-path > span {
  display: grid;
  min-width: 116px;
  max-width: 220px;
  min-height: 42px;
  align-content: center;
  margin: 0;
  padding: 6px 10px;
  color: var(--text);
  border: 1px solid #e0e4ee;
  border-radius: 10px;
  background: #f8f9fd;
  font: inherit;
  letter-spacing: normal;
}
.builder-head .selection-path > span:nth-of-type(2) { max-width: 150px; }
.builder-head .selection-path > span:nth-of-type(3) { max-width: 245px; }
.selection-path small { display: block; margin-bottom: 2px; color: #858ca0; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.selection-path strong { display: block; overflow: hidden; color: #273044; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selection-path > i { color: #a0a7b8; font: normal 800 13px/1 ui-monospace, monospace; }
.selection-state {
  display: inline-flex;
  min-width: 82px;
  height: 33px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  color: #60687c;
  border: 1px solid #dde1eb;
  border-radius: 99px;
  background: #f6f7fa;
  font-size: 11px;
  white-space: nowrap;
}
.selection-state em { width: 7px; height: 7px; border-radius: 50%; background: #a4aabb; }
.selection-state.checking { color: #087d84; border-color: #bee4e6; background: var(--cyan-soft); }
.selection-state.checking em { background: var(--cyan); animation: live-pulse 1.4s ease-out infinite; }
.selection-state.ready { color: var(--green-dark); border-color: #c8e6d8; background: var(--green-soft); }
.selection-state.ready em { background: var(--green); }
.selection-state.blocked { color: #b43a49; border-color: #efc8ce; background: var(--red-soft); }
.selection-state.blocked em { background: var(--red); }

.build-step { padding-top: 10px; }
.step-heading { gap: 9px; margin-bottom: 8px; }
.step-heading > b {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: linear-gradient(145deg, #7568f2, #5648d7);
  box-shadow: 0 7px 16px rgba(83,69,205,.22);
}
.step-heading h2 { color: #20293d; font-size: 17px; font-weight: 850; }
.model-grid { gap: 8px; }
.model-card {
  min-height: 108px;
  padding: 11px;
  overflow: hidden;
  border-color: #dfe4ed;
  border-radius: 11px;
  background: linear-gradient(145deg, #fff, #f7f8fc);
  box-shadow: 0 4px 13px rgba(35,45,78,.035);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.model-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  opacity: .28;
}
.model-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent), #fff 34%); box-shadow: 0 10px 24px rgba(48,58,99,.11); }
.model-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), #fff 94%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent), transparent 82%), inset 0 0 0 1px color-mix(in srgb, var(--accent), #fff 38%);
}
.model-card.selected::before { opacity: 1; }
.select-indicator, .node-check { width: 22px; height: 22px; color: transparent; border: 1px solid #d6dbe5; background: #eef1f5; }
.model-card.selected .select-indicator, .node-card.selected .node-check { color: #fff; border-color: transparent; background: var(--accent, var(--primary)); box-shadow: 0 5px 12px color-mix(in srgb, var(--accent, var(--primary)), transparent 70%); }
.model-card > small { margin-bottom: 9px; font-size: 11px; letter-spacing: .03em; }
.model-card > strong { color: #20293c; font-size: 15px; font-weight: 850; }
.model-facts { margin-top: 9px; color: #727b90; font-size: 12px; }

.placement-grid { grid-template-columns: minmax(300px, .67fr) minmax(580px, 1.33fr); gap: 10px; }
.placement-grid .build-step { padding: 11px 12px 12px; border-color: #e0e4ed; border-radius: 13px; background: linear-gradient(150deg, #f8f9fd, #f5f7fb); }
.node-grid { gap: 6px; }
.node-card {
  min-height: 61px;
  padding: 9px 11px;
  border-color: #dfe3ed;
  border-radius: 9px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 3px 10px rgba(35,45,78,.025);
}
.node-card:hover:not(:disabled) { border-color: #b9b1f2; background: #fbfaff; }
.node-card.selected { --accent: var(--primary); border-color: #8e83ec; background: linear-gradient(145deg, #f2f0ff, #fbfaff); box-shadow: 0 7px 18px rgba(89,74,213,.11); }
.node-card > small { color: var(--primary-dark); font-size: 11px; letter-spacing: .03em; }
.node-card > strong { color: #202a3d; font-size: 15px; font-weight: 850; }
.node-card > div { color: #687187; font-size: 12px; }

.gpu-toolbar { margin-bottom: 7px; padding: 6px 8px; border-color: #dde2ec; border-radius: 9px; background: rgba(255,255,255,.9); }
.gpu-toolbar > span { font-size: 12px; }
#gpuCountButtons button { width: 28px; height: 28px; border-color: #dce1ea; border-radius: 7px; background: #f7f8fb; }
#gpuCountButtons button:hover, #gpuCountButtons button.active { border-color: var(--primary); background: linear-gradient(145deg, #7568f2, #584bd9); box-shadow: 0 5px 12px rgba(87,72,210,.2); }
#gpuSelectionText { color: var(--primary-dark); font-size: 12px; }
.gpu-grid { gap: 6px; }
.gpu-card {
  padding: 8px 9px;
  border-color: #dfe4ed;
  border-radius: 9px;
  background: rgba(255,255,255,.96);
  transition: .16s ease;
}
.gpu-card:hover { border-color: #b9b1f2; transform: translateY(-1px); }
.gpu-card.selected { border-color: #8e83ec; background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(101,88,232,.08); }
.gpu-card.shared:not(.selected) { border-color: #ebcb94; background: var(--amber-soft); }
.gpu-card strong { color: #242d41; font-size: 13px; }
.gpu-card div span { font-size: 11px; }
.gpu-card.selected div span { color: var(--primary-dark); }
.memory-bar { height: 5px; margin: 7px 0 6px; background: #e8ebf1; }
.memory-bar i { border-radius: inherit; background: linear-gradient(90deg, #5e55da, #20a6ad); }
.gpu-card.shared .memory-bar i { background: linear-gradient(90deg, #d58a1d, #e7aa48); }
.gpu-card > small { color: #70798d; font-size: 11px; }

.parameter-panel { padding: 11px 12px 12px; border-color: #e0e4ed; border-radius: 13px; background: linear-gradient(145deg, #f8f9fd, #f5f7fb); }
.parameter-head { margin-bottom: 8px; }
.parameter-head h2 { color: #20293d; font-size: 17px; font-weight: 850; }
.parameter-grid { gap: 7px; }
.parameter-grid label { padding: 7px 8px 8px; border-color: #dfe4ed; border-radius: 9px; background: rgba(255,255,255,.95); box-shadow: 0 3px 10px rgba(35,45,78,.025); }
.parameter-grid label > span { min-height: 18px; }
.parameter-grid label > span b { color: #354055; font-size: 12px; }
.parameter-grid input, .parameter-grid select {
  height: 33px;
  color: #1f2940;
  border-color: #d3d9e5;
  border-radius: 7px;
  background: #fafbfe;
  font-size: 12px;
}
.parameter-grid input:focus, .parameter-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,88,232,.11); background: #fff; }
.official-parameters { border-color: #bde2e4; background: var(--cyan-soft); }
.advanced-parameters { border-color: #dee3ed; border-radius: 10px; }
.advanced-parameters > summary i { color: var(--primary-dark); }

.commit-grid { grid-template-columns: minmax(600px, 13fr) minmax(420px, 7fr); gap: 9px; }
.preflight-panel { padding: 10px 11px; border-color: #dee3ec; border-radius: 12px; background: #f7f8fb; }
.preflight-panel.passed { border-color: #bfe2d3; background: linear-gradient(145deg, #eefaf4, #f8fdfb); }
.preflight-panel.failed { border-color: #efc5cb; background: linear-gradient(145deg, #fff2f4, #fff8f9); }
.preflight-panel.checking { border-color: #b8dfe2; background: linear-gradient(145deg, #ebf9fa, #f7fdfd); }
.preflight-icon { border-color: #d7dce7; border-radius: 10px; }
.passed .preflight-icon { border-color: var(--green); background: linear-gradient(145deg, #2db77b, #159a63); box-shadow: 0 7px 15px rgba(35,166,111,.2); }
.preflight-copy h2 { color: #20293d; font-size: 15px; }
.preflight-metrics > div { border-color: #e0e4ed; border-radius: 8px; }
.preflight-metrics small { font-size: 11px; }
.preflight-metrics strong { color: #273044; font-size: 12px; }
.deploy-actions { padding: 10px; border-color: #dddff0; border-radius: 12px; background: linear-gradient(145deg, #f5f3ff, #fbfbff); }
.key-setting label { color: #4f5870; font-size: 11px; }
.key-setting input { height: 39px; border-color: #d4d8e5; background: #fff; }
.key-setting button { color: var(--primary-dark); border-color: #d4d8e5; background: #f3f1ff; }
.key-setting button:hover { background: #e9e6ff; }
.deploy-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #7669f1 0%, #5c4edc 58%, #168f9b 145%);
  box-shadow: 0 10px 23px rgba(85,70,209,.28);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.deploy-button::after { content: ""; position: absolute; inset: -80% auto -80% -35%; width: 28%; background: rgba(255,255,255,.26); transform: rotate(18deg); transition: left .45s ease; }
.deploy-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(85,70,209,.34); }
.deploy-button:hover:not(:disabled)::after { left: 115%; }
.deploy-button:disabled { background: #aeb4c4; }

.monitor-drawer { border-color: rgba(218,223,237,.95); border-radius: 16px; background: rgba(255,255,255,.94); }
.monitor-drawer > summary { padding: 14px 17px; }
.monitor-drawer > summary b { color: #222b3e; }
.monitor-drawer > summary i { color: var(--primary-dark); }
.monitor-grid { background: #f6f7fb; }
.log-search > span, .log-search b { color: var(--primary-dark); }
.log-search input:focus { border-color: var(--primary); }
#runtimeLogs { color: #dfe8ff; background: #151a2c; }
#runtimeLogs::selection { color: #151a2c; background: #bcb5ff; }
.toast { right: 24px; bottom: 24px; padding: 13px 17px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: #272f48; box-shadow: 0 18px 44px rgba(24,31,55,.28); font-size: 12px; }

.service-stop-dialog {
  width: 560px;
  padding: 0;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--red), var(--line) 52%);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(10, 15, 35, .38), 0 0 0 1px color-mix(in srgb, var(--red), transparent 78%);
}
.service-stop-dialog::backdrop { background: rgba(4, 7, 18, .76); backdrop-filter: blur(8px); }
.service-stop-dialog form { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 22px; }
.service-stop-symbol { display: grid; width: 48px; height: 48px; place-items: center; color: #fff; border-radius: 14px; background: linear-gradient(145deg, #ff7188, var(--red)); box-shadow: 0 10px 24px color-mix(in srgb, var(--red), transparent 68%); font-size: 25px; font-weight: 900; }
.service-stop-copy > span { display: block; margin: 2px 0 7px; color: var(--red); font: 850 11px/1 ui-monospace, monospace; letter-spacing: .13em; }
.service-stop-copy h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.service-stop-copy > p { margin: 10px 0 15px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.service-stop-copy dl { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.service-stop-copy dl > div { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; padding: 9px 11px; }
.service-stop-copy dl > div + div { border-top: 1px solid var(--line); }
.service-stop-copy dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.service-stop-copy dd { overflow: hidden; margin: 0; font: 750 12px/1.35 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.service-stop-note { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 6px 10px; margin-top: 13px; padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--red), var(--line) 62%); border-radius: 10px; background: var(--red-soft); font-size: 12px; line-height: 1.4; }
.service-stop-note b { color: var(--red); }
.service-stop-dialog footer { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.service-stop-dialog footer button { height: 42px; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 850; cursor: pointer; }
.service-stop-cancel { color: var(--text); border: 1px solid var(--line-strong); background: var(--surface-soft); }
.service-stop-cancel:hover { border-color: var(--primary); background: var(--primary-soft); }
.service-stop-confirm { color: #fff; border: 1px solid transparent; background: linear-gradient(135deg, #f45f77, var(--red)); box-shadow: 0 8px 20px color-mix(in srgb, var(--red), transparent 72%); }
.service-stop-confirm:hover { filter: brightness(1.08); }

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(35,166,111,.3); }
  72%, 100% { box-shadow: 0 0 0 7px rgba(35,166,111,0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Fixed 16:9 deployment workspace with a collapsible right-side log rail. */
body { overflow: hidden; }
main {
  height: calc(100vh - 70px);
  padding: 12px 14px;
  overflow: hidden;
}
/* Keep the desktop workbench intact when the browser window is smaller than
   its design size. Native document scrollbars expose the whole workspace. */
body.console-page:not(.auth-locked) { overflow: auto; }
.console-page > main {
  position: relative;
  height: max(1010px, calc(100vh - 70px));
}
@media (max-width: 1919px), (max-height: 1079px) {
  .console-page .deployment-overview {
    position: absolute;
    inset: 0 auto auto 0;
    height: 100%;
  }
}
.cluster-bar {
  min-height: 54px;
  margin-bottom: 9px;
}
.workspace-shell {
  --log-rail-width: clamp(480px, 28vw, 760px);
  display: grid;
  height: calc(100% - 63px);
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) var(--log-rail-width);
  gap: 10px;
  margin-left: calc(var(--rail-width) + 16px);
}
body.logs-collapsed .workspace-shell { --log-rail-width: 50px; }
body.logs-focused .workspace-shell { grid-template-columns: minmax(0, 1fr); }
body.logs-focused .workspace-shell > .builder { display: none; }
.workspace-shell > .builder,
.workspace-shell > .monitor-drawer { min-width: 0; height: 100%; margin: 0; }
.builder {
  display: flex;
  flex-direction: column;
  container: deployment-workbench / size;
  padding: 11px 12px 12px;
  overflow: hidden;
}
.builder > * { flex: 0 0 auto; }
.builder-head {
  min-height: 47px;
  padding: 0 2px 8px;
}
.builder-head h1 { font-size: 20px; }
.build-step { padding-top: 7px; }
.step-heading { margin-bottom: 5px; }
.step-heading > b { width: 26px; height: 26px; }
.step-heading h2, .parameter-head h2 { font-size: 15px; }

.model-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.model-card {
  min-width: 150px;
  min-height: 78px;
  flex: 1 0 150px;
  padding: 8px 9px;
}
.model-card > small { margin-bottom: 6px; }
.model-card > strong {
  min-height: 18px;
  padding-right: 22px;
  line-height: 1.2;
  -webkit-line-clamp: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.model-facts { margin-top: 7px; }

.placement-grid {
  grid-template-columns: minmax(245px, .66fr) minmax(500px, 1.34fr);
  gap: 7px;
  margin-top: 7px;
}
.placement-grid .build-step { padding: 8px 9px 9px; }
.node-grid { gap: 4px; }
.node-card { min-height: 47px; padding: 6px 9px; }
.node-card > div { margin-top: 3px; }
.gpu-toolbar { margin-bottom: 5px; padding: 4px 6px; }
#gpuCountButtons button { width: 25px; height: 25px; }
.gpu-grid { gap: 4px; }
.gpu-card { padding: 6px 7px; }
.memory-bar { height: 4px; margin: 5px 0 4px; }

.parameter-panel { margin-top: 7px; padding: 8px 9px 9px; }
.parameter-head { margin-bottom: 5px; }
.parameter-grid { gap: 5px; }
.parameter-grid label { padding: 4px 6px 5px; }
.parameter-grid label > span { min-height: 16px; margin-bottom: 2px; }
.parameter-grid input, .parameter-grid select { height: 29px; }
.advanced-parameters { margin-top: 6px; }

.commit-grid {
  flex: 0 0 auto; min-height: 116px; grid-template-columns: minmax(0, 3fr) minmax(440px, 2fr);
  grid-template-rows: auto; align-content: start; gap: 6px; margin-top: 6px;
}
.preflight-panel { padding: 7px 8px; }
.preflight-icon { width: 32px; height: 32px; }
.preflight-metrics { gap: 4px; margin-top: 5px; }
.preflight-metrics > div { padding: 4px 6px; }
.preflight-metrics small { margin-bottom: 2px; }
.preflight-copy ul { max-height: 34px; margin-top: 4px; }
.deploy-actions { gap: 5px; padding: 7px 8px; }
.key-setting label { margin-bottom: 3px; }
.key-setting input { height: 33px; }
.deploy-button { min-height: 34px; }

.deployment-progress { margin-top: 6px; padding: 9px 10px 10px; }
.progress-copy > span { margin-bottom: 3px; }
.progress-copy h2 { font-size: 14px; }
.progress-copy p { margin-top: 2px; font-size: 11px; }
.progress-state { min-width: 94px; padding: 6px 8px; }
.progress-steps {
  grid-template-columns: minmax(105px, 1fr) 15px minmax(105px, 1fr) 15px minmax(105px, 1fr) 15px minmax(105px, 1fr) 15px minmax(105px, 1fr) 15px minmax(105px, 1fr);
  margin-top: 8px;
}
.progress-steps > div {
  min-height: 48px;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 7px;
}
.progress-steps > div > i { width: 27px; height: 27px; }
.progress-steps > div small { margin-top: 2px; }

.monitor-drawer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  transition: width .22s ease, border-color .18s ease;
}
.monitor-header {
  min-height: 54px;
  flex: 0 0 auto;
  gap: 8px;
  padding: 9px 10px 9px 12px;
}
.monitor-title { min-width: 0; }
.monitor-title > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monitor-controls { display: flex; align-items: center; gap: 6px; }
.monitor-live { padding: 6px 8px; }
.log-panel-toggle {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  color: var(--primary-dark);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}
.log-panel-toggle b { font-size: 18px; font-weight: 500; }
.monitor-grid { min-width: 0; min-height: 0; flex: 1 1 auto; padding: 7px; }
.log-panel { display: grid; height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
.log-head { display: grid; gap: 7px; padding: 10px 11px; }
.log-head h2 { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.log-actions { justify-content: space-between; }
.log-search { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 6px 8px; }
.log-search b { display: block; }
.log-actions > div { display: flex; align-items: center; gap: 6px; }
.log-actions button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
#runtimeLogs {
  width: 100%; height: auto; min-width: 0; min-height: 0; padding: 12px 14px;
  white-space: pre; overflow-wrap: normal; word-break: normal;
  overflow: auto; scrollbar-gutter: stable; font-size: 13px; line-height: 1.7;
}

body.logs-collapsed .monitor-drawer { cursor: pointer; }
body.logs-collapsed .monitor-header {
  height: 100%;
  min-height: 0;
  justify-content: center;
  padding: 5px;
  border-bottom: 0;
}
body.logs-collapsed .monitor-title,
body.logs-collapsed .monitor-live,
body.logs-collapsed #expandLogPanel,
body.logs-collapsed .monitor-grid { display: none; }
body.logs-collapsed .monitor-controls { width: 100%; height: 100%; }
body.logs-collapsed .log-panel-toggle {
  width: 100%;
  height: 100%;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  background: transparent;
}
body.logs-collapsed .log-panel-toggle span { writing-mode: vertical-rl; letter-spacing: .18em; }

@media (min-height: 1200px) {
  .model-card { min-height: 88px; }
  .workspace-shell { height: calc(100% - 65px); }
}

/* The access cards determine the visible row height. Calculation details scroll
   inside that row without expanding it; spare workbench space stays unfilled. */
.preflight-panel {
  contain: size;
  height: 100%;
  min-height: 0;
  max-height: none;
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  overflow: hidden;
}
.preflight-copy {
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-gutter: stable;
}
.preflight-copy ul {
  max-height: none;
  overflow: visible;
}
.preflight-copy .gpu-cleanup-preview {
  margin-top: 5px;
}
.deploy-actions { align-self: start; }
.deployment-access { display: flex; min-width: 0; min-height: 0; flex-direction: column; gap: 6px; }
.deployment-access > .deploy-actions { align-self: stretch; flex: 0 0 auto; }
.new-api-card {
  min-width: 0; min-height: 0; flex: 0 1 auto; overflow: auto; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--workspace-card-bg, var(--surface-soft));
}
.new-api-head { display: flex; min-height: 20px; align-items: center; gap: 8px; margin-bottom: 2px; }
.new-api-head h2 { margin: 0; font-size: 13px; font-weight: 750; white-space: nowrap; }
.new-api-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.new-api-card[data-state="ready"] .new-api-status { color: var(--green); }
.new-api-card[data-state="loading"] .new-api-status { color: var(--amber); }
.new-api-card[data-state="invalid"] .new-api-status, .new-api-card[data-state="failed"] .new-api-status { color: var(--red); }
.new-api-card button {
  display: inline-flex; height: 20px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0 6px;
  border: 1px solid var(--line-strong); border-radius: 5px; color: var(--primary-dark); background: var(--surface);
  font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.new-api-head button { margin-left: auto; }
.new-api-card button:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.new-api-card button:disabled { opacity: .45; cursor: not-allowed; }
.new-api-fields { display: grid; gap: 2px; margin: 0; }
.new-api-row { display: grid; min-width: 0; min-height: 20px; grid-template-columns: 64px minmax(0, 1fr) 24px; align-items: center; gap: 6px; }
.new-api-row dt { color: var(--muted); font-size: 12px; }
.new-api-row dd { min-width: 0; margin: 0; }
.new-api-row code { display: block; overflow: hidden; font: 13px/1.3 ui-monospace, "Cascadia Code", monospace; text-overflow: ellipsis; white-space: nowrap; }
.new-api-row button { width: 24px; padding: 0; }
.new-api-row svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* Taller workbenches use comfortable access-card spacing. The calculation row
   remains content-sized so the spare height stays below the deployment steps. */
@container deployment-workbench (min-height: 1000px) {
  .deploy-actions { gap: 10px; padding: 10px 12px; }
  .key-setting label { margin-bottom: 8px; line-height: 1.5; }
  .key-setting input { height: 36px; }
  .new-api-card { padding: 10px 12px; }
  .new-api-head { min-height: 26px; margin-bottom: 8px; }
  .new-api-head h2, .new-api-status { line-height: 1.5; }
  .new-api-card button { height: 26px; padding: 0 8px; }
  .new-api-fields { gap: 8px; }
  .new-api-row { min-height: 28px; grid-template-columns: 72px minmax(0, 1fr) 28px; gap: 8px; }
  .new-api-row dt, .new-api-row code { line-height: 1.5; }
  .new-api-row button { width: 28px; padding: 0; }
}

.gpu-cleanup-preview {
  grid-template-columns: auto minmax(0, 1fr);
}
.gpu-cleanup-preview span {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}
.deploy-submit-row {
  display: grid;
  grid-template-columns: minmax(132px, .72fr) minmax(270px, 1.28fr);
  gap: 6px;
  align-items: stretch;
}
.deploy-submit-row .deploy-button {
  width: 100%;
  min-width: 0;
}
.deploy-submit-row .gpu-cleanup-option {
  min-width: 0;
  align-items: center;
  padding: 5px 8px;
}
.deploy-submit-row .gpu-cleanup-option input {
  margin-top: 0;
}
.deploy-submit-row .gpu-cleanup-option small {
  margin-top: 2px;
}
