
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: "DM Sans", sans-serif;
  color: #eef0f5;
  background: #08090c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;

  --bg: #08090c;
  --sidebar: #0b0d11;
  --panel: #11141a;
  --panel-hover: #171b23;
  --line: #242831;
  --text: #eef0f5;
  --muted: #888f9e;
  --subtle: #5f6674;
  --accent: #aaaecb;
  --accent-bright: #d7d9e6;
  --soft: #1b1b2a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 65% 0%, #24213930, transparent 36%),
    var(--bg);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #aaa6dc;
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
}

/* SIDEBAR */

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0e1015, #0a0c10);
  border-right: 1px solid var(--line);
  padding: 24px 15px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #f1f2f6;
  font: 800 21px Manrope, sans-serif;
  letter-spacing: -0.9px;
  padding: 0 10px 31px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f2f4f8, #737c8d 54%, #343b48);
  color: #101219;
  font: 800 25px Manrope, sans-serif;
  box-shadow: 0 4px 20px #c0c7d31a;
}

.brand-ai {
  color: #9199a8;
  font-weight: 500;
}

.new-chat {
  height: 44px;
  border: 1px solid #383d49;
  border-radius: 11px;
  background: linear-gradient(135deg, #1c2029, #151820);
  color: #e8eaf0;
  font-weight: 600;
  text-align: left;
  padding: 0 13px;
  margin-bottom: 29px;
  transition: all .2s ease;
}

.new-chat:hover {
  background: #252a36;
  border-color: #687083;
  transform: translateY(-1px);
}

.new-chat span {
  font-size: 20px;
  vertical-align: -1px;
  margin-right: 7px;
  color: #d6d9e3;
}

.side-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: #697181;
  padding: 0 12px 11px;
}

.nav-item {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  color: #979eac;
  text-align: left;
  margin-bottom: 5px;
  font-size: 13px;
  transition: all .18s ease;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(90deg, #ffffff10, #ffffff05);
  border-color: #ffffff0d;
  color: #f1f2f6;
  font-weight: 600;
}

.nav-item.active {
  box-shadow: inset 2px 0 #b9bfd1;
}

.nav-icon {
  width: 19px;
  text-align: center;
  font-size: 16px;
  color: #bdc4d2;
}

.history-label {
  margin-top: 27px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-entry {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  color: #8c93a1;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all .15s ease;
}

.history-entry:hover,
.history-entry.current {
  background: #ffffff09;
  color: #e2e5ed;
  border-color: #ffffff0a;
}

.history-entry.current {
  font-weight: 600;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 17px 7px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #d8dce6, #6d7483);
  color: #11141b;
  font-weight: 800;
}

.profile-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

.profile-text strong {
  font-size: 12px;
  color: #e1e4eb;
}

.profile-text span {
  color: #777f8d;
}

.status-dot,
.tiny-dot {
  width: 7px;
  height: 7px;
  background: #65c99d;
  border-radius: 50%;
  margin-left: auto;
}

/* MAIN WORKSPACE */

.main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: #0b0d11d9;
  backdrop-filter: blur(18px);
}

.top-title {
  font-size: 12px;
  color: #858c9a;
}

.top-title span {
  margin: 0 10px;
  color: #555d6a;
}

.top-title strong {
  font-size: 12px;
  color: #e2e5ec;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.secure-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9299a6;
}

.tiny-dot {
  margin: 0;
  width: 6px;
  height: 6px;
}

.icon-button,
.mobile-menu {
  border: 1px solid var(--line);
  background: #14171e;
  color: #abb2c0;
  border-radius: 9px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  transition: all .18s ease;
}

.icon-button:hover,
.mobile-menu:hover {
  background: #252a34;
  color: white;
  border-color: #555d6d;
}

.mobile-menu {
  display: none;
}

/* CONTENT */

.content {
  width: min(900px, 100%);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 5vh, 55px) 30px 18px;
  min-height: 0;
}

/* WELCOME SCREEN */

.welcome {
  margin: auto 0 27px;
}

.sparkle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #272a38, #171a24);
  border: 1px solid #414657;
  color: #e0e4ef;
  font-size: 23px;
  margin-bottom: 24px;
  box-shadow: 0 7px 22px #0005;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #a2a6be;
  margin: 0 0 14px;
}

.welcome h1 {
  font: 700 clamp(34px, 4.3vw, 49px)/1.17 Manrope, sans-serif;
  letter-spacing: -2.3px;
  margin: 0;
  color: #f0f1f5;
}

