:root {
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #ecece7;
  --text: #151715;
  --text-soft: #6d726e;
  --text-faint: #989d99;
  --border: #d9dcd7;
  --border-strong: #c7cbc5;
  --accent: #23683f;
  --accent-soft: #e7f1ea;
  --accent-contrast: #ffffff;
  --shadow: 0 18px 60px rgba(24, 28, 25, 0.10);
  --shadow-soft: 0 8px 28px rgba(24, 28, 25, 0.07);
  --rail-width: clamp(250px, 25vw, 390px);
  --topbar-height: 78px;
  --composer-safe: 150px;
}

html[data-theme="dark"] {
  --bg: #0f1110;
  --surface: #151816;
  --surface-2: #1a1d1b;
  --surface-3: #202420;
  --text: #f2f4f2;
  --text-soft: #9ba19c;
  --text-faint: #6e756f;
  --border: #292e2a;
  --border-strong: #353b36;
  --accent: #5fd689;
  --accent-soft: #17271d;
  --accent-contrast: #0b120d;
  --shadow: 0 22px 72px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
  transition: background 180ms ease, color 180ms ease;
}

button, textarea { font: inherit; }

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   APP / SCROLL FIX
   ========================================================= */

.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px 0 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    left 320ms cubic-bezier(.2,.75,.2,1),
    padding 320ms cubic-bezier(.2,.75,.2,1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 800;
}

.brand-name {
  font-size: 14px;
  font-weight: 760;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 11px;
}

.icon-button,
.close-button {
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text-soft);
}

.icon-button:hover,
.close-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.theme-icon { font-size: 18px; }

.chat {
  position: absolute;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 52px 22px calc(var(--composer-safe) + 38px);
  scroll-behavior: smooth;
  transition:
    left 320ms cubic-bezier(.2,.75,.2,1),
    padding 320ms cubic-bezier(.2,.75,.2,1);
}

.chat::-webkit-scrollbar { width: 10px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
  background-clip: padding-box;
}

.welcome {
  width: min(760px, 100%);
  margin: 14vh auto 0;
}

.welcome[hidden] { display: none; }

.welcome-eyebrow,
.launcher-kicker,
.launcher-section-label,
.rail-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.welcome h1 {
  margin: 12px 0 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.welcome p {
  max-width: 560px;
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.6;
}

.messages {
  width: min(820px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
  padding-bottom: 10px;
}

.message {
  width: 100%;
  animation: messageIn 180ms ease both;
}

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

.user-bubble {
  max-width: min(680px, 86%);
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 18px 18px 6px 18px;
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-message {
  display: grid;
  gap: 8px;
}

.ai-label {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ai-bubble {
  color: var(--text);
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
}

.ai-bubble.markdown-rendered {
  white-space: normal;
}

.error-text { color: #c94b4b; }

.composer-shell {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 35;
  width: min(780px, calc(100vw - 160px));
  transform: translateX(-50%);
  transition:
    left 320ms cubic-bezier(.2,.75,.2,1),
    width 320ms cubic-bezier(.2,.75,.2,1),
    transform 320ms cubic-bezier(.2,.75,.2,1);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

#input {
  width: 100%;
  min-height: 46px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 12px 10px 10px;
  background: transparent;
  color: var(--text);
  line-height: 1.5;
}

#input::placeholder { color: var(--text-faint); }

.send-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  font-size: 20px;
  transition: transform 140ms ease, opacity 140ms ease;
}

.send-button:hover { transform: translateY(-1px); }
.send-button:disabled { opacity: 0.45; cursor: default; transform: none; }

.composer-note {
  margin-top: 7px;
  text-align: center;
  color: var(--text-faint);
  font-size: 9px;
}

.corner-controls {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
}

.launcher-button,
.voice-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.launcher-button:hover,
.voice-button:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
}

.voice-button {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.voice-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-strong));
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent);
}

.voice-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-listening-dot {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: scale(.7);
}

.voice-button.is-listening .voice-listening-dot {
  opacity: 1;
  animation: voicePulse 1.05s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { transform: scale(.72); opacity: .45; }
  50% { transform: scale(1); opacity: 1; }
}

.launcher-grid {
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.launcher-grid i {
  display: block;
  border-radius: 3px;
  background: var(--text);
}

/* =========================================================
   DYNAMIC PROJECT / CHAT RAIL
   ========================================================= */

.context-rail {
  position: absolute;
  z-index: 25;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--rail-width);
  min-width: 0;
  border-right: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: transparent;
  opacity: 0;
  transform: translateX(-34px);
  pointer-events: none;
  transition:
    opacity 280ms ease,
    transform 320ms cubic-bezier(.2,.75,.2,1);
}

.app.rail-open .context-rail {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.rail-inner {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 28px 36px 94px 26px;
}

.rail-top {
  padding: 0 6px 18px;
}

.rail-title {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 12px;
}

.rail-scroll {
  position: relative;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-snap-type: y proximity;
  padding: 38% 5px;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 13%,
    black 87%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 13%,
    black 87%,
    transparent 100%
  );
}

.rail-scroll::-webkit-scrollbar { display: none; }

.rail-item {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: center;
  transform-origin: left center;
  transition:
    opacity 150ms ease,
    transform 150ms ease,
    color 150ms ease;
}

.rail-item .rail-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 620;
  line-height: 1.2;
}

.rail-item .rail-item-meta {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 9px;
  flex: 0 0 auto;
}

/* JS assigns --wheel-scale / --wheel-opacity */
.rail-item {
  transform: scale(var(--wheel-scale, .82));
  opacity: var(--wheel-opacity, .42);
}

.rail-item.is-center {
  color: var(--text);
}

.rail-item.is-active .rail-item-name {
  color: var(--accent);
}

.rail-hide {
  position: absolute;
  top: 50%;
  right: -15px;
  width: 30px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  opacity: .82;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.rail-hide:hover {
  opacity: 1;
  background: var(--surface);
  transform: translateY(-50%) translateX(-1px);
}

.rail-hide span {
  font-size: 24px;
  line-height: 1;
}

/* Project folders */
.project-item {
  display: block;
  min-height: 62px;
  height: auto;
  padding: 0;
  scroll-snap-align: center;
}

.project-folder-button {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 0 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.project-chevron {
  width: 14px;
  flex: 0 0 14px;
  color: var(--text-faint);
  transition: transform 180ms ease;
}

.project-item.expanded .project-chevron {
  transform: rotate(90deg);
}

.project-children {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 260ms cubic-bezier(.2,.75,.2,1),
    opacity 200ms ease;
}

.project-children-inner {
  min-height: 0;
  overflow: hidden;
}

.project-item.expanded .project-children {
  grid-template-rows: 1fr;
  opacity: 1;
}

.project-chat {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  border: 0;
  padding: 0 10px 0 33px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  font-size: inherit; /* same size as folder */
  font-weight: 560;
}

.project-chat:hover {
  color: var(--text);
}

/* Push the rest of Clovis to the right when rail is open */
.app.rail-open .topbar {
  left: var(--rail-width);
}

.app.rail-open .chat {
  left: var(--rail-width);
}

.app.rail-open .composer-shell {
  left: calc(50% + (var(--rail-width) / 2));
  width: min(780px, calc(100vw - var(--rail-width) - 100px));
}

/* =========================================================
   FULL WORKSPACE LAUNCHER
   ========================================================= */

.launcher-overlay,
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.launcher-overlay[hidden],
.settings-overlay[hidden] { display: none; }

.launcher-backdrop,
.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 8, 0.44);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  animation: backdropIn 220ms ease forwards;
}

.launcher-panel {
  position: absolute;
  inset: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(22px) scale(0.985);
  opacity: 0;
  animation: launcherIn 260ms cubic-bezier(.2,.75,.2,1) forwards;
}

.launcher-header,
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.launcher-header h2,
.settings-header h2 {
  margin: 5px 0 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.close-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--text-soft);
  font-size: 20px;
}

.launcher-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 25%) 1px 1fr;
}

.launcher-primary {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-auto-rows: minmax(150px, 1fr);
  gap: 14px;
  padding: 22px;
}

.nav-tile {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  opacity: 0;
  animation: tileIn 300ms ease forwards;
}

.nav-tile:nth-child(1) { animation-delay: 70ms; }
.nav-tile:nth-child(2) { animation-delay: 110ms; }
.nav-tile:nth-child(3) { animation-delay: 150ms; }

.nav-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.nav-tile.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
}

