/* Brand polish layered on top of Tailwind utility output. */

html { scroll-behavior: smooth; }

/* Custom scrollbars. */
* { scrollbar-width: thin; scrollbar-color: #D8D4FF transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8D4FF; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6055FC; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Layout: projects vs hero vs chat ────────────────────────────────── */
/* PROJECTS mode: only the picker grid is visible; chat/hero/composer hidden.
   HERO mode: chat is hidden, hero is centered, composer sits below hero,
     chips are visible.
   CHAT mode: hero is hidden, chips are hidden, chat fills space and scrolls,
     composer is pinned to the bottom. */

body[data-mode="projects"] #chat,
body[data-mode="projects"] #hero,
body[data-mode="projects"] #composer-wrap { display: none; }

body[data-mode="hero"] #projects-view,
body[data-mode="chat"] #projects-view { display: none; }

body[data-mode="hero"] #chat { display: none; }
body[data-mode="chat"] #hero { display: none; }
body[data-mode="chat"] #starter-chips { display: none; }

body[data-mode="hero"] #composer-wrap { padding-bottom: 4rem; }
body[data-mode="chat"] #composer-wrap {
  background: linear-gradient(to top, #F3F3F3 70%, rgba(250, 250, 252, 0));
  padding-top: 1rem;
}

.activity-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  border: 1px solid #D8D4FF;
  background: #F4F2FF;
  color: #4F46E5;
  border-radius: 0.65rem;
  padding: 0.42rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(96, 85, 252, 0.12);
}

.activity-pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #6055FC;
  box-shadow: 0 0 0 0 rgba(96, 85, 252, 0.45);
  animation: activity-pulse 1.35s ease-out infinite;
  flex: 0 0 auto;
}

#activity[data-state="tools"] .activity-inner {
  border-color: #F5B25A;
  background: #FFF5D8;
  color: #8A5200;
}

#activity[data-state="tools"] .activity-pulse {
  background: #F5B25A;
  box-shadow: 0 0 0 0 rgba(245, 178, 90, 0.45);
}

#activity[data-state="writing"] .activity-inner {
  border-color: #7DD87D;
  background: #ECFCEB;
  color: #166534;
}

#activity[data-state="writing"] .activity-pulse {
  background: #22C55E;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.42);
}

#activity[data-state="stopping"] .activity-inner {
  border-color: #FCA5A5;
  background: #FFE4E4;
  color: #B91C1C;
}

#activity[data-state="stopping"] .activity-pulse {
  background: #DC2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.42);
}

@keyframes activity-pulse {
  70% { box-shadow: 0 0 0 0.45rem rgba(96, 85, 252, 0); }
  100% { box-shadow: 0 0 0 0 rgba(96, 85, 252, 0); }
}

#send[data-action="stop"],
#send[data-action="stopping"] {
  background: #DC2626;
}

#send[data-action="stop"]:hover,
#send[data-action="stopping"]:hover {
  background: #B91C1C;
}

/* ─── Project cards ───────────────────────────────────────────────────── */

.project-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: white;
  border: 1px solid #EDEDED;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  min-height: 130px;
}
.project-card:hover {
  border-color: #D8D4FF;
  background: #F4F2FF;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(96, 85, 252, 0.12);
}
.project-card:focus-visible {
  outline: 3px solid rgba(96, 85, 252, 0.35);
  outline-offset: 2px;
}
.project-card .name {
  font-family: "Space Grotesk", ui-sans-serif, system-ui;
  font-weight: 700;
  font-size: 1.05rem;
  color: #151618;
  line-height: 1.3;
}
.project-card .meta {
  font-size: 0.75rem;
  color: #85858F;
  margin-top: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.project-card .added {
  font-size: 0.78rem;
  color: #707070;
  margin-top: auto;
  padding-top: 0.75rem;
}
.project-card .remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: #85858F;
  display: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}
