:root {
  --bg: #111111;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --surface-3: #272727;
  --text: #f2f2f2;
  --muted: #a7a7a7;
  --subtle: #747474;
  --line: #2d2d2d;
  --line-strong: #454545;
  --accent: #d7d7d7;
  --accent-soft: rgba(255, 255, 255, .07);
  --danger: #ff8f8f;
  --warning: #e9c46a;
  --inverse-bg: #fff;
  --inverse-text: #000;
  --shadow: 0 20px 64px rgba(0, 0, 0, .38);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  --bg: #f3f3f3;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #ededed;
  --text: #191919;
  --muted: #5d5d5d;
  --subtle: #858585;
  --line: #e2e2e2;
  --line-strong: #c8c8c8;
  --accent: #292929;
  --accent-soft: rgba(0, 0, 0, .055);
  --danger: #a92323;
  --warning: #8a6512;
  --inverse-bg: #000;
  --inverse-text: #fff;
  --shadow: 0 24px 80px rgba(0, 0, 0, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .18em; font-size: 10px; font-weight: 850; }
.brand-logo { display: block; flex: none; object-fit: contain; border-radius: 14px; background: transparent; box-shadow: 0 0 0 1px var(--line-strong); }
.hero-logo { width: 84px; height: 84px; margin-bottom: 36px; }
.hero-logo { border-radius: 22px; }
.card-logo { width: 48px; height: 48px; }
.sidebar-logo { width: 42px; height: 42px; }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .65fr); align-items: center; gap: 8vw; padding: 7vw; }
.auth-brand { max-width: 760px; }
.auth-brand h1 { margin: 0; max-width: 760px; font-size: clamp(48px, 6vw, 90px); line-height: .98; letter-spacing: -.06em; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.75; max-width: 650px; margin: 28px 0 0; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px; box-shadow: var(--shadow); }
.auth-card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.auth-card h2, .panel h2, .section-title h2, .section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.auth-card .muted { line-height: 1.6; }
.stack-lg { display: grid; gap: 18px; margin-top: 28px; }
.fine-print { color: var(--subtle); font-size: 11px; line-height: 1.55; }

label { color: var(--muted); font-size: 12px; font-weight: 700; display: grid; gap: 8px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; color: var(--text); background: var(--surface-2); outline: none; transition: border .16s, box-shadow .16s; }
input:focus, textarea:focus, select:focus { border-color: var(--text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 12%, transparent); }
textarea { resize: vertical; line-height: 1.55; }
select option { background: var(--surface); color: var(--text); }
input[type="checkbox"] { width: 38px; height: 20px; accent-color: var(--inverse-bg); }

.button { border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 14px; color: var(--text); background: var(--surface); font-weight: 780; transition: transform .15s, background .15s, color .15s, border .15s; }
.button:hover { transform: translateY(-1px); border-color: var(--text); }
.button:disabled { opacity: .45; cursor: wait; transform: none; }
.button.primary { color: var(--inverse-text); background: var(--inverse-bg); border-color: var(--inverse-bg); }
.button.primary:hover { opacity: .86; }
.button.secondary { background: var(--surface-2); }
.button.danger { border-style: dashed; color: var(--muted); }
.button.full { width: 100%; padding: 12px; }
.button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-button, .menu-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-brand { display: flex; align-items: center; gap: 13px; padding: 0 7px 30px; }
.sidebar-brand strong { display: block; font-size: 17px; }
.sidebar-brand span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; letter-spacing: .1em; text-transform: uppercase; }
#main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-weight: 760; }
.nav-item span { width: 22px; color: var(--subtle); font: 10px ui-monospace, Consolas, monospace; }
.nav-item:hover { color: var(--text); border-color: var(--line); }
.nav-item.active { color: var(--inverse-text); background: var(--inverse-bg); }
.nav-item.active span { color: var(--inverse-text); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 15px 7px 0; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
.user-chip strong, .user-chip small { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: var(--muted); margin-top: 2px; font-size: 10px; }
.profile-trigger { max-width: calc(100% - 48px); padding: 5px; border: 0; border-radius: 7px; color: var(--text); background: transparent; text-align: left; }
.profile-trigger:hover { background: var(--surface-3); }
.profile-trigger-copy { min-width: 0; }
.profile-chevron { margin-left: auto; color: var(--subtle); font-size: 18px; }

.workspace { min-width: 0; padding: 0 34px 44px; }
.topbar { min-height: 100px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.theme-toggle { position: relative; width: 58px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: var(--surface-2); box-shadow: inset 0 1px rgba(255, 255, 255, .04); }
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-3); }
.theme-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.theme-track { position: absolute; inset: 2px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.theme-symbol { position: relative; z-index: 2; display: grid; place-items: center; font-size: 14px; line-height: 1; transition: color .28s ease, opacity .28s ease; }
.theme-thumb { position: absolute; z-index: 1; left: 1px; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--inverse-bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .28); transform: translateX(26px); transition: transform .34s cubic-bezier(.2, .8, .2, 1), background .28s ease; }
:root[data-theme="light"] .theme-thumb { transform: translateX(0); }
:root[data-theme="dark"] .theme-moon, :root[data-theme="light"] .theme-sun { color: var(--inverse-text); }
:root[data-theme="dark"] .theme-sun, :root[data-theme="light"] .theme-moon { color: var(--subtle); opacity: .62; }