.nav-tile-number {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.nav-tile-title {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.nav-tile-copy {
  max-width: 220px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.launcher-divider { background: var(--border); }

.launcher-secondary {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  align-items: start;
  padding: 30px 34px 92px;
}

.launcher-content {
  max-width: 650px;
  animation: contentIn 220ms ease both;
}

.launcher-content h3 {
  margin: 12px 0 10px;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.launcher-content p {
  max-width: 560px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.settings-button {
  position: absolute;
  right: 24px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
}

.settings-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.settings-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(640px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(-50% + 16px)) scale(0.99);
  opacity: 0;
  animation: settingsIn 220ms cubic-bezier(.2,.75,.2,1) forwards;
}

.settings-content { padding: 24px 26px 28px; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
}

.settings-row-title {
  font-size: 14px;
  font-weight: 700;
}

.settings-row-copy {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 12px;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
}

.segmented-control button.active {
  background: var(--surface-3);
  color: var(--text);
}

@keyframes launcherIn {
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes settingsIn {
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes backdropIn { to { opacity: 1; } }
@keyframes tileIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes contentIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes messageIn {
  from { transform: translateY(5px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 900px) {
  :root {
    --rail-width: min(320px, 78vw);
  }

  .app.rail-open .topbar {
    left: 0;
  }

  .app.rail-open .chat {
    left: 0;
    transform: translateX(var(--rail-width));
  }

  .app.rail-open .composer-shell {
    left: 50%;
    width: min(780px, calc(100vw - 92px));
  }

  .context-rail {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 66px;
  }

  .topbar { padding: 0 16px; }
  .chat { padding: 34px 14px 150px; }
  .welcome { margin-top: 9vh; }

  .composer-shell {
    width: calc(100vw - 92px);
    left: auto;
    right: 14px;
    bottom: 14px;
    transform: none;
  }

  .app.rail-open .composer-shell {
    left: auto;
    right: 14px;
    width: calc(100vw - 92px);
    transform: none;
  }

  .corner-controls { left: 14px; bottom: 14px; gap: 8px; }
  .launcher-button,
  .voice-button { width: 48px; height: 48px; border-radius: 15px; }

  .launcher-panel { inset: 8px; border-radius: 24px; }

  .launcher-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px 1fr;
  }

  .launcher-primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 138px;
    gap: 8px;
    padding: 14px;
  }

  .launcher-divider { width: 100%; height: 1px; }

  .nav-tile {
    min-height: 138px;
    padding: 12px;
    border-radius: 16px;
  }

  .nav-tile-title { font-size: 13px; }
  .nav-tile-copy { font-size: 10px; }
  .launcher-secondary { padding: 22px 18px 82px; }

  .settings-row {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
}

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


/* =========================================================
   PERSISTENCE UI / EMPTY STATES / RESTORE ARROW
   ========================================================= */

.rail-create-button {
  width: calc(100% - 12px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 6px 16px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}

.rail-create-button:hover {
  color: var(--text);
}

.rail-create-plus {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}

.rail-empty {
  padding: 28px 12px;
  color: var(--text-faint);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.project-folder-button .project-add-chat {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  margin-left: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.project-folder-button .project-add-chat:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.rail-restore {
  position: absolute;
  z-index: 29;
  top: calc(var(--topbar-height) + 50%);
  left: 0;
  width: 30px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  opacity: .86;
  animation: restoreIn 220ms ease both;
}

.rail-restore[hidden] {
  display: none;
}

.rail-restore:hover {
  opacity: 1;
  background: var(--surface);
}

.rail-restore span {
  font-size: 24px;
  line-height: 1;
}

@keyframes restoreIn {
  from { transform: translate(-12px, -50%); opacity: 0; }
  to { transform: translate(0, -50%); opacity: .86; }
}

.chat-title-active .rail-item-name,
.project-chat.chat-title-active {
  color: var(--accent);
}


/* =========================================================
   v0.4 WORKSPACE SWITCHING + CONTEXT MENU + DRAG/DROP
   ========================================================= */

.context-menu {
  position: fixed;
  z-index: 220;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.context-menu[hidden] { display: none; }

.context-menu button {
  width: 100%;
  min-height: 36px;
  display: block;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.context-menu button:hover {
  background: var(--surface-2);
}

.context-menu button.danger {
  color: #c94b4b;
}

.rail-item[draggable="true"],
.project-item[draggable="true"] {
  cursor: grab;
}

.rail-item.dragging,
.project-item.dragging {
  opacity: .28 !important;
}

.project-item.drag-over .project-folder-button {
  background: var(--accent-soft);
  border-radius: 12px;
}

.rail-drop-root {
  margin: 2px 6px 12px;
  min-height: 34px;
  display: grid;
  place-items: center start;
  padding: 0 10px;
  border: 1px dashed transparent;
  border-radius: 10px;
  color: var(--text-faint);
  font-size: 10px;
}

.rail-drop-root.drag-over {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.workspace-pending-note {
  margin-top: 18px;
  color: var(--text-faint);
  font-size: 11px;
}


/* =========================================================
   v0.4.1 VISUAL POLISH
   ========================================================= */

/* No permanent top bar. Clovis starts directly in the workspace. */
:root {
  --topbar-height: 0px;
}

.topbar {
  display: none !important;
}

/* The side rail should feel like it simply exists beside the chat,
   not like a boxed sidebar separated by a rule. */
.context-rail {
  top: 0;
  border-right: 0 !important;
}

.rail-inner {
  padding-top: 30px;
}

/* Remove any visible split line between the rail and conversation. */
.app.rail-open .chat {
  border-left: 0 !important;
}

.chat {
  top: 0;
  padding-top: 52px;
}

/* With no top bar, the conversation can breathe a little more. */
.app.rail-open .chat {
  padding-left: 36px;
}

.rail-restore {
  top: 50%;
}

/* Smooth new-response typing cursor. */
.ai-bubble.typing {
  position: relative;
}

.ai-bubble.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: .48;
  vertical-align: -0.12em;
  animation: clovisCaret 880ms ease-in-out infinite;
}

@keyframes clovisCaret {
  0%, 100% { opacity: .14; }
  50% { opacity: .62; }
}


/* =========================================================
   v0.4.2 CHAT MANAGEMENT / TRANSFER
   ========================================================= */

.context-menu button[data-context-action="transfer"] {
  color: var(--accent);
}

.transfer-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
}

.transfer-overlay[hidden] { display: none; }

.transfer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 8, .42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.transfer-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: transferIn 190ms cubic-bezier(.2,.75,.2,1) both;
}

.transfer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.transfer-header h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -.02em;
}

.transfer-project-list {
  overflow-y: auto;
  padding: 10px;
}

.transfer-project-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.transfer-project-button:hover {
  background: var(--surface-2);
}

.transfer-project-button.new {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 6px;
}

.transfer-project-meta {
  color: var(--text-faint);
  font-size: 10px;
}

@keyframes transferIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Chat reordering */
.rail-item.reorder-target-before {
  box-shadow: inset 0 2px 0 var(--accent);
}

.rail-item.reorder-target-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Remove the old explicit drag-out-to-chats target. */
.rail-drop-root {
  display: none !important;
}


/* =========================================================
   v0.4.3 GENERATING INDICATOR + FREE SCROLLING
   ========================================================= */

.ai-generating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .005em;
}

.ai-generating-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 14px;
}

.ai-generating-dots i {
  width: 4px;
  height: 4px;
  display: block;
  border-radius: 999px;
  background: var(--accent);
  animation: clovisDotJump 900ms ease-in-out infinite;
}

.ai-generating-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.ai-generating-dots i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes clovisDotJump {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: .35;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-generating-dots i {
    animation: none !important;
    opacity: .65;
  }
}


/* =========================================================
   v0.4.4 MESSAGE TOOLS + TIMESTAMPS
   ========================================================= */

.message-meta {
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1;
  user-select: none;
}

.user-message .message-meta {
  text-align: right;
  padding-right: 4px;
}

.ai-message .message-meta {
  text-align: left;
}

.ai-bubble[data-message-id] {
  cursor: context-menu;
}

.message-context-menu button[data-message-action="regenerate"] {
  color: var(--accent);
}

.ai-message.is-regenerating .ai-bubble {
  opacity: .82;
}


/* =========================================================
   v0.4.5 MESSAGE POLISH
   ========================================================= */

/* User message layout: keep the bubble comfortably sized instead of
   allowing the timestamp wrapper to collapse the flex item. */
.user-message > .message-stack {
  width: fit-content;
  max-width: min(680px, 86%);
  display: grid;
  justify-items: end;
}

.user-message .user-bubble {
  max-width: 100%;
  width: fit-content;
  min-width: 0;
}

/* Clovis response layout stays tight and compact. */
.ai-message {
  gap: 4px;
}

.ai-bubble {
  margin: 0;
  padding: 0;
  min-height: 0;
}

.ai-generating {
  margin: 0;
  padding: 0;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.ai-generating-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 12px;
}

.ai-generating-dots i {
  width: 5px;
  height: 5px;
  display: block;
  border-radius: 999px;
  background: var(--accent) !important;
  animation: clovisDotJump 900ms ease-in-out infinite;
}

.ai-generating-dots i:nth-child(2) { animation-delay: 120ms; }
.ai-generating-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes clovisDotJump {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Right-click affordance for user messages too. */
.user-bubble[data-message-id] {
  cursor: context-menu;
}

/* Date separators */
.date-separator {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 8px 0 2px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .10em;
  text-transform: uppercase;
  user-select: none;
}

.date-separator::before,
.date-separator::after {
  content: "";
  height: 1px;
  background: color-mix(in srgb, var(--border) 78%, transparent);
}

.user-message-context-menu button[data-user-message-action="edit"] {
  color: var(--accent);
}

.rail-item.chat-dragging{opacity:.3!important;transform:scale(.97)}
.rail-item.reorder-target-before{box-shadow:inset 0 2px 0 var(--accent)}
.rail-item.reorder-target-after{box-shadow:inset 0 -2px 0 var(--accent)}
body.chat-drag-active,body.chat-drag-active *{cursor:grabbing!important}


/* =========================================================
   v0.4.7 PROVIDER FALLBACK POLISH
   ========================================================= */

/* In dark mode, Generating Call dots are white instead of green. */
html[data-theme="dark"] .ai-generating-dots i {
  background: #ffffff !important;
}

/* In light mode, keep the restrained Clovis green. */
html[data-theme="light"] .ai-generating-dots i {
  background: var(--accent) !important;
}


/* =========================================================
   v0.6.0 IMAGE GENERATION + B2 ATTACHMENTS
   ========================================================= */

.message-attachments {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  width: fit-content;
  max-width: min(640px, 86vw);
}

.user-message .message-attachments {
  justify-items: end;
}

.image-attachment-link {
  display: inline-block;
  text-decoration: none;
}

.image-attachment {
  display: block;
  width: auto;
  max-width: min(540px, 72vw);
  max-height: 72vh;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.18);
}

.image-attachment:hover {
  border-color: var(--border-strong);
}

.attachment-caption {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.4;
}


/* =========================================================
   v0.8.0 — CLOVIS CONTINUOUS VOICE CALL
   ========================================================= */

.voice-call-shell {
  position: relative;
  display: grid;
  place-items: end center;
}

.voice-call-controls {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 12px);
  width: 164px;
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px);
  transform-origin: bottom left;
  animation: voiceControlsIn 180ms ease both;
}

.voice-call-controls[hidden] {
  display: none;
}

.voice-call-status {
  padding: 5px 8px 4px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .17em;
}

.voice-call-control {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.voice-call-control:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-1px);
}

.voice-call-control.active {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
  color: var(--text);
}

.voice-call-control.danger {
  color: #d05c5c;
}

.voice-control-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .28;
}

.voice-call-control.active .voice-control-dot {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 48%, transparent);
}

.voice-control-icon {
  width: 9px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-size: 15px;
  line-height: 1;
}

.voice-button.call-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.voice-button.is-speaking {
  color: var(--accent);
}

.voice-button.is-speaking .voice-listening-dot {
  opacity: 1;
  background: var(--accent);
  animation: voiceSpeakingPulse .72s ease-in-out infinite;
}

.voice-button.is-muted {
  opacity: .62;
}

.voice-button.is-muted .voice-listening-dot {
  opacity: 0;
}

@keyframes voiceControlsIn {
  from {
    opacity: 0;
    transform: translateY(9px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes voiceSpeakingPulse {
  0%, 100% { transform: scale(.7); opacity: .42; }
  50% { transform: scale(1.15); opacity: 1; }
}

@media (max-width: 700px) {
  .voice-call-controls {
    width: 156px;
    left: 0;
    right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-call-controls,
  .voice-button.is-speaking .voice-listening-dot {
    animation: none;
  }
}

/* =========================================================
   v0.9.1 COMPACT B2 FILES — BUILT INTO THE CORE FOUR FILES
   ========================================================= */

.attach-wrap {
  position: relative;
  flex: 0 0 auto;
  align-self: flex-end;
  margin-bottom: 4px;
}

.attach-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.attach-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-1px);
}

.attach-button:disabled { opacity: .45; cursor: progress; transform: none; }

.attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 120;
  width: 208px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.attach-menu[hidden] { display: none; }

.attach-menu button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  padding: 0 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.attach-menu button:hover { background: var(--surface-2); }
.attach-menu button span { color: var(--text-faint); font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.attach-menu button strong { font-size: 11px; font-weight: 650; }

.file-tray {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}

.file-tray[hidden], .file-upload-status[hidden] { display: none; }

.pending-file-chip {
  min-width: 170px;
  max-width: min(360px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.pending-file-chip.folder { border-style: dashed; }
.pending-file-chip.image { min-width: 228px; }
.pending-image-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: block; }
.pending-file-icon { color: var(--text-faint); font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.pending-file-copy { min-width: 0; display: grid; gap: 2px; }
.pending-file-copy strong, .pending-file-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pending-file-copy strong { font-size: 11px; font-weight: 650; }
.pending-file-copy small { color: var(--text-faint); font-size: 9px; }
.pending-file-chip > button { width: 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 16px; }
.pending-file-chip > button:hover { background: var(--surface-2); color: var(--text); }

.file-upload-status {
  margin: 0 2px 7px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-attachment-card {
  min-width: 210px;
  max-width: min(460px, 78vw);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.file-attachment-card.folder { border-style: dashed; }
.file-attachment-card[href]:hover { border-color: var(--border-strong); background: var(--surface-3); }
.file-attachment-icon { color: var(--text-faint); font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.file-attachment-copy { min-width: 0; display: grid; gap: 3px; }
.file-attachment-copy strong, .file-attachment-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-attachment-copy strong { font-size: 11px; font-weight: 650; }
.file-attachment-copy small { color: var(--text-faint); font-size: 9px; }

.saved-files-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 6, .56);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.saved-files-panel {
  width: min(620px, 100%);
  max-height: min(720px, 84vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.saved-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
}

.saved-files-header > div { display: grid; gap: 3px; }
.saved-files-header span { color: var(--accent); font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.saved-files-header strong { font-size: 14px; font-weight: 650; }
.saved-files-header button { width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 20px; }

.saved-files-list { min-height: 160px; overflow-y: auto; padding: 10px; }
.saved-files-heading { padding: 11px 8px 6px; color: var(--text-faint); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.saved-files-empty { padding: 34px 18px; color: var(--text-faint); text-align: center; font-size: 11px; }

.saved-file-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  padding: 10px 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.saved-file-row:hover { background: var(--surface-2); }
.saved-file-kind { color: var(--text-faint); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.saved-file-copy { min-width: 0; display: grid; gap: 3px; }
.saved-file-copy strong, .saved-file-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.saved-file-copy strong { font-size: 12px; font-weight: 620; }
.saved-file-copy small { color: var(--text-faint); font-size: 9px; }
.saved-file-action { color: var(--text-faint); font-size: 8px; font-weight: 900; letter-spacing: .10em; }

@media (max-width: 760px) {
  .composer { gap: 7px; }
  .attach-button { width: 36px; height: 36px; border-radius: 11px; }
  .pending-file-chip { min-width: 148px; }
}



/* v0.9.3 — direct Bromero Storage upload path; file UI unchanged. */

/* =========================================================
   v0.10.0 DEEP THINKING STATUS
   ========================================================= */
.reasoning-status {
  width: fit-content;
  max-width: min(620px, 92%);
  margin: 2px 0 4px;
  color: #f7f7f7;
}

.reasoning-status-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  background: #070707;
  color: #f8f8f8;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  font: inherit;
  cursor: pointer;
}

.reasoning-status-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.reasoning-status-chevron {
  font-size: 18px;
  line-height: 1;
  opacity: .82;
  transition: transform .18s ease;
}

.reasoning-status.expanded .reasoning-status-chevron {
  transform: rotate(90deg);
}

.reasoning-status-panel {
  width: min(520px, calc(100vw - 56px));
  margin-top: 7px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: #0a0a0a;
  color: #f5f5f5;
  box-shadow: 0 14px 42px rgba(0,0,0,.24);
}

.reasoning-status-panel[hidden] { display: none !important; }

.reasoning-status-panel-header,
.reasoning-status-footer {
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .14em;
  opacity: .42;
}

.reasoning-status-list {
  display: grid;
  gap: 10px;
}

.reasoning-status-panel-header { margin-bottom: 10px; }

.reasoning-status-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.reasoning-status-dot {
  width: 5px;
  height: 5px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 38%, transparent);
}

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

.reasoning-status-copy strong {
  font-size: 11px;
  font-weight: 650;
}

.reasoning-status-copy small,
.reasoning-status-empty {
  color: rgba(255,255,255,.50);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.reasoning-status-footer {
  padding-top: 2px;
}

.reasoning-status.done .reasoning-status-button {
  background: #050505;
}

.reasoning-status.failed .reasoning-status-button {
  border-color: rgba(210,80,80,.32);
}

html[data-theme="light"] .reasoning-status-button,
html[data-theme="light"] .reasoning-status-panel {
  background: #090909;
  color: #fff;
}

@media (max-width: 620px) {
  .reasoning-status { max-width: 100%; }
  .reasoning-status-panel { width: min(500px, calc(100vw - 40px)); }
}


/* Clovis v0.10.1 — Previously Uploaded management */
.saved-asset-context-menu {
  position: fixed;
  z-index: 3200;
  width: 160px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}

.saved-asset-context-menu[hidden] {
  display: none !important;
}

.saved-asset-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.saved-asset-context-menu button:hover {
  background: var(--surface-2);
}

.saved-asset-context-menu button.danger {
  color: var(--danger, #c64d4d);
}

.saved-file-row {
  cursor: pointer;
}


/* =========================================================
   v0.10.2 — CLOVIS POLISH
   Markdown · CODEX · Workspace quick actions · Responsive controls
   ========================================================= */

/* -------------------------
   Rich assistant Markdown
   ------------------------- */

.ai-bubble.markdown-rendered > :first-child {
  margin-top: 0;
}

.ai-bubble.markdown-rendered > :last-child {
  margin-bottom: 0;
}

.md-paragraph {
  margin: 0 0 16px;
}

.md-heading {
  margin: 24px 0 10px;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -.025em;
}

h2.md-heading { font-size: 22px; }
h3.md-heading { font-size: 18px; }
h4.md-heading { font-size: 16px; }

.md-list {
  margin: 6px 0 18px;
  padding-left: 24px;
}

.md-list li {
  margin: 6px 0;
  padding-left: 2px;
}

.ai-bubble strong {
  font-weight: 760;
}

.ai-bubble em {
  font-style: italic;
}

.md-inline-code {
  display: inline;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
}

.md-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.md-link:hover {
  border-bottom-color: var(--accent);
}

.md-quote {
  margin: 12px 0 18px;
  padding: 11px 15px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
  color: var(--text-soft);
}

/* -------------------------
   CODEX blocks
   ------------------------- */

.codex-block {
  margin: 18px 0 22px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: #0d0f0e;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .13);
}

.codex-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 9px 8px 15px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: #121513;
}

.codex-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.codex-brand {
  color: #f1f4f1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

.codex-language {
  color: rgba(241,244,241,.42);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
}

.codex-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.codex-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  color: rgba(245,247,245,.72);
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.codex-actions button:hover {
  color: #fff;
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.075);
  transform: translateY(-1px);
}

.codex-actions .codex-cce-button {
  background: rgba(255,255,255,.09);
  color: #fff;
}

.codex-pre {
  margin: 0;
  max-height: 620px;
  overflow: auto;
  padding: 18px 20px 22px;
  color: #e8ece8;
  background: #0d0f0e;
  font: 12.5px/1.72 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
}

.codex-pre code {
  font: inherit;
}

html[data-theme="light"] .codex-block {
  border-color: rgba(0,0,0,.16);
}

/* -------------------------
   Workspace action gallery
   ------------------------- */

.launcher-secondary {
  grid-template-columns: minmax(260px, .9fr) minmax(330px, 1.1fr);
  grid-template-rows: 1fr;
  align-items: stretch;
  gap: clamp(24px, 4vw, 70px);
}

.launcher-content {
  align-self: start;
}

.workspace-action-gallery {
  min-width: 0;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(44px, 1fr));
  gap: 12px;
  width: min(580px, 100%);
  height: min(430px, 64vh);
  justify-self: end;
}

.workspace-action {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(.2,.75,.2,1),
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.workspace-action::before {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -34px;
  top: -38px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: .65;
}

.workspace-action:hover {
  transform: translateY(-4px) scale(1.012);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-strong));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
  box-shadow: 0 18px 42px rgba(0,0,0,.08);
}

.workspace-action-code {
  position: absolute;
  top: 15px;
  left: 17px;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .17em;
}

.workspace-action strong {
  font-size: clamp(13px, 1.5vw, 18px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.workspace-action small {
  max-width: 220px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.4;
}

.workspace-action-extensions {
  grid-column: 1 / 4;
  grid-row: 1 / 4;
  border-radius: 24px 44px 24px 24px;
}

.workspace-action-library {
  grid-column: 4 / 7;
  grid-row: 1 / 4;
  aspect-ratio: 1;
  justify-self: end;
  width: min(100%, 230px);
  border-radius: 999px;
  padding: 26px;
}

.workspace-action-uploaded {
  grid-column: 1 / 5;
  grid-row: 4 / 7;
  border-radius: 22px;
}

.workspace-action-call {
  grid-column: 5 / 7;
  grid-row: 4 / 7;
  border-radius: 999px;
  padding: 20px;
}

.nav-tile {
  user-select: none;
}

.nav-tile::after {
  content: "DOUBLE-CLICK TO OPEN";
  position: absolute;
  left: 18px;
  top: 16px;
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .12em;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.nav-tile:hover::after {
  opacity: .58;
  transform: translateY(0);
}

.nav-tile:hover .nav-tile-number {
  opacity: 0;
}

/* -------------------------
   Responsive floating controls
   ------------------------- */

@media (max-width: 760px) {
  .corner-controls {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 8px;
  }

  .voice-call-shell {
    place-items: end center;
  }

  .composer-shell,
  .app.rail-open .composer-shell {
    width: calc(100vw - 88px);
  }

  .launcher-secondary {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 18px;
    overflow: auto;
  }

  .workspace-action-gallery {
    justify-self: stretch;
    width: 100%;
    height: 300px;
    grid-template-rows: repeat(4, minmax(54px, 1fr));
    gap: 8px;
  }

  .workspace-action {
    padding: 13px;
    border-radius: 15px;
  }

  .workspace-action-extensions {
    grid-column: 1 / 4;
    grid-row: 1 / 3;
  }

  .workspace-action-library {
    grid-column: 4 / 7;
    grid-row: 1 / 3;
    width: 100%;
    aspect-ratio: auto;
    border-radius: 999px;
    padding: 14px;
  }

  .workspace-action-uploaded {
    grid-column: 1 / 5;
    grid-row: 3 / 5;
  }

  .workspace-action-call {
    grid-column: 5 / 7;
    grid-row: 3 / 5;
  }

  .workspace-action small {
    display: none;
  }
}

@media (max-width: 520px) {
  .composer-shell,
  .app.rail-open .composer-shell {
    width: calc(100vw - 82px);
    right: 10px;
    bottom: 10px;
  }

  .corner-controls {
    left: 10px;
    bottom: 10px;
  }

  .launcher-button,
  .voice-button {
    width: 46px;
    height: 46px;
  }

  .codex-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 11px;
  }

  .codex-actions {
    width: 100%;
  }

  .codex-actions button {
    flex: 1;
    padding: 0 7px;
  }

  .codex-pre {
    padding: 15px;
    font-size: 11.5px;
  }
}


/* =========================================================
   v0.10.3 — Workspace + CODEX proportion refinements
   ========================================================= */

/* Keep CODEX inside the exact same visual lane as assistant prose. */
.ai-row,
.ai-bubble,
.ai-bubble.markdown-rendered {
  min-width: 0;
}

.ai-bubble.markdown-rendered {
  width: 100%;
  max-width: 100%;
}

.codex-block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.codex-header,
.codex-pre {
  box-sizing: border-box;
  max-width: 100%;
}

.codex-pre {
  width: 100%;
  overflow-x: auto;
}

/* Prevent a long code line from forcing the whole conversation wider. */
.codex-pre code {
  display: block;
  min-width: max-content;
}

/* -------------------------
   Workspace: clean 2-column shell
   ------------------------- */

.launcher-body {
  position: relative;
}

.launcher-primary {
  position: relative;
  z-index: 2;
}

.launcher-secondary {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  padding: clamp(20px, 3vw, 36px);
  padding-left: clamp(26px, 3.5vw, 52px);
}

/* The old descriptive center copy is intentionally gone. */
.launcher-content {
  display: none !important;
}

.workspace-action-gallery {
  width: min(780px, 100%);
  height: auto;
  min-height: 0;
  align-self: flex-start;
  justify-self: auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  margin: 0;
}

/* All quick actions are now clean boxes. */
.workspace-action {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  border-radius: 18px;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.workspace-action::before {
  display: none;
}

.workspace-action:hover {
  transform: translateY(-2px);
}

/* Extensions: one long green rectangle across the top. */
.workspace-action-extensions {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  min-height: 128px;
  padding: 24px 26px;
  border-radius: 20px;
  background: #1f6f47;
  border-color: rgba(20, 82, 54, .32);
  color: #fff;
}

.workspace-action-extensions:hover {
  background: #247a50;
  border-color: rgba(20, 82, 54, .5);
}

.workspace-action-extensions .workspace-action-code {
  color: rgba(255,255,255,.58);
}

.workspace-action-copy {
  display: grid;
  gap: 5px;
}

.workspace-action-extensions strong {
  color: #fff;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1;
  letter-spacing: -.04em;
}

.workspace-action-extensions small {
  display: block;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.35;
}

.workspace-action-lower {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Library = pink box. */
.workspace-action-library {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  min-height: 150px;
  aspect-ratio: auto;
  justify-self: auto;
  padding: 20px;
  border-radius: 18px;
  background: #f3c4d7;
  border-color: rgba(176, 92, 127, .28);
  color: #2b1820;
}

.workspace-action-library:hover {
  background: #f6ccdd;
  border-color: rgba(176, 92, 127, .42);
}

.workspace-action-library .workspace-action-code {
  color: rgba(43,24,32,.42);
}

.workspace-action-library strong {
  color: #2b1820;
  font-size: clamp(17px, 1.7vw, 24px);
}

/* Previously Uploaded = yellow box. */
.workspace-action-uploaded {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  min-height: 150px;
  padding: 20px;
  border-radius: 18px;
  background: #f4df82;
  border-color: rgba(159, 128, 37, .26);
  color: #2b2410;
}

.workspace-action-uploaded:hover {
  background: #f7e58f;
  border-color: rgba(159, 128, 37, .42);
}

.workspace-action-uploaded .workspace-action-code {
  color: rgba(43,36,16,.42);
}

.workspace-action-uploaded strong {
  color: #2b2410;
  font-size: clamp(17px, 1.7vw, 24px);
}

.workspace-action-code {
  position: absolute;
  top: 16px;
  left: 18px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .16em;
}

.workspace-action-lower .workspace-action {
  align-items: flex-end;
}

/* Phone call floats separately near the lower-left of the right pane,
   immediately outside the nav divider. */
.workspace-call-button {
  position: absolute;
  left: 22px;
  bottom: 26px;
  z-index: 5;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #1f6f47;
  color: #fff;
  box-shadow: 0 14px 30px rgba(31, 111, 71, .22);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.workspace-call-button:hover {
  transform: translateY(-2px) scale(1.03);
  background: #247a50;
  box-shadow: 0 17px 36px rgba(31, 111, 71, .28);
}

.workspace-call-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Settings remains tucked to the lower-right. */
.launcher-secondary .settings-button {
  position: absolute;
  right: 24px;
  bottom: 22px;
}

/* Stack mic above launcher sooner so the composer gets room earlier. */
@media (max-width: 980px) {
  .corner-controls {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 8px;
  }

  .voice-call-shell {
    place-items: end center;
  }

  .composer-shell,
  .app.rail-open .composer-shell {
    width: calc(100vw - 92px);
  }
}

/* Workspace scales elegantly before mobile. */
@media (max-width: 1100px) {
  .launcher-secondary {
    padding-left: 28px;
  }

  .workspace-action-gallery {
    width: 100%;
  }

  .workspace-action-extensions {
    min-height: 112px;
  }

  .workspace-action-lower .workspace-action {
    min-height: 132px;
  }
}

@media (max-width: 760px) {
  .launcher-body {
    grid-template-columns: minmax(170px, 34%) 1fr;
  }

  .launcher-secondary {
    display: flex;
    padding: 16px;
    padding-bottom: 92px;
  }

  .workspace-action-gallery {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    gap: 10px;
  }

  .workspace-action-lower {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .workspace-action-extensions,
  .workspace-action-library,
  .workspace-action-uploaded {
    width: 100%;
    min-height: 86px;
    border-radius: 15px;
    padding: 16px;
  }

  .workspace-action-extensions strong {
    font-size: 20px;
  }

  .workspace-action-lower .workspace-action {
    min-height: 76px;
  }

  .workspace-call-button {
    left: 14px;
    bottom: 18px;
    width: 50px;
    height: 50px;
  }
}

/* Very narrow browser: keep CODEX controls usable without widening chat. */
@media (max-width: 560px) {
  .codex-header {
    gap: 9px;
  }

  .codex-actions {
    flex-wrap: wrap;
  }

  .codex-actions button {
    min-width: 0;
  }
}


/* =========================================================
   v0.10.4 — Live formatting + traceable web citations
   ========================================================= */

.md-citation-wrap {
  display: inline;
  position: relative;
  top: -.15em;
  margin-left: 2px;
  font-size: .72em;
  line-height: 0;
  vertical-align: super;
}

.md-citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.md-citation:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translateY(-1px);
}

.codex-streaming {
  position: relative;
}

.codex-streaming .codex-brand::after {
  content: " · WRITING";
  color: rgba(241,244,241,.34);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
}

.codex-stream-start {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 12px 0;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
}

/* Sources section stays compact rather than dominating the answer. */
.ai-bubble .md-heading + .md-list:last-child {
  font-size: 12px;
  color: var(--text-soft);
}



/* v0.10.5 — persisted reasoning summaries */
.reasoning-status.done {
  animation: reasoningRestoreIn 180ms ease both;
}

@keyframes reasoningRestoreIn {
  from { opacity: .82; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}



/* =========================================================
   v0.11.0 — CLOVIS LIBRARY
   ========================================================= */

.library-overlay,
.library-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
}

.library-backdrop,
.library-editor-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 8, .56);
  backdrop-filter: blur(12px);
}

.library-panel,
.library-editor-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: min(820px, 92vh);
  overflow: hidden;
  display: grid;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  isolation: isolate;
  box-shadow: 0 30px 90px rgba(0,0,0,.30);
}

.library-panel {
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
}

.library-header,
.library-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.library-header > div:first-child,
.library-editor-header > div:first-child {
  min-width: 0;
}

.library-kicker,
.library-editor-header span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .20em;
}

.library-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  letter-spacing: -.035em;
}

.library-header p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 11px;
}

.library-header-actions,
.library-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-header-actions button,
.library-editor-actions button,
.library-breadcrumb button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.library-add-files {
  min-height: 39px;
  padding: 0 15px;
  border-radius: 11px;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 780 !important;
}

.library-add-folder {
  min-height: 39px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: 10px !important;
  font-weight: 700 !important;
}

.library-close,
.library-editor-close {
  width: 39px;
  height: 39px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 20px !important;
}

.library-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.library-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 10px;
}

.library-breadcrumb button {
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: var(--text);
  font-weight: 720;
}

.library-breadcrumb strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-search-shell {
  width: min(340px, 50%);
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 39px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.library-search-shell span {
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .14em;
}

.library-search {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
}

.library-status {
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 9px;
}

.library-list {
  min-height: 260px;
  overflow: auto;
  padding: 12px 14px 22px;
}

.library-section-heading {
  padding: 12px 10px 7px;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .17em;
}

.library-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 130ms ease, transform 130ms ease;
}

.library-item:hover {
  background: var(--surface-2);
}

.library-item-type {
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .13em;
}

.library-item-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.library-item-copy strong,
.library-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-item-copy strong {
  font-size: 12px;
  font-weight: 720;
}

.library-item-copy small {
  color: var(--text-soft);
  font-size: 9px;
}

.library-item-hint {
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
}

.library-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 8px;
}

.library-empty {
  min-height: 230px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 30px;
  text-align: center;
  color: var(--text-soft);
}

.library-empty strong {
  color: var(--text);
  font-size: 13px;
}

.library-empty span {
  max-width: 420px;
  font-size: 10px;
}

.library-context-menu {
  position: fixed;
  z-index: 3900;
  width: 168px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(0,0,0,.24);
}

.library-context-menu[hidden] {
  display: none !important;
}

.library-context-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.library-context-menu button:hover {
  background: var(--surface-2);
}

.library-context-menu button.danger {
  color: var(--danger, #c84b4b);
}

/* Editor / preview */
.library-editor-panel {
  grid-template-rows: auto auto minmax(260px, 1fr);
  width: min(1120px, 100%);
  height: min(780px, 90vh);
}

.library-editor-header strong {
  display: block;
  max-width: min(720px, 62vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 18px;
}

.library-editor-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
}

.library-editor-meta {
  color: var(--text-soft);
  font-size: 9px;
}

.library-editor-actions button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 720;
}

.library-editor-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.library-editor-body {
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.library-editor-loading,
.library-editor-error,
.library-binary-preview {
  height: 100%;
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 30px;
  color: var(--text-soft);
  text-align: center;
}

.library-binary-preview strong {
  color: var(--text);
  font-size: 14px;
}

.library-binary-preview p {
  max-width: 520px;
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.library-text-editor {
  width: 100%;
  height: 100%;
  min-height: 420px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 22px 24px;
  background: #0d0f0e;
  color: #e8ece8;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

.library-pdf-preview {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #fff;
}

.library-image-preview {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}

@media (max-width: 760px) {
  .library-header,
  .library-editor-header,
  .library-toolbar,
  .library-editor-toolbar,
  .library-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .library-header-actions,
  .library-editor-actions {
    flex-wrap: wrap;
  }

  .library-search-shell {
    width: 100%;
  }

  .library-footer {
    gap: 5px;
  }

  .library-editor-panel {
    height: 92vh;
  }
}



/* v0.11.1 — Library must always be an opaque application surface. */
.library-panel,
.library-editor-panel {
  background-color: var(--surface) !important;
  opacity: 1;
}

.library-header,
.library-toolbar,
.library-list,
.library-footer,
.library-editor-header,
.library-editor-toolbar,
.library-editor-body {
  background-color: var(--surface);
}



/* =========================================================
   v0.12.2 — MOBILE VOICE + MOBILE WORKSPACE REBUILD
   ========================================================= */

/* -------------------------
   Full-screen Clovis call
   ------------------------- */

.voice-mobile-call {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background:
    radial-gradient(circle at 50% 32%,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent 34%),
    var(--bg);
}

.voice-mobile-call[hidden] {
  display: none !important;
}

.voice-mobile-call-screen {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  box-sizing: border-box;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface) 96%, var(--accent) 4%),
      var(--bg)
    );
}

.voice-mobile-call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.voice-mobile-call-header > div {
  display: grid;
  gap: 3px;
}

.voice-mobile-call-kicker {
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .19em;
}

.voice-mobile-call-header strong {
  color: var(--text);
  font-size: 15px;
  letter-spacing: -.02em;
}

.voice-mobile-minimize {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.voice-mobile-call-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  text-align: center;
}

.voice-mobile-orb {
  position: relative;
  width: min(42vw, 168px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
}

.voice-mobile-orb-ring {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  opacity: .4;
}

.voice-mobile-orb-ring.ring-two {
  inset: 12%;
  opacity: .64;
}

.voice-mobile-orb-core {
  position: relative;
  z-index: 2;
  width: 58%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 20px 60px color-mix(in srgb, var(--accent) 24%, transparent);
}

.voice-mobile-orb-core svg {
  width: 38%;
  height: 38%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-mobile-orb.is-listening .ring-one {
  animation: mobileCallRing 1.5s ease-out infinite;
}

.voice-mobile-orb.is-listening .ring-two {
  animation: mobileCallRing 1.5s .34s ease-out infinite;
}

.voice-mobile-orb.is-speaking .voice-mobile-orb-core {
  animation: mobileCallSpeaking .85s ease-in-out infinite;
}

.voice-mobile-orb.is-muted {
  opacity: .54;
}

.voice-mobile-orb.has-error .voice-mobile-orb-core {
  background: #b95252;
}

@keyframes mobileCallRing {
  0% { transform: scale(.76); opacity: .7; }
  100% { transform: scale(1.16); opacity: 0; }
}

@keyframes mobileCallSpeaking {
  0%, 100% { transform: scale(.96); }
  50% { transform: scale(1.04); }
}

.voice-mobile-call-main h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1;
  letter-spacing: -.055em;
}

.voice-mobile-call-status {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
}

.voice-mobile-call-timer {
  margin-top: 7px;
  color: var(--text-faint);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}

.voice-mobile-transcript {
  width: min(560px, 100%);
  min-height: 72px;
  margin-top: 28px;
  padding: 16px 18px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.voice-mobile-mode {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 16px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-2);
}

.voice-mobile-mode button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.voice-mobile-mode button.active {
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, var(--border));
}

.voice-mobile-call-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(430px, 100%);
  justify-self: center;
  padding-top: 18px;
}

.voice-mobile-call-action {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.voice-mobile-call-action.active {
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.voice-mobile-call-action.end {
  border-color: rgba(190, 75, 75, .22);
  background: #b74e4e;
  color: #fff;
}

.voice-mobile-action-icon {
  font-size: 20px;
  line-height: 1;
}

@media (min-width: 901px) {
  .voice-mobile-call {
    display: none !important;
  }
}

/* -------------------------
   Definitive mobile Workspace
   ------------------------- */

@media (max-width: 760px) {
  .launcher-overlay {
    overflow: hidden;
  }

  .launcher-panel {
    inset: 8px !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    border-radius: 24px !important;
  }

  .launcher-header {
    min-height: 72px;
    padding: 14px 16px !important;
  }

  .launcher-header h2 {
    font-size: 25px !important;
  }

  .launcher-body {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1px minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .launcher-primary {
    min-width: 0 !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 102px !important;
    gap: 8px !important;
    padding: 12px !important;
  }

  .nav-tile {
    min-width: 0 !important;
    min-height: 102px !important;
    height: 102px !important;
    align-content: end !important;
    gap: 4px !important;
    padding: 11px 9px !important;
    border-radius: 15px !important;
  }

  .nav-tile::after {
    display: none !important;
  }

  .nav-tile-number {
    top: 10px !important;
    right: 10px !important;
    font-size: 8px !important;
  }

  .nav-tile-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(11px, 3.2vw, 14px) !important;
  }

  .nav-tile-copy {
    display: none !important;
  }

  .launcher-divider {
    width: 100% !important;
    height: 1px !important;
  }

  .launcher-secondary {
    min-height: 0 !important;
    overflow-y: auto !important;
    display: block !important;
    padding: 14px 14px 94px !important;
  }

  .workspace-action-gallery {
    width: 100% !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 10px !important;
  }

  .workspace-action-extensions {
    width: 100% !important;
    min-height: 96px !important;
    padding: 18px !important;
    border-radius: 17px !important;
  }

  .workspace-action-extensions strong {
    font-size: 22px !important;
  }

  .workspace-action-extensions small {
    display: block !important;
    margin-top: 3px;
    font-size: 10px !important;
  }

  .workspace-action-lower {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .workspace-action-library,
  .workspace-action-uploaded {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 112px !important;
    padding: 15px !important;
    border-radius: 16px !important;
  }

  .workspace-action-library strong,
  .workspace-action-uploaded strong {
    font-size: clamp(14px, 4vw, 18px) !important;
    line-height: 1.08 !important;
  }

  .workspace-action-code {
    top: 12px !important;
    left: 13px !important;
  }

  .workspace-call-button {
    left: 14px !important;
    bottom: 18px !important;
    width: 52px !important;
    height: 52px !important;
  }

  .launcher-secondary .settings-button {
    right: 14px !important;
    bottom: 18px !important;
    min-height: 42px !important;
    max-width: calc(100% - 88px);
  }
}

@media (max-width: 390px) {
  .launcher-primary {
    gap: 6px !important;
    padding: 10px !important;
  }

  .nav-tile {
    padding: 10px 7px !important;
  }

  .workspace-action-lower {
    grid-template-columns: 1fr !important;
  }

  .workspace-action-library,
  .workspace-action-uploaded {
    min-height: 82px !important;
  }
}



/* =========================================================
   v0.13.0 — PDF creation + editing
   ========================================================= */

.pdf-action-status {
  width: min(100%, 620px);
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.pdf-action-status-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.pdf-action-status.error {
  color: #b85050;
  border-color: rgba(184,80,80,.24);
}



/* v0.13.1 — PDF job reliability */
.pdf-action-status-copy {
  min-width: 0;
}

.pdf-action-status {
  box-shadow: 0 8px 28px rgba(0,0,0,.04);
}



/* v0.13.2 — PDF artifact lifecycle */
.pdf-action-status.error {
  white-space: normal;
  line-height: 1.45;
  font-weight: 720;
}

.file-attachment-card.file[href*="/api/files/"] {
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

.file-attachment-card.file[href*="/api/files/"]:hover {
  transform: translateY(-1px);
}



/* v0.14.0 — mixed files → PDF */
.pdf-action-status[data-mode="combine"] .pdf-action-status-icon {
  background: color-mix(in srgb, var(--accent) 82%, #ffffff 18%);
}



/* =========================================================
   v0.15.0 — Excel editing
   ========================================================= */

.excel-action-status-icon {
  width: 40px;
  background: #1f7a4d;
  letter-spacing: .04em;
}

.excel-action-status {
  border-color: color-mix(in srgb, #1f7a4d 22%, var(--border));
}



/* v0.16.0 — Excel creation */
.excel-action-status .pdf-action-status-copy {
  min-width: 0;
}



/* v0.16.1 — Excel creation repair reliability */
.excel-action-status.error {
  white-space: normal;
  line-height: 1.45;
}



/* =========================================================
   v0.16.2 — live math + chemistry rendering
   ========================================================= */

.clovis-math-inline {
  display: inline-block;
  max-width: 100%;
  vertical-align: -0.08em;
  margin: 0 .02em;
}

.clovis-math-display {
  width: 100%;
  max-width: 100%;
  margin: 14px 0;
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.clovis-math-display .katex-display {
  margin: 0;
  text-align: left;
}

.clovis-math .katex {
  font-size: 1.02em;
}

.clovis-math-display .katex {
  font-size: 1.08em;
}

.clovis-math-fallback {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92em;
  opacity: .8;
}

@media (max-width: 680px) {
  .clovis-math-display {
    margin: 10px 0;
  }

  .clovis-math-display .katex {
    font-size: 1em;
  }
}


/* =========================================================
   v0.16.3 — model resilience + standby
   ========================================================= */

.reasoning-status.standby-exhausted .reasoning-status-button {
  border-color: rgba(186, 145, 48, .34);
}

.standby-unavailable {
  color: var(--text);
  opacity: .82;
}

html[data-theme="dark"] .standby-unavailable {
  color: rgba(255,255,255,.78);
}



/* =========================================================
   v0.16.4 — renderer stability
   ========================================================= */

/*
  Let Chromium skip layout/paint work for old messages far outside the
  viewport. This substantially lowers long-conversation rendering pressure.
*/
.message {
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

/*
  Large CODEX panels should not invalidate layout/paint for the entire chat.
*/
.codex-block {
  contain: layout paint style;
}

/*
  v0.16.4 asks KaTeX for HTML-only output. This rule is an extra deployment
  guard in case a stale cached message contains a MathML accessibility tree.
*/
.clovis-math .katex-mathml {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* =========================================================
   CLOVIS v0.17.2 — HIDDEN SEARCH VIEW
   Light-mode search facade, responsive desktop + phone.
   ========================================================= */

.hidden-search-view {
  --hs-bg: #fff;
  --hs-text: #202124;
  --hs-soft: #5f6368;
  --hs-border: #dadce0;
  --hs-link: #1a0dab;
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--hs-bg);
  color: var(--hs-text);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden-search-view[hidden] { display: none !important; }
html.clovis-hidden-search, html.clovis-hidden-search body { background:#fff !important; color-scheme:light !important; }
html.clovis-hidden-search body { overflow:hidden !important; }

.hidden-search-header {
  min-height: 92px;
  display:grid;
  grid-template-columns:104px minmax(260px,690px) 1fr auto auto;
  align-items:center;
  gap:18px;
  padding:19px 28px 11px;
  background:#fff;
}
.hidden-google-logo { width:max-content; font-size:29px; line-height:1; letter-spacing:-1.8px; user-select:none; }
.hidden-google-logo .g-blue{color:#4285f4}.hidden-google-logo .g-red{color:#ea4335}.hidden-google-logo .g-yellow{color:#fbbc05}.hidden-google-logo .g-green{color:#34a853}
.hidden-search-box { min-height:46px; display:flex; align-items:center; gap:16px; padding:0 17px 0 20px; border:1px solid #dfe1e5; border-radius:24px; background:#fff; box-shadow:0 1px 6px rgba(32,33,36,.16); font-size:16px; }
.hidden-mobile-g{display:none;font-weight:700;color:#4285f4}.hidden-search-query{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hidden-search-tools{color:#5f6368;font-size:22px;white-space:nowrap}
.hidden-search-header-icons{display:flex;gap:17px;align-items:center;color:#3c4043;font-size:20px}.hidden-search-account{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#5f6368;color:#fff;font-size:14px}
.hidden-search-tabs{border-bottom:1px solid #ebebeb;background:#fff}.hidden-search-tabs-inner{width:min(930px,calc(100vw - 210px));margin-left:154px;display:flex;align-items:end;gap:25px;min-height:45px;color:#5f6368;font-size:13px;white-space:nowrap;overflow:hidden}.hidden-search-tabs-inner span{height:45px;display:flex;align-items:center;border-bottom:3px solid transparent}.hidden-search-tabs-inner .active{color:#202124;border-bottom-color:#1a73e8}

.hidden-search-main{width:min(1100px,calc(100vw - 210px));margin-left:154px;padding:13px 0 48px}.hidden-search-count{margin-bottom:20px;color:#70757a;font-size:12px}
.hidden-dog-hero{width:min(940px,100%);display:grid;grid-template-columns:minmax(0,560px) minmax(280px,340px);gap:28px;margin-bottom:26px;padding-top:2px}.hidden-dog-main{min-width:0}.hidden-dog-title-row{display:flex;align-items:center;gap:14px;margin-bottom:18px}.hidden-dog-heading{font-size:28px;line-height:1.12}.hidden-dog-subtitle{margin-top:5px;color:#5f6368;font-size:13px}
.hidden-dog-gallery{display:grid;grid-template-columns:2fr 1fr 1fr;grid-template-rows:128px 128px;gap:3px;height:259px;overflow:hidden;border-radius:18px}.hidden-dog-gallery img{width:100%;height:100%;object-fit:cover;display:block}.hidden-dog-gallery-main{grid-row:1/3}.hidden-dog-gallery img:nth-child(4){grid-column:2/4;grid-row:2;object-position:center}.hidden-dog-definition{margin-top:12px;color:#3c4043;font-size:14px;line-height:1.55}.hidden-dog-definition mark{background:#dbe7ff;color:#174ea6;padding:1px 2px}.hidden-dog-definition span{color:#70757a;font-size:11px}.hidden-show-more,.hidden-see-more{width:100%;margin-top:15px;min-height:42px;border:1px solid #c5d1e8;border-radius:999px;background:#fff;color:#3c4043;font-weight:600}.hidden-show-more span{margin-left:8px}
.hidden-dog-facts{margin-top:66px;padding-left:18px;border-left:1px solid #dadce0}.hidden-fact-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hidden-fact-pair>div,.hidden-fact-wide{display:grid;gap:7px;padding:15px;border-radius:16px;background:#f1f3f4}.hidden-fact-pair small,.hidden-fact-wide small{font-size:12px;color:#5f6368}.hidden-fact-pair strong,.hidden-fact-wide strong{font-size:18px;font-weight:500}.hidden-fact-pair span{font-size:12px}.hidden-fact-wide{margin-top:10px;grid-template-columns:1fr auto;align-items:center}.hidden-fact-wide strong{font-size:13px}.hidden-people-search-title{margin-top:22px;padding-top:20px;border-top:1px solid #dadce0;font-size:16px}.hidden-people-search-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:12px}.hidden-people-search-grid img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:8px}.hidden-people-search-grid span{display:block;margin-top:5px;font-size:12px;line-height:1.2}.hidden-see-more{border:0;background:#f1f3f4;margin-top:17px}

.hidden-search-overview{width:min(690px,100%);margin:0 0 30px;padding:18px 20px 14px;border:1px solid #e0e3e7;border-radius:16px;background:#fff;box-shadow:0 1px 2px rgba(60,64,67,.08)}.hidden-overview-kicker{display:flex;align-items:center;gap:8px;margin-bottom:14px;color:#3c4043;font-size:18px;font-weight:500}.hidden-spark{color:#5f6368;font-size:16px}.hidden-overview-answer{color:#202124;font-size:14px;line-height:1.62}.hidden-overview-answer:empty{display:none}.hidden-overview-answer p,.hidden-result-snippet p{margin:0 0 8px}.hidden-overview-answer p:last-child,.hidden-result-snippet p:last-child{margin-bottom:0}.hidden-overview-answer .katex,.hidden-result-snippet .katex{font-size:1em}.hidden-overview-footer{margin-top:13px;padding-top:10px;border-top:1px solid #edf0f2;color:#70757a;font-size:11px}.hidden-overview-footer span{color:#1a73e8}

.hidden-search-results{width:min(690px,100%);display:grid;gap:31px}.hidden-search-result{min-width:0}.hidden-result-source{display:flex;align-items:center;gap:10px;color:#202124;font-size:13px}.hidden-result-favicon{width:28px;height:28px;display:grid;place-items:center;flex:0 0 28px;border-radius:50%;background:#f1f3f4;color:#5f6368;font-size:11px;font-weight:700}.hidden-result-domain{margin-top:2px;color:#4d5156;font-size:11px}.hidden-result-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:start}.hidden-result-title{margin:6px 0 5px;color:#1a0dab;font-size:20px;line-height:1.25;font-weight:400;cursor:pointer}.hidden-result-title:hover{text-decoration:underline}.hidden-result-snippet{color:#4d5156;font-size:14px;line-height:1.58;overflow-wrap:anywhere}.hidden-result-thumb{width:140px;height:92px;object-fit:cover;border-radius:9px;margin-top:7px}.hidden-result-snippet ul,.hidden-result-snippet ol{margin:6px 0 0 20px;padding:0}.hidden-result-snippet pre,.hidden-result-snippet .codex-block{max-width:100%;margin:8px 0 0;border:1px solid #e0e3e7;border-radius:10px;background:#f8f9fa;color:#202124;box-shadow:none}.hidden-result-snippet code{font-size:12px}
.hidden-people-ask,.hidden-related-searches,.hidden-search-footer{width:min(690px,100%)}.hidden-people-ask{margin-top:34px;border-top:1px solid #ebebeb}.hidden-people-ask h2,.hidden-related-searches h2{margin:18px 0 8px;font-size:21px;font-weight:400}.hidden-people-ask>div{min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid #ebebeb;color:#202124;font-size:15px}.hidden-related-searches{margin-top:30px}.hidden-related-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px 12px}.hidden-related-grid span{min-height:47px;display:flex;align-items:center;padding:0 18px;border-radius:24px;background:#f1f3f4;color:#202124;font-size:14px}.hidden-search-footer{display:flex;flex-wrap:wrap;gap:18px;margin-top:42px;padding:18px 0 4px;border-top:1px solid #ebebeb;color:#70757a;font-size:12px}
.hidden-search-view .markdown-rendered h1,.hidden-search-view .markdown-rendered h2,.hidden-search-view .markdown-rendered h3,.hidden-search-view .markdown-rendered h4{margin:8px 0 4px;font-size:14px;line-height:1.45;font-weight:600}.hidden-search-view .markdown-rendered blockquote{margin:6px 0;padding-left:10px;border-left:2px solid #dadce0}.hidden-search-view .reasoning-status,.hidden-search-view .message-meta,.hidden-search-view .ai-label{display:none!important}

@media (max-width:760px){
  .hidden-search-header{min-height:auto;grid-template-columns:1fr auto auto;gap:12px;padding:14px 14px 10px}.hidden-google-logo{display:none}.hidden-search-box{grid-column:1;min-height:50px;padding-left:16px;background:#f1f3f4;box-shadow:none;border:0}.hidden-mobile-g{display:inline}.hidden-search-header-icons{grid-column:2;font-size:18px;gap:12px}.hidden-search-account{grid-column:3}.hidden-search-tabs-inner,.hidden-search-main{width:100%;margin-left:0}.hidden-search-tabs-inner{min-height:48px;gap:24px;padding:0 14px;overflow-x:auto;scrollbar-width:none}.hidden-search-tabs-inner::-webkit-scrollbar{display:none}.hidden-search-tabs-inner span{height:48px}.hidden-search-main{padding:9px 14px 34px}.hidden-search-count{display:none}
  .hidden-dog-hero{display:block;width:100%;margin-bottom:28px}.hidden-dog-title-row{margin:20px 0}.hidden-dog-heading{font-size:29px}.hidden-dog-gallery{height:296px;grid-template-rows:147px 147px;border-radius:18px}.hidden-dog-definition{font-size:16px;line-height:1.5}.hidden-show-more{min-height:50px;margin-top:18px}.hidden-dog-facts{margin-top:28px;padding:28px 0 0;border-left:0;border-top:1px solid #dadce0}.hidden-fact-pair>div,.hidden-fact-wide{background:#f1f3f4}.hidden-people-search-title,.hidden-people-search-grid,.hidden-see-more{display:none}
  .hidden-search-overview{width:100%;margin-left:0;margin-right:0;padding:17px 16px 14px;border-radius:15px}.hidden-overview-kicker{font-size:17px}.hidden-overview-answer,.hidden-result-snippet{font-size:14px}.hidden-search-results{width:100%;gap:29px}.hidden-result-title{font-size:19px}.hidden-result-thumb{width:118px;height:82px}.hidden-people-ask,.hidden-related-searches,.hidden-search-footer{width:100%}.hidden-related-grid{grid-template-columns:1fr}
}


/* v0.17.2 hidden -> chat snap disintegration */
.hidden-snap-layer{position:fixed;inset:0;z-index:12000;pointer-events:none;overflow:hidden;contain:strict}
.hidden-snap-piece{position:absolute;display:block;transform:translate3d(0,0,0) rotate(0deg) scale(1);opacity:1;filter:blur(0);transform-origin:center;will-change:transform,opacity,filter}
.hidden-snap-layer.go .hidden-snap-piece{animation:hiddenSnapPiece 780ms cubic-bezier(.22,.72,.22,1) var(--delay,0ms) forwards}
@keyframes hiddenSnapPiece{0%{transform:translate3d(0,0,0) rotate(0deg) scale(1);opacity:1;filter:blur(0)}30%{opacity:.97}100%{transform:translate3d(var(--dx,60px),var(--dy,-20px),0) rotate(var(--rot,7deg)) scale(.74);opacity:0;filter:blur(2.4px)}}
.hidden-snap-dust-only i{position:absolute;width:7px;height:7px;border-radius:2px;background:#dadce0;box-shadow:0 0 0 1px rgba(32,33,36,.06);opacity:0}
.hidden-snap-dust-only.go i{animation:hiddenSnapDust 720ms ease-out var(--delay,0ms) forwards}
@keyframes hiddenSnapDust{0%{opacity:.86;transform:translate3d(0,0,0) rotate(0) scale(1)}100%{opacity:0;transform:translate3d(var(--dx,50px),var(--dy,-20px),0) rotate(var(--rot,12deg)) scale(.25)}}
@media (prefers-reduced-motion:reduce){.hidden-snap-layer{display:none!important}}


/* =========================================================
   v0.17.3 — DISCRETE MODE WORKSPACE ENTRY + IMAGE FALLBACKS
   ========================================================= */

.workspace-action-discrete {
  min-height: 104px;
  margin-top: 16px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
}

.workspace-action-discrete:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--border-strong));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
}

.workspace-action-discrete .workspace-action-code {
  color: var(--accent);
}

.hidden-dog-gallery img.hidden-dog-image-missing {
  background:
    radial-gradient(circle at 32% 28%, #e6ece8 0 12%, transparent 13%),
    linear-gradient(145deg, #dfe5e1, #cbd3ce);
}

@media (max-width: 760px) {
  .workspace-action-discrete {
    min-height: 92px;
    margin-top: 10px;
  }
}


/* =========================================================
   v0.17.4 — DISCRETE UX / EXPANDED ANSWER / HIDDEN ASK BAR
   ========================================================= */

/* Remove the old hover instruction from chat workspace cards. */
.nav-tile::after { content: none !important; display: none !important; }
.nav-tile:hover .nav-tile-number { opacity: 1 !important; }

/* Workspace color coding. */
.nav-tile[data-section="general"] {
  background: #e5f2e8;
  border-color: #9cc9aa;
  color: #18221b;
}
.nav-tile[data-section="projects"] {
  background: #eee6f8;
  border-color: #c6ace4;
  color: #24182f;
}
.nav-tile[data-section="chats"] {
  background: #e4effb;
  border-color: #a9c7e9;
  color: #172536;
}
.nav-tile[data-section="general"].active { background:#dceddf; border-color:#6eaa7f; }
.nav-tile[data-section="projects"].active { background:#e5d8f5; border-color:#a681d1; }
.nav-tile[data-section="chats"].active { background:#d9e9fa; border-color:#78a9d9; }

/* Discrete Mode should read as a deliberate black utility card. */
.workspace-action-discrete {
  background: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}
.workspace-action-discrete:hover {
  background: #1b1b1b !important;
  border-color: #2c2c2c !important;
}
.workspace-action-discrete .workspace-action-code,
.workspace-action-discrete strong { color:#fff !important; }
.workspace-action-discrete small { color:rgba(255,255,255,.72) !important; }

/* Expanded latest Clovis answer from the fake Google Show more button. */
.hidden-full-answer {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  padding: 24px;
}
.hidden-full-answer[hidden] { display:none !important; }
.hidden-full-answer-backdrop {
  position:absolute;
  inset:0;
  background:rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hidden-full-answer-card {
  position:relative;
  width:min(820px, 100%);
  max-height:min(82vh, 900px);
  overflow:auto;
  border:1px solid #dadce0;
  border-radius:20px;
  background:#fff;
  box-shadow:0 18px 60px rgba(60,64,67,.22);
  color:#202124;
}
.hidden-full-answer-card header {
  position:sticky; top:0; z-index:2;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:18px 20px;
  border-bottom:1px solid #eceff1;
  background:rgba(255,255,255,.96);
  font-size:18px; font-weight:500;
}
.hidden-full-answer-card header button {
  width:36px; height:36px; border:0; border-radius:50%; background:#f1f3f4;
  color:#5f6368; cursor:pointer; font-size:22px; line-height:1;
}
.hidden-full-answer-content { padding:20px; font-size:15px; line-height:1.72; }
.hidden-full-answer-note {
  padding:12px 20px 18px; border-top:1px solid #eceff1; color:#70757a; font-size:11px;
}
.hidden-full-answer-note span { color:#1a73e8; }

/* Floating Google-flavored hidden-mode composer. */
.hidden-ask-bar {
  position:fixed;
  z-index:10020;
  left:50%;
  bottom:max(24px, env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(720px, calc(100vw - 40px));
  min-height:58px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 9px 8px 14px;
  border:1px solid #dfe1e5;
  border-radius:30px;
  background:#fff;
  box-shadow:0 8px 28px rgba(60,64,67,.24);
}
.hidden-ask-bar[hidden] { display:none !important; }
.hidden-ask-g {
  display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px;
  border-radius:50%; background:#f1f3f4; color:#4285f4; font-weight:800; font-size:18px;
}
.hidden-ask-bar input {
  min-width:0; flex:1; border:0; outline:0; background:transparent; color:#202124;
  font:inherit; font-size:15px;
}
.hidden-ask-bar input::placeholder { color:#70757a; }
.hidden-ask-submit {
  min-height:40px; padding:0 16px; border:0; border-radius:20px;
  background:#1a73e8; color:#fff; font-weight:600; cursor:pointer;
}
.hidden-ask-close {
  width:38px; height:38px; border:0; border-radius:50%; background:transparent;
  color:#5f6368; cursor:pointer; font-size:22px;
}
.hidden-show-more { cursor:pointer !important; }

@media (max-width:760px) {
  .hidden-full-answer { padding:10px; }
  .hidden-full-answer-card { width:100%; max-height:88vh; border-radius:18px; }
  .hidden-full-answer-content { padding:16px; font-size:14px; }
  .hidden-ask-bar {
    bottom:max(12px, env(safe-area-inset-bottom));
    width:calc(100vw - 20px);
    min-height:54px;
    padding-left:10px;
  }
  .hidden-ask-submit { padding:0 13px; }
}


/* =========================================================
   v0.17.5 — INLINE SHOW MORE + VIEWPORT-STICKY ASK BAR
   ========================================================= */

/* Full latest answer expands exactly where Google's Show more lives. */
.hidden-inline-answer {
  margin-top: 16px;
  padding: 16px 0 2px;
  border-top: 1px solid #e5e7ea;
  color: #202124;
  font-size: 14px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.hidden-inline-answer[hidden] { display: none !important; }
.hidden-inline-answer p { margin: 0 0 10px; }
.hidden-inline-answer p:last-child { margin-bottom: 0; }
.hidden-inline-answer ul,
.hidden-inline-answer ol { margin: 8px 0 10px 22px; padding: 0; }
.hidden-inline-answer pre,
.hidden-inline-answer .codex-block {
  max-width: 100%;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid #e0e3e7;
  border-radius: 10px;
  background: #f8f9fa;
  color: #202124;
}
.hidden-inline-answer .katex { font-size: 1em; }
.hidden-show-more[aria-expanded="true"] { margin-top: 14px; }

/* This form is a direct child of the fixed hidden view, so it follows the
   viewport rather than the long fake-results document. */
#hidden-search-view > .hidden-ask-bar {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  top: auto !important;
  transform: translateX(-50%) !important;
  z-index: 10150 !important;
  width: min(720px, calc(100vw - 40px)) !important;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 8px 9px 8px 14px;
  border: 1px solid #dfe1e5;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(60,64,67,.24);
  font-family: Arial, Helvetica, sans-serif;
}
#hidden-search-view > .hidden-ask-bar[hidden] { display: none !important; }
#hidden-search-view > .hidden-ask-bar .hidden-ask-g {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f3f4;
  color: #4285f4;
  font-weight: 800;
  font-size: 18px;
}
#hidden-search-view > .hidden-ask-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: #202124;
  font: inherit;
  font-size: 15px;
}
#hidden-search-view > .hidden-ask-bar .hidden-ask-submit {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
#hidden-search-view > .hidden-ask-bar .hidden-ask-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  font-size: 22px;
}

@media (max-width: 760px) {
  .hidden-inline-answer { font-size: 15px; line-height: 1.62; }
  #hidden-search-view > .hidden-ask-bar {
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    width: calc(100vw - 20px) !important;
    min-height: 54px;
    padding-left: 10px;
  }
  #hidden-search-view > .hidden-ask-bar .hidden-ask-submit { padding: 0 13px; }
}


/* =========================================================
   v0.18.3 — FOLLOW-UP QUEUE + PERSISTENT MESSAGE REFERENCES
   ========================================================= */

.message-queue-status {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: .01em;
  text-align: right;
}

.user-message.is-queued .user-bubble {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.user-message.is-processing .user-bubble {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
}

.user-message.is-processing .message-queue-status {
  color: var(--accent);
}

/* Text-message-style references. Clovis stays green; the relationship copy is quiet gray. */
.ai-reference-thread,
.user-reference-thread {
  width: min(680px, 88%);
  margin: 1px 0 5px;
  padding: 0 2px 7px;
  color: var(--text-soft);
}

.user-reference-thread {
  width: min(620px, 100%);
  margin-left: auto;
  text-align: right;
}

.reference-thread-line {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.reference-thread-name {
  color: var(--accent);
  font-weight: 800;
}

.user-reference-thread .reference-thread-name {
  color: var(--text);
}

.reference-thread-action {
  color: var(--text-faint);
  font-weight: 600;
}

.reference-thread-quote {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 62%, var(--border));
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.42;
}

.user-reference-thread .reference-thread-quote {
  padding-left: 0;
  padding-right: 10px;
  border-left: 0;
  border-right: 2px solid color-mix(in srgb, var(--accent) 42%, var(--border));
}

.ai-reply-files {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 9px;
}

.message-reference-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 8px;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
  box-shadow: var(--shadow-soft);
}

.message-reference-bar[hidden] { display: none; }

.message-reference-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.message-reference-copy strong {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.message-reference-copy span {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reference-clear {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 17px;
}

.message-reference-clear:hover {
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 760px) {
  .ai-reference-thread,
  .user-reference-thread {
    width: 100%;
  }
}



/* v0.18.3 — Clovis reference label lives on the existing CLOVIS line. */
.ai-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ai-label-name {
  color: var(--accent);
}

.ai-label-reference-action {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
}

.ai-reference-thread {
  margin-top: -2px;
}

.ai-reference-thread .reference-thread-quote {
  margin-top: 0;
}


/* v0.19.3 — canvas-backed image previews + attachment-only turns */
.user-bubble[hidden] { display: none !important; }
.image-attachment-canvas {
  width: auto;
  height: auto;
  max-width: min(540px, 72vw);
  max-height: 72vh;
  object-fit: contain;
}
.image-attachment-canvas:not([data-ready="1"]),
.pending-image-canvas:not([data-ready="1"]) {
  min-width: 58px;
  min-height: 58px;
  background:
    linear-gradient(110deg, transparent 25%, color-mix(in srgb, var(--surface-2) 70%, transparent) 45%, transparent 65%),
    var(--surface-2);
  background-size: 220% 100%;
  animation: clovisImagePreviewLoading 1.15s linear infinite;
}
.pending-image-canvas {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.image-preview-failed {
  animation: none !important;
  background: var(--surface-2) !important;
}
@keyframes clovisImagePreviewLoading {
  to { background-position: -220% 0; }
}


/* =========================================================
   v0.19.4 — BASIC MARKDOWN TABLE RENDERING
   ========================================================= */
.ai-bubble .md-table-shell {
  width: 100%;
  max-width: 100%;
  margin: 14px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-overflow-scrolling: touch;
}

.ai-bubble .md-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.ai-bubble .md-table th,
.ai-bubble .md-table td {
  padding: 11px 13px;
  vertical-align: top;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ai-bubble .md-table th:last-child,
.ai-bubble .md-table td:last-child {
  border-right: 0;
}

.ai-bubble .md-table tbody tr:last-child td {
  border-bottom: 0;
}

.ai-bubble .md-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface-2) 92%, var(--surface));
  font-weight: 750;
  white-space: nowrap;
}

.ai-bubble .md-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 36%, transparent);
}

.ai-bubble .md-table code {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .ai-bubble .md-table-shell {
    margin-left: 0;
    margin-right: 0;
    border-radius: 12px;
  }

  .ai-bubble .md-table {
    min-width: 520px;
    font-size: 12px;
  }

  .ai-bubble .md-table th,
  .ai-bubble .md-table td {
    padding: 10px 11px;
  }
}

.hidden-search-view .md-table-shell {
  overflow-x: auto;
  border: 1px solid #dadce0;
  border-radius: 12px;
  margin: 12px 0;
}

.hidden-search-view .md-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  color: #202124;
  font-size: 13px;
}

.hidden-search-view .md-table th,
.hidden-search-view .md-table td {
  padding: 9px 11px;
  border: 1px solid #dadce0;
  vertical-align: top;
}

.hidden-search-view .md-table th {
  background: #f8f9fa;
  font-weight: 600;
}


/* =========================================================
   v0.19.5 — WIDE DESKTOP CHAT + CHEMISTRY TYPOGRAPHY
   ========================================================= */

.chem-formula {
  display: inline-block;
  white-space: nowrap;
  font-variant-numeric: lining-nums;
}

.chem-formula sub,
.chem-formula sup {
  position: relative;
  font-size: .72em;
  line-height: 0;
}

.chem-formula sub { bottom: -.18em; }
.chem-formula sup { top: -.36em; }

@media (min-width: 1100px) {
  /* Use roughly three quarters of a large display instead of constraining
     long explanations/tables to the old 820px column. */
  .messages {
    width: min(75vw, 1440px);
  }

  .composer-shell {
    width: min(72vw, 1280px);
  }

  /* When the context rail is open, size against the remaining chat area so
     the content never hides underneath the rail. */
  .app.rail-open .messages {
    width: min(82%, 1180px);
  }

  .app.rail-open .composer-shell {
    width: min(72%, 1080px);
  }
}


/* =========================================================
   v0.19.6 — HIDDEN VIEW READABILITY
   Keep the disguise readable even when rendered Markdown carries
   muted theme colors from the normal Clovis chat.
   ========================================================= */
.hidden-search-view {
  --hs-readable-text: #3c4043;
  --hs-readable-link: #1a0dab;
}

/* Search-page copy is always a legible dark gray. This deliberately
   overrides normal-chat markdown/theme colors that can leak into the
   hidden renderer. */
.hidden-search-view .hidden-search-main,
.hidden-search-view .hidden-search-main p,
.hidden-search-view .hidden-search-main li,
.hidden-search-view .hidden-search-main ul,
.hidden-search-view .hidden-search-main ol,
.hidden-search-view .hidden-search-main strong,
.hidden-search-view .hidden-search-main em,
.hidden-search-view .hidden-search-main b,
.hidden-search-view .hidden-search-main i,
.hidden-search-view .hidden-search-main small,
.hidden-search-view .hidden-search-main span:not(.hidden-spark),
.hidden-search-view .hidden-search-main h1,
.hidden-search-view .hidden-search-main h2,
.hidden-search-view .hidden-search-main h3,
.hidden-search-view .hidden-search-main h4,
.hidden-search-view .hidden-search-main blockquote,
.hidden-search-view .hidden-result-source,
.hidden-search-view .hidden-result-domain,
.hidden-search-view .hidden-result-snippet,
.hidden-search-view .hidden-overview-answer,
.hidden-search-view .hidden-overview-kicker,
.hidden-search-view .hidden-search-count,
.hidden-search-view .hidden-search-footer {
  color: var(--hs-readable-text) !important;
  opacity: 1 !important;
}

/* Search-result/source links use familiar Google blue; ordinary copy stays dark gray. */
.hidden-search-view .hidden-result-title,
.hidden-search-view .hidden-search-main a,
.hidden-search-view .hidden-overview-footer a,
.hidden-search-view .hidden-overview-footer span {
  color: var(--hs-readable-link) !important;
  opacity: 1 !important;
}

.hidden-search-view .hidden-result-title:hover,
.hidden-search-view .hidden-search-main a:hover {
  color: #174ea6 !important;
}

/* Preserve intentional non-copy treatments. */
.hidden-search-view .hidden-dog-definition mark {
  color: #174ea6 !important;
}
.hidden-search-view .hidden-result-favicon {
  color: #5f6368 !important;
}


/* v0.19.8 — deterministic chemistry typography post-pass */
.chem-postprocessed sub,.chem-postprocessed sup{font-size:.72em;line-height:0;position:relative}.chem-postprocessed sub{bottom:-.18em}.chem-postprocessed sup{top:-.36em}