.project-card { position: relative; }
.project-card:hover .remove,
.project-card:focus-within .remove { display: inline-flex; }
.project-card .remove:hover { background: #FFE4E4; color: #DC2626; }

.add-project-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  border: 2px dashed #D8D4FF;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #6055FC;
  font-weight: 600;
  min-height: 130px;
}
.add-project-tile:hover {
  border-color: #6055FC;
  background: #F4F2FF;
}
.add-project-tile .plus {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* ─── Starter chips ────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  background: white;
  border: 1px solid #EDEDED;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #151618;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.chip:hover {
  border-color: #6055FC;
  background: #F4F2FF;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(96, 85, 252, 0.12);
}
.chip:active { transform: translateY(0); }
.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

/* ─── Streaming caret ──────────────────────────────────────────────────── */

.assistant-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  color: #4F46E5;
  background: #F4F2FF;
  border: 1px solid #D8D4FF;
  border-radius: 0.7rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(96, 85, 252, 0.1);
}

.assistant-pending[data-state="tools"] {
  color: #8A5200;
  background: #FFF5D8;
  border-color: #F5B25A;
}

.assistant-pending[data-state="writing"] {
  color: #166534;
  background: #ECFCEB;
  border-color: #7DD87D;
}

.assistant-pending[data-state="stopping"] {
  color: #B91C1C;
  background: #FFE4E4;
  border-color: #FCA5A5;
}

.pending-orb {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  animation: pending-orb 1.1s ease-in-out infinite;
  flex: 0 0 auto;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding-top: 0.08rem;
}

.thinking-dots i {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: #6055FC;
  opacity: 0.35;
  animation: thinking-dot 1.2s ease-in-out infinite;
}

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

@keyframes thinking-dot {
  0%, 70%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes pending-orb {
  0%, 100% { transform: scale(0.85); opacity: 0.45; }
  50% { transform: scale(1.15); opacity: 1; }
}

.streaming::after {
  content: "▍";
  margin-left: 2px;
  animation: blink 1s steps(2, start) infinite;
  color: #6055FC;
}
@keyframes blink { to { visibility: hidden; } }

/* ─── Tool call cards ──────────────────────────────────────────────────── */

.message-row {
  position: relative;
}

.user-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.message-copy {
  border: 1px solid #EDEDED;
  border-radius: 999px;
  background: white;
  color: #707070;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

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

.message-copy:hover,
.message-copy.copied {
  border-color: #D8D4FF;
  background: #F4F2FF;
  color: #4F46E5;
}

.user-row .message-copy {
  margin-top: 0.35rem;
}

@media (hover: none) {
  .message-copy {
    opacity: 1;
  }
}

.tool-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #FCFDD0;
  border-left: 3px solid #6055FC;
  border-radius: 0.5rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: #151618;
}
.tool-card.error {
  background: #FFE4E4;
  border-left-color: #DC2626;
}
.tool-card .tool-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: #4F46E5;
}
.tool-card details > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.tool-card details > summary::-webkit-details-marker { display: none; }
.tool-card details[open] > summary .chev { transform: rotate(90deg); }
.tool-card .chev {
  display: inline-block;
  transition: transform 0.15s ease;
  color: #707070;
}
.tool-card pre {
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #151618;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.5rem 0.6rem;
  border-radius: 0.35rem;
  max-height: 22rem;
  overflow-y: auto;
}
.tool-card .args {
  margin-top: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: #707070;
  word-break: break-word;
}

.tool-group {
  width: min(100%, 46rem);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.74);
  color: #151618;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tool-group.has-error {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(255, 255, 255, 0.86);
}

.tool-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2rem;
  padding: 0.34rem 0.6rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tool-group-summary:hover {
  background: rgba(96, 85, 252, 0.035);
}

.tool-group-summary::-webkit-details-marker,
.tool-call-summary::-webkit-details-marker {
  display: none;
}

.tool-group-left,
.tool-call-main {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.4rem;
}

.tool-group-left::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #6055FC;
  box-shadow: 0 0 0 3px rgba(96, 85, 252, 0.1);
}

