:root {
  --bg-1: #f2f6f9;
  --bg-2: #edf1f3;
  --ink: #0f1c2e;
  --muted: #556179;
  --brand: #0d6d73;
  --brand-2: #0a4f54;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(16, 32, 48, 0.09);
  --assistant: #ffffff;
  --user: #e4f7f7;
  --shadow: 0 16px 40px rgba(12, 24, 36, 0.14);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 8% 10%, #d2ece8 0%, transparent 36%),
    radial-gradient(circle at 90% 5%, #dceaf8 0%, transparent 35%),
    linear-gradient(145deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1.3rem;
  max-width: 100vw;
  margin: 0 auto;
  padding: 1.6rem 1.6rem 1.2rem;
  position: relative;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 100%;
  z-index: -1;
  filter: blur(26px);
}

.ambient-one {
  width: 340px;
  height: 340px;
  background: rgba(18, 172, 156, 0.14);
  top: -120px;
  left: -120px;
}

.ambient-two {
  width: 260px;
  height: 260px;
  background: rgba(84, 149, 213, 0.16);
  right: -70px;
  bottom: 80px;
}

.topbar {
  display: grid;
  gap: 0.6rem;
  animation: rise 0.9s ease both;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.9rem;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
}

.export-btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
}

.brand-chip {
  justify-self: start;
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #0f5559;
  background: rgba(13, 109, 115, 0.12);
  border: 1px solid rgba(13, 109, 115, 0.2);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  max-width: 800px;
}

.chat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  width: 100%;
  position: relative;
  animation: rise 0.9s ease both;
  animation-delay: 0.15s;
}

.messages {
  overflow-y: auto;
  padding: 1.2rem;
  display: grid;
  gap: 0.82rem;
  scroll-behavior: smooth;
  min-height: 0;
}

.message-row {
  display: flex;
}

.message-row.assistant {
  justify-content: flex-start;
}

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

.bubble {
  max-width: min(96%, 1400px);
  padding: 0.78rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 3px 16px rgba(15, 28, 46, 0.08);
  transform-origin: bottom;
  animation: pop 0.24s ease;
}

.message-row.assistant .bubble {
  background: var(--assistant);
}

.message-row.user .bubble {
  background: var(--user);
  border-color: rgba(13, 109, 115, 0.18);
}

.bubble p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message-content {
  line-height: 1.6;
  overflow-x: auto;
}

.message-content p {
  margin: 0.3rem 0;
}

.message-content table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.88rem;
  position: relative;
}

.message-content th,
.message-content td {
  border: 1px solid rgba(15, 28, 46, 0.12);
  padding: 0.35rem 0.45rem;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.message-content th {
  background: rgba(13, 109, 115, 0.08);
  position: sticky;
  top: 0;
  z-index: 1;
}

.message-content code {
  background: rgba(15, 28, 46, 0.08);
  border-radius: 6px;
  padding: 0.08rem 0.3rem;
}

.deal-link {
  color: #0a4f54;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(10, 79, 84, 0.4);
  cursor: pointer;
}

.deal-link:hover {
  color: #0d6d73;
  border-bottom-color: rgba(13, 109, 115, 0.7);
}

.section-link {
  color: #0a4f54;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted rgba(10, 79, 84, 0.5);
  cursor: pointer;
}

.section-link:hover {
  color: #0d6d73;
  border-bottom-color: rgba(13, 109, 115, 0.8);
}

.message-content ul,
.message-content ol {
  list-style: none;
  margin: 0.4rem 0;
  padding-left: 0;
}

.message-content li {
  margin: 0.2rem 0;
}

.message-content input[type="checkbox"] {
  display: none;
}

.tool-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #265f64;
}

.download-row {
  margin-top: 0.35rem;
  display: flex;
  justify-content: flex-end;
}

.download-btn {
  border: 1px solid rgba(13, 109, 115, 0.2);
  background: rgba(13, 109, 115, 0.08);
  color: #0f5559;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.download-btn:hover {
  background: rgba(13, 109, 115, 0.16);
}

.chat-toolbar {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 5;
}

.message-time {
  margin-top: 0.42rem;
  font-size: 0.72rem;
  color: #6b778e;
}

.starter-panel {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(16, 32, 48, 0.08);
}

.followup-row .bubble {
  width: min(100%, 840px);
}

.followup-bubble {
  background: #fff;
}

.followup-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f4f54;
  margin-bottom: 0.45rem;
}

.followup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.followup-btn {
  border: 1px solid rgba(13, 109, 115, 0.2);
  border-radius: 999px;
  background: rgba(13, 109, 115, 0.08);
  color: #0f4448;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.38rem 0.68rem;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.followup-btn:hover {
  background: rgba(13, 109, 115, 0.16);
  transform: translateY(-1px);
}

.typing-bubble {
  display: inline-flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}

.dots {
  display: inline-flex;
  gap: 0.24rem;
  align-items: center;
}

.progress-panel {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(127, 141, 163, 0.25);
  font-size: 0.72rem;
  color: rgba(15, 23, 42, 0.7);
}

.progress-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.64rem;
  margin-bottom: 0.3rem;
}

.progress-step {
  padding: 0.12rem 0;
  font-weight: 600;
}

.dot {
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 100%;
  background: #7f8da3;
  animation: blink 1.2s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.15s;
}

.dot:nth-child(3) {
  animation-delay: 0.3s;
}

.composer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.95rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0.72rem;
}

.composer button {
  height: 100%;
  min-height: 60px;
}

.scroll-down-btn {
  position: absolute;
  right: 1.05rem;
  bottom: 6.2rem;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(16, 32, 48, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: #0f1c2e;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(12, 24, 36, 0.14);
}

.scroll-down-btn:hover:not(:disabled) {
  background: rgba(13, 109, 115, 0.1);
  filter: none;
}

textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(16, 32, 48, 0.15);
  background: #fff;
  resize: none;
  outline: none;
  min-height: 60px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  line-height: 1.45;
}

textarea:focus {
  border-color: rgba(13, 109, 115, 0.6);
  box-shadow: 0 0 0 3px rgba(13, 109, 115, 0.12);
}

button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 600;
  padding: 0 1rem;
  min-width: 104px;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

@keyframes blink {
  0%,
  80%,
  100% {
    transform: scale(0.9);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 720px) {
  .app-shell {
    padding: 1rem 0.7rem 0.7rem;
    gap: 0.9rem;
  }

  .chat-card {
    border-radius: 16px;
  }

  .bubble {
    max-width: 90%;
  }

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

  .scroll-down-btn {
    right: 0.9rem;
    bottom: 7.2rem;
  }

  button {
    height: 44px;
  }

  .composer button {
    height: 100%;
    min-height: 56px;
  }
}
