/* ============================================================
   Sameiehjelpen — «Lund»-designsystem (delt med dørklokke-appen)
   Selvhostede fonter (ingen eksterne kall, GDPR). Papir · salvie · oker · blekk.
   ============================================================ */

/* Samme «Lund»-fontfiler som dørklokke-appen — statiske per-vekt woff2 med
   unicode-range (dekker æøå). Piksellikt uttrykk på tvers av sameiets apper. */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-sans-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-sans-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-sans-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/ibm-plex-sans-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/source-serif-4-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/source-serif-4-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Farger */
  --paper: #f0f2ec;
  --surface: #ffffff;
  --subtle: #f6f7f2;
  --border: #e4e8db;
  --border-input: #dde2d3;
  --border-faint: #eef1e8;
  --sage: #4f6a4a;
  --sage-light: #5f8a55;
  --green-text: #3d5539;
  --green-pill: #e6efe1;
  --ocher-dark: #8a6a1f;
  --ocher-text: #7a6120;
  --ocher-pill: #f6ecd8;
  --ocher-border: #ecdcbb;
  --ocher-icon: #efd9ab;
  --ink: #232821;
  --muted: #616a5c;
  --faint: #8a9081;
  --label-green: #8b9578;
  --placeholder: #969c8a;
  --danger: #b23b34;

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --shadow-modal: 0 40px 90px -30px rgba(30, 36, 22, .6);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; }

/* Grønt «L»-merke — gjenbrukes i flere størrelser via --mark-size */
.mark {
  width: var(--mark-size, 40px);
  height: var(--mark-size, 40px);
  border-radius: var(--mark-radius, 11px);
  background: var(--sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: calc(var(--mark-size, 40px) * .5);
  font-weight: 600;
  flex: none;
}

/* ============================ KODEPORT ============================ */
.gate {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 22px 48px;
}
.gate-inner { width: 100%; max-width: 380px; }
.gate .mark { --mark-size: 56px; --mark-radius: 15px; margin: 0 auto 18px; }
.gate h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.12;
  margin: 0;
}
.gate .subtitle { font-size: 13.5px; color: var(--faint); font-weight: 600; margin-top: 6px; }
.gate .intro { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 12px 0 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  text-align: left;
}
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-text);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  border: 1.5px solid var(--border-input);
  border-radius: 12px;
  padding: 14px 15px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
}
.field input::placeholder { color: var(--placeholder); }
.field input:focus { outline: none; border-color: var(--sage); }

.btn-primary {
  width: 100%;
  height: 52px;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--green-text); }
.btn-primary:disabled { opacity: .6; cursor: default; }

/* Sekundærknapp: samme form og høyde som .btn-primary, men i omriss — for
   handlinger som står ved siden av en primærknapp uten å konkurrere med den. */
.btn-secondary {
  width: 100%;
  height: 52px;
  background: var(--surface);
  color: var(--green-text);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--subtle); border-color: var(--sage); }
.btn-secondary:disabled { opacity: .6; cursor: default; }

/* Knapper på rad — brytes til flere linjer på smal skjerm. */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.error-text { color: var(--danger); font-size: 13.5px; margin-top: 12px; min-height: 1em; text-align: center; }
.gate .muted { font-size: 13px; color: var(--faint); margin: 18px 0 0; }