.tool-group.has-error .tool-group-left::before {
  background: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.tool-group-chev,
.tool-call-chev {
  display: inline-block;
  color: #85858F;
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}

.tool-group[open] > .tool-group-summary .tool-group-chev,
.tool-call[open] > .tool-call-summary .tool-call-chev {
  transform: rotate(90deg);
}

.tool-group-title {
  font-size: 0.74rem;
  font-weight: 650;
  color: #555660;
}

.tool-group-meta {
  flex-shrink: 0;
  color: #85858F;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.tool-group.has-error .tool-group-meta {
  color: #B91C1C;
}

.tool-list {
  display: grid;
  gap: 0.2rem;
  padding: 0.3rem 0.4rem 0.42rem;
  border-top: 1px solid rgba(21, 22, 24, 0.08);
  background: rgba(250, 250, 250, 0.72);
}

.tool-call {
  border: 0;
  border-radius: 0.42rem;
  background: transparent;
  overflow: hidden;
}

.tool-call.error {
  background: rgba(255, 241, 242, 0.72);
}

.tool-call-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.8rem;
  padding: 0.32rem 0.45rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: 0.42rem;
}

.tool-call-summary:hover {
  background: #FFFFFF;
}

.tool-call .tool-name {
  overflow: hidden;
  color: #4F46E5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-status {
  flex-shrink: 0;
  border: 1px solid rgba(112, 112, 112, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #707070;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.18rem 0.38rem;
}

.tool-call.done .tool-status {
  border-color: rgba(4, 120, 87, 0.16);
  background: rgba(236, 253, 245, 0.8);
  color: #047857;
}

.tool-call.error .tool-status {
  border-color: rgba(185, 28, 28, 0.18);
  background: rgba(254, 242, 242, 0.85);
  color: #B91C1C;
}

.tool-call-detail {
  display: grid;
  gap: 0.45rem;
  padding: 0 0.45rem 0.45rem 1.45rem;
}

.tool-call-args,
.tool-output {
  border: 1px solid rgba(21, 22, 24, 0.07);
  border-radius: 0.38rem;
  background: #FFFFFF;
  color: #151618;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding: 0.42rem 0.5rem;
  white-space: pre-wrap;
}

.tool-call-args {
  color: #707070;
}

.tool-output {
  max-height: 18rem;
  overflow-y: auto;
}

.tool-output[hidden] {
  display: none;
}

/* ─── User bubble ──────────────────────────────────────────────────────── */

.user-message {
  background: linear-gradient(135deg, #6055FC 0%, #4F46E5 100%);
  color: white;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.7rem 1rem;
  max-width: 75%;
  align-self: flex-end;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(96, 85, 252, 0.2);
  font-size: 0.95rem;
}

/* ─── Markdown ────────────────────────────────────────────────────────── */

.assistant-md {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #151618;
}
.assistant-md > * + * { margin-top: 0.75rem; }
.assistant-md strong { color: #151618; font-weight: 600; }
.assistant-md em { font-style: italic; color: #4A4A55; }
.assistant-md code {
  background: #FCFDD0;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  color: #4F46E5;
}
.assistant-md pre {
  background: #151618;
  color: #FCFDD0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre;
}
.assistant-md pre code { background: transparent; color: inherit; padding: 0; }
.assistant-md ul { list-style: disc; padding-left: 1.25rem; }
.assistant-md ol { list-style: decimal; padding-left: 1.25rem; }
.assistant-md li + li { margin-top: 0.25rem; }
.assistant-md h1, .assistant-md h2, .assistant-md h3 {
  font-family: "Space Grotesk", ui-sans-serif, system-ui;
  font-weight: 600;
  color: #151618;
}
.assistant-md h1 { font-size: 1.25rem; }
.assistant-md h2 { font-size: 1.1rem; color: #4F46E5; }
.assistant-md h3 { font-size: 1rem; }
.assistant-md a { color: #6055FC; text-decoration: underline; }
.assistant-md blockquote {
  border-left: 3px solid #D8D4FF;
  padding-left: 0.75rem;
  color: #4A4A55;
  font-style: italic;
}

/* Markdown tables. */
.assistant-md .md-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #EDEDED;
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.9rem;
  width: 100%;
  display: block;
  overflow-x: auto;
}
.assistant-md .md-table thead { background: #F4F2FF; }
.assistant-md .md-table th {
  text-align: left;
  font-family: "Space Grotesk", ui-sans-serif, system-ui;
  font-weight: 600;
  color: #4F46E5;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #D8D4FF;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.assistant-md .md-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #F4F4F8;
  vertical-align: top;
  color: #151618;
}
.assistant-md .md-table tbody tr:last-child td { border-bottom: none; }
.assistant-md .md-table tbody tr:hover { background: #FCFDD0; }
.assistant-md .md-table td code,
.assistant-md .md-table th code {
  font-size: 0.82em;
  padding: 0.05rem 0.3rem;
}

/* Scroll-to-bottom pill */
#scroll-pill {
  animation: pill-pop 0.18s ease-out;
}
@keyframes pill-pop {
  from { transform: translate(-50%, 8px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Markdown tables. */
.assistant-md .md-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #EDEDED;
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.9rem;
  width: 100%;
  display: block;
  overflow-x: auto;
}
.assistant-md .md-table thead {
  background: #F4F2FF;
}
.assistant-md .md-table th {
  text-align: left;
  font-family: "Space Grotesk", ui-sans-serif, system-ui;
  font-weight: 600;
  color: #4F46E5;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #D8D4FF;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.assistant-md .md-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #F4F4F8;
  vertical-align: top;
  color: #151618;
}
.assistant-md .md-table tbody tr:last-child td {
  border-bottom: none;
}
.assistant-md .md-table tbody tr:hover {
  background: #FCFDD0;
}
.assistant-md .md-table td code,
.assistant-md .md-table th code {
  /* Keep code chips tight inside cells. */
  font-size: 0.82em;
  padding: 0.05rem 0.3rem;
}

/* Composer textarea auto-grow */
#input { max-height: 12rem; min-height: 56px; }

/* ─── Attachment pills (in composer) ──────────────────────────────────── */
.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem 0.3rem 0.65rem;
  background: #F4F2FF;
  border: 1px solid #D8D4FF;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #4F46E5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-pill .filename {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 18ch;
}
.attachment-pill .size {
  color: #85858F;
  font-weight: 400;
  font-size: 0.7rem;
}
.attachment-pill .remove {
  background: transparent;
  border: 0;
  color: #6055FC;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.attachment-pill .remove:hover {
  background: #6055FC;
  color: white;
}
.attachment-pill.uploading { opacity: 0.6; }
.attachment-pill.error {
  background: #FFE4E4;
  border-color: #FCA5A5;
  color: #B91C1C;
}

/* ─── Inline (assistant-side) file pill ───────────────────────────────── */
.user-attachment-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
  max-width: 75%;
  align-self: flex-end;
}
.user-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  background: white;
  border: 1px solid #D8D4FF;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #4F46E5;
}

/* ─── Drop overlay ────────────────────────────────────────────────────── */
body.dragging-file #drop-overlay {
  opacity: 1;
}

/* ─── Dario intro video (welcome + in-chat hero) ──────────────────────── */
/* Stays invisible until the first frame has actually painted, so users
   never see the static-logo-then-animation flash. */
.dario-video {
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity 200ms ease;
}
.dario-video.ready { opacity: 1; }

/* ─── Header credits chip ─────────────────────────────────────────────── */
/* Out of credits: flip the yellow pill to a warning red so the user
   notices before an AI feature run fails. */
#credits-chip.credits-low {
  background: #FDE8E8;
  color: #B42318;
}

.dario-mark {
  display: block;
  width: 7rem;
  height: 7rem;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 1.25rem;
  opacity: 1;
}

.dario-animation {
  display: block;
  width: auto;
  height: clamp(7.5rem, 12vw, 9rem);
  max-width: min(18rem, 72vw);
  max-height: none;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 1.25rem;
  opacity: 1;
}

/* ─── Andromeda platform UI refresh ──────────────────────────────────── */
:root {
  --an-purple: #6055FC;
  --an-purple-dark: #4F46E5;
  --an-purple-light: #D8D4FF;
  --an-purple-tint: #F4F2FF;
  --an-yellow: #F8FC7E;
  --an-yellow-soft: #FCFDD0;
  --an-teal: #63D7CC;
  --an-black: #151618;
  --an-gray-900: #24252A;
  --an-gray-700: #555660;
  --an-gray-600: #707070;
  --an-gray-500: #85858F;
  --an-gray-200: #EDEDED;
  --an-gray-100: #F3F3F3;
  --surface: #FFFFFF;
  --surface-subtle: #FAFAFA;
  --border: rgba(21, 22, 24, 0.1);
  --shadow-sm: 0 1px 2px rgba(21, 22, 24, 0.04);
  --shadow-md: 0 10px 24px rgba(21, 22, 24, 0.08);
  --radius-card: 0.5rem;
  --radius-control: 0.5rem;
}

html,
body {
  background: var(--an-gray-100);
  color: var(--an-black);
}

body {
  min-width: 320px;
}

button,
textarea,
input {
  letter-spacing: 0;
}

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

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
.project-card:focus-visible,
.add-project-tile:focus-visible {
  outline: 3px solid rgba(96, 85, 252, 0.28);
  outline-offset: 2px;
}

.app-header {
  min-height: 4.1rem;
}

.app-header-inner {
  min-height: 4rem;
}

.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 0.4rem 0.6rem;
  font-weight: 600;
}

.header-action:hover {
  border-color: var(--border);
  background: var(--surface-subtle);
}

#project-chip {
  max-width: min(38vw, 22rem);
}

#project-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#status-dot {
  box-shadow: 0 0 0 3px rgba(96, 85, 252, 0.08);
}

