:root {
  color-scheme: light;
  --bg: #fbfcfa;
  --surface: #fff;
  --sidebar: #f1f3ef;
  --text: #202b25;
  --muted: #7b837b;
  --line: #e2e7df;
  --green: #2c4a3b;
  --green-soft: #e8eee6;
  --danger: #8d3c2d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #a1b4a6; }
a { color: var(--green); }
[hidden] { display: none !important; }
.initial-loading { display: grid; min-height: 100dvh; place-content: center; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 650; letter-spacing: -.7px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: white; background: var(--green); border-radius: 8px; }
.brand-mark .icon { width: 16px; height: 16px; }
.workspace { display: flex; height: 100dvh; overflow: hidden; }
.sidebar { width: 256px; flex: 0 0 256px; padding: 26px 17px 16px; background: var(--sidebar); display: flex; flex-direction: column; border-right: 1px solid #e9ede6; }
.sidebar .brand { margin: 0 10px 34px; }
.new-research { display: flex; align-items: center; gap: 10px; padding: 12px 13px; width: 100%; border: 1px solid #d6ddd2; border-radius: 8px; background: #f9fbf6; font-weight: 550; color: var(--green); text-align: left; }
.new-research:hover { background: var(--surface); }
.history { overflow: auto; flex: 1; margin-top: 27px; scrollbar-width: thin; }
.history-label { display: block; color: #8a9288; font-size: 11px; font-weight: 550; margin: 0 12px 9px; }
.history-label:not(:first-child) { margin-top: 24px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: transparent; padding: 10px 12px; border-radius: 6px; color: #566050; font-size: 13px; text-align: left; margin: 2px 0; }
.history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item:hover { background: #e8ede3; }
.history-item.active { background: #e2e9dc; color: #273e2b; font-weight: 550; }
.history-empty { padding: 3px 12px; font-size: 12px; line-height: 1.7; color: #92998d; max-width: 190px; }
.sidebar-foot { position: relative; padding-top: 18px; }
.user-button { border: 0; background: transparent; width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.user-button:hover { background: #e6ece1; }
.avatar { display: grid; place-items: center; background: #e0e6d9; color: #526148; border-radius: 50%; font-size: 11px; font-weight: 600; width: 32px; height: 32px; flex: 0 0 auto; }
.user-info { flex: 1; min-width: 0; }
.user-info strong, .user-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info strong { font-size: 12px; font-weight: 550; }
.user-info small { font-size: 10px; color: #87907f; margin-top: 3px; }
.account-menu { position: absolute; bottom: 70px; left: 0; right: 0; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 6px; box-shadow: 0 10px 25px #243b2210; z-index: 10; }
.account-menu button { display: block; width: 100%; padding: 11px 10px; border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--text); font-size: 12px; }
.account-menu button:hover { background: var(--sidebar); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar { min-height: 78px; display: flex; justify-content: space-between; align-items: center; padding: 0 37px; flex-shrink: 0; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: #4f5b50; font-weight: 500; }
.breadcrumb .slash { color: #c5ccc0; }
.source-label { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #869080; }
.source-label .dot { background: #779467; width: 5px; height: 5px; border-radius: 50%; }
.mobile-toggle { display: none; background: transparent; border: 0; color: var(--text); padding: 7px; }
.scroll-area { flex: 1; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: thin; }
.welcome { max-width: 720px; margin: max(50px, calc(20dvh - 50px)) auto 45px; padding: 0 34px; }
.eyebrow { font-size: 10px; font-weight: 550; text-transform: uppercase; letter-spacing: 2px; color: #8b9987; margin-bottom: 24px; }
.welcome h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3vw, 40px); font-weight: 400; letter-spacing: -1.2px; line-height: 1.23; margin: 0 0 15px; color: #2c3c30; }
.welcome p { font-size: 13px; color: #8b9388; line-height: 1.7; margin: 0; }
.company-search { margin-top: 34px; position: relative; }
.search-box { display: flex; gap: 12px; align-items: center; border: 1px solid #dde4d7; background: white; border-radius: 10px; padding: 17px 18px; box-shadow: 0 2px 5px #31432a03; }
.search-box:focus-within { border-color: #aabda7; box-shadow: 0 0 0 3px #537c4710; }
.search-box .icon { color: #859580; }
.search-box input { border: 0; background: transparent; color: var(--text); flex: 1; min-width: 0; font-size: 13px; padding: 0; }
.search-box input::placeholder { color: #a1a99c; }
.key-hint { border: 1px solid #e5e9e1; border-radius: 4px; font-size: 10px; color: #a1aa9a; padding: 2px 5px; }
.search-results { border: 1px solid var(--line); background: white; border-radius: 9px; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; padding: 5px; box-shadow: 0 10px 35px #263e2210; }
.company-option { display: flex; justify-content: space-between; align-items: center; width: 100%; background: transparent; border: 0; border-radius: 5px; color: var(--text); text-align: left; gap: 15px; padding: 12px; }
.company-option:hover { background: var(--sidebar); }
.company-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.company-option small { color: var(--muted); font-size: 10px; flex-shrink: 0; }
.search-note { color: var(--muted); font-size: 12px; padding: 13px; line-height: 1.6; }
.prompt-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.prompt-examples button { background: transparent; border: 1px solid #e3e8dd; border-radius: 6px; font-size: 11px; padding: 8px 11px; color: #7b8b70; }
.prompt-examples button:hover { background: #eef3e9; border-color: #ccd9c2; }
.welcome-rule { width: 30px; height: 1px; background: #dbe3d4; margin: 36px 0 14px; }
.welcome .quiet { font-size: 11px; color: #a0a89a; }
.conversation { width: 100%; max-width: 800px; margin: 0 auto; padding: 24px 34px 42px; }
.message { margin-bottom: 36px; }
.message.user { display: flex; justify-content: flex-end; }
.user-content { background: #eef2e9; border-radius: 12px 12px 3px 12px; padding: 13px 18px; max-width: 85%; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-heading { display: flex; align-items: center; gap: 8px; color: #516b48; font-size: 11px; font-weight: 550; margin-bottom: 15px; }
.assistant-heading .brand-mark { width: 19px; height: 19px; border-radius: 5px; }
.assistant-heading .brand-mark .icon { width: 10px; height: 10px; }
.message-content { font-size: 14px; line-height: 1.85; color: #3b463d; overflow-wrap: anywhere; }
.message-content p { margin: 0 0 16px; }
.message-content h1, .message-content h2, .message-content h3 { line-height: 1.45; color: #293a2d; margin: 25px 0 12px; letter-spacing: -.25px; }
.message-content h1 { font-size: 22px; }
.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 15px; }
.message-content h1:first-child, .message-content h2:first-child, .message-content h3:first-child { margin-top: 0; }
.message-content ul, .message-content ol { padding-left: 23px; margin: 10px 0 18px; }
.message-content li { padding-left: 4px; margin-bottom: 8px; }
.message-content strong { font-weight: 600; color: #293c2d; }
.message-content code { font-size: 12px; background: #eef2e9; padding: 2px 4px; border-radius: 3px; }
.message-content pre { white-space: pre-wrap; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--sidebar); }
.message-content blockquote { padding-left: 17px; border-left: 2px solid #bacbb0; margin: 15px 0; color: #6a7565; }
.citation { display: inline-block; font-size: 10px; text-decoration: none; font-weight: 650; color: #537449; background: #eaf0e3; border-radius: 4px; padding: 0 4px; line-height: 17px; margin-left: 2px; vertical-align: super; }
.citation:hover { background: #dce8d1; }
.table-wrap { overflow-x: auto; margin: 18px 0; }
.message-content table { border-collapse: collapse; width: 100%; font-size: 12px; white-space: normal; }
.message-content th { text-align: left; color: #4c6244; font-weight: 600; background: #f1f5ed; }
.message-content td, .message-content th { border-bottom: 1px solid var(--line); padding: 9px 12px; }
.sources { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 17px; }
.sources summary { color: #819276; font-size: 11px; cursor: pointer; }
.source-item { display: flex; align-items: baseline; gap: 10px; margin-top: 11px; font-size: 11px; line-height: 1.5; }
.source-item span { color: #8ea180; font-size: 10px; }
.source-item a { color: #6c8260; text-decoration: none; }
.source-item a:hover { text-decoration: underline; }
.stream-status { display: flex; align-items: center; gap: 8px; color: #8b9b82; font-size: 11px; margin: 14px 0; min-height: 18px; }
.stream-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #809e6e; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.message-error { color: var(--danger); font-size: 12px; line-height: 1.7; margin-top: 15px; }
.composer-region { max-width: 800px; width: 100%; margin: 0 auto; padding: 8px 34px 18px; flex-shrink: 0; background: var(--bg); }
.composer { background: white; border: 1px solid #dce3d7; border-radius: 12px; box-shadow: 0 3px 15px #31432704; padding: 14px 15px 10px; }
.composer:focus-within { border-color: #a7baa0; }
.composer textarea { display: block; width: 100%; min-height: 30px; max-height: 180px; resize: none; padding: 0; border: 0; background: transparent; color: var(--text); line-height: 1.6; font-size: 13px; }
.composer textarea::placeholder { color: #a3ac9d; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.composer-note { font-size: 10px; color: #9da895; display: flex; align-items: center; gap: 6px; }
.composer-note .icon { width: 12px; height: 12px; }
.send-button { width: 30px; height: 30px; background: var(--green); color: white; display: grid; place-items: center; border: 0; border-radius: 7px; }
.send-button .icon { width: 15px; height: 15px; }
.composer-caption { text-align: center; font-size: 9px; color: #a3ac9c; margin: 10px 0 0; line-height: 1.5; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 32px 20px; }
.auth-panel { width: 100%; max-width: 365px; }
.auth-panel .brand { margin-bottom: 55px; }
.auth-panel h1 { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.7px; font-size: 29px; margin: 0 0 12px; }
.auth-panel p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 0 28px; }
.field { display: block; margin-bottom: 17px; font-size: 11px; color: #75816e; }
.field input, .field select, .field textarea { display: block; width: 100%; padding: 12px 13px; border: 1px solid #dce3d6; border-radius: 6px; color: var(--text); background: white; margin-top: 7px; font-size: 13px; }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
.field input:disabled { background: #f1f4ed; color: #89957f; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
.primary-button { padding: 12px 16px; border: 0; border-radius: 6px; background: var(--green); color: white; font-size: 12px; font-weight: 550; }
.auth-panel .primary-button { width: 100%; margin-top: 7px; }
.secondary-button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #64775c; font-size: 12px; }
.text-button { background: transparent; border: 0; color: #7b8d6f; font-size: 11px; padding: 0; }
.auth-footer { margin-top: 30px; color: #9ca792; font-size: 10px; text-align: center; }
.form-error { color: var(--danger); font-size: 12px; line-height: 1.7; margin: 14px 0; }
.form-success { color: #5e7c4f; font-size: 12px; margin: 13px 0; }
.modal-backdrop { display: grid; place-items: center; position: fixed; inset: 0; background: #22331f30; backdrop-filter: blur(3px); padding: 20px; z-index: 30; }
.modal { background: var(--bg); width: 100%; max-width: 490px; padding: 30px; border: 1px solid #e2e9dc; border-radius: 13px; box-shadow: 0 20px 70px #23361d20; max-height: 85dvh; overflow: auto; }
.modal.wide { max-width: 710px; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-heading h2 { font-family: Georgia, serif; font-size: 22px; font-weight: 400; margin: 0; letter-spacing: -.5px; }
.close-button { display: grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 5px; background: transparent; color: #8b9982; }
.close-button:hover { background: var(--sidebar); }
.modal p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.capacity-number { font-size: 30px; font-family: Georgia, serif; color: #405a36; margin: 24px 0 8px; }
.capacity-number span { color: #9cac92; font-size: 18px; }
.capacity-bar { width: 100%; height: 4px; border: 0; border-radius: 4px; background: #e4ebdd; overflow: hidden; appearance: none; }
.capacity-bar::-webkit-progress-bar { background: #e4ebdd; }
.capacity-bar::-webkit-progress-value { background: #8ba87a; }
.capacity-bar::-moz-progress-bar { background: #8ba87a; }
.capacity-fill { height: 100%; background: #8ba87a; }
.detail-list { margin: 25px 0; }
.detail-list div { display: flex; justify-content: space-between; font-size: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 15px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 500; }
.admin-table th, .admin-table td { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.admin-table td small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.section-label { font-size: 11px; color: #7d9271; margin-top: 25px; font-weight: 550; }
.drawer-backdrop { display: none; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 40px); border: 1px solid #d9e2d1; border-radius: 8px; padding: 12px 18px; background: #fff; color: #5c7451; font-size: 12px; box-shadow: 0 5px 20px #293d2110; z-index: 50; }
.copy-answer { display: flex; align-items: center; gap: 5px; margin-top: 15px; background: transparent; border: 0; padding: 4px 0; color: #9aab8e; font-size: 10px; }
.copy-answer .icon { width: 12px; height: 12px; }

@media (min-width: 1800px) { .topbar { padding: 0 50px; } }
@media (max-width: 1024px) { .sidebar { width: 230px; flex-basis: 230px; } .topbar { padding: 0 26px; } .welcome { padding: 0 28px; } }
@media (max-width: 700px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 25; transform: translateX(-100%); transition: transform .2s; }
  .workspace.drawer-open .sidebar { transform: translateX(0); }
  .workspace.drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; background: #23362040; z-index: 24; }
  .mobile-toggle { display: grid; place-items: center; }
  .topbar { min-height: 61px; padding: 0 16px; gap: 10px; }
  .breadcrumb { flex: 1; min-width: 0; font-size: 11px; overflow: hidden; }
  .breadcrumb strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .breadcrumb > span:first-child, .breadcrumb .slash { display: none; }
  .source-label { font-size: 9px; }
  .welcome { margin-top: max(50px, calc(15dvh - 20px)); padding: 0 25px; }
  .welcome h1 { font-size: 32px; max-width: 320px; }
  .eyebrow { font-size: 9px; margin-bottom: 19px; }
  .company-search { margin-top: 27px; }
  .search-box { padding: 15px; }
  .key-hint { display: none; }
  .prompt-examples { gap: 7px; }
  .prompt-examples button { font-size: 10px; }
  .conversation { padding: 20px 21px 30px; }
  .message { margin-bottom: 30px; }
  .message-content { font-size: 13px; }
  .user-content { font-size: 13px; max-width: 92%; }
  .composer-region { padding: 5px 15px max(13px, env(safe-area-inset-bottom)); }
  .composer-caption { font-size: 8px; margin-top: 8px; }
  .modal { padding: 23px; }
  .auth-panel .brand { margin-bottom: 43px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
