:root {
  color: #1a1a1a;
  background: #ffffff;
  font-family: 'Plus Jakarta Sans', 'Avenir Next', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #ffffff;
  color: #1a1a1a;
}

a,
button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

textarea {
  resize: none;
}

::selection {
  background: #d0d0d0;
}

.page {
  min-height: 100vh;
}

.app-frame {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.app-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar {
  width: 272px;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #ececec;
  background: #fafafa;
  transition:
    width 0.2s ease,
    flex-basis 0.2s ease;
}

.sidebar.is-collapsed {
  width: 64px;
  flex-basis: 64px;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 16px 16px 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.brand-mark {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: #1a1a1a;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark span {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #fff;
}
.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.sidebar-toggle,
.mobile-menu-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: #888;
  flex: none;
}
.sidebar-toggle:hover,
.mobile-menu-button:hover {
  background: #eee;
  color: #222;
}
.sidebar-primary {
  padding: 4px 12px 12px;
}
.new-chat-button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 39px;
  padding: 0 12px;
  border: 1px solid #e2e2e2;
  border-radius: 9px;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.new-chat-button:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}
.sidebar-tools {
  padding: 0 12px 10px;
}
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f0f0f0;
  color: #8f8f8f;
}
.sidebar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #333;
  font-size: 12.5px;
}
.sidebar-chats {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 12px;
}
.sidebar-section-label {
  padding: 10px 8px 5px;
  color: #999;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 1px 0;
  padding: 9px 10px;
  border-radius: 8px;
}
.sidebar-chat:hover,
.sidebar-chat.is-active {
  background: #fff;
}
.sidebar-chat.is-active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.sidebar-chat-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4d4d4d;
  font-size: 12.5px;
}
.sidebar-chat.is-active .sidebar-chat-title {
  color: #111;
  font-weight: 600;
}
.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #bbb;
}
.status-dot.status-accepted {
  background: #1a1a1a;
}
.status-dot.status-active {
  background: #bbb;
}
.sidebar-empty,
.sidebar-no-results {
  padding: 18px 10px;
  color: #aaa;
  text-align: center;
  font-size: 12px;
}
.sidebar-no-results {
  display: none;
}
.sidebar-no-results.is-visible {
  display: block;
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px 14px;
  border-top: 1px solid #ececec;
}
.account-avatar,
.topbar-avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.account-avatar {
  width: 27px;
  height: 27px;
}
.account-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4d4d4d;
  font-size: 12px;
}
.sidebar.is-collapsed .brand,
.sidebar.is-collapsed .sidebar-tools,
.sidebar.is-collapsed .sidebar-section-label,
.sidebar.is-collapsed .sidebar-chat-title,
.sidebar.is-collapsed .account-label {
  display: none;
}
.sidebar.is-collapsed .sidebar-head {
  justify-content: center;
  padding-inline: 0;
}
.sidebar.is-collapsed .sidebar-primary {
  padding-inline: 12px;
}
.sidebar.is-collapsed .new-chat-button {
  justify-content: center;
  padding: 0;
}
.sidebar.is-collapsed .new-chat-button span {
  display: none;
}
.sidebar.is-collapsed .sidebar-chat {
  justify-content: center;
  padding-inline: 0;
}
.sidebar.is-collapsed .sidebar-account {
  justify-content: center;
  padding-inline: 0;
}

.topbar {
  min-height: 63px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid #ececec;
  background: #fff;
}
.topbar-title-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .header-title {
  font-size: 14px;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  padding: 3px 9px;
  color: #8a8a8a;
  font-size: 11px;
}
.topbar-avatar {
  width: 25px;
  height: 25px;
}
.mobile-menu-button {
  display: none;
}
.sidebar-scrim {
  display: none;
}

.shell {
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 63px);
  flex: 1;
  width: 100%;
  max-width: 720px;
  flex-direction: column;
  padding: 0 24px;
}

/* Chrome-less full-screen layout (mandatory onboarding). No topbar, so the
   shell fills the full viewport height and centers its content. */
.app-main-bare {
  align-items: center;
}
.app-main-bare .shell {
  min-height: 100vh;
  justify-content: center;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  font-size: 13px;
  color: #8a8a8a;
}

.topbar .header-nav {
  font-size: 13px;
  color: #8a8a8a;
}

