:root {
  color-scheme: light;
  --ink: #162033;
  --muted: #68748a;
  --muted-2: #94a0b5;
  --line: #e6e9f0;
  --line-strong: #d8deea;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --surface-blue: #f2f5ff;
  --blue: #315efb;
  --blue-dark: #2449d8;
  --blue-soft: #e9eeff;
  --green: #0e9f6e;
  --amber: #e99a18;
  --red: #d84343;
  --purple: #7c4dff;
  --sidebar: 274px;
  --shadow: 0 20px 60px rgba(34, 47, 78, 0.12);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--ink);
  overflow: hidden;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  background: radial-gradient(circle at 50% 45%, #fff, #f1f4fc 70%);
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #4b72ff, #234ddb);
  color: #fff;
  font: 800 22px/1 Manrope, sans-serif;
  box-shadow: 0 12px 24px rgba(49, 94, 251, .25);
}
.boot-line { width: 136px; height: 4px; border-radius: 9px; background: #e3e7f1; overflow: hidden; }
.boot-line span { display: block; width: 45%; height: 100%; background: var(--blue); animation: load 1.1s infinite ease-in-out; }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(320%); } }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
  background: #fff;
}
.auth-story {
  padding: 56px clamp(40px, 6vw, 96px);
  color: #fff;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 15%, rgba(127, 151, 255, .46), transparent 29%),
    radial-gradient(circle at 84% 85%, rgba(107, 73, 255, .34), transparent 32%),
    linear-gradient(145deg, #172c77 0%, #203faf 48%, #2f5cf5 100%);
}
.auth-trust { position: absolute; left: clamp(40px, 6vw, 96px); bottom: 34px; z-index: 1; color: #dbe2ff; font-size: 12px; }
.auth-story::before, .auth-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  width: 520px;
  height: 520px;
  right: -280px;
  top: -180px;
}
.auth-story::after { width: 320px; height: 320px; left: -150px; top: auto; bottom: -140px; }
.auth-logo { display: flex; align-items: center; gap: 12px; font: 800 18px/1 Manrope, sans-serif; letter-spacing: -.02em; }
.auth-logo .brand-mark { background: rgba(255,255,255,.16); box-shadow: none; border: 1px solid rgba(255,255,255,.28); }
.story-content { max-width: 610px; margin-top: clamp(110px, 19vh, 200px); position: relative; z-index: 1; }
.story-kicker { color: #d5ddff; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.story-content h1 { font: 800 clamp(38px, 5vw, 66px)/1.05 Manrope, sans-serif; letter-spacing: -.05em; margin: 18px 0 24px; }
.story-content p { color: #dbe2ff; font-size: 18px; line-height: 1.7; max-width: 540px; }
.story-points { margin-top: 42px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.story-point { display: flex; align-items: center; gap: 10px; color: #eef1ff; font-weight: 600; }
.check { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 12px; }
.auth-form-side { display: grid; place-items: center; padding: 40px; background: #f7f9fe; }
.auth-card { width: min(470px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(30, 49, 92, .10); }
.company-access { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.company-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #e9eeff; color: var(--blue); font-weight: 900; }
.company-access strong, .company-access small { display: block; }
.company-access strong { font: 800 13px Manrope, sans-serif; }
.company-access small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.auth-overline { display: block; margin-bottom: 8px; color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.auth-card h2 { font: 800 32px/1.15 Manrope, sans-serif; margin: 0 0 10px; letter-spacing: -.035em; }
.auth-card > p { color: var(--muted); margin: 0 0 28px; line-height: 1.6; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: 13px; font-weight: 700; color: #39445a; }
.input, .field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: .2s border, .2s box-shadow;
}
.field textarea { resize: vertical; min-height: 112px; line-height: 1.5; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: #87a0ff; box-shadow: 0 0 0 4px rgba(49,94,251,.09); }
.primary-button, .secondary-button, .ghost-button, .icon-button {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  transition: transform .15s ease, background .15s, box-shadow .15s;
}
.primary-button {
  width: 100%;
  padding: 13px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(49, 94, 251, .2);
}
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .58; cursor: wait; transform: none; }
.secondary-button { padding: 10px 14px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.secondary-button:hover { background: var(--surface-soft); }
.ghost-button { padding: 9px 11px; background: transparent; color: var(--muted); }
.ghost-button:hover { background: #edf0f6; color: var(--ink); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted-2); font-size: 10px; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.directory-button { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; }
.directory-button:hover { border-color: #aab9e9; background: #f8faff; }
.directory-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #f0f3fb; color: #42506a; font-weight: 900; }
.directory-button strong, .directory-button small { display: block; }
.directory-button strong { font-size: 12px; }.directory-button small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.directory-note { margin: 9px 3px 0!important; color: var(--muted-2)!important; font-size: 10px; line-height: 1.5!important; }
.auth-hint { margin-top: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.auth-hint span { color: var(--green); font-size: 9px; }

.workspace { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); height: 100vh; background: var(--surface); }
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 18px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; font: 800 15px/1 Manrope, sans-serif; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; background: transparent; font-size: 18px; }
.icon-button:hover { background: #e8ebf2; }
.new-chat { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--ink); color: #fff; border: 0; cursor: pointer; font-weight: 700; }
.new-chat:hover { background: #222e45; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 0; scrollbar-width: thin; }
.nav-section { margin-top: 18px; }
.nav-label { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 7px; color: var(--muted-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.nav-label button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; }
.assistant-nav, .conversation-nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; border: 0; background: transparent; border-radius: 10px; padding: 8px 9px; text-align: left; cursor: pointer; color: #455067; }
.nav-item:hover, .nav-item.active { background: #e8ebf2; color: var(--ink); }
.nav-item.active { font-weight: 700; }
.nav-icon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 800; }
.nav-icon.guide { background: #ece6ff; color: var(--purple); }
.assistant-avatar-shell { padding: 0; overflow: hidden; background: transparent!important; }
.assistant-avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.conversation-row { display: flex; align-items: center; min-width: 0; border-radius: 10px; }
.conversation-row:hover, .conversation-row.active { background: #e8ebf2; }
.conversation-row .nav-item { flex: 1; padding-block: 7px; }
.conversation-row .nav-item:hover { background: transparent; }
.conversation-nav .nav-icon { background: transparent; width: 18px; flex-basis: 18px; color: var(--muted-2); }
.conversation-delete { width: 28px; height: 28px; flex: 0 0 28px; margin-right: 4px; border: 0; border-radius: 8px; background: transparent; color: var(--muted-2); cursor: pointer; opacity: .55; }
.conversation-delete:hover, .conversation-delete:focus-visible { background: #feecec; color: var(--red); opacity: 1; }
.sidebar-footer { border-top: 1px solid var(--line); padding-top: 12px; }
.profile-button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 11px; cursor: pointer; text-align: left; }
.profile-button:hover { background: #e8ebf2; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; background: linear-gradient(145deg, #c9d4ff, #e7ebff); color: #2a4fdc; display: grid; place-items: center; font-weight: 800; }
.profile-meta { min-width: 0; flex: 1; }
.profile-name, .profile-dept { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name { font-size: 13px; font-weight: 700; }
.profile-dept { font-size: 11px; color: var(--muted); margin-top: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; position: relative; background: var(--surface); }
.topbar { height: 68px; flex: 0 0 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); z-index: 5; }
.mobile-menu { display: none; }
.topbar-title { min-width: 0; }
.topbar-title h1 { margin: 0; font: 700 15px/1.25 Manrope, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.export-button { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-decoration: none; color: #34415a; font-size: 11px; }
.export-button:hover { border-color: #b7c4e8; background: #f8faff; }
.export-button > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #185abd; color: #fff; font-weight: 900; }
.export-button strong { white-space: nowrap; }
.provider-logo { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 9px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.provider-logo img { display: block; width: 17px; height: 17px; object-fit: contain; }
.provider-logo.deepseek { background: #eef3ff; border-color: #e1e8ff; }
.provider-logo.gemini { background: #f4efff; border-color: #e9e0ff; }
.provider-logo.demo { background: #fff0dc; color: #a45e15; font-size: 9px; font-weight: 900; }
.model-copy { min-width: 0; flex: 1; }
.model-name { display: block; font-size: 12px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.model-menu { position: absolute; top: calc(100% + 9px); right: 0; width: min(390px, calc(100vw - 34px)); max-height: 470px; overflow: auto; padding: 9px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); z-index: 20; }
.model-menu[hidden] { display: none; }
.model-menu-head { padding: 8px 9px 10px; }
.model-menu-head strong { font: 800 14px Manrope, sans-serif; }
.model-menu-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.model-option { width: 100%; display: flex; gap: 11px; padding: 10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.model-option:hover, .model-option.selected { background: var(--surface-blue); }
.model-option.selected { box-shadow: inset 0 0 0 1px #dce4ff; }
.model-option .model-copy { padding-top: 1px; }
.model-description { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.badge { align-self: flex-start; margin-left: auto; padding: 3px 6px; border-radius: 99px; background: #edf1fa; color: #657189; font-size: 9px; font-weight: 800; white-space: nowrap; }
.not-ready { opacity: .62; }
.main-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; }

.welcome { width: min(930px, calc(100% - 40px)); margin: 0 auto; padding: clamp(45px, 8vh, 86px) 0 190px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.welcome h2 { margin: 12px 0 12px; font: 800 clamp(34px, 5vw, 52px)/1.08 Manrope, sans-serif; letter-spacing: -.05em; }
.welcome > p { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 650px; margin: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 34px; }
.quick-card { min-height: 150px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 17px; background: #fff; padding: 15px; cursor: pointer; text-align: left; transition: transform .18s, border .18s, box-shadow .18s; }
.quick-card:hover { transform: translateY(-3px); border-color: #cdd6f1; box-shadow: 0 14px 30px rgba(34,47,78,.08); }
.quick-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.quick-card:nth-child(2) .quick-icon { background: #eaf8f3; color: var(--green); }
.quick-card:nth-child(3) .quick-icon { background: #fff4e1; color: #b87404; }
.quick-card:nth-child(4) .quick-icon { background: #f1eaff; color: var(--purple); }
.quick-card strong { margin-top: 18px; font: 700 13px/1.25 Manrope, sans-serif; }
.quick-card span { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.section-heading { margin: 42px 0 15px; display: flex; align-items: center; justify-content: space-between; }
.section-heading h3 { margin: 0; font: 800 14px Manrope, sans-serif; }
.section-heading button { border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; }
.assistant-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.assistant-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.assistant-card:hover { border-color: #cbd5f3; background: #fafbff; }
.assistant-card .nav-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
.assistant-info { min-width: 0; }
.assistant-info strong { display: block; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.assistant-info span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

.chat { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 190px; }
.chat-intro { text-align: center; padding: 42px 20px 38px; }
.chat-intro .nav-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; font-size: 18px; }
.chat-intro h2 { margin: 0; font: 800 23px Manrope, sans-serif; }
.chat-intro p { margin: 9px auto 0; color: var(--muted); max-width: 550px; line-height: 1.55; }
.message { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 13px; padding: 18px 0; }
.message-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #edf1fa; color: #5e6980; font-weight: 800; font-size: 12px; }
.message.assistant .message-avatar { background: transparent; color: #fff; }
.message-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.message-head strong { font-size: 13px; }
.message-head span { color: var(--muted-2); font-size: 10px; }
.message-body { line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; }
.message-body p { margin: 0 0 10px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body h1, .message-body h2, .message-body h3 { font-family: Manrope, sans-serif; margin: 18px 0 8px; line-height: 1.25; }
.message-body h1 { font-size: 20px; }.message-body h2 { font-size: 17px; }.message-body h3 { font-size: 15px; }
.message-body ul, .message-body ol { padding-left: 22px; }
.message-body code { padding: 2px 5px; border-radius: 5px; background: #f0f2f7; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.message-body pre { overflow-x: auto; padding: 14px; border-radius: 12px; background: #172033; color: #eef2ff; }
.message-body pre code { background: transparent; color: inherit; padding: 0; }
.message-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 12px; }
.message-body th, .message-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.message-body th { background: #f5f7fb; }
.sources { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.source-chip { max-width: 220px; padding: 6px 9px; border: 1px solid #dde3f2; background: #f8f9fd; border-radius: 9px; color: #556076; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.artifacts { margin-top: 15px; display: grid; gap: 8px; }
.artifact { display: flex; align-items: center; gap: 11px; max-width: 430px; padding: 11px; border: 1px solid #dbe2f5; border-radius: 13px; background: #f8faff; text-decoration: none; }
.artifact:hover { border-color: #b8c7f4; background: #f1f5ff; }
.artifact-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #e4eaff; color: var(--blue); font-weight: 800; font-size: 10px; text-transform: uppercase; }
.artifact-copy { min-width: 0; flex: 1; }
.artifact-copy strong, .artifact-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.artifact-copy strong { font-size: 12px; }.artifact-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.typing { display: flex; gap: 4px; padding-top: 8px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #8d9ab2; animation: bounce 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .12s; }.typing span:nth-child(3) { animation-delay: .24s; }
@keyframes bounce { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-5px); opacity: 1; } }

.composer-wrap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 28px 24px 20px; background: linear-gradient(to bottom, transparent, var(--surface) 28%, var(--surface)); pointer-events: none; }
.composer { pointer-events: auto; width: min(900px, 100%); margin: auto; border: 1px solid #dfe3ec; border-radius: 18px; background: #fff; box-shadow: 0 14px 36px rgba(35, 47, 76, .12); padding: 10px 11px 9px; }
.attachments { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 3px 8px; }
.attachments:empty { display: none; }
.file-chip { display: flex; align-items: center; gap: 7px; max-width: 240px; padding: 6px 8px; background: #f2f5fb; border-radius: 9px; font-size: 10px; }
.file-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.composer textarea { width: 100%; min-height: 42px; max-height: 150px; resize: none; border: 0; outline: 0; padding: 8px 7px 5px; color: var(--ink); line-height: 1.5; background: transparent; }
.composer textarea::placeholder { color: #97a1b4; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-tools { display: flex; align-items: center; gap: 3px; }
.tool-button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.tool-button:hover { background: #f0f2f7; color: var(--ink); }
.composer-model-picker { position: relative; margin-left: 4px; }
.composer-model-button { height: 34px; max-width: 220px; display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 4px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fc; cursor: pointer; }
.composer-model-button:hover { background: #f0f2f7; border-color: #cbd2e2; }
.composer-model-button .provider-logo { width: 26px; height: 26px; flex-basis: 26px; }
.composer-model-button > span:nth-child(2) { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.composer-model-button > span:last-child { color: var(--muted); font-size: 11px; }
.composer-model-menu { top: auto; right: auto; bottom: calc(100% + 9px); left: 0; width: min(390px, calc(100vw - 42px)); }
.send-button { width: 36px; height: 36px; border: 0; border-radius: 11px; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; font-weight: 800; }
.send-button:hover { background: var(--blue); }.send-button:disabled { opacity: .4; cursor: wait; }
.composer-note { text-align: center; color: #9aa3b4; font-size: 9px; margin-top: 7px; pointer-events: auto; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(16, 24, 42, .42); backdrop-filter: blur(4px); }
.modal { width: min(600px, 100%); max-height: min(820px, calc(100vh - 40px)); overflow-y: auto; background: #fff; border-radius: 20px; box-shadow: 0 28px 90px rgba(13,24,48,.24); }
.modal.wide { width: min(820px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 17px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.modal-header h2 { margin: 0; font: 800 20px Manrope, sans-serif; letter-spacing: -.025em; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-body { padding: 22px 24px 25px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 15px 24px; border-top: 1px solid var(--line); background: #fff; }
.modal-footer .primary-button { width: auto; }
.assistant-modal-body { padding-top: 18px; }
.avatar-picker { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.avatar-picker legend { padding: 0; color: #39445a; font-size: 13px; font-weight: 800; }
.avatar-picker > p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; }
.avatar-choice-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 9px; }
.avatar-choice { min-width: 0; cursor: pointer; }
.avatar-choice-card { position: relative; display: grid; justify-items: center; padding: 7px 5px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border .16s, box-shadow .16s, transform .16s, background .16s; }
.avatar-choice-card:hover { transform: translateY(-2px); border-color: #cbd5f3; background: #fafbff; }
.avatar-choice-card img { display: block; width: 68px; height: 68px; max-width: 100%; border-radius: 12px; object-fit: cover; }
.avatar-check { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-weight: 900; opacity: 0; transform: scale(.7); transition: opacity .16s, transform .16s; }
.avatar-choice input:checked + .avatar-choice-card { border-color: var(--blue); background: #f2f5ff; box-shadow: 0 0 0 3px rgba(49,94,251,.12); }
.avatar-choice input:checked + .avatar-choice-card .avatar-check { opacity: 1; transform: scale(1); }
.avatar-choice input:focus-visible + .avatar-choice-card { outline: 3px solid rgba(49,94,251,.22); outline-offset: 2px; }
.custom-department-field[hidden] { display: none; }
.dropzone { border: 1.5px dashed #ccd4e4; border-radius: 14px; padding: 22px; text-align: center; background: #fafbfe; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: #7f9bff; background: #f3f6ff; }

.assistant-choice-modal { width: min(540px, 100%); }
.assistant-choice-body { display: flex; align-items: center; gap: 14px; }
.assistant-choice-avatar { width: 64px; height: 64px; flex: 0 0 64px; display: block; border-radius: 18px; }
.assistant-choice-body strong { font: 800 15px Manrope, sans-serif; }
.assistant-choice-body p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.assistant-choice-footer { justify-content: space-between; }
.assistant-management-actions, .assistant-chat-actions { display: flex; align-items: center; gap: 8px; }
.assistant-delete-button { padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--red); cursor: pointer; font-weight: 700; }
.assistant-delete-button:hover { background: #fff0f0; }
.share-user-list { display: grid; gap: 8px; }
.share-user-row { display: grid; grid-template-columns: 20px 36px 1fr; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.share-user-row:hover { border-color: #c6d1ef; background: #fafbff; }
.share-user-row input { width: 16px; height: 16px; accent-color: var(--blue); }
.share-user-copy { min-width: 0; }
.share-user-copy strong, .share-user-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.share-user-copy strong { font-size: 12px; }.share-user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.confirm-modal { width: min(500px, 100%); }
.danger-button { padding: 10px 14px; border: 0; border-radius: 12px; background: var(--red); color: #fff; cursor: pointer; font-weight: 700; }
.danger-button:hover { background: #b92f2f; }
.dropzone strong { display: block; font-size: 13px; }.dropzone span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.uploaded-list { display: grid; gap: 7px; margin-top: 10px; }
.uploaded-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; }
.uploaded-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-list { display: grid; gap: 8px; }
.user-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.user-row strong, .user-row span { display: block; }.user-row strong { font-size: 12px; }.user-row span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.role-pill { padding: 4px 7px; background: #f0f3f8; border-radius: 99px; color: #647087; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.profile-actions { display: grid; gap: 8px; }
.profile-action { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; text-align: left; }
.profile-action:hover { background: #fafbfe; }.profile-action.danger { color: var(--red); }
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 14px; border-radius: 12px; background: #172033; color: #fff; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { background: #9f2f37; }.toast.success { background: #087756; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.empty { padding: 22px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: 12px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.topbar-tool { height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); cursor: pointer; }
.topbar-tool:hover { border-color: #c4ceeb; background: #f8faff; }
.topbar-tool span { color: var(--blue); font-size: 15px; }
.topbar-tool strong { font-size: 10px; white-space: nowrap; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.pack-card { min-width: 0; min-height: 82px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; text-align: left; }
.pack-card:hover { border-color: #cbd5f3; background: #fafbff; transform: translateY(-1px); }
.pack-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #eef2ff; color: var(--blue); font: 800 12px Manrope, sans-serif; }
.pack-card strong, .pack-card small { display: block; }
.pack-card strong { font-size: 12px; }
.pack-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.guide-tool { color: var(--blue); background: #f0f4ff; }
.evidence-bar { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #dbe5dd; border-radius: 10px; background: #f5fbf7; color: #326149; font-size: 10px; }
.evidence-bar.no_source { border-color: #e5e7ec; background: #f7f8fa; color: #68748a; }
.evidence-bar.limited { border-color: #f0dfb5; background: #fffaf0; color: #8a661b; }
.evidence-bar span:not(.evidence-dot), .evidence-bar em { color: inherit; opacity: .82; font-style: normal; }
.evidence-dot { width: 7px; height: 7px; border-radius: 50%; background: #2d9d64; }
.evidence-bar.no_source .evidence-dot { background: #8f99aa; }.evidence-bar.limited .evidence-dot { background: #d79a21; }
.source-chip { font: inherit; cursor: pointer; text-align: left; }
.source-chip:hover { border-color: #b8c7ef; background: #f1f5ff; }
.arena-model-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.arena-model-choice { min-width: 0; display: grid; grid-template-columns: 18px 34px minmax(0,1fr); align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.arena-model-choice:has(input:checked) { border-color: #aebff2; background: #f4f7ff; }
.arena-model-choice input { accent-color: var(--blue); }.arena-model-choice strong, .arena-model-choice small { display: block; }.arena-model-choice strong { font-size: 11px; }.arena-model-choice small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.field-note { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.arena-result-modal, .insight-modal { width: min(1180px, 100%); }
.comparison-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: start; }
.comparison-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.comparison-card > header { display: flex; align-items: center; gap: 9px; padding: 13px; border-bottom: 1px solid var(--line); background: #fafbfe; }
.comparison-card header strong, .comparison-card header small { display: block; }.comparison-card header strong { font-size: 12px; }.comparison-card header small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.comparison-answer { max-height: 390px; overflow: auto; padding: 14px; font-size: 12px; line-height: 1.6; }
.comparison-answer h1, .comparison-answer h2, .comparison-answer h3 { font-size: 14px; }.comparison-answer table { width: 100%; font-size: 10px; }
.comparison-card .evidence-bar { margin: 0 12px 10px; }
.comparison-pick { width: calc(100% - 24px); margin: 0 12px 12px; padding: 9px; border: 1px solid #b9c8f2; border-radius: 10px; background: #f1f5ff; color: var(--blue); cursor: pointer; font-weight: 800; }
.comparison-card.failed { opacity: .7; }
.output-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-bottom: 20px; }
.output-choice { min-width: 0; cursor: pointer; }.output-choice input { position: absolute; opacity: 0; }
.output-choice-card { min-height: 135px; display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.output-choice-card b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #edf2ff; color: var(--blue); }
.output-choice-card strong { margin-top: 14px; font-size: 12px; }.output-choice-card small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.output-choice input:checked + .output-choice-card { border-color: var(--blue); background: #f4f7ff; box-shadow: 0 0 0 3px rgba(49,94,251,.1); }
.pack-preview { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfe; }
.pack-preview p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }.pack-prompt-list { margin: 18px 0; }.pack-prompt-list ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.guide-warning { margin-bottom: 8px; padding: 9px 11px; border-radius: 10px; background: #fff5e8; color: #8a5a16; font-size: 11px; }
.guide-recommendation { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 11px; border: 1px solid #dce4f8; border-radius: 12px; background: #f5f8ff; }.guide-recommendation strong { font-size: 12px; }.guide-recommendation span { color: var(--muted); font-size: 10px; text-align: right; }
.insight-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 24px; }
.public-insight-cards { grid-template-columns: repeat(3, minmax(0,1fr)); }
.insight-cards article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfe; }.insight-cards small, .insight-cards strong { display: block; }.insight-cards small { color: var(--muted); font-size: 10px; }.insight-cards strong { margin-top: 9px; font: 800 20px Manrope, sans-serif; }
.insight-modal h3 { margin: 22px 0 8px; font: 800 13px Manrope, sans-serif; }.table-scroll { overflow-x: auto; }
.insight-table { width: 100%; border-collapse: collapse; font-size: 11px; }.insight-table th, .insight-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }.insight-table th { color: var(--muted); background: #fafbfe; }
.cost-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.source-excerpt-label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }.source-modal blockquote { margin: 10px 0 0; padding: 16px; border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; background: #f7f9ff; font-size: 13px; line-height: 1.65; }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }

@media (max-width: 1040px) {
  :root { --sidebar: 245px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .assistant-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pack-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar-tool strong { display: none; }
  .comparison-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { overflow: hidden; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-form-side { padding: 25px; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(294px, 88vw); z-index: 30; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .workspace.sidebar-open .sidebar { transform: translateX(0); }
  .workspace.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(18,27,48,.32); }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 14px; height: 62px; flex-basis: 62px; }
  .topbar-title p { display: none; }
  .export-button strong { display: none; }
  .export-button { padding: 6px; }
  .topbar-actions { gap: 4px; }.topbar-tool { width: 34px; padding: 0; justify-content: center; }
  .welcome, .chat { width: min(100% - 28px, 900px); }
  .welcome { padding-top: 42px; }
  .welcome h2 { font-size: 34px; }
  .quick-grid, .assistant-grid { grid-template-columns: 1fr 1fr; }
  .quick-card { min-height: 130px; }
  .composer-wrap { padding-inline: 10px; padding-bottom: 10px; }
  .composer-note { display: none; }
  .composer-model-button > span:nth-child(2) { max-width: 104px; }
  .avatar-choice-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .assistant-choice-footer { align-items: stretch; flex-direction: column-reverse; }
  .assistant-management-actions, .assistant-chat-actions { flex-wrap: wrap; }
  .arena-model-list, .output-choice-grid, .insight-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 470px) {
  .quick-grid, .assistant-grid { grid-template-columns: 1fr; }
  .pack-grid, .arena-model-list, .output-choice-grid, .insight-cards { grid-template-columns: 1fr; }
  .quick-grid { gap: 8px; }.quick-card { min-height: 105px; }
  .quick-card strong { margin-top: 12px; }
  .topbar-title { display: none; }
  .message { grid-template-columns: 29px minmax(0,1fr); gap: 10px; }
  .message-avatar { width: 29px; height: 29px; border-radius: 9px; }
  .composer-model-button > span:nth-child(2) { display: none; }
  .composer-model-button { padding-right: 6px; }
  .composer-model-menu { left: -82px; width: min(360px, calc(100vw - 26px)); }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .avatar-choice-card img { width: 62px; height: 62px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { max-height: 94vh; border-radius: 20px 20px 0 0; }
}