body[data-mode="hero"] #composer-wrap {
  padding-bottom: 1.5rem;
}

body[data-mode="chat"] #composer-wrap {
  background: linear-gradient(to top, var(--an-gray-100) 72%, rgba(243, 243, 243, 0));
  padding-top: 0.75rem;
}

#projects-view,
#chat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 20rem),
    var(--an-gray-100);
}

#welcome-hero {
  gap: 0;
}

#welcome-intro,
#dario-intro {
  width: auto !important;
  height: clamp(7.5rem, 12vw, 9rem) !important;
  max-width: min(18rem, 72vw);
  max-height: none;
  object-fit: contain;
  object-position: center;
  margin-bottom: 1.25rem !important;
}

#welcome-hero p,
#hero p {
  color: var(--an-gray-700);
}

#projects-list h1,
#welcome-hero h1,
#hero h1,
#add-project-card h2 {
  letter-spacing: 0;
}

#welcome-hero h1,
#hero h1 {
  font-size: 2.5rem;
  line-height: 1.08;
}

#projects-list h1 {
  font-size: 2.25rem;
  line-height: 1.12;
}

#add-project-open,
#welcome-connect,
#add-project-submit {
  border-radius: var(--radius-control);
}

#projects-grid {
  align-items: stretch;
}

#add-project-card > div {
  border-color: var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

