:root {
  color-scheme: dark;
  --bg: #05070c;
  --panel: rgba(13, 17, 26, .82);
  --panel-strong: rgba(18, 24, 36, .94);
  --panel-soft: rgba(255, 255, 255, .045);
  --stroke: rgba(255, 255, 255, .11);
  --stroke-bright: rgba(180, 220, 255, .38);
  --text: #f7fbff;
  --muted: rgba(232, 242, 255, .62);
  --muted-2: rgba(232, 242, 255, .42);
  --blue: #5db8ff;
  --blue-2: #98d7ff;
  --danger: #ff6f8b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .48);
  --sidebar-w: 292px;
  --composer-h: 146px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(79, 173, 255, .22), transparent 38%),
    radial-gradient(circle at 100% 20%, rgba(255, 255, 255, .08), transparent 28%),
    var(--bg);
  color: var(--text);
}

button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: currentColor; }
a { color: var(--blue-2); }

.aurora-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

.aurora-bg span {
  position: absolute;
  width: 48vmax;
  height: 48vmax;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(70, 170, 255, .16), transparent 62%);
  animation: drift 18s infinite alternate ease-in-out;
}

.aurora-bg span:nth-child(1) { left: -22vmax; bottom: -26vmax; }
.aurora-bg span:nth-child(2) { right: -25vmax; top: -22vmax; animation-delay: -5s; }
.aurora-bg span:nth-child(3) {
  left: 42%;
  top: 36%;
  width: 30vmax;
  height: 30vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, .06), transparent 62%);
  animation-delay: -10s;
}

@keyframes drift {
  from { transform: translate3d(-2%, 1%, 0) scale(.95); }
  to { transform: translate3d(7%, -4%, 0) scale(1.08); }
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.sidebar {
  height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(8, 11, 18, .92), rgba(8, 12, 20, .74));
  backdrop-filter: blur(28px);
}

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

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(125, 199, 255, .26));
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: .01em;
}

.brand small {
  color: var(--muted-2);
  font-size: 12px;
}

.primary-action,
.ghost-btn,
.icon-btn,
.prompt-card,
.attach-btn,
.send-btn,
.chat-item,
.chat-action,
.message-action,
.tab-btn,
.code-copy {
  border: 1px solid var(--stroke);
  color: var(--text);
  background: var(--panel-soft);
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}

.primary-action:hover,
.ghost-btn:hover,
.icon-btn:hover,
.prompt-card:hover,
.attach-btn:hover,
.send-btn:hover,
.chat-item:hover,
.chat-action:hover,
.message-action:hover,
.tab-btn:hover,
.code-copy:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-bright);
  box-shadow: 0 0 32px rgba(78, 174, 255, .12);
}

.new-chat {
  height: 46px;
  width: 100%;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background:
    linear-gradient(135deg, rgba(63, 164, 255, .2), rgba(255, 255, 255, .05)),
    var(--panel-soft);
}

.plus-icon {
  color: var(--blue-2);
  text-shadow: 0 0 18px rgba(96, 190, 255, .8);
}

.search-box {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, .035);
}

.search-box:focus-within {
  color: var(--blue-2);
  border-color: var(--stroke-bright);
  box-shadow: 0 0 30px rgba(78, 174, 255, .10);
}

.search-box input,
.modal textarea,
.setting-row select {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder,
textarea::placeholder { color: var(--muted-2); }

.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tab-btn {
  height: 34px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
}

.tab-btn.active {
  color: var(--text);
  border-color: var(--stroke-bright);
  background: rgba(94, 183, 255, .14);
}

.section-label {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 4px 10px 0;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 3px;
}

.chat-item {
  width: 100%;
  min-height: 42px;
  padding: 8px 8px 8px 12px;
  border-radius: 14px;
  text-align: left;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: transparent;
}

.chat-item.active {
  background: rgba(94, 183, 255, .14);
  border-color: var(--stroke-bright);
}

.chat-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-title small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 2px;
}

.chat-spark { color: var(--blue-2); }

.chat-actions {
  display: inline-flex;
  gap: 4px;
  opacity: 0;
}

.chat-item:hover .chat-actions,
.chat-item.active .chat-actions {
  opacity: 1;
}

.chat-action {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ghost-btn,
.icon-btn {
  height: 40px;
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .045);
}

