:root {
  --bg: #0b0d12;
  --bg-alt: #151a24;
  --bg-spot-1: #1f2b40;
  --bg-spot-2: #1b3a2c;
  --bg-bottom: #07090d;
  --panel: #0f131b;
  --panel-bright: #1a2030;
  --panel-highlight: rgba(255, 255, 255, 0.05);
  --text: #eef2f7;
  --muted: #a5b0c0;
  --accent: #6ae6c9;
  --accent-bright: #9af7e0;
  --accent-2: #ffb86c;
  --accent-2-bright: #ffd39a;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 60px rgba(3, 8, 18, 0.55);
  --glow-1: rgba(106, 230, 201, 0.08);
  --glow-2: rgba(255, 184, 108, 0.1);
  --body-pattern: url("../img/transparent_logo_no_text/black\ logo\ 500px\ padding.png");
  --pattern-opacity: 0.9;
  --nav-bg: rgba(10, 14, 20, 0.9);
  --nav-border: rgba(255, 255, 255, 0.1);
  --nav-shadow: 0 14px 30px rgba(3, 8, 18, 0.35);
  --nav-hover-border: rgba(106, 230, 201, 0.45);
  --nav-hover-shadow: 0 8px 16px rgba(106, 230, 201, 0.12);
  --nav-dropdown-bg: rgba(10, 14, 20, 0.95);
  --nav-dropdown-border: rgba(255, 255, 255, 0.12);
  --nav-dropdown-shadow: 0 16px 30px rgba(3, 8, 18, 0.4);
  --nav-wallet-bg: rgba(106, 230, 201, 0.12);
  --nav-wallet-border: rgba(106, 230, 201, 0.35);
  --nav-btn-ghost-bg: rgba(255, 184, 108, 0.12);
  --nav-btn-ghost-border: rgba(255, 184, 108, 0.4);
  --ticker-border: rgba(255, 255, 255, 0.08);
  --ticker-bg: linear-gradient(180deg, rgba(10, 12, 18, 0.98), rgba(6, 8, 12, 0.92));
  --ticker-shadow: 0 -18px 40px rgba(2, 6, 12, 0.6);
  --ticker-item-bg: rgba(15, 19, 27, 0.7);
  --ticker-item-border: rgba(255, 255, 255, 0.12);
  --ticker-image-bg: #0f131b;
  --surface-1: rgba(11, 14, 20, 0.8);
  --surface-2: rgba(9, 12, 18, 0.8);
  --surface-3: rgba(15, 19, 27, 0.7);
  --surface-4: rgba(15, 19, 27, 0.8);
  --surface-5: rgba(15, 19, 27, 0.85);
  --surface-6: rgba(15, 19, 27, 0.9);
  --surface-7: rgba(15, 19, 27, 0.95);
  --surface-8: rgba(10, 12, 18, 0.9);
  --surface-9: rgba(10, 12, 18, 0.8);
  --surface-10: rgba(10, 12, 18, 0.78);
  --surface-11: rgba(10, 12, 18, 0.6);
  --surface-12: #0b0d12;
  --surface-13: #0f131b;
  --surface-14: rgba(6, 10, 18, 0.75);
  --surface-15: rgba(11, 14, 20, 0.7);
  --surface-16: rgba(12, 16, 24, 0.7);
  --surface-17: rgba(11, 13, 18, 0.85);
  --surface-18: rgba(255, 255, 255, 0.04);
  --surface-19: rgba(255, 255, 255, 0.08);
  --rail-fade: rgba(15, 19, 27, 0.6);
  --scrollbar-track: rgba(15, 19, 27, 0.6);
  --scrollbar-thumb-border: rgba(11, 14, 20, 0.9);
  --code-bg: rgba(6, 10, 18, 0.75);
  --code-inline-bg: rgba(255, 255, 255, 0.08);
  --text-subtle: rgba(255, 255, 255, 0.75);
  --text-faint: rgba(255, 255, 255, 0.6);
  --info-muted: var(--muted);
  --danger-bg: rgba(255, 107, 107, 0.14);
  --danger-border: rgba(255, 107, 107, 0.35);
  --danger-text: #ffd6d6;
  --danger-hover-text: #ffecec;
  --btn-on-accent: #062018;
  --btn-on-danger: #2a0606;
  --ad-text: var(--text);
  --ad-bg: var(--surface-4);
  --chip-border: rgba(255, 255, 255, 0.1);
  --chip-border-weak: rgba(255, 255, 255, 0.12);
  --ad-creative-bg: linear-gradient(135deg, rgba(106, 230, 201, 0.2), rgba(10, 12, 18, 0.95));
  --ad-creative-border: rgba(255, 255, 255, 0.12);
  --ad-creative-inner-border: rgba(10, 12, 18, 0.45);
  --app-max-width-on: 1100px;
  --app-max-width-off: 100%;
  --app-max-width: var(--app-max-width-on);
  --color-scheme: dark;
}

html {
  color-scheme: var(--color-scheme, dark);
}