#add-project-error {
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-control);
  background: #FFF1F2;
  padding: 0.7rem 0.8rem;
}

.project-card {
  border-color: var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  min-height: 9.25rem;
  padding: 1rem;
}

.project-card::before {
  content: "";
  width: 2.15rem;
  height: 2.15rem;
  border-radius: var(--radius-control);
  background:
    linear-gradient(135deg, rgba(96, 85, 252, 0.16), rgba(99, 215, 204, 0.18)),
    var(--surface);
  border: 1px solid rgba(96, 85, 252, 0.14);
  margin-bottom: 0.8rem;
}

.project-card:hover {
  border-color: rgba(96, 85, 252, 0.28);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.project-card .name {
  color: var(--an-black);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.project-card .meta {
  color: var(--an-gray-500);
}

.project-card .added {
  color: var(--an-gray-600);
}

.project-card .remove {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--an-gray-500);
}

.project-card .remove:hover {
  background: #FFF1F2;
  color: #DC2626;
}

.add-project-tile {
  min-height: 9.25rem;
  border: 1px dashed rgba(96, 85, 252, 0.42);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.54);
  color: var(--an-purple);
}

.add-project-tile:hover {
  border-color: var(--an-purple);
  background: var(--an-purple-tint);
  transform: translateY(-1px);
}