.ghost-btn.compact { height: 36px; }
.ghost-btn.danger { color: var(--danger); }

.main {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 66px 1fr auto;
  position: relative;
}

.topbar {
  height: 66px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu { display: none; }

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  backdrop-filter: blur(18px);
  color: var(--muted);
}

.model-pill strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #73ffba;
  box-shadow: 0 0 16px rgba(115, 255, 186, .75);
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.chat-stage {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: 0 22px var(--composer-h);
  scroll-behavior: smooth;
}

.hero {
  min-height: calc(100vh - 66px - var(--composer-h));
  max-width: 920px;
  margin: 0 auto;
  padding: 8vh 0 24px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.logo-orb {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
}

.logo-orb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 12px rgba(255,255,255,.14))
    drop-shadow(0 0 42px rgba(91,185,255,.20));
}

.eyebrow {
  margin: 20px 0 8px;
  color: var(--blue-2);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 76px);
  letter-spacing: -.06em;
  line-height: .95;
  background: linear-gradient(100deg, #fff, #d9efff 38%, #6dbcff 66%, #fff);
  -webkit-background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.subline {
  margin: 18px auto 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.prompt-grid {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.prompt-card {
  border-radius: 22px;
  padding: 16px 18px;
  min-height: 74px;
  text-align: left;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.025)),
    rgba(255,255,255,.025);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.35;
}

.prompt-card span {
  color: var(--blue-2);
  text-shadow: 0 0 18px rgba(93, 184, 255, .75);
}

.messages {
  width: min(920px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 0 18px;
}

.hero.hidden { display: none; }

.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  animation: messageIn .28s ease both;
}

@keyframes messageIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.message.user { grid-template-columns: minmax(0, 1fr) 38px; }
.message.user .avatar { grid-column: 2; grid-row: 1; }
.message.user .message-body { grid-column: 1; grid-row: 1; align-items: flex-end; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background:
    url("assets/visionai-logo-transparent.png") center/78% no-repeat,
    linear-gradient(135deg, rgba(93,184,255,.25), rgba(255,255,255,.05));
  border: 1px solid var(--stroke);
  box-shadow: 0 0 28px rgba(93,184,255,.15);
}

.message.user .avatar {
  background: linear-gradient(135deg, #58b7ff, #e8f6ff);
  position: relative;
}

.message.user .avatar::after {
  content: "Du";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #06101f;
  font-size: 11px;
  font-weight: 800;
}

.message-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.message-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.message-meta {
  color: var(--muted-2);
  font-size: 12px;
}

.message-actions {
  display: inline-flex;
  gap: 5px;
  opacity: 0;
  transition: opacity .18s ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
}

.message-action {
  height: 28px;
  padding: 0 9px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.bubble {
  width: fit-content;
  max-width: min(760px, 100%);
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: anywhere;
}

.message.assistant .bubble {
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.02)),
    rgba(255,255,255,.02);
  border-top-left-radius: 8px;
}

.message.user .bubble {
  border-color: rgba(127, 201, 255, .28);
  background:
    linear-gradient(135deg, rgba(93,184,255,.24), rgba(255,255,255,.07));
  border-top-right-radius: 8px;
  white-space: pre-wrap;
}

.md h1,
.md h2,
.md h3 {
  margin: .2em 0 .35em;
  letter-spacing: -.02em;
  color: var(--text);
}

.md h1 { font-size: 1.35rem; }
.md h2 { font-size: 1.18rem; }
.md h3 { font-size: 1.05rem; }

.md p { margin: 0 0 .8em; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: .2em 0 .9em 1.25em; padding: 0; }
.md li { margin: .22em 0; }
.md strong { font-weight: 700; }
.md code:not(.code-block code) {
  padding: .15em .36em;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  background: rgba(255,255,255,.07);
  color: #dff4ff;
}

.code-block {
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(0,0,0,.32);
}

.code-head {
  height: 36px;
  padding: 0 10px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.04);
  font-size: 12px;
}

.code-copy {
  height: 26px;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
}

.code-block pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
}

.code-block code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.attachment-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-pill,
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 250px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  font-size: 12px;
}

.file-pill button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.composer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 22px 14px;
  background: linear-gradient(180deg, transparent, var(--bg) 40%);
}

