:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #667482;
  --line: #dfe5ea;
  --canvas: #f4f7f9;
  --panel: #ffffff;
  --sidebar: #edf2f5;
  --accent: #2f5f82;
  --accent-strong: #244b68;
  --accent-soft: #e9f0f5;
  --teal: #397965;
  --danger: #c84242;
  --shadow: 0 20px 55px rgba(34, 51, 65, .11);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 0; margin: 0; min-height: 100%; overflow-x: hidden; background: var(--canvas); color: var(--ink); }
button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(480px, .95fr); }
.auth-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 42px 52px; color: var(--ink); background: #e8eef2; }
.auth-story::after { content: ""; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(rgba(47,95,130,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(47,95,130,.055) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent); }
.brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; font-weight: 740; letter-spacing: -.02em; }
.brand-wordmark { display: block; width: auto; height: 27px; opacity: 1; filter: saturate(.82) contrast(1.22); transition: filter .18s ease, opacity .18s ease; }
.brand-ai-tag { display: grid; place-items: center; min-width: 29px; height: 23px; padding: 0 7px; border: 1px solid #315f80; border-radius: 7px; color: #fff; background: #315f80; box-shadow: 0 3px 9px rgba(35,67,90,.16); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(84,121,160,.18); border-radius: 11px; color: white; font-size: 15px; background: #0a2134; box-shadow: inset 0 1px rgba(255,255,255,.18), 0 5px 14px rgba(7,24,39,.12); }
.brand-mark img { display: block; width: 28px; height: 28px; }
.brand-on-dark .brand-mark { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); }
.auth-story-copy { position: relative; z-index: 2; max-width: 610px; margin: auto 0; }
.eyebrow { margin: 0 0 14px; color: #53728a; font-size: 12px; line-height: 1; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.ink { color: var(--accent); }
.auth-story h1 { max-width: 560px; margin: 0; font-size: clamp(46px, 5.2vw, 76px); line-height: .99; letter-spacing: -.065em; font-weight: 650; }
.auth-story-copy > p:not(.eyebrow) { max-width: 570px; margin: 28px 0; color: #52616e; font-size: 18px; line-height: 1.65; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; color: #556674; font-size: 13px; }
.trust-row span { display: flex; align-items: center; gap: 8px; }
.trust-row i { width: 7px; height: 7px; border-radius: 999px; background: #4b806d; box-shadow: 0 0 0 4px rgba(75,128,109,.1); }
.story-orbit { position: absolute; border: 1px solid rgba(47,95,130,.12); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; right: -230px; top: -180px; }
.orbit-two { width: 340px; height: 340px; left: -180px; bottom: -140px; }
.auth-panel { display: grid; place-items: center; padding: 48px; background: #ffffff; }
.auth-card { width: min(100%, 480px); }
.mobile-brand { display: none; }
.auth-tabs { width: fit-content; display: flex; gap: 6px; margin-bottom: 40px; padding: 4px; border-radius: 12px; background: #eef0f3; }
.auth-tab { border: 0; border-radius: 9px; padding: 9px 16px; color: var(--muted); background: transparent; cursor: pointer; }
.auth-tab.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(20,24,34,.08); }
.auth-form { display: grid; gap: 18px; }
.auth-form h2, .admin-dialog h2 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.form-hint { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
label { display: grid; gap: 8px; color: #444953; font-size: 13px; font-weight: 680; }
input, textarea { width: 100%; border: 1px solid #dfe2e8; outline: none; color: var(--ink); background: white; transition: border-color .16s, box-shadow .16s; }
input { height: 48px; padding: 0 14px; border-radius: 12px; }
input:focus, textarea:focus { border-color: #6f94ae; box-shadow: 0 0 0 4px rgba(47,95,130,.1); }
label small { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.45; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.primary-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 12px; color: white; background: var(--accent); font-weight: 720; cursor: pointer; box-shadow: 0 8px 20px rgba(47,95,130,.18); transition: transform .16s, background .16s; }
.primary-button:hover { transform: translateY(-1px); background: var(--accent-strong); }
.primary-button:disabled { cursor: wait; opacity: .62; transform: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: #8a949e; font-size: 11px; text-align: center; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-divider span { white-space: nowrap; }
.microsoft-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid #cfd6dc; border-radius: 12px; padding: 0 16px; color: #27333d; background: #fff; font-weight: 700; cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.microsoft-button:hover { transform: translateY(-1px); border-color: #9caebc; background: #f7f9fa; }
.microsoft-button:disabled { opacity: .6; cursor: wait; transform: none; }
.microsoft-mark { flex: 0 0 auto; width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.microsoft-mark i:nth-child(1) { background: #f25022; }
.microsoft-mark i:nth-child(2) { background: #7fba00; }
.microsoft-mark i:nth-child(3) { background: #00a4ef; }
.microsoft-mark i:nth-child(4) { background: #ffb900; }
.microsoft-note { margin: -7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.form-error { min-height: 20px; margin: 15px 0 0; color: var(--danger); font-size: 13px; }

.sidebar-backdrop { display: none; }
.app-view { position: fixed; inset: 0; width: 100%; min-width: 0; height: 100dvh; min-height: 0; display: grid; grid-template-columns: 286px minmax(0, 1fr); overflow: hidden; }
.sidebar { position: relative; z-index: 20; min-width: 0; height: 100%; display: flex; flex-direction: column; padding: 22px 14px 14px; border-right: 1px solid #e4e6eb; background: var(--sidebar); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 24px; }
.new-chat-button { width: 100%; display: flex; align-items: center; gap: 11px; border: 1px solid #dedfe6; border-radius: 13px; padding: 11px 13px; background: rgba(255,255,255,.78); font-weight: 680; cursor: pointer; transition: background .16s, border .16s; }
.new-chat-button:hover { border-color: #c9c9e8; background: white; }
.new-chat-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: white; background: var(--accent); }
.sidebar-label { margin: 26px 11px 10px; color: #90949d; font-size: 11px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.conversation-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 3px; }
.conversation-item { display: flex; align-items: center; gap: 5px; border-radius: 10px; }
.conversation-item.active { background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(20,24,34,.04); }
.conversation-open { min-width: 0; flex: 1; border: 0; padding: 10px 10px; overflow: hidden; color: #555b65; background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.conversation-delete { opacity: 0; border: 0; padding: 8px; color: #9599a1; background: transparent; cursor: pointer; }
.conversation-item:hover .conversation-delete { opacity: 1; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.sidebar-action { border: 0; border-radius: 10px; padding: 10px 11px; color: #565c66; background: transparent; text-align: left; cursor: pointer; }
.sidebar-action:hover { background: rgba(255,255,255,.72); }
.sidebar-action:not(.hidden) { display: flex; align-items: center; gap: 9px; }
.account-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid #dedfe4; padding: 14px 8px 2px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: #202330; font-size: 13px; font-weight: 760; }
.account-copy { min-width: 0; flex: 1; display: grid; }
.account-copy strong, .account-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 13px; }
.account-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #727780; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(0,0,0,.05); }
.logout-button { flex: 0 0 auto; border: 1px solid #d9dce3; border-radius: 9px; padding: 7px 9px; color: #5f6570; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 680; cursor: pointer; }
.logout-button:hover { color: #292d34; border-color: #c9cdd6; background: white; }
.chat-shell { min-width: 0; width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: white; }
.chat-header { min-height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 26px; border-bottom: 1px solid var(--line); }
.chat-header > div:nth-child(2) { min-width: 0; display: grid; }
.chat-header strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header span:not(.model-pill span) { margin-top: 2px; color: var(--muted); font-size: 11px; }
.model-pill { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: #fafafd; font-size: 12px; }
.model-pill > span { width: 7px; height: 7px; border-radius: 999px; background: var(--teal); box-shadow: 0 0 0 4px rgba(34,165,139,.1); }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-action { min-height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; color: #555b65; background: #fafafd; font-size: 11px; font-weight: 700; cursor: pointer; }
.header-action:hover { color: var(--accent-strong); border-color: #cecef0; background: white; }
.chat-scroll { min-width: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.welcome-state { min-height: 100%; display: grid; place-content: center; justify-items: center; padding: 70px 24px 150px; text-align: center; }
.welcome-mark { width: 68px; height: 68px; display: grid; place-items: center; margin-bottom: 25px; border-radius: 20px; background: #eaf0f4; box-shadow: inset 0 0 0 1px rgba(47,95,130,.09); }
.welcome-mark span { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #d3dfe7; border-radius: 14px; color: white; background: white; box-shadow: 0 8px 20px rgba(34,51,65,.1); font-weight: 800; }
.welcome-mark img { display: block; width: 38px; height: 38px; }
.welcome-state h1 { margin: 0; font-size: clamp(34px, 4vw, 52px); font-weight: 610; letter-spacing: -.055em; }
.welcome-state > p:not(.eyebrow) { margin: 16px 0 34px; color: var(--muted); font-size: 16px; }
.suggestion-grid { width: min(100%, 760px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.suggestion-grid button { min-height: 104px; display: grid; align-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fbfbfc; text-align: left; cursor: pointer; transition: transform .16s, border-color .16s, background .16s; }
.suggestion-grid button:hover { transform: translateY(-2px); border-color: #cecef0; background: white; }
.suggestion-grid b { font-size: 13px; }
.suggestion-grid span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.message-list { width: min(100%, 900px); margin: 0 auto; padding: 36px 24px 170px; }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; margin-bottom: 30px; }
.message-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; color: white; background: #252835; font-size: 12px; font-weight: 760; }
.message.assistant .message-avatar { background: var(--accent); }
.message-body { min-width: 0; padding-top: 4px; }
.message-label { margin-bottom: 8px; color: #444953; font-size: 12px; font-weight: 730; }
.message-content { color: #292d34; font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-content { width: fit-content; max-width: min(100%, 720px); border-radius: 16px 16px 4px 16px; padding: 12px 15px; background: #f1f2f5; }
.message.error .message-content { color: var(--danger); }
.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing i { width: 6px; height: 6px; border-radius: 999px; background: #aaaee6; animation: pulse 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 65%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-4px); opacity: 1; } }
.composer-wrap { position: relative; z-index: 5; padding: 10px 24px 16px; background: linear-gradient(to top, white 75%, rgba(255,255,255,0)); }
.composer { width: min(100%, 900px); margin: 0 auto; border: 1px solid #dfe1e7; border-radius: 18px; padding: 12px 12px 9px 16px; background: white; box-shadow: 0 10px 34px rgba(28,32,45,.1); }
.composer textarea { max-height: 180px; resize: none; border: 0; padding: 4px 2px 10px; box-shadow: none; line-height: 1.55; }
.composer textarea:focus { box-shadow: none; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-bottom > span { color: #a0a4ac; font-size: 10px; }
.send-button { width: 34px; height: 34px; border: 0; border-radius: 11px; color: white; background: var(--accent); font-size: 19px; font-weight: 700; cursor: pointer; }
.send-button:disabled { background: #bbbce0; cursor: wait; }
.composer-note { margin: 8px 0 0; color: #9a9ea6; font-size: 10px; text-align: center; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border-radius: 12px; padding: 11px 15px; color: white; background: #242731; font-size: 13px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.admin-dialog { width: min(760px, calc(100% - 30px)); max-height: min(820px, calc(100vh - 30px)); overflow-y: auto; border: 0; border-radius: 22px; padding: 26px; color: var(--ink); background: white; box-shadow: var(--shadow); }
.admin-dialog::backdrop { background: rgba(23,26,35,.42); backdrop-filter: blur(6px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-intro { margin: 10px 0 24px; color: var(--muted); line-height: 1.55; }
.company-sso-card { display: grid; gap: 14px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfd; }
.company-sso-copy { display: flex; align-items: center; gap: 12px; }
.company-sso-copy > .microsoft-mark { width: 24px; height: 24px; gap: 2px; }
.company-sso-copy strong { display: block; font-size: 14px; }
.company-sso-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.sso-link-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.sso-link-form .microsoft-button { min-width: 210px; }
.create-user-form { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; padding: 16px; border-radius: 16px; background: #f6f6f8; }
.create-user-form .primary-button { grid-column: 1 / -1; }
.user-list { display: grid; gap: 8px; margin-top: 18px; }
.user-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.user-row-copy { min-width: 0; display: grid; gap: 3px; }
.user-row-copy strong, .user-row-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-copy span { color: var(--muted); font-size: 12px; }
.status-button { border: 0; border-radius: 9px; padding: 7px 10px; color: #297262; background: #e7f6f2; font-size: 11px; cursor: pointer; }
.status-button.inactive { color: #9b3f3f; background: #f9eaea; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 11px; color: #425665; border: 1px solid #d4dde4; border-radius: 10px; background: rgba(255,255,255,.78); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(35,53,67,.06); transition: color .16s, border-color .16s, background .16s; }
.theme-toggle:hover { color: var(--accent-strong); border-color: #b9cad6; background: #fff; }
.theme-toggle [data-theme-icon] { font-size: 14px; line-height: 1; }
.auth-theme-toggle { position: absolute; z-index: 10; top: 22px; right: 22px; }
.header-theme-toggle { flex: 0 0 auto; }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf2f5;
  --muted: #9ba9b4;
  --line: #2b3943;
  --canvas: #10171c;
  --panel: #172027;
  --sidebar: #141d23;
  --accent: #6791ad;
  --accent-strong: #82a6bd;
  --accent-soft: #21313c;
  --teal: #6da18e;
  --danger: #e17a7a;
  --shadow: 0 22px 58px rgba(0,0,0,.28);
}
html[data-theme="dark"] .brand-wordmark { filter: brightness(0) saturate(100%) invert(94%) sepia(8%) saturate(278%) hue-rotate(161deg) brightness(103%); opacity: 1; }
html[data-theme="dark"] .brand-ai-tag { border-color: #9fc2d7; color: #14212a; background: #9fc2d7; box-shadow: none; }
html[data-theme="dark"] .auth-story { color: var(--ink); background: #18232b; }
html[data-theme="dark"] .auth-story::after { opacity: .35; background-image: linear-gradient(rgba(184,202,215,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(184,202,215,.06) 1px, transparent 1px); }
html[data-theme="dark"] .auth-story-copy > p:not(.eyebrow),
html[data-theme="dark"] .trust-row { color: #a9b5be; }
html[data-theme="dark"] .story-orbit { border-color: rgba(184,202,215,.1); }
html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .chat-shell { background: #11191e; }
html[data-theme="dark"] .auth-tabs { background: #202a31; }
html[data-theme="dark"] .auth-tab.active { color: var(--ink); background: #2a353d; box-shadow: none; }
html[data-theme="dark"] label { color: #c2ccd3; }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea { color: var(--ink); border-color: #34434d; background: #172127; }
html[data-theme="dark"] .sidebar { border-color: #293740; background: var(--sidebar); }
html[data-theme="dark"] .new-chat-button,
html[data-theme="dark"] .logout-button,
html[data-theme="dark"] .model-pill,
html[data-theme="dark"] .header-action { color: #d3dde3; border-color: #33414a; background: #1b252b; }
html[data-theme="dark"] .new-chat-button:hover,
html[data-theme="dark"] .logout-button:hover,
html[data-theme="dark"] .header-action:hover { color: white; border-color: #526a79; background: #222e35; }
html[data-theme="dark"] .conversation-item.active { background: #202b32; box-shadow: none; }
html[data-theme="dark"] .conversation-open,
html[data-theme="dark"] .sidebar-action { color: #b8c4cc; }
html[data-theme="dark"] .sidebar-action:hover { background: #202b32; }
html[data-theme="dark"] .account-row,
html[data-theme="dark"] .chat-header { border-color: #2b3943; }
html[data-theme="dark"] .icon-button { color: #a8b5be; }
html[data-theme="dark"] .icon-button:hover { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .welcome-mark { background: #1d2a32; box-shadow: inset 0 0 0 1px #2d3d47; }
html[data-theme="dark"] .welcome-mark span { border-color: #34434d; background: #172127; }
html[data-theme="dark"] .suggestion-grid button { color: var(--ink); border-color: #2d3b45; background: #172127; }
html[data-theme="dark"] .suggestion-grid button:hover { border-color: #516877; background: #1c272e; }
html[data-theme="dark"] .message-label,
html[data-theme="dark"] .message-content { color: #dbe3e8; }
html[data-theme="dark"] .message.user .message-content { background: #202a31; }
html[data-theme="dark"] .composer-wrap { background: linear-gradient(to top, #11191e 75%, rgba(17,25,30,0)); }
html[data-theme="dark"] .composer { border-color: #34434d; background: #172127; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
html[data-theme="dark"] .admin-dialog { color: var(--ink); border-color: #34434d; background: #182229; }
html[data-theme="dark"] .create-user-form { background: #202a31; }
html[data-theme="dark"] .company-sso-card { border-color: #34434d; background: #202a31; }
html[data-theme="dark"] .microsoft-button { color: #dce4e9; border-color: #3a4953; background: #1b252b; }
html[data-theme="dark"] .microsoft-button:hover { border-color: #5a7180; background: #222e35; }
html[data-theme="dark"] .user-row { border-color: #34434d; }
html[data-theme="dark"] .theme-toggle { color: #c8d2d9; border-color: #3a4953; background: #1c262d; box-shadow: none; }
html[data-theme="dark"] .theme-toggle:hover { color: white; border-color: #5a7180; background: #222e35; }

@media (max-width: 900px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; padding: 32px 20px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-weight: 740; }
  .app-view { grid-template-columns: 1fr; }
  .mobile-only { display: inline-grid; place-items: center; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 310px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 45px rgba(25,28,40,.16); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 15; inset: 0; display: none; background: rgba(22,25,34,.35); }
  .sidebar-backdrop.open { display: block; }
  .theme-toggle [data-theme-label] { display: none; }
  .theme-toggle { width: 36px; padding: 0; }
  .chat-header { padding: 0 15px; }
  .header-actions { margin-left: auto; }
  .suggestion-grid { grid-template-columns: 1fr; }
  .welcome-state { padding-bottom: 120px; }
  .composer-wrap { padding-inline: 12px; }
  .create-user-form { grid-template-columns: 1fr; }
  .sso-link-form { grid-template-columns: 1fr; }
  .sso-link-form .microsoft-button { width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
  .two-fields { grid-template-columns: 1fr; }
  .auth-tabs { margin-bottom: 28px; }
  .auth-form h2 { font-size: 26px; }
  .model-pill b { display: none; }
  .model-pill { display: none; }
  .chat-header { gap: 8px; }
  .chat-header > div:nth-child(2) { flex: 1; }
  .header-actions { gap: 4px; }
  .header-action { padding: 7px 8px; }
  .message-list { padding-inline: 15px; }
  .composer-bottom > span { display: none; }
  .admin-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; padding: 22px 18px; }
}

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