/* ============================ CHAT-APP ============================ */
.chat-app {
  height: 100dvh;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: none;
}
.chat-header .mark { --mark-size: 38px; --mark-radius: 10px; }
.mark-wrap { position: relative; flex: none; }
.online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sage-light);
  border: 2.5px solid var(--surface);
}
.chat-header .title { flex: 1; min-width: 0; }
.chat-header .title .name { font-family: var(--serif); font-weight: 600; font-size: 15.5px; line-height: 1.2; }
.chat-header .title .sub { font-size: 12px; color: var(--faint); }
.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--border-input); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Bobler */
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.bubble {
  font-size: 15px;
  line-height: 1.55;
  padding: 14px 17px;
  border-radius: 18px;
  max-width: 92%;
}
.msg.user .bubble {
  background: var(--sage);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
  max-width: 82%;
}
.msg.bot .bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 6px;
}
.bubble .lead {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
/* Strukturert svar: avsnitt med luft + ekte lister */
.bubble .ans-p { margin: 0 0 10px; }
.bubble .ans-p:last-child { margin-bottom: 0; }
.bubble .ans-list { margin: 0 0 10px; padding-left: 22px; }
.bubble .ans-list:last-child { margin-bottom: 0; }
.bubble .ans-list li { margin-bottom: 5px; }
.bubble .ans-list li:last-child { margin-bottom: 0; }
.answer-link {
  color: var(--sage);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.answer-link:hover,
.answer-link:focus-visible { color: var(--green-text); }

/* Velkomst: temaknagger + forslag */
.block { display: flex; flex-direction: column; }
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--label-green);
  margin: 2px 2px 9px;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.pill:hover { border-color: var(--sage); color: var(--green-text); }

.suggestions { display: flex; flex-direction: column; gap: 9px; }
.suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
}
.suggestion:hover { border-color: var(--sage); }
.suggestion .arrow { color: var(--sage); font-size: 18px; flex: none; }

/* Samlet, sammenleggbar kildevisning */
.sources-section {
  width: 92%;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.sources-summary {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border: 0;
  background: transparent;
  color: var(--green-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.sources-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sources-summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--green-pill);
  color: var(--sage);
}
.sources-summary-toggle {
  flex: none;
  color: var(--green-text);
  font-size: 13px;
  font-weight: 600;
}
.sources-summary:hover,
.sources-list .source-head:hover { background: var(--subtle); }
.sources-summary:focus,
.sources-list .source-head:focus { outline: none; }
.sources-summary:focus-visible,
.sources-list .source-head:focus-visible {
  outline: 3px solid rgba(79, 106, 74, .22);
  outline-offset: -3px;
}
.sources-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 10px 10px;
  border-top: 1px solid var(--border-faint);
}
.sources-list[hidden] { display: none; }