.attachment-tray {
  width: min(920px, 100%);
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer {
  position: relative;
  z-index: 3;
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 42px 1fr 46px;
  align-items: end;
  gap: 8px;
  padding: 9px;
  border-radius: 28px;
  border: 1px solid var(--stroke-bright);
  background:
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035)),
    rgba(6, 10, 16, .72);
  backdrop-filter: blur(26px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.025),
    0 24px 80px rgba(0,0,0,.38),
    0 0 45px rgba(70,170,255,.10);
}

.input-stack {
  min-width: 0;
  display: grid;
}

.attach-btn,
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.attach-btn {
  font-size: 22px;
  color: var(--blue-2);
}

.send-btn {
  width: 46px;
  height: 46px;
  border: 0;
  background:
    radial-gradient(circle at 35% 20%, #fff, transparent 32%),
    linear-gradient(135deg, #eaf7ff, #61bfff 56%, #2b83ff);
  box-shadow:
    0 0 22px rgba(77, 176, 255, .48),
    inset 0 1px 0 rgba(255,255,255,.6);
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: #06101f;
}

.stop-icon {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #06101f;
}

.generating .send-icon { display: none; }
.generating .stop-icon { display: block; }

textarea {
  min-height: 42px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 11px 4px 4px;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
}

.composer-meta {
  min-height: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  font-size: 11px;
  padding: 0 4px 2px;
}

.disclaimer {
  width: min(920px, 100%);
  margin: 8px auto 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
}

.start-soft-glow {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 8px;
  width: min(760px, calc(100vw - 40px));
  height: 170px;
  transform: translateX(-50%) translateY(24px) scale(.92);
  pointer-events: none;
  opacity: 0;
  filter: blur(18px);
  background:
    radial-gradient(ellipse at 50% 74%,
      rgba(255,255,255,.76) 0%,
      rgba(190,235,255,.56) 12%,
      rgba(90,190,255,.34) 28%,
      rgba(42,130,255,.14) 48%,
      rgba(42,130,255,0) 72%),
    radial-gradient(ellipse at 44% 78%,
      rgba(255,255,255,.32) 0%,
      rgba(135,215,255,.18) 34%,
      rgba(135,215,255,0) 66%);
  mix-blend-mode: screen;
  will-change: opacity, transform, filter;
}

.start-soft-glow.play {
  animation: softStartGlow 4.8s cubic-bezier(.16,.84,.24,1) forwards;
}

.composer.soft-glow-active {
  box-shadow:
    0 0 0 1px rgba(255,255,255,.025),
    0 24px 80px rgba(0,0,0,.38),
    0 0 34px rgba(90,185,255,.14);
}

@keyframes softStartGlow {
  0% { opacity: 0; transform: translateX(-50%) translateY(32px) scale(.84); filter: blur(28px); }
  18% { opacity: .92; transform: translateX(-50%) translateY(4px) scale(1); filter: blur(18px); }
  48% { opacity: .58; transform: translateX(-50%) translateY(-8px) scale(1.06); filter: blur(22px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(1.14); filter: blur(34px); }
}

.slash-menu {
  position: absolute;
  left: 58px;
  right: 58px;
  bottom: calc(100% + 10px);
  display: none;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(12, 17, 26, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.slash-menu.open { display: grid; gap: 5px; }

.slash-menu button {
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.slash-menu button:hover { background: rgba(255,255,255,.06); }
.slash-menu small { color: var(--muted-2); }

.scroll-bottom {
  position: sticky;
  bottom: 18px;
  left: calc(50% - 18px);
  width: 36px;
  height: 36px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--text);
  background: rgba(12, 17, 26, .88);
  box-shadow: var(--shadow);
  display: none;
}

.scroll-bottom.show { display: grid; place-items: center; }

.modal {
  width: min(600px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  border-radius: 26px;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
}

.modal-card {
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 26px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.modal-head strong {
  display: block;
  font-size: 18px;
}

.modal-head small {
  display: block;
  color: var(--muted-2);
  margin-top: 3px;
}

.setting-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--stroke);
}

.setting-row span,
.setting-stack span {
  color: var(--muted);
}

.setting-row select {
  min-height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255,255,255,.05);
}

.setting-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

.setting-stack {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  border-top: 1px solid var(--stroke);
}

.setting-stack textarea,

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
}

.save-settings {
  min-height: 40px;
  border-radius: 14px;
  padding: 0 16px;
}


.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  min-width: 160px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid var(--stroke-bright);
  border-radius: 999px;
  text-align: center;
  color: var(--text);
  background: rgba(10, 15, 24, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(84vw, var(--sidebar-w));
    z-index: 5;
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: var(--shadow);
  }

  .app-shell[data-sidebar="open"] .sidebar { transform: translateX(0); }

  .mobile-menu {
    display: grid;
    place-items: center;
  }

  .topbar { padding-inline: 12px; }

  .model-pill span:not(.status-dot) { display: none; }

  .hero { padding-top: 6vh; }

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

  .composer-wrap,
  .chat-stage { padding-inline: 12px; }
}

@media (max-width: 560px) {
  :root { --composer-h: 158px; }

  .top-actions .compact:first-child { display: none; }

  .hero {
    justify-items: stretch;
    text-align: left;
  }

  .logo-orb {
    justify-self: center;
    width: 138px;
    height: 138px;
  }

  .eyebrow, h1, .subline { text-align: center; }

  .prompt-card {
    min-height: 62px;
    border-radius: 18px;
  }

  .messages { gap: 18px; }

  .message {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .message.user { grid-template-columns: minmax(0, 1fr) 32px; }

  .avatar {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }

  .bubble {
    max-width: 100%;
    padding: 12px 14px;
  }

  .composer {
    grid-template-columns: 38px 1fr 42px;
    border-radius: 24px;
  }

  .attach-btn {
    width: 38px;
    height: 38px;
  }

  .send-btn {
    width: 42px;
    height: 42px;
  }

  .composer-meta {
    display: none;
  }

  .start-soft-glow {
    bottom: 4px;
    height: 150px;
    width: calc(100vw - 28px);
  }

  .setting-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 0;
  }

  .modal-actions {
    flex-direction: column;
  }
}


.free-tier-note {
  margin-top: 22px;
  width: min(680px, 100%);
  padding: 12px 14px;
  border: 1px solid rgba(152, 215, 255, .24);
  border-radius: 18px;
  color: rgba(232, 242, 255, .72);
  background:
    linear-gradient(135deg, rgba(93,184,255,.10), rgba(255,255,255,.035)),
    rgba(255,255,255,.025);
  box-shadow: 0 0 32px rgba(70,170,255,.08);
  font-size: 13px;
  line-height: 1.45;
}

.limit-message {
  border-color: rgba(152, 215, 255, .34) !important;
  background:
    linear-gradient(145deg, rgba(93,184,255,.12), rgba(255,255,255,.035)),
    rgba(255,255,255,.025) !important;
}

.status-dot {
  background: #7efac4;
  box-shadow: 0 0 16px rgba(126,250,196,.78);
}

.prompt-card {
  position: relative;
  overflow: hidden;
}

.prompt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.055), transparent);
  transform: translateX(-120%);
  transition: transform .55s ease;
}

