@import "./vendor/bigid-ui/styles.css";

:root {
  color-scheme: light;
  --search-ink: #242a31;
  --search-muted: #66717d;
  --search-line: #e1e5e9;
  --search-panel: #f7f8fa;
  --search-primary: #2463a8;
  font-family: Mulish, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--search-ink);
  background: #fff;
}

* { box-sizing: border-box; }
html, body, #root { width: 100%; min-width: 320px; min-height: 100%; height: 100%; margin: 0; }
body { background: #fff; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.load-error { margin: 0; min-height: 100%; display: grid; place-items: center; color: var(--search-muted); }

.login-screen { min-height: 100%; display: grid; place-items: center; padding: 24px; background: #f8f9fb; }
.login-card { width: min(100%, 480px); padding: 24px; border: 1px solid var(--search-line); border-radius: 12px; background: #fff; }
.login-brand { margin: 0 0 24px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.login-brand span { margin-left: 8px; color: var(--search-muted); font-weight: 500; }

.chat-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); width: 100%; height: 100dvh; min-height: 540px; overflow: hidden; background: #fff; }
.chat-sidebar { z-index: 2; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 16px 12px; border-right: 1px solid var(--search-line); background: var(--search-panel); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; font-size: 14px; font-weight: 700; }
.brand-mark { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: var(--search-primary); color: #fff; font-size: 18px; font-weight: 800; }
.new-chat-button, .toolbar-new-chat, .sign-out-button, .mobile-menu-button { border: 1px solid var(--search-line); border-radius: 8px; background: #fff; color: var(--search-ink); }
.new-chat-button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; text-align: left; font-size: 13px; font-weight: 600; }
.new-chat-button:hover, .toolbar-new-chat:hover, .sign-out-button:hover, .mobile-menu-button:hover { background: #eef1f4; }
.sidebar-section { padding-top: 8px; }
.sidebar-section h2 { margin: 0 8px 8px; color: var(--search-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.source-toggle { min-height: 36px; padding: 5px 8px; border-radius: 6px; }
.source-toggle:hover { background: #eceff2; }
.sidebar-empty { margin: 8px; color: var(--search-muted); font-size: 12px; }
.result-limit { display: grid; gap: 6px; margin: 0 8px; color: var(--search-muted); font-size: 12px; font-weight: 600; }
.result-limit select { width: 100%; padding: 7px 8px; border: 1px solid var(--search-line); border-radius: 7px; background: #fff; color: var(--search-ink); }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--search-line); color: var(--search-muted); font-size: 12px; }
.signed-in-dot { width: 8px; height: 8px; border-radius: 50%; background: #29936d; }
.sign-out-button { margin-left: auto; padding: 6px 8px; font-size: 12px; }

.chat-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: #fff; }
.chat-toolbar { display: flex; align-items: center; min-height: 56px; gap: 12px; padding: 8px 20px; border-bottom: 1px solid var(--search-line); }
.chat-title { font-size: 14px; font-weight: 700; }
.toolbar-new-chat { margin-left: auto; padding: 7px 10px; font-size: 12px; }
.mobile-menu-button { display: none; width: 34px; height: 34px; padding: 0; font-size: 18px; }
.chat-thread { display: flex; flex: 1; min-height: 0; justify-content: center; overflow-y: auto; padding: 20px 24px 8px; }
.chat-thread > * { width: min(100%, 820px); min-height: 100%; }
.empty-chat { display: grid; min-height: min(55vh, 460px); place-items: center; color: var(--search-muted); font-size: 17px; font-weight: 600; }
.chat-composer-wrap { z-index: 1; display: grid; justify-items: center; padding: 8px 24px 20px; background: linear-gradient(#fff0, #fff 18%); }
.chat-composer-wrap > * { width: min(100%, 820px); }
.chat-notice { margin: 4px auto 8px; color: var(--search-muted); font-size: 12px; }
.error-notice { color: #a33c38; }
.sidebar-scrim { display: none; }

@media (max-width: 760px) {
  .chat-shell { grid-template-columns: minmax(0, 1fr); }
  .chat-sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-102%); transition: transform .18s ease; box-shadow: 12px 0 30px #0002; }
  .sidebar-open .chat-sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-scrim { position: fixed; z-index: 1; inset: 0; display: block; border: 0; background: #10182066; }
  .mobile-menu-button { display: block; }
  .chat-toolbar { padding: 8px 12px; }
  .chat-thread { padding: 14px 12px 6px; }
  .chat-composer-wrap { padding: 6px 10px 12px; }
}

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