html[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-alt: #eef1f6;
  --bg-spot-1: #dde8ff;
  --bg-spot-2: #d6f3e6;
  --bg-bottom: #f0f2f5;
  --panel: #ffffff;
  --panel-bright: #f6f8fb;
  --panel-highlight: rgba(0, 0, 0, 0.03);
  --text: #0f1624;
  --muted: #51607a;
  --accent: #0aa27e;
  --accent-bright: #6ae6c9;
  --accent-2: #d57a22;
  --accent-2-bright: #ffb86c;
  --border: rgba(12, 18, 30, 0.12);
  --shadow: 0 28px 50px rgba(12, 18, 30, 0.14);
  --glow-1: rgba(10, 162, 126, 0.15);
  --glow-2: rgba(213, 122, 34, 0.18);
  --pattern-opacity: 0.25;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --nav-border: rgba(12, 18, 30, 0.12);
  --nav-shadow: 0 12px 24px rgba(12, 18, 30, 0.14);
  --nav-hover-border: rgba(10, 162, 126, 0.45);
  --nav-hover-shadow: 0 8px 16px rgba(10, 162, 126, 0.18);
  --nav-dropdown-bg: rgba(255, 255, 255, 0.98);
  --nav-dropdown-border: rgba(12, 18, 30, 0.12);
  --nav-dropdown-shadow: 0 14px 26px rgba(12, 18, 30, 0.18);
  --nav-wallet-bg: rgba(10, 162, 126, 0.12);
  --nav-wallet-border: rgba(10, 162, 126, 0.35);
  --nav-btn-ghost-bg: rgba(213, 122, 34, 0.12);
  --nav-btn-ghost-border: rgba(213, 122, 34, 0.35);
  --ticker-border: rgba(12, 18, 30, 0.12);
  --ticker-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 251, 0.96));
  --ticker-shadow: 0 -16px 30px rgba(12, 18, 30, 0.18);
  --ticker-item-bg: rgba(246, 248, 251, 0.9);
  --ticker-item-border: rgba(12, 18, 30, 0.12);
  --ticker-image-bg: #f2f4f7;
  --surface-1: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(248, 250, 252, 0.96);
  --surface-3: rgba(246, 248, 251, 0.9);
  --surface-4: rgba(246, 248, 251, 0.96);
  --surface-5: rgba(255, 255, 255, 0.98);
  --surface-6: rgba(255, 255, 255, 0.92);
  --surface-7: rgba(248, 250, 252, 0.98);
  --surface-8: rgba(246, 248, 251, 0.96);
  --surface-9: rgba(246, 248, 251, 0.92);
  --surface-10: rgba(248, 250, 252, 0.9);
  --surface-11: rgba(235, 240, 247, 0.85);
  --surface-12: #f2f4f7;
  --surface-13: #ffffff;
  --surface-14: rgba(233, 238, 245, 0.9);
  --surface-15: rgba(248, 250, 252, 0.9);
  --surface-16: rgba(246, 248, 251, 0.9);
  --surface-17: rgba(240, 244, 249, 0.95);
  --surface-18: rgba(12, 18, 30, 0.05);
  --surface-19: rgba(12, 18, 30, 0.12);
  --rail-fade: rgba(246, 248, 251, 0.85);
  --scrollbar-track: rgba(225, 232, 242, 0.9);
  --scrollbar-thumb-border: rgba(246, 248, 251, 0.95);
  --code-bg: rgba(233, 238, 245, 0.9);
  --code-inline-bg: rgba(15, 22, 36, 0.08);
  --text-subtle: rgba(15, 22, 36, 0.7);
  --text-faint: rgba(15, 22, 36, 0.55);
  --chip-border: rgba(12, 18, 30, 0.18);
  --chip-border-weak: rgba(12, 18, 30, 0.12);
  --ad-creative-bg: linear-gradient(135deg, rgba(10, 162, 126, 0.18), rgba(255, 255, 255, 0.95));
  --ad-creative-border: rgba(12, 18, 30, 0.12);
  --ad-creative-inner-border: rgba(12, 18, 30, 0.12);
  --danger-bg: rgba(255, 110, 110, 0.16);
  --danger-border: rgba(255, 110, 110, 0.45);
  --danger-text: #7a1f1f;
  --danger-hover-text: #5c1414;
  --btn-on-accent: #0b1f18;
  --btn-on-danger: #4b1111;
  --ad-text: var(--text);
  --ad-bg: var(--surface-4);
  --color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 15% 10%, var(--bg-spot-1) 0%, transparent 60%),
    radial-gradient(900px 600px at 85% 20%, var(--bg-spot-2) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-bottom));
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  --page-pad-top: 24px;
  --page-pad-bottom: 24px;
  --page-pad-x: 24px;
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, var(--glow-1), transparent 45%),
    radial-gradient(circle at 80% 60%, var(--glow-2), transparent 50%),
    var(--body-pattern);
  background-repeat: no-repeat, no-repeat, space;
  background-size: cover, cover, 50px 50px;
  pointer-events: none;
  opacity: var(--pattern-opacity);
}

