:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fbfbf8;
  --surface-strong: #ffffff;
  --surface-muted: #eeeeea;
  --ink: #171815;
  --muted: #6e7169;
  --line: #dedfd8;
  --line-strong: #caccc3;
  --accent: #546cff;
  --accent-strong: #3f55e8;
  --accent-soft: #e8ebff;
  --success: #247b53;
  --warning: #9b621b;
  --danger: #b24242;
  --shadow: 0 18px 50px rgba(27, 31, 24, .10);
  --sidebar: 272px;
  --log-width: 330px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11120f;
  --surface: #181a16;
  --surface-strong: #1e201b;
  --surface-muted: #242620;
  --ink: #f1f2ec;
  --muted: #9c9f95;
  --line: #30332b;
  --line-strong: #42463b;
  --accent: #8190ff;
  --accent-strong: #9ca7ff;
  --accent-soft: #292e50;
  --success: #65c898;
  --warning: #e3aa60;
  --danger: #f08080;
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); }
button, input, textarea, select { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mobile-only { display: none; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.count { min-width: 20px; border-radius: 99px; padding: 2px 6px; background: var(--surface-muted); color: var(--muted); text-align: center; font-size: .7rem; }

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, .95fr);
  background: var(--surface);
}
.login-brand {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  background:
    radial-gradient(circle at 20% 15%, rgba(156, 167, 255, .9), transparent 32%),
    radial-gradient(circle at 82% 75%, rgba(116, 210, 181, .62), transparent 36%),
    linear-gradient(145deg, #5668ed, #29316e 72%);
  color: white;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 460px;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(255,255,255,.035), 0 0 0 160px rgba(255,255,255,.025);
}
.login-brand p { position: relative; z-index: 1; margin: 0; font-size: .9rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark-large { position: relative; z-index: 1; width: 82px !important; height: 82px !important; font-size: 2.6rem !important; box-shadow: 0 12px 38px rgba(12, 19, 70, .35); }
.login-card { width: min(420px, calc(100% - 48px)); place-self: center; display: grid; gap: 19px; }
.login-card h1 { margin: 0; max-width: 380px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.02; letter-spacing: -.055em; }
.login-card > p.muted { margin: -4px 0 10px; line-height: 1.55; }

label { display: grid; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 650; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink)); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
textarea { resize: none; }
small { color: var(--muted); font-size: .74rem; font-weight: 500; }

.primary-button, .secondary-button {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: var(--surface-strong); color: var(--ink); }
.secondary-button:hover:not(:disabled) { background: var(--surface-muted); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .5; }
.primary-button.compact { min-height: 40px; padding-inline: 20px; }
.full-width { width: 100%; margin-top: 10px; }
.danger-text { color: var(--danger); }
.form-error { margin: 0; color: var(--danger); font-size: .82rem; line-height: 1.4; }
.notice { border: 1px solid color-mix(in srgb, var(--warning) 40%, var(--line)); border-radius: 12px; padding: 11px 13px; background: color-mix(in srgb, var(--warning) 9%, var(--surface)); color: var(--warning); font-size: .82rem; line-height: 1.4; }

.app-shell { height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app-shell.log-open { grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--log-width); }
.sidebar { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-header { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: .9rem; font-weight: 780; text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #7383ff, #5367ee 60%, #3f4db7);
  color: white;
  font-size: 1rem;
  font-weight: 800;
}
.new-chat-button {
  margin: 5px 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 720;
  cursor: pointer;
}
.new-chat-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-navigation { flex: 1; overflow: auto; padding: 0 10px 18px; scrollbar-width: thin; }
.chat-navigation section + section { margin-top: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 10px 7px; color: var(--muted); font-size: .69rem; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.chat-list { display: grid; gap: 3px; }
.chat-item {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.chat-item:hover { background: var(--surface-muted); }
.chat-item.active { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 72%, var(--ink)); }
.chat-item-copy { min-width: 0; display: grid; gap: 3px; }
.chat-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 680; }
.chat-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; }
.chat-item .activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.empty-list { padding: 8px 10px; color: var(--muted); font-size: .76rem; }
.sidebar-footer { border-top: 1px solid var(--line); padding: 10px; }
.footer-button { width: 100%; border: 0; border-radius: 9px; padding: 8px 10px; display: flex; gap: 9px; background: transparent; color: var(--muted); font-size: .78rem; cursor: pointer; }
.footer-button:hover { background: var(--surface-muted); color: var(--ink); }
.account-button { width: 100%; border: 0; border-radius: 11px; margin-top: 5px; padding: 8px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.account-button:hover { background: var(--surface-muted); }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #dce2be; color: #3e4c19; font-size: .74rem; font-weight: 800; }
.account-copy { min-width: 0; display: grid; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: .76rem; }
.account-copy small { font-size: .65rem; }

.workspace { position: relative; min-width: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.workspace-header { position: relative; z-index: 3; min-height: 70px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 18px 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
.conversation-title-wrap { min-width: 0; flex: 1; }
.title-row { min-width: 0; display: flex; align-items: center; gap: 8px; }
.conversation-title-wrap h2 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; letter-spacing: -.01em; }
.conversation-title-wrap p { overflow: hidden; margin: 3px 0 0; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.visibility-badge { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 99px; padding: 2px 7px; color: var(--muted); font-size: .61rem; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 3px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; display: inline-grid; place-items: center; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; }
.icon-button:hover { background: var(--surface-muted); color: var(--ink); }
.danger-hover:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }

.empty-state { flex: 1; width: min(530px, calc(100% - 40px)); margin: auto; display: grid; justify-items: center; text-align: center; }
.empty-orbit { width: 82px; height: 82px; margin-bottom: 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; box-shadow: 0 0 0 14px var(--surface-muted), 0 0 0 15px var(--line); }
.empty-orbit span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; background: var(--accent); color: white; font-size: 1.4rem; font-weight: 800; transform: rotate(-5deg); }
.empty-state h1 { margin: 2px 0 8px; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.055em; }
.empty-state > p:not(.eyebrow) { max-width: 490px; margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.first-chat-button {
  width: fit-content;
  max-width: 100%;
  min-height: 46px;
  align-self: center;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--line));
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 7px;
  background: var(--surface-strong);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 760;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.first-chat-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
}
.first-chat-arrow { color: var(--accent); font-size: 1rem; transition: transform .16s ease; }
.first-chat-button:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 20%, transparent); transform: translateY(-1px); }
.first-chat-button:hover .first-chat-arrow { transform: translateX(2px); }
.first-chat-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 3px; }

