:root {
  color-scheme: dark;
  --bg: #080c12;
  --surface: #101720;
  --raised: #141c25;
  --surface-hover: #18212b;
  --input: #0c1219;
  --line: #202a34;
  --line-strong: #2a3541;
  --text: #f2f5f8;
  --heading: #eef2f5;
  --muted: #9fabb7;
  --subtle: #7f8c98;
  --green: #2ac47b;
  --green-hover: #38d589;
  --green-deep: #173522;
  --danger: #c88484;
  --purple: #a192f5;
  --cyan: #70c9e0;
  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar: 300px;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  overflow: hidden;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(1px);
}
.ambient-one {
  width: 720px;
  height: 720px;
  left: -340px;
  top: -360px;
  background: radial-gradient(circle, rgba(42, 196, 123, .085), transparent 66%);
}
.ambient-two {
  width: 640px;
  height: 640px;
  right: -390px;
  bottom: -420px;
  background: radial-gradient(circle, rgba(112, 201, 224, .045), transparent 68%);
}

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: Manrope, "DM Sans", Inter, sans-serif; color: var(--heading); letter-spacing: -.035em; }
em { color: var(--green); font-style: normal; }
label { display: block; margin: 18px 0 8px; color: #cbd3da; font-size: 13px; font-weight: 650; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--input);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
input { height: 50px; padding: 0 15px; }
textarea { resize: none; padding: 15px 16px 2px; max-height: 190px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #65727f; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(42, 196, 123, .12); background: #0e151d; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: Manrope, Inter, sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .085em;
}
.brand-slash { color: var(--green); padding: 0 2px; }
.brand-mark { width: 32px; height: 32px; display: block; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 0 12px rgba(42, 196, 123, .2)); }
.brand-mark.small { width: 25px; height: 25px; }