.app {
  background: linear-gradient(135deg, var(--panel-highlight), transparent 60%), var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body.ad-mode-on {
  --app-max-width: var(--app-max-width-on);
}

body:not(.ad-mode-on) {
  --app-max-width: var(--app-max-width-off);
}

body.ad-mode-on .wallet-label {
  display: none;
}

body.ad-mode-on .nav-toggle,
body.ad-mode-on .ad-toggle,
body.ad-mode-on .req-toggle,
body.ad-mode-on .raw-toggle,
body.ad-mode-on .contrib-button {
  padding: 6px 10px;
  font-size: 11px;
}

body.ad-mode-on .composer {
  gap: 10px;
}

body.ad-mode-on .composer button {
  padding: 10px 14px;
  font-size: 13px;
}

.app::after {
  content: "";
  position: absolute;
  inset: -40% 40% auto -20%;
  height: 300px;
  background: radial-gradient(circle, rgba(106, 230, 201, 0.2), transparent 70%);
  filter: blur(12px);
  opacity: 0.7;
  pointer-events: none;
}

.app-grid {
  display: grid;
  --rail-width: clamp(180px, 22vw, 280px);
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: min(640px, 100%);
  height: 100%;
  position: relative;
  transition: grid-template-columns 0.25s ease;
}

.rail {
  background: linear-gradient(180deg, var(--panel-bright), var(--rail-fade));
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  height: 100%;
  width: var(--rail-width);
  transition: transform 0.25s ease, opacity 0.2s ease, width 0.25s ease, padding 0.25s ease;
  scrollbar-gutter: stable;
}

.rail-toggle {
  position: absolute;
  top: 50%;
  left: calc(var(--rail-width) + 10px);
  transform: translate(-50%, -50%);
  width: 14px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: left 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
  opacity: 0.6;
}

.rail-toggle:hover {
  opacity: 1;
}

.rail-toggle::before {
  content: "<";
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.app-grid.is-rail-collapsed .rail-toggle::before {
  content: ">";
}

.app-grid.is-rail-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-grid.is-rail-collapsed .rail {
  transform: translateX(-100%);
  opacity: 0;
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
  pointer-events: none;
}

.app-grid.is-rail-collapsed .rail-toggle {
  left: 0;
  transform: translate(6px, -50%);
}

.rail-card--conversations {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.rail > * {
  flex-shrink: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.chat-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-brand-logo-img {
  display: block;
  height: 120px;
  width: auto;
}

.chat-brand-logo-img--light {
  display: none;
}

html[data-theme="light"] .chat-brand-logo-img--dark {
  display: none;
}

html[data-theme="light"] .chat-brand-logo-img--light {
  display: block;
}

.chat-brand-tagline {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.rail-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.rail-dropdown {
  padding: 0;
  overflow: hidden;
}

.rail-dropdown-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.rail-dropdown-summary::-webkit-details-marker {
  display: none;
}

.rail-dropdown-summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

.rail-dropdown[open] .rail-dropdown-summary::after {
  content: "-";
  border-color: rgba(106, 230, 201, 0.5);
  background: rgba(106, 230, 201, 0.12);
  color: var(--text);
}

.rail-dropdown-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 14px;
}

.rail-dropdown-body {
  border-top: 1px solid var(--border);
  padding: 12px 18px 16px;
  display: grid;
  gap: 14px;
}

.rail-dropdown-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.rail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rail-card-head h2 {
  margin: 0;
}

.conv-new {
  border: 1px solid rgba(106, 230, 201, 0.4);
  background: rgba(106, 230, 201, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.conv-new--full {
  width: 100%;
  margin: 6px 0 12px;
  padding: 10px 12px;
  text-align: center;
}

.conv-new:hover {
  border-color: rgba(106, 230, 201, 0.7);
  box-shadow: 0 8px 16px rgba(106, 230, 201, 0.18);
  transform: translateY(-1px);
}

.conv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
  flex: 1 1 auto;
  min-height: 0;
}

.conv-row {
  position: relative;
}

.conv-item {
  border: 1px solid var(--chip-border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 72px 10px 12px;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 4px;
  font-size: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.conv-item:hover {
  border-color: rgba(106, 230, 201, 0.55);
  box-shadow: 0 8px 16px rgba(106, 230, 201, 0.12);
  transform: translateY(-1px);
}

.conv-item.active {
  border-color: rgba(106, 230, 201, 0.8);
  box-shadow: 0 0 0 1px rgba(106, 230, 201, 0.35);
}

.conv-delete {
  position: absolute;
  top: 50%;
  right: 8px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 2;
  transform: translateY(-50%);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.conv-delete:hover {
  border-color: rgba(255, 107, 107, 0.75);
  color: var(--danger-hover-text);
  transform: translateY(calc(-50% - 1px));
}

.conv-delete:active {
  transform: translateY(calc(-50% + 1px));
}

.conv-row.is-confirming .conv-delete {
  border-color: rgba(255, 184, 108, 0.65);
  color: var(--text);
}

.conv-row.is-error .conv-delete {
  border-color: rgba(255, 107, 107, 0.6);
  color: var(--danger-text);
}

.conv-delete-hint {
  font-size: 10px;
  color: var(--muted);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.15s ease, max-height 0.2s ease;
}

.conv-row.is-confirming .conv-delete-hint,
.conv-row.is-error .conv-delete-hint {
  opacity: 0.9;
  max-height: 40px;
}

.conv-row.is-error .conv-delete-hint {
  color: var(--danger-text);
}

.conv-title {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

.conv-meta {
  color: var(--muted);
  font-size: 11px;
}

.conv-empty {
  border: 1px dashed var(--chip-border-weak);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.ad-slot {
  border: none;
  border-radius: 18px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  text-align: left;
  padding: 10px;
  width: 100%;
  pointer-events: auto;
  flex: 1 1 0;
  min-height: 0;
  /* box-shadow: 0 12px 24px rgba(3, 10, 18, 0.45); */
  position: absolute;
  z-index: 0;
  isolation: isolate;
}

.ad-slot::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px dashed rgba(106, 230, 201, 0.45);
  border-radius: inherit;
  background: rgba(106, 230, 201, 0.06);
  pointer-events: none;
  z-index: -2;
}

.ad-slot > * {
  position: relative;
  z-index: 1;
}

.ad-creative {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  border: 1px solid var(--ad-creative-border);
  box-shadow: inset 0 0 0 1px var(--ad-creative-inner-border);
  background: var(--ad-creative-bg);
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.ad-creative::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 55%);
  opacity: 0.8;
  pointer-events: none;
}

.ad-creative > * {
  position: relative;
  z-index: 1;
}

.ad-creative-image {
  padding: 0;
}

.ad-creative-image::before {
  display: none;
}

.ad-creative-text {
  background: var(--ad-bg, var(--ad-creative-bg));
  color: var(--ad-text, var(--text));
  font-family: var(--ad-font, "Space Grotesk", system-ui, sans-serif);
  justify-content: center;
  align-items: center;
  text-align: center;
}

.ad-creative-text .ad-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.ad-text {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  text-align: center;
  width: 100%;
}

.ad-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.ad-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ad-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.ad-badge {
  display: none;
}

.ad-tracker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ad-theme-cyan {
  background: linear-gradient(145deg, rgba(106, 230, 201, 0.35), rgba(10, 12, 18, 0.95));
}

.ad-theme-ember {
  background: linear-gradient(145deg, rgba(255, 184, 108, 0.38), rgba(12, 14, 18, 0.95));
}

.ad-theme-slate {
  background: linear-gradient(145deg, rgba(120, 150, 190, 0.32), rgba(9, 12, 18, 0.95));
}

.ad-theme-mint {
  background: linear-gradient(145deg, rgba(138, 244, 210, 0.28), rgba(8, 11, 18, 0.96));
}

.ad-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-subtle);
}

.ad-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-copy {
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ad-cta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  color: var(--accent-2);
}

.ad-size {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
}


.ad-slot-square {
  --ad-row-span: 1;
  --ad-col-span: 1;
}

.ad-slot-rect {
  --ad-row-span: 2;
  --ad-col-span: 1;
}

.ad-slot-banner {
  --ad-row-span: 1;
  --ad-col-span: 2;
  border-radius: 0;
}

.ad-slot-banner .ad-creative {
  border-radius: 0;
}

.ad-slot-tall {
  --ad-row-span: 3;
  --ad-col-span: 1;
}

.ad-shape-wide .ad-text {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.ad-shape-square .ad-text,
.ad-shape-rect .ad-text {
  -webkit-line-clamp: 3;
}

.ad-shape-tall .ad-text {
  font-size: 15px;
  -webkit-line-clamp: 6;
}


.rail-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.rail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.rail-card .tip-list,
.rail-card .prompt-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.rail-card .tip-list li,
.rail-card .prompt-list li{ margin-bottom: 6px; }
.rail-card .tip-list strong{ font-weight: 600; color: var(--text); }

.nav-toggle{
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-15);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.nav-toggle:hover{ border-color: rgba(106, 230, 201, 0.6); box-shadow: 0 8px 16px rgba(106,230,201,0.18); transform: translateY(-1px); }

.raw-toggle{
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-15);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.raw-toggle:hover{ border-color: rgba(106, 230, 201, 0.6); box-shadow: 0 8px 16px rgba(106,230,201,0.18); transform: translateY(-1px); }
.raw-toggle.is-on{
  border-color: rgba(106, 230, 201, 0.6);
  background: rgba(106, 230, 201, 0.12);
}

.ad-toggle {
  border: 1px solid rgba(255, 184, 108, 0.4);
  background: rgba(255, 184, 108, 0.12);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ad-toggle:hover {
  border-color: rgba(255, 184, 108, 0.7);
  box-shadow: 0 8px 16px rgba(255, 184, 108, 0.18);
  transform: translateY(-1px);
}
.ad-toggle.is-on {
  border-color: rgba(106, 230, 201, 0.6);
  background: rgba(106, 230, 201, 0.12);
}


.side-nav{
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  max-width: 80vw;
  background: linear-gradient(180deg, rgba(15,19,27,1.0), rgba(10,12,18,1.0));
  border-right: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  z-index: 12000;
  transform: translateX(-100%);
  transition: transform .2s ease-out;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
}
.side-nav.open{ transform: translateX(0); }
.side-nav-head{
  display:flex; align-items:center; justify-content: space-between;
  font-weight:700; font-size:15px; color: var(--text);
}
.side-nav-head button{
  background:none; border:1px solid rgba(255,255,255,0.12); color: var(--text);
  border-radius:10px; padding:4px 10px; cursor:pointer;
}
.side-nav-links{
  list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:0;
}
.side-nav-links > li{ margin-bottom:12px; }
.side-nav-links > li:last-child{ margin-bottom:0; }
.side-nav-links a{
  display:block;
  color: var(--text); text-decoration:none; font-weight:600; padding:10px 12px;
  border:1px solid rgba(255,255,255,0.08); border-radius:12px;
  background: rgba(255,255,255,0.02);
  line-height: 1.4;
}
.side-nav-links a:hover{
  border-color: rgba(106,230,201,0.6);
  box-shadow: 0 10px 18px rgba(106,230,201,0.15);
}
.side-nav-group details{
  display: block;
}
.side-nav-group summary{
  list-style: none;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  color: var(--text);
  text-decoration:none;
  font-weight:600;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  background: rgba(255,255,255,0.02);
  line-height: 1.4;
}
.side-nav-group summary:hover{
  border-color: rgba(106,230,201,0.6);
  box-shadow: 0 10px 18px rgba(106,230,201,0.15);
}
.side-nav-group summary::-webkit-details-marker{
  display:none;
}
.side-nav-group summary::after{
  content: "v";
  font-size: 12px;
  color: var(--muted);
  transition: transform .18s ease;
}
.side-nav-group details[open] summary::after{
  transform: rotate(180deg);
}
.side-nav-group details[open] summary{
  border-color: rgba(106,230,201,0.6);
  box-shadow: 0 10px 18px rgba(106,230,201,0.15);
}
.side-nav-sub{
  list-style:none;
  padding:10px 12px 12px;
  margin:6px 0 0;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  background: rgba(8,10,16,0.6);
  display:grid;
  gap:8px;
  animation: nav-drop .18s ease;
}
.side-nav-sub a{
  font-weight:500;
  font-size: 13px;
  border-radius:10px;
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.01);
}
@keyframes nav-drop{
  from{ opacity:0; transform: translateY(-6px); }
  to{ opacity:1; transform: translateY(0); }
}
.side-nav-bottom{
  margin-top:auto;
  padding-top:12px;
  border-top:1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-nav-bottom a{
  display: block;
  color: var(--accent-2);
  text-decoration:none;
  font-weight:600;
}
.side-nav-overlay{
  position: fixed;
  inset: 0;
  background: rgba(5,7,10,0.55);
  z-index: 11000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease-out;
}
.side-nav-overlay.open{
  opacity: 1;
  pointer-events: auto;
}

.null-prompts-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: none;
  background-color: var(--panel) !important;
  background-image: none !important;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate;
}

.null-prompts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: none;
  background-color: var(--panel-bright) !important;
  background-image: none !important;
  opacity: 1 !important;
}

.null-prompts-head h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
}

.null-prompts-count {
  border: 1px solid rgba(106, 230, 201, 0.4);
  background: rgba(106, 230, 201, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.null-prompts-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
  background: none;
  background-color: var(--panel) !important;
  background-image: none !important;
  opacity: 1 !important;
}

.null-prompts-item {
  border: 1px solid var(--chip-border-weak);
  border-radius: 12px;
  background: none;
  background-color: var(--panel-bright) !important;
  background-image: none !important;
  opacity: 1 !important;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.null-prompts-text {
  margin: 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
}

.null-prompts-meta {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.null-prompts-load {
  justify-self: start;
  border: 1px solid rgba(255, 184, 108, 0.45);
  background: rgba(255, 184, 108, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.null-prompts-load:hover {
  border-color: rgba(255, 184, 108, 0.75);
}

.null-prompts-empty {
  border: 1px dashed var(--chip-border-weak);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(106, 230, 201, 0.4);
  background: rgba(106, 230, 201, 0.08);
  width: fit-content;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(106, 230, 201, 0.7);
}

.chat {
  padding: 32px 36px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  position: relative;
  z-index: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 260px;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 240px;
  min-width: 0;
}

.contrib-button {
  border: 1px solid rgba(106, 230, 201, 0.4);
  background: rgba(106, 230, 201, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.contrib-button:hover {
  border-color: rgba(106, 230, 201, 0.7);
  box-shadow: 0 10px 20px rgba(106, 230, 201, 0.2);
  transform: translateY(-1px);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallet-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: normal;
  flex: 0 1 auto;
  max-width: 100%;
}

.wallet-amount {
  font-weight: 600;
  color: var(--text);
}

.wallet-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.wallet-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.chat-header div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-header h2 {
  margin: 0;
  font-size: 22px;
}

.chat-header span {
  color: var(--muted);
  font-size: 14px;
}

.chat-thread-title {
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-link {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--chip-border-weak);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--surface-3);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-link:hover {
  border-color: rgba(106, 230, 201, 0.6);
  box-shadow: 0 12px 24px rgba(106, 230, 201, 0.15);
  transform: translateY(-1px);
}


.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
  min-height: 0;
}

.messages-loading {
  align-self: stretch;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

.messages-loading-text {
  line-height: 1;
}

/* Scrollbar styling */
.messages,
.rail,
.doc-modal-flow {
  scrollbar-width: thin;
  scrollbar-color: rgba(106, 230, 201, 0.55) var(--scrollbar-track);
}

.messages::-webkit-scrollbar,
.rail::-webkit-scrollbar,
.doc-modal-flow::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-track,
.rail::-webkit-scrollbar-track,
.doc-modal-flow::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

.messages::-webkit-scrollbar-thumb,
.rail::-webkit-scrollbar-thumb,
.doc-modal-flow::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(106, 230, 201, 0.85), rgba(106, 230, 201, 0.35));
  border-radius: 999px;
  border: 2px solid var(--scrollbar-thumb-border);
}

.messages::-webkit-scrollbar-thumb:hover,
.rail::-webkit-scrollbar-thumb:hover,
.doc-modal-flow::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(106, 230, 201, 1), rgba(106, 230, 201, 0.55));
}

.rail {
  scrollbar-color: transparent transparent;
}

.rail:hover {
  scrollbar-color: rgba(106, 230, 201, 0.55) var(--scrollbar-track, rgba(15, 19, 27, 0.6));
}

.rail::-webkit-scrollbar-track,
.rail::-webkit-scrollbar-thumb {
  background: transparent;
  border-color: transparent;
}

.rail:hover::-webkit-scrollbar-track {
  background: var(--scrollbar-track, rgba(15, 19, 27, 0.6));
}

.rail:hover::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(106, 230, 201, 0.85), rgba(106, 230, 201, 0.35));
  border-color: var(--scrollbar-thumb-border, rgba(11, 14, 20, 0.9));
}

.bubble {
  max-width: 85%;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 15px;
  position: relative;
  animation: float-in 0.35s ease forwards;
  opacity: 0;
  transform: translateY(8px);
}

.bubble.user {
  align-self: flex-end;
  background: linear-gradient(120deg, rgba(106, 230, 201, 0.18), rgba(106, 230, 201, 0.05));
  border: 1px solid rgba(106, 230, 201, 0.35);
}

.bubble.ai {
  align-self: flex-start;
  background: var(--surface-4);
  border: 1px solid var(--border);
}

.bubble .meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bubble-share-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bubble-share-btn {
  border: 1px solid rgba(106, 230, 201, 0.5);
  background: rgba(106, 230, 201, 0.14);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
}

.bubble-share-btn--text {
  border-color: rgba(255, 184, 108, 0.45);
  background: rgba(255, 184, 108, 0.13);
}

.bubble-share-btn--inbox {
  border-color: rgba(122, 162, 255, 0.5);
  background: rgba(122, 162, 255, 0.14);
}

.bubble-share-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.bubble-share-status {
  font-size: 11px;
  color: var(--muted);
}

body.share-preview-open {
  overflow: hidden;
}

body.share-to-inbox-open {
  overflow: hidden;
}

.share-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9950;
  background: rgba(4, 8, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.share-preview-card {
  width: min(840px, 95vw);
  max-height: min(92vh, 940px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.share-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-preview-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

#share-preview-close {
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-15);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.share-preview-image-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-6);
  min-height: 220px;
  max-height: 58vh;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px;
}

#share-preview-image {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
}

.share-preview-platforms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-platform-btn {
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.share-platform-btn:hover {
  border-color: rgba(106, 230, 201, 0.65);
  box-shadow: 0 10px 18px rgba(106, 230, 201, 0.15);
  transform: translateY(-1px);
}

.share-platform-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-platform-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.share-platform-icon--x svg,
.share-platform-icon--facebook svg,
.share-platform-icon--linkedin svg {
  fill: currentColor;
  stroke: none;
}

.share-preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-preview-action-btn {
  border: 1px solid rgba(255, 184, 108, 0.45);
  background: rgba(255, 184, 108, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.share-preview-note {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .share-preview-platforms {
    grid-template-columns: 1fr;
  }
}

.share-to-inbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9960;
  background: rgba(4, 8, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.share-to-inbox-card {
  width: min(560px, 94vw);
  max-height: min(86vh, 760px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.share-to-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-to-inbox-head h3 {
  margin: 0;
  font-size: 16px;
}

.share-to-inbox-close {
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-15);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.share-to-inbox-toolbar input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--surface-2);
  color: var(--text);
}

.share-to-inbox-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-6);
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: auto;
  min-height: 140px;
}

.share-to-inbox-person {
  width: 100%;
  border: 1px solid var(--chip-border-weak);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.share-to-inbox-person:hover {
  border-color: rgba(106, 230, 201, 0.65);
  transform: translateY(-1px);
}

.share-to-inbox-person:disabled {
  opacity: 0.65;
  cursor: wait;
}

.share-to-inbox-person-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.share-to-inbox-name {
  font-size: 13px;
  font-weight: 700;
}

.share-to-inbox-username {
  font-size: 11px;
  color: var(--muted);
}

.share-to-inbox-tag {
  border: 1px solid rgba(122, 162, 255, 0.4);
  background: rgba(122, 162, 255, 0.15);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 700;
}

.share-to-inbox-note {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
}

.share-to-inbox-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.bubble .markdown > :first-child {
  margin-top: 0;
}

.bubble .markdown > :last-child {
  margin-bottom: 0;
}

.bubble .markdown p {
  margin: 0 0 12px;
}

.bubble .markdown h1,
.bubble .markdown h2,
.bubble .markdown h3 {
  margin: 8px 0 10px;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.bubble .markdown ul,
.bubble .markdown ol {
  margin: 0 0 12px 18px;
  padding: 0;
}

.bubble .markdown li {
  margin-bottom: 6px;
}

.bubble .markdown code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  background: var(--code-inline-bg);
  padding: 2px 6px;
  border-radius: 6px;
}

.raw-response {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--code-bg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.raw-response pre {
  margin: 0;
  white-space: pre-wrap;
}

.raw-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 6px;
}

body.raw-mode .raw-response {
  display: block;
}

.bubble .markdown pre {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.bubble .markdown pre code {
  background: transparent;
  padding: 0;
}

.bubble .markdown a {
  color: var(--accent);
}

.bubble .markdown .cite {
  color: var(--accent-2);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 184, 108, 0.12);
  border: 1px solid rgba(255, 184, 108, 0.3);
}

.bubble .markdown .cite.cite-contribution {
  background: rgba(106, 230, 201, 0.12);
  border-color: rgba(106, 230, 201, 0.35);
  color: var(--accent);
}

.bubble .markdown .cite-missing {
  opacity: 0.5;
  cursor: default;
}

.bubble .markdown .cite::after {
  content: "open";
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
}

.bubble .markdown .cite-missing::after {
  content: "";
}

.bubble .markdown .cite.cite-contribution::after {
  content: "tip";
}

.chat-ad {
  border: 1px solid rgba(255, 184, 108, 0.35);
  background: var(--surface-5);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 22px rgba(5, 10, 18, 0.4);
  max-width: 85%;
}

body:not(.ad-mode-on) .chat-ad {
  display: none;
}

.chat-ad-badge {
  display: none;
}

.chat-ad-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.chat-ad-image {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--chip-border-weak);
}

.chat-ad-content {
  display: grid;
  gap: 6px;
}

.chat-ad-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.chat-ad-copy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.chat-ad-bullets {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chat-ad-bullets li {
  margin-bottom: 4px;
}

.chat-ad-promo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(106, 230, 201, 0.4);
  background: rgba(106, 230, 201, 0.12);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
}

.chat-ad-promo strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.chat-ad-cta {
  width: fit-content;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: #062018;
  background: linear-gradient(120deg, var(--accent), var(--accent-bright, #9af7e0));
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
}

.chat-ad-cta:hover {
  box-shadow: 0 6px 16px rgba(106, 230, 201, 0.25);
}

.cite-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.bubble.contrib-cta {
  background: var(--surface-6);
  border: 1px solid rgba(106, 230, 201, 0.2);
}

.contrib-cta-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.contrib-cta-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.contrib-cta-actions button {
  border: 1px solid rgba(106, 230, 201, 0.45);
  background: rgba(106, 230, 201, 0.15);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.contrib-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9900;
}

.contrib-card {
  width: min(820px, 94vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contrib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-7);
  font-size: 14px;
}

.contrib-head span {
  font-weight: 600;
}

#contrib-close {
  border: 1px solid var(--chip-border-weak);
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contrib-form {
  display: grid;
  gap: 14px;
  padding: 16px 18px 20px;
}

.contrib-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.contrib-form textarea {
  background: var(--surface-8);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
  min-height: 140px;
  resize: vertical;
}

.contrib-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.contrib-toggle input {
  accent-color: var(--accent);
}

.contrib-preview {
  border: 1px solid var(--surface-19);
  border-radius: 14px;
  background: var(--surface-15);
  padding: 12px 14px;
  display: grid;
  gap: 12px;
}

.contrib-preview-row {
  display: grid;
  gap: 6px;
}

.contrib-preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-2);
}

.contrib-preview p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  max-height: 120px;
  overflow: hidden;
}

.contrib-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contrib-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 60%;
}

#contrib-submit {
  border: none;
  border-radius: 14px;
  padding: 10px 18px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-bright, #9af7e0));
  color: #062018;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 25px rgba(106, 230, 201, 0.3);
}

#contrib-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.contrib-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

.contrib-source-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10050;
}

.contrib-source-card {
  width: min(860px, 96vw);
  max-height: 90vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contrib-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-7);
  font-size: 14px;
}

#contrib-source-close {
  border: 1px solid var(--chip-border-weak);
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contrib-source-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
  overflow: auto;
}

.contrib-source-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contrib-source-user {
  color: var(--text);
  font-weight: 600;
}

.contrib-source-text {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-9);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.contrib-tip {
  border: 1px solid var(--surface-19);
  border-radius: 14px;
  background: var(--surface-16);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.contrib-tip-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.contrib-tip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contrib-tip-btn {
  border: 1px solid rgba(106, 230, 201, 0.45);
  background: rgba(106, 230, 201, 0.15);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.contrib-tip-btn:disabled,
#contrib-tip-send:disabled,
#contrib-tip-amount:disabled {
  border-color: rgba(210, 220, 232, 0.28);
  background: rgba(122, 136, 152, 0.35);
  color: rgba(230, 238, 248, 0.78);
  box-shadow: none;
  cursor: not-allowed;
}

#contrib-tip-amount {
  width: 90px;
  background: var(--surface-11);
  border: 1px solid var(--chip-border-weak);
  border-radius: 10px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
}

#contrib-tip-send {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(120deg, var(--accent), var(--accent-bright, #9af7e0));
  color: #062018;
  cursor: pointer;
}

