@font-face {
  font-family: "Inclusive Sans";
  src: url("/assets/fonts/InclusiveSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inclusive Sans";
  src: url("/assets/fonts/InclusiveSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inclusive Sans";
  src: url("/assets/fonts/InclusiveSans-SemiBold.ttf") format("truetype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Creolia";
  src: url("/assets/fonts/Creolia.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-top: #f8f8f6;
  --bg-bottom: #f2f2ee;
  --ink: #1f2328;
  --muted: #6f757c;
  --line: rgba(32, 35, 40, 0.10);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --accent: #181a1d;
  --accent-soft: rgba(24, 26, 29, 0.06);
  --success: #2e8a57;
  --danger: #b65050;
  --shadow: 0 18px 44px rgba(24, 28, 34, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inclusive Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), transparent 26%),
    radial-gradient(circle at top right, rgba(236, 236, 232, 0.72), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body[data-page="app"] {
  height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 92%);
  pointer-events: none;
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: 22px;
  padding: 24px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow);
}

.auth-panel-compact {
  grid-template-columns: 1fr;
  width: min(560px, 100%);
}

.auth-hero,
.auth-card {
  display: grid;
  gap: 18px;
}

.auth-card {
  align-content: start;
}

.brand-block-centered {
  padding: 0;
}

.hero-highlights-center {
  justify-content: flex-start;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.auth-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.auth-list span {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(100, 122, 148, 0.14);
}

.compact-card {
  padding: 18px;
}

.auth-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 20, 22, 0.18);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  z-index: 60;
}

.modal-panel {
  width: min(640px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 56px rgba(24, 28, 34, 0.12);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  margin: 0;
}

.modal-copy {
  color: var(--muted);
  line-height: 1.6;
}

.common-question-list {
  display: grid;
  gap: 12px;
}

.common-question-button {
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(24, 26, 29, 0.08);
  background: rgba(248, 248, 246, 0.96);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.common-question-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(24, 26, 29, 0.14);
}

.common-question-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.desktop-common-questions-modal {
  width: min(760px, 100%);
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  min-height: 100vh;
  padding: 24px;
}

body[data-page="app"] .shell {
  height: 100vh;
  min-height: 100vh;
}

.sidebar,
.hero-card,
.conversation-card,
.catalog-card {
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-xl);
  overflow: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.brand-block h1,
.hero-card h2,
.conversation-header h3,
.catalog-card h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-block h1,
.workspace-topbar-name,
.drawer-header h3,
.auth-page .hero-card h2 {
  font-family: "Creolia", "Inclusive Sans", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.sidebar-label {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 5px rgba(95, 108, 124, 0.12);
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(46, 138, 87, 0.14);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(182, 80, 80, 0.14);
}

.scope-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-status {
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.sidebar-frequent-button {
  width: 100%;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
}

.workspace {
  display: grid;
  gap: 22px;
  align-content: start;
  min-height: 0;
  min-width: 0;
}

body[data-page="app"] .workspace {
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
}

.hero-card,
.conversation-card,
.catalog-card {
  border-radius: var(--radius-xl);
}

.hero-card {
  padding: 26px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.56));
}

.hero-copy {
  max-width: 820px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.conversation-card {
  display: grid;
  gap: 18px;
  min-height: 540px;
  padding: 24px;
  overflow: hidden;
}

body[data-page="app"] .conversation-card {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.workspace-topbar-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.workspace-topbar-name {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: #2583ff;
}

.workspace-topbar-chevron {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(24, 26, 29, 0.32);
}

.workspace-topbar-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.workspace-topbar-spacer {
  margin-left: auto;
}

.topbar-quick-action {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(17, 19, 21, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(17, 19, 21, 0.08);
  color: #111315;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.topbar-quick-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(17, 19, 21, 0.1);
}

.topbar-quick-action svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: #111315;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle:hover {
  transform: translateY(-1px);
  opacity: 0.78;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  fill: none;
}

.conversation-header,
.card-header,
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conversation-header {
  padding-bottom: 6px;
}

.conversation-heading {
  display: grid;
  gap: 8px;
}

.conversation-meta,
.conversation-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.conversation-id-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(24, 26, 29, 0.05);
  border: 1px solid rgba(24, 26, 29, 0.08);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.messages {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 4px 8px 28px 4px;
  min-height: 320px;
  scroll-behavior: smooth;
}

body[data-page="app"] .messages {
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.message {
  max-width: min(760px, 100%);
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 14px 30px rgba(24, 28, 34, 0.06);
  animation: message-raise 260ms ease;
}

.message.user {
  justify-self: end;
  max-width: min(680px, 88%);
  background: linear-gradient(135deg, rgba(33, 36, 40, 0.96), rgba(54, 58, 64, 0.92));
  color: white;
  border-color: rgba(44, 48, 54, 0.28);
  box-shadow: 0 18px 34px rgba(24, 28, 34, 0.14);
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
  cursor: copy;
}

.message.assistant {
  justify-self: start;
  background: rgba(255, 255, 255, 0.9);
}

.message-stack {
  display: grid;
  gap: 14px;
}

.message.pending {
  opacity: 0.92;
}

.message.user.is-copy-armed {
  transform: scale(0.992);
  box-shadow: 0 12px 24px rgba(24, 28, 34, 0.18);
}

.message p {
  margin: 0;
  line-height: 1.68;
}

.message-text {
  white-space: pre-wrap;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.loading-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 48, 63, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
}

.message.user .loading-status {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(24, 26, 29, 0.16);
  border-top-color: rgba(24, 26, 29, 0.86);
  animation: loading-spin 0.8s linear infinite;
}

.message.user .loading-spinner {
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.96);
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translate(-50%, 14px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(21, 23, 26, 0.94);
  color: white;
  font-size: 0.92rem;
  line-height: 1;
  box-shadow: 0 16px 30px rgba(24, 28, 34, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.thinking-label {
  color: var(--ink);
  font-weight: 600;
}

.message-fragment {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.message-fragment.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.drawer-backdrop {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  place-items: normal;
  padding: 0;
}

.drawer-panel {
  width: min(380px, 88vw);
  max-width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 18px;
  margin: 0;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  border-radius: 0 28px 28px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 20px 0 40px rgba(24, 28, 34, 0.10);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  animation: drawer-slide-in 220ms ease;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h3 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.drawer-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.drawer-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drawer-icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 26, 29, 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.drawer-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.drawer-icon-button:hover {
  transform: translateY(-1px);
  background: rgba(24, 26, 29, 0.08);
}

.drawer-list-item {
  width: 100%;
  border: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  padding: 14px 16px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.drawer-copy-button {
  grid-template-columns: 26px minmax(0, 1fr);
}

.drawer-action-button:not(.drawer-disclosure-trigger) {
  grid-template-columns: 26px minmax(0, 1fr);
}

.drawer-list-item:hover,
.drawer-list-item.is-open {
  transform: translateY(-1px);
  background: rgba(24, 26, 29, 0.04);
  border-color: rgba(24, 26, 29, 0.06);
}

.drawer-item-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.drawer-item-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.drawer-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.drawer-item-title {
  font-size: 1.1rem;
  font-weight: 550;
  line-height: 1.2;
}

.drawer-item-subtitle {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.drawer-chevron {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(24, 26, 29, 0.46);
  transition: transform 180ms ease, color 180ms ease;
}

.drawer-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.drawer-disclosure-trigger.is-open .drawer-chevron {
  transform: rotate(90deg);
  color: var(--ink);
}

.drawer-sublist {
  display: grid;
  gap: 6px;
  padding: 4px 0 2px 40px;
}

.drawer-question-item {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.35;
  text-align: left;
  padding: 10px 4px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.drawer-question-item:hover {
  background: rgba(24, 26, 29, 0.04);
  transform: translateX(2px);
}

.drawer-question-item:disabled,
.drawer-list-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.drawer-meta {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(24, 26, 29, 0.08);
}

.drawer-meta-brand {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.drawer-meta-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(248, 233, 211, 0.92);
}

.drawer-meta-mark-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.drawer-meta-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.drawer-meta-eyebrow {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.drawer-meta-copy strong {
  font-family: "Creolia", "Inclusive Sans", sans-serif;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1;
}

.drawer-meta-status {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.drawer-meta-status .status-dot {
  width: 10px;
  height: 10px;
  margin-top: 3px;
  box-shadow: none;
}

.drawer-meta-status-text {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.drawer-footer {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(24, 26, 29, 0.08);
}

.drawer-user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(63, 187, 168, 0.96), rgba(29, 167, 144, 0.92));
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

.drawer-user-copy {
  display: grid;
  gap: 3px;
}

.drawer-user-copy strong {
  font-size: 1.05rem;
}

.drawer-user-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.message-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(100, 122, 148, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.message-section.assumptions {
  background: rgba(255, 244, 226, 0.88);
}

.message-section.insights {
  background: rgba(245, 247, 248, 0.96);
}

.message-section.suggestions {
  background: rgba(248, 250, 255, 0.84);
}

.message-section-title {
  font-size: 0.92rem;
}

.message-bullet-list {
  display: grid;
  gap: 9px;
}

.message-bullet-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  line-height: 1.55;
}

.message-bullet-dot {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(24, 26, 29, 0.08);
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-chip {
  border: 1px solid rgba(24, 26, 29, 0.1);
  background: rgba(24, 26, 29, 0.04);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  transition: transform 180ms ease, background 180ms ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  background: rgba(24, 26, 29, 0.07);
}

.suggestion-chip:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-shell {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(100, 122, 148, 0.18);
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.95), rgba(245, 247, 252, 0.78));
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-header strong {
  color: var(--ink);
  font-size: 1rem;
}

.chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-multi-line-path {
  stroke-width: 3;
}

.chart-line-point {
  fill: white;
  stroke: var(--accent);
  stroke-width: 3;
  cursor: pointer;
}

.chart-multi-line-point {
  stroke-width: 2.4;
}

.chart-grid-line {
  stroke: rgba(24, 26, 29, 0.08);
  stroke-width: 1;
}

.chart-point-value-label {
  fill: rgba(24, 26, 29, 0.82);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart-x-axis-label,
.chart-y-axis-label {
  fill: rgba(95, 104, 117, 0.88);
  font-size: 11px;
  font-weight: 500;
}

.chart-x-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
}

.chart-x-label {
  display: grid;
  gap: 3px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-x-label strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 144px;
  max-width: min(280px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(24, 26, 29, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(24, 26, 29, 0.14);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip-title {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.chart-tooltip-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-tooltip-row + .chart-tooltip-row {
  margin-top: 4px;
}

.chart-tooltip-row strong {
  color: var(--ink);
  font-weight: 700;
}

.chart-tooltip-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.stacked-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 14px;
  align-items: end;
}

.stacked-bar-column {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.stacked-bar-total {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.stacked-bar-track {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  max-width: 72px;
  min-height: 18px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(100, 122, 148, 0.08);
  box-shadow: inset 0 0 0 1px rgba(100, 122, 148, 0.08);
}

.stacked-bar-segment {
  width: 100%;
}

.stacked-bar-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.ranked-bars {
  display: grid;
  gap: 12px;
}

.ranked-bar-row {
  display: grid;
  gap: 8px;
}

.ranked-bar-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ranked-bar-copy strong {
  font-size: 0.92rem;
}

.ranked-bar-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.ranked-bar-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(100, 122, 148, 0.1);
}

.ranked-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(33, 36, 40, 0.88), rgba(90, 97, 106, 0.58));
}

.map-svg {
  border-radius: 24px;
}

.map-grid-line {
  stroke: rgba(34, 48, 63, 0.16);
  stroke-width: 1;
}

.interactive-map-frame {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(100, 122, 148, 0.18);
  background: linear-gradient(180deg, rgba(223, 235, 248, 0.9), rgba(246, 240, 233, 0.76));
}

.interactive-map-canvas {
  width: 100%;
  min-height: 440px;
  background: linear-gradient(180deg, rgba(223, 235, 248, 0.92), rgba(245, 240, 233, 0.82));
}

.interactive-map-canvas .gm-style,
.interactive-map-canvas .leaflet-container {
  min-height: 440px;
  font: inherit;
}

.map-loading-copy,
.map-fallback-copy {
  min-height: 440px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.map-fallback-copy strong {
  color: var(--ink);
}

.leaflet-container {
  background: #d9e4ef;
}

.leaflet-control-attribution,
.leaflet-control-scale {
  font-family: inherit;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.94);
}

.map-popup {
  display: grid;
  gap: 4px;
  color: var(--ink);
}

.map-popup strong {
  font-size: 0.94rem;
}

.map-popup span {
  color: var(--muted);
  font-size: 0.85rem;
}

.map-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.map-footer span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(100, 122, 148, 0.14);
}

.map-modal-panel {
  width: min(1400px, 100%);
  min-height: min(90dvh, 940px);
  max-height: 92dvh;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.map-modal-copy {
  color: var(--muted);
  line-height: 1.5;
}

.map-modal-frame {
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(100, 122, 148, 0.18);
  background: linear-gradient(180deg, rgba(223, 235, 248, 0.9), rgba(246, 240, 233, 0.76));
}

.map-modal-canvas {
  width: 100%;
  min-height: min(74dvh, 760px);
}

.map-modal-canvas .gm-style,
.map-modal-canvas .leaflet-container {
  min-height: min(74dvh, 760px);
}

.mini-button {
  border: 0;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  background: rgba(34, 48, 63, 0.08);
  color: var(--ink);
}

.result-table-shell {
  overflow: auto;
  max-height: min(38vh, 360px);
  border-radius: 18px;
  border: 1px solid rgba(100, 122, 148, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.result-table th,
.result-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(100, 122, 148, 0.14);
  white-space: nowrap;
}

.result-table td.table-cell-positive {
  background: rgba(179, 220, 150, 0.52);
  color: #23351a;
  font-weight: 600;
}

.result-table td.table-cell-negative {
  background: rgba(242, 178, 178, 0.48);
  color: #4f2323;
  font-weight: 600;
}

.result-table th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 255, 0.96);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.composer {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 20px 46px rgba(38, 49, 69, 0.12);
}

.composer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 48%);
  opacity: 0.9;
}

body[data-page="app"] .composer {
  position: sticky;
  bottom: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="app"] .composer::before {
  display: none;
}

body[data-page="app"] .composer-hint {
  display: none;
}

body[data-page="app"] .composer-actions {
  justify-content: flex-end;
  align-self: end;
}

.composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow: 0 14px 34px rgba(38, 49, 69, 0.1);
}

.composer textarea {
  position: relative;
  z-index: 1;
  display: block;
  align-self: start;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  min-height: 22px;
  max-height: 220px;
  margin: 0;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  overflow-y: auto;
}

.composer textarea:focus {
  outline: none;
}

.composer textarea::placeholder {
  color: rgba(95, 108, 124, 0.9);
}

.composer-hint {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.composer-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.send-button,
.ghost-button,
.mic-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  border-radius: 999px;
  padding: 12px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.small-button {
  padding: 9px 14px;
  font-size: 0.9rem;
}

.send-button {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(21, 23, 26, 1), rgba(37, 40, 45, 0.94));
  color: white;
  box-shadow: 0 12px 24px rgba(24, 28, 34, 0.14);
  font-size: 1.2rem;
  font-weight: 600;
}

.mic-button {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 26, 29, 0.06);
  color: var(--ink);
  border: 1px solid rgba(24, 26, 29, 0.08);
}

.mic-button-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mic-button-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mic-button.is-recording {
  background: rgba(182, 80, 80, 0.12);
  color: #9b2f2f;
  border-color: rgba(182, 80, 80, 0.22);
  box-shadow: 0 0 0 8px rgba(182, 80, 80, 0.08);
}

.mic-button.is-loading {
  background: rgba(24, 26, 29, 0.08);
}

.ghost-button {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  border: 1px solid rgba(100, 122, 148, 0.24);
}

.send-button:hover,
.ghost-button:hover,
.mic-button:hover {
  transform: translateY(-1px);
}

@keyframes loading-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes message-raise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawer-slide-in {
  from {
    opacity: 0.82;
    transform: translateX(-22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.catalog-card {
  padding: 24px;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(24, 26, 29, 0.08);
  font-size: 0.95rem;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  body[data-page="app"] {
    height: 100dvh;
    overflow: hidden;
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  body[data-page="app"] .shell {
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    order: 1;
    height: 100%;
    min-height: 0;
  }

  .chart-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  body[data-page="app"] .conversation-card {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 0 12px calc(8px + env(safe-area-inset-bottom));
  }

  body[data-page="app"] .messages {
    min-height: 0;
    overflow: auto;
    padding: 0 2px 14px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .workspace-topbar {
    position: sticky;
    top: 0;
    z-index: 6;
    margin: 0 -12px;
    min-height: 56px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 10px;
    background: linear-gradient(180deg, rgba(250, 250, 248, 0.98), rgba(250, 250, 248, 0.82) 72%, transparent);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
  }

  .workspace-topbar-name {
    font-size: 1.1rem;
  }

  .topbar-quick-action {
    display: inline-flex;
  }

  body[data-page="app"] .composer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -12px calc(-6px - env(safe-area-inset-bottom));
    padding: 6px 12px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(250, 250, 248, 0) 0%, rgba(250, 250, 248, 0.1) 35%, rgba(250, 250, 248, 0.24) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  body[data-page="app"] .composer-shell {
    padding: 9px 10px 9px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.48);
    box-shadow: 0 12px 28px rgba(38, 49, 69, 0.08);
  }

  body[data-page="app"] .composer-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .interactive-map-canvas,
  .interactive-map-canvas .gm-style,
  .interactive-map-canvas .leaflet-container,
  .map-loading-copy,
  .map-fallback-copy {
    min-height: 420px;
  }

  .app-toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  .auth-page,
  .shell {
    padding: 14px;
  }

  body[data-page="app"] .shell {
    padding: 0;
  }

  .auth-panel,
  .sidebar,
  .hero-card,
  .conversation-card,
  .catalog-card {
    border-radius: 24px;
  }

  .conversation-card {
    min-height: auto;
    padding: 18px;
  }

  body[data-page="app"] .conversation-card {
    padding: 0 10px calc(8px + env(safe-area-inset-bottom));
  }

  .result-table-shell {
    max-height: 280px;
  }

  .hero-card,
  .catalog-card {
    padding: 18px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .composer textarea {
    min-height: 22px;
    padding: 0;
    font-size: 1rem;
  }

  .stacked-bars {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  }

  .message,
  .message.user {
    max-width: 100%;
  }

  .drawer-panel {
    width: min(356px, 88vw);
    padding-inline: 16px;
  }

  .drawer-meta {
    gap: 10px;
  }

  .drawer-meta-brand {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }

  .drawer-meta-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .drawer-meta-copy strong {
    font-size: 1rem;
  }

  .drawer-meta-status-text {
    font-size: 0.76rem;
  }
}

@media (max-width: 720px) {
  .suggestion-row {
    flex-direction: column;
  }

  .suggestion-chip {
    width: 100%;
    text-align: left;
  }

  .ranked-bar-copy {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .auth-page,
  .shell {
    padding: 10px;
  }

  body[data-page="app"] .shell {
    padding: 0;
  }

  .auth-panel,
  .sidebar,
  .hero-card,
  .conversation-card,
  .catalog-card {
    padding: 16px;
    border-radius: 20px;
  }

  .card-header,
  .auth-cta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="app"] .composer-actions {
    align-items: center;
    flex-direction: row;
  }

  .send-button,
  .ghost-button,
  .auth-link-button {
    width: 100%;
    justify-content: center;
  }

  body[data-page="app"] .ghost-button {
    width: auto;
  }

  body[data-page="app"] .send-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  body[data-page="app"] .composer-shell {
    padding: 8px 10px 8px 13px;
  }

  .message {
    max-width: 100%;
  }

  .chart-x-labels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-table th,
  .result-table td {
    padding: 9px 10px;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .drawer-backdrop {
    display: flex;
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    place-items: normal;
  }

  .modal-panel {
    padding: 20px;
    border-radius: 24px;
  }

  .modal-header {
    align-items: center;
  }

  .workspace-topbar {
    padding-inline: 12px;
  }

  .topbar-quick-action {
    width: 42px;
    height: 42px;
  }

  .drawer-panel {
    width: min(356px, 90vw);
    min-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0 28px 28px 0;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  }

  .drawer-meta {
    margin-top: auto;
  }

  .map-modal-panel {
    width: 100%;
    min-height: 88dvh;
    max-height: 88dvh;
    padding: 16px;
    border-radius: 24px;
  }

  .map-modal-canvas,
  .map-modal-canvas .gm-style,
  .map-modal-canvas .leaflet-container {
    min-height: 66dvh;
  }
}
