:root {
  --c-bg: #0b1120;
  --c-surface: #1e293b;
  --c-border: #2d3a4d;
  --c-text: #e2e8f0;
  --c-muted: #94a3b8;
  --c-primary: #3b82f6;
  --c-primary-hover: #2563eb;
  --c-user-msg: #3b82f6;
  --c-bot-msg: rgba(255,255,255,.06);
  --c-card: rgba(255,255,255,.04);
  --c-green: #22c55e;
  --c-red: #ef4444;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  height: 100%;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: none; background: none; }

.page {
  display: flex; flex-direction: column;
  height: 100vh; max-width: 960px;
  margin: 0 auto; padding: 0 16px;
}

/* Header */
.header { padding: 24px 0 16px; text-align: center; flex-shrink: 0; }
.header__logo { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 8px; }
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--c-primary); color: #fff;
  font-weight: 800; font-size: .85rem;
}
.logo-text { font-weight: 700; font-size: 1.15rem; }
.header__tagline { color: var(--c-muted); font-size: .9rem; }

/* Chat */
.chat-container { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat {
  flex: 1; display: flex; flex-direction: column;
  background: var(--c-surface); border-radius: 16px;
  border: 1px solid var(--c-border); overflow: hidden;
  min-height: 0;
}
.chat__header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.chat__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-primary); display: flex;
  align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .8rem;
}
.chat__name { font-weight: 600; font-size: .9rem; }
.chat__status { color: var(--c-muted); font-size: .75rem; }
.chat__body {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat__welcome p { color: var(--c-muted); font-size: .9rem; margin-bottom: 6px; }
.chat__prompts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.prompt-btn {
  padding: 10px 14px; border-radius: 10px;
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.18);
  color: var(--c-text); font-size: .88rem; text-align: left;
  transition: background .15s, border-color .15s;
}
.prompt-btn:hover { background: rgba(59,130,246,.15); border-color: var(--c-primary); }

/* Input */
.chat__input {
  display: flex; gap: 8px; padding: 14px 18px;
  border-top: 1px solid var(--c-border); flex-shrink: 0;
}
#chat-input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  background: var(--c-bg); color: var(--c-text);
  border: 1px solid var(--c-border); font-size: .88rem;
  outline: none; font-family: var(--font);
}
#chat-input:focus { border-color: var(--c-primary); }
#chat-input::placeholder { color: var(--c-muted); }
.send-btn {
  padding: 10px 18px; border-radius: 10px;
  background: var(--c-primary); color: #fff;
  font-weight: 600; font-size: .88rem;
  transition: background .15s;
}
.send-btn:hover { background: var(--c-primary-hover); }

/* Messages */
.msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: .88rem; line-height: 1.5;
  animation: fadeIn .25s ease-out;
}
.msg--user {
  background: var(--c-user-msg); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.msg--bot {
  background: var(--c-bot-msg); color: var(--c-text);
  align-self: flex-start; border-bottom-left-radius: 4px;
  white-space: pre-line;
}
.msg--card {
  background: var(--c-card); border: 1px solid var(--c-border);
  padding: 14px; border-radius: 12px; align-self: flex-start;
  max-width: 95%;
}
.msg--card h4, .plan-card h4 { font-size: .85rem; margin-bottom: 4px; }
.msg--card p, .plan-card p { font-size: .78rem; color: var(--c-muted); margin-bottom: 2px; }
.msg--card .price, .plan-card .price { color: var(--c-text); font-weight: 700; font-size: .9rem; }
.msg--card .checks { font-size: .78rem; margin-top: 6px; }

/* Plans grid — side-by-side on desktop, stacked on mobile */
.plans-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  width: 100%; min-width: 0; animation: fadeIn .3s ease-out;
}
.plans-grid .plan-card { min-width: 0; }
.plan-card { padding: 0; overflow: visible; background: var(--c-card); border: 1px solid var(--c-border); border-radius: 12px; }
.plan-card .card-img { width: 100%; max-height: 160px; overflow: hidden; }
.plan-card .card-img img {
  width: 100%; height: 120px; object-fit: cover;
  display: block; background: var(--c-border);
}
.plan-card .card-img img[src=""], .plan-card .card-img img:not([src]) { display: none; }
.plan-card .card-body { padding: 14px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.card-header h4 { flex: 1; }
.card-badge {
  flex-shrink: 0; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 600;
  background: rgba(59,130,246,.15); color: var(--c-primary); white-space: nowrap;
}
.card-details-grid { display: grid; gap: 2px; margin: 6px 0; }
.card-details-grid p { font-size: .82rem; color: var(--c-muted); margin: 0; }
.stars { color: #f59e0b; font-size: .75rem; letter-spacing: -1px; }
.check-pass { color: var(--c-green); }
.check-fail { color: var(--c-red); }

.msg--success { border-color: var(--c-green); }
.msg--success h4 { color: var(--c-green); }

.plan-details {
  margin-top: 6px; font-size: .82rem; color: var(--c-muted);
}
.plan-details summary {
  cursor: pointer; color: var(--c-primary); font-size: .8rem;
}
.plan-details p { margin: 4px 0; }
.plan-weather {
  color: var(--c-primary); font-size: .85rem; font-weight: 600;
  padding: 4px 0; margin: 2px 0;
}
.weather-kind { font-weight: 400; font-size: .75rem; color: var(--c-muted); }
.plan-why { color: var(--c-green); font-size: .8rem; margin-top: 6px; }
.plan-risk { color: var(--c-red); font-size: .8rem; }
.plan-tradeoff { color: var(--c-muted); font-size: .8rem; font-style: italic; }

.day-item { margin: 6px 0; font-size: .82rem; }
.day-item strong { color: var(--c-text); }

.select-btn {
  margin-top: 8px; padding: 7px 16px; border-radius: 8px;
  background: var(--c-primary); color: #fff;
  font-size: .82rem; font-weight: 600;
  transition: background .15s;
}
.select-btn:hover { background: var(--c-primary-hover); }

/* Typing */
.typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-muted); animation: blink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }

.action-btn {
  display: inline-block; margin-top: 10px; padding: 8px 16px;
  border-radius: 8px; background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.2); color: var(--c-text);
  font-size: .85rem; transition: background .15s;
}
.action-btn:hover { background: rgba(59,130,246,.2); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* Footer */
.footer {
  flex-shrink: 0; padding: 14px 0;
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--c-muted);
}

@media (max-width: 700px) {
  .plans-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .page { padding: 0 8px; }
  .header { padding: 16px 0 10px; }
  .header__tagline { font-size: .82rem; }
  .msg { max-width: 92%; }
}