.conversation-view { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 30px max(24px, calc((100% - 850px) / 2)) 180px; scrollbar-width: thin; }
.message { display: grid; grid-template-columns: 33px minmax(0, 1fr); gap: 12px; margin: 0 0 27px; }
.message-avatar { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-strong); color: var(--muted); font-size: .72rem; font-weight: 800; }
.message.assistant .message-avatar { border-color: transparent; background: var(--accent); color: white; }
.message-body { min-width: 0; }
.message-heading { display: flex; align-items: baseline; gap: 8px; margin: 0 0 7px; }
.message-heading strong { font-size: .78rem; }
.message-heading time { color: var(--muted); font-size: .64rem; }
.message-content { overflow-wrap: anywhere; font-size: .9rem; line-height: 1.68; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: .55em 0; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 { margin: 1.25em 0 .45em; line-height: 1.25; letter-spacing: -.025em; }
.message-content h1 { font-size: 1.35rem; }.message-content h2 { font-size: 1.18rem; }.message-content h3 { font-size: 1.02rem; }
.message-content pre { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-strong); font-size: .78rem; line-height: 1.55; }
.message-content code { border-radius: 5px; padding: 2px 5px; background: var(--surface-muted); font: .84em ui-monospace, SFMono-Regular, Menlo, monospace; }
.message-content pre code { padding: 0; background: none; }
.message-content a { color: var(--accent); }
.message-content table { width: 100%; border-collapse: collapse; }
.message-content th, .message-content td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.message.pending .message-content { color: var(--muted); }
.thinking { display: inline-flex; gap: 4px; align-items: center; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.message-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 9px; margin-bottom: 10px; }
.asset-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; align-items: center; gap: 9px; padding: 8px; background: var(--surface-strong); color: var(--ink); text-decoration: none; }
.asset-card:hover { border-color: var(--accent); }
.asset-card img { width: 72px; height: 58px; border-radius: 8px; object-fit: cover; background: var(--surface-muted); }
.asset-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.asset-copy { min-width: 0; display: grid; gap: 3px; }
.asset-copy strong, .asset-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-copy strong { font-size: .73rem; }
.asset-expired { opacity: .55; pointer-events: none; }
.scroll-bottom { position: absolute; z-index: 3; right: 24px; bottom: 126px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-strong); box-shadow: var(--shadow); cursor: pointer; }

.composer-dock { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; padding: 10px max(24px, calc((100% - 850px) / 2)) 16px; background: linear-gradient(to bottom, transparent, var(--bg) 26%); }
.composer { min-height: 58px; border: 1px solid var(--line-strong); border-radius: 17px; display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 7px; padding: 8px; background: var(--surface-strong); box-shadow: 0 8px 30px rgba(31, 34, 28, .08); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent), 0 8px 30px rgba(31, 34, 28, .08); }
.composer textarea { max-height: 180px; min-height: 40px; border: 0; padding: 10px 7px 8px; background: transparent; line-height: 1.45; box-shadow: none; }
.composer textarea:focus { box-shadow: none; }
.attach-button, .send-button { width: 40px; height: 40px; border: 0; border-radius: 11px; display: grid; place-items: center; cursor: pointer; }
.attach-button { background: transparent; color: var(--muted); font-size: 1.2rem; }
.attach-button:hover { background: var(--surface-muted); color: var(--ink); }
.send-button { background: var(--accent); color: white; font-size: 1.2rem; font-weight: 700; }
.send-button:hover { background: var(--accent-strong); }
.send-button:disabled, .attach-button.disabled { opacity: .35; pointer-events: none; }
.composer-hint { margin: 7px 4px 0; color: var(--muted); text-align: center; font-size: .63rem; }
.upload-list { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 7px; padding: 2px; }
.upload-chip { flex: 0 0 auto; width: min(245px, 65vw); border: 1px solid var(--line); border-radius: 12px; padding: 8px 9px; background: var(--surface-strong); }
.upload-chip-row { display: flex; align-items: center; gap: 8px; }
.upload-chip-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.upload-chip strong, .upload-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.upload-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.mini-progress { height: 3px; overflow: hidden; margin-top: 6px; border-radius: 99px; background: var(--surface-muted); }
.mini-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .18s linear; }