.eyebrow, .kicker { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .18em; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow > span { width: 22px; height: 1px; background: var(--green); }
.eyebrow.centered { justify-content: center; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr); }
.login-intro { min-height: 100vh; padding: 48px clamp(48px, 7vw, 112px); display: flex; flex-direction: column; border-right: 1px solid rgba(42, 53, 65, .58); }
.login-copy { max-width: 740px; margin: auto 0; padding: 96px 0 72px; }
.login-copy h1 { margin-top: 24px; font-size: clamp(44px, 5.6vw, 78px); line-height: 1.04; font-weight: 650; }
.login-copy > p:last-child { max-width: 650px; margin-top: 28px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.feature-row { display: flex; flex-wrap: wrap; gap: 24px; padding: 23px 0; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.feature-row span { display: flex; align-items: center; gap: 8px; }
.feature-row i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.login-panel { display: grid; place-items: center; min-height: 100vh; padding: 36px clamp(28px, 5vw, 72px); background: rgba(10, 15, 22, .44); }
.login-card { width: min(100%, 430px); padding: 38px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(20, 28, 37, .96), rgba(14, 21, 29, .96)); box-shadow: var(--shadow); }
.login-card-heading h2 { margin-top: 8px; font-size: 31px; }
.login-card-heading p { margin-top: 9px; color: var(--muted); font-size: 14px; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.field-action { position: absolute; right: 8px; top: 7px; }
.button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 720;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .58; transform: none; }
.button.primary { background: var(--green); color: #06120c; }
.button.primary:hover { background: var(--green-hover); }
.button.secondary { background: var(--raised); border-color: var(--line-strong); color: var(--text); }
.button.danger { background: rgba(200, 132, 132, .09); border-color: rgba(200, 132, 132, .28); color: #e1a8a8; }
.button.wide { width: 100%; }
.login-card .button { margin-top: 24px; }
.button svg { width: 18px; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: var(--subtle); font-size: 11px; }
.auth-divider { margin: 22px 0 16px; display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.button.kyroid { margin-top: 0; border-color: var(--line-strong); background: var(--input); color: var(--text); box-shadow: none; }
.button.kyroid:hover { border-color: #355042; background: var(--raised); }
.kyroid-mark { width: 28px; height: 28px; flex: 0 0 auto; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(42, 196, 123, .08); }
.form-error { margin-top: 14px; padding: 10px 12px; border: 1px solid rgba(200, 132, 132, .28); border-radius: var(--radius-sm); background: rgba(200, 132, 132, .08); color: #dfa1a1; font-size: 13px; }

.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; transition: background 180ms ease, color 180ms ease; }
.icon-button:hover { background: var(--raised); color: var(--text); }
.icon-button:focus-visible, .browser-view-switch button:focus-visible, .hub-tabs button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.icon-button.tiny { width: 30px; height: 30px; }
.icon-button.tiny svg { width: 16px; }

.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
/* Long histories must scroll inside the sidebar, never enlarge the app's grid row. */
.sidebar { position: relative; z-index: 20; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0b1118; }
.sidebar > :not(.sidebar-scroll) { flex-shrink: 0; }
/* On short landscape windows, keep the account footer reachable as well. */
.sidebar > .tool-nav { min-height: 0; flex-shrink: 1; overflow-y: auto; }
.sidebar-head { min-height: 84px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.brand.compact { font-size: 13px; gap: 10px; }
.new-chat { min-height: 48px; margin: 4px 16px 18px; justify-content: flex-start; font-size: 14px; }
.new-chat svg { width: 17px; }
.tool-nav { margin: 0 12px 14px; padding: 0 4px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 3px; }
.tool-nav-heading { padding: 5px 10px 7px; color: #6f7c88; font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.tool-nav-item { min-width: 0; min-height: 42px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; display: flex; align-items: center; gap: 11px; color: var(--muted); cursor: pointer; font-size: 12px; text-align: left; }
.tool-nav-item:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.tool-nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.tool-nav-item.admin-entry { margin-top: 5px; border-color: rgba(42, 196, 123, .18); background: rgba(42, 196, 123, .045); color: #b8d9c8; }
.sidebar-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 18px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-section { margin-top: 13px; }
.nav-section.grow { margin-top: 27px; }
.nav-heading { height: 36px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; color: #778591; font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.nav-heading-actions { display: flex; align-items: center; gap: 1px; }
.nav-list { display: grid; gap: 3px; }
.project-row { position: relative; min-width: 0; }
.project-row .nav-item { padding-right: 73px; }
.conversation-row { position: relative; min-width: 0; }
.conversation-row .nav-item { padding-right: 39px; }
.conversation-running { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(112, 201, 224, .08); flex: 0 0 auto; animation: running-pulse 1.4s ease-in-out infinite; }
.conversation-queue-count { margin-left: auto; padding: 2px 6px; border-radius: 999px; background: rgba(112, 201, 224, .1); color: var(--cyan); flex: 0 0 auto; font-size: 8px; font-weight: 800; }
.conversation-queue-count + .conversation-running { margin-left: 0; }
.conversation-delete-action { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--subtle); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 160ms ease, color 160ms ease, background 160ms ease; }
.conversation-row:hover .conversation-delete-action, .conversation-row:focus-within .conversation-delete-action { opacity: 1; }
.conversation-delete-action:hover { background: rgba(200, 132, 132, .1); color: var(--danger); }
.conversation-delete-action svg { width: 15px; height: 15px; }
.project-archive-action { position: absolute; top: 6px; right: 5px; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--subtle); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 150ms ease, background 150ms ease, color 150ms ease; }
.project-edit-action { position: absolute; top: 6px; right: 38px; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--subtle); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 150ms ease, background 150ms ease, color 150ms ease; }
.project-row:hover .project-archive-action, .project-row:hover .project-edit-action, .project-archive-action:focus-visible, .project-edit-action:focus-visible { opacity: 1; }
.project-archive-action:hover { background: rgba(200, 132, 132, .1); color: var(--danger); }
.project-edit-action:hover { background: rgba(42, 196, 123, .08); color: var(--green); }
.project-archive-action svg, .project-edit-action svg { width: 15px; height: 15px; }
.nav-item { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; display: flex; align-items: center; gap: 11px; text-align: left; color: var(--muted); cursor: pointer; overflow: hidden; font-size: 13px; transition: background 160ms ease, color 160ms ease, border 160ms ease; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--text); background: var(--raised); border-color: var(--line); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversations .nav-item { min-height: 40px; padding-left: 11px; font-size: 12px; color: #98a4af; }
.conversations .nav-item::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #43505c; flex: 0 0 auto; }
.conversations .nav-item.active::before { background: var(--green); }
.nav-empty { padding: 8px 10px; color: #596672; font-size: 11px; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--line); }
.account-button { width: 100%; min-width: 0; padding: 9px; border: 0; border-radius: var(--radius); background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.account-button:hover { background: var(--surface); }
.avatar { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(42, 196, 123, .25); border-radius: 9px; background: var(--green-deep); color: var(--green-hover); font-size: 12px; font-weight: 800; }
.avatar.large { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.avatar img, .message-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.account-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.account-copy strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { overflow: hidden; color: var(--subtle); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-button > svg { width: 17px; color: var(--subtle); }

.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: radial-gradient(circle at 50% 34%, rgba(23, 53, 34, .22), transparent 42%); }
.topbar { position: relative; z-index: 10; min-width: 0; min-height: 80px; padding: 12px 24px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(32, 42, 52, .78); background: rgba(8, 12, 18, .82); backdrop-filter: blur(14px); }
.context { position: relative; min-width: 0; max-width: 260px; display: flex; flex-direction: column; }
.context-label { color: #71808d; font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.context-select { margin-left: -7px; padding: 3px 7px; border: 0; border-radius: 6px; background: transparent; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 700; }
.context-select:hover { background: var(--surface); }
.context-select { min-width: 0; max-width: 100%; }
#active-project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-icon, .context-select > .chevron { flex-shrink: 0; }
.context-icon { color: var(--green); display: flex; }
.context-icon svg { width: 15px; }
.chevron { width: 14px; color: var(--subtle); }
.topbar-actions { min-width: 0; max-width: 100%; display: flex; flex: 1 1 620px; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.topbar-actions > * { flex-shrink: 0; }
.scope-switch { padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--input); display: flex; }
.scope-switch button { height: 32px; padding: 0 13px; border: 0; border-radius: 6px; background: transparent; color: var(--subtle); cursor: pointer; font-size: 11px; font-weight: 700; }
.scope-switch button.active { background: var(--raised); color: var(--text); }
.git-status-button { min-width: 0; height: 34px; padding: 0 10px; border: 1px solid rgba(42, 196, 123, .2); border-radius: 8px; background: rgba(42, 196, 123, .055); color: #a8d9bf; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 10px; font-weight: 750; }
.git-status-button:hover { border-color: rgba(42, 196, 123, .38); background: rgba(42, 196, 123, .09); color: var(--green-hover); }
.git-status-button svg { width: 15px; height: 15px; }
.agent-switch { padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--input); display: flex; }
.agent-switch button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--subtle); cursor: pointer; font-size: 10px; font-weight: 750; transition: background 160ms ease, color 160ms ease; }
.agent-switch button:hover:not(:disabled) { color: var(--text); }
.agent-switch button.active { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035); }
.agent-switch button:disabled { opacity: .36; cursor: not-allowed; }
.provider-pill { height: 31px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.model-picker { height: 38px; margin: 0; padding: 0 10px 0 13px; border: 1px solid var(--line); border-radius: 999px; display: flex; align-items: center; gap: 8px; }
.model-picker select, .inline-actions select { border: 0; outline: 0; background: var(--input); color: var(--muted); font-size: 11px; }
.model-picker select { max-width: 190px; background: transparent; font-size: 12px; }
.model-picker.provider-claude .status-dot { background: var(--purple); box-shadow: 0 0 0 4px rgba(161, 146, 245, .08); }
.effort-picker, .permission-picker { height: 38px; margin: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; display: flex; align-items: center; gap: 6px; transition: border-color 160ms ease, background 160ms ease; }
.effort-picker > span, .permission-picker > span { color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.effort-picker select, .permission-picker select { border: 0; outline: 0; background: transparent; color: var(--muted); font-size: 11px; }
.effort-picker select { width: 68px; }
.permission-picker select { width: 108px; }
.permission-picker.provider-claude select { width: 92px; }
.permission-picker.risk { border-color: rgba(218, 157, 84, .55); background: rgba(218, 157, 84, .07); }
.permission-picker.risk span, .permission-picker.risk select { color: #e3b47d; }
.cli-trace-control { height: 38px; margin: 0; padding: 0 11px; border: 1px solid rgba(112, 201, 224, .25); border-radius: 999px; background: rgba(112, 201, 224, .055); display: flex; align-items: center; gap: 7px; color: #a9d8e4; cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.cli-trace-control:hover { border-color: rgba(112, 201, 224, .45); }
.cli-trace-control input { width: 14px; height: 14px; margin: 0; accent-color: var(--cyan); }
.popover { position: absolute; z-index: 30; top: calc(100% + 10px); left: -4px; width: 250px; padding: 7px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); box-shadow: var(--shadow); }
.project-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; display: flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; text-align: left; }
.project-menu button:hover, .project-menu button.active { background: var(--surface); color: var(--text); }
.project-menu button.active::after { content: '✓'; margin-left: auto; color: var(--green); }

.chat-scroll { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.empty-state { width: min(100% - 80px, 1160px); min-height: 100%; margin: 0 auto; padding: 72px 0 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-symbol { width: 62px; height: 58px; margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: center; gap: 6px; transform: skew(-10deg); }
.empty-symbol span { width: 11px; border-radius: 3px 3px 0 0; background: var(--green); }
.empty-symbol span:nth-child(1) { height: 27px; opacity: .45; }
.empty-symbol span:nth-child(2) { height: 42px; opacity: .7; }
.empty-symbol span:nth-child(3) { height: 58px; box-shadow: 0 0 34px rgba(42, 196, 123, .2); }
.empty-state h1 { margin-top: 17px; font-size: clamp(46px, 4vw, 68px); font-weight: 640; }
.empty-lead { max-width: 760px; margin-top: 22px; color: var(--muted); font-size: 17px; line-height: 1.72; }
.suggestion-grid { width: 100%; margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.suggestion { min-height: 166px; padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: rgba(16, 23, 32, .78); display: flex; flex-direction: column; align-items: flex-start; text-align: left; cursor: pointer; transition: transform 180ms ease, background 180ms ease, border-color 180ms ease; }
.suggestion:hover { transform: translateY(-2px); background: var(--raised); border-color: var(--line-strong); }
.suggestion-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; }
.suggestion-icon svg { width: 17px; }
.suggestion-icon.green { color: var(--green); background: rgba(42, 196, 123, .09); }
.suggestion-icon.purple { color: var(--purple); background: rgba(161, 146, 245, .09); }
.suggestion-icon.cyan { color: var(--cyan); background: rgba(112, 201, 224, .09); }
.suggestion strong { margin-top: 17px; color: var(--text); font-size: 15px; }
.suggestion small { margin-top: 5px; color: var(--subtle); font-size: 12px; }

.messages { width: min(calc(100% - 64px), 1380px); margin: 0 auto; padding: 54px 0 100px; display: grid; gap: 34px; }
.response-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 20px; }
.response-comparison .message { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(16, 23, 32, .74); align-content: start; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.response-comparison .message:hover { border-color: var(--line-strong); background: rgba(20, 28, 37, .86); }
.response-comparison .message.selected-response { border-color: rgba(42, 196, 123, .62); background: rgba(23, 53, 34, .2); box-shadow: 0 0 0 3px rgba(42, 196, 123, .07); }
.response-comparison .message.provider-claude.selected-response { border-color: rgba(161, 146, 245, .62); background: rgba(161, 146, 245, .07); box-shadow: 0 0 0 3px rgba(161, 146, 245, .06); }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; animation: message-in 220ms ease both; }
.message-avatar { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 800; }
.message.assistant .message-avatar { border-color: rgba(42, 196, 123, .22); background: var(--green-deep); color: var(--green); }
.message.assistant.provider-claude .message-avatar { border-color: rgba(161, 146, 245, .24); background: rgba(161, 146, 245, .09); color: var(--purple); }
.message-body { min-width: 0; padding-top: 4px; }
.message-meta { margin-bottom: 7px; color: var(--subtle); font-size: 10px; font-weight: 730; letter-spacing: .08em; }
.message-content { color: #dbe1e6; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.message.user .message-content { color: var(--text); white-space: pre-wrap; }
.message.pending .message-content { color: var(--muted); }
.message.queued { margin-left: 48px; padding: 12px 14px; border: 1px dashed rgba(112, 201, 224, .28); border-radius: 11px; background: rgba(112, 201, 224, .035); opacity: .82; }
.message.queued .message-avatar { border-color: rgba(112, 201, 224, .28); color: var(--cyan); }
.message.queued .message-meta { color: var(--cyan); }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p, .message-content ul, .message-content ol, .message-content blockquote, .message-content pre, .message-content table { margin: 0 0 14px; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 { margin: 22px 0 9px; color: var(--heading); line-height: 1.3; }
.message-content h1 { font-size: 1.45em; }
.message-content h2 { font-size: 1.28em; }
.message-content h3 { font-size: 1.13em; }
.message-content ul, .message-content ol { padding-left: 24px; }
.message-content li + li { margin-top: 4px; }
.message-content blockquote { padding: 3px 0 3px 14px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.message-content code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--input); color: #c7e8d7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86em; }
.message-content pre { max-width: 100%; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #090e14; }
.message-content pre code { padding: 0; border: 0; background: transparent; color: #d5dce2; font-size: 12px; white-space: pre; }
.message-content table { width: 100%; max-width: 100%; border-collapse: collapse; display: block; overflow-x: auto; overflow-wrap: normal; }
.message-content th, .message-content td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.message-content th { background: var(--surface); color: var(--heading); }
.message-content a { color: var(--cyan); text-decoration-color: rgba(112, 201, 224, .42); text-underline-offset: 3px; }
.message-content hr { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.cli-trace { margin-top: 14px; border: 1px solid rgba(112, 201, 224, .22); border-radius: 10px; overflow: hidden; background: rgba(8, 14, 20, .72); }
.cli-trace summary { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: #b8dce5; cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.cli-trace summary::-webkit-details-marker { display: none; }
.cli-trace summary::before { content: '›'; color: var(--cyan); font-size: 17px; transition: transform 150ms ease; }
.cli-trace[open] summary::before { transform: rotate(90deg); }
.cli-trace summary small { margin-left: auto; padding: 2px 6px; border-radius: 999px; background: rgba(112, 201, 224, .09); color: var(--cyan); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.cli-activity-list { max-height: 420px; padding: 5px 12px 10px; overflow: auto; border-top: 1px solid var(--line); }
.cli-activity { position: relative; min-width: 0; padding: 10px 8px 10px 22px; border-bottom: 1px solid rgba(43, 55, 67, .54); }
.cli-activity:last-child { border-bottom: 0; }
.cli-activity::before { content: ''; position: absolute; left: 4px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(112, 201, 224, .08); }
.cli-activity::after { content: ''; position: absolute; left: 7px; top: 27px; bottom: -6px; width: 1px; background: rgba(112, 201, 224, .18); }
.cli-activity:last-child::after { display: none; }
.cli-activity.command::before { background: var(--green); box-shadow: 0 0 0 4px rgba(42, 196, 123, .08); }
.cli-activity.file::before { background: var(--purple); box-shadow: 0 0 0 4px rgba(161, 146, 245, .08); }
.cli-activity.error::before { background: var(--danger); box-shadow: 0 0 0 4px rgba(226, 100, 100, .08); }
.cli-activity strong { display: block; color: #d3e4e9; font-size: 11px; line-height: 1.45; }
.cli-activity p { margin: 3px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cli-activity pre { max-height: 220px; margin: 6px 0 0; padding: 9px 10px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #070c11; color: #b8c8d3; font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.continue-agent { margin-top: 17px; padding: 8px 11px; border: 1px solid rgba(42, 196, 123, .28); border-radius: 8px; background: rgba(42, 196, 123, .07); color: var(--green); cursor: pointer; font-size: 10px; font-weight: 750; }
.provider-claude .continue-agent { border-color: rgba(161, 146, 245, .3); background: rgba(161, 146, 245, .07); color: var(--purple); }
.continue-agent:hover { filter: brightness(1.16); }
.thinking { display: inline-flex; gap: 4px; margin-left: 7px; }
.thinking i { width: 4px; height: 4px; border-radius: 50%; background: var(--green); animation: pulse 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: .14s; }
.thinking i:nth-child(3) { animation-delay: .28s; }

.composer-wrap { position: relative; z-index: 5; width: min(calc(100% - 64px), 1180px); margin: 0 auto; padding: 0 0 24px; }
.composer { min-height: 104px; border: 1px solid var(--line-strong); border-radius: 15px; background: rgba(14, 20, 28, .97); box-shadow: 0 18px 50px rgba(0, 0, 0, .25); transition: border 180ms ease, box-shadow 180ms ease; }
.composer:focus-within { border-color: rgba(42, 196, 123, .68); box-shadow: 0 0 0 3px rgba(42, 196, 123, .08), 0 18px 50px rgba(0, 0, 0, .25); }
.composer.queue-ready { border-color: rgba(112, 201, 224, .45); }
.composer.queue-ready .send-button { background: var(--cyan); }
.composer.drop-active { border-color: var(--green); box-shadow: 0 0 0 4px rgba(42, 196, 123, .12), 0 18px 50px rgba(0, 0, 0, .25); }
.composer textarea { min-height: 52px; border: 0; background: transparent; box-shadow: none; }
.composer textarea:focus { box-shadow: none; background: transparent; }
.composer-foot { min-height: 46px; padding: 3px 8px 8px 15px; display: flex; align-items: center; justify-content: space-between; }
.composer-tools { display: flex; align-items: center; gap: 5px; }
.composer-context { display: flex; align-items: center; gap: 8px; color: var(--subtle); font-size: 10px; }
.attachment-chips { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-chip { max-width: 220px; padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { width: 17px; height: 17px; padding: 0; border: 0; background: transparent; color: var(--subtle); cursor: pointer; }
.send-button { width: 37px; height: 37px; border: 0; border-radius: 9px; background: var(--green); color: #07140d; display: grid; place-items: center; cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.send-button:hover { background: var(--green-hover); transform: translateY(-1px); }
.send-button:disabled { background: #244737; color: #718c7d; cursor: wait; transform: none; }
.send-button svg { width: 18px; stroke-width: 2; }
.composer-note { margin-top: 8px; color: #56626e; text-align: center; font-size: 9px; }

.dialog { width: min(calc(100% - 32px), 480px); padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--raised); color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(3, 6, 9, .72); backdrop-filter: blur(6px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin-top: 5px; font-size: 25px; }
.dialog > form > p, .dialog > p { margin-top: 10px; color: var(--muted); font-size: 13px; }
.dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.dialog-select { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: 0; background: var(--input); color: var(--text); }
.dialog-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(42, 196, 123, .12); }
.field-note { margin-top: 9px; color: var(--subtle); font-size: 10px; line-height: 1.55; }
.git-dialog { width: min(calc(100% - 32px), 590px); }
.git-loading { margin-top: 24px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; font-size: 12px; }
.git-overview { margin-top: 23px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; align-items: center; gap: 13px; }
.git-mark { width: 43px; height: 43px; flex: 0 0 auto; border: 1px solid rgba(42, 196, 123, .25); border-radius: 11px; background: var(--green-deep); color: var(--green); display: grid; place-items: center; }
.git-mark svg { width: 20px; height: 20px; }
.git-overview > div { min-width: 0; display: flex; flex-direction: column; }
.git-overview > .status-badge { margin-left: auto; flex: 0 0 auto; }
.git-overview small { color: var(--subtle); font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.git-overview strong { margin-top: 2px; overflow: hidden; color: var(--text); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.git-overview span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.git-stats { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.git-stats > div { min-height: 67px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(16, 23, 32, .6); display: flex; flex-direction: column; }
.git-stats strong { color: var(--heading); font-size: 18px; }
.git-stats span { color: var(--subtle); font-size: 9px; }
.git-message { margin-top: 12px; min-height: 38px; padding: 10px 12px; border-radius: 8px; background: rgba(42, 196, 123, .06); color: #a8d9bf; font-size: 11px; }
.git-message.dirty { background: rgba(227, 180, 125, .07); color: #d9b58c; }
.git-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
.git-actions .button { min-width: 0; }
.sync-mode-help { margin-top: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; }
.sync-mode-help strong { color: var(--text); font-size: 11px; }
.sync-mode-help span { margin-top: 2px; color: var(--subtle); font-size: 9px; line-height: 1.5; }
.git-settings-dialog { width: min(calc(100% - 32px), 720px); max-height: min(92vh, 900px); overflow-y: auto; }
.git-auth-section { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16, 23, 32, .65); }
.git-auth-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.git-auth-head > div { display: flex; flex-direction: column; }
.git-auth-head strong { color: var(--heading); font-size: 13px; }
.git-auth-head small { margin-top: 2px; color: var(--subtle); font-size: 9px; }
.status-badge { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.status-badge.ready { border-color: rgba(42, 196, 123, .25); background: rgba(42, 196, 123, .07); color: #9ad4b5; }
.git-auth-empty { margin-top: 14px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 9px; }
.git-auth-empty p { margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.git-public-key { min-height: 82px; padding: 11px 12px; color: #b8c9bf; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.git-key-meta { margin-top: 7px; display: flex; justify-content: space-between; gap: 12px; color: var(--subtle); font-size: 9px; }
.git-key-meta code { overflow: hidden; text-overflow: ellipsis; }
.git-auth-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.git-auth-actions .button { min-height: 42px; }
.git-token-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.git-token-fields label { margin-bottom: 0; }
.git-token-list { margin-top: 16px; display: grid; gap: 7px; }
.git-token-row { min-height: 56px; padding: 9px 10px 9px 13px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.git-token-row > div { min-width: 0; display: flex; flex-direction: column; }
.git-token-row strong { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; }
.git-token-row small { color: var(--subtle); font-size: 9px; }
.git-token-row button { flex: 0 0 auto; }
.git-token-empty { padding: 13px; border: 1px dashed var(--line); border-radius: 9px; color: var(--subtle); text-align: center; font-size: 10px; }
.confirmation-dialog { width: min(calc(100% - 32px), 520px); padding: 0; overflow: hidden; }
.confirmation-dialog form { padding: 26px; }
.confirmation-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 36px; align-items: start; gap: 14px; }
.confirmation-icon { width: 44px; height: 44px; border: 1px solid rgba(200, 132, 132, .26); border-radius: 12px; background: rgba(200, 132, 132, .09); color: #dda1a1; display: grid; place-items: center; }
.confirmation-icon svg { width: 21px; height: 21px; }
.confirmation-copy { min-width: 0; }
.confirmation-copy h2 { margin-top: 4px; font-size: 21px; }
.confirmation-copy p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.confirmation-dialog[data-tone="primary"] .confirmation-icon { border-color: rgba(42, 196, 123, .28); background: rgba(42, 196, 123, .09); color: var(--green); }
.confirmation-dialog .dialog-actions { padding-top: 18px; border-top: 1px solid var(--line); }
.confirmation-dialog .button.danger:hover { border-color: rgba(200, 132, 132, .5); background: rgba(200, 132, 132, .15); }
.archive-dialog { width: min(calc(100% - 32px), 680px); }
.archived-project-list { margin-top: 22px; max-height: 54vh; overflow: auto; display: grid; gap: 9px; }
.archived-project { min-height: 72px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.archive-project-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--green-deep); color: var(--green); display: grid; place-items: center; }
.archive-project-icon svg { width: 18px; height: 18px; }
.archive-project-copy { min-width: 0; display: flex; flex-direction: column; }
.archive-project-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.archive-project-copy small { color: var(--subtle); font-size: 10px; }
.archive-empty { padding: 34px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--subtle); text-align: center; font-size: 12px; }
.settings-account { margin: 24px 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; align-items: center; gap: 13px; }
.settings-account div { display: flex; flex-direction: column; }
.settings-account small { color: var(--subtle); }
.settings-row { min-height: 52px; padding: 12px 2px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.settings-row strong { display: flex; align-items: center; gap: 8px; color: var(--text); }
.settings-row code { max-width: 55%; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.settings-preferences { margin: 18px 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16, 23, 32, .65); }
.settings-section-head { padding: 0 1px 11px; display: flex; flex-direction: column; }
.settings-section-head strong { color: var(--heading); font-size: 13px; }
.settings-section-head small { margin-top: 3px; color: var(--subtle); font-size: 10px; }
.settings-toggle-row { margin: 0; padding: 12px 1px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; }
.settings-toggle-row > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.settings-toggle-row strong { color: var(--text); font-size: 12px; }
.settings-toggle-row small { margin-top: 3px; color: var(--subtle); font-size: 9px; line-height: 1.45; }
.settings-toggle-row .switch-control { flex: 0 0 auto; }
.settings-preferences .button { margin-top: 11px; }
.settings-dialog > .button { margin-top: 22px; }
.settings-dialog #settings-admin { border-color: rgba(42, 196, 123, .28); color: #b9dec9; }
.hub-dialog { width: min(calc(100% - 32px), 1080px); height: min(86vh, 850px); padding: 0; overflow: hidden; }
.hub-head { width: 100%; margin: 0; padding: 24px 26px 18px; }
.hub-tabs { padding: 0 26px; border-bottom: 1px solid var(--line); display: flex; gap: 20px; }
.hub-tabs button { height: 42px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--subtle); cursor: pointer; font-size: 12px; font-weight: 700; }
.hub-tabs button.active { border-color: var(--green); color: var(--text); }
.hub-panel { height: calc(100% - 126px); padding: 24px 26px 32px; overflow: auto; }
.panel-toolbar { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-toolbar h3 { font-size: 19px; }
.panel-toolbar p { margin-top: 4px; color: var(--subtle); font-size: 12px; }
.upload-button { min-height: 42px; height: 42px; margin: 0; padding: 0 12px; flex: 0 0 auto; font-size: 10px; white-space: nowrap; }
.library-actions { display: flex; align-items: center; gap: 9px; }
.library-actions select, .library-filter { min-width: 190px; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: 0; background: var(--input); color: var(--muted); font-size: 11px; }
.browser-toolbar { margin: -4px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.browser-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.browser-breadcrumb { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--subtle); font-size: 11px; }
.browser-breadcrumb button { max-width: 220px; padding: 5px 7px; overflow: hidden; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
.browser-breadcrumb button:hover:not(:disabled) { background: var(--surface-hover); color: var(--heading); }
.browser-breadcrumb button:disabled { color: var(--heading); cursor: default; font-weight: 700; }
.browser-search { width: min(100%, 270px); height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input); display: flex; align-items: center; gap: 8px; }
.browser-search:focus-within { border-color: var(--green); }
.browser-search svg { width: 15px; flex: 0 0 auto; fill: none; stroke: var(--subtle); stroke-width: 1.8; }
.browser-search input { min-width: 0; height: auto; padding: 0; border: 0; background: transparent; color: var(--text); outline: 0; font-size: 11px; }
.browser-search input::placeholder { color: var(--subtle); }
.browser-view-switch { height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input); display: flex; align-items: center; gap: 2px; }
.browser-view-switch button { width: 31px; height: 30px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--subtle); display: grid; place-items: center; cursor: pointer; }
.browser-view-switch button:hover { color: var(--text); }
.browser-view-switch button.active { background: var(--raised); color: var(--green); }
.browser-view-switch svg { width: 16px; height: 16px; }
.library-summary { margin: -4px 0 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.library-summary div { min-height: 64px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(16, 23, 32, .72); display: flex; flex-direction: column; justify-content: center; }
.library-summary strong { color: var(--heading); font-size: 17px; }
.library-summary span { color: var(--subtle); font-size: 9px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.asset-card { min-width: 0; min-height: 92px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 11px; align-items: center; }
.asset-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--green-deep); color: var(--green); }
.asset-icon svg { width: 18px; }
.asset-copy { min-width: 0; display: flex; flex-direction: column; }
.asset-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.asset-copy small { color: var(--subtle); font-size: 10px; }
.asset-actions { display: flex; flex-direction: column; }
.asset-empty { padding: 38px; border: 1px dashed var(--line-strong); border-radius: var(--radius); grid-column: 1 / -1; color: var(--subtle); text-align: center; }
.browser-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.browser-card { position: relative; min-width: 0; min-height: 82px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; align-items: center; text-align: left; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.browser-card:has(.browser-context-menu[open]) { z-index: 30; }
.browser-card.folder { width: 100%; cursor: pointer; font: inherit; }
.browser-card:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-1px); }
.browser-entry-icon { width: 38px; height: 38px; border-radius: 9px; background: rgba(70, 159, 217, .1); color: #77b9e2; display: grid; place-items: center; }
.browser-card.folder .browser-entry-icon { background: var(--green-deep); color: var(--green); }
.browser-entry-icon svg { width: 19px; height: 19px; }
.browser-entry-copy { min-width: 0; display: flex; flex-direction: column; }
.browser-entry-copy strong { overflow: hidden; color: var(--heading); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.browser-entry-copy small { margin-top: 3px; overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.browser-entry-path { margin-top: 4px; overflow: hidden; color: #607080; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.browser-context-menu { position: relative; justify-self: end; }
.browser-context-menu > summary { list-style: none; }
.browser-context-menu > summary::-webkit-details-marker { display: none; }
.browser-context-menu[open] > summary { background: var(--raised); color: var(--text); }
.browser-context-panel { position: absolute; z-index: 40; top: calc(100% + 5px); right: 0; width: max-content; min-width: 186px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 10px; background: #101820; box-shadow: 0 16px 38px rgba(0, 0, 0, .42); display: flex; flex-direction: column; }
.browser-context-menu.open-up .browser-context-panel { top: auto; bottom: calc(100% + 5px); }
.browser-context-menu.align-start .browser-context-panel { right: auto; left: 0; }
.browser-context-item { min-height: 36px; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text); display: flex; align-items: center; gap: 9px; cursor: pointer; font: inherit; font-size: 11px; text-decoration: none; text-align: left; }
.browser-context-item:hover, .browser-context-item:focus-visible { outline: none; background: var(--raised); }
.browser-context-item svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; }
.browser-context-item.danger { color: #e09494; }
.browser-context-item.danger:hover, .browser-context-item.danger:focus-visible { background: rgba(184, 68, 68, .13); color: #f0aaaa; }
.file-entry-dialog { width: min(92vw, 520px); }
.browser-grid.list-view { grid-template-columns: 1fr; gap: 4px; }
.browser-grid.list-view .browser-card { min-height: 58px; padding: 8px 11px; border-radius: 8px; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; }
.browser-grid.list-view .browser-card:hover { transform: none; }
.browser-grid.list-view .browser-entry-icon { width: 34px; height: 34px; border-radius: 8px; }
.browser-grid.list-view .browser-entry-copy { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(190px, .9fr) minmax(180px, 1.3fr); align-items: center; gap: 16px; }
.browser-grid.list-view .browser-entry-copy small, .browser-grid.list-view .browser-entry-path { margin-top: 0; }
.image-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.image-tile { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); cursor: zoom-in; text-align: left; transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.image-tile:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 14px 30px rgba(0, 0, 0, .2); }
.image-tile > img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: var(--input); }
.image-tile-caption { min-width: 0; padding: 11px 12px 12px; display: flex; flex-direction: column; }
.image-tile-caption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.image-tile-caption small { margin-top: 4px; overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.gallery-warning { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid rgba(218, 157, 84, .3); border-radius: 9px; background: rgba(218, 157, 84, .06); color: #d7ac78; font-size: 11px; }
.image-viewer { width: min(94vw, 1440px); height: min(92vh, 940px); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: #080c12; color: var(--text); box-shadow: var(--shadow); }
.image-viewer::backdrop { background: rgba(0, 0, 0, .88); backdrop-filter: blur(9px); }
.image-viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.image-viewer-stage { position: relative; min-width: 0; min-height: 0; padding: 24px; background: #040609; display: grid; place-items: center; }
.image-viewer-stage > img { max-width: 100%; max-height: calc(92vh - 48px); object-fit: contain; image-rendering: auto; }
.image-step { position: absolute; z-index: 2; top: 50%; width: 42px; height: 58px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: rgba(8, 12, 18, .76); color: var(--text); cursor: pointer; font-size: 31px; transform: translateY(-50%); }
.image-step:hover:not(:disabled) { background: rgba(25, 34, 43, .92); }
.image-step:disabled { opacity: .25; cursor: default; }
.image-step.previous { left: 18px; }
.image-step.next { right: 18px; }
.image-viewer-details { min-width: 0; padding: 27px 24px; overflow: auto; border-left: 1px solid var(--line); background: var(--raised); }
.image-viewer-details h2 { max-width: 210px; overflow-wrap: anywhere; font-size: 22px; }
.image-metadata { margin: 30px 0; display: grid; gap: 0; }
.image-metadata div { padding: 12px 0; border-top: 1px solid var(--line); }
.image-metadata dt { color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.image-metadata dd { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.stack-form { margin-bottom: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stack-form label { margin-top: 0; }
.inline-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 10px; }
.inline-actions select { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.admin-users { display: grid; gap: 12px; }
.admin-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.check-row input { width: auto; height: auto; accent-color: var(--green); }
.admin-card { display: grid; gap: 16px; }
.admin-head strong { font-size: 15px; }
.admin-head small { display: block; margin-top: 2px; color: var(--subtle); }
.admin-fields { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto auto; gap: 12px; align-items: end; }
.admin-fields label { margin: 0; }
.model-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.model-check { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; }
.model-check.disabled { opacity: .5; }
.model-check input { width: auto; height: auto; accent-color: var(--green); }
.admin-section-label { color: var(--subtle); font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.admin-card-actions { padding-top: 2px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.admin-badges { display: flex; gap: 6px; }
.admin-badges span { padding: 4px 8px; border: 1px solid rgba(42, 196, 123, .24); border-radius: 999px; color: #a9dec4; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.admin-badges .status-badge { border-color: var(--line-strong); color: var(--muted); }
.admin-dialog { width: min(calc(100% - 36px), 1280px); height: min(92vh, 900px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
.admin-dialog::backdrop { background: rgba(3, 6, 9, .78); backdrop-filter: blur(7px); }
.admin-shell { height: 100%; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.admin-sidebar { padding: 27px 18px 20px; border-right: 1px solid var(--line); background: #0b1118; display: flex; flex-direction: column; }
.admin-brand { padding: 0 10px 26px; display: flex; align-items: center; gap: 12px; }
.admin-brand > div { display: flex; flex-direction: column; }
.admin-brand strong { margin-top: 2px; font-size: 15px; }
.admin-nav { display: grid; gap: 5px; }
.admin-nav button, .admin-back { min-height: 45px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; font-size: 13px; }
.admin-nav button:hover, .admin-back:hover { border-color: var(--line); background: var(--surface); color: var(--text); }
.admin-nav button.active { border-color: rgba(42, 196, 123, .22); background: rgba(42, 196, 123, .08); color: #c7efda; }
.admin-nav svg, .admin-back svg { width: 18px; height: 18px; }
.admin-back { width: 100%; margin-top: auto; }
.admin-main { min-width: 0; overflow: auto; }
.admin-main-head { min-height: 116px; padding: 27px 34px 24px; border-bottom: 1px solid var(--line); background: rgba(16, 23, 32, .6); display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.admin-main-head h2 { margin-top: 4px; font-size: 27px; }
.admin-main-head p { margin-top: 4px; color: var(--subtle); font-size: 12px; }
.admin-panel { padding: 28px 34px 40px; }
.admin-summary { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.admin-summary div { min-height: 84px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; justify-content: center; }
.admin-summary strong { color: var(--heading); font-size: 24px; }
.admin-summary span { color: var(--subtle); font-size: 11px; }
.admin-models { display: grid; gap: 9px; }
.admin-model-card { min-height: 76px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; }
.model-provider { width: 40px; height: 40px; border-radius: 10px; background: var(--green-deep); color: var(--green); display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.model-provider.provider-claude { background: rgba(161, 146, 245, .12); color: var(--purple); }
.admin-model-copy { min-width: 0; display: flex; flex-direction: column; }
.admin-model-copy strong { font-size: 14px; }
.admin-model-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--subtle); font-size: 10px; }
.model-status { padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.model-status.ready { background: rgba(42, 196, 123, .1); color: #8cdbb3; }
.model-status.offline { background: rgba(200, 132, 132, .1); color: #d9a1a1; }
.switch-control { margin: 0; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control span { width: 40px; height: 22px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--input); display: block; transition: 160ms ease; }
.switch-control span::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); display: block; transition: 160ms ease; }
.switch-control input:checked + span { border-color: rgba(42, 196, 123, .45); background: rgba(42, 196, 123, .18); }
.switch-control input:checked + span::after { background: var(--green); transform: translateX(18px); }
.check-row { display: flex; align-items: center; gap: 9px; }
.attach-dialog { width: min(calc(100% - 32px), 620px); }
.attach-dropzone { margin-top: 20px; padding: 17px; border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(20, 28, 38, .5); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; cursor: pointer; transition: border-color 160ms ease, background 160ms ease; }
.attach-dropzone:hover, .attach-dropzone:focus-visible, .attach-dropzone.drop-active { border-color: var(--green); background: rgba(42, 196, 123, .055); outline: 0; }
.attach-dropzone.uploading { opacity: .65; pointer-events: none; }
.attach-drop-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--green-deep); display: grid; place-items: center; color: var(--green); }
.attach-drop-icon svg { width: 18px; }
.attach-dropzone > div { min-width: 0; display: flex; flex-direction: column; }
.attach-dropzone strong { font-size: 13px; }
.attach-dropzone small { margin-top: 3px; color: var(--subtle); font-size: 10px; }
.attach-library-label { margin-top: 20px; display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.attach-library-label::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.attach-list { max-height: 38vh; margin: 10px 0 20px; overflow: auto; display: grid; gap: 7px; }
.attach-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 10px; }
.attach-row input { width: auto; height: auto; accent-color: var(--green); }
.attach-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { max-width: 360px; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); box-shadow: var(--shadow); color: var(--text); font-size: 13px; animation: toast-in 200ms ease both; }
.toast.error { border-color: rgba(200, 132, 132, .35); color: #e1aaaa; }
.sidebar-backdrop { display: none; }
.mobile-bottom-nav, .mobile-controls-head, .mobile-controls-dialog { display: none; }
.mobile-only { display: none; }

@keyframes message-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }
@keyframes pulse { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes running-pulse { 0%, 100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1); } }

@media (max-width: 900px) {
  .mobile-only { display: inline-grid; }
  .mobile-controls-button { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, var(--sidebar)); transform: translateX(-102%); transition: transform 220ms ease; box-shadow: var(--shadow); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 19; inset: 0; display: block; background: rgba(2, 5, 8, .6); opacity: 0; visibility: hidden; transition: opacity 220ms ease, visibility 220ms ease; }
  .app-shell.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar > .mobile-only { flex: 0 0 auto; }
  .context { margin-right: auto; }
  .response-comparison { grid-template-columns: 1fr; }
  .agent-switch button { padding: 0 8px; }
  .model-picker select { max-width: 105px; }
  .effort-picker > span { display: none; }
  .effort-picker select { width: 58px; }
  .permission-picker > span { display: none; }
  .permission-picker select, .permission-picker.provider-claude select { width: 82px; }
  .provider-pill span:last-child { display: none; }
  .provider-pill { width: 31px; padding: 0; justify-content: center; }
  .login-shell { display: block; overflow: auto; }
  .login-intro { min-height: 44vh; padding: 32px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-copy { padding: 72px 0 42px; }
  .feature-row { display: none; }
  .login-panel { min-height: 56vh; padding: 32px; }
  .admin-dialog { width: calc(100% - 20px); height: 94vh; }
  .admin-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .admin-fields { grid-template-columns: 1fr 1fr; }
  .admin-fields .check-row { min-height: 42px; }
}

@media (max-width: 680px) {
  :root { --mobile-nav-height: 62px; }
  html, body { width: 100%; max-width: 100%; min-height: 100%; min-height: 100dvh; overflow-x: hidden; overscroll-behavior: none; }
  body { font-size: 14px; }
  button, a, select, input { touch-action: manipulation; }
  .project-archive-action { opacity: 1; }
  .project-edit-action { opacity: 1; }
  .conversation-delete-action { opacity: 1; }
  .login-shell { min-height: 100dvh; }
  .login-intro { min-height: auto; padding: max(18px, env(safe-area-inset-top)) 18px 16px; }
  .login-copy { padding: 28px 0 4px; }
  .login-copy h1 { font-size: clamp(29px, 9vw, 38px); line-height: 1.06; }
  .login-copy > p:last-child { max-width: 36rem; margin-top: 14px; font-size: 13px; line-height: 1.5; }
  .login-panel { min-height: auto; padding: 18px 14px max(18px, env(safe-area-inset-bottom)); }
  .login-card { width: 100%; padding: 24px 19px; }
  .login-card-heading h2 { font-size: 27px; }
  .login-card label { margin-top: 14px; }
  .login-card .button { min-height: 48px; margin-top: 18px; }
  .app-shell { min-height: 100dvh; padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .workspace { grid-template-rows: calc(58px + env(safe-area-inset-top)) minmax(0, 1fr) auto; min-height: 0; }
  .topbar { min-height: 0; height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; gap: 7px; flex-wrap: nowrap; align-content: normal; }
  .topbar > .icon-button { min-width: 42px; min-height: 42px; }
  .context-label { display: none; }
  .context { min-width: 0; flex: 1 1 auto; margin-right: 0; }
  .context-select { width: 100%; min-height: 42px; margin-left: 0; padding: 4px 5px; }
  .context-select #active-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .context-icon { display: none; }
  #new-chat-top { display: none; }
  .scope-switch { flex: 0 0 auto; }
  .scope-switch button { width: 39px; height: 36px; padding: 0 3px; overflow: hidden; font-size: 0; }
  .scope-switch button::after { font-size: 9px; }
  #scope-chat::after { content: 'Chat'; }
  #scope-project::after { content: 'Projekt'; }
  .git-status-button { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .git-status-button span { display: none; }
  .mobile-controls-button { display: inline-grid; flex: 0 0 auto; }
  .topbar-actions { display: none; }
  .mobile-controls-dialog { width: calc(100% - 16px); max-width: 560px; max-height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom) - 18px); margin: auto auto calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 8px); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; outline: 0; overflow: hidden; background: rgba(14, 20, 28, .99); color: var(--text); box-shadow: var(--shadow); }
  .mobile-controls-dialog[open] { display: block; }
  .mobile-controls-dialog::backdrop { background: rgba(2, 5, 8, .68); backdrop-filter: blur(4px); }
  .mobile-controls-head { min-height: 52px; padding: 7px 10px 5px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
  .mobile-controls-head strong { font-size: 14px; }
  .mobile-controls-mount { max-height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom) - 72px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-controls-dialog .topbar-actions { position: static; width: 100%; max-height: none; padding: 12px 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; overflow: visible; transform: none; opacity: 1; visibility: visible; }
  .mobile-controls-dialog .cli-trace-control { grid-column: 1 / -1; width: 100%; height: 46px; border-radius: 10px; justify-content: center; }
  .agent-switch { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 11px; }
  .agent-switch button { min-height: 40px; border-radius: 8px; font-size: 11px; }
  .model-picker, .effort-picker, .permission-picker { width: 100%; max-width: none; min-height: 48px; height: auto; border-radius: 10px; }
  .model-picker { grid-column: 1 / -1; }
  .model-picker select { width: 100%; max-width: none; min-height: 42px; }
  .effort-picker, .permission-picker { display: grid; grid-template-columns: 1fr; align-content: center; gap: 1px; }
  .effort-picker > span, .permission-picker > span { display: block; }
  .effort-picker select, .permission-picker select, .permission-picker.provider-claude select { width: 100%; min-height: 26px; }
  .topbar-actions > #new-chat-top { display: none; }
  .mobile-bottom-nav { position: fixed; z-index: 22; right: 0; bottom: 0; left: 0; height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); padding: 5px 10px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(10, 16, 23, .96); backdrop-filter: blur(16px); display: grid; grid-template-columns: repeat(4, 1fr); }
  .mobile-bottom-nav button { min-width: 0; border: 0; border-radius: 9px; background: transparent; color: var(--subtle); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 9px; font-weight: 700; }
  .mobile-bottom-nav button:active { background: var(--surface-hover); color: var(--green); }
  .mobile-bottom-nav svg { width: 20px; height: 20px; }
  .sidebar { width: 100%; padding-top: env(safe-area-inset-top); padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); box-shadow: none; }
  .sidebar-head { min-height: 58px; }
  .sidebar .new-chat { min-height: 50px; }
  .nav-item, .conversations .nav-item, .tool-nav-item { min-height: 46px; }
  .sidebar-foot { padding-bottom: 10px; }
  .attach-dropzone { grid-template-columns: auto minmax(0, 1fr); }
  .attach-dropzone .button { grid-column: 1 / -1; width: 100%; }
  .chat-scroll { scroll-padding-bottom: 130px; }
  .empty-state { width: min(100% - 24px, 540px); padding: 26px 0 34px; justify-content: flex-start; }
  .empty-symbol { margin: 0 0 12px; transform: scale(.68) skew(-10deg); transform-origin: bottom; }
  .empty-state .eyebrow { display: none; }
  .empty-state h1 { margin-top: 0; font-size: 31px; }
  .empty-lead { font-size: 13px; }
  .suggestion-grid { display: none; }
  .messages { width: calc(100% - 20px); padding: 22px 0 34px; gap: 24px; }
  .message { grid-template-columns: 27px minmax(0, 1fr); gap: 8px; }
  .message-avatar { width: 27px; height: 27px; border-radius: 7px; font-size: 9px; }
  .message-body { padding-top: 1px; }
  .message-content { font-size: 14px; line-height: 1.62; }
  .message-content pre { margin-right: -2px; padding: 11px; border-radius: 8px; }
  .message-content pre code { font-size: 11px; }
  .message.queued { margin-left: 12px; padding: 10px 11px; }
  .cli-activity-list { max-height: 52vh; padding-inline: 9px; }
  .cli-activity pre { max-height: 34vh; font-size: 9px; }
  .response-comparison .message { padding: 12px; }
  .composer-wrap { width: 100%; padding: 8px 9px 9px; border-top: 1px solid rgba(32, 42, 52, .75); background: rgba(8, 12, 18, .94); }
  .attachment-chips { overflow-x: auto; flex-wrap: nowrap; }
  .attachment-chip { flex: 0 0 auto; max-width: 78vw; }
  .composer { min-height: 88px; border-radius: 13px; }
  .composer textarea { min-height: 44px; padding: 11px 12px 0; font-size: 16px; }
  .composer-foot { min-height: 42px; padding: 1px 6px 6px 9px; }
  .composer-tools .icon-button, .send-button { width: 42px; height: 42px; }
  .composer-context { max-width: 47vw; }
  .composer-context span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .composer-note { display: none; }
  .dialog { width: 100%; max-width: 100vw; max-height: calc(100dvh - 8px); margin: auto 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 20px 20px 0 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .dialog > *, .dialog form, .settings-account > div, .settings-toggle-row > span:first-child, .git-auth-head > div { min-width: 0; max-width: 100%; }
  .settings-account small, .settings-row strong, .settings-row code, .git-auth-head small, .field-note { overflow-wrap: anywhere; word-break: break-word; }
  .settings-dialog, .git-settings-dialog { contain: inline-size; }
  .dialog-head { position: sticky; z-index: 2; top: -22px; margin: -22px -18px 10px; padding: 18px 18px 12px; background: linear-gradient(var(--raised) 82%, transparent); }
  .dialog-head h2 { font-size: 23px; }
  .dialog input, .dialog select, .dialog .button { min-height: 46px; }
  .dialog-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); margin-right: -18px; margin-left: -18px; padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); background: rgba(20, 28, 37, .98); }
  .git-actions { grid-template-columns: 1fr; }
  .git-token-fields { grid-template-columns: 1fr; gap: 0; }
  .git-auth-actions { display: grid; grid-template-columns: 1fr; }
  .hub-dialog { width: 100%; height: 100dvh; max-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border: 0; border-radius: 0; overflow-x: hidden; }
  .image-viewer { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .image-viewer[open] { grid-template-columns: 1fr; grid-template-rows: minmax(48vh, 1fr) auto; }
  .image-viewer-stage { padding: 14px; }
  .image-viewer-stage > img { max-height: 62vh; }
  .image-viewer-details { max-height: 38vh; padding: 18px; border-top: 1px solid var(--line); border-left: 0; }
  .image-metadata { margin: 18px 0; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .hub-head { position: sticky; z-index: 3; top: 0; margin: 0; padding: 16px max(15px, env(safe-area-inset-right)) 12px max(15px, env(safe-area-inset-left)); background: var(--raised); }
  .hub-panel { padding-right: max(13px, env(safe-area-inset-right)); padding-left: max(13px, env(safe-area-inset-left)); }
  .hub-tabs { padding-right: max(18px, env(safe-area-inset-right)); padding-left: max(18px, env(safe-area-inset-left)); gap: 14px; overflow-x: auto; }
  .panel-toolbar { align-items: stretch; flex-direction: column; }
  .library-actions { align-items: stretch; flex-direction: column; }
  .library-actions select, .library-filter { width: 100%; }
  .browser-toolbar { align-items: stretch; flex-direction: column; }
  .browser-toolbar-actions { align-items: stretch; display: grid; grid-template-columns: 1fr auto; }
  .browser-search { width: 100%; }
  .browser-view-switch { flex: 0 0 auto; }
  .browser-grid { grid-template-columns: 1fr; }
  .browser-card, .browser-grid.list-view .browser-card { min-height: 62px; grid-template-columns: 38px minmax(0, 1fr) auto; }
  .browser-grid.list-view .browser-entry-copy { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .browser-grid.list-view .browser-entry-path { display: none; }
  .library-summary { grid-template-columns: 1fr 1fr; }
  .admin-dialog { width: 100%; height: 100dvh; max-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border: 0; border-radius: 0; overflow-x: hidden; }
  .admin-shell { display: block; overflow: auto; }
  .admin-sidebar { padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; }
  .admin-brand { padding: 3px 4px 13px; }
  .admin-nav { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .admin-back { display: none; }
  .admin-main { overflow: visible; }
  .admin-main-head { min-height: 96px; padding: 20px 18px; }
  .admin-panel { padding: 20px 18px 32px; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-model-card { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .admin-model-card .model-status { grid-column: 2; justify-self: start; }
  .admin-model-card .switch-control { grid-column: 3; grid-row: 1 / 3; }
  .admin-fields { grid-template-columns: 1fr; }
  .admin-card-actions { flex-direction: column; }
  .admin-card-actions .button { width: 100%; }
  .archived-project { grid-template-columns: 39px minmax(0, 1fr); }
  .archived-project .button { grid-column: 1 / -1; width: 100%; }
  .toast-region { right: 10px; bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 10px); left: 10px; }
  .toast { width: 100%; max-width: none; }
}

@media (max-width: 390px) {
  .topbar { gap: 4px; padding-right: 6px; padding-left: 6px; }
  .topbar > .icon-button, .mobile-controls-button { min-width: 38px; width: 38px; }
  .scope-switch button { width: 35px; }
  .git-status-button { width: 36px; }
  .context-select { font-size: 12px; }
  .empty-state h1 { font-size: 28px; }
  .message { grid-template-columns: 1fr; }
  .message-avatar { display: none; }
  .response-comparison .message { display: block; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
}

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