:root {
  --bg-page: #212121;
  --bg-sidebar: #171717;
  --bg-main: #212121;
  --surface-0: #2a2a2a;
  --surface-1: #2f2f2f;
  --surface-2: #363636;
  --border: #3f3f3f;
  --border-soft: #343434;
  --text: #ececec;
  --text-muted: #a9a9a9;
  --text-faint: #7f7f7f;
  --accent: #8ea6c9;
  --danger: #ff6b6b;
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 20px 44px rgba(0, 0, 0, 0.34);
  --content-width: 840px;
  --sans: "Sohne", "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", "Cascadia Code", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.sidebar-locked {
  overflow: hidden;
  touch-action: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(950px 460px at 50% -42%, rgba(255, 255, 255, 0.09), transparent 74%),
    radial-gradient(760px 340px at 11% -24%, rgba(142, 166, 201, 0.06), transparent 67%);
  opacity: 0.56;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.conversation-open:focus-visible {
  outline: 2px solid rgba(142, 166, 201, 0.72);
  outline-offset: 2px;
}

.unlock-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-main);
}

.unlock-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(47, 47, 47, 0.92);
  box-shadow: var(--shadow-lg);
}

.unlock-brand {
  margin-bottom: 18px;
}

.unlock-card h1 {
  margin: 0 0 8px;
  font-size: 1.65rem;
}

.unlock-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.unlock-card form {
  display: grid;
  gap: 12px;
}

.unlock-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-0);
}

.unlock-card button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  color: #111;
  background: #ececec;
  cursor: pointer;
}

.unlock-card button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.unlock-card .unlock-error {
  margin: 14px 0 0;
  color: var(--danger);
}

.layout-shell {
  --chat-lock-base: 252px;
  --chat-lock-shift: calc((var(--sidebar-width, 252px) - var(--chat-lock-base)) * -0.5);
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width, 302px) 0 1fr;
  background: var(--bg-main);
}

.sidebar {
  grid-column: 1;
  min-width: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px 12px 12px;
  background: var(--bg-sidebar);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  z-index: 20;
}

.sidebar-resizer {
  grid-column: 2;
  position: relative;
  width: 14px;
  margin-left: -7px;
  cursor: col-resize;
  touch-action: none;
  z-index: 24;
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 1px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.16);
  transition: opacity 0.14s ease;
}

.sidebar-resizer:hover::before {
  opacity: 0.45;
}

.sidebar-resizer:focus-visible {
  outline: none;
}

.sidebar-resizer:focus-visible::before {
  opacity: 0.8;
  background: rgba(142, 166, 201, 0.78);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #35373d;
  border-radius: 14px;
  padding: 11px 12px;
  background: linear-gradient(180deg, #212224 0%, #1d1e20 100%);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: #eef2f7;
  border: 1px solid #4a5361;
  background: linear-gradient(145deg, #3d4758, #2a3341);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-copy h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-copy p {
  margin: 2px 0 0;
  color: #949daa;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.new-chat-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
  background: linear-gradient(180deg, #272727 0%, #252525 100%);
  color: #efefef;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 580;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.new-chat-btn:hover:not(:disabled) {
  border-color: #5a5d64;
  background: #2e2f31;
  transform: translateY(-1px);
}

.new-chat-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sidebar-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
}

.sidebar-section h2 {
  margin: 0;
  font-size: 0.73rem;
  color: var(--text-faint);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
}

.sidebar-meta {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.conversation-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: grid;
  gap: 4px;
  padding-right: 2px;
}

.conversation-list::-webkit-scrollbar {
  width: 9px;
}

.conversation-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.sidebar:hover .conversation-list,
.conversation-list:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 142, 142, 0.72) transparent;
}

.sidebar:hover .conversation-list::-webkit-scrollbar-thumb,
.conversation-list:hover::-webkit-scrollbar-thumb {
  background: rgba(142, 142, 142, 0.72);
}