.prompt-card:hover::after {
  transform: translateX(120%);
}


/* =========================================================
   VisionAI UI Refresh: model picker, thinking state, mobile
   ========================================================= */

.model-picker {
  position: relative;
  z-index: 20;
}

.model-pill {
  min-height: 44px;
  padding: 6px 10px 6px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  gap: 10px;
  transition: background .18s ease, border-color .18s ease;
}

.model-pill:hover,
.model-pill[aria-expanded="true"] {
  background: rgba(255,255,255,.065);
  border-color: rgba(255,255,255,.07);
}

.model-pill-copy {
  display: grid;
  text-align: left;
  line-height: 1.15;
  gap: 3px;
}

.model-pill-copy strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.model-pill-copy small {
  color: var(--muted);
  font-size: 11px;
}

.model-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform .18s ease;
}

.model-pill[aria-expanded="true"] .model-chevron {
  transform: rotate(180deg);
}

.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(340px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(18, 20, 25, .98);
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.985);
  transform-origin: top left;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.model-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.model-option {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.model-option:hover {
  background: rgba(255,255,255,.065);
}

.model-option.active {
  background: rgba(255,255,255,.085);
}

.model-option-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #eaf7ff;
  background: linear-gradient(145deg, rgba(109,190,255,.24), rgba(255,255,255,.07));
}

.model-option > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.model-option strong {
  font-size: 14px;
  font-weight: 620;
}

.model-option small {
  color: var(--muted);
  font-size: 12px;
}