.welcome h1 span {
  background: linear-gradient(100deg, #f0f2f7, #9da6bb 48%, #aaa2df);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.welcome-copy {
  max-width: 490px;
  color: #9299a7;
  font-size: 14px;
  line-height: 1.8;
  margin: 18px 0 28px;
}

/* SUGGESTION CARDS */

.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  max-width: 650px;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 13px;
  border: 1px solid #292e39;
  border-radius: 12px;
  background: linear-gradient(145deg, #13161d, #101319);
  text-align: left;
  min-width: 0;
  transition: all .2s ease;
}

.suggestion:hover {
  transform: translateY(-3px);
  border-color: #656b7e;
  background: #191d27;
  box-shadow: 0 12px 30px #0004;
}

.suggestion-icon {
  height: 35px;
  width: 35px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 16px;
  background: #252936;
  color: #e1e5ef;
}

.purple {
  background: #28243a;
  color: #c4b8f2;
}

.peach {
  background: #33251f;
  color: #e7b69a;
}

.blue {
  background: #202c3c;
  color: #a9c9ed;
}

.green {
  background: #1d3029;
  color: #9cdbb9;
}

.suggestion strong,
.suggestion small {
  display: block;
}

.suggestion strong {
  font-size: 12px;
  font-weight: 600;
  color: #e6e8ef;
}

.suggestion small {
  font-size: 10px;
  color: #858d9c;
  margin-top: 4px;
}

.arrow {
  margin-left: auto;
  color: #858d9e;
  font-size: 15px;
}

/* CHAT COMPOSER */

.composer-wrap {
  margin-top: auto;
}

.composer {
  border: 1px solid #303541;
  background: linear-gradient(145deg, #151820, #101319);
  border-radius: 16px;
  padding: 13px 14px 11px;
  box-shadow: 0 12px 35px #0004;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.composer:focus-within {
  border-color: #777b98;
  box-shadow: 0 0 0 3px #a9a5da13, 0 14px 38px #0006;
}

.composer textarea {
  display: block;
  resize: none;
  width: 100%;
  border: 0;
  outline: 0;
  min-height: 48px;
  max-height: 180px;
  padding: 7px 5px 11px;
  color: #eff0f5;
  background: transparent;
  font-size: 13px;
  line-height: 1.7;
}

.composer textarea::placeholder {
  color: #777f8e;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-tools {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tool-pill {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 9px;
  background: transparent;
  color: #8991a0;
  font-size: 11px;
  transition: all .18s ease;
}

.tool-pill:hover {
  background: #ffffff0a;
  color: #e2e5ee;
}

.tool-pill.selected {
  background: #272a3b;
  color: #e2e1f4;
  border-color: #44455f;
}

.send-area {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.send-area span {
  font-size: 10px;
  color: #747d8d;
}

.send-button {
  border: 1px solid #8990a0;
  border-radius: 10px;
  background: linear-gradient(145deg, #e3e6ed, #919bad);
  color: #10131a;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 4px 16px #0004;
  transition: all .18s ease;
}

.send-button:not(:disabled):hover {
  transform: translateY(-2px);
  background: linear-gradient(145deg, #fff, #b6bfd0);
  box-shadow: 0 7px 20px #929bb433;
}

.send-button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.disclaimer {
  text-align: center;
  font-size: 10px;
  color: #747c89;
  margin: 12px 0 3px;
}

/* CONVERSATION */

.conversation {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 0 24px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 240px);
  padding: 9px 3px;
  scrollbar-width: thin;
  scrollbar-color: #454a57 transparent;
}

.message {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  animation: appear .2s ease;
}

.message-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, #dfe3ec, #858fa1);
  color: #11141b;
  font-weight: 800;
  font-size: 13px;
}

.message.user .message-avatar {
  background: #242a36;
  color: #dfe4ef;
  border: 1px solid #3d4351;
}

.message-body {
  min-width: 0;
  flex: 1;
}

.message-name {
  font-size: 11px;
  color: #969eac;
  font-weight: 600;
  margin: 4px 0 8px;
}

.message-text {
  font-size: 14px;
  line-height: 1.85;
  color: #d5d8e1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-text p {
  margin: 0 0 13px;
}

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

.message-text h1,
.message-text h2,
.message-text h3 {
  font-family: Manrope, sans-serif;
  color: #f0f1f5;
  line-height: 1.4;
  margin: 19px 0 9px;
}

.message-text h1 { font-size: 23px; }
.message-text h2 { font-size: 19px; }
.message-text h3 { font-size: 16px; }

.message-text strong {
  font-weight: 700;
  color: #f1f2f6;
}

.message-text a {
  color: #c4c0ed;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-text ul {
  padding-left: 22px;
  margin: 9px 0 14px;
}

.message-text li {
  padding-left: 3px;
  margin: 6px 0;
}

.message-text blockquote {
  margin: 10px 0;
  padding: 11px 14px;
  border-left: 3px solid #8984bd;
  background: #171823;
  color: #abb0c0;
  border-radius: 0 9px 9px 0;
}

.message-text code {
  font-family: Consolas, monospace;
  font-size: .9em;
  color: #d1cafa;
  background: #262338;
  border: 1px solid #39344d;
  padding: 2px 5px;
  border-radius: 5px;
}

/* CODE BLOCKS */

.code-block {
  position: relative;
  margin: 14px 0;
  border: 1px solid #343946;
  border-radius: 11px;
  overflow: hidden;
  background: #0c0e13;
  color: #f0f1f6;
  box-shadow: 0 8px 25px #0003;
}

.code-block pre {
  margin: 0;
  padding: 38px 17px 17px;
  overflow: auto;
  max-width: 100%;
  font: 12px/1.75 Consolas, "Courier New", monospace;
  color: #e0e4ed;
  white-space: pre;
}

.code-block pre code {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

.code-language {
  position: absolute;
  top: 11px;
  left: 13px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a5adbc;
}

.copy-code {
  position: absolute;
  top: 7px;
  right: 8px;
  border: 1px solid #444a57;
  border-radius: 6px;
  background: #ffffff0a;
  color: #cbd0dc;
  padding: 5px 9px;
  font-size: 10px;
}

.copy-code:hover {
  background: #ffffff18;
  color: white;
}

.message-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  opacity: .8;
}

.message-action {
  border: 1px solid transparent;
  background: transparent;
  color: #929aa8;
  font-size: 11px;
  border-radius: 7px;
  padding: 6px 9px;
}

.message-action:hover {
  background: #ffffff0a;
  border-color: #343a47;
  color: #e6e8ef;
}

/* LOADING AND NOTIFICATIONS */

.typing {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a1a8b6;
  font-size: 13px;
}

.typing::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b9b5e6;
  box-shadow: 9px 0 #8983bd, 18px 0 #575378;
  display: inline-block;
  margin-left: 18px;
  animation: pulse 1s infinite ease-in-out;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #242833;
  border: 1px solid #3b4250;
  color: #f0f2f6;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  max-width: 90vw;
  z-index: 20;
  box-shadow: 0 12px 35px #0008;
}

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

/* ANIMATIONS */

button {
  transition:
    background .17s ease,
    border-color .17s ease,
    transform .17s ease,
    color .17s ease;
}

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

@keyframes pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

/* RESPONSIVE */

@media (min-width: 1100px) {
  .content {
    width: min(940px, 100%);
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    z-index: 10;
    left: -275px;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 260px;
    box-shadow: 12px 0 35px #0008;
    transition: left .22s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-menu {
    display: block;
    margin-right: 11px;
  }

  .topbar {
    height: 62px;
    padding: 0 14px;
    justify-content: flex-start;
  }

  .top-title {
    flex: 1;
    white-space: nowrap;
  }

  .top-actions {
    gap: 9px;
  }

  .secure-label {
    font-size: 0;
    gap: 0;
  }

  .secure-label .tiny-dot {
    width: 7px;
    height: 7px;
  }

  .content {
    padding: 29px 16px 13px;
  }

  .welcome h1 {
    font-size: clamp(32px, 8vw, 39px);
    letter-spacing: -1.7px;
  }

  .welcome-copy {
    font-size: 13px;
  }

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

  .suggestion {
    padding: 12px;
  }

  .conversation {
    max-height: calc(100vh - 235px);
    gap: 20px;
  }

  .message-text {
    font-size: 13px;
  }

  .message-actions {
    opacity: 1;
  }

  .tool-pill {
    padding: 7px;
  }

  .tool-pill span {
    display: none;
  }

  .disclaimer {
    font-size: 9px;
  }

  .composer {
    padding: 10px;
  }

  .composer-footer {
    align-items: flex-end;
  }

  .send-area {
    gap: 7px;
  }

  .send-area span {
    display: none;
  }

  .code-block pre {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding: 0 9px;
  }

  .top-title {
    font-size: 10px;
  }

  .tool-pill {
    padding: 6px;
    font-size: 10px;
  }

  .welcome h1 {
    font-size: 31px;
  }
}

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