.header-title {
  min-width: 0;
  flex: 1;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.header-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header a:hover,
.header button:hover {
  color: #1a1a1a;
}

.viewer-pill {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 120px;
}

.hero-title {
  margin: 0 0 28px;
  text-align: center;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-card {
  display: flex;
  width: 100%;
  max-width: 420px;
  flex-direction: column;
  align-items: center;
}

.auth-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.google-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  padding: 13px 18px;
  background: #ffffff;
  font-size: 14px;
}

.google-button:hover {
  border-color: #d6d6d6;
  background: #fafafa;
}

.google-mark {
  display: inline-flex;
  height: 22px;
  width: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 13px;
  font-weight: 600;
}

.main-chat {
  flex: 1;
  padding: 12px 0 24px;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 24px;
}

.composer-wrap {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding: 12px 0 24px;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  border: 1px solid #ececec;
  border-radius: 28px;
  padding: 8px 8px 8px 22px;
  background: #ffffff;
  box-shadow:
    0 6px 24px rgba(15, 15, 15, 0.06),
    0 1px 3px rgba(15, 15, 15, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.composer:focus-within {
  border-color: #dedede;
  box-shadow:
    0 8px 30px rgba(15, 15, 15, 0.1),
    0 1px 3px rgba(15, 15, 15, 0.05);
}

.composer textarea {
  flex: 1;
  min-height: 28px;
  max-height: 200px;
  padding: 7px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.5;
  overflow-y: auto;
}

.composer textarea::placeholder {
  color: #9a9a9a;
}

.send-button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #ffffff;
  transition:
    background-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.1s ease;
}

.send-button:hover {
  background: #000000;
}

.send-button:active {
  transform: scale(0.94);
}

.send-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.send-button svg {
  display: block;
}

.composer-mic {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #444444;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.composer-mic:hover {
  background: #e6e6e6;
}

.composer-mic:active {
  transform: scale(0.94);
}

.composer-mic svg {
  display: block;
}

.composer-mic.is-listening {
  background: #e5484d;
  color: #ffffff;
  animation: mic-pulse 1.4s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(229, 72, 77, 0);
  }
}

.message-row {
  display: flex;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.user-bubble {
  max-width: 80%;
  border-radius: 16px;
  background: #f0f0f0;
  padding: 10px 16px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.5;
}

.assistant-bubble {
  max-width: 100%;
  font-size: 15px;
  line-height: 1.7;
}

.assistant-bubble p:first-child,
.assistant-bubble h1:first-child,
.assistant-bubble h2:first-child,
.assistant-bubble h3:first-child,
.assistant-bubble h4:first-child,
.assistant-bubble ul:first-child,
.assistant-bubble ol:first-child,
.assistant-bubble blockquote:first-child,
.assistant-bubble pre:first-child {
  margin-top: 0;
}

.assistant-bubble p:last-child,
.assistant-bubble h1:last-child,
.assistant-bubble h2:last-child,
.assistant-bubble h3:last-child,
.assistant-bubble h4:last-child,
.assistant-bubble ul:last-child,
.assistant-bubble ol:last-child,
.assistant-bubble blockquote:last-child,
.assistant-bubble pre:last-child {
  margin-bottom: 0;
}

.assistant-bubble h1,
.assistant-bubble h2,
.assistant-bubble h3,
.assistant-bubble h4 {
  margin: 0 0 10px;
  font-weight: 600;
}

.assistant-bubble h1,
.assistant-bubble h2 {
  font-size: 17px;
}

.assistant-bubble h3,
.assistant-bubble h4 {
  font-size: 15px;
}

.assistant-bubble p {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.intent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.intent-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 100%;
  border: 1px solid #dedede;
  border-radius: 8px;
  padding: 7px 11px;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1.25;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    transform 0.1s ease;
}

.intent-action:hover {
  border-color: #a8a8a8;
  background: #f7f7f7;
}

.intent-action:active {
  transform: translateY(1px);
}

.intent-action:disabled {
  cursor: default;
  opacity: 0.55;
}

.intent-actions.is-disabled {
  pointer-events: none;
}

.assistant-bubble ul,
.assistant-bubble ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.assistant-bubble li {
  margin-bottom: 4px;
}

.assistant-bubble blockquote {
  margin: 0 0 12px;
  border-left: 2px solid #dcdcdc;
  padding-left: 12px;
  color: #6a6a6a;
}

.assistant-bubble pre {
  overflow-x: auto;
  border-radius: 8px;
  background: #f6f6f6;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.assistant-bubble code {
  font-family: 'SFMono-Regular', 'SF Mono', Menlo, monospace;
}

.assistant-bubble hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid #e5e5e5;
}

.assistant-bubble table {
  min-width: 100%;
  border-collapse: collapse;
}

.assistant-bubble th,
.assistant-bubble td {
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.assistant-bubble th {
  color: #6a6a6a;
  font-size: 13px;
  font-weight: 500;
}

.streaming {
  white-space: pre-wrap;
}

.thinking {
  color: #8a8a8a;
}

.history-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.history-empty {
  padding: 32px 0;
  color: #8a8a8a;
  font-size: 15px;
}

.history-list {
  display: flex;
  flex-direction: column;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 12px 10px;
}

.history-row:hover {
  background: #f5f5f5;
}

.history-icon {
  flex-shrink: 0;
}

.history-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.history-meta {
  flex-shrink: 0;
  color: #a0a0a0;
  font-size: 13px;
}

@media (max-width: 640px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 272px !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.08);
  }
  .sidebar.is-collapsed {
    flex-basis: 272px;
  }
  .sidebar.is-collapsed .brand {
    display: flex;
  }
  .sidebar.is-collapsed .sidebar-tools,
  .sidebar.is-collapsed .sidebar-section-label,
  .sidebar.is-collapsed .sidebar-chat-title,
  .sidebar.is-collapsed .account-label {
    display: flex;
  }
  .sidebar.is-collapsed .sidebar-head {
    justify-content: space-between;
    padding: 16px 16px 10px;
  }
  .sidebar.is-collapsed .new-chat-button {
    justify-content: flex-start;
    padding: 0 12px;
  }
  .sidebar.is-collapsed .new-chat-button span {
    display: inline;
  }
  .sidebar.is-collapsed .sidebar-chat {
    justify-content: flex-start;
    padding: 9px 10px;
  }
  .sidebar.is-collapsed .sidebar-account {
    justify-content: flex-start;
    padding: 10px 14px;
  }
  .mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.24);
  }
  .mobile-sidebar-open .sidebar-scrim {
    display: block;
  }
  .mobile-menu-button {
    display: grid;
  }
  .topbar {
    min-height: 57px;
    padding: 0 16px;
  }
  .topbar-status,
  .viewer-pill,
  .topbar-avatar {
    display: none;
  }
  .shell {
    min-height: calc(100vh - 57px);
  }
  .shell {
    padding: 0 18px;
  }

  .header {
    justify-content: space-between;
    gap: 12px;
  }

  .header-nav {
    gap: 12px;
  }

  .header-group {
    gap: 12px;
  }

  .viewer-pill {
    max-width: 140px;
  }

  .hero-title {
    font-size: 24px;
  }

  .composer {
    padding: 8px 8px 8px 16px;
  }
}