.conversation-item {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.conversation-item:hover {
  background: #27282a;
}

.conversation-item.active {
  background: #2d2f33;
  border-color: #454b56;
}

.conversation-open {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 2px;
}

.conversation-open:focus-visible {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.conversation-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.conversation-title {
  display: block;
  font-size: 0.85rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  color: var(--text-faint);
  font-size: 0.73rem;
}

.delete-conversation {
  font: inherit;
  font-weight: 580;
  border: 0;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: transparent;
  color: rgba(232, 232, 232, 0.66);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(2px);
  transition: background-color 0.12s ease, color 0.12s ease, opacity 0.12s ease, transform 0.12s ease;
}

.conversation-item:hover .delete-conversation,
.conversation-item.active .delete-conversation {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.delete-conversation:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.16);
  color: #ffc4c4;
}

.delete-conversation:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.delete-conversation:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-shell {
  grid-column: 3;
  position: relative;
  left: var(--chat-lock-shift);
  min-width: 0;
  width: calc(100% - max(0px, var(--chat-lock-shift)));
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 0 clamp(8px, 1.9vw, 22px) 14px;
  background: var(--bg-main);
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 12;
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  padding: 12px 4px 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(33, 33, 33, 0.98), rgba(33, 33, 33, 0.93) 79%, rgba(33, 33, 33, 0));
}

.chat-header.home-minimal {
  padding-top: 10px;
  padding-bottom: 4px;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(33, 33, 33, 0.94), rgba(33, 33, 33, 0));
}

.header-spacer {
  flex: 1;
}

.chat-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-heading {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
}

.vayu-lockup {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  padding-right: 3.05rem;
}

.vayu-wordmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  isolation: isolate;
  padding: 0.03em 0.02em 0.08em 0.12em;
  font-family: var(--sans);
  font-weight: 730;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #edf3fb;
  background: linear-gradient(180deg, #f8fbff 0%, #e7eef6 48%, #bccadd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 16px rgba(142, 166, 201, 0.09);
  filter: drop-shadow(0 0 10px rgba(142, 166, 201, 0.08));
}

.chat-header .vayu-wordmark {
  font-size: 1.18rem;
  letter-spacing: 0.15em;
}

.empty-state .vayu-wordmark {
  font-size: clamp(2.18rem, 3.28vw, 2.92rem);
}

.vayu-beta-tag {
  position: absolute;
  top: -0.1rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(146, 167, 195, 0.34);
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  background: linear-gradient(180deg, rgba(31, 37, 45, 0.96) 0%, rgba(24, 29, 36, 0.92) 100%);
  color: #d7e4f5;
  font-size: 0.46rem;
  font-weight: 720;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.empty-state .vayu-lockup {
  padding-right: 3.8rem;
}

.empty-state .vayu-beta-tag {
  top: 0.14rem;
  font-size: 0.58rem;
  padding: 0.22rem 0.56rem;
}

.vayu-wordmark::before {
  content: "";
  position: absolute;
  left: 0.18em;
  right: -0.16em;
  bottom: 0.02em;
  height: 0.5em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(142, 166, 201, 0) 0%, rgba(142, 166, 201, 0.12) 20%, rgba(201, 214, 231, 0.34) 52%, rgba(142, 166, 201, 0) 100%);
  filter: blur(8px);
  opacity: 0.72;
  z-index: -1;
}

.vayu-wordmark::after {
  content: "";
  position: absolute;
  left: 0.42em;
  right: -0.08em;
  top: 56%;
  height: 1px;
  background: linear-gradient(90deg, rgba(214, 225, 238, 0) 0%, rgba(214, 225, 238, 0.08) 18%, rgba(214, 225, 238, 0.48) 58%, rgba(214, 225, 238, 0) 100%);
  transform: translateY(-50%) skewX(-24deg);
  opacity: 0.68;
}

.vayu-wordmark-hero {
  letter-spacing: 0.16em;
}

