:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f2f1ed;
  --border: #e7e5df;
  --border-sterk: #d8d5cd;
  --text: #1f1e1b;
  --muted: #8a877e;
  --accent-1: #7c5cf0;
  --accent-2: #14b8a6;
  --gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --skygge: 0 1px 2px rgba(30, 28, 22, 0.04), 0 8px 24px rgba(30, 28, 22, 0.06);
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--font-head); color: var(--text); }
a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

.grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.asterisk { color: var(--accent-1); font-weight: 600; font-size: 0.6em; vertical-align: text-top; }
.fotnote { margin-bottom: 6px; }

/* Topplinje */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: 760px; margin: 0 auto; width: 100%;
}
.logo { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--text); }
.logo:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 64px 0 8px; }
.hero h1 {
  font-size: clamp(28px, 5.5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.undertekst { color: var(--muted); margin-top: 12px; font-size: 16px; }
.undertekst-2 { margin-top: 4px; font-size: 14.5px; }

/* Chat-området */
.chat-shell { display: flex; flex-direction: column; gap: 14px; padding: 28px 0; }
.chat-shell-samtale { min-height: calc(100dvh - 140px); padding-top: 12px; }

.chat-log { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.boble { max-width: 78%; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.boble-bruker {
  align-self: flex-end;
  background: var(--surface-2);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  margin-top: 18px;
}
.boble-andre {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 16px;
  margin-top: 18px;
}
.boble audio { width: 260px; max-width: 100%; display: block; margin-top: 6px; }
.svar-bilde { max-width: 340px; width: 100%; border-radius: 14px; display: block; border: 1px solid var(--border); }

.boble-meta { align-self: flex-start; font-size: 12px; color: var(--muted); padding: 4px 2px 0; }
.boble-meta.hoyre { align-self: flex-end; text-align: right; }
.svartid-chip { color: var(--accent-2); font-weight: 500; }
.ressurslinje { color: var(--muted); }

.transkripsjon {
  font-size: 13.5px; color: var(--muted);
  border-left: 2px solid var(--border-sterk);
  padding-left: 12px; margin-top: 10px; font-style: italic;
}

.feedback { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
.feedback button {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 9px; cursor: pointer; font-size: 13px; color: var(--muted);
  transition: border-color 0.15s, background 0.15s;
}
.feedback button:hover { border-color: var(--border-sterk); background: var(--surface-2); }
.feedback button.valgt { border-color: var(--accent-1); background: #f3f0ff; }
.feedback .feedback-tekst { font-size: 11.5px; color: var(--muted); }
.del-knapp {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: 12.5px;
  transition: border-color 0.15s, color 0.15s;
}
.del-knapp:hover { color: var(--text); border-color: var(--border-sterk); }

/* Tenker-indikator */
.tenker {
  align-self: flex-start; display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 14px; padding: 14px 2px 4px;
}
.tenker .prikker { display: inline-flex; gap: 4px; }
.tenker .prikker span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-1);
  animation: pulse 1.4s infinite ease-in-out;
}
.tenker .prikker span:nth-child(2) { animation-delay: 0.2s; }
.tenker .prikker span:nth-child(3) { animation-delay: 0.4s; background: var(--accent-2); }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.vente-info { font-size: 13px; color: var(--muted); text-align: center; padding: 10px 0 4px; }
.vente-info .ko { color: var(--accent-1); font-weight: 600; }
.laster { color: var(--muted); text-align: center; padding: 40px 0; }

/* Composer */
.composer-kort {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 14px 14px 10px;
  box-shadow: var(--skygge);
  transition: border-color 0.15s;
}
.composer-kort:focus-within { border-color: var(--border-sterk); }
.composer-kort textarea {
  width: 100%; border: none; outline: none; resize: none; background: none;
  font-family: var(--font-body); font-size: 15.5px; color: var(--text);
  line-height: 1.5; max-height: 160px; padding: 2px 4px;
}
.composer-kort textarea::placeholder { color: #b3b0a6; }
.composer-rad { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.composer-verktoy { display: flex; align-items: center; gap: 6px; }

.dyp-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 13px; font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.dyp-toggle:hover { color: var(--text); border-color: var(--border-sterk); }
.dyp-toggle.aktiv { color: var(--accent-1); border-color: #c9bcf7; background: #f3f0ff; }

.ikon-knapp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: none; color: var(--muted); cursor: pointer;
  transition: background 0.15s, color 0.15s;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ikon-knapp:hover { background: var(--surface-2); color: var(--text); }
.ikon-knapp.opptak { background: #fee2e2; color: #dc2626; animation: pulse 1.2s infinite; }

.send-knapp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--text); color: var(--bg);
  transition: opacity 0.15s, transform 0.1s;
}
.send-knapp:hover:not(:disabled) { transform: scale(1.05); }
.send-knapp:disabled { background: var(--surface-2); color: #c4c1b8; cursor: default; }

.opptak-status { font-size: 13px; color: #dc2626; text-align: center; }
.composer-hint { font-size: 12.5px; color: var(--muted); text-align: center; }

/* Forslags-chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-family: var(--font-body); font-size: 13.5px; color: var(--muted);
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-sterk); background: var(--surface-2); }

/* Sticky composer i samtaler */
.composer-fast {
  position: sticky; bottom: 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  padding: 20px 0 16px;
  display: flex; flex-direction: column; gap: 10px;
}

/* Spec-badges */
.badges {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
  padding: 8px 0 8px; font-size: 13px; color: var(--muted);
}
.badge strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.badge-skille { color: var(--border-sterk); }
.badges-venstre { justify-content: flex-start; padding: 0 0 18px; }

/* Model card-siden gjenbruker kortstilen inne i prose */
.prose .modelcard { margin: 8px 0 12px; }

/* Paywall-banner */
.paywall-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fdf6e3; border: 1px solid #efd9a7; border-radius: 14px;
  padding: 10px 14px; font-size: 13.5px; color: #7c5e10;
}

/* Knapper */
.btn {
  font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  border-radius: 12px; padding: 11px 18px; cursor: pointer; border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--muted); }
.btn-small { padding: 7px 13px; font-size: 13px; flex-shrink: 0; }
.btn-disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* Model card */
.modelcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px; margin: 40px 0 0; box-shadow: var(--skygge);
}
.modelcard h2 { font-size: 19px; margin-bottom: 20px; }
.modelcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.modelcard h3 { font-size: 13px; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.bench { margin-bottom: 13px; }
.bench-label { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.bench-label span:last-child { color: var(--muted); }
.bench-track { background: var(--surface-2); border-radius: 99px; height: 6px; overflow: hidden; }
.bench-bar { height: 100%; border-radius: 99px; }
.bar-god { background: var(--gradient); }
.bar-darlig { background: #f0b429; }
.nb { margin-top: 14px; font-size: 13px; }

/* USP */
.usp { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 40px 0 48px; }
.usp-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px;
}
.usp-item h3 { font-size: 15px; margin-bottom: 6px; }
.usp-item p { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* Prose-sider */
.prose { padding: 36px 0 56px; }
.prose h1 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 16px; letter-spacing: -0.02em; }
.prose h2 { font-size: 18px; margin: 28px 0 10px; }
.prose p, .prose li { color: #4b4943; font-size: 15px; }
.prose ul { padding-left: 22px; margin: 10px 0; }
.prose .lead { font-size: 17px; color: var(--text); }
.erklaering {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  padding: 14px 18px; border-radius: 0 12px 12px 0; margin-top: 8px;
}
.status-kort {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; margin: 16px 0; box-shadow: var(--skygge);
}
.status-hoved { font-size: 19px; font-family: var(--font-head); font-weight: 500; }
.status-detalj { color: var(--muted); font-size: 14px; margin-top: 6px; }
.status-tabell { width: 100%; border-collapse: collapse; margin: 12px 0; }
.status-tabell td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.status-tabell td:first-child { color: var(--muted); }

/* Bottom sheet / modal */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(31, 30, 27, 0.35); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 22px 32px; width: 100%; max-width: 560px;
  max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 -8px 40px rgba(30, 28, 22, 0.15);
}
.sheet h2 { font-size: 19px; }
.sheet-handle { width: 40px; height: 4px; border-radius: 99px; background: var(--border-sterk); margin: 0 auto 4px; }
.sheet .input {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-family: var(--font-body); font-size: 15px; outline: none;
}
.sheet .input:focus { border-color: var(--border-sterk); }

.tiers { display: flex; flex-direction: column; gap: 10px; }
.tier {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
}
.tier-navn { font-weight: 600; font-size: 14.5px; }
.tier-pris { font-family: var(--font-head); font-size: 17px; text-align: right; }
.tier-desc { font-size: 13px; color: var(--muted); grid-column: 1; }
.tier .btn { grid-column: 2; grid-row: 2 / 4; font-size: 13px; padding: 8px 12px; }
.tier-utsolgt { opacity: 0.55; }
.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 100;
  max-width: 90vw; text-align: center; box-shadow: var(--skygge);
}

/* Footer */
.footer { text-align: center; padding: 28px 20px 40px; color: var(--muted); font-size: 12.5px; }
.footer-links { margin-top: 10px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .modelcard-grid { grid-template-columns: 1fr; }
  .usp { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; }
  .logo { font-size: 18px; }
  .topbar nav { gap: 12px; }
  .topbar nav a { font-size: 12.5px; }
  .boble-bruker { max-width: 88%; }
  .composer-fast { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

  /* Verktøyraden scroller horisontalt i stedet for å skvise send-knappen */
  .composer-verktoy { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .composer-verktoy::-webkit-scrollbar { display: none; }
  .dyp-toggle { flex-shrink: 0; font-size: 12.5px; padding: 6px 11px; white-space: nowrap; }
  .ikon-knapp { flex-shrink: 0; }
  .send-knapp { flex-shrink: 0; margin-left: 8px; }
}