.add-project-tile .plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: var(--radius-control);
  background: var(--an-purple);
  color: #FFFFFF;
  font-size: 1.35rem;
}

#messages {
  width: 100%;
}

.message-row {
  width: 100%;
}

.assistant-row {
  display: grid !important;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.85rem !important;
  align-items: start;
}

.assistant-row > img {
  width: 2.25rem !important;
  height: 2.25rem !important;
  border-radius: var(--radius-control);
  background: white;
  border: 1px solid var(--border);
  padding: 0.18rem;
  margin-top: 0 !important;
}

.assistant-row > img.assistant-avatar {
  object-fit: cover !important;
  object-position: 58% 26%;
  background: var(--an-purple-tint);
}

.assistant-body {
  position: relative;
}

.assistant-header {
  min-height: 1.75rem;
  margin-bottom: 0.15rem;
}

.assistant-header-actions {
  position: absolute;
  top: -0.1rem;
  right: 0;
  z-index: 1;
  justify-content: flex-end;
  min-height: 0;
  margin-bottom: 0;
}

.assistant-content {
  max-width: 52rem;
  padding-top: 0.22rem;
}

.assistant-md {
  color: var(--an-black);
  font-size: 0.96rem;
  line-height: 1.65;
}

.assistant-md h1,
.assistant-md h2,
.assistant-md h3 {
  letter-spacing: 0;
}

.assistant-md h2 {
  color: var(--an-purple-dark);
}

.assistant-md code {
  background: var(--an-yellow-soft);
  color: var(--an-purple-dark);
}

.assistant-md pre {
  background: var(--an-black);
  color: var(--an-yellow-soft);
  border-radius: var(--radius-card);
}

.assistant-md .md-table {
  border-color: var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  display: block;
  width: fit-content;
  min-width: min(32rem, 100%);
  max-width: 100%;
}

.assistant-md .md-table th {
  background: var(--an-purple-tint);
  color: var(--an-purple-dark);
  letter-spacing: 0;
}

.assistant-md .md-table tbody tr:hover {
  background: rgba(248, 252, 126, 0.34);
}

.user-row {
  align-items: flex-end;
}

.user-message {
  max-width: min(78%, 48rem);
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--an-purple);
  box-shadow: 0 8px 20px rgba(96, 85, 252, 0.16);
  font-size: 0.96rem;
  line-height: 1.55;
}

.message-copy {
  border-color: var(--border);
  color: var(--an-gray-600);
  border-radius: 999px;
  font-weight: 600;
}

.message-copy:hover,
.message-copy.copied {
  border-color: rgba(96, 85, 252, 0.32);
  background: var(--an-purple-tint);
  color: var(--an-purple-dark);
}

.chip {
  border-color: var(--border);
  border-radius: 999px;
  color: var(--an-black);
  box-shadow: var(--shadow-sm);
}

.chip:hover {
  border-color: rgba(96, 85, 252, 0.36);
  background: var(--an-purple-tint);
  box-shadow: 0 8px 18px rgba(96, 85, 252, 0.1);
}

.chip .dot {
  flex: 0 0 auto;
}

#composer {
  filter: drop-shadow(0 12px 24px rgba(21, 22, 24, 0.08));
}

.composer-field {
  position: relative;
}

#input {
  display: block;
  min-height: 58px;
  max-height: 12rem;
  border-color: var(--border);
  border-radius: 0.85rem;
  color: var(--an-black);
  line-height: 1.5;
  box-shadow: none;
}

#input:disabled {
  background: #FAFAFA;
  color: var(--an-gray-600);
}