html.theme-transitioning::view-transition-old(root) { z-index: 1; animation: none; }
html.theme-transitioning::view-transition-new(root) { z-index: 9999; animation: theme-diagonal-reveal .58s cubic-bezier(.2, .75, .15, 1) both; }
.theme-wipe-overlay { position: fixed; z-index: 9998; inset: 0; opacity: 0; clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0); pointer-events: none; }
.theme-wipe-overlay.to-light { background: #f3f3f3; }
.theme-wipe-overlay.to-dark { background: #111; }
.theme-wipe-overlay.active { animation: theme-fallback-reveal .62s cubic-bezier(.2, .75, .15, 1) both; }
@keyframes theme-diagonal-reveal {
  from { clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0); }
  to { clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 0); }
}
@keyframes theme-fallback-reveal {
  0% { opacity: 1; clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0); }
  72% { opacity: 1; clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 0); }
  100% { opacity: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 0); }
}
.command-trigger { display: inline-flex; align-items: center; gap: 8px; }
kbd { display: inline-grid; min-width: 19px; height: 18px; place-items: center; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--surface-2); font: 8px ui-monospace, SFMono-Regular, Consolas, monospace; }
.menu-button { display: none; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 780; }
.pill.solid { color: var(--inverse-text); background: var(--inverse-bg); border-color: var(--inverse-bg); }
.pill.health-ok::before, .pill.health-warning::before, .pill.health-error::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.pill.health-warning { border-style: dashed; }
.pill.health-error { color: var(--inverse-text); border-color: var(--inverse-bg); background: var(--inverse-bg); }
.view { display: none; animation: reveal .18s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.banner { padding: 13px 15px; border: 1px solid var(--line-strong); border-left: 4px solid var(--text); border-radius: 8px; margin-bottom: 20px; color: var(--text); background: var(--surface-2); line-height: 1.5; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel, .integration-card, .editor-card { border: 1px solid var(--line); background: var(--surface); }
.metric-card { padding: 19px; border-radius: 12px; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; }
.metric-card strong { display: block; font-size: 36px; margin: 10px 0 2px; letter-spacing: -.055em; }
.metric-card small { color: var(--subtle); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.panel { border-radius: 14px; padding: 21px; margin-bottom: 16px; }
.intro-panel { padding: 26px; }
.intro-panel .muted { max-width: 850px; line-height: 1.7; margin-bottom: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.bot-summary { display: grid; gap: 9px; }
.summary-row { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-row strong { font-size: 13px; }
.task-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.task-tag { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--subtle); font-size: 10px; }
.task-tag.on { color: var(--text); border-color: var(--line-strong); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action-button { padding: 13px; text-align: left; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.action-button:hover { border-color: var(--text); }
.action-button span, .action-button small { display: block; }
.action-button span { font-size: 12px; font-weight: 820; }
.action-button small { color: var(--muted); margin-top: 5px; font-size: 9px; line-height: 1.4; }
.console-output { min-height: 76px; max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 14px 0 0; padding: 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.diagnostics-list { display: grid; gap: 7px; }
.diagnostic { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 7px; font-size: 11px; color: var(--muted); background: var(--surface-2); }
.diagnostic.error { color: var(--text); border-left-color: var(--text); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 28px 0 13px; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.integration-card { border-radius: 14px; padding: 20px; display: flex; flex-direction: column; min-height: 270px; }
.integration-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.integration-logo { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-weight: 900; font-size: 12px; }
.integration-card h3 { margin: 14px 0 3px; font-size: 18px; }
.integration-meta { color: var(--muted); font-size: 11px; line-height: 1.55; word-break: break-all; }
.integration-status { padding: 11px; margin: 16px 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-2); font: 10px/1.5 ui-monospace, Consolas, monospace; word-break: break-word; }
.integration-card .button-row { margin-top: auto; }
.login-dialog { width: min(1180px, calc(100vw - 40px)); height: min(780px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.login-dialog::backdrop { background: rgba(3, 7, 12, .78); backdrop-filter: blur(7px); }
.login-dialog-layout { height: 100%; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.login-guide { display: flex; flex-direction: column; gap: 22px; padding: 28px; border-right: 1px solid var(--line); background: var(--surface-2); }
.login-guide h2 { margin: 0; font-size: 24px; }
.login-guide ol { margin: 4px 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.login-state { padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 12px; line-height: 1.5; }
.login-state.success { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.login-guide .fine-print { margin-top: auto; }
.qr-stage { display: grid; place-content: center; justify-items: center; gap: 20px; padding: 36px; background: radial-gradient(circle, var(--accent-soft), transparent 54%), var(--surface); }
.qr-image-shell { position: relative; width: min(390px, 70vw); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .28); }
.qr-image-shell img { display: none; width: 100%; height: 100%; padding: 18px; object-fit: contain; image-rendering: crisp-edges; }
.qr-image-shell img.loaded { display: block; }
.qr-placeholder { display: grid; justify-items: center; gap: 8px; padding: 30px; color: #3a4350; text-align: center; }
.qr-placeholder small { color: #798393; }
.qr-spinner { width: 32px; height: 32px; margin-bottom: 8px; border: 3px solid #dce2ea; border-top-color: #315fbd; border-radius: 50%; animation: qr-spin .8s linear infinite; }
.qr-stage > p { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.qr-stage.success .qr-image-shell::after { content: "✓  已登录"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(12, 15, 20, .82); font-size: 28px; font-weight: 850; }
@keyframes qr-spin { to { transform: rotate(360deg); } }

.settings-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); align-items: start; gap: 42px; max-width: 1240px; margin: 0 auto; }
.settings-progress { position: sticky; top: 20px; padding-right: 24px; border-right: 1px solid var(--line); }
.progress-intro { padding: 4px 0 22px; }
.progress-intro strong, .progress-intro small { display: block; }
.progress-intro strong { font-size: 17px; }
.progress-intro small { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-progress nav { position: relative; display: grid; gap: 2px; }
.settings-progress nav::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 1px; background: var(--line); }
.settings-step { position: relative; z-index: 1; display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 11px; width: 100%; padding: 9px 7px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; text-align: left; }
.settings-step > span { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); font: 10px ui-monospace, Consolas, monospace; }
.settings-step strong, .settings-step small { display: block; }
.settings-step strong { font-size: 12px; }
.settings-step small { margin-top: 2px; color: var(--subtle); font-size: 10px; }
.settings-step:hover { color: var(--text); background: var(--surface-2); }
.settings-step.active { color: var(--text); background: var(--accent-soft); }
.settings-step.active > span { color: var(--inverse-text); border-color: var(--inverse-bg); background: var(--inverse-bg); }
.settings-step.completed > span { color: var(--text); border-color: var(--accent); background: var(--surface); }
.settings-step.completed > span::after { content: "✓"; font-size: 13px; }
.settings-step.completed > span { font-size: 0; }
.settings-workspace { min-width: 0; padding-bottom: 92px; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.section-title { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.section-title .muted { line-height: 1.6; margin-bottom: 0; }
.split-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.switch-field { grid-template-columns: 1fr auto; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-field span strong, .switch-field span small { display: block; }
.switch-field span strong { color: var(--text); font-size: 12px; }
.switch-field span small { color: var(--muted); margin-top: 3px; font-weight: 500; }
.code-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.settings-actions { position: sticky; z-index: 5; bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 38px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(12px); }

.bot-editor-list { display: grid; gap: 14px; }
.editor-card { border-radius: 14px; overflow: hidden; box-shadow: 0 16px 45px rgba(0, 0, 0, .08); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.editor-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.editor-index { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font: 10px ui-monospace, Consolas, monospace; }
.editor-title strong, .editor-title small { display: block; }
.editor-title small { color: var(--muted); margin-top: 2px; }
.editor-body { padding: 16px; }
.connection-hint { display: grid; gap: 4px; margin: 20px -16px -16px; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); background: var(--accent-soft); font-size: 11px; line-height: 1.5; }
.connection-hint strong { color: var(--text); }
.orchestration-link-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.orchestration-link-card strong, .orchestration-link-card small { display: block; }
.orchestration-link-card strong { color: var(--text); font-size: 11px; }
.orchestration-link-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.workflow-list { padding: 0 18px; }
.task-card { border-bottom: 1px solid var(--line); }
.task-card:last-child { border-bottom: 0; }
.task-master { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 19px 0; }
.task-master strong, .task-master small { display: block; }
.task-master strong { font-size: 13px; }
.task-master small { color: var(--muted); margin-top: 4px; line-height: 1.45; }
.task-detail { display: none; grid-template-columns: 1fr 1fr; gap: 13px 20px; padding: 0 0 20px; }
.task-card.active .task-detail { display: grid; }
.featured-switch { padding: 14px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent-soft); }
.task-note { grid-column: span 2; margin: 0; padding: 10px 12px; border-left: 2px solid var(--accent); color: var(--muted); background: var(--surface-2); font-size: 10px; line-height: 1.5; }
.empty-editor { padding: 30px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; color: var(--muted); }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-grid article { display: grid; gap: 7px; min-height: 130px; padding: 18px; border-top: 2px solid var(--accent); background: var(--surface); }
.review-grid span { color: var(--muted); font-size: 11px; }
.review-grid strong { font-size: 20px; }
.review-grid small { color: var(--subtle); line-height: 1.5; }
.review-notice { display: grid; gap: 5px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.review-notice span { color: var(--muted); font-size: 11px; }

.records-heading { align-items: center; }
.record-filter-bar { display: grid; grid-template-columns: 150px 180px 150px minmax(220px, 1fr) 82px auto; align-items: end; gap: 8px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.record-filter-bar label { gap: 5px; font-size: 9px; }
.record-filter-bar input, .record-filter-bar select { padding: 7px 8px; font-size: 10px; }
.record-filter-bar button { margin-bottom: 1px; }
.records-table { overflow: auto; }
.record-list { display: grid; gap: 9px; }
.record-item { border: 1px solid var(--line); border-radius: 8px; padding: 13px; background: var(--surface-2); }
.record-summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; cursor: pointer; list-style: none; }
.record-summary::-webkit-details-marker { display: none; }
.record-summary::before { content: "›"; flex: 0 0 auto; color: var(--subtle); font-size: 16px; transition: transform .14s; }
.record-item[open] .record-summary::before { transform: rotate(90deg); }
.record-summary > div { min-width: 0; flex: 1; }
.record-summary strong, .record-summary small { display: block; }
.record-summary strong { color: var(--text); }
.record-summary small { max-width: 720px; margin-top: 4px; overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.record-summary > span { flex: 0 0 auto; font: 9px ui-monospace, Consolas, monospace; }
.record-item pre { margin: 12px 0 0; padding: 11px; border-top: 1px solid var(--line); color: var(--muted); background: var(--bg); font: 10px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.records-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; }
.records-pagination #records-page { min-width: 56px; text-align: center; }
.empty-state { color: var(--muted); padding: 50px 10px; text-align: center; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 420px; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--inverse-text); background: var(--inverse-bg); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-style: dashed; }

.command-dialog { width: min(640px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 60px)); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: color-mix(in srgb, var(--surface) 97%, transparent); box-shadow: 0 30px 100px rgba(0, 0, 0, .52); backdrop-filter: blur(24px); }
.command-dialog::backdrop { background: rgba(0, 0, 0, .56); backdrop-filter: blur(4px); }
.command-dialog > header { display: grid; grid-template-columns: 24px minmax(0, 1fr) 28px; align-items: center; gap: 7px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.command-icon { color: var(--muted); font-size: 18px; text-align: center; }
.command-dialog > header input { padding: 7px 3px; border: 0; background: transparent; box-shadow: none; font-size: 13px; }
.command-dialog > header input:focus { border: 0; box-shadow: none; }
.command-dialog > header button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 18px; }
.command-dialog > header button:hover { color: var(--text); background: var(--surface-3); }
.command-results { max-height: min(480px, calc(100vh - 180px)); overflow: auto; padding: 6px; }
.command-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) 24px; align-items: center; gap: 9px; width: 100%; min-height: 50px; padding: 7px 9px; border: 0; border-radius: 6px; color: var(--text); background: transparent; text-align: left; }
.command-item.active { background: var(--surface-3); box-shadow: inset 2px 0 var(--text); }
.command-category { color: var(--subtle); font: 8px ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.command-item strong, .command-item small { display: block; }
.command-item strong { font-size: 11px; }
.command-item small { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.command-arrow { color: var(--subtle); text-align: center; opacity: 0; }
.command-item.active .command-arrow { opacity: 1; }
.command-empty { padding: 46px 20px; color: var(--subtle); text-align: center; font-size: 11px; }
.command-dialog > footer { display: flex; align-items: center; gap: 16px; padding: 7px 12px; border-top: 1px solid var(--line); color: var(--subtle); background: var(--surface-2); font-size: 8px; }
.command-dialog > footer span { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .integration-grid { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .record-filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-search { grid-column: span 2; }
}
@media (max-width: 840px) {
  .auth-layout { grid-template-columns: 1fr; padding: 28px 20px; }
  .auth-brand { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; width: 250px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .workspace { padding: 0 18px 34px; }
  .menu-button { display: block; }
  .topbar { min-height: 86px; }
  .topbar-actions .pill { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-progress { position: static; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .progress-intro { display: none; }
  .settings-progress nav { display: flex; min-width: max-content; }
  .settings-progress nav::before { display: none; }
  .settings-step { width: 150px; }
  .settings-step small { display: none; }
  .login-dialog-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(420px, 1fr); }
  .login-guide { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-guide ol, .login-guide .fine-print { display: none; }
  .login-guide .button-row { grid-column: 1 / -1; }
  .qr-stage { min-height: 420px; padding: 24px; }
  .qr-image-shell { width: min(330px, 72vw); }
}
@media (max-width: 580px) {
  .metric-grid, .form-grid, .task-detail, .review-grid { grid-template-columns: 1fr; }
  .span-2, .task-note { grid-column: span 1; }
  .topbar-actions #refresh-button { display: none; }
  .command-trigger > span { display: none; }
  .auth-card, .panel, .integration-card { padding: 18px; }
  .record-summary, .settings-actions, .split-title { align-items: flex-start; flex-direction: column; }
  .settings-actions { bottom: 8px; }
  .settings-actions .button-row { width: 100%; }
  .settings-actions .button { flex: 1; }
  .summary-row { grid-template-columns: 1fr; gap: 7px; }
  .record-filter-bar { grid-template-columns: 1fr 1fr; }
  .record-search { grid-column: span 2; }
  .records-pagination { align-items: flex-start; flex-direction: column; }
}

/* Desktop workbench refresh: quiet Win11 / Codex / VS Code surfaces. */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: var(--line-strong); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
.app-shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { padding: 14px 10px 10px; background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(24px); }
.sidebar-brand { gap: 10px; min-height: 52px; padding: 4px 9px 16px; }
.sidebar-logo { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-brand strong { font-size: 14px; letter-spacing: -.01em; }
.sidebar-brand span { font-size: 9px; letter-spacing: .08em; }
#main-nav { gap: 2px; }
.nav-item { gap: 10px; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 6px; font-size: 12px; font-weight: 580; }
.nav-item:hover { border: 0; background: var(--surface-2); }
.nav-item.active { color: var(--text); background: var(--surface-3); box-shadow: inset 2px 0 var(--text); }
.nav-item.active span { color: inherit; }
.nav-item > .nav-glyph { width: 18px; color: var(--muted); font: 15px/1 "Segoe UI Symbol", sans-serif; text-align: center; }
.nav-item > span:not(.nav-glyph) { width: auto; color: inherit; font: inherit; }
.sidebar-footer { padding: 12px 7px 0; }
.avatar { width: 28px; height: 28px; border-radius: 7px; font-size: 11px; }
.user-chip strong { font-size: 11px; }
.user-chip small { font-size: 9px; }
.workspace { padding: 0 28px 32px; }
.topbar { min-height: 68px; margin-bottom: 22px; }
.topbar h1 { font-size: 19px; font-weight: 640; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 3px; font-size: 8px; }
.topbar-actions { gap: 6px; }
.button { border-color: var(--line); border-radius: 6px; padding: 7px 12px; font-size: 11px; font-weight: 620; box-shadow: none; }
.button:hover { transform: none; border-color: var(--line-strong); background: var(--surface-3); }
.button.primary { border-color: var(--text); color: var(--inverse-text); background: var(--inverse-bg); }
.button.compact { padding: 5px 9px; }
.pill { border-color: var(--line); border-radius: 5px; padding: 4px 8px; font-size: 10px; font-weight: 620; }
input, textarea, select { border-radius: 6px; padding: 9px 10px; background: var(--surface-2); }
.metric-card, .panel, .integration-card, .editor-card { border-color: var(--line); border-radius: 8px; box-shadow: none; }
.metric-card { padding: 16px; }
.metric-card strong { margin: 7px 0 1px; font-size: 30px; }
.panel { padding: 18px; }
.auth-card { border-radius: 12px; }
.auth-layout { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; }
.auth-card, .auth-brand { position: relative; z-index: 1; }
.auth-layout::before { content: ""; position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(2px); }

.orchestration-view { margin: 0 -28px -32px; }
.orchestration-shell { display: grid; grid-template-rows: 46px minmax(0, 1fr) 25px; height: calc(100vh - 90px); min-height: 650px; overflow: hidden; border-top: 1px solid var(--line); background: var(--surface); }
.orchestration-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.toolbar-cluster { display: flex; align-items: center; gap: 5px; }
.graph-search { width: min(280px, 24vw); display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 3px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--subtle); background: var(--surface-2); }
.graph-search:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 1px var(--line-strong); }
.graph-search > span { font-size: 14px; text-align: center; }
.graph-search input { min-width: 0; padding: 5px 3px; border: 0; background: transparent; box-shadow: none; font-size: 10px; }
.graph-search input:focus { border: 0; box-shadow: none; }
.graph-legend { color: var(--subtle); font-size: 9px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 5px; margin: 0 4px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.legend-dot.group { border: 1px solid var(--muted); background: transparent; }
.legend-dot.knowledge { border-radius: 1px; background: var(--text); }
.save-state { margin-right: 6px; color: var(--subtle); font-size: 9px; }
.orchestration-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 342px; }
.orchestration-viewport { position: relative; min-width: 0; min-height: 0; overflow: auto; background: var(--bg); }
.orchestration-canvas { position: relative; width: 1800px; height: 1100px; overflow: hidden; outline: 0; }
.canvas-grid { position: absolute; inset: 0; opacity: .72; background-image: radial-gradient(circle, var(--line-strong) .75px, transparent .85px); background-size: 20px 20px; pointer-events: none; }
.orchestration-edges { position: absolute; inset: 0; width: 1800px; height: 1100px; overflow: visible; pointer-events: none; }
.orchestration-edges marker path { fill: var(--subtle); }
.edge-group { pointer-events: auto; }
.graph-edge { fill: none; stroke: var(--subtle); stroke-width: 1.25; opacity: .8; pointer-events: none; }
.graph-edge.disabled { stroke-dasharray: 4 5; opacity: .35; }
.graph-edge.temp { stroke: var(--text); stroke-dasharray: 5 4; opacity: .8; }
.graph-edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.edge-group:hover .graph-edge { stroke: var(--text); stroke-width: 1.8; opacity: 1; }
.graph-edge-label { fill: var(--subtle); font: 9px "Segoe UI", sans-serif; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.orchestration-node-layer { position: absolute; inset: 0; pointer-events: none; }
.graph-node { position: absolute; width: 220px; min-height: 104px; overflow: visible; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: color-mix(in srgb, var(--surface) 97%, transparent); box-shadow: 0 8px 28px rgba(0, 0, 0, .24); user-select: none; touch-action: none; pointer-events: auto; transition: border-color .12s, box-shadow .12s; }
.graph-node:hover { border-color: var(--muted); }
.graph-node:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.graph-node.selected { border-color: var(--text); box-shadow: 0 0 0 1px var(--text), 0 12px 35px rgba(0, 0, 0, .32); }
.graph-node.disabled { opacity: .58; }
.graph-node.search-muted { opacity: .16; filter: grayscale(1); pointer-events: none; }
.graph-node.search-match { border-color: var(--muted); }
.node-accent { position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 8px 0 0 8px; background: var(--muted); }
.graph-node.qq_group .node-accent, .graph-node.feishu_group .node-accent { background: var(--line-strong); }
.graph-node.knowledge_base .node-accent { width: 5px; background: var(--text); }
.node-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) 8px; align-items: center; gap: 9px; padding: 13px 13px 9px 15px; }
.node-glyph { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface-2); font: 700 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.node-kind, .node-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-kind { margin-bottom: 3px; color: var(--subtle); font: 8px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.node-name { font-size: 12px; font-weight: 630; }
.node-state { width: 6px; height: 6px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.graph-node.disabled .node-state { background: var(--subtle); box-shadow: none; }
.node-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 13px 10px 15px; border-top: 1px solid var(--line); color: var(--subtle); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.node-detail { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-port { position: absolute; z-index: 3; right: -7px; top: calc(50% - 7px); width: 14px; height: 14px; padding: 0; border: 2px solid var(--bg); border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 1px var(--line-strong); cursor: crosshair; }
.node-port:hover { background: var(--text); transform: scale(1.12); }
.canvas-empty { position: absolute; left: 50%; top: 42%; width: 340px; display: grid; justify-items: center; gap: 7px; transform: translate(-50%, -50%); color: var(--subtle); text-align: center; pointer-events: none; }
.canvas-empty .empty-glyph { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font-size: 20px; }
.canvas-empty strong { color: var(--muted); font-size: 13px; }
.canvas-empty small { max-width: 300px; line-height: 1.55; }
.orchestration-inspector { min-width: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--surface); }
.inspector-empty { display: grid; align-content: center; justify-items: center; min-height: 100%; padding: 38px; color: var(--subtle); text-align: center; }
.inspector-empty span { font: 9px ui-monospace, Consolas, monospace; letter-spacing: .15em; }
.inspector-empty strong { margin-top: 14px; color: var(--muted); font-size: 14px; }
.inspector-empty p { max-width: 240px; margin: 8px 0 0; font-size: 11px; line-height: 1.65; }
#inspector-content { padding-bottom: 18px; }
.inspector-header { position: sticky; z-index: 4; top: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) 28px; align-items: center; gap: 10px; min-height: 66px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); }
.inspector-header .node-glyph { width: 34px; height: 34px; }
.inspector-header small, .inspector-header h3 { display: block; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector-header small { margin-bottom: 3px; color: var(--subtle); font: 8px ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.inspector-header h3 { font-size: 13px; }
.inspector-close { width: 26px; height: 26px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 18px; }
.inspector-close:hover { color: var(--text); background: var(--surface-3); }
.inspector-form, .inspector-section { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.inspector-section h4 { margin: 0 0 2px; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.inspector-form label, .inspector-section label { font-size: 10px; }
.inspector-form .switch-field { padding: 7px 0 0; border: 0; }
.inspector-status { min-height: 58px; max-height: 150px; overflow: auto; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--bg); font: 9px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.inspector-muted { margin: 0; color: var(--subtle); font-size: 10px; line-height: 1.55; }
.inspector-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.inspector-metrics div { padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.inspector-metrics span, .inspector-metrics strong { display: block; }
.inspector-metrics span { color: var(--subtle); font-size: 8px; }
.inspector-metrics strong { margin-top: 3px; font-size: 15px; }
.group-activity { display: grid; gap: 12px; }
.group-activity > .inspector-section { padding: 0; border: 0; }
.connection-list { display: grid; gap: 5px; }
.connection-list > div { display: grid; grid-template-columns: minmax(0, 1fr) 78px 24px; align-items: center; gap: 5px; }
.connection-list span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.connection-list select { padding: 5px 6px; font-size: 9px; }
.connection-list button { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-2); }
.assignment-task-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.assignment-task-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.assignment-task-editor > header strong, .assignment-task-editor > header small { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-task-editor > header strong { font-size: 10px; }
.assignment-task-editor > header small { margin-top: 3px; color: var(--subtle); font: 8px ui-monospace, Consolas, monospace; }
.assignment-task-editor .workflow-list { padding: 0 10px; }
.assignment-task-editor .task-master { padding: 12px 0; }
.assignment-task-editor .task-master strong { font-size: 11px; }
.assignment-task-editor .task-master small { font-size: 9px; }
.assignment-task-editor .task-detail { grid-template-columns: 1fr; gap: 8px; padding-bottom: 12px; }
.assignment-task-editor .switch-field { min-height: 34px; padding: 7px; }
#inspector-content > .button.danger { width: calc(100% - 28px); margin: 14px; }
.orchestration-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 10px; border-top: 1px solid var(--line); color: var(--subtle); background: var(--surface); font: 8px ui-monospace, Consolas, monospace; }
.context-menu { position: fixed; z-index: 120; width: 238px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 8px; background: color-mix(in srgb, var(--surface) 97%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.context-menu-label { padding: 6px 9px 7px; color: var(--subtle); font: 8px ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .12em; }
.context-menu button { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 5px; color: var(--text); background: transparent; text-align: left; }
.context-menu button:hover { background: var(--surface-3); }
.context-menu button.danger-action { color: var(--danger); }
.context-menu button.danger-action:hover { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.context-menu button > span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; font: 700 10px ui-monospace, Consolas, monospace; }
.context-menu strong, .context-menu small { display: block; }
.context-menu strong { font-size: 10px; }
.context-menu small { margin-top: 2px; color: var(--subtle); font-size: 8px; }
.context-menu-separator { height: 1px; margin: 4px 5px; background: var(--line); }
@media (max-width: 1050px) {
  .orchestration-body { grid-template-columns: minmax(0, 1fr) 300px; }
  .graph-legend { display: none; }
  .graph-search { width: min(240px, 28vw); }
}
@media (max-width: 840px) {
  .app-shell { grid-template-columns: 1fr; }
  .workspace { padding: 0 16px 24px; }
  .orchestration-view { margin: 0 -16px -24px; }
  .orchestration-shell { height: calc(100vh - 86px); }
  .orchestration-body { position: relative; grid-template-columns: minmax(0, 1fr); }
  .orchestration-inspector { position: absolute; z-index: 15; right: 0; top: 0; bottom: 0; width: min(342px, 92vw); box-shadow: -18px 0 50px rgba(0, 0, 0, .36); }
  .orchestration-inspector:has(.inspector-empty:not(.hidden)) { display: none; }
  .orchestration-toolbar .save-state { display: none; }
  .graph-search { width: 210px; }
}
@media (max-width: 580px) {
  .orchestration-toolbar { overflow-x: auto; justify-content: flex-start; }
  .orchestration-toolbar > .toolbar-cluster:last-child { margin-left: auto; }
  .orchestration-statusbar span:last-child { display: none; }
}

/* Multi-user access management. */
.user-management-layout { display: grid; grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); align-items: start; gap: 18px; }
.user-create-panel { position: sticky; top: 18px; }
.user-management-intro { margin: -4px 0 0; line-height: 1.7; }
.user-create-panel label small { color: var(--subtle); font-weight: 500; line-height: 1.5; }
.user-list { display: grid; gap: 9px; }
.user-card { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(160px, .8fr) auto; align-items: center; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.user-card-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-card-identity > div { min-width: 0; }
.user-card-identity strong, .user-card-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-identity small { margin-top: 4px; color: var(--muted); }
.user-card-avatar { flex: none; width: 36px; height: 36px; }
.user-card-status { display: grid; justify-items: start; gap: 6px; color: var(--subtle); }
.pill.attention { border-style: dashed; color: var(--text); }
.user-card-actions { flex-wrap: nowrap; justify-content: flex-end; }
.user-card-actions .button { white-space: nowrap; }
.protected-user-label { color: var(--subtle); white-space: nowrap; }
.form-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.form-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(5px); }
.form-dialog > form { padding: 22px; }
.form-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.form-dialog h2 { margin: 0; }
.form-dialog header .icon-button { width: 32px; height: 32px; font-size: 24px; }
.form-dialog > form > .muted { line-height: 1.65; }
.form-dialog footer { justify-content: flex-end; margin-top: 22px; }
.node-detail-dialog { width: min(1120px, calc(100vw - 48px)); max-height: min(880px, calc(100vh - 32px)); overflow: hidden; }
.node-detail-dialog > form { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; max-height: min(880px, calc(100vh - 32px)); padding: 0; }
.node-detail-dialog header { padding: 20px 22px 16px; }
.node-detail-dialog > form > .muted { margin: 0; padding: 13px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.node-detail-body { min-height: 0; overflow: auto; padding: 0 22px; }
.node-detail-section { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.node-detail-section:last-child { border-bottom: 0; }
.node-detail-section-title span, .node-detail-section-title h3 { display: block; margin: 0; }
.node-detail-section-title span { color: var(--subtle); font: 10px ui-monospace, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.node-detail-section-title h3 { margin-top: 5px; font-size: 14px; }
.node-detail-section-content { min-width: 0; }
.node-detail-section-content > .muted { margin: 0 0 14px; }
.node-feature-settings { display: block; }
.node-detail-section-heading { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: start; gap: 20px; }
.node-detail-section-heading > .muted { margin: 0; line-height: 1.65; }
.node-feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-top: 18px; }
.node-feature-list .assignment-task-editor { min-width: 0; }
.node-feature-list .assignment-task-editor .task-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.node-detail-section .form-grid { margin: 0; }
.node-detail-section input[readonly] { color: var(--muted); background: var(--surface-2); cursor: not-allowed; }
.node-detail-section label > small { display: block; margin-top: 5px; color: var(--subtle); font-size: 10px; line-height: 1.45; }
.node-detail-lock-notice { margin: 18px 0 0; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--line)); border-radius: 7px; color: var(--muted); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); font-size: 11px; line-height: 1.55; }
.node-detail-dialog footer { margin: 0; padding: 16px 22px 20px; border-top: 1px solid var(--line); background: var(--surface); }

@media (max-width: 720px) {
  .node-detail-section { grid-template-columns: 1fr; gap: 12px; }
  .node-detail-section-heading { grid-template-columns: 1fr; gap: 12px; }
  .node-feature-list, .node-feature-list .assignment-task-editor .task-detail { grid-template-columns: 1fr; }
}
.profile-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 32px)); overflow: auto; }
.profile-dialog-body, .value-dialog-body { padding: 22px; }
.profile-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; margin: 18px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.profile-summary strong, .profile-summary small { display: block; }
.profile-summary small { margin-top: 3px; color: var(--muted); }
.profile-avatar { width: 42px; height: 42px; border-radius: 10px; }
.profile-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.profile-section { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.profile-section h3 { margin: 0; font-size: 17px; }
.profile-section p { margin: 7px 0 0; line-height: 1.6; }
.profile-section .stack-lg { gap: 13px; margin-top: 18px; }
.profile-section .button { justify-self: start; }
.profile-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }
.confirm-dialog { width: min(480px, calc(100vw - 32px)); }
.confirm-dialog-body { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; padding: 24px; }
.confirm-dialog-body footer { grid-column: 1 / -1; }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: var(--surface-2); font: 700 19px ui-monospace, Consolas, monospace; }
.confirm-dialog h2 { margin: 0; font-size: 24px; }
.confirm-dialog #confirm-message { margin: 10px 0 0; line-height: 1.65; white-space: pre-line; }
.confirm-dialog.danger .confirm-icon { border-style: dashed; }
.confirm-dialog.danger #confirm-accept { border-style: dashed; color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.value-dialog { width: min(600px, calc(100vw - 32px)); }
.value-dialog #value-message { line-height: 1.65; }
.value-dialog textarea { min-height: 118px; resize: none; }

@media (prefers-reduced-motion: reduce) {
  html.theme-transitioning::view-transition-new(root) { animation-duration: .01ms; }
  .theme-wipe-overlay.active { animation-duration: .01ms; }
  .theme-thumb, .theme-symbol { transition-duration: .01ms; }
}

/* Readable type scale: roughly 25% larger across the workbench. */
.eyebrow { font-size: 12.5px; }
.lead { font-size: 22.5px; }
.auth-card h2, .panel h2, .section-title h2, .section-heading h2 { font-size: 30px; }
.fine-print { font-size: 13.75px; }
label { font-size: 15px; }
.icon-button, .menu-button { font-size: 15px; }
.sidebar-brand strong { font-size: 17.5px; }
.sidebar-brand span { font-size: 11.25px; }
.nav-item { font-size: 15px; }
.nav-item > .nav-glyph { font-size: 18px; }
.user-chip strong { font-size: 13.75px; }
.user-chip small { font-size: 11.25px; }
.avatar { font-size: 13.75px; }
.topbar h1 { font-size: 24px; }
.topbar .eyebrow { font-size: 10px; }
.button { font-size: 13.75px; }
.pill { font-size: 12.5px; }
.banner, .metric-card span { font-size: 15px; }
.metric-card strong { font-size: 37.5px; }
.summary-row strong { font-size: 16.25px; }
.task-tag { font-size: 12.5px; }
.action-button span { font-size: 15px; }
.action-button small { font-size: 11.25px; }
.console-output { font-size: 13.75px; }
.diagnostic { font-size: 13.75px; }
.integration-logo { font-size: 15px; }
.integration-card h3 { font-size: 22.5px; }
.integration-meta { font-size: 13.75px; }
.integration-status { font-size: 12.5px; }
.login-guide h2 { font-size: 30px; }
.login-guide ol { font-size: 16.25px; }
.login-state, .qr-stage > p { font-size: 15px; }
.progress-intro strong { font-size: 21.25px; }
.progress-intro small { font-size: 13.75px; }
.settings-step > span { font-size: 12.5px; }
.settings-step strong { font-size: 15px; }
.settings-step small { font-size: 12.5px; }
.switch-field span strong { font-size: 15px; }
.code-input { font-size: 13.75px; }
.editor-index { font-size: 12.5px; }
.connection-hint { font-size: 13.75px; }
.orchestration-link-card strong { font-size: 13.75px; }
.orchestration-link-card small { font-size: 11.25px; }
.task-master strong { font-size: 16.25px; }
.task-note { font-size: 12.5px; }
.review-grid span, .review-notice span { font-size: 13.75px; }
.review-grid strong { font-size: 25px; }
.record-filter-bar label { font-size: 11.25px; }
.record-filter-bar input, .record-filter-bar select { font-size: 12.5px; }
.record-summary { font-size: 13.75px; }
.record-summary small, .record-summary > span { font-size: 11.25px; }
.record-item pre { font-size: 12.5px; }
.records-pagination { font-size: 11.25px; }
.command-category, .command-dialog > footer { font-size: 10px; }
.command-item strong, .command-empty { font-size: 13.75px; }
.command-item small { font-size: 11.25px; }
.user-card-identity strong { font-size: 15px; }
.user-card-identity small, .user-card-status small, .protected-user-label { font-size: 12.5px; }

/* Graph node text grows more conservatively to preserve dense network layouts. */
.graph-edge-label { font-size: 10.35px; }
.node-glyph { font-size: 15px; }
.node-kind { font-size: 9.2px; }
.node-name { font-size: 13.8px; }
.node-meta { font-size: 10.35px; }
.canvas-empty strong { font-size: 16.25px; }
.inspector-empty span { font-size: 11.25px; }
.inspector-empty strong { font-size: 17.5px; }
.inspector-empty p { font-size: 13.75px; }
.inspector-header small { font-size: 10px; }
.inspector-header h3 { font-size: 16.25px; }
.inspector-section h4, .inspector-form label, .inspector-section label { font-size: 12.5px; }
.inspector-status { font-size: 11.25px; }
.inspector-muted { font-size: 12.5px; }
.inspector-metrics span { font-size: 10px; }
.inspector-metrics strong { font-size: 18.75px; }
.connection-list span { font-size: 12.5px; }
.connection-list select { font-size: 11.25px; }
.orchestration-statusbar, .context-menu-label { font-size: 10px; }
.context-menu button > span, .context-menu strong { font-size: 12.5px; }
.context-menu small { font-size: 10px; }

@media (max-width: 1120px) {
  .user-management-layout { grid-template-columns: 1fr; }
  .user-create-panel { position: static; }
}
@media (max-width: 720px) {
  .user-card { grid-template-columns: 1fr; }
  .user-card-actions { justify-content: flex-start; }
  .profile-settings-grid { grid-template-columns: 1fr; }
  .profile-footer { align-items: flex-start; flex-direction: column; }
}

/* Group workspace: a group-centric record browser opened from the orchestration graph. */
.group-workspace-dialog { width: min(1460px, calc(100vw - 28px)); height: min(900px, calc(100vh - 28px)); max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: 0 32px 120px rgba(0, 0, 0, .58); }
.group-workspace-dialog::backdrop { background: rgba(3, 6, 10, .76); backdrop-filter: blur(7px); }
.group-workspace-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.group-workspace-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); }
.group-workspace-identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.group-workspace-identity h2 { max-width: 540px; margin: 0; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.group-workspace-identity .eyebrow { margin-bottom: 4px; font-size: 8px; }
.group-workspace-identity small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.group-workspace-avatar { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--inverse-text); background: var(--inverse-bg); font-weight: 900; }
.group-workspace-header .icon-button { width: 34px; height: 34px; font-size: 24px; }
.group-workspace-layout { min-height: 0; display: grid; grid-template-columns: 168px minmax(460px, 1fr) 270px; }
.group-workspace-tabs { min-height: 0; display: flex; flex-direction: column; gap: 5px; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--surface-2); }
.group-workspace-tabs button { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 11px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; }
.group-workspace-tabs button:hover { color: var(--text); border-color: var(--line); background: var(--surface-3); }
.group-workspace-tabs button.active { color: var(--inverse-text); border-color: var(--inverse-bg); background: var(--inverse-bg); }
.group-workspace-tabs button > span { font-size: 12px; font-weight: 850; }
.group-workspace-tabs button > strong { grid-row: span 2; align-self: center; font: 800 14px ui-monospace, Consolas, monospace; }
.group-workspace-tabs button > small { color: var(--subtle); font-size: 9px; }
.group-workspace-tabs button.active > small { color: color-mix(in srgb, var(--inverse-text) 68%, transparent); }
.group-workspace-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg); }
.group-record-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) 145px auto; align-items: end; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.group-record-toolbar label { gap: 5px; font-size: 9px; }
.group-record-toolbar input, .group-record-toolbar select { min-height: 34px; padding: 7px 9px; font-size: 11px; }
.group-record-actions { flex-wrap: nowrap; }
.group-record-actions .button { min-height: 34px; padding: 7px 10px; white-space: nowrap; }
.group-record-content { min-height: 0; overflow: auto; padding: 18px clamp(14px, 3vw, 36px); background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line) 44%, transparent) 1px, transparent 0); background-size: 18px 18px; }
.group-record-content.announcements, .group-record-content.joins, .group-record-content.moderation { display: grid; align-content: start; gap: 11px; }
.group-record-content.loading { display: grid; place-items: center; }
.group-record-loading { color: var(--muted); text-align: center; }
.group-record-loading span { width: 24px; height: 24px; display: block; margin: 0 auto 10px; border: 2px solid var(--line-strong); border-top-color: var(--text); border-radius: 50%; animation: group-record-spin .8s linear infinite; }
@keyframes group-record-spin { to { transform: rotate(360deg); } }
.group-record-loading p { margin: 0; font-size: 11px; }
.group-record-empty { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--subtle); text-align: center; }
.group-record-empty > span { font-size: 32px; }
.group-record-empty strong { color: var(--muted); font-size: 14px; }
.group-record-empty p { max-width: 360px; margin: 0; font-size: 11px; line-height: 1.55; }
.group-record-pagination { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 13px; border-top: 1px solid var(--line); color: var(--subtle); background: var(--surface); font-size: 10px; }
.group-record-pagination .button { padding: 6px 10px; }
.group-workspace-info { min-height: 0; overflow: auto; padding: 17px 15px; border-left: 1px solid var(--line); background: var(--surface); }
.group-workspace-info section { padding-bottom: 18px; }
.group-workspace-info section + section { padding-top: 18px; border-top: 1px solid var(--line); }
.group-workspace-info h3 { margin: 0 0 12px; font-size: 13px; }
.group-workspace-info dl { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px 10px; margin: 0; font-size: 10px; line-height: 1.45; }
.group-workspace-info dt { color: var(--subtle); }
.group-workspace-info dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--muted); }
.group-manager-list { display: grid; gap: 7px; }
.group-manager-list article { display: grid; grid-template-columns: 30px minmax(0, 1fr) 8px; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.group-manager-list strong, .group-manager-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-manager-list strong { font-size: 10px; }
.group-manager-list small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.group-manager-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 10px; font-weight: 900; }
.group-manager-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }
.group-manager-list i.online { background: #6ecf8b; box-shadow: 0 0 0 3px color-mix(in srgb, #6ecf8b 13%, transparent); }
.group-archive-note { color: var(--muted); font-size: 10px; line-height: 1.6; }
.group-archive-note strong { color: var(--text); }
.group-archive-note p { margin: 7px 0 0; }

.qq-message-row { display: flex; align-items: flex-start; gap: 10px; max-width: min(760px, 92%); margin-bottom: 15px; }
.qq-message-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--surface-2); font-size: 11px; font-weight: 900; }
.qq-message-body { min-width: 0; }
.qq-message-meta { display: flex; align-items: baseline; gap: 9px; margin-bottom: 5px; }
.qq-message-meta strong { font-size: 11px; }
.qq-message-meta span { color: var(--subtle); font-size: 8px; }
.qq-message-bubble { width: fit-content; max-width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 3px 10px 10px 10px; color: var(--text); background: var(--surface); box-shadow: 0 4px 14px rgba(0, 0, 0, .1); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.qq-message-body > small { display: block; margin-top: 4px; color: var(--subtle); font: 8px ui-monospace, Consolas, monospace; }

.group-announcement-card, .group-join-card, .group-moderation-card { border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.group-announcement-card { padding: 16px; }
.group-announcement-card.deleted { border-style: dashed; opacity: .82; }
.group-announcement-card > header, .group-join-card header, .group-moderation-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.group-announcement-card h3 { margin: 0; font-size: 14px; }
.group-announcement-card header small, .group-join-card header small, .group-moderation-card header small { display: block; margin-top: 5px; color: var(--subtle); font-size: 9px; }
.group-announcement-card > p { margin: 15px 0; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.group-announcement-card > footer, .group-join-card footer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; line-height: 1.5; }
.group-status-tags { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.group-status-tag { display: inline-flex; align-items: center; min-height: 21px; padding: 3px 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 8px; font-weight: 800; white-space: nowrap; }
.group-status-tag.success { color: #70d48d; border-color: color-mix(in srgb, #70d48d 45%, var(--line)); background: color-mix(in srgb, #70d48d 8%, var(--surface)); }
.group-status-tag.danger { color: var(--danger); border-style: dashed; border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.group-status-tag.muted { color: var(--subtle); }
.group-join-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 15px; }
.group-join-avatar { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: var(--surface-2); font-weight: 900; }
.group-join-card header strong, .group-moderation-card header strong { font-size: 12px; }
.group-join-card p { margin: 13px 0; padding: 11px; border-radius: 7px; color: var(--text); background: var(--surface-2); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.group-moderation-card { padding: 15px; }
.group-moderation-card > p { margin: 12px 0; color: var(--muted); font-size: 11px; }
.group-finding-list { display: grid; gap: 7px; }
.group-finding-list article { padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.group-finding-list strong { font-size: 10px; text-transform: uppercase; }
.group-finding-list p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

@media (max-width: 1120px) {
  .group-workspace-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .group-workspace-info { display: none; }
}
@media (max-width: 760px) {
  .group-workspace-dialog { width: calc(100vw - 12px); height: calc(100vh - 12px); border-radius: 10px; }
  .group-workspace-header { min-height: 68px; padding: 10px 12px; }
  .group-workspace-header #group-workspace-refresh { display: none; }
  .group-workspace-avatar { width: 38px; height: 38px; border-radius: 10px; }
  .group-workspace-identity h2 { max-width: 42vw; font-size: 16px; }
  .group-workspace-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .group-workspace-tabs { flex-direction: row; overflow-x: auto; padding: 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .group-workspace-tabs button { min-width: 108px; padding: 8px; }
  .group-workspace-tabs button > small { display: none; }
  .group-record-toolbar { grid-template-columns: minmax(0, 1fr) 116px; }
  .group-record-actions { grid-column: 1 / -1; }
  .group-record-actions .button { flex: 1; }
  .group-record-content { padding: 14px 10px; }
  .qq-message-row { max-width: 100%; }
  .group-announcement-card > header, .group-join-card header, .group-moderation-card > header { flex-direction: column; }
  .group-status-tags { justify-content: flex-start; }
}