.sidebar-account {
  text-decoration: none;
}
.sidebar-account:hover {
  background: #f0f0f0;
}
.sidebar-voice-link { margin: 0 12px 6px; padding: 8px 10px; border-radius: 8px; color: #555; font-size: 12px; text-decoration: none; }
.sidebar-voice-link:hover { background: #f0f0f0; }
.onboarding { position: relative; width: min(720px, 100%); margin: 0 auto; padding: 44px 24px 70px; }
.onboarding-overlay { display: none; position: absolute; inset: 0; z-index: 5; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; background: rgba(255, 255, 255, .92); border-radius: 16px; }
.onboarding-overlay p { margin: 0; font-size: 18px; font-weight: 600; }
.onboarding-overlay span { color: #737373; font-size: 13px; }
.onboarding-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #e5e5e5; border-top-color: #171717; animation: onboarding-spin .8s linear infinite; }
@keyframes onboarding-spin { to { transform: rotate(360deg); } }
.onboarding.is-processing .onboarding-overlay { display: flex; }
.onboarding.is-processing > *:not(.onboarding-overlay) { opacity: .3; pointer-events: none; }
.onboarding-intro h1 { margin: 4px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.onboarding-intro p { color: #737373; line-height: 1.55; }
.eyebrow { margin: 0; text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.coverage-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0; }
.coverage-list span { color: #aaa; font-size: 13px; transition: color .2s; }
.coverage-list span.is-covered { color: #16803b; font-weight: 600; }
.onboarding-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.profile-input-wrap { position: relative; }
.profile-input-wrap textarea, .example-row textarea { box-sizing: border-box; width: 100%; resize: vertical; border: 1px solid #ddd; border-radius: 12px; padding: 14px; font: inherit; line-height: 1.5; }
.profile-input-wrap textarea:focus, .example-row textarea:focus { outline: none; border-color: #777; }
.mic-button { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ddd; background: white; color: #777; cursor: pointer; }
.mic-button.is-listening { color: #d33; box-shadow: 0 0 0 4px #fee; }
.examples-head { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.examples-head p { margin: 2px 0; color: #999; font-size: 12px; }
.examples-head button, .example-row button, .skip-form button { border: 0; background: transparent; color: #666; cursor: pointer; }
.example-row { margin-top: 12px; }
.example-row button { padding: 5px 0; font-size: 12px; }
.onboarding-actions { margin-top: 26px; }
.continue-button { width: 100%; padding: 12px 18px; border: 0; border-radius: 10px; background: #171717; color: white; font-weight: 600; cursor: pointer; }
.skip-form { text-align: center; margin-top: 12px; }

.settings-form {
  max-width: 440px;
  padding: 8px 0;
}
.settings-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}
.settings-hint {
  margin: 4px 0 12px;
  font-size: 12.5px;
  color: #8a8a8a;
}
.settings-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e2e2e2;
  border-radius: 9px;
  background: #fff;
  color: #1a1a1a;
  font-size: 13px;
}
.settings-input:focus {
  outline: none;
  border-color: #1a1a1a;
}
.settings-save {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #1a1a1a;
  border-radius: 9px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.settings-save:hover {
  background: #000;
}