#send,
#attach {
  border-radius: var(--radius-control);
  top: 50%;
  transform: translateY(-50%);
}

#send {
  background: var(--an-purple);
}

#send:hover {
  background: var(--an-purple-dark);
}

#send[data-action="stop"],
#send[data-action="stopping"] {
  background: #DC2626;
}

.activity-inner,
.assistant-pending {
  border-color: rgba(96, 85, 252, 0.24);
  background: var(--an-purple-tint);
  color: var(--an-purple-dark);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.activity-pulse,
.pending-orb {
  background: currentColor;
}

.thinking-dots i {
  background: currentColor;
}

.tool-card {
  border-color: rgba(96, 85, 252, 0.16);
  border-left-color: var(--an-purple);
  border-radius: var(--radius-card);
  background: rgba(248, 252, 126, 0.38);
}

.tool-card .tool-name {
  color: var(--an-purple-dark);
}

.tool-card pre {
  border-radius: var(--radius-control);
}

.attachment-pill {
  border-color: rgba(96, 85, 252, 0.24);
  background: var(--an-purple-tint);
  color: var(--an-purple-dark);
}

.attachment-icon,
.user-attachment-icon {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}

.user-attachment-line {
  max-width: min(78%, 48rem);
}

.user-attachment {
  border-color: rgba(96, 85, 252, 0.28);
  color: var(--an-purple-dark);
}

#drop-overlay > div {
  border-radius: var(--radius-card);
}

#scroll-pill {
  border-radius: 999px;
  background: var(--an-purple);
  box-shadow: var(--shadow-md);
}

#activity {
  display: none !important;
}

body[data-mode="hero"] #hero {
  flex: 1 1 auto;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 1.25rem;
}

body[data-mode="hero"] #composer-wrap {
  flex: 0 0 auto;
  padding-top: 0;
  padding-bottom: 1.25rem;
}

body[data-mode="hero"] #starter-chips {
  margin-top: 0.9rem;
}

body[data-mode="hero"] #starter-chips > .text-xs {
  margin-bottom: 0.65rem;
}

body[data-mode="hero"] #starter-chips .flex {
  align-items: center;
  justify-content: flex-start;
  row-gap: 0.55rem;
}

body[data-mode="hero"] #model-info {
  display: none;
}

@media (max-width: 760px) {
  .app-header {
    min-height: 3.75rem;
  }

  .app-header-inner {
    min-height: 3.75rem;
    gap: 0.6rem;
  }

  #project-chip {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .app-header-inner {
    flex-wrap: wrap;
  }

  .header-action span {
    display: none;
  }

  .header-action {
    width: 2rem;
    padding: 0;
  }

  body[data-mode="hero"] #composer-wrap {
    padding-bottom: 1rem;
  }

  #welcome-hero,
  #hero {
    justify-content: flex-start;
    min-height: auto;
  }

  body[data-mode="hero"] #hero {
    padding-top: 1.75rem;
    padding-bottom: 0.75rem;
  }

  #welcome-intro,
  #dario-intro,
  .dario-animation {
    width: auto !important;
    height: clamp(6.5rem, 28vw, 7.75rem) !important;
    max-width: min(16rem, 78vw);
    max-height: none;
    margin-bottom: 0.9rem !important;
  }

  #starter-chips {
    margin-top: 0.75rem;
    max-width: min(100%, calc(100vw - 1.5rem));
  }

  body[data-mode="hero"] #starter-chips .flex,
  #starter-chips .flex {
    justify-content: flex-start;
    overflow-x: visible;
    flex-wrap: wrap;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .chip {
    flex: 0 1 auto;
    max-width: 100%;
    padding-inline: 0.8rem;
  }

  .assistant-row {
    grid-template-columns: 1.9rem minmax(0, 1fr);
    gap: 0.65rem !important;
  }

  .assistant-row > img {
    width: 1.9rem !important;
    height: 1.9rem !important;
  }

  .user-message,
  .user-attachment-line {
    max-width: 92%;
  }

  #messages {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  #composer-wrap {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}
