.chat-page {
  min-height: 100vh;
  background: var(--soft);
}

.chat-header {
  position: relative;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.chat-main {
  padding: 1.5rem 0 3rem;
}

.chat-shell {
  max-width: 40rem;
  margin: 0 auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 1.15rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
}

.chat-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  border-bottom: 1px solid #1e293b;
}

.restart-btn {
  margin-left: auto;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.restart-btn:hover,
.restart-btn:focus-visible {
  color: #e2e8f0;
  border-color: var(--blue-500);
  outline: none;
}

.chat-live-thread {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 18rem;
  max-height: min(55vh, 28rem);
  overflow-y: auto;
  padding: 1rem;
  background: #161e2e;
}

.msg {
  max-width: 90%;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 0.85rem;
  white-space: pre-wrap;
}

.msg-user {
  align-self: flex-end;
  background: var(--blue-600);
  color: #fff;
  border-bottom-right-radius: 0.3rem;
}

.msg-bot {
  align-self: flex-start;
  background: #1e293b;
  color: #e2e8f0;
  border-bottom-left-radius: 0.3rem;
}

.msg-bot.streaming::after {
  content: "▍";
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.card-slot {
  padding: 0 1rem 1rem;
  background: #161e2e;
}

.result-card {
  background: #fff;
  color: var(--navy);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.result-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.result-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.result-card li {
  padding: 0.65rem 0.75rem;
  background: var(--soft);
  border-radius: 0.55rem;
  border-left: 3px solid var(--cyan);
}

.result-card .pick-name,
.result-card .station-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
}

.result-card .pick-meta,
.result-card .station-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--mute);
}

.result-card a {
  color: var(--blue-600);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
}

.result-card a:hover {
  text-decoration: underline;
}

.card-fresh {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--mute);
}

.chat-live-form {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid #1e293b;
  background: #0f172a;
}

.chat-live-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  resize: vertical;
  min-height: 3.5rem;
}

.chat-live-form textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.chat-live-form .btn {
  justify-self: end;
}

.chat-error {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fca5a5;
  background: #0f172a;
}

@media (prefers-reduced-motion: reduce) {
  .msg-bot.streaming::after {
    animation: none;
  }
}

.choice-slot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-self: stretch;
  max-width: 100%;
  margin-top: 0.15rem;
}
.choice-slot[hidden] {
  display: none;
}
.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.15rem 0 0.25rem;
  background: transparent;
  border: 0;
}
.chip {
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover,
.chip:focus-visible {
  border-color: var(--blue-500);
  outline: none;
}
.cp-pad {
  display: flex;
  gap: 0.5rem;
  padding: 0.15rem 0 0.25rem;
  background: transparent;
  max-width: 18rem;
}
.cp-pad[hidden] {
  display: none;
}
.chip-bar:empty {
  display: none;
}
.cp-pad input {
  flex: 1;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.5rem 0.75rem;
  font: inherit;
}
.text-toggle {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  cursor: pointer;
  text-align: left;
}
.text-wrap {
  border-top: 1px solid #1e293b;
}
.text-wrap[hidden] {
  display: none;
}