.model-check {
  opacity: 0;
  color: #9ed8ff;
  font-weight: 700;
  justify-self: center;
}

.model-option.active .model-check {
  opacity: 1;
}

/* thinking animation */
.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  color: rgba(238,246,255,.84);
  font-size: 14px;
  font-weight: 520;
}

.thinking-word {
  letter-spacing: -.01em;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
}

.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: .28;
  animation: thinkingPulse 1.15s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) { animation-delay: .16s; }
.thinking-dots i:nth-child(3) { animation-delay: .32s; }

@keyframes thinkingPulse {
  0%, 70%, 100% { opacity: .24; transform: translateY(0) scale(.9); }
  35% { opacity: 1; transform: translateY(-2px) scale(1.08); }
}

.message.assistant.is-thinking .bubble {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-left: 2px;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
  }

  .main {
    width: 100%;
    min-width: 0;
    height: 100dvh;
  }

  .sidebar {
    height: 100dvh;
    width: min(88vw, 330px);
    z-index: 80;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    display: block;
    transition: opacity .2s ease;
  }

  .app-shell[data-sidebar="open"] .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    height: 60px;
    padding: 8px 10px;
    gap: 6px;
  }

  .model-pill {
    max-width: min(52vw, 250px);
    padding-inline: 9px;
  }

  .model-pill-copy {
    min-width: 0;
  }

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

  .top-actions {
    gap: 4px;
  }

  .top-actions .compact {
    padding-inline: 10px;
  }

  .chat-stage {
    padding: 0 10px calc(var(--composer-h) + env(safe-area-inset-bottom));
  }

  .messages {
    width: min(100%, 760px);
  }

  .composer-wrap {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .composer {
    width: min(100%, 760px);
  }

  .model-menu {
    position: fixed;
    top: 64px;
    left: 10px;
    right: 10px;
    width: auto;
    transform-origin: top center;
  }
}

@media (max-width: 560px) {
  :root {
    --composer-h: 126px;
  }

  .topbar {
    position: relative;
    z-index: 30;
  }

  .mobile-menu {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .model-picker {
    min-width: 0;
    flex: 1;
  }

  .model-pill {
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }

  .model-pill-copy small {
    display: none;
  }

  .top-actions .compact {
    display: none;
  }

  .top-actions .compact:last-child {
    display: inline-flex;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0;
    align-items: center;
    justify-content: center;
  }

  .top-actions .compact:last-child::before {
    content: "↺";
    font-size: 20px;
  }

  .hero {
    min-height: auto;
    padding: 28px 4px 140px;
    align-content: start;
  }

  .logo-orb {
    width: 112px;
    height: 112px;
    margin-bottom: 4px;
  }

  .hero h1 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 1.05;
  }

  .subline {
    font-size: 14px;
    line-height: 1.55;
  }

  .free-tier-note {
    margin-top: 16px;
    border-radius: 14px;
    font-size: 12px;
  }

  .prompt-grid {
    gap: 8px;
    margin-top: 14px;
  }

  .prompt-card {
    min-height: 56px;
    padding: 12px 13px;
    font-size: 13px;
  }

  .messages {
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .message,
  .message.user {
    grid-template-columns: 28px minmax(0,1fr);
    gap: 8px;
  }

  .message.user {
    grid-template-columns: minmax(0,1fr);
  }

  .message.user .avatar {
    display: none;
  }

  .message.user .message-body {
    justify-self: end;
    max-width: 88%;
  }

  .message.assistant .message-body {
    max-width: calc(100vw - 58px);
  }

  .avatar {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .message-head {
    min-height: 20px;
  }

  .bubble {
    padding: 11px 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.58;
    overflow-wrap: anywhere;
  }

  .message.user .bubble {
    border-bottom-right-radius: 5px;
  }

  .composer-wrap {
    gap: 5px;
  }

  .attachment-tray {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .composer {
    min-height: 58px;
    grid-template-columns: 36px minmax(0,1fr) 40px;
    gap: 5px;
    padding: 7px;
    border-radius: 22px;
  }

  .attach-btn {
    width: 36px;
    height: 36px;
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

  textarea {
    max-height: 120px;
    font-size: 16px;
    line-height: 1.4;
  }

  .disclaimer {
    display: none;
  }

  .slash-menu {
    left: 6px;
    right: 6px;
    bottom: calc(100% + 8px);
    width: auto;
  }

  .modal {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .modal::backdrop {
    background: rgba(0,0,0,.65);
  }

  .modal-card {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-height: 88dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}


/* =========================================================
   VisionAI Professional Cleanup
   ========================================================= */

.sidebar {
  padding-top: 16px;
}

.sidebar-footer {
  grid-template-columns: 1fr;
  gap: 9px;
}

.workspace-status {
  min-height: 58px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(93,184,255,.075), rgba(255,255,255,.025)),
    rgba(255,255,255,.02);
}

.workspace-status-dot,
.top-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #78e6b2;
  box-shadow: 0 0 14px rgba(120,230,178,.54);
}

.workspace-status > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-status strong {
  font-size: 12px;
  font-weight: 620;
}

.workspace-status small {
  color: var(--muted-2);
  font-size: 11px;
}

.settings-entry {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.settings-entry:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.045);
}

.settings-entry-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue-2);
  background: rgba(93,184,255,.09);
}

.topbar {
  border-bottom: 1px solid rgba(255,255,255,.045);
  background: linear-gradient(180deg, rgba(5,7,12,.56), transparent);
}

.top-status {
  margin-left: auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  font-size: 12px;
  white-space: nowrap;
}

.hero {
  max-width: 980px;
}

.hero h1 {
  max-width: 900px;
}

.free-tier-note {
  width: auto;
  padding: 9px 13px;
  border-radius: 999px;
  color: rgba(225,239,251,.68);
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.07);
  box-shadow: none;
  letter-spacing: .01em;
}

