:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #0ea5e9;
  --ok: #16a34a;
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 240px, #f8fafc 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--bg);
  background: linear-gradient(120deg, #1e3a8a, #2563eb 55%, #0ea5e9);
  color: #fff;
  padding: 22px 0;
}
.logo {
  font-size: 1.5rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -0.5px;
}
.logo span { color: #bae6fd; }
.tagline { margin: 4px 0 0; color: #dbeafe; font-size: 0.95rem; }
.brand-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-badge {
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  white-space: nowrap;
}

/* Banner: gør tydeligt at det er et "Play with AI"-website */
.ai-notice { background: #fef9c3; border-bottom: 1px solid #fde68a; color: #854d0e; }
.ai-notice .wrap { padding: 10px 20px; font-size: 0.88rem; line-height: 1.45; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 40px;
  flex: 1;
  align-items: start;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .feed-panel { order: -1; }
}

/* Chat panel */
.chat-panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 230px);
  min-height: 480px;
  max-height: 840px;
}

/* "Vælg AI"-række */
.ai-select-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex: 0 0 auto; }
.ai-select-row label { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.ai-select-row select {
  flex: 1; max-width: 280px; padding: 8px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; font: inherit; background: #fff; cursor: pointer; color: var(--ink);
}
.ai-select-row select:focus { border-color: var(--brand); outline: none; }

/* AI-mærkat på svar og i feedet */
.ai-tag { display: block; font-size: 0.72rem; font-weight: 700; color: var(--brand); margin-bottom: 5px; }
.feed .tag.ai { background: #e0ecff; color: var(--brand-dark); }

/* Linje med "Start forfra"-knap (vises når en samtale er i gang) */
.chat-bar { display: flex; justify-content: flex-end; margin-bottom: 10px; flex: 0 0 auto; }
.reset-btn {
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 0.82rem; cursor: pointer;
  transition: all 0.15s;
}
.reset-btn:hover { background: var(--soft); color: var(--ink); border-color: var(--brand); }
.chat-intro h1 { font-size: 1.5rem; margin: 6px 0 6px; }
.chat-intro p { color: var(--muted); margin: 0 0 16px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; }
.suggestions button {
  background: var(--soft); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 14px; border-radius: 999px; cursor: pointer; font-size: 0.9rem;
  transition: all 0.15s;
}
.suggestions button:hover { background: #e0ecff; border-color: var(--brand); }

/* Messages – scrollbart område inde i panelet */
.messages {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 6px 4px 2px; margin-bottom: 12px;
}
.chat-intro { flex: 0 0 auto; }
.solved-box { flex: 0 0 auto; }
.composer { flex: 0 0 auto; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--soft); color: var(--ink); border-bottom-left-radius: 4px; }
.msg.assistant.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Solved box */
.solved-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px;
}
.solved-box span { font-weight: 600; margin-right: auto; }
.solved-box button { border: none; border-radius: 999px; padding: 9px 16px; cursor: pointer; font-weight: 600; }
.btn-yes { background: var(--ok); color: #fff; }
.btn-no { background: #fff; border: 1px solid var(--line) !important; color: var(--ink); }

/* Composer */
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: auto; }
.composer textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; max-height: 160px; outline: none;
}
.composer textarea:focus { border-color: var(--brand); }
.composer button {
  background: var(--brand); color: #fff; border: none; border-radius: 12px;
  padding: 12px 22px; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.composer button:hover { background: var(--brand-dark); }
.composer button:disabled { opacity: 0.5; cursor: not-allowed; }
.disclaimer { color: var(--muted); font-size: 0.78rem; margin: 10px 2px 0; }

/* Feed */
.feed-panel {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; position: sticky; top: 20px;
}
.feed-panel h2 { font-size: 1.1rem; margin: 0 0 2px; }
.feed-count { color: var(--muted); font-size: 0.82rem; margin: 0 0 14px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feed li.item { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; }
.feed .title { font-weight: 600; font-size: 0.92rem; }
.feed .meta { color: var(--muted); font-size: 0.75rem; margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.feed .tag { background: var(--soft); border-radius: 999px; padding: 2px 8px; }
.feed .summary { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.feed-empty { color: var(--muted); font-size: 0.88rem; }

/* Footer */
.site-footer { background: #0f172a; color: #94a3b8; padding: 20px 0; font-size: 0.85rem; }
.site-footer p { margin: 0; }