.contrib-tip-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

.doc-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20000;
  backdrop-filter: blur(2px);
}

body.doc-modal-open {
  overflow: hidden;
}

.doc-modal-card {
  width: min(1180px, 96vw);
  height: min(840px, 94vh);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-7);
  font-size: 14px;
}

.doc-modal-head span {
  font-weight: 600;
}

#doc-modal-close {
  border: 1px solid var(--chip-border-weak);
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#doc-modal-close:hover {
  border-color: rgba(106, 230, 201, 0.6);
}

#doc-modal-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--surface-12);
}

.doc-modal-flow {
  flex: 1;
  overflow: auto;
  padding: 20px 22px 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(106, 230, 201, 0.08), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(255, 184, 108, 0.12), transparent 45%),
    var(--surface-12);
}

.flow-chart {
  display: grid;
  gap: 18px;
}

.flow-node {
  border-radius: 16px;
  border: 1px solid var(--surface-19);
  background: var(--surface-7);
  padding: 14px 16px;
  box-shadow: 0 12px 22px rgba(3, 10, 20, 0.45);
  position: relative;
}

.flow-node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(106, 230, 201, 0.18);
  opacity: 0.6;
  pointer-events: none;
}

.flow-node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.flow-node-title {
  font-weight: 600;
  font-size: 14px;
}