.prompt-card {
  border-color: rgba(255,255,255,.075);
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
    rgba(255,255,255,.015);
  box-shadow: 0 18px 55px rgba(0,0,0,.14);
}

.prompt-card:hover {
  background:
    linear-gradient(145deg, rgba(93,184,255,.095), rgba(255,255,255,.025)),
    rgba(255,255,255,.02);
}

.modal-card {
  border-color: rgba(255,255,255,.09);
  background:
    linear-gradient(180deg, rgba(25,29,38,.985), rgba(13,16,23,.985));
}

.modal-head strong {
  letter-spacing: -.015em;
}

.setting-row,
.setting-stack {
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.025);
}

.modal-actions-clean {
  justify-content: flex-end;
}

.modal-actions-clean .save-settings {
  min-width: 190px;
}

@media (max-width: 560px) {
  .top-status {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .top-status-dot {
    width: 9px;
    height: 9px;
  }

  .workspace-status {
    min-height: 54px;
  }

  .free-tier-note {
    max-width: calc(100vw - 36px);
    text-align: center;
    border-radius: 14px;
    line-height: 1.35;
  }

  .modal-actions-clean .save-settings {
    width: 100%;
    min-width: 0;
  }
}


/* =========================================================
   VisionAI in-app confirmation
   ========================================================= */

.confirm-modal {
  width: min(440px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.confirm-modal::backdrop {
  background: rgba(2, 4, 8, .72);
  backdrop-filter: blur(7px);
  animation: confirmBackdropIn .16s ease both;
}

.confirm-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 0%, rgba(255,100,110,.08), transparent 34%),
    linear-gradient(180deg, rgba(27,30,38,.99), rgba(14,17,23,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
  animation: confirmCardIn .18s cubic-bezier(.2,.8,.2,1) both;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,115,125,.19);
  border-radius: 15px;
  color: #ff9199;
  background: rgba(255,92,104,.09);
}

.confirm-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding-top: 1px;
}

.confirm-eyebrow {
  color: #ff9aa2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.confirm-copy strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 660;
  line-height: 1.28;
  letter-spacing: -.018em;
  overflow-wrap: anywhere;
}

.confirm-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 5px;
}

.confirm-cancel,
.danger-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 620;
}

