/* Light grey chrome and an inset white sheet follow Veyns UI's hierarchy. */
:root {
  --chrome: #e7e7ec;
  --chrome-hover: #d4d4dc;
  --chrome-line: #c9c9d1;
  --sheet: #fff;
  --sunk: #f7f7f9;
  --ink: #1e1e24;
  --ink-secondary: #5a5a64;
  --ink-muted: #6e6e78;
  --line: #dadae0;
  --line-soft: #ebebef;
  --primary: #0f62fe;
  --accent: #0f62fe;
  --focus: #4589ff;
  --success: #237a4b;
  --warning: #7a4f00;
  --danger: #95241c;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --content-gutter: max(28px, calc((100% - 940px) / 2));
  font-family: var(--font);
  color: var(--ink);
  background: var(--chrome);
  font-synthesis: none;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, select, textarea, input { font: inherit; color: inherit; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #b9b9c2;
  border-radius: 6px;
  background: var(--sheet);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}
button:hover:not(:disabled) { background: #f1f1f4; border-color: #a5a5b0; }
button:active:not(:disabled) { box-shadow: inset 0 1px 2px #14141e12; }
button:disabled { color: #8c8c94; border-color: var(--line); background: #f1f1f4; cursor: not-allowed; }
.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.primary:hover:not(:disabled) { background: #0043ce; border-color: #0043ce; }
.primary:disabled { background: #e6e6eb; }
.icon-button { width: 32px; min-height: 32px; padding: 6px; border-color: transparent; background: transparent; flex: none; }
.icon-button:hover:not(:disabled) { background: #d4d4dc80; border-color: transparent; }
.icon-button:disabled { background: transparent; border-color: transparent; }
.quiet-danger { border-color: var(--line); color: var(--ink-secondary); background: transparent; }
.quiet-danger:hover:not(:disabled) { color: var(--danger); border-color: #e8c5c1; background: #fbebe9; }
.icon { display: inline-block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: #dfe0f6; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 100; padding: 8px 14px; border-radius: 6px; background: white; color: var(--accent); }
.skip-link:focus { top: 8px; }

/* Workspace shell */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: grid; grid-template-columns: 248px minmax(0, 1fr) auto; align-items: center; min-width: 0; padding-right: 22px; }
.topbar-brand { display: flex; align-items: center; gap: 5px; padding-left: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.35px; white-space: nowrap; }
.brand strong { font-weight: 450; color: var(--ink-secondary); }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; }
.atl-brand-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand-image { display: block; flex: none; width: 16px; height: 16px; object-fit: contain; }
.topbar-context { display: flex; align-items: center; gap: 12px; color: var(--ink-secondary); font-size: 12px; }
.topbar-context strong { color: #46464e; font-weight: 550; }
.breadcrumb-divider { color: #a4a4ad; }
.local-label { display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px; border: 1px solid #b5b5be; border-radius: 4px; font-size: 10px; font-weight: 600; color: #575760; }
.local-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#toggle-sidebar, #sidebar-backdrop { display: none; }
aside { display: flex; flex-direction: column; gap: 14px; min-height: 0; min-width: 0; padding: 12px 14px 16px; overflow: hidden; }
aside > :not(nav) { flex-shrink: 0; }
#new-session { justify-content: flex-start; width: 100%; min-height: 40px; gap: 9px; border-radius: 8px; font-size: 13px; box-shadow: 0 2px 4px #2424310d; }
.session-settings { display: flex; flex-direction: column; gap: 14px; padding: 0 3px 12px; border-bottom: 1px solid var(--chrome-line); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #46464e; }
.field label .icon { width: 13px; height: 13px; }
.field-note { font-weight: 400; color: #62626e; font-size: 10px; margin-left: auto; }
.select-wrap { position: relative; min-width: 0; }
.field select { appearance: none; width: 100%; min-width: 0; height: 36px; padding: 7px 29px 7px 10px; border: 1px solid #c2c2cc; border-radius: 6px; background: #f4f4f7; color: #2d2d34; font-size: 12px; text-overflow: ellipsis; cursor: pointer; }
.field select:hover:not(:disabled) { border-color: #a4a4ad; background: white; }
.field select:disabled { opacity: .65; cursor: not-allowed; }
.select-chevron { position: absolute; right: 9px; top: 10px; pointer-events: none; color: var(--ink-secondary); }
.field-help { margin: 0; color: #62626e; font-size: 10px; line-height: 1.6; }
.sessions-label { display: flex; align-items: center; justify-content: space-between; margin: -6px 2px -10px 8px; color: var(--ink-secondary); font-size: 10px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; }
nav { min-height: 44px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #bfc0cd transparent; }
.session { position: relative; display: block; text-align: left; width: 100%; padding: 11px 12px; margin-bottom: 5px; border-color: transparent; border-radius: 8px; background: transparent; }
.session:hover:not(:disabled) { background: #d4d4dc80; border-color: transparent; }
.session.selected { border-color: #cdcadf; background: #fcfbff; box-shadow: 0 1px 3px #29204406; }
.session.selected::before { content: ""; position: absolute; top: 11px; bottom: 11px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.session.selected:hover:not(:disabled) { background: white; border-color: #b9b3d6; }
.session strong { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session small { display: block; margin-top: 5px; color: #62626e; font-size: 10px; line-height: 1.5; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-title, .session-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.session-status-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: #8c8c94; }
.session[data-status="busy"] .session-status-dot { background: var(--accent); }
.session[data-status="requires_action"] .session-status-dot { background: #946000; }
.session[data-status="failed"] .session-status-dot { background: var(--danger); }
.sidebar-bottom { display: flex; align-items: center; gap: 7px; color: #73737e; padding: 0 5px; font-size: 9px; }
.sidebar-bottom .icon { width: 14px; height: 14px; }

/* Team sign-in and administration use the same light workspace chrome. */
.auth-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; padding: 32px 18px; background: radial-gradient(ellipse at 50% 0%, #f5f5f8, var(--chrome) 72%); }
.auth-card { width: min(100%, 420px); padding: 34px; border: 1px solid #d2d2da; border-radius: 18px; background: var(--sheet); box-shadow: 0 16px 48px #2929360a; }
.auth-brand { margin-bottom: 30px; font-size: 21px; }
.auth-brand .brand-mark { width: 40px; height: 40px; }
.auth-card .eyebrow { margin-bottom: 8px; font-size: 10px; }
.auth-card h1 { margin: 0 0 10px; font-size: 25px; line-height: 1.25; letter-spacing: -.7px; font-weight: 650; }
.auth-description { margin: 0 0 24px; color: var(--ink-secondary); font-size: 13px; line-height: 1.7; }
.auth-message { margin: 0 0 18px; padding: 10px 12px; border: 1px solid #d7e0ef; border-radius: 7px; background: #f3f6fc; color: #344a67; font-size: 12px; overflow-wrap: anywhere; }
.auth-message[data-error="true"] { border-color: #efcfcb; background: #fcf1ef; color: var(--danger); }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form label, .team-dialog .field label { font-size: 12px; }
.auth-form input, .team-dialog input { width: 100%; min-width: 0; height: 42px; padding: 9px 11px; border: 1px solid #c4c4cd; border-radius: 7px; background: #fdfdfe; font-size: 14px; }
.auth-form input:disabled { background: var(--sunk); opacity: .7; }
.auth-form input:focus, .team-dialog input:focus { outline: 2px solid #0f62fe22; outline-offset: 1px; border-color: var(--accent); }
.auth-form > button { min-height: 42px; font-size: 13px; }
.auth-form .field-help { font-size: 11px; }
.auth-form > .field-help { text-align: center; }
.auth-footer { margin: 0; color: var(--ink-muted); font-size: 11px; text-align: center; }
#otp-code { font: 22px/1.4 var(--mono); letter-spacing: .32em; text-align: center; }
.otp-enrollment { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); text-align: center; }
.otp-enrollment p { margin: 0 0 10px; font-size: 12px; color: var(--ink-secondary); }
.otp-enrollment img { display: block; max-width: 100%; height: auto; margin: 0 auto 12px; border-radius: 6px; }
.otp-enrollment summary { color: var(--accent); font-size: 11px; cursor: pointer; }
.otp-enrollment code { display: block; margin-top: 10px; padding: 10px; background: white; border-radius: 6px; overflow-wrap: anywhere; font-size: 12px; user-select: all; }
.team-account { padding: 13px 4px 0; border-top: 1px solid var(--chrome-line); }
.team-account-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team-account-identity > div { min-width: 0; }
.team-account-identity strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 600; }
.team-account-identity span:not(.team-avatar) { color: var(--ink-secondary); font-size: 10px; }
.team-avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #bdc9dc; border-radius: 10px; background: #f1f5fc; color: #315688; font-size: 13px; font-weight: 650; }
.team-account-actions { display: flex; gap: 8px; margin-top: 10px; }
.team-account-actions button { flex: 1; min-height: 29px; padding: 4px 6px; font-size: 10px; background: #f4f4f7; }
.team-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 28px; border: 1px solid #c6c6d0; border-radius: 15px; background: #fdfdfe; color: var(--ink); box-shadow: 0 20px 60px #14141e24; overscroll-behavior: contain; }
.team-dialog::backdrop { background: #17172566; backdrop-filter: blur(2px); }
.team-dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.team-dialog-heading .eyebrow { margin: 0 0 5px; font-size: 9px; }
.team-dialog h2 { margin: 0; font-size: 23px; font-weight: 650; letter-spacing: -.5px; }
.team-dialog h3 { margin: 0; font-size: 13px; font-weight: 650; }
.team-dialog-description { margin: 12px 0 22px; color: var(--ink-secondary); font-size: 12px; line-height: 1.7; }
.create-user-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.create-user-form h3, .create-user-form > .field-help { grid-column: 1 / -1; }
.create-user-form > button { align-self: end; height: 36px; }
.team-dialog input { height: 36px; font-size: 12px; }
.team-dialog .field select { background: white; }
.team-list-heading { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; }
.team-list-heading button { min-height: 28px; font-size: 10px; }
.team-user-list { display: flex; flex-direction: column; gap: 9px; }
.team-user { padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.team-user-info strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.team-user-info span { display: block; color: var(--ink-secondary); font-size: 10px; margin-top: 4px; }
.team-user-info span[data-disabled="true"] { color: var(--danger); }
.team-user-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.team-user-actions button { min-height: 27px; padding: 4px 8px; font-size: 10px; }
.team-user-action { margin-top: 18px; padding: 18px; border: 1px solid #b9cbea; border-radius: 10px; background: #f3f6fc; }
.team-user-action p { font-size: 12px; color: var(--ink-secondary); }
.team-action-buttons { display: flex; gap: 8px; margin-top: 15px; }
@media (max-width: 560px) {
  .auth-card { padding: 26px 24px; }
  .team-dialog { padding: 20px; }
  .create-user-form { grid-template-columns: minmax(0, 1fr); padding: 15px; }
}
main { display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 0 10px 10px 0; border: 1px solid #c8c8d0; border-radius: 12px; background: white; overflow: hidden; box-shadow: 0 1px 3px #14141e03; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 80px; padding: 16px 25px; border-bottom: 1px solid var(--line-soft); }
.workspace-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.workspace-identity > div { min-width: 0; }
.workspace-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: #575760; background: var(--sunk); }
.workspace-header strong { display: block; font-size: 13px; line-height: 1.4; font-weight: 600; }
.workspace-header p { margin: 5px 0 0; font: 10px/1.5 var(--mono); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.header-actions button { font-size: 11px; min-height: 30px; padding: 5px 9px; }
.header-actions .icon { width: 12px; height: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--ink-muted); white-space: nowrap; }
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8c8c94; }
.status-chip[data-state="connected"]::before { background: var(--success); }
.status-chip[data-state="disconnected"] { color: var(--danger); }
.status-chip[data-state="disconnected"]::before { background: var(--danger); }
#notice { flex: none; color: var(--warning); background: #fbf2dc; border-bottom: 1px solid #ecdcae; padding: 11px 25px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }

/* Conversation and tool output */
#messages { flex: 1; min-height: 0; overflow-y: auto; padding: 30px var(--content-gutter) 20px; background: #fdfdfe; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cfcfd6 transparent; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 220px; padding: 20px 0 30px; text-align: center; color: var(--ink-muted); }
.empty-mark { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 24px; }
.empty .eyebrow { margin: 0 0 12px; color: var(--ink-muted); font-size: 9px; font-weight: 600; letter-spacing: 1.3px; }
.empty h1 { margin: 0 0 12px; color: #2d2d34; font-size: clamp(22px, 2.5vw, 28px); line-height: 1.3; font-weight: 550; letter-spacing: -.75px; }
.empty p { margin: 0; max-width: 380px; font-size: 12px; line-height: 1.85; }
.empty-capabilities { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 27px; color: var(--ink-muted); font-size: 10px; }
.empty-capabilities span { display: flex; align-items: center; gap: 6px; }
.empty-capabilities .icon { width: 13px; height: 13px; }
.continuation { color: var(--ink-muted); font-size: 10px; line-height: 1.75; padding: 0 12px 20px; margin: 0 0 26px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.message { margin: 0 0 25px; min-width: 0; }
.message-label { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 11px; font-weight: 650; color: #605592; }
.message.assistant .message-label::before { content: ""; display: block; width: 24px; height: 24px; background: url('/assets/favicon-192.png') center / contain no-repeat; }
.message.assistant > .message-body { padding: 18px 20px; border: 1px solid #e6e4ee; border-radius: 4px 12px 12px; background: white; box-shadow: 0 2px 5px #25203803; }
.message pre, .message-body { margin: 0; color: #32323a; overflow-wrap: anywhere; font: 14px/1.8 var(--font); }
.message pre { white-space: pre-wrap; }
.message.user { margin-left: 44px; }
.message.user .message-label { justify-content: flex-end; color: #69607f; }
.message.user pre { padding: 14px 18px; border: 1px solid #dedbea; border-radius: 12px 4px 12px 12px; background: #f2f0f8; }
.message.tool { margin-top: -8px; margin-bottom: 16px; }
.tool-details { min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid #dedee7; border-radius: 9px; background: #fafafd; }
.tool-details > summary { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px 13px; color: #515161; font-size: 11px; cursor: pointer; list-style: none; }
.tool-details > summary::-webkit-details-marker { display: none; }
.tool-details > summary::after { content: ""; width: 6px; height: 6px; margin-left: 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); flex: none; opacity: .6; }
.tool-details[open] > summary::after { transform: rotate(225deg); }
.tool-details > summary:hover { background: #efedf7; }
.tool-details[open] > summary { border-bottom: 1px solid #e6e4ee; }
.tool-summary-icon { display: grid; place-items: center; flex: none; width: 23px; height: 23px; border-radius: 6px; background: #ece8fa; color: #6550a7; font: 600 12px var(--mono); }
.tool-name { flex: none; font-weight: 650; }
.tool-description { flex: 1; min-width: 0; color: #707080; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-status { flex: none; padding: 2px 6px; border-radius: 5px; color: #26744e; background: #eaf4ef; font-size: 9px; font-weight: 600; }
.tool-status[data-status="running"] { color: #6250a4; background: #eeebf9; }
.tool-status[data-status="error"] { color: #a23b35; background: #faeae8; }
.tool-status[data-status="interrupted"] { color: #8a671d; background: #f6efdd; }
.tool-body { padding: 10px; }
.tool-input-fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px; margin: 2px 3px 10px; font: 11px/1.7 var(--mono); }
.tool-input-fields dt { color: #747180; font: 10px/1.85 var(--font); }
.tool-input-fields dd { margin: 0; color: #60518f; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.tool-waiting { margin: 8px 4px; color: #777386; font-size: 11px; }
.terminal-tool { border-color: #282d36; background: #070a0e; box-shadow: 0 5px 16px #11182716; }
.terminal-tool > summary { min-height: 43px; padding: 10px 14px; color: #e6eaf0; background: #232731; }
.terminal-tool > summary:hover { background: #2b303b; }
.terminal-tool[open] > summary { border-color: #333946; }
.terminal-tool .tool-name { font: 600 11px/1.5 var(--mono); }
.terminal-tool .tool-description { color: #b2bac7; }
.terminal-tool .tool-status { color: #8bdbb0; background: #254037; }
.terminal-tool .tool-status[data-status="running"] { color: #d0bcff; background: #3b3154; }
.terminal-tool .tool-status[data-status="error"] { color: #ffaaa4; background: #522e35; }
.terminal-tool .tool-status[data-status="interrupted"] { color: #e8cb8a; background: #49412b; }
.terminal-tool .tool-waiting { color: #a8a8bc; }
.terminal-window-controls { display: inline-flex; align-items: center; flex: none; gap: 6px; margin-right: 4px; }
.terminal-window-dot { display: block; width: 9px; height: 9px; border-radius: 50%; }
.terminal-window-dot.red { background: #ff5f57; }
.terminal-window-dot.yellow { background: #febc2e; }
.terminal-window-dot.green { background: #28c840; }
.agent-tool .tool-summary-icon { color: #0f62fe; background: #e5efff; }
.agent-progress { margin: 1px 3px 12px; color: #5b677b; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.agent-activity, .agent-instructions { min-width: 0; margin: 10px 0 0; border: 1px solid #dfe4ef; border-radius: 7px; background: #f5f7fb; }
.agent-activity > summary, .agent-instructions > summary { padding: 9px 11px; color: #4d607c; font-size: 11px; font-weight: 550; cursor: pointer; }
.agent-activity[open] > summary, .agent-instructions[open] > summary { border-bottom: 1px solid #e0e5ee; }
.agent-entries { min-width: 0; padding: 10px; }
.agent-entry + .agent-entry { margin-top: 10px; }
.agent-entry .agent-instructions { margin-top: 0; }
.agent-instructions pre { max-height: 220px; margin: 0; padding: 11px 13px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #576277; font: 11px/1.75 var(--mono); }
.agent-entry-label { margin: 2px 0 6px; color: #476b9d; font-size: 10px; font-weight: 600; }
.agent-message, .agent-result { min-width: 0; padding: 12px 14px; border: 1px solid #e2e7ee; border-radius: 7px; background: #fff; font-size: 12px; }
.agent-streaming .agent-entry-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #4589ff; }
.message.system pre { padding: 9px 12px; border-left: 2px solid #c2c3df; color: #5a5a64; background: #f8f8fa; font-size: 11px; }
.message.error > pre, .message.error > .message-body { color: var(--danger); border-color: #e8c5c1; background: #fbebe9; }
.message.error .message-label { color: var(--danger); }
.message.tool.error .tool-details { border-color: #c18485; }
.message-body > :first-child { margin-top: 0; }
.message-body > :last-child { margin-bottom: 0; }
.message-body p { margin: 0 0 13px; }
.message-body h1, .message-body h2, .message-body h3, .message-body h4, .message-body h5, .message-body h6 { margin: 22px 0 10px; color: #494066; font-weight: 650; line-height: 1.4; letter-spacing: -.2px; }
.message-body h1 { font-size: 21px; }
.message-body h2 { font-size: 18px; }
.message-body h3 { font-size: 15px; }
.message-body h4, .message-body h5, .message-body h6 { font-size: 13px; }
.message-body ul, .message-body ol { margin: 10px 0 15px; padding-left: 24px; }
.message-body li { padding-left: 3px; margin-bottom: 5px; }
.message-body li::marker { color: #8b7aad; }
.message-body li > p { margin-bottom: 6px; }
.message-body li:has(> input[type="checkbox"]) { list-style: none; margin-left: -20px; }
.message-body li > input[type="checkbox"] { width: 13px; height: 13px; margin: 0 6px 0 0; vertical-align: -2px; accent-color: var(--primary); }
.message-body a { color: var(--accent); text-decoration-color: #4549a850; text-underline-offset: 3px; }
.message-body a:hover { color: #373a8a; text-decoration-color: currentColor; }
.message-body code { border: 1px solid #e7e0f1; border-radius: 4px; padding: 2px 5px; background: #f5f0fa; color: #754d9e; font: 12px/1.65 var(--mono); }
.message-body pre { margin: 14px 0; padding: 14px 16px; border: 1px solid #dedee6; border-radius: 7px; background: #f7f7f9; overflow-x: auto; font: 11px/1.75 var(--mono); }
.message-body pre code { padding: 0; border: 0; background: transparent; white-space: pre; }
.code-block { min-width: 0; max-width: 100%; margin: 14px 0; border: 1px solid #2b2d3a; border-radius: 8px; background: #15161d; color: #e3e2ed; overflow: hidden; }
.code-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 37px; padding: 5px 11px 5px 14px; border-bottom: 1px solid #30313f; background: #20212b; }
.code-language { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7b6c8; font: 10px/1.4 var(--font); font-weight: 550; letter-spacing: .2px; }
.code-copy { min-height: 25px; padding: 3px 7px; border: 1px solid #414251; border-radius: 5px; background: transparent; color: #c7c6d9; font-size: 10px; }
.code-copy:hover:not(:disabled) { background: #343544; color: #fff; border-color: #67667c; }
.code-copy:focus-visible { outline-color: #bb9bf5; }
.code-copy:disabled { background: #292a35; color: #9492aa; border-color: #414251; }
.code-truncated { margin: 0; padding: 8px 14px; border-top: 1px solid #30313f; color: #aaa8bd; font-size: 10px; }
.code-block pre, .message-body .code-block pre { max-width: 100%; margin: 0; padding: 15px 16px; border: 0; border-radius: 0; background: #15161d; color: #e3e2ed; overflow: auto; white-space: pre; overflow-wrap: normal; font: 12px/1.85 var(--mono); tab-size: 4; scrollbar-width: thin; scrollbar-color: #535464 transparent; }
.code-block pre:focus-visible { outline-offset: -3px; outline-color: #78a9ff; }
.code-block pre code, .message-body .code-block pre code { padding: 0; border: 0; background: transparent; color: inherit; white-space: pre; font: inherit; }
.code-block ::selection { background: #5c4e8a; color: #fff; }
.tool-body .code-block { margin: 0; }
.tool-command + .tool-output { margin-top: 9px; }
.tool-body .code-block pre { max-height: 320px; }
.terminal-tool > .tool-body { padding: 0; }
.terminal-tool .code-block { border: 0; border-radius: 0; background: #070a0e; }
.terminal-tool .code-block pre, .terminal-code pre, .message-body .terminal-code pre { background: #070a0e; }
.terminal-code > .code-header { background: #232731; border-color: #333946; }
.terminal-tool .code-header { min-height: 30px; padding: 8px 14px 0 16px; border: 0; background: #070a0e; }
.terminal-tool .code-language { color: #838f9f; font-size: 9px; letter-spacing: .8px; text-transform: uppercase; }
.terminal-tool .code-copy { min-height: 23px; padding: 2px 6px; border-color: #2b3340; color: #a5afbe; }
.terminal-tool .tool-command + .tool-output { margin-top: 0; border-top: 1px solid #202630; }
.terminal-tool .tool-waiting { padding: 2px 13px 12px; }
.terminal-code.output-code pre, .message-body .terminal-code.output-code pre { color: #ead774; }
.terminal-code.shell-code pre, .message-body .terminal-code.shell-code pre { color: #a3ec91; }
.code-block pre.terminal-command-line { display: flex; gap: 12px; align-items: flex-start; }
.terminal-command-line > code { flex: 1 0 auto; }
.terminal-prompt { flex: none; color: #55aaff; font-weight: 700; user-select: none; }
.terminal-code .hljs-built_in, .terminal-code .hljs-keyword { color: #78e68a; font-weight: 600; }
.terminal-code .hljs-string { color: #c7ed96; }
.terminal-code .hljs-variable { color: #6ed9ee; }
.terminal-code .hljs-comment { color: #8d98a8; }
.hljs-keyword, .hljs-selector-tag, .hljs-type { color: #c7a2ff; }
.hljs-string, .hljs-addition { color: #9bdda9; }
.hljs-number, .hljs-literal { color: #efb884; }
.hljs-comment, .hljs-quote { color: #9093a9; font-style: italic; }
.hljs-title, .hljs-section, .hljs-name { color: #91c7ff; }
.hljs-built_in, .hljs-attr, .hljs-attribute { color: #e7d58b; }
.hljs-variable, .hljs-template-variable, .hljs-selector-class, .hljs-selector-id { color: #f0b1cf; }
.hljs-tag, .hljs-meta { color: #8fd5da; }
.hljs-deletion { color: #ff9b9d; }
.ansi-red { color: #ff8585; } .ansi-green { color: #83e89a; } .ansi-yellow { color: #f3dc72; }
.ansi-blue { color: #69b2ff; } .ansi-magenta { color: #c4a0ff; } .ansi-cyan { color: #74dbe5; }
.ansi-muted { color: #9093a9; } .ansi-white { color: #eceaf4; } .ansi-bold { font-weight: 700; }
.message-body blockquote { margin: 14px 0; padding: 5px 0 5px 15px; border-left: 3px solid #c2c3df; color: #6e6e78; }
.message-body blockquote p:last-child { margin-bottom: 0; }
.message-body hr { height: 1px; margin: 20px 0; border: 0; background: var(--line); }
.message-body .table-scroll { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 7px; }
.message-body table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; line-height: 1.65; }
.message-body th, .message-body td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.message-body th { background: #f7f7f9; font-size: 11px; font-weight: 600; }
.message-body tr:last-child td { border-bottom: 0; }
.message-truncated { margin-top: 12px; padding: 8px 11px; border-radius: 5px; color: var(--ink-muted); background: #f1f1f4; font-size: 11px; }

/* Approval requests and progress */
#approvals { flex: none; max-height: 34vh; padding: 0 var(--content-gutter); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.approval { padding: 14px 16px; margin-bottom: 12px; border: 1px solid #d6d5e3; border-radius: 8px; background: #f8f8fc; box-shadow: 0 2px 4px #14141e03; font-size: 12px; }
.approval > strong { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.approval > strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #eeeffb; }
.approval pre { max-height: 145px; margin: 12px 0; padding: 10px 12px; border: 1px solid #e5e5ee; border-radius: 5px; background: white; color: #575760; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; font: 11px/1.65 var(--mono); }
.approval > div { display: flex; justify-content: flex-end; gap: 8px; }
.approval button { min-height: 32px; }
.approval details { margin: 10px 0; }
.approval summary { color: var(--ink-secondary); font-size: 11px; cursor: pointer; }
#retry-status { flex: none; margin: 0 var(--content-gutter) 12px; padding: 10px 13px; border: 1px solid #e8dbb9; border-radius: 7px; background: #fcf7eb; color: var(--warning); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
#retry-status::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 1.5px solid #bda36b; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Composer, attachment chips and keyboard hint */
.compose-area { flex: none; padding: 10px var(--content-gutter) 0; background: #fdfdfe; }
#composer { padding: 14px 15px 12px; border: 1px solid #cfccd9; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #30244008; transition: border-color 150ms, box-shadow 150ms; }
#composer:focus-within { border-color: #9395c3; box-shadow: 0 0 0 3px #eeeffb; }
#composer.drag-over, #composer[data-dragging="true"] { border-color: var(--focus); background: #f7f7fd; box-shadow: 0 0 0 3px #dfe0f6; }
textarea { display: block; width: 100%; min-height: 72px; max-height: 23vh; resize: vertical; padding: 0 2px 7px; border: 0; outline: none; background: transparent; font-size: 13px; line-height: 1.75; }
textarea:focus-visible { outline: none; }
textarea::placeholder { color: var(--ink-muted); opacity: 1; }
textarea:disabled { cursor: not-allowed; }
.composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 5px; }
.composer-context, .composer-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
.composer-context { gap: 9px; }
.composer-actions { flex: none; }
.permission-control { position: relative; min-width: 0; color: #746397; }
.permission-icon { position: absolute; z-index: 1; left: 9px; top: 9px; width: 14px; height: 14px; pointer-events: none; }
#permission-mode { display: block; appearance: none; width: 205px; max-width: 100%; height: 32px; padding: 5px 27px 5px 30px; border: 1px solid #e2ddeb; border-radius: 7px; background: #f7f4fb; color: #62527f; font-size: 11px; text-overflow: ellipsis; cursor: pointer; }
#permission-mode:hover:not(:disabled) { background: #efebf7; border-color: #bfb4d3; }
#permission-mode:disabled { color: #96909f; border-color: #e8e5ed; background: #f6f5f8; cursor: not-allowed; }
.permission-control .select-chevron { top: 9px; right: 7px; width: 14px; height: 14px; color: #827291; }
#attach-files { width: 29px; min-height: 29px; padding: 5px; color: #6e6e78; }
#attach-files:hover:not(:disabled) { background: #f1f1f4; color: var(--ink); }
#attach-files:disabled { color: #b5b5be; }
#session-status { font-size: 10px; line-height: 1.5; color: var(--ink-muted); overflow-wrap: anywhere; }
#session-status[data-status="busy"], #session-status[data-status="starting"] { color: var(--accent); }
#session-status[data-status="requires_action"] { color: var(--warning); }
#session-status[data-status="failed"] { color: var(--danger); }
#send { min-width: 76px; min-height: 33px; border-radius: 7px; }
#send .icon { width: 14px; height: 14px; }
#interrupt { min-height: 32px; font-size: 11px; }
#interrupt .icon { width: 13px; height: 13px; }
#attachment-list { display: flex; flex-wrap: wrap; gap: 6px; }
#attachment-list:empty { display: none; }
#attachment-list:not(:empty) { margin-bottom: 12px; }
.attachment, .attachment-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 6px 8px 6px 10px; border: 1px solid #dcdce2; border-radius: 6px; background: #f7f7f9; color: #46464e; font-size: 11px; }
.attachment > span, .attachment-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment small, .attachment-chip small { color: var(--ink-muted); font-size: 10px; }
.attachment button, .attachment-chip button { flex: none; width: 22px; min-height: 22px; padding: 0; border: 0; background: transparent; color: #6e6e78; font-size: 15px; }
.attachment button:hover, .attachment-chip button:hover { color: var(--danger); background: #fbebe9; }
.attachment .icon, .attachment-chip .icon { width: 14px; height: 14px; }
#upload-status { margin: 2px 2px 8px; color: var(--ink-secondary); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 42px; padding: 9px 2px 12px; color: var(--ink-muted); font-size: 9px; line-height: 1.5; }
.keyboard-hint { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
kbd { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; border: 1px solid #e1e1e7; border-radius: 3px; background: #f8f8fa; color: var(--ink-muted); font: 9px var(--font); }

@media (min-width: 1600px) { .app { grid-template-columns: 264px minmax(0, 1fr); } .topbar { grid-template-columns: 264px minmax(0, 1fr) auto; } aside { padding-inline: 18px; } }
@media (max-width: 1050px) {
  :root { --content-gutter: 24px; }
  .app { grid-template-columns: 222px minmax(0, 1fr); }
  .topbar { grid-template-columns: 222px minmax(0, 1fr) auto; }
  aside { padding-inline: 10px; }
  .workspace-header { gap: 12px; padding: 15px 20px; }
  .workspace-icon { display: none; }
  .header-actions { gap: 7px; }
  .keyboard-hint { display: none; }
}
@media (max-width: 720px) {
  :root { --content-gutter: 20px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); }
  .topbar { grid-template-columns: auto 1fr auto; padding-right: 15px; }
  .topbar-brand { padding-left: 9px; gap: 8px; }
  #toggle-sidebar { display: inline-flex; }
  .topbar-context { justify-self: end; padding-right: 18px; font-size: 11px; }
  .topbar-context > span { display: none; }
  main { grid-column: 1; grid-row: 2; margin: 0 7px 7px; border-radius: 10px; }
  aside { position: fixed; z-index: 30; top: 52px; bottom: 0; left: 0; width: min(300px, calc(100vw - 45px)); padding: 20px 16px; border-right: 1px solid #b9b9c2; background: var(--chrome); box-shadow: 10px 0 30px #14141e16; visibility: hidden; transform: translateX(-105%); transition: transform 180ms ease, visibility 180ms; }
  .sidebar-open aside { transform: translateX(0); visibility: visible; }
  #sidebar-backdrop { position: fixed; z-index: 25; inset: 52px 0 0; width: 100%; border: 0; border-radius: 0; background: #14141e55; }
  .sidebar-open #sidebar-backdrop:not([hidden]) { display: block; }
  .workspace-header { min-height: 74px; padding: 14px 17px; }
  .workspace-header strong { font-size: 12px; }
  .workspace-header p { max-width: 35vw; font-size: 9px; }
  .header-actions { gap: 9px; }
  .status-chip { font-size: 9px; }
  .header-actions button { min-height: 32px; }
  #messages { padding-top: 24px; }
  .message { margin-bottom: 25px; }
  .message pre, .message-body { font-size: 13px; }
  .message.user { margin-left: 12px; }
  .message.assistant > .message-body { padding: 14px 15px; }
  .tool-details > summary { gap: 6px; padding: 9px 10px; }
  .tool-description { font-size: 10px; }
  .tool-summary-icon { width: 20px; height: 20px; }
  .tool-body { padding: 7px; }
  .code-block pre, .message-body .code-block pre { padding: 12px; font-size: 11px; }
  #notice { padding: 10px 17px; }
  .empty h1 { font-size: 24px; }
  .empty-mark { margin-bottom: 20px; }
  .empty-capabilities { gap: 15px; }
  #approvals { max-height: 32vh; }
  #composer { padding: 11px 12px 9px; }
  textarea { min-height: 70px; font-size: 16px; line-height: 1.6; }
  #prompt::placeholder { font-size: 13px; }
  .composer-bottom { gap: 8px; flex-wrap: wrap; }
  .composer-context { gap: 7px; flex: none; }
  .composer-actions { margin-left: auto; }
  #permission-mode { width: 205px; height: 36px; }
  .permission-icon, .permission-control .select-chevron { top: 11px; }
  #session-status { font-size: 9px; }
  .composer-actions button { min-height: 36px; }
  #attach-files { min-height: 36px; width: 32px; }
  footer { min-height: 36px; padding-bottom: max(9px, env(safe-area-inset-bottom)); font-size: 9px; }
}
@media (max-width: 420px) {
  :root { --content-gutter: 14px; }
  .topbar-context { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .workspace-header { gap: 8px; padding: 12px 14px; flex-wrap: wrap; }
  .workspace-identity { flex: 1; }
  .workspace-header p { max-width: 42vw; }
  .header-actions { gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
  .header-actions button { padding-inline: 7px; font-size: 10px; }
  #connection { font-size: 9px; }
  #stop .icon { display: none; }
  .empty { min-height: 190px; }
  .empty h1 { font-size: 21px; }
  .empty p { font-size: 11px; }
  .empty-capabilities { gap: 12px; font-size: 9px; }
  .composer-context { gap: 5px; }
  .composer-actions { gap: 5px; }
  #permission-mode { width: 205px; font-size: 10px; padding-left: 26px; padding-right: 22px; }
  .permission-icon { left: 7px; width: 13px; }
  .permission-control .select-chevron { right: 5px; width: 12px; }
  #send { min-width: 57px; padding-inline: 9px; }
  #interrupt { padding-inline: 8px; font-size: 10px; }
  #interrupt .icon { display: none; }
}
@media (max-height: 600px) {
  aside { gap: 8px; padding-top: 8px; padding-bottom: 9px; }
  .session-settings { gap: 8px; flex: none; padding-bottom: 8px; }
  #sessions { min-height: 32px; }
  .sidebar-bottom, #new-session, .sessions-label { flex: none; }
  .sessions-label { margin-top: -6px; margin-bottom: -6px; }
  .workspace-header { min-height: 60px; padding-block: 10px; }
  #messages { padding-block: 16px; }
  textarea { height: 60px; min-height: 44px; }
  .empty { min-height: 160px; }
  .empty-capabilities { display: none; }
  footer { min-height: 30px; padding-block: 7px; }
}
@media (max-height: 440px) {
  aside { gap: 6px; }
  .sidebar-bottom, #model-help { display: none; }
  #new-session { min-height: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Company and project navigation */
.app { --sidebar-width: 252px; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.topbar { grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto; }
.topbar-brand { padding-left: 11px; }
#toggle-sidebar { display: inline-flex; }
.topbar-context { overflow: hidden; gap: 10px; }
.topbar-context > span, .topbar-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sidebar { gap: 13px; padding: 9px 11px 12px; }
.workspace-selectors { padding: 0 4px 12px; border-bottom: 1px solid var(--chrome-line); }
.workspace-selector-heading { display: flex; align-items: center; min-height: 24px; gap: 3px; margin: 0 0 3px; }
.workspace-selector-heading label { flex: 1; color: #60606b; font-size: 10px; font-weight: 600; }
.workspace-selector-heading .icon-button { width: 23px; min-height: 23px; padding: 3px; font-size: 17px; }
.workspace-selector-heading .icon { width: 13px; height: 13px; }
.workspace-selectors select { width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #c3c3cd; border-radius: 6px; color: #30303a; background: #f4f4f7; font-size: 12px; font-weight: 550; text-overflow: ellipsis; }
.workspace-selectors select:disabled { opacity: .6; }
.project-selector-group { margin-top: 10px; padding-left: 11px; border-left: 1px solid #cbcbd4; }
.project-role { display: block; margin: 7px 0 0 12px; color: #70707b; font-size: 9px; }
.project-navigation { display: flex; gap: 3px; padding: 0 1px 11px; border-bottom: 1px solid var(--chrome-line); }
.project-tab { flex: 1; min-width: 0; min-height: 32px; gap: 5px; padding: 5px; border: 0; background: transparent; color: #62626d; font-size: 10px; }
.project-tab .icon { width: 14px; height: 14px; }
.project-tab.active { background: #f9f9fb; color: #234d94; box-shadow: 0 1px 3px #24243a0c; }
.sidebar-panel { display: flex; flex-direction: column; gap: 8px; flex: 1 !important; min-height: 0; overflow: hidden; }
.sessions-label { flex: none; min-height: 26px; margin: 0 2px 0 7px; font-size: 9px; letter-spacing: .8px; }
.sessions-label > div { display: flex; gap: 0; }
.sessions-label .icon-button, #new-session { display: inline-flex; align-items: center; justify-content: center; width: 26px; min-height: 26px; padding: 4px; border: 0; border-radius: 5px; background: transparent; box-shadow: none; }
.sessions-label .icon { width: 14px; height: 14px; }
#sessions { min-height: 0; padding: 0 0 4px; overflow: auto; scrollbar-width: thin; }
.session.session-row { display: flex; align-items: center; min-width: 0; min-height: 33px; gap: 2px; margin: 0; padding: 0 3px 0 0; border: 0; border-radius: 5px; background: transparent; box-shadow: none; }
.session.session-row::before { display: none; }
.session.session-row:hover { background: #d8d8e180; }
.session.session-row.selected { background: #f8f8fb; box-shadow: inset 2px 0 0 var(--accent); }
.session-select { flex: 1; justify-content: flex-start; min-width: 0; min-height: 33px; padding: 6px 8px; border: 0; background: transparent; border-radius: 5px; text-align: left; }
.session-select:hover:not(:disabled), .session-select:disabled { background: transparent; border-color: transparent; }
.session-title { min-width: 0; gap: 8px; }
.session-title strong { font-size: 11px; font-weight: 450; letter-spacing: 0; }
.session.selected .session-title strong { font-weight: 600; color: #294c8b; }
.session-status-dot { width: 4px; height: 4px; }
.session-delete { width: 23px; min-height: 23px; padding: 2px; color: #6b6b76; font-size: 17px; opacity: 0; }
.session:hover .session-delete, .session:focus-within .session-delete, .session.selected .session-delete { opacity: 1; }
.session-delete:hover:not(:disabled) { color: var(--danger); background: #f1dddd; }
.session-list-empty, .file-tree-empty { margin: 8px; color: var(--ink-muted); font-size: 11px; }
.session-settings { display: block; margin-top: auto; padding: 10px 5px 0; border: 0; border-top: 1px solid var(--chrome-line); }
.session-settings summary { color: var(--ink-secondary); font-size: 10px; cursor: pointer; }
.session-settings .field { margin-top: 10px; }
.session-settings .field-note { display: none; }
.sidebar-panel-help { margin: 4px 7px; color: var(--ink-muted); font-size: 10px; line-height: 1.7; }
.team-account { padding-top: 11px; }
.conversation-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.project-access-notice { padding: 8px 24px; border-bottom: 1px solid #dae3f3; color: #416085; background: #f0f4fa; font-size: 11px; }
.workspace-header { min-height: 67px; padding-block: 12px; }
.workspace-header p { font-family: var(--font); }

/* A compact rail keeps project sections available while the sidebar is closed. */
@media (min-width: 721px) {
  .app.sidebar-collapsed { --sidebar-width: 58px; }
  .sidebar-collapsed .topbar-brand .brand { display: none; }
  .sidebar-collapsed #sidebar { padding-inline: 9px; gap: 10px; align-items: stretch; }
  .sidebar-collapsed .workspace-selectors, .sidebar-collapsed .sidebar-panel, .sidebar-collapsed .team-account, .sidebar-collapsed .sidebar-bottom { display: none; }
  .sidebar-collapsed .project-navigation { flex-direction: column; border: 0; gap: 8px; }
  .sidebar-collapsed .project-tab { flex: none; width: 38px; min-height: 38px; padding: 8px; }
  .sidebar-collapsed .project-tab span { display: none; }
  .sidebar-collapsed .project-tab .icon { width: 18px; height: 18px; }
}

/* Files and membership use light surfaces with narrow navigation rows. */
.project-content { flex: 1; min-height: 0; overflow: auto; padding: 24px 28px; background: #fafafb; }
.project-view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.project-view-toolbar h1 { margin: 0; font-size: 21px; letter-spacing: -.5px; font-weight: 620; }
.project-view-toolbar p { margin: 5px 0 0; color: var(--ink-secondary); font-size: 11px; line-height: 1.7; }
.project-view-toolbar .eyebrow { margin-bottom: 4px; font-size: 9px; }
.project-file-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.project-file-actions button { min-height: 31px; font-size: 10px; }
.file-drop-zone { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 68px; padding: 14px; margin-bottom: 19px; border: 1px dashed #bbc4d3; border-radius: 9px; color: #4b6388; background: #f3f6fa; font-size: 12px; cursor: pointer; }
.file-drop-zone span { color: #7c8595; font-size: 10px; }
.file-drop-zone.drag-over { background: #e5efff; border-color: #4480d9; box-shadow: 0 0 0 3px #4380d912; }
.file-drop-zone[aria-disabled="true"] { opacity: .55; cursor: wait; }
.file-location { display: flex; align-items: center; gap: 7px; min-width: 0; margin: -4px 0 12px; color: var(--ink-muted); font-size: 11px; }
.file-location button { min-height: 27px; padding: 3px 7px; border: 0; background: transparent; color: #526989; font-size: 11px; }
.file-location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-status { padding: 10px 12px; margin: 0 0 15px; border: 1px solid #d8e1ee; border-radius: 7px; background: #f0f4fa; color: #3f5a7f; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.project-status[data-error="true"] { color: #8a352d; border-color: #ebd4d0; background: #fcf1ef; }
.file-tree { overflow: auto; min-height: 0; flex: 1; padding: 1px 0 8px; scrollbar-width: thin; }
.file-tree-entry { min-width: 0; }
.file-tree-button { justify-content: flex-start; width: 100%; min-height: 29px; gap: 7px; padding: 4px 7px; border: 0; background: transparent; font-size: 11px; font-weight: 430; text-align: left; }
.file-tree-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree-button.selected { background: #f8f8fb; color: #234d94; }
.file-tree-icon { width: 13px; flex: none; color: #848895; font-size: 14px; text-align: center; }
.file-tree-children { margin-left: 12px; padding-left: 3px; border-left: 1px solid #d1d1da; }
.file-preview { display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 200px; }
.file-preview-empty { align-self: stretch; padding: 45px 22px; border: 1px solid #e1e1e7; border-radius: 10px; background: white; color: var(--ink-muted); text-align: center; }
.file-preview-empty .icon { width: 35px; height: 35px; color: #939caf; margin-bottom: 10px; }
.file-preview-empty h2 { margin: 0 0 8px; color: #454551; font-size: 15px; font-weight: 550; }
.file-preview-empty p, .file-preview-note { margin: 0; color: var(--ink-muted); font-size: 12px; }
.project-image-preview { display: block; max-width: 100%; max-height: 60vh; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.file-download { color: var(--accent); font-size: 11px; text-underline-offset: 3px; }
.file-editor-panel { min-height: 180px; border: 1px solid #d5d5df; border-radius: 10px; background: white; overflow: hidden; }
.file-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-bottom: 1px solid #dedee5; background: #f0f0f5; }
.file-editor-heading > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); }
.file-editor-heading > div { display: flex; gap: 7px; align-items: center; flex: none; }
.file-editor-heading button { min-height: 28px; padding: 4px 9px; font-size: 10px; }
#file-dirty { font-size: 10px; color: #927044; }
.file-highlight .code-block { margin: 0; border: 0; border-radius: 0; }
.file-highlight .code-toolbar { display: none; }
.file-highlight .code-block pre { max-height: 56vh; min-height: 200px; }
textarea.file-editor { display: block; width: 100%; min-height: 350px; height: 55vh; margin: 0; padding: 15px 18px; border: 0; border-radius: 0; outline-offset: -3px; background: #fafaff; color: #25263b; font: 12px/1.85 var(--mono); tab-size: 2; white-space: pre; overflow: auto; resize: vertical; }
.project-member-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; padding: 17px; margin: 0 0 22px; border: 1px solid #dcdce4; border-radius: 9px; background: white; }
.project-member-form > button { height: 36px; font-size: 11px; }
.project-members-list { border-top: 1px solid #dcdce4; }
.project-member-row { display: flex; gap: 12px; align-items: center; min-height: 63px; padding: 12px 8px; border-bottom: 1px solid #e2e2e8; }
.project-member-info { flex: 1; min-width: 0; }
.project-member-info strong { display: block; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.project-member-info span { display: block; margin-top: 4px; color: var(--ink-muted); font-size: 10px; }
.project-member-row select { height: 31px; padding: 4px 7px; border: 1px solid #c9c9d4; border-radius: 6px; background: white; font-size: 11px; }
.project-member-row button { min-height: 31px; font-size: 10px; }
.member-role-label { font-size: 11px; text-transform: capitalize; color: var(--ink-secondary); }
.workspace-dialog { width: min(420px, calc(100vw - 30px)); max-height: calc(100dvh - 40px); margin: auto; padding: 26px; border: 1px solid #c5c5d1; border-radius: 13px; background: #fdfdff; color: var(--ink); box-shadow: 0 15px 60px #14141e22; }
.workspace-dialog::backdrop { background: #17172566; }
.workspace-dialog h2 { margin: 0 0 12px; font-size: 21px; letter-spacing: -.3px; }
.workspace-dialog p { color: var(--ink-secondary); font-size: 12px; line-height: 1.7; }
.workspace-dialog input { width: 100%; height: 38px; padding: 8px 10px; border: 1px solid #c5c5d1; border-radius: 6px; background: white; font-size: 13px; }
.workspace-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@media (max-width: 1050px) {
  .app { --sidebar-width: 232px; }
  .project-content { padding: 20px; }
  .project-view-toolbar { align-items: flex-start; }
  .project-file-actions { max-width: 210px; }
  .project-member-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .project-member-form > button { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  #sidebar { width: min(310px, calc(100vw - 44px)); padding: 15px 12px; }
  .topbar-brand { padding-left: 9px; }
  .topbar-context { padding-right: 10px; }
  .project-content { padding: 18px 15px; }
  .project-view-toolbar { flex-direction: column; gap: 12px; }
  .project-view-toolbar h1 { font-size: 19px; }
  .project-file-actions { max-width: none; width: 100%; justify-content: flex-start; }
  .file-drop-zone { flex-direction: column; gap: 4px; }
  .file-editor-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .file-editor-heading > strong { max-width: 100%; }
  .file-editor-heading > div { flex-wrap: wrap; }
  .project-member-row { gap: 8px; flex-wrap: wrap; }
  .project-member-info { flex-basis: 100%; }
  .project-access-notice { padding-inline: 16px; }
  .session-delete { opacity: .7; }
}
@media (max-width: 420px) {
  .topbar { grid-template-columns: 1fr auto; }
  .project-member-form { grid-template-columns: minmax(0, 1fr); }
}