.flow-node-kind {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(106, 230, 201, 0.12);
  border: 1px solid rgba(106, 230, 201, 0.3);
  padding: 3px 8px;
  border-radius: 999px;
}

.doc-modal-ev {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface-12);
}

.doc-ev-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-7);
}

.doc-ev-title {
  font-weight: 600;
  font-size: 14px;
}

.doc-ev-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  padding: 16px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.doc-ev-image-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-13);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(320px, 100%);
  padding: 12px;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.doc-ev-image-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
}

.doc-ev-image-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* html[data-theme="dark"] .doc-ev-image-stage img {
  filter: invert(1);
} */

.doc-ev-loading {
  position: absolute;
  inset: 12px;
  border-radius: 12px;
  background: var(--surface-17);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 3px solid rgba(106, 230, 201, 0.25);
  border-top-color: rgba(106, 230, 201, 0.9);
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 18px rgba(106, 230, 201, 0.2);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.doc-ev-image-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ev-region {
  fill: rgba(106, 230, 201, 0.12);
  stroke: rgba(106, 230, 201, 0.7);
  stroke-width: 0.004;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  pointer-events: auto;
}

.ev-region:hover {
  fill: rgba(106, 230, 201, 0.4);
  stroke: rgba(106, 230, 201, 1);
  stroke-width: 0.006;
  filter: drop-shadow(0 0 6px rgba(106, 230, 201, 0.6));
}

.doc-ev-parts li.active {
  border-color: rgba(106, 230, 201, 0.8);
  box-shadow: 0 0 0 1px rgba(106, 230, 201, 0.4);
  color: var(--text);
}

.doc-ev-parts {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-5);
  padding: 12px 14px;
  overflow: auto;
}