.chat-header p {
  margin: 2px 0 0;
  color: #949daa;
  font-size: 0.77rem;
}

.chat-header > div {
  min-width: 0;
}

.data-sources {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.source-pill {
  border: 1px solid #40434a;
  border-radius: 999px;
  padding: 3px 9px;
  background: #2a2c30;
  color: #c4c9d2;
  font-size: 0.64rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.sidebar-toggle {
  display: none;
  width: auto;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #2d2d2d;
  color: #d4d4d4;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.header-new-chat {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #303133 0%, #2d2e30 100%);
  color: #f0f0f0;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 580;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.header-new-chat:hover:not(:disabled) {
  border-color: #5b5e65;
  background: #38393c;
  transform: translateY(-1px);
}

.header-new-chat:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.thread {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 4px 2px 14px;
  scroll-behavior: auto;
}

.chat-content-grid {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, var(--content-width));
  gap: 0;
  align-items: start;
}

.chat-main-column {
  min-width: 0;
}

.chat-lane {
  min-width: 0;
  width: 100%;
  margin: 0;
}

.thread::-webkit-scrollbar {
  width: 9px;
}

.thread::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #4f4f4f;
}

.thread-meta {
  width: 100%;
  margin: 0 0 10px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.empty-state {
  width: 100%;
  margin: 9.5vh auto 0;
  text-align: center;
  animation: fade-up 0.26s ease;
}

.chat-shell.home .empty-state {
  margin-top: 6.6vh;
}

.empty-state h3 {
  margin: 0 0 12px;
  font-size: clamp(1.82rem, 2.75vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 680;
}

.empty-state p {
  margin: 0 auto;
  max-width: 690px;
  color: #b3b8c1;
  font-size: 0.9rem;
  line-height: 1.58;
}

.empty-sources {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.starter-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.starter-card {
  text-align: left;
  border: 1px solid #40434a;
  border-radius: 13px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #2c2d30 0%, #292a2c 100%);
  color: #e0e0e0;
  font-family: var(--sans);
  font-size: 0.89rem;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.starter-card:hover {
  border-color: #5c6675;
  background: #333538;
  transform: translateY(-1px);
}

.bubble,
.assistant-turn {
  min-width: 0;
  max-width: 100%;
  animation: fade-up 0.18s ease;
}

.turn-row {
  width: 100%;
  margin: 0 0 20px;
}

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

.bubble {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
}

.bubble.user {
  width: fit-content;
  max-width: min(72%, 640px);
  margin: 0;
  border: 1px solid #42454d;
  border-radius: 22px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #313235 0%, #2c2d30 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}

.bubble.user .markdown {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ededed;
}

.bubble.user .markdown p {
  margin: 0;
}

.bubble.assistant {
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding-top: 2px;
}

.assistant-turn {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0 0 20px;
  display: grid;
  gap: 10px;
}

.bubble.assistant .markdown {
  font-size: 0.95rem;
  line-height: 1.66;
  color: #e7e7e7;
}

.thinking-stream {
  position: relative;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 10px 0 2px;
  display: grid;
  gap: 10px;
}

.thinking-stream::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 36px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(142, 166, 201, 0.32) 0%, rgba(142, 166, 201, 0.08) 100%);
  opacity: 0.7;
}

.thinking-stream.running .thinking-status {
  animation: subtle-pulse 2.1s ease-in-out infinite;
}

.thinking-status {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-left: 2px;
}

.thinking-status.clickable {
  cursor: pointer;
  user-select: none;
}

.thinking-status.clickable:hover .thinking-text {
  color: rgba(238, 243, 250, 0.98);
}

.thinking-status.clickable:focus-visible {
  outline: 2px solid rgba(142, 166, 201, 0.6);
  outline-offset: 6px;
  border-radius: 10px;
}

.thinking-loader {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  place-items: center;
  padding: 4px;
  border: 1px solid rgba(142, 166, 201, 0.12);
  border-radius: 7px;
  background: rgba(142, 166, 201, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.thinking-loader-square {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: rgba(196, 207, 221, 0.34);
  opacity: 0.18;
  transform: scale(0.88);
  flex-shrink: 0;
}

.thinking-stream.running .thinking-loader-square {
  animation: thinking-grid-step 0.92s ease-in-out infinite;
}

.thinking-stream.running .thinking-loader-square:nth-child(2) {
  animation-delay: 0.14s;
}

.thinking-stream.running .thinking-loader-square:nth-child(3) {
  animation-delay: 0.42s;
}

.thinking-stream.running .thinking-loader-square:nth-child(4) {
  animation-delay: 0.28s;
}

.thinking-stream.settled .thinking-loader {
  border-color: rgba(142, 166, 201, 0.08);
  background: rgba(142, 166, 201, 0.025);
  opacity: 0.88;
}

.thinking-stream.settled .thinking-loader-square {
  background: rgba(186, 194, 205, 0.48);
  opacity: 0.44;
  transform: scale(1);
}

.thinking-text {
  max-width: min(72vw, 640px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.87rem;
  font-weight: 620;
  color: rgba(228, 236, 247, 0.92);
  letter-spacing: 0.005em;
  text-shadow: 0 0 10px rgba(142, 166, 201, 0.12);
}

.thinking-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.82rem;
  height: 0.82rem;
  flex-shrink: 0;
  color: rgba(214, 223, 235, 0.58);
  transform: rotate(0deg);
  transition: transform 0.16s ease, color 0.16s ease;
}

.thinking-caret::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transform-origin: center;
}

.thinking-status.clickable:hover .thinking-caret {
  color: rgba(228, 235, 245, 0.78);
}

.thinking-caret.collapsed {
  transform: rotate(-90deg);
}

.thinking-panel-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding-left: 30px;
}

.reasoning-markdown {
  margin: 0;
  color: rgba(222, 229, 239, 0.66);
  text-shadow: none;
  font-size: 0.94rem;
  line-height: 1.7;
}

.reasoning-markdown p,
.reasoning-markdown li,
.reasoning-markdown code {
  opacity: 0.72;
}

.thinking-segment {
  margin: 0;
}

.assistant-meta {
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.model-chip,
.reasoning-chip,
.token-chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(116, 126, 141, 0.24);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(34, 37, 43, 0.62);
  color: rgba(214, 221, 232, 0.76);
  font-size: 0.615rem;
  font-weight: 560;
  letter-spacing: 0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.reasoning-chip {
  text-transform: capitalize;
}

.action-card {
  min-width: 0;
  border: 1px solid rgba(74, 80, 90, 0.5);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(37, 40, 45, 0.82) 0%, rgba(29, 32, 37, 0.84) 100%);
  overflow: hidden;
}

.action-card.request {
  border-color: rgba(88, 104, 132, 0.48);
}

.action-card.result {
  border-color: rgba(82, 108, 102, 0.46);
}

.action-card:hover {
  border-color: rgba(113, 124, 141, 0.58);
}

.action-card[open] {
  border-color: rgba(121, 133, 151, 0.66);
  background: linear-gradient(180deg, rgba(41, 45, 52, 0.88) 0%, rgba(31, 35, 41, 0.88) 100%);
}

.action-summary {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 9px 10px;
}

.action-summary::-webkit-details-marker {
  display: none;
}

.action-summary::marker {
  display: none;
  content: "";
}

.action-title-wrap {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

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

.action-name {
  color: rgba(232, 238, 247, 0.88);
  font-size: 0.74rem;
  font-weight: 620;
  line-height: 1.25;
}

.action-summary-text {
  color: rgba(198, 208, 222, 0.56);
  font-size: 0.64rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-step {
  flex-shrink: 0;
  color: rgba(176, 186, 200, 0.56);
  font-family: var(--mono);
  font-size: 0.61rem;
  line-height: 1.25;
  padding-top: 1px;
}

.action-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-kind {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(121, 136, 158, 0.24);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(142, 166, 201, 0.12);
  color: rgba(220, 227, 238, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.55rem;
  line-height: 1;
  font-weight: 600;
}

.action-card.request .action-kind {
  border-color: rgba(129, 167, 222, 0.24);
  background: rgba(129, 167, 222, 0.08);
}

.action-card.result .action-kind {
  border-color: rgba(106, 179, 150, 0.24);
  background: rgba(106, 179, 150, 0.08);
}

.action-summary:hover .action-name {
  color: rgba(241, 246, 253, 0.94);
}

.action-summary:hover .action-summary-text {
  color: rgba(204, 215, 229, 0.68);
}

.action-caret {
  flex-shrink: 0;
  color: rgba(214, 223, 235, 0.56);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.82rem;
  height: 0.82rem;
  transition: transform 0.16s ease, color 0.16s ease;
}

.action-caret::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transform-origin: center;
}

.action-card[open] .action-caret {
  transform: rotate(180deg);
  color: rgba(228, 235, 245, 0.82);
}

.action-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.action-section {
  display: grid;
  gap: 6px;
}

.action-section-label {
  color: rgba(190, 200, 214, 0.68);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-json {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(66, 71, 79, 0.56);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(19, 21, 25, 0.68);
  color: rgba(224, 231, 241, 0.82);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
}

.action-sql {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(90, 103, 121, 0.58);
  border-radius: 10px;
  padding: 10px 11px;
  background: rgba(14, 17, 21, 0.92);
  color: rgba(237, 242, 250, 0.92);
  font-family: var(--mono);
  font-size: 0.67rem;
  line-height: 1.56;
  white-space: pre;
  tab-size: 2;
  max-height: 240px;
}

.composer {
  position: sticky;
  bottom: 0;
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: 6px;
  padding: 10px 0 4px;
  background: linear-gradient(180deg, rgba(33, 33, 33, 0) 0%, rgba(33, 33, 33, 0.94) 24%, rgba(33, 33, 33, 0.98) 100%);
}

.composer-input-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #4d5057;
  border-radius: 26px;
  background: linear-gradient(180deg, #36373b 0%, #303236 100%);
  box-shadow: var(--shadow-lg);
  padding: 10px 12px 10px 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.composer-input-row:focus-within {
  border-color: rgba(142, 166, 201, 0.5);
  box-shadow: 0 0 0 1px rgba(142, 166, 201, 0.08), var(--shadow-lg);
}

.composer-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.composer textarea {
  width: 100%;
  resize: none;
  min-height: 36px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 8px 2px 6px 0;
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.43;
}

.composer textarea::placeholder {
  color: #a8aeb8;
}

.composer textarea::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.composer textarea::-webkit-scrollbar-button {
  display: none;
}

.composer textarea:focus {
  outline: none;
}

.reasoning-dropdown {
  position: relative;
  flex-shrink: 0;
}

.reasoning-dropdown::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, rgba(146, 159, 179, 0) 0%, rgba(146, 159, 179, 0.16) 20%, rgba(146, 159, 179, 0.42) 50%, rgba(146, 159, 179, 0.16) 80%, rgba(146, 159, 179, 0) 100%);
  transform: translateY(-50%);
}

.reasoning-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  padding: 4px 4px 4px 0;
  background: transparent;
  color: rgba(225, 232, 241, 0.8);
  cursor: pointer;
  transition: color 0.14s ease, opacity 0.14s ease;
}

.reasoning-trigger:hover:not(:disabled),
.reasoning-dropdown.open .reasoning-trigger {
  color: rgba(240, 244, 250, 0.92);
}

.reasoning-trigger:focus-visible {
  outline: 2px solid rgba(142, 166, 201, 0.52);
  outline-offset: 2px;
}

.reasoning-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.reasoning-trigger-label {
  color: rgba(154, 165, 180, 0.82);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.reasoning-trigger-value {
  color: rgba(236, 241, 248, 0.94);
  font-size: 0.73rem;
  font-weight: 620;
  line-height: 1;
}

.reasoning-trigger-caret {
  color: rgba(210, 219, 230, 0.64);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.8rem;
  height: 0.8rem;
  transition: transform 0.14s ease;
}

.reasoning-trigger-caret::before {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transform-origin: center;
}

.reasoning-dropdown.open .reasoning-trigger-caret {
  transform: rotate(180deg);
}

.reasoning-menu {
  position: absolute;
  left: -8px;
  bottom: calc(100% + 8px);
  z-index: 18;
  min-width: 210px;
  border: 1px solid rgba(99, 111, 128, 0.3);
  border-radius: 14px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(37, 40, 46, 0.98) 0%, rgba(29, 32, 37, 0.98) 100%);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.reasoning-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  background: transparent;
  color: #edf2f8;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.reasoning-option:hover,
.reasoning-option.active {
  background: rgba(142, 166, 201, 0.1);
}

.reasoning-option:focus-visible {
  outline: 2px solid rgba(142, 166, 201, 0.56);
  outline-offset: 0;
}

.reasoning-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reasoning-option-label {
  color: rgba(239, 244, 251, 0.94);
  font-size: 0.74rem;
  font-weight: 620;
  line-height: 1.1;
}

.reasoning-option-hint {
  color: rgba(177, 187, 201, 0.68);
  font-size: 0.66rem;
  line-height: 1.2;
}

.reasoning-option-check {
  color: rgba(194, 212, 236, 0.82);
  font-size: 0.92rem;
  line-height: 1;
  min-width: 0.7rem;
  text-align: center;
}

.send-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f1f1f1;
  color: #121212;
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #ffffff;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer-note {
  margin: 0;
  text-align: center;
  color: #9ba1ab;
  font-size: 0.72rem;
}

.markdown {
  min-width: 0;
  color: #e6e6e6;
  font-size: 0.94rem;
  line-height: 1.64;
  overflow-wrap: anywhere;
}

.markdown p {
  margin: 0 0 12px;
}

.markdown p:last-child {
  margin-bottom: 0;
}

.markdown ul,
.markdown ol {
  margin: 10px 0 12px 22px;
  padding: 0;
}

.markdown li {
  margin: 0 0 6px;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  margin: 24px 0 10px;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #f0f0f0;
}

.markdown h1 {
  font-size: 1.56rem;
}

.markdown h2 {
  font-size: 1.34rem;
}

.markdown h3 {
  font-size: 1.16rem;
}

.markdown h4 {
  font-size: 1.01rem;
}

.markdown strong {
  color: #f2f2f2;
  font-weight: 670;
}

.markdown blockquote {
  margin: 10px 0;
  border-left: 3px solid #4f4f4f;
  padding-left: 12px;
  color: #dadada;
}

.markdown pre {
  max-width: 100%;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid #404040;
  border-radius: 12px;
  background: #1b1b1b;
  overflow-x: auto;
}

.markdown code {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.markdown :not(pre) > code {
  background: #333;
  border-radius: 6px;
  padding: 1px 5px;
  word-break: break-word;
}

.markdown .katex {
  color: inherit;
}

.markdown .katex-display {
  margin: 12px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.markdown table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.92rem;
}

.markdown th,
.markdown td {
  border: 1px solid #424242;
  padding: 8px 10px;
  text-align: left;
}

.markdown th {
  background: #323232;
  font-weight: 650;
}

.markdown hr {
  border: 0;
  border-top: 1px solid #4a4a4a;
  margin: 24px 0;
}

.markdown a {
  color: #9ab7da;
  text-decoration: none;
}

.markdown a:hover {
  text-decoration: underline;
}

.markdown img {
  display: block;
  max-width: 100%;
  height: auto;
}

.error-text {
  color: var(--danger);
}

.sidebar-scrim {
  display: none;
  cursor: pointer;
}

body.resizing-sidebar,
body.resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}

@keyframes thinking-grid-step {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.88);
  }
  26% {
    opacity: 1;
    transform: scale(1.16);
    box-shadow: 0 0 8px rgba(142, 166, 201, 0.28);
  }
  54% {
    opacity: 0.46;
    transform: scale(0.96);
    box-shadow: none;
  }
}

@keyframes subtle-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(142, 166, 201, 0.14);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(142, 166, 201, 0.04);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(142, 166, 201, 0.14);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .layout-shell {
    height: 100dvh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    max-height: 100dvh;
    width: min(86vw, 330px);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }

  .sidebar-resizer {
    display: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 14px 0 36px rgba(0, 0, 0, 0.5);
  }

  .sidebar-toggle {
    display: inline-grid;
    place-items: center;
    align-self: center;
  }

  .chat-shell {
    grid-column: 1;
    left: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding-top: 0;
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
  }

  .chat-header {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding-top: 10px;
  }

  .chat-header.home-minimal {
    padding-top: 8px;
    padding-bottom: 2px;
  }

  .chat-header p {
    font-size: 0.72rem;
  }

  .source-pill {
    font-size: 0.61rem;
  }

  .empty-state {
    margin-top: 8vh;
  }

  .chat-shell.home .empty-state {
    margin-top: 6vh;
  }

  .chat-content-grid {
    width: 100%;
    gap: 14px;
  }

  .header-new-chat {
    margin-left: 0;
  }

  .starter-grid {
    grid-template-columns: 1fr;
  }

  .bubble,
  .assistant-turn {
    width: 100%;
  }

  .turn-row {
    width: 100%;
  }

  .bubble.user {
    width: fit-content;
    max-width: 92%;
  }

  .thinking-text {
    max-width: 68vw;
  }

  .action-summary {
    padding: 8px 9px;
  }

  .action-title-wrap {
    gap: 7px;
  }

  .action-name {
    font-size: 0.71rem;
  }

  .action-summary-text {
    font-size: 0.62rem;
  }

  .action-body {
    padding: 0 9px 9px;
  }

  .action-json,
  .action-sql {
    font-size: 0.63rem;
    max-height: 220px;
  }

  .composer {
    width: 100%;
    padding-bottom: 4px;
  }

  .composer-input-row {
    border-radius: 22px;
    gap: 10px;
    padding: 8px 9px 8px 12px;
  }

  .composer-body {
    gap: 13px;
  }

  .composer textarea {
    font-size: 0.92rem;
    min-height: 34px;
  }

  .reasoning-dropdown::after {
    right: -7px;
    height: 20px;
  }

  .reasoning-menu {
    min-width: 196px;
    max-width: calc(100vw - 24px);
  }

  .reasoning-trigger-label {
    font-size: 0.59rem;
  }

  .reasoning-trigger-value {
    font-size: 0.71rem;
  }

  .send-btn {
    width: 34px;
    height: 34px;
    font-size: 0.94rem;
  }

  .composer-note {
    font-size: 0.68rem;
    margin-top: 0;
    text-align: center;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(10, 10, 10, 0.62);
    z-index: 15;
  }
}

@media (max-width: 720px) {
  .sidebar {
    width: min(90vw, 320px);
    padding: 12px 10px 10px;
    gap: 10px;
  }

  .chat-shell {
    padding-right: calc(8px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(8px + env(safe-area-inset-left, 0px));
  }

  .chat-header {
    grid-template-columns: auto 1fr auto;
    gap: 8px 10px;
    padding: 10px 0 6px;
  }

  .chat-header.home-minimal {
    padding-top: 8px;
    padding-bottom: 2px;
  }

  .sidebar-toggle {
    grid-column: 1;
    align-self: start;
  }

  .chat-header > div:not(.header-spacer) {
    grid-column: 1 / -1;
  }

  .header-new-chat {
    grid-column: 3;
    justify-self: end;
  }

  .chat-header .vayu-lockup {
    padding-right: 2.55rem;
  }

  .chat-header .vayu-wordmark {
    font-size: 1.04rem;
    letter-spacing: 0.12em;
  }

  .chat-header .vayu-beta-tag {
    top: 0;
    font-size: 0.42rem;
    padding: 0.17rem 0.42rem;
  }

  .chat-header p {
    font-size: 0.7rem;
    line-height: 1.45;
  }

  .data-sources {
    margin-top: 5px;
    gap: 4px;
  }

  .source-pill {
    padding: 3px 8px;
  }

  .empty-state {
    margin-top: 5.5vh;
    padding-inline: 4px;
  }

  .chat-shell.home .empty-state {
    margin-top: 4.5vh;
  }

  .empty-state p {
    font-size: 0.84rem;
  }

  .starter-grid {
    gap: 8px;
  }

  .starter-card {
    padding: 12px 13px;
    font-size: 0.85rem;
  }

  .turn-row,
  .assistant-turn {
    margin-bottom: 16px;
  }

  .bubble.user {
    max-width: 96%;
    border-radius: 20px;
    padding: 9px 14px;
  }

  .bubble.user .markdown,
  .bubble.assistant .markdown,
  .reasoning-markdown {
    font-size: 0.92rem;
  }

  .thinking-stream {
    padding-top: 8px;
    gap: 8px;
  }

  .thinking-stream::before {
    left: 11px;
    top: 34px;
  }

  .thinking-panel-body {
    padding-left: 26px;
  }

  .thinking-text {
    max-width: calc(100vw - 110px);
    font-size: 0.82rem;
  }

  .assistant-meta {
    gap: 5px;
    padding-top: 6px;
  }

  .composer {
    gap: 5px;
  }

  .composer-input-row {
    border-radius: 20px;
    gap: 8px;
    padding: 8px 8px 8px 11px;
  }

  .composer-body {
    gap: 10px;
  }

  .composer textarea {
    font-size: 0.89rem;
    line-height: 1.4;
  }

  .reasoning-trigger {
    gap: 7px;
  }

  .reasoning-menu {
    left: 0;
    min-width: min(196px, calc(100vw - 24px));
  }
}

@media (max-width: 520px) {
  .sidebar {
    width: min(92vw, 300px);
  }

  .unlock-shell {
    padding: 16px;
  }

  .unlock-card {
    padding: 22px;
    border-radius: 22px;
  }

  .chat-header .vayu-lockup {
    padding-right: 2.35rem;
  }

  .chat-header .vayu-wordmark {
    font-size: 0.98rem;
    letter-spacing: 0.1em;
  }

  .chat-header .vayu-beta-tag {
    font-size: 0.4rem;
    padding: 0.15rem 0.38rem;
  }

  .empty-state {
    padding-inline: 2px;
  }

  .empty-state h3 {
    font-size: clamp(1.6rem, 10vw, 1.95rem);
  }

  .empty-state .vayu-lockup {
    padding-right: 3.2rem;
  }

  .empty-state .vayu-beta-tag {
    font-size: 0.5rem;
    padding: 0.18rem 0.46rem;
  }

  .composer-input-row {
    align-items: flex-end;
    gap: 7px;
    padding: 7px 7px 7px 10px;
  }

  .composer-body {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .composer textarea {
    min-height: 38px;
    padding-top: 2px;
  }

  .reasoning-dropdown {
    align-self: flex-start;
  }

  .reasoning-dropdown::after {
    display: none;
  }

  .reasoning-trigger {
    gap: 6px;
    padding: 2px 0 1px;
  }

  .reasoning-trigger-label {
    font-size: 0.56rem;
  }

  .reasoning-trigger-value {
    font-size: 0.68rem;
  }

  .reasoning-dropdown::after {
    right: -6px;
  }

  .send-btn {
    width: 32px;
    height: 32px;
    font-size: 0.88rem;
  }
}