.danger-action {
  border: 1px solid rgba(255,119,128,.46);
  color: #fff;
  background: linear-gradient(180deg, #e95b66, #cc3f4b);
  box-shadow: 0 8px 24px rgba(204,63,75,.20);
}

.danger-action:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.danger-action:active {
  transform: translateY(0);
}

@keyframes confirmBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confirmCardIn {
  from { opacity: 0; transform: translateY(8px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .confirm-modal {
    width: calc(100vw - 20px);
    margin: auto;
  }

  .confirm-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 18px;
    border-radius: 20px;
  }

  .confirm-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .confirm-copy strong {
    font-size: 16px;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .confirm-cancel,
  .danger-action {
    width: 100%;
    padding-inline: 10px;
  }
}


/* =========================================================
   Mobile Chat Actions
   ========================================================= */

.chat-more {
  display: none;
}

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

.chat-context-menu {
  position: fixed;
  z-index: 140;
  width: 220px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(28,31,40,.99), rgba(15,18,25,.99));
  box-shadow: 0 24px 70px rgba(0,0,0,.56);
  backdrop-filter: blur(22px);
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  transform-origin: top right;
  pointer-events: none;
}

.chat-context-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: chatContextIn .16s cubic-bezier(.2,.8,.2,1) both;
}

.chat-context-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.chat-context-item:hover,
.chat-context-item:focus-visible {
  outline: none;
  background: rgba(255,255,255,.065);
}

.chat-context-item.danger {
  color: #ff929a;
}

.chat-context-item.danger:hover,
.chat-context-item.danger:focus-visible {
  background: rgba(255,90,102,.09);
}

.chat-context-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue-2);
  background: rgba(93,184,255,.08);
  font-size: 13px;
}

.chat-context-item.danger .chat-context-icon {
  color: #ff929a;
  background: rgba(255,90,102,.09);
}

.chat-context-divider {
  height: 1px;
  margin: 5px 7px;
  background: rgba(255,255,255,.075);
}

@keyframes chatContextIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .chat-item {
    position: relative;
    grid-template-columns: 18px minmax(0,1fr) 34px;
    min-height: 48px;
    padding-right: 7px;
  }

  .chat-actions {
    display: none !important;
  }

  .chat-more {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    justify-self: end;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
  }

  .chat-more:hover,
  .chat-more:focus-visible {
    outline: none;
    color: var(--text);
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.055);
  }

  .chat-item.active .chat-more {
    color: var(--text);
  }
}

@media (max-width: 560px) {
  .chat-context-menu {
    width: min(220px, calc(100vw - 24px));
    border-radius: 15px;
  }

  .chat-context-item {
    min-height: 44px;
    font-size: 13px;
  }
}


/* VisionAI production polish */\n.launch-splash {\n  position: fixed;\n  inset: 0;\n  z-index: 1000;\n  display: grid;\n  place-items: center;\n  background:\n    radial-gradient(circle at 50% 42%, rgba(67, 164, 255, .18), transparent 30%),\n    #070a10;\n  opacity: 1;\n  visibility: visible;\n  transition: opacity .38s ease, visibility .38s ease;\n}\n.launch-splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }\n.launch-splash-inner { display: grid; place-items: center; text-align: center; color: #fff; }\n.launch-splash img {\n  width: 126px;\n  height: 126px;\n  object-fit: contain;\n  filter: drop-shadow(0 0 34px rgba(94, 185, 255, .76));\n  animation: launchLogoPulse 1.35s ease-in-out infinite;\n}\n.launch-splash strong { margin-top: 10px; font-size: 27px; letter-spacing: -.045em; }\n.launch-splash span { margin-top: 5px; color: rgba(229, 241, 255, .56); font-size: 12px; }\n.launch-splash i {\n  width: 136px; height: 3px; margin-top: 19px; overflow: hidden; border-radius: 99px;\n  background: rgba(255,255,255,.075);\n}\n.launch-splash i::after {\n  content: ""; display: block; width: 42%; height: 100%; border-radius: inherit;\n  background: linear-gradient(90deg, #61baff, #e2f5ff);\n  animation: launchProgress 1.05s ease-in-out infinite;\n}\n.sidebar-footer { grid-template-columns: 1fr; }\n.settings-entry { border-color: rgba(255,255,255,.055); background: rgba(255,255,255,.025); }\n.topbar { justify-content: flex-start; }\n.hero { padding-top: 36px; }\n@keyframes launchLogoPulse { 50% { transform: scale(1.035); filter: drop-shadow(0 0 44px rgba(94,185,255,.92)); } }\n@keyframes launchProgress { from { transform: translateX(-125%); } to { transform: translateX(340%); } }\n@media (prefers-reduced-motion: reduce) {\n  .launch-splash img, .launch-splash i::after { animation: none; }\n}\n