:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f7f8fa;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #1e293b;
  --muted: #64748b;
  --faint: #8f98a8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16865c;
  --warning: #a76712;
  --danger: #c33d4b;
  --shadow: 0 12px 36px rgba(29, 41, 68, .14);
  --sidebar: 244px;
  --inspector: 328px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; }

body {
  min-width: 320px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:not(:disabled), select:not(:disabled), input[type="checkbox"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .52);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 12px;
  top: -50px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--text);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

.app-shell { height: 100dvh; min-height: 0; overflow: hidden; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) 0; background: var(--bg); }
.app-shell.inspector-open { grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--inspector); }

.sidebar,
.inspector {
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  overflow: hidden;
}

.sidebar {
  z-index: 20;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.brand-row {
  height: 66px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.brand-mark,
.dialog-brand {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
}

.brand-mark img,
.dialog-brand img { display: block; width: 100%; height: 100%; }

.brand-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.brand-copy strong { font-size: 14px; line-height: 1.3; }
.brand-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }

.icon-button,
.toolbar-button,
.mini-button,
.compact-tool,
.text-tool {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 5px;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 19px;
}
.icon-button:hover, .toolbar-button:hover, .compact-tool:hover { border-color: var(--line-strong); background: var(--panel-soft); }
.mobile-only, .menu-button { display: none; }

.new-task-button {
  min-height: 38px;
  margin: 12px 12px 9px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #b9c7ef;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.new-task-button:hover { border-color: #8da4e6; background: #e5edff; }
.new-task-button b { flex: 1; text-align: left; font-size: 13px; }
.new-task-button kbd { color: #7783a0; font: 10px/1.8 Consolas, monospace; }

.model-nav { padding: 0 9px 9px; border-bottom: 1px solid var(--line); }
.section-heading { min-height: 30px; padding: 0 5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mini-button { padding: 3px 6px; color: var(--muted); font-size: 11px; }
.mini-button:hover { color: var(--primary); border-color: #b9c7ef; }

.model-group {
  width: 100%;
  height: 42px;
  padding: 4px 7px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}
.model-group:hover { background: var(--panel-soft); border-color: #ebedf2; }
.model-group.is-active { background: var(--primary-soft); border-color: #ced9f8; }
.model-group > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.model-group b { font-size: 12px; line-height: 1.25; }
.model-group small { margin-top: 1px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-group em { min-width: 20px; padding: 1px 5px; border-radius: 9px; background: #edf0f5; color: var(--muted); font-size: 10px; font-style: normal; text-align: center; }
.model-group.is-active em { background: #d8e2ff; color: var(--primary-dark); }

.group-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}
.group-gpt { background: #e9edff; color: #3f55bd; }
.group-claude { background: #fff0e5; color: #9a572a; }
.group-gemini { background: #e8f4ff; color: #2773ac; }
.group-other { background: #edf5ed; color: #3d7546; }
.group-image { background: #fbeafb; color: #9c3f8e; }
.group-video { background: #f1eafd; color: #6845a6; }

.history-section { min-height: 0; padding: 7px 9px 0; display: flex; flex: 1; flex-direction: column; }
.history-search { padding: 1px 4px 7px; }
.history-search input {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}
.history-list { min-height: 0; overflow: auto; scrollbar-width: thin; }
.history-item {
  position: relative;
  min-height: 43px;
  padding: 5px 27px 5px 8px;
  display: grid;
  grid-template-columns: 3px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}
.history-item:hover { background: var(--panel-soft); }
.history-item.is-active { background: #f0f4ff; border-color: #dbe4fd; }
.history-item > i { width: 3px; height: 25px; border-radius: 2px; }
.history-item > span { min-width: 0; display: flex; flex-direction: column; }
.history-item b { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.history-item.is-running { background: #f5f8ff; }
.history-run-dot { width: 6px; height: 6px; margin-right: 4px; display: inline-block; border-radius: 50%; background: #d3901b; box-shadow: 0 0 0 2px rgba(211,144,27,.13); animation: pulse 1.1s infinite; vertical-align: 0; }
.history-delete { position: absolute; right: 4px; top: 8px; width: 25px; height: 25px; border: 0; border-radius: 4px; background: transparent; color: var(--faint); opacity: 0; }
.history-item:hover .history-delete, .history-delete:focus-visible { opacity: 1; }
.history-delete:hover { background: #ffecef; color: var(--danger); }
.empty-note { padding: 14px 8px; margin: 0; color: var(--faint); font-size: 11px; text-align: center; }

.sidebar-footer { padding: 9px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.account-button {
  width: 100%;
  min-height: 44px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  text-align: left;
}
.account-button:hover { border-color: #b8c5e8; }
.account-button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.account-button b { font-size: 12px; }
.account-button small { overflow: hidden; margin-top: 2px; color: var(--muted); font: 10px Consolas, monospace; text-overflow: ellipsis; }
.key-status { position: relative; height: 29px; display: grid; place-items: center; border-radius: 4px; background: #e8ecf4; color: #606b7f; font-size: 9px; font-weight: 800; }
.key-status i { position: absolute; right: -2px; top: -2px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #a6adba; }
.key-status i.is-online { background: #20ad75; }
.privacy-note { margin: 7px 0 0; color: var(--faint); font-size: 10px; text-align: center; }
.sidebar-platform-link { min-height: 35px; margin-top: 7px; padding: 0 8px; display: grid; grid-template-columns: 23px auto minmax(0,1fr) auto; align-items: center; gap: 6px; border: 1px solid #c6d2f3; border-radius: 5px; background: #f2f5ff; color: #29459b; text-decoration: none; }
.sidebar-platform-link:hover { border-color: #91a8e8; background: #e9efff; }
.sidebar-platform-link > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 4px; background: var(--primary); color: #fff; font-size: 8px; font-weight: 900; }
.sidebar-platform-link b { font-size: 10px; white-space: nowrap; }
.sidebar-platform-link small { overflow: hidden; color: #7080aa; font-size: 8px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-platform-link i { font-size: 11px; font-style: normal; }

.workspace { height: 100%; max-height: 100dvh; min-height: 0; overflow: hidden; min-width: 0; max-width: 100%; display: grid; grid-template-rows: 64px auto auto minmax(0, 1fr) auto; background: #f8fafc; }
.workspace > .topbar { grid-row: 1; }
.workspace > .run-strip { grid-row: 2; }
.workspace > .context-bar { grid-row: 3; }
.workspace > .content-stage { grid-row: 4; }
.workspace > .composer-wrap { grid-row: 5; }
.topbar {
  min-width: 0;
  padding: 0 14px;
  display: grid;
  grid-template-columns: minmax(180px,1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
}
.topbar-left, .topbar-actions { min-width: 0; display: flex; align-items: center; gap: 9px; }
.topbar-actions { justify-content: flex-end; }
.platform-portal {
  min-width: 196px;
  height: 42px;
  padding: 0 10px 0 7px;
  display: grid;
  grid-template-columns: 29px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #fff;
  color: #1e40af;
  text-decoration: none;
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease;
}
.platform-portal:hover { border-color: #60a5fa; background: #eff6ff; }
.platform-portal-mark { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #bfdbfe; border-radius: 6px; background: #eff6ff; color: #2563eb; font-size: 10px; font-weight: 900; letter-spacing: 0; }
.platform-portal-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.platform-portal-copy b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.platform-portal-copy small { overflow: hidden; margin-top: 3px; color: #64748b; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.platform-portal-arrow { font-size: 15px; line-height: 1; }
.task-heading { min-width: 0; }
.task-heading h1 { max-width: 370px; overflow: hidden; margin: 0; font-size: 14px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.task-heading span { display: block; max-width: 370px; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-button {
  width: 100%;
  height: 38px;
  padding: 3px 8px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  text-align: left;
}
.model-picker-button:hover { border-color: #9baad3; }
.model-picker-button > span:first-child { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; }
.model-picker-button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.model-picker-button b, .model-picker-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-button b { font-size: 11px; }
.model-picker-button small { margin-top: 1px; color: var(--muted); font-size: 9px; }

.service-pill { height: 27px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.service-pill i { width: 7px; height: 7px; border-radius: 50%; background: #a5adba; }
.service-pill.is-online i { background: var(--success); box-shadow: 0 0 0 3px rgba(22,134,92,.1); }
.service-pill.is-busy i { background: #d3901b; animation: pulse 1s infinite; }
.service-pill.is-error i { background: var(--danger); }
.toolbar-button { height: 28px; padding: 0 8px; color: #4d596d; font-size: 10px; }

.run-strip { min-width: 0; border-bottom: 1px solid var(--line); background: #fff; }
.run-strip > header { height: 34px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #f1f5f9; }
.run-strip > header > div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.run-strip > header b { font-size: 11px; }
.run-strip > header span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.run-strip > header strong { color: var(--primary); font-size: 10px; white-space: nowrap; }
.run-strip-list { min-width: 0; padding: 7px 10px 8px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.run-strip-item { width: 214px; min-width: 214px; height: 54px; display: grid; grid-template-columns: minmax(0,1fr) 24px; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.run-strip-item:hover { border-color: #bfdbfe; }
.run-strip-open { min-width: 0; height: 100%; padding: 6px 4px 6px 7px; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 7px; border: 0; background: transparent; text-align: left; }
.run-strip-type { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 5px; background: var(--primary-soft); color: var(--run-color); font-size: 9px; font-weight: 800; }
.run-strip-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.run-strip-copy b, .run-strip-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-strip-copy b { font-size: 10px; }
.run-strip-copy small { color: var(--muted); font-size: 8px; }
.run-strip-progress { position: relative; width: 100%; height: 3px; margin-top: 2px; overflow: hidden; border-radius: 2px; background: #e2e8f0; }
.run-strip-progress i { display: block; height: 100%; background: var(--primary); }
.run-strip-progress.is-indeterminate i { width: 42%; animation: run-strip-slide 1.25s ease-in-out infinite; }
.run-strip-stop { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--faint); }
.run-strip-stop:hover { background: #fef2f2; color: var(--danger); }
@keyframes run-strip-slide { from { transform: translateX(-120%); } to { transform: translateX(260%); } }

.context-bar {
  min-width: 0;
  min-height: 38px;
  padding: 5px 13px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #dce3f2;
  background: #f0f4ff;
}
.context-bar > div:first-child { min-width: 0; display: flex; align-items: center; gap: 7px; }
.context-bar > div:first-child b { color: var(--primary-dark); font-size: 11px; white-space: nowrap; }
.context-bar > div:first-child span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.context-bar > button { border: 0; background: transparent; color: var(--muted); font-size: 10px; }

.content-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.welcome-state { width: min(940px, calc(100% - 36px)); max-width: 100%; min-width: 0; margin: 24px auto 28px; }
.welcome-header { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 30px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: #fff; }
.welcome-header > *, .workflow-launcher > *, .block-heading > *, .start-guide > *, .connection-summary, .workflow-table { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.welcome-header h2 { max-width: 650px; margin: 0; font-size: 27px; line-height: 1.3; letter-spacing: 0; }
.welcome-header > div > p:last-child { max-width: 660px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.welcome-header h2, .welcome-header p, .block-heading p { overflow-wrap: anywhere; word-break: break-word; }
.connection-summary { margin: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); }
.connection-summary div { min-height: 34px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.connection-summary div:last-child { border-bottom: 0; }
.connection-summary dt { color: var(--muted); font-size: 10px; }
.connection-summary dd { margin: 0; font-size: 10px; font-weight: 600; text-align: right; }

.workflow-launcher { padding: 18px 24px 22px; border: 1px solid var(--line); border-top: 0; background: #fff; }
.block-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.block-heading h3 { margin: 0; font-size: 13px; }
.block-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.block-heading button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--primary); font-size: 10px; }

.workflow-table { border: 1px solid var(--line); border-bottom: 0; border-radius: 5px; overflow: hidden; }
.workflow-table button {
  width: 100%;
  min-height: 42px;
  padding: 5px 9px;
  display: grid;
  grid-template-columns: 28px 115px minmax(0,1fr) 38px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}
.workflow-table button:hover { background: #f5f7fb; }
.workflow-table button span { color: #8994a5; font: 10px Consolas, monospace; }
.workflow-table button b { font-size: 11px; }
.workflow-table button small { color: var(--muted); font-size: 10px; }
.workflow-table button em { padding: 2px 4px; border-radius: 3px; background: #edf1f7; color: #5e687a; font-size: 9px; font-style: normal; text-align: center; }

.start-guide { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: #f8f9fb; }
.start-guide > div { min-height: 61px; padding: 10px 15px; display: flex; align-items: center; gap: 9px; border-right: 1px solid var(--line); }
.start-guide > div:last-child { border-right: 0; }
.start-guide b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e9edf5; color: #687388; font-size: 10px; }
.start-guide span { display: flex; flex-direction: column; }
.start-guide strong { font-size: 11px; }
.start-guide small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.start-guide-key { background: #f2f5ff; }
.start-guide-key span { position: relative; padding-right: 72px; }
.start-guide-key a { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 9px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.start-guide-key a:hover { text-decoration: underline; }

.message-list { width: min(900px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 26px; }
.message { padding: 13px 4px; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; border-bottom: 1px solid #e4e7ed; }
.message-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #596579; font-size: 8px; font-weight: 800; }
.message.assistant .message-avatar { background: var(--primary-soft); color: var(--primary); border-color: #cfdbfa; }
.message-main { min-width: 0; }
.message-meta { min-height: 22px; display: flex; align-items: center; gap: 7px; }
.message-meta b { font-size: 11px; }
.message-meta span { color: var(--faint); font-size: 9px; }
.attachment-note { margin: 4px 0 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.attachment-note span { padding: 2px 6px; border: 1px solid #d4dae5; border-radius: 9px; background: #f8f9fb; color: #697588; font-size: 9px; }
.message-bubble { overflow-wrap: anywhere; color: #263247; font-size: 13px; line-height: 1.72; }
.message-bubble > :first-child { margin-top: 0; }
.message-bubble > :last-child { margin-bottom: 0; }
.message-bubble p { margin: .55em 0; }
.message-bubble h1, .message-bubble h2, .message-bubble h3 { margin: 1em 0 .45em; line-height: 1.35; }
.message-bubble h1 { font-size: 18px; }.message-bubble h2 { font-size: 16px; }.message-bubble h3 { font-size: 14px; }
.message-bubble ul, .message-bubble ol { margin: .55em 0; padding-left: 1.5em; }
.message-bubble blockquote { margin: .6em 0; padding: 4px 9px; border-left: 3px solid #bdc9e9; background: #f4f6fb; color: #596579; }
.message-bubble code { padding: 1px 4px; border-radius: 3px; background: #eef1f6; font: 12px/1.5 Consolas, monospace; }
.message-bubble pre { overflow: auto; margin: .7em 0; padding: 11px; border: 1px solid #d8dde6; border-radius: 5px; background: #111827; color: #e7edf8; }
.message-bubble pre code { padding: 0; background: transparent; color: inherit; }
.message-bubble pre { position: relative; }
.message-bubble pre .code-lang { position: absolute; top: 0; right: 52px; padding: 2px 7px; border-radius: 0 0 4px 4px; background: #1f2937; color: #8b9bb4; font: 9px Consolas, monospace; text-transform: uppercase; letter-spacing: .5px; }
.message-bubble pre .code-copy-btn { position: absolute; top: 5px; right: 5px; padding: 2px 7px; border: 1px solid #2d3a52; border-radius: 3px; background: #1f2937; color: #8b9bb4; font: 9px Consolas, monospace; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; }
.message-bubble pre:hover .code-copy-btn { opacity: 1; }
.message-bubble pre .code-copy-btn:hover { color: #e7edf8; border-color: #4b5e80; }
.message-bubble hr { margin: 1em 0; border: none; border-top: 1px solid #d8dde6; }
.message-bubble h4 { margin: .8em 0 .4em; font-size: 13px; }
.message-bubble a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.message-bubble a:hover { border-bottom-color: var(--primary); }
.message-bubble .inline-img { max-width: 100%; height: auto; border-radius: 4px; margin: 4px 0; }
.message-bubble em { font-style: italic; }
.message-bubble del { color: #9ca3af; text-decoration: line-through; }
.message-bubble .task-list { list-style: none; padding-left: .5em; }
.message-bubble .task-item { padding: 2px 0; }
.message-bubble .task-item .task-checkbox { display: inline-block; width: 1.2em; font-size: 14px; }
.message-bubble .task-item.checked { color: var(--muted); }
.message-bubble .task-item.checked .task-checkbox { color: #22c55e; }
.message-bubble .table-wrapper { overflow-x: auto; margin: .7em 0; }
.message-bubble table { width: 100%; border-collapse: collapse; font-size: 12px; }
.message-bubble th, .message-bubble td { padding: 5px 9px; border: 1px solid #d8dde6; text-align: left; }
.message-bubble th { background: #f0f2f7; font-weight: 600; }
.message-bubble tbody tr:nth-child(even) { background: #f8f9fc; }
.typing-caret::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; background: var(--primary); vertical-align: -.15em; animation: blink .8s step-end infinite; }

.message-actions { min-height: 25px; margin-top: 5px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.message:hover .message-actions, .message-actions.always { opacity: 1; }
.message-actions button { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font-size: 9px; }
.message-actions button:hover { color: var(--primary); border-color: #b7c5eb; }
.error-card { padding: 9px 11px; border: 1px solid #f1c5cb; border-radius: 5px; background: #fff4f5; color: #a62e3c; font-size: 12px; line-height: 1.55; }
.error-card small { display: block; margin-top: 5px; color: #87515a; font: 9px Consolas, monospace; }

.generation-status { min-height: 52px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.status-spinner { width: 18px; height: 18px; border: 2px solid #d8dfea; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.generation-status span { display: flex; flex-direction: column; }
.generation-status b { font-size: 11px; }.generation-status small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.video-progress { height: 4px; margin-top: 5px; overflow: hidden; border-radius: 2px; background: #e6e9ef; }
.video-progress i { display: block; height: 100%; background: var(--primary); transition: width .35s; }

.media-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 9px; }
.media-card { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #e9edf3; }
.media-card img, .media-card video { width: 100%; max-height: 520px; display: block; object-fit: contain; background: #161b25; }
.media-card-footer { min-height: 32px; padding: 5px 7px; display: flex; align-items: center; justify-content: space-between; gap: 7px; background: #fff; }
.media-card-footer small { color: var(--muted); font-size: 9px; }
.media-card-footer a { padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--primary); font-size: 9px; text-decoration: none; }
.media-placeholder { min-height: 120px; padding: 18px; display: grid; place-items: center; background: #f5f6f8; color: var(--muted); font-size: 11px; text-align: center; }

@media (min-width: 761px) {
  .image-result-grid.is-multi { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .image-result-grid.is-multi .media-card { display: grid; grid-template-rows: minmax(0,1fr) auto; }
  .image-result-grid.is-multi .media-card img,
  .image-result-grid.is-multi .media-placeholder { width: 100%; min-height: 0; aspect-ratio: 4 / 3; }
  .image-result-grid.is-multi .media-card img { max-height: none; object-fit: contain; background: #eef1f5; }
}

.jump-bottom { position: sticky; z-index: 5; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; box-shadow: 0 4px 12px rgba(24,33,52,.12); color: #566176; font-size: 10px; }

.composer-wrap { padding: 8px max(14px,calc((100% - 900px)/2)) max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(247,248,250,.98); }
.composer { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; box-shadow: 0 3px 12px rgba(31,43,70,.06); }
.composer:focus-within { border-color: #839be1; box-shadow: 0 0 0 3px rgba(49,89,216,.07); }
.composer-toolbar, .composer-actions { min-height: 34px; padding: 4px 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-toolbar { border-bottom: 1px solid #edf0f4; background: #fafbfc; }
.composer-toolbar > div, .composer-actions > div { display: flex; align-items: center; gap: 5px; }
.compact-tool { height: 24px; padding: 0 7px; color: #536078; font-size: 9px; }
.mode-hint { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
#promptInput { width: 100%; min-height: 70px; max-height: 180px; padding: 10px 11px; resize: none; border: 0; outline: 0; color: var(--text); font-size: 13px; line-height: 1.6; }
#promptInput::placeholder { color: #9ba4b3; }
.composer-actions { border-top: 1px solid #edf0f4; }
.composer-submit { min-width: 0; display: grid !important; grid-template-columns: minmax(150px, 260px) auto; align-items: center; gap: 6px !important; }
.composer-model-picker { height: 30px; min-width: 0; padding: 2px 6px; grid-template-columns: 24px minmax(0,1fr) auto; }
.composer-model-picker > span:first-child { width: 23px; height: 23px; }
.composer-model-picker b { font-size: 10px; }
.composer-model-picker small { display: none; }
.reference-strip { min-height: 62px; padding: 6px 8px; display: flex; align-items: center; gap: 7px; overflow-x: auto; border-bottom: 1px solid #edf0f4; background: #fbfcfe; scrollbar-width: thin; }
.reference-thumb { position: relative; width: 70px; height: 50px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #e8ecf2; }
.reference-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.reference-thumb button { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(18,25,38,.78); color: #fff; }
.reference-thumb button svg { width: 11px; height: 11px; }
.reference-thumb small { position: absolute; left: 2px; bottom: 2px; max-width: calc(100% - 4px); padding: 1px 3px; overflow: hidden; border-radius: 2px; background: rgba(18,25,38,.72); color: #fff; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.composer-file-reference { width: 196px; height: 50px; padding: 5px; flex: 0 0 auto; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 6px; border: 1px solid #d9dfeb; border-radius: 5px; background: #fff; }
.composer-file-reference.has-ocr-action { width: 224px; }
.composer-file-reference.is-ready { border-color: #cdd8ef; background: #fbfcff; }
.composer-file-reference.is-failed { border-color: #f1c8cf; background: #fff8f9; }
.composer-file-reference.is-pending-ocr { border-color: #dfd7f6; background: #fcfaff; }
.composer-file-type { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; background: #eef2ff; color: var(--primary); font: 700 8px Consolas,monospace; }
.composer-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.composer-file-copy b, .composer-file-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-file-copy b { font-size: 9px; }
.composer-file-copy small { color: var(--muted); font-size: 8px; }
.composer-file-copy .file-progress { width: 100%; margin-top: 0; }
.composer-file-actions { display: flex; align-items: center; gap: 2px; }
.composer-file-actions button { width: 22px; height: 22px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: var(--faint); }
.composer-file-actions button:hover { background: #f0f3f8; color: var(--primary); }
.composer-file-actions button:last-child:hover { background: #fff0f2; color: var(--danger); }
.composer-file-actions svg { width: 13px; height: 13px; }
.composer.is-image-dragging { border-color: var(--primary); box-shadow: inset 0 0 0 2px rgba(49,89,216,.15); }
.text-tool { padding: 3px 5px; border-color: transparent; background: transparent; color: var(--muted); font-size: 9px; }
.danger-text:hover { color: var(--danger); background: #fff2f4; }
.char-count { color: var(--faint); font-size: 9px; }
.send-button { height: 29px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.send-button:hover { background: var(--primary-dark); }.send-button.is-stop { background: var(--danger); }
.send-button b { font: 10px Consolas,monospace; opacity: .7; }
.composer-footnote { margin: 5px 0 0; color: var(--faint); font-size: 9px; text-align: center; }

.inspector { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.inspector-header { height: 58px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.inspector-header h2 { margin: 0; font-size: 14px; }.inspector-header .eyebrow { margin-bottom: 2px; }
.inspector-tabs { height: 38px; padding: 5px 8px 0; display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
.inspector-tabs button { border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; background: transparent; color: var(--muted); font-size: 10px; }
.inspector-tabs button.is-active { border-color: var(--line); background: #fff; color: var(--primary); font-weight: 700; }
.inspector-body { min-height: 0; padding: 12px; flex: 1; overflow: auto; scrollbar-width: thin; }
.inspector-panel { min-width: 0; }
.field-label { display: block; margin: 0 0 5px; color: #596579; font-size: 10px; font-weight: 600; }
.model-catalog-heading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-catalog-heading .field-label { margin: 0; }
.model-sync-button { width: 26px; height: 26px; }
.model-sync-button svg { width: 14px; height: 14px; }
.model-sync-button.is-syncing svg { animation: spin .8s linear infinite; }
.model-catalog-status { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.select-wrap select, .setting-group textarea, .two-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}
.select-wrap select { height: 32px; padding: 0 8px; }
.setting-group textarea { min-height: 76px; padding: 7px 8px; resize: vertical; line-height: 1.45; }
.model-summary { min-height: 52px; margin-top: 8px; padding: 7px; display: grid; grid-template-columns: 31px minmax(0,1fr); align-items: center; gap: 8px; border: 1px solid #dbe2ef; border-radius: 5px; background: #f7f9fc; }
.model-summary > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 800; }
.model-summary > div { min-width: 0; }.model-summary b, .model-summary p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.model-summary b { display: block; font-size: 10px; }.model-summary p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.setting-group, .task-info { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.setting-title { min-height: 26px; display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.setting-title h3 { margin: 0; font-size: 11px; }.setting-title span { color: #9aa3b1; font: 8px Consolas,monospace; letter-spacing: .08em; }
.range-heading { margin: 10px 0 5px; display: flex; justify-content: space-between; color: #596579; font-size: 10px; }
.range-heading output { color: var(--primary); font: 10px Consolas,monospace; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.two-fields { margin-top: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.two-fields input { height: 31px; padding: 0 7px; }
.toggle-row { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.toggle-row > span { display: flex; flex-direction: column; }.toggle-row b { font-size: 10px; }.toggle-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { position: relative; width: 31px; height: 17px; border-radius: 9px; background: #c9ced8; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle-row input:checked + i { background: var(--primary); }.toggle-row input:checked + i::after { transform: translateX(14px); }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.segmented button { height: 29px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 9px; }.segmented button:last-child { border-right: 0; }.segmented button.is-active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.cost-note, .file-warning { padding: 7px 8px; border: 1px solid #ecd8b7; border-radius: 4px; background: #fff9ed; color: #846022; font-size: 9px; line-height: 1.5; }
.task-info dl { margin: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 4px; overflow: hidden; }
.task-info dl div { min-height: 29px; padding: 0 7px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }.task-info dt { color: var(--muted); font-size: 9px; }.task-info dd { margin: 0; font-size: 9px; font-weight: 600; }
.reset-button { width: 100%; height: 31px; margin-top: 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font-size: 9px; }.reset-button:hover { border-color: #aebbdc; color: var(--primary); }

.panel-intro { padding-bottom: 10px; border-bottom: 1px solid var(--line); }.panel-intro h3 { margin: 0; font-size: 12px; }.panel-intro p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.workflow-library { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.workflow-entry { padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.workflow-entry.is-active { border-color: #aebfe9; background: #f4f7ff; }
.workflow-entry header { display: flex; align-items: center; justify-content: space-between; gap: 7px; }.workflow-entry h4 { margin: 0; font-size: 11px; }.workflow-entry em { padding: 2px 4px; border-radius: 3px; background: #edf0f5; color: var(--muted); font-size: 8px; font-style: normal; }
.workflow-entry p { margin: 5px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }.workflow-entry ol { margin: 6px 0; padding-left: 20px; color: #546177; font-size: 9px; line-height: 1.6; }
.workflow-entry button { width: 100%; height: 27px; border: 1px solid #bac7e9; border-radius: 4px; background: var(--primary-soft); color: var(--primary-dark); font-size: 9px; }

.file-dropzone { width: 100%; min-height: 76px; margin-top: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed #aeb8c8; border-radius: 5px; background: #f8f9fb; }.file-dropzone:hover, .file-dropzone.is-dragging { border-color: var(--primary); background: var(--primary-soft); }.file-dropzone b { font-size: 10px; }.file-dropzone span { color: var(--muted); font-size: 8px; }
.file-list { margin-top: 8px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.file-item { min-height: 42px; padding: 5px 6px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }.file-item:last-child { border-bottom: 0; }.file-item > span { min-width: 0; display: flex; flex-direction: column; }.file-item b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.file-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }.file-item .file-actions { flex-direction: row; align-items: center; gap: 3px; }.file-item button { min-width: 24px; height: 24px; padding: 0 6px; border: 0; border-radius: 3px; background: transparent; color: var(--faint); font-size: 9px; }.file-item .file-remove-button { width: 24px; padding: 0; font-size: 14px; }.file-item .file-ocr-button { background: #eef2ff; color: var(--primary); white-space: nowrap; }.file-item .file-cancel-button { background: #fff5e8; color: #9a5b00; }.file-item button:hover { background: #fff0f2; color: var(--danger); }.file-item.is-pending-ocr { background: #fbfcff; }
.file-item.is-failed small { color: var(--danger); }
.file-progress { height: 3px; margin-top: 5px; overflow: hidden; border-radius: 2px; background: #e6e9ef; }
.file-progress em { display: block; height: 100%; background: var(--primary); transition: width .25s; }
.context-meter { margin-top: 9px; }.context-meter > span { height: 4px; display: block; overflow: hidden; border-radius: 2px; background: #e8ebf0; }.context-meter i { width: 0; height: 100%; display: block; background: var(--primary); transition: width .2s; }.context-meter small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; text-align: right; }
.reference-options { margin-top: 9px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.reference-options label { min-width: 0; }
.reference-options select { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 9px; }
.reference-options input { width: 100%; }
.reference-options output { float: right; color: var(--primary); font: 9px Consolas,monospace; }
.current-reference-list { margin-top: 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.current-reference-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.current-reference-card img { width: 100%; height: 72px; display: block; object-fit: cover; background: #e8ebf0; }
.current-reference-card div { padding: 4px 5px; min-width: 0; }
.current-reference-card b, .current-reference-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-reference-card b { font-size: 8px; }.current-reference-card small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.current-reference-card button { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(18,25,38,.8); color: #fff; }
.library-heading { min-height: 32px; margin-top: 11px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.library-heading h4 { margin: 0; font-size: 10px; }.library-heading button { border: 0; background: transparent; color: var(--primary); font-size: 8px; }
.library-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.library-filters button { min-width: 0; height: 27px; padding: 0 3px; overflow: hidden; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.library-filters button:last-child { border-right: 0; }.library-filters button.is-active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.media-library-grid { margin-top: 7px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.library-media-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.library-media-preview { position: relative; width: 100%; height: 92px; padding: 0; display: block; overflow: hidden; border: 0; background: #e8ebf0; }
.library-media-preview img, .library-media-preview video { width: 100%; height: 100%; display: block; object-fit: cover; }
.library-media-preview .remote-badge { position: absolute; left: 3px; top: 3px; padding: 2px 4px; border-radius: 3px; background: rgba(18,25,38,.76); color: #fff; font-size: 7px; }
.library-media-copy { padding: 5px; }.library-media-copy b, .library-media-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.library-media-copy b { font-size: 8px; }.library-media-copy small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.library-media-actions { padding: 0 5px 5px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }.library-media-actions button { height: 23px; padding: 0 2px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--muted); font-size: 7px; }.library-media-actions button:hover { border-color: #b9c7eb; color: var(--primary); }.library-media-actions button.danger:hover { border-color: #efc3c9; color: var(--danger); }
.library-clear-button { color: var(--danger); }

.model-popover {
  position: fixed;
  z-index: 80;
  width: min(440px, calc(100vw - 20px));
  max-height: min(560px,calc(100dvh - 30px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}
.model-search { padding: 8px; border-bottom: 1px solid var(--line); }.model-search input { width: 100%; height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); }
.model-results { max-height: 480px; padding: 6px; overflow: auto; }.model-results section + section { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }.model-results h3 { margin: 3px 5px 5px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }.model-results h3 em { font-style: normal; }
.model-option { width: 100%; min-height: 40px; padding: 5px 6px; display: grid; grid-template-columns: 27px minmax(0,1fr) auto; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 4px; background: transparent; text-align: left; }.model-option:hover { background: var(--panel-soft); }.model-option.is-active { border-color: #d1dcf9; background: var(--primary-soft); }.model-option > span:first-child { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 4px; background: #edf0f5; font-size: 9px; font-weight: 800; }.model-option > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }.model-option b,.model-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.model-option b { font-size: 10px; }.model-option small { margin-top: 2px; color: var(--muted); font: 8px Consolas,monospace; }.model-option > em { color: var(--primary); font-size: 11px; font-style: normal; }

dialog { color: var(--text); }
.key-dialog, .confirm-dialog, .media-preview-dialog, .export-dialog { padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(16,24,40,.48); backdrop-filter: blur(2px); }
.key-dialog { width: min(440px,calc(100vw - 24px)); }.key-dialog form { position: relative; padding: 25px; }.dialog-close { position: absolute; right: 10px; top: 10px; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }.key-dialog .dialog-brand { width: 40px; height: 40px; margin-bottom: 12px; }.key-dialog h2 { margin: 0; font-size: 20px; }.dialog-copy { margin: 8px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.platform-entry { margin: 0 0 16px; padding: 12px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid #b8c8f5; border-radius: 7px; background: #f1f5ff; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.platform-entry-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: #2f61d5; color: #fff; font-size: 11px; font-weight: 900; box-shadow: 0 4px 10px rgba(49,89,216,.2); }
.platform-entry span { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.platform-entry b { color: #203d96; font-size: 12px; }
.platform-entry small { color: #65718b; font-size: 9px; line-height: 1.4; }
.platform-entry a { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 5px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; box-shadow: 0 3px 8px rgba(49,89,216,.2); }
.platform-entry a:hover { background: var(--primary-dark); }
.platform-entry a i { font-size: 13px; font-style: normal; }
.key-field > span { display: block; margin-bottom: 5px; color: #536078; font-size: 10px; font-weight: 600; }.key-field > div { height: 38px; display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }.key-field input { min-width: 0; padding: 0 10px; border: 0; outline: 0; font: 12px Consolas,monospace; }.key-field button { width: 48px; border: 0; border-left: 1px solid var(--line); background: var(--panel-soft); color: var(--muted); font-size: 9px; }
.endpoint-row { min-height: 34px; margin-top: 8px; padding: 0 8px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); font-size: 9px; }.endpoint-row span { color: var(--muted); }.endpoint-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.endpoint-row i { color: var(--success); font-style: normal; }
.remember-row { margin: 11px 0; display: flex; align-items: center; gap: 8px; }.remember-row input { position: absolute; opacity: 0; }.remember-row > i { width: 16px; height: 16px; border: 1px solid var(--line-strong); border-radius: 3px; }.remember-row input:checked + i { position: relative; border-color: var(--primary); background: var(--primary); }.remember-row input:checked + i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 10px; }.remember-row > span { display: flex; flex-direction: column; }.remember-row b { font-size: 10px; }.remember-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.key-error { padding: 7px 8px; border: 1px solid #f0c4ca; border-radius: 4px; background: #fff3f5; color: #ad3543; font-size: 10px; }.connect-button { width: 100%; height: 38px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 5px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }.connect-button:hover { background: var(--primary-dark); }.trust-row { margin-top: 12px; display: flex; justify-content: center; gap: 12px; color: var(--faint); font-size: 8px; }
.clear-local-data-button { width: 100%; margin-top: 13px; padding: 7px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #9f3a47; font-size: 9px; text-decoration: underline; text-underline-offset: 2px; }.clear-local-data-button:hover { border-color: #efc8ce; background: #fff4f5; text-decoration: none; }
.confirm-dialog { width: min(350px,calc(100vw - 24px)); }.confirm-dialog form { padding: 22px; text-align: center; }.confirm-icon { width: 35px; height: 35px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: #fff1f3; color: var(--danger); font-weight: 800; }.confirm-dialog h2 { margin: 0; font-size: 16px; }.confirm-dialog p { margin: 8px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }.confirm-dialog form > div:last-child { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }.confirm-dialog button { height: 33px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }.confirm-dialog button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.confirm-dialog button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.export-dialog { width: min(460px,calc(100vw - 24px)); }
.export-dialog-header { min-height: 70px; padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.export-dialog-header h2 { margin: 2px 0 0; font-size: 16px; }
.export-dialog-header button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font-size: 18px; }
.export-format-grid { padding: 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.export-format-grid button { min-height: 62px; padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; text-align: left; }
.export-format-grid button:hover { border-color: #9aade5; background: var(--primary-soft); }
.export-format-grid button > i { width: 20px; height: 20px; color: var(--primary); }
.export-format-grid button span { display: flex; flex-direction: column; gap: 2px; }
.export-format-grid button b { font-size: 11px; }.export-format-grid button small { color: var(--muted); font-size: 9px; }
#templateEditorDialog { width: min(480px,calc(100vw - 24px)); }
#templateEditorDialog form { padding: 22px; }
#templateEditorDialog h2 { margin: 0; font-size: 16px; }
#templateEditorDialog .dialog-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--faint); }
#templateEditorDialog button { height: 33px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--text); cursor: pointer; font-size: 12px; }
#templateEditorDialog button.primary { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
#templateEditorDialog button.danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.media-preview-dialog { width: min(900px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: hidden; }
.media-preview-header { height: 52px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }.media-preview-header h2 { margin: 0; font-size: 13px; }.media-preview-header .eyebrow { margin-bottom: 2px; }.media-preview-header button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.media-preview-body { min-height: 180px; max-height: calc(100dvh - 140px); display: grid; place-items: center; overflow: auto; background: #111722; }.media-preview-body img, .media-preview-body video { max-width: 100%; max-height: calc(100dvh - 150px); display: block; object-fit: contain; }
.media-preview-footer { min-height: 43px; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); }.media-preview-footer span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.media-preview-footer button { height: 28px; border: 1px solid #b9c7eb; border-radius: 4px; background: var(--primary-soft); color: var(--primary-dark); font-size: 9px; }

.toast-region { position: fixed; z-index: 120; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }.toast { min-width: 230px; max-width: 360px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid #b9dcca; border-radius: 5px; background: #f2fff8; box-shadow: 0 6px 18px rgba(31,45,63,.16); color: #216747; font-size: 10px; animation: toast-in .18s ease-out; }.toast.error { border-color: #efc3c9; background: #fff4f5; color: #9c2f3c; }.toast i { font-style: normal; font-weight: 800; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

@media (max-width: 1180px) {
  .app-shell.inspector-open { grid-template-columns: var(--sidebar) minmax(0,1fr) 292px; }
  :root { --inspector: 292px; }
  .welcome-header { grid-template-columns: minmax(0,1fr) 225px; }
  .service-pill { display: none; }
}

@media (max-width: 1120px) {
  .app-shell, .app-shell.inspector-open { grid-template-columns: 230px minmax(0,1fr); }
  :root { --sidebar: 230px; }
  .inspector { position: fixed; z-index: 50; right: 0; top: 0; bottom: 0; width: min(340px,calc(100vw - 30px)); transform: translateX(105%); box-shadow: -10px 0 30px rgba(24,33,52,.14); transition: transform .2s; }
  .app-shell.inspector-open .inspector { transform: translateX(0); }
  .topbar { grid-template-columns: minmax(130px,1fr) auto; }
  .platform-portal { min-width: 154px; }
  .platform-portal-copy b { font-size: 10px; }
  .platform-portal-copy small { font-size: 7px; }
  .welcome-header { grid-template-columns: 1fr; }.connection-summary { display: grid; grid-template-columns: repeat(2,1fr); }.connection-summary div:nth-child(odd) { border-right: 1px solid var(--line); }.connection-summary div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 760px) {
  .workspace { grid-template-rows: 54px auto auto minmax(0,1fr) auto; }
  body { overflow: hidden; }
  .app-shell, .app-shell.inspector-open { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: min(280px,calc(100vw - 45px)); transform: translateX(-105%); box-shadow: 12px 0 30px rgba(20,29,45,.2); transition: transform .2s; }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(15,23,38,.42); }
  .mobile-only, .menu-button { display: inline-grid; }
  .topbar { height: 54px; padding: 0 9px; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
  .task-heading span, .toolbar-button:not(#toggleInspectorButton), .service-pill { display: none; }
  .platform-portal { min-width: 132px; height: 38px; grid-template-columns: 27px minmax(0,1fr) auto; gap: 6px; padding-right: 8px; }
  .platform-portal-mark { width: 27px; height: 27px; }
  .platform-portal-copy b { font-size: 9px; }
  .platform-portal-copy small { display: none; }
  .task-heading h1 { max-width: 120px; }
  .run-strip > header span { display: none; }
  .run-strip-list { padding-right: 7px; padding-left: 7px; }
  .run-strip-item { width: 194px; min-width: 194px; }
  .context-bar { grid-template-columns: minmax(0,1fr) auto; }
  .welcome-state { width: calc(100% - 18px); max-width: calc(100% - 18px); margin: 10px auto 18px; }.welcome-header, .workflow-launcher { min-width: 0; padding: 15px; }.welcome-header h2 { max-width: 100%; font-size: 20px; }.welcome-header > div > p:last-child { max-width: 100%; font-size: 11px; }.connection-summary { width: 100%; grid-template-columns: minmax(0,1fr); }.connection-summary div, .connection-summary div:nth-child(odd) { min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); }.connection-summary div:last-child { border-bottom: 0; }
  .workflow-table button { grid-template-columns: 23px 90px minmax(0,1fr); }.workflow-table button em { display: none; }.start-guide { grid-template-columns: 1fr; }.start-guide > div { min-height: 50px; border-right: 0; border-bottom: 1px solid var(--line); }.start-guide > div:last-child { border-bottom: 0; }
  .start-guide-key span { padding-right: 90px; }
  .message-list { width: calc(100% - 16px); padding-top: 6px; }.message { grid-template-columns: 28px minmax(0,1fr); gap: 7px; }.message-avatar { width: 26px; height: 26px; }.message-actions { opacity: 1; }
  .composer-wrap { padding: 6px 7px max(6px,env(safe-area-inset-bottom)); }.composer-toolbar { min-height: 31px; }.mode-hint { display: none; }#promptInput { min-height: 58px; }.composer-footnote { display: none; }.composer-actions { align-items: stretch; flex-direction: column; }.composer-actions > div:first-child { min-height: 22px; }.composer-submit { width: 100%; grid-template-columns: minmax(0,1fr) 72px; }.composer-model-picker { width: 100%; }.send-button { justify-content: center; }
  .inspector { width: min(340px,calc(100vw - 26px)); }
  .toast-region { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }.toast { min-width: 0; max-width: none; }
}

@media (max-width: 520px) {
  .topbar { grid-template-columns: minmax(0,1fr) auto; }.topbar-actions { gap: 0; }.task-heading { display: none; }
  .platform-portal { min-width: 110px; }
  .platform-portal-copy b { max-width: 52px; white-space: normal; line-height: 1.05; }
  .platform-entry { grid-template-columns: 34px minmax(0,1fr); }
  .platform-entry-logo { width: 34px; height: 34px; }
  .platform-entry a { grid-column: 1 / -1; justify-content: center; }
  .workflow-table button { grid-template-columns: 23px 82px minmax(0,1fr); }.workflow-table button small { font-size: 9px; }
  .composer-toolbar .compact-tool { padding: 0 4px; font-size: 8px; }.media-grid { grid-template-columns: 1fr; }.reference-options { grid-template-columns: 1fr; }.media-library-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-height: 520px) and (orientation:landscape) {
  .workspace { grid-template-rows: 46px auto auto minmax(0,1fr) auto; }.topbar { height: 46px; }.run-strip > header { display: none; }.run-strip-list { padding-top: 4px; padding-bottom: 4px; }.welcome-state { margin-top: 7px; }.welcome-header { padding: 10px 14px; }.welcome-header h2 { font-size: 18px; }.connection-summary { display: none; }.workflow-launcher { padding: 9px 14px; }.workflow-table button { min-height: 34px; }.start-guide { display: none; }.composer-wrap { padding-top: 4px; }.composer-toolbar { display: none; }#promptInput { min-height: 44px; max-height: 82px; padding-top: 7px; padding-bottom: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* JuFlow Zeno v1.0.0 visual layer */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dfe5ee;
  --line-strong: #c7d1df;
  --text: #172033;
  --muted: #667085;
  --faint: #98a2b3;
  --primary: #2f61d5;
  --primary-dark: #234cae;
  --primary-soft: #eef3ff;
  --success: #16865c;
  --warning: #ad6a0d;
  --danger: #c43d4d;
  --shadow: 0 14px 40px rgba(22, 34, 58, .12);
  --sidebar: 238px;
  --inspector: 316px;
}

* { letter-spacing: 0 !important; }
body { background: #f4f7fb; }
.app-shell { background: #f4f7fb; }
.sidebar, .inspector, .topbar, .run-strip, .composer-wrap { background: #fff; }
.brand-row { height: 68px; padding-inline: 16px; }
.brand-mark { width: 36px; height: 36px; border: 0; }
.brand-copy strong { color: #111827; font-size: 15px; }
.brand-copy span { color: #7b8495; }
.new-task-button { min-height: 40px; margin: 13px 12px 10px; border-color: #2f61d5; background: #2f61d5; color: #fff; }
.new-task-button:hover { border-color: #234cae; background: #234cae; }
.new-task-button svg { width: 16px; height: 16px; }
.new-task-button kbd { color: rgba(255,255,255,.76); }
.model-group { height: 44px; }
.model-group.is-active { border-color: #d8e2fb; background: #eef3ff; }
.history-item.is-active { border-color: #d8e2fb; background: #f1f5ff; }
.sidebar-footer { background: #fbfcfe; }
.workspace { background: #fff; }
.topbar { height: 64px; padding-inline: 16px; }
.topbar::after { content: "ZENO STUDIO"; margin-left: 8px; color: #98a2b3; font-size: 9px; font-weight: 800; }
.topbar-actions { margin-left: auto; }
.toolbar-button { display: inline-flex; align-items: center; gap: 6px; }
.toolbar-button svg, .icon-button svg, .compact-tool svg, .send-button svg { width: 16px; height: 16px; flex: 0 0 auto; }
.platform-portal { border-color: #d4def3; background: #f7f9ff; }
.run-strip > header { height: 36px; }
.run-strip-list { padding-block: 8px; }
.run-strip-item { height: 58px; border-color: #dfe5ee; box-shadow: 0 2px 8px rgba(30, 50, 84, .04); }
.content-stage { background: #fff; }
.welcome-state { width: min(980px, calc(100% - 40px)); margin-top: 22px; }
.welcome-header { border-color: #dfe5ee; background: #fbfcfe; box-shadow: none; }
.welcome-header h2 { max-width: 680px; font-size: 27px; }
.workflow-launcher, .start-guide { border-color: #dfe5ee; box-shadow: none; }
.workflow-table button { background: #fff; }
.workflow-table button:hover { border-color: #c7d6f5; background: #f8faff; }
.message-list { width: min(920px, calc(100% - 32px)); }
.message { padding-block: 15px; }
.composer-wrap { padding-top: 10px; border-top-color: #dfe5ee; }
.composer { border-color: #cfd8e6; border-radius: 8px; box-shadow: 0 8px 26px rgba(24, 43, 78, .08); }
.composer:focus-within { border-color: #7f9fe9; box-shadow: 0 0 0 3px rgba(47, 97, 213, .1), 0 8px 26px rgba(24, 43, 78, .08); }
.compact-tool { display: inline-flex; align-items: center; gap: 5px; }
.composer-model-picker { border-color: #d4dce8; background: #f8fafc; }
.send-button { min-width: 78px; border-radius: 6px; background: #2f61d5; }
.send-button:hover { background: #234cae; }
.inspector-header { height: 68px; }
.inspector-tabs { background: #fbfcfe; }
.inspector-tab, .inspector-tabs button { min-width: 0; }
.platform-entry { background: #f1f5ff; box-shadow: none; }
.platform-entry-logo { background: #2f61d5; box-shadow: none; }
.jump-bottom { border-radius: 6px; }
.local-data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.local-data-actions button { min-width: 0; min-height: 34px; padding: 7px 8px; border-radius: 5px; font-size: 10px; }
.disconnect-key-button { border: 1px solid #d7deea; background: #fff; color: #526079; }
.disconnect-key-button:hover { border-color: #c43d4d; background: #fff5f6; color: #a62f3d; }
.lucide { display: block; }

@media (max-width: 940px) {
  .topbar::after { display: none; }
}

@media (max-width: 760px) {
  .workspace { grid-template-rows: 54px auto auto minmax(0,1fr) auto; }
  .topbar { height: 54px; }
  .inspector {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(74dvh, 680px);
    border-top: 1px solid #cfd8e6;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    transform: translateY(105%);
    box-shadow: 0 -16px 38px rgba(17, 31, 55, .18);
  }
  .app-shell.inspector-open .inspector { transform: translateY(0); }
  .welcome-header h2 { font-size: 20px; }
  .composer { box-shadow: 0 5px 18px rgba(24, 43, 78, .08); }
}

@media (max-width: 520px) {
  .topbar-actions .toolbar-button span { display: none; }
  .topbar-actions .toolbar-button { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .platform-portal { min-width: 116px; }
  .local-data-actions { grid-template-columns: 1fr; }
}

/* JuFlow classic Zeno studio layout */
:root {
  --bg: #f7f7fc;
  --panel: #ffffff;
  --panel-soft: #f7f7fc;
  --line: #e5e5ee;
  --line-strong: #d8d8e4;
  --text: #1c1c2e;
  --muted: #6f7280;
  --faint: #999ca8;
  --primary: #4f46e5;
  --primary-dark: #4238d1;
  --primary-soft: #eeedff;
  --success: #16855b;
  --warning: #a66512;
  --danger: #c95745;
  --sidebar: 240px;
  --inspector: 328px;
}

.app-shell, body { font-family: "DM Sans", Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; }
.app-shell { grid-template-columns: var(--sidebar) minmax(0,1fr) 0; }
.app-shell.inspector-open { grid-template-columns: var(--sidebar) minmax(0,1fr) var(--inspector); }
.app-shell:not(.inspector-open) .inspector { overflow: hidden; border-left: 0; }
.sidebar { background: #fff; }
.brand-row { height: 74px; padding: 0 16px; }
.brand-mark { width: 36px; height: 36px; border: 0; border-radius: 8px; }
.brand-copy strong { color: #0f0f1a; font-size: 16px; }
.brand-copy span { margin-top: 4px; color: #858895; font-size: 10px; font-style: italic; }
.new-task-button { min-height: 40px; margin: 13px 12px 8px; border-radius: 6px; background: #4f46e5; }
.new-task-button:hover { background: #4238d1; }

.workspace-nav { padding: 4px 8px 2px; }
.workspace-nav > .section-label { margin: 10px 9px 7px; }
.workspace-nav-item {
  width: 100%; min-height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 5px; background: transparent; color: #545865; text-align: left;
}
.workspace-nav-item svg { width: 17px; height: 17px; color: #858996; flex: 0 0 auto; }
.workspace-nav-item:hover { background: #f7f7fc; color: #1c1c2e; }
.workspace-nav-item.is-active { background: #eeedff; color: #352ea4; font-weight: 700; }
.workspace-nav-item.is-active svg { color: #4f46e5; }

.sidebar-capacity { margin: 10px 12px 8px; padding: 11px; border: 1px solid #e5e5ee; border-radius: 6px; background: #f7f7fc; }
.sidebar-capacity div { display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.sidebar-capacity b { font-size: 11px; }
.sidebar-capacity i { color: #4f46e5; font-style: normal; }
.sidebar-capacity progress { width: 100%; height: 5px; margin: 8px 0 3px; accent-color: #4f46e5; }
.sidebar-capacity small { color: #717582; font-size: 9px; }
.history-section { padding-top: 2px; }
.history-item { min-height: 45px; }

.workspace { height: 100dvh; max-height: 100dvh; grid-template-rows: 68px auto auto minmax(0,1fr) auto; background: #f7f7fc; }
.topbar { height: 68px; padding: 0 18px; background: #fff; }
.topbar::after { content: none; }
.task-heading p { display: none; }
.task-heading h1 { max-width: 320px; color: #0f0f1a; font-size: 20px; line-height: 1.1; }
.task-heading span { margin-top: 4px; color: #6f7280; font-size: 10px; }
.header-search-button { width: 240px; height: 36px; padding: 0 9px; display: flex; align-items: center; gap: 8px; border: 1px solid #d8d8e4; border-radius: 6px; background: #f7f7fc; color: #6f7280; text-align: left; }
.header-search-button svg { width: 14px; height: 14px; }
.header-search-button span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-search-button kbd { padding: 2px 5px; border: 1px solid #d8d8e4; border-radius: 4px; background: #fff; color: #999ca8; font: 9px Consolas,monospace; }
.service-pill { height: 36px; padding: 0 10px; border-color: #cfe7dc; border-radius: 6px; background: #e8f6ef; color: #126344; font-weight: 700; }
.platform-portal { min-width: 36px; width: 36px; height: 36px; padding: 0; display: grid; grid-template-columns: 1fr; place-items: center; border-color: #d7dae2; }
.platform-portal-mark { width: 26px; height: 26px; }
.platform-portal-copy, .platform-portal-arrow { display: none; }
.toolbar-button { height: 36px; padding: 0 9px; }

.run-strip > header { height: 39px; padding: 0 16px; }
.run-strip > header b { font-size: 12px; }
.run-strip > header span { font-size: 10px; }
.run-strip-list { padding: 8px 12px 9px; gap: 8px; }
.run-strip-item { width: 210px; min-width: 210px; height: 57px; }

.content-stage { background: #f7f7fc; }
.content-stage.is-welcome .conversation-header { display: none; }
.conversation-header { position: sticky; z-index: 8; top: 0; height: 57px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e6eb; background: rgba(255,255,255,.97); }
.conversation-header > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.conversation-avatar { width: 31px; height: 31px; flex: 0 0 auto; overflow: hidden; border-radius: 7px; }
.conversation-avatar img { width: 100%; height: 100%; display: block; }
.conversation-header > div > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conversation-header b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-header small { display: flex; align-items: center; gap: 5px; color: #717582; font-size: 9px; }
.conversation-header small > i { width: 6px; height: 6px; border-radius: 50%; background: #20a36d; }

.welcome-state { width: min(1040px,calc(100% - 48px)); margin: 26px auto 34px; }
.welcome-header { grid-template-columns: minmax(0,1fr) 224px; gap: 26px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.welcome-copy { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.welcome-copy > div:first-child { min-width: 0; }
.welcome-header h2 { max-width: 620px; color: #0f0f1a; font-size: 22px; line-height: 1.28; }
.welcome-copy > div:first-child > p:last-child { max-width: 650px; margin: 8px 0 0; color: #6f7280; font-size: 11px; line-height: 1.65; }
.studio-dashboard-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.studio-dashboard-actions button { height: 34px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d8d8e4; border-radius: 6px; background: #fff; color: #4f46e5; font-size: 10px; white-space: nowrap; }
.studio-dashboard-actions button:hover { border-color: #b8b5ed; background: #f4f3ff; }
.studio-dashboard-actions button.is-primary { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.studio-dashboard-actions button.is-primary:hover { border-color: #4238d1; background: #4238d1; }
.studio-dashboard-actions svg { width: 14px; height: 14px; }
.connection-summary { border-color: #e5e5ee; border-radius: 6px; background: #fff; }
.connection-summary div { border-bottom-color: #e5e5ee; }
.studio-metrics { margin-top: 24px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; }
.studio-metrics article { min-width: 0; min-height: 112px; padding: 17px 16px; display: flex; flex-direction: column; border: 1px solid #e5e5ee; border-radius: 6px; background: #fff; }
.studio-metrics span { color: #6f7280; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.studio-metrics strong { margin-top: 12px; color: #0f0f1a; font-size: 23px; line-height: 1; }
.studio-metrics strong i { color: inherit; font-style: normal; }
.studio-metrics strong small { font-size: 12px; font-weight: 400; color: #6f7280; }
.studio-metrics small { margin-top: auto; color: #999ca8; font-size: 9px; }
.workflow-launcher { padding: 25px 0 0; border: 0; background: transparent; }
.block-heading h3 { color: #0f0f1a; font-size: 15px; }
.block-heading button { border-color: #d8d8e4; border-radius: 6px; }
.workflow-table { display: grid; gap: 8px; overflow: visible; border: 0; border-radius: 0; }
.workflow-table button { border: 1px solid #e5e5ee; border-radius: 6px; background: #fff; }
.workflow-table button:hover { border-color: #bbb7f2; background: #fafaff; }
.start-guide { display: none; }
.message-list { width: min(760px,calc(100% - 40px)); padding: 20px 0 30px; }
.message { grid-template-columns: minmax(0,1fr); gap: 0; padding: 17px 0; }
.message-avatar { display: none; }
.message-meta { margin-bottom: 7px; }
.message.assistant .message-meta b { color: #4f46e5; }

.composer-wrap { padding: 10px max(18px,calc((100% - 800px)/2)) 12px; background: #f7f7fc; }
.composer { border-color: #d7dae2; border-radius: 7px; box-shadow: 0 5px 18px rgba(30,32,43,.05); }
.composer:focus-within { border-color: #9b96ed; box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.composer-toolbar { min-height: 38px; padding: 4px 9px; background: #fff; }
.composer-mode-switch { overflow: hidden; border: 1px solid #e5e5ee; border-radius: 5px; background: #f7f7fc; }
.composer-mode-switch button { min-width: 46px; height: 28px; padding: 0 8px; border: 0; border-right: 1px solid #e4e6eb; background: transparent; color: #717582; font-size: 10px; }
.composer-mode-switch button:last-child { border-right: 0; }
.composer-mode-switch button.is-active { background: #fff; color: #4f46e5; font-weight: 700; box-shadow: inset 0 -2px 0 #4f46e5; }
.composer-attachment-tools { margin-left: auto; }
#promptInput { min-height: 62px; }
.composer-actions { min-height: 38px; }
.send-button { width: 34px; min-width: 34px; height: 32px; padding: 0; justify-content: center; }
.send-button span { display: none; }
.composer-submit { grid-template-columns: minmax(150px,260px) 34px; }
.composer-footnote { display: none; }

.inspector { background: #f7f7fc; }
.inspector-header { display: none; }
.inspector-tabs { height: 57px; padding: 0; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; background: #fff; }
.inspector-tabs button { position: relative; border: 0; border-radius: 0; background: transparent; color: #717582; font-size: 11px; }
.inspector-tabs button.is-active { border: 0; background: #fff; color: #1c1c2e; }
.inspector-tabs button.is-active::after { position: absolute; right: 18px; bottom: 0; left: 18px; height: 2px; background: #4f46e5; content: ""; }
.inspector-tabs button > i { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 3px; border-radius: 9px; background: #eeedff; color: #4f46e5; font-size: 9px; font-style: normal; }
.inspector-body { padding: 15px 12px; background: #f7f7fc; }
.panel-intro h3 { font-size: 13px; }
.inspector-task-list { display: flex; flex-direction: column; gap: 7px; }
.inspector-task-card { min-width: 0; min-height: 64px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px; padding: 7px; border: 1px solid #e4e6eb; border-radius: 6px; background: #fff; }
.inspector-task-card.is-running { border-color: #bbb7f2; box-shadow: 0 0 0 2px rgba(79,70,229,.06); }
.inspector-task-card > button:first-child { min-width: 0; display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; text-align: left; }
.inspector-task-card > button:first-child > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.inspector-task-preview { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 5px; background: color-mix(in srgb,var(--task-color) 12%,#fff); color: var(--task-color); font-size: 11px; font-weight: 800; }
.inspector-task-card b, .inspector-task-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector-task-card b { font-size: 10px; }
.inspector-task-card small { color: #717582; font-size: 8px; }
.inspector-task-card span > i { height: 3px; overflow: hidden; border-radius: 2px; background: #e7e8ec; }
.inspector-task-card span > i em { display: block; height: 100%; background: #4f46e5; }
.inspector-task-card > button:last-child { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #989ca8; }
.inspector-task-card > strong { color: #4f46e5; font-size: 8px; }

@media (min-width: 761px) and (max-width: 1050px) {
  :root { --sidebar: clamp(190px,22vw,220px); }
  .app-shell, .app-shell.inspector-open { grid-template-columns: var(--sidebar) minmax(0,1fr); }
  .header-search-button { width: clamp(130px,20vw,180px); }
  .toolbar-button span { display: none; }
  .toolbar-button { width: 36px; padding: 0; justify-content: center; }
}

@media (min-width: 1051px) and (max-width: 1180px) {
  :root { --sidebar: clamp(210px,20vw,240px); --inspector: clamp(270px,25vw,292px); }
  .app-shell { grid-template-columns: var(--sidebar) minmax(0,1fr) 0; }
  .app-shell.inspector-open { grid-template-columns: var(--sidebar) minmax(0,1fr) var(--inspector); }
  .inspector { position: static; width: auto; transform: none; box-shadow: none; transition: none; }
  .app-shell.inspector-open .inspector { transform: none; }
  .header-search-button { width: clamp(140px,15vw,180px); }
  .toolbar-button span { display: none; }
  .toolbar-button { width: 36px; padding: 0; justify-content: center; }
  .message-list { width: min(760px,calc(100% - 28px)); }
  .composer-wrap { padding-inline: max(14px,calc((100% - 800px)/2)); }
}

@media (min-width: 761px) and (max-width: 900px) {
  .studio-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  :root { --sidebar: 280px; }
  .app-shell, .app-shell.inspector-open { grid-template-columns: minmax(0,1fr); }
  .brand-row { height: 64px; }
  .new-task-button { min-height: 38px; margin: 8px 12px 5px; }
  .workspace-nav { padding: 2px 8px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 4px; row-gap: 2px; }
  .workspace-nav > .section-label { grid-column: 1 / -1; margin: 6px 8px 4px; }
  .workspace-nav-item { min-height: 34px; padding: 0 7px; gap: 7px; }
  .workspace-nav-item svg { width: 15px; height: 15px; }
  .workspace-nav-item[data-zeno-panel="workflows"] { grid-column: 2; grid-row: 4; }
  .workspace-nav-item[data-zeno-panel="inspiration"] { grid-column: 1; grid-row: 4; }
  .history-section { min-height: 174px; padding-top: 4px; flex: 1 1 220px; }
  .history-list { min-height: 135px; overscroll-behavior: contain; }
  .sidebar-capacity { margin-top: 6px; padding: 9px; }
  .workspace { grid-template-rows: 50px auto auto minmax(0,1fr) auto; }
  .topbar { height: 50px; padding: 0 8px; }
  .header-search-button, .task-heading p, .task-heading span, .service-pill { display: none; }
  .task-heading h1 { font-size: 14px; }
  .platform-portal { display: grid; }
  .conversation-header { height: 48px; padding: 0 9px; }
  .conversation-avatar { width: 27px; height: 27px; }
  .conversation-header .icon-button { width: 30px; height: 30px; }
  .welcome-state { width: calc(100% - 22px); margin-top: 16px; }
  .welcome-header { grid-template-columns: 1fr; padding: 0; }
  .welcome-copy { flex-direction: column; gap: 13px; }
  .studio-dashboard-actions { width: 100%; }
  .studio-dashboard-actions button { flex: 1; justify-content: center; }
  .studio-metrics { margin-top: 18px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .studio-metrics article { min-height: 94px; padding: 13px; }
  .studio-metrics strong { margin-top: 9px; font-size: 20px; }
  .connection-summary { display: none; }
  .workflow-launcher { padding: 20px 0 0; }
  .message-list { width: calc(100% - 20px); padding: 4px 0 14px; }
  .message { padding: 11px 0; }
  .message-meta { margin-bottom: 5px; }
  .composer-wrap { padding: 4px 6px max(5px,env(safe-area-inset-bottom)); }
  .composer-toolbar { min-height: 31px; padding: 2px 5px; align-items: center; flex-wrap: nowrap; }
  .composer-mode-switch button { height: 26px; }
  .composer-attachment-tools { margin-left: auto; flex: 0 0 auto; }
  .compact-tool { width: 28px; height: 28px; padding: 0; justify-content: center; }
  .compact-tool span { display: none; }
  #promptInput { min-height: 44px; max-height: 96px; padding: 7px 8px; font-size: 12px; line-height: 1.45; }
  .composer-actions { min-height: 38px; padding: 3px 5px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 6px; }
  .composer-actions > div:first-child { min-height: 0; gap: 4px; white-space: nowrap; }
  .composer-submit { width: 100%; grid-template-columns: minmax(0,1fr) 34px; }
  .composer-model-picker { width: 100%; height: 32px; }
  #clearTaskButton { padding-inline: 4px; }
  .composer.is-input-focused .composer-toolbar,
  .composer:focus-within:not(:has(.composer-toolbar :focus)) .composer-toolbar { display: none; }
  .composer.is-input-focused .composer-actions,
  .composer:focus-within:not(:has(.composer-toolbar :focus)) .composer-actions { grid-template-columns: minmax(0,1fr); }
  .composer.is-input-focused .composer-actions > div:first-child,
  .composer:focus-within:not(:has(.composer-toolbar :focus)) .composer-actions > div:first-child { display: none; }
  .mode-hint { display: none; }
  .inspector-header { display: flex; }
  .inspector-tabs { height: 48px; }
  .inspector-body { padding: 10px; }
}

@media (max-width: 760px) and (max-height: 700px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .history-section { flex: 0 0 174px; }
}

@media (max-width: 520px) {
  .toolbar-button { width: 34px; padding: 0; }
  .composer-mode-switch button { min-width: 42px; padding: 0 6px; }
  .compact-tool { padding-inline: 5px; }
  .compact-tool span { display: none; }
  .studio-metrics { grid-template-columns: 1fr 1fr; }
  .studio-metrics small { line-height: 1.3; }
}

/* Classic Zeno readability scale */
.brand-copy span,
.privacy-note,
.sidebar-capacity small { font-size: 11px; line-height: 1.45; }
.section-label { font-size: 12px; }
.history-item { min-height: 48px; }
.history-item b,
.account-button b { font-size: 13px; }
.history-item small,
.account-button small { font-size: 11px; line-height: 1.35; }
.sidebar-platform-link { min-height: 38px; }
.sidebar-platform-link b { font-size: 11px; }
.sidebar-platform-link small { font-size: 10px; }

.task-heading span,
.conversation-header small,
.run-strip > header span,
.context-bar > div:first-child span,
.context-bar > button { font-size: 11px; }
.toolbar-button,
.service-pill { font-size: 12px; }
.run-strip-copy b { font-size: 11px; }
.run-strip-copy small { font-size: 10px; }

.eyebrow { font-size: 10px; }
.welcome-copy > div:first-child > p:last-child { font-size: 13px; line-height: 1.7; }
.studio-dashboard-actions button { font-size: 12px; }
.connection-summary dt,
.connection-summary dd { font-size: 11px; }
.studio-metrics span { font-size: 11px; }
.studio-metrics small { font-size: 10px; line-height: 1.45; }
.block-heading p { font-size: 12px; line-height: 1.55; }
.block-heading button { font-size: 11px; }
.workflow-table button { min-height: 46px; }
.workflow-table button span { font-size: 11px; }
.workflow-table button b { font-size: 13px; }
.workflow-table button small { font-size: 12px; }
.workflow-table button em { font-size: 10px; }

.message-meta b { font-size: 12px; }
.message-meta span { font-size: 10px; }
.attachment-note span { font-size: 11px; }
.message-bubble { font-size: 15px; line-height: 1.75; }
.message-bubble h1 { font-size: 21px; }
.message-bubble h2 { font-size: 18px; }
.message-bubble h3 { font-size: 16px; }
.message-bubble h4 { font-size: 15px; }
.message-bubble code { font-size: 13px; }
.message-bubble table { font-size: 13px; }
.message-bubble pre .code-lang,
.message-bubble pre .code-copy-btn,
.message-actions button { font-size: 10px; }
.generation-status b,
.media-placeholder { font-size: 12px; }
.generation-status small,
.media-card-footer small,
.media-card-footer a { font-size: 10px; }

.composer-mode-switch button,
.compact-tool,
.text-tool { font-size: 11px; }
#promptInput { font-size: 14px; line-height: 1.65; }
.composer-model-picker b { font-size: 12px; }
.char-count { font-size: 10px; }

.inspector-tabs button,
.field-label { font-size: 12px; }
.panel-intro p,
.model-summary p,
.toggle-row small,
.cost-note,
.file-warning,
.task-info dt,
.task-info dd { font-size: 10px; }
.setting-title h3,
.toggle-row b,
.model-summary b,
.workflow-entry h4 { font-size: 12px; }
.setting-title span,
.range-heading,
.range-heading output,
.segmented button { font-size: 10px; }
.workflow-entry p,
.workflow-entry ol,
.workflow-entry button { font-size: 11px; }
.workflow-entry button { height: 31px; }

.file-dropzone b,
.file-item b,
.composer-file-copy b { font-size: 11px; }
.file-dropzone span,
.file-item small,
.composer-file-copy small,
.context-meter small { font-size: 10px; }
.file-item { min-height: 46px; }
.reference-options select,
.reference-options output { font-size: 10px; }
.current-reference-card b,
.library-media-copy b { font-size: 10px; }
.current-reference-card small,
.library-media-copy small,
.library-media-preview .remote-badge,
.library-media-actions button { font-size: 9px; }
.library-heading h4 { font-size: 12px; }
.library-heading button,
.library-filters button { font-size: 10px; }
.library-filters button { height: 30px; }

.model-results h3 { font-size: 11px; }
.model-option { min-height: 46px; }
.model-option b { font-size: 12px; }
.model-option small { font-size: 10px; }
.dialog-copy { font-size: 13px; }
.platform-entry small,
.key-field > span,
.remember-row b,
.key-error,
.toast { font-size: 11px; }
.remember-row small,
.trust-row,
.media-preview-footer span,
.media-preview-footer button { font-size: 10px; }

@media (min-width: 1051px) and (max-width: 1180px) {
  .welcome-state { width: calc(100% - 28px); margin-top: 18px; }
  .welcome-header { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .welcome-copy { flex-direction: column; gap: 12px; }
  .welcome-copy > div:first-child > p:last-child { max-width: none; }
  .studio-dashboard-actions { width: 100%; }
  .studio-dashboard-actions button { flex: 1; justify-content: center; }
  .studio-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .welcome-header h2 { font-size: 22px; line-height: 1.35; }
  .welcome-copy > div:first-child > p:last-child { font-size: 13px; line-height: 1.65; }
  .studio-dashboard-actions button { font-size: 11px; }
  .studio-metrics span { font-size: 10px; }
  .studio-metrics small { font-size: 10px; }
  .workflow-table button { min-height: 42px; }
  .workflow-table button b { font-size: 12px; }
  .workflow-table button small { font-size: 11px; }
  .message-bubble { font-size: 14px; line-height: 1.7; }
  #promptInput { min-height: 44px; font-size: 14px; line-height: 1.5; }
  .composer-mode-switch button { font-size: 11px; }
}