/* Individuell kilde med sammenleggbart utdrag */
.sources-list .source {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.sources-list .source-head {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  color: var(--green-text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.sources-list .source-head svg { flex: none; }
.sources-list .source-head .source-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.sources-list .source-head .toggle {
  flex: none;
  margin-left: auto;
  color: var(--green-text);
  font-size: 13px;
  font-weight: 600;
}
.sources-list .source-body {
  padding: 0 13px 13px 47px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.sources-list .source-body[hidden] { display: none; }

/* Handlingsrad: tommel + kopier */
.actions { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding-left: 2px; }
.actions .label { font-size: 12.5px; color: var(--faint); }
.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-input); }
.icon-btn.up { color: var(--sage); }
.icon-btn.active { background: var(--sage); border-color: var(--sage); color: #fff; }
.icon-btn.active-down { background: var(--faint); border-color: var(--faint); color: #fff; }
.copy-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--border-input); }

/* «Snakk med styret»-kort (oker) */
.board-card {
  margin-top: 14px;
  background: var(--ocher-pill);
  border: 1px solid var(--ocher-border);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.board-card .board-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ocher-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.board-card h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ocher-dark);
  line-height: 1.3;
  margin: 0;
}
.board-card p { font-size: 12.5px; color: #7a6a4a; line-height: 1.5; margin: 3px 0 11px; }
.btn-ocher {
  border: none;
  background: var(--ocher-dark);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

/* Vibbo-eskaleringskort (forslag til melding) */
.draft-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.draft-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.draft-head .draft-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.draft-head h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0; }
.draft-card .draft-intro { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.draft-tema {
  background: var(--green-pill);
  color: var(--green-text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.draft-tema strong { font-weight: 600; }
.draft-box {
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
  margin-bottom: 13px;
}
.draft-buttons { display: flex; gap: 9px; }
.draft-buttons .btn-primary { height: 48px; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; }
.vibbo-link {
  flex: none;
  height: 48px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--green-text);
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.vibbo-link:hover { background: var(--subtle); }
.steps { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.step { display: flex; align-items: center; gap: 9px; }
.step .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-pill);
  color: var(--green-text);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.step .txt { font-size: 12.5px; color: var(--muted); }

/* Input-rad */
.chat-input {
  padding: 12px 18px 6px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-input textarea {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}
.chat-input textarea::placeholder { color: var(--placeholder); }
.chat-input textarea:focus { outline: none; border-color: var(--sage); }
.send-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 13px;
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.send-btn:hover { background: var(--green-text); }
.send-btn:disabled { opacity: .6; cursor: default; }

/* Typing-indikator */
.typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--label-green);
  animation: dotblink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dotblink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* Bunntekst + Les mer */
.disclaimer {
  font-size: 11px;
  color: var(--faint);
  padding: 8px 22px 16px;
  background: var(--surface);
  line-height: 1.45;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  text-align: center;
}
.disclaimer .more {
  background: none;
  border: none;
  color: var(--sage);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Les mer-modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 40, 33, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.modal {
  background: var(--surface);
  border-radius: 22px;
  max-width: 460px;
  width: 100%;
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-modal);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.modal-head .mark { --mark-size: 40px; --mark-radius: 11px; }
.modal-head .title-row { display: flex; align-items: center; gap: 11px; }
.modal-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.15; margin: 0; }
.modal-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal p { font-size: 15px; line-height: 1.65; color: #3f4a3c; margin: 0 0 14px; }
.modal .warn {
  background: var(--ocher-pill);
  border: 1px solid var(--ocher-border);
  border-radius: 13px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ocher-text);
}
.modal .btn-primary { margin-top: 20px; height: 50px; }

/* ============================ ADMIN ============================ */
.admin-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-header .mark { --mark-size: 38px; --mark-radius: 10px; }
.admin-header .title { flex: 1; min-width: 0; }
.admin-header .title .name { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.2; }
.admin-header .title .sub { font-size: 12px; color: var(--faint); }

.admin-app { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.tabs button:hover { border-color: var(--border-input); color: var(--ink); }
.tabs button.active { background: var(--sage); border-color: var(--sage); color: #fff; }

.admin-app .card { margin-bottom: 16px; }
.admin-app .card h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 6px;
}
.admin-app .muted { font-size: 13px; color: var(--faint); line-height: 1.5; margin: 0 0 14px; }

.field select,
.field input[type="date"],
.field input[type="file"] {
  width: 100%;
  border: 1.5px solid var(--border-input);
  border-radius: 12px;
  padding: 12px 13px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
}
.field input[type="file"] { padding: 10px 12px; font-size: 13px; }
.field select:focus, .field input:focus { outline: none; border-color: var(--sage); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }

.btn-inline { width: auto; padding: 0 22px; height: 46px; font-size: 14.5px; }

/* Tabeller */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--label-green);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--border-faint); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.muted { color: var(--faint); font-size: 12.5px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.active, .badge.svar, .badge.eskalert_sendt { background: var(--green-pill); color: var(--green-text); }
.badge.historical, .badge.ikke_funnet { background: var(--paper); color: var(--faint); border: 1px solid var(--border); }
.badge.eskaler { background: var(--ocher-pill); color: var(--ocher-dark); }

.fb { font-size: 12.5px; font-weight: 600; }
.fb.up { color: var(--sage); }
.fb.down { color: var(--danger); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sm:hover { border-color: var(--border-input); color: var(--ink); }
.btn-sm.danger { color: var(--danger); }
.btn-sm.danger:hover { border-color: var(--danger); }

/* Statistikk-fliser */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 120px;
  flex: 1;
}
.stat .n { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--faint); margin-top: 3px; }

/* Testsøk-resultater */
.hit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.hit .hit-head { font-size: 13px; font-weight: 600; color: var(--green-text); }
.hit .hit-head .score { color: var(--faint); font-weight: 400; font-size: 12px; }
.hit .hit-body { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; white-space: pre-wrap; }

.status-note { font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 1em; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 11px;
  z-index: 1100;
  box-shadow: var(--shadow-modal);
}
.toast.err { background: var(--danger); }

/* ============================================================
   «Legg til som app» (A2HS) — hint + bunn-ark
   ============================================================ */
.disclaimer .dot{color:var(--muted);font-size:11px}

/* Engangs-hint (oker), i meldingslista */
.a2hs-hint{margin-top:auto;display:flex;gap:11px;align-items:flex-start;
  background:#f6ecd8;border:1px solid #ecdcbb;border-radius:16px;padding:14px}
.a2hs-hint-icon{width:32px;height:32px;border-radius:9px;background:#efd9ab;
  display:flex;align-items:center;justify-content:center;flex:none}
.a2hs-hint-body{flex:1;min-width:0}
.a2hs-hint-body h3{margin:0;font-family:'Source Serif 4',serif;font-size:14.5px;
  font-weight:600;color:#8a6a1f;line-height:1.3}
.a2hs-hint-body p{margin:3px 0 10px;font-size:12.5px;color:#7a6a4a;line-height:1.5}
.a2hs-hint-row{display:flex;gap:8px}
.a2hs-later{border:none;background:transparent;color:#9a8358;font:inherit;
  font-size:13px;font-weight:600;padding:9px 8px;border-radius:9px;cursor:pointer}

/* Bunn-ark */
.a2hs-overlay{position:fixed;inset:0;background:rgba(35,40,33,.4);z-index:1100;
  display:flex;align-items:flex-end;justify-content:center}
.a2hs-sheet{background:#fff;width:100%;max-width:460px;border-radius:26px 26px 0 0;
  padding:10px 22px calc(30px + env(safe-area-inset-bottom));
  box-shadow:0 -20px 50px -20px rgba(30,36,22,.5);animation:sheetUp .22s ease}
@keyframes sheetUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.a2hs-grabber{width:40px;height:5px;border-radius:3px;background:#dde2d3;margin:0 auto 16px}
.a2hs-sheet-head{display:flex;align-items:center;gap:11px;margin-bottom:6px}
.a2hs-sheet-head .mark{width:40px;height:40px;border-radius:11px;font-size:20px}
.a2hs-sheet-head h2{margin:0;font-family:'Source Serif 4',serif;font-size:19px;
  font-weight:600;color:#232821;line-height:1.15}
.a2hs-lead{font-size:13.5px;color:#616a5c;line-height:1.55;margin:6px 0 18px}
.a2hs-steps{display:flex;flex-direction:column;gap:14px}
.a2hs-step{display:flex;gap:12px;align-items:center}
.a2hs-step .num{width:26px;height:26px;border-radius:50%;background:#e6efe1;color:#3d5539;
  font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none}
.a2hs-step .txt{font-size:14px;color:#232821;line-height:1.4}
.a2hs-glyph{margin-left:auto;width:38px;height:38px;border-radius:10px;background:#eef1e8;
  display:flex;align-items:center;justify-content:center;flex:none}
.a2hs-glyph.ok{background:#e6efe1}
.a2hs-ios-tip{background:#f6ecd8;border:1px solid #ecdcbb;border-radius:12px;
  padding:11px 14px;font-size:13px;color:#7a6a4a;line-height:1.5;margin-bottom:4px}
.a2hs-ios-tip strong{color:#8a6a1f}
.a2hs-sheet .btn-primary{width:100%;height:50px;margin-top:22px}