.log-panel { display: none; min-width: 0; border-left: 1px solid var(--line); background: var(--surface); }
.log-open .log-panel { display: flex; flex-direction: column; }
.log-panel header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 12px 15px 10px 18px; }
.log-panel h3 { margin: 0; font-size: .88rem; }
.job-summary { margin: 15px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-strong); font-size: .74rem; line-height: 1.45; }
.event-log { flex: 1; overflow-y: auto; margin: 0; padding: 0 15px 18px 35px; font: .7rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.event-log li { margin-bottom: 11px; padding-left: 4px; color: var(--muted); }
.event-log li::marker { color: var(--line-strong); }
.event-log time { display: block; color: color-mix(in srgb, var(--muted) 70%, transparent); font-size: .62rem; }
.event-log li.success { color: var(--success); }.event-log li.error { color: var(--danger); }.event-log li.warning { color: var(--warning); }
.job-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding: 12px 15px; }
.job-actions button { flex: 1; }

.dialog { width: min(560px, calc(100% - 28px)); max-height: min(760px, calc(100vh - 30px)); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(15, 17, 14, .48); backdrop-filter: blur(3px); }
.dialog form { display: grid; gap: 18px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog form .dialog-header { margin-bottom: 0; }
.dialog h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
.dialog fieldset { min-width: 0; display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }
.dialog legend { margin-bottom: 8px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.dialog-actions button { min-width: 104px; }
.small-dialog { width: min(430px, calc(100% - 28px)); }
.model-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: auto 1fr; align-items: flex-start; gap: 9px; padding: 10px; background: var(--surface-strong); color: var(--ink); cursor: pointer; }
.choice-card:hover { border-color: var(--accent); }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-card:has(input:disabled) { opacity: .48; cursor: not-allowed; }
.choice-card input { width: auto; margin: 3px 0 0; accent-color: var(--accent); }
.choice-card span { min-width: 0; display: grid; gap: 3px; }
.choice-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.choice-card small { font-size: .64rem; line-height: 1.35; }
.admin-dialog { width: min(850px, calc(100% - 28px)); }
.create-user-form { display: grid !important; grid-template-columns: 1fr 1.15fr 1.25fr .8fr auto; gap: 8px !important; }
.create-user-form input, .create-user-form select { min-width: 0; }
.admin-hint { margin: 14px 2px 0; font-size: .72rem; }
.user-list { display: grid; gap: 6px; margin-top: 10px; }
.user-row { border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; padding: 10px; background: var(--surface-strong); }
.user-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row select { padding: 8px 10px; font-size: .72rem; }
.user-row button { min-height: 34px; padding: 6px 10px; font-size: .7rem; }
.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(390px, calc(100vw - 36px)); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--surface-strong); box-shadow: var(--shadow); font-size: .78rem; animation: toast-in .2s ease; }
.toast.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .app-shell.log-open { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .log-panel { position: fixed; z-index: 10; top: 0; right: 0; bottom: 0; width: min(var(--log-width), calc(100vw - 30px)); box-shadow: var(--shadow); }
}

@media (max-width: 760px) {
  .mobile-only { display: inline-grid; }
  .login-view { grid-template-columns: 1fr; }
  .login-brand { min-height: 180px; align-content: center; }
  .login-brand::after { width: 260px; box-shadow: 0 0 0 50px rgba(255,255,255,.035); }
  .brand-mark-large { width: 58px !important; height: 58px !important; font-size: 1.7rem !important; }
  .login-card { padding-block: 42px; }
  .app-shell, .app-shell.log-open { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: min(var(--sidebar), calc(100vw - 48px)); transform: translateX(-105%); box-shadow: var(--shadow); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 15; inset: 0; display: block !important; background: rgba(15, 17, 14, .45); }
  .mobile-scrim[hidden] { display: none !important; }
  .workspace-header { padding-inline: 10px; }
  .header-actions { gap: 0; }
  .header-actions .icon-button:nth-child(-n+3) { display: none; }
  .messages { padding: 22px 15px 170px; }
  .composer-dock { padding: 8px 10px 10px; }
  .composer-hint { display: none; }
  .message { grid-template-columns: 29px minmax(0, 1fr); gap: 9px; }
  .message-avatar { width: 29px; height: 29px; border-radius: 9px; }
  .message-content { font-size: .86rem; }
  .model-options { grid-template-columns: 1fr; }
  .create-user-form { grid-template-columns: 1fr !important; }
  .user-row { grid-template-columns: 1fr auto; }
  .user-row > :nth-child(2) { display: none; }
}

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