:root {
  --bg: #000;
  --text: #f5f5f5;
  --muted: #b5b5b5;
  --header-height: 64px;
  --accent: #3be8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  padding-bottom: 120px; /* space for fixed composer */
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  background: #000;
  border-bottom: 1px solid #7B7B7B;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.icon-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  position: relative;
}

.icon-button .material-symbols-outlined {
  font-size: 28px;
  line-height: 1;
}

.icon-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  transition-delay: 200ms;
}

.icon-button[data-tooltip]:hover::after {
  opacity: 1;
}

.app-main {
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.placeholder {
  color: var(--muted);
  border: 1px dashed #2a2a2a;
  padding: 24px;
  border-radius: 8px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.bubble {
  max-width: 470px;
  background: #262626;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  padding: 16px;
  border-radius: 24px 0 24px 24px;
  align-self: flex-end;
  scroll-margin-bottom: 140px;
}

.answer {
  min-height: 40px;
  padding-top: 20px;
  scroll-margin-bottom: 140px;
}

.answer-inner {
  white-space: pre-wrap;
  overflow: visible;
  font-family: "Noto Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  line-height: 1.4;
  padding: 16px;
  border-radius: 24px 0 24px 24px;
  align-self: flex-start;
  max-width: 100%;
  width: auto;
  background: transparent;
}

.answer-inner a,
.answer-inner a:visited {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.answer-inner a:hover {
  text-decoration-thickness: 2px;
}

.answer-inner.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.answer-inner.typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.answer-inner.typing .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: typingPulse 1.2s infinite ease-in-out;
}

.answer-inner.typing .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.answer-inner.typing .dot:nth-child(3) {
  animation-delay: 0.4s;
}

.answer-inner ul,
.answer-inner ol {
  margin: 0;
  padding: 0 0 0 18px;
  white-space: normal;
}

.answer-inner li {
  margin: 0;
  padding: 0;
  white-space: normal;
}

.composer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px 10px 36px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 40%, rgba(0,0,0,1) 100%);
}

.composer-inner {
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
}

.composer-inner textarea {
  background: #484848;
  border: none;
  border-radius: 0;
  font-family: "Noto Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  line-height: 1.4;
  padding: 10px 20px;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  flex: 1;
  outline: none;
  resize: none;
  overflow-y: auto;
}

.composer-inner textarea::placeholder {
  color: #A5A5A5;
}

.composer-inner button {
  background: var(--accent);
  border: none;
  width: 48px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  cursor: pointer;
  padding: 0 12px;
  transition: opacity 150ms ease, background 150ms ease;
}

.composer-inner button .material-symbols-outlined {
  font-size: 30px;
  color: #fff;
}

/* Disabled look when the input is still showing placeholder */
.composer-inner textarea:placeholder-shown + button {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--accent);
}

.composer-inner button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