.doc-ev-parts li.doc-ev-order-inline {
  border: 1px solid var(--surface-19);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-10);
  display: grid;
  gap: 8px;
}

.doc-ev-order-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.doc-ev-order-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.doc-ev-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.doc-ev-order-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.doc-ev-order-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-ev-order-actions button {
  border: 1px solid rgba(106, 230, 201, 0.55);
  background: rgba(106, 230, 201, 0.15);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.doc-ev-order-actions button:hover {
  border-color: rgba(106, 230, 201, 0.8);
  box-shadow: 0 8px 16px rgba(106, 230, 201, 0.18);
  transform: translateY(-1px);
}

.doc-ev-order-status {
  font-size: 11px;
  color: var(--accent-2);
}


.doc-ev-parts h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.doc-ev-parts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.doc-ev-parts li {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-18);
  border: 1px solid var(--surface-19);
}

.doc-ev-parts li strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 900px) {
  .doc-ev-body {
    grid-template-columns: 1fr;
  }
}

.flow-node-body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.flow-edge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
}

.flow-edge-line {
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, rgba(106, 230, 201, 0.6), rgba(106, 230, 201, 0));
  border-radius: 999px;
}

.flow-edge-label {
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.typing {
  display: inline-flex;
  gap: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: var(--surface-9);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  min-width: 0;
}

.composer-tools {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.composer .composer-upload-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-11);
  color: var(--text);
  padding: 6px 10px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

.composer .composer-upload-btn:active {
  transform: none;
  box-shadow: none;
}

.composer .composer-upload-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.composer-upload-name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Temporarily hide image upload UI while keeping logic in JS/backend intact. */
.composer .composer-tools,
.composer #prompt-image-btn,
.composer #prompt-image-name {
  display: none !important;
}

.composer textarea {
  background: transparent;
  border: none;
  resize: none;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  height: 48px;
  outline: none;
  min-width: 0;
}

.composer button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), #9af7e0);
  color: #062018;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 25px rgba(106, 230, 201, 0.3);
  white-space: nowrap;
}

.composer button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.footer-note {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.guest-trial-counter {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.guest-trial-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 14, 22, 0.82);
  z-index: 60000;
  backdrop-filter: blur(2px);
}

.guest-trial-card {
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface-10, var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.guest-trial-card h3 {
  margin: 0 0 8px;
}

.guest-trial-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.guest-trial-form {
  display: grid;
  gap: 8px;
}

.guest-trial-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  background: color-mix(in oklab, var(--surface), #fff 2%);
  color: var(--text);
}

.guest-trial-form button {
  margin-top: 0;
  width: 100%;
  border: none;
  background: linear-gradient(120deg, var(--accent-2), var(--accent-2-bright, #ffd39a));
  color: #2f1b08;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 184, 108, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.guest-trial-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(255, 184, 108, 0.34);
}

.guest-trial-status {
  min-height: 20px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.guest-trial-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.guest-trial-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
  text-align: center;
}

.guest-trial-link-btn:hover {
  transform: translateY(-1px);
}

.guest-trial-link-btn--primary {
  background: linear-gradient(120deg, var(--accent), #9af7e0);
  color: #0b1117;
  border: none;
  box-shadow: 0 10px 20px rgba(106, 247, 224, 0.25);
}

.guest-trial-link-btn--secondary {
  background: #ffffff;
  border: 1px solid rgba(16, 19, 26, 0.18);
  color: #1a2433;
  box-shadow: none;
}

.guest-trial-link-btn--primary:hover {
  box-shadow: 0 14px 24px rgba(106, 247, 224, 0.28);
}

.guest-trial-link-btn--secondary:hover {
  box-shadow: 0 12px 20px rgba(16, 19, 26, 0.1);
}

body.guest-trial-open {
  overflow: hidden;
}

@keyframes float-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

  .rail-toggle {
    display: none;
  }

  .chat {
    padding: 24px;
  }

  .bubble {
    max-width: 100%;
  }

  .chat-ad {
    max-width: 100%;
  }

  .chat-ad-body {
    grid-template-columns: 1fr;
  }

  .chat-ad-image {
    width: 100%;
    height: 140px;
  }

  .contrib-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .contrib-note {
    max-width: 100%;
  }
}

@media (max-height: 820px) {
  .chat {
    padding: 20px 24px 18px;
    gap: 16px;
  }

  .chat-header h2 {
    font-size: 18px;
  }

  .chat-header span {
    font-size: 12px;
  }

  .composer textarea {
    height: 40px;
  }

  .composer button {
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (max-height: 680px) {
  .chat {
    padding: 16px 18px 14px;
    gap: 12px;
  }

  .chat-header span:not(.chat-thread-title) {
    display: none;
  }

  .composer {
    gap: 8px;
    padding: 10px 12px;
  }

  .composer textarea {
    height: 36px;
  }
}

@media (max-height: 620px) {
  .chat {
    overflow-y: auto;
  }
}
