:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --border: #e4e0d8;
  --text: #2b2b28;
  --text-muted: #756f63;
  --primary: #3a6b57;
  --primary-dark: #2b503f;
  --primary-light: #e7f0ec;
  --accent: #c96f4a;
  --danger: #b3452f;
  --radius: 12px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  /* Stop iOS from silently scaling up text in landscape. */
  -webkit-text-size-adjust: 100%;
}

/* Tap feedback should be our own colour, not the browser's grey flash. */
button, .btn, .animal-card, .tabs button {
  -webkit-tap-highlight-color: rgba(58, 107, 87, 0.15);
}

a { color: var(--primary); }

.hidden { display: none !important; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-dark);
  text-decoration: none;
}
.topbar .brand .brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--primary);
}
.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Buttons */
button, .btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button:active, .btn:active { transform: scale(0.98); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--border);
}
button.secondary:hover, .btn.secondary:hover { background: var(--primary-light); }
button.danger, .btn.danger { background: var(--danger); }
button.danger:hover, .btn.danger:hover { background: #8f3524; }
button.small, .btn.small { padding: 5px 10px; font-size: 0.82rem; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Auth */
.auth-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}
.auth-wrap h1 {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.auth-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.auth-title .auth-mark {
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--primary);
}
.auth-wrap .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.auth-tabs button {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.auth-tabs button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Forms */
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}
.field textarea { min-height: 70px; resize: vertical; }
.field.checkbox { display: flex; align-items: center; gap: 8px; }
.field.checkbox label { margin: 0; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.error-msg {
  background: #fbe9e5;
  color: var(--danger);
  border: 1px solid #f0c3b8;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.success-msg {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #bfe0d1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

/* Dashboard */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
}
.section-header h2 { margin: 0; color: var(--primary-dark); }

.animal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.animal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
  /* The whole card is a tap target - selecting its text on tap-and-drag
     (which is what a slightly imprecise tap looks like on a phone) just
     gets in the way. */
  user-select: none;
  -webkit-user-select: none;
}
.animal-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.animal-card .avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.animal-card h3 { margin: 0 0 2px; }
.animal-card .meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 10px; }
.animal-card .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
}
.pill {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 3px 9px;
}
/* Samme form som en vanlig pille, men varmt farget: brukes bare når noe
   faktisk forfaller, slik at den skiller seg ut blant de nøytrale. */
.pill.warn {
  background: #fdf0dc;
  color: #8a5a00;
  font-weight: 600;
}
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 50px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Animal detail */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 10px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.back-link:hover { color: var(--primary-dark); }

.animal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.animal-header h1 { margin: 0 0 4px; color: var(--primary-dark); }
.animal-header .meta { color: var(--text-muted); }

.animal-identity { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.animal-photo-box {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.animal-photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.animal-photo-fallback { font-size: 2.4rem; font-weight: 700; color: var(--primary-dark); }
.animal-photo-actions { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.animal-photo-actions label.btn,
.animal-photo-actions button { font-size: 0.72rem; padding: 4px 9px; }

.animal-card .avatar { overflow: hidden; }
.animal-card .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.share-box {
  background: var(--primary-light);
  border: 1px solid #bfe0d1;
  border-radius: var(--radius);
  padding: 16px 18px;
  min-width: 260px;
}
.share-box h4 { margin: 0 0 8px; color: var(--primary-dark); }
.share-code-display {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  letter-spacing: 1px;
  background: white;
  border: 1px solid #bfe0d1;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  margin: 8px 0;
  color: var(--primary-dark);
  font-weight: 700;
}
.share-box .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.owner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #d7ecdf;
}
.owner-row:last-child { border-bottom: none; }
.owner-row .who { min-width: 0; }
.owner-row .name { font-weight: 600; font-size: 0.9rem; }
.owner-row .email { font-size: 0.78rem; color: var(--text-muted); }
.owner-row .pill.primary { background: var(--primary); color: white; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tabs button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button:hover { background: none; color: var(--primary-dark); }
.tabs button.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.record-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.record-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.record-item .main { flex: 1; min-width: 0; }
.record-item .main h4 { margin: 0 0 3px; }
.record-item .main .date { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 6px; }
/* Innskannet journaltekst er ofte lange kliniske notater. pre-wrap bevarer
   linjeskiftene fra dokumentet; resten handler om å gjøre en tett tekstblokk
   lesbar: luftigere linjeavstand, og en lesebredde som stopper rundt 70 tegn
   i stedet for å strekke seg over hele skjermen på en bred skjerm. */
.record-item .main .desc {
  font-size: 0.9rem;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.65;
  max-width: 70ch;
  margin-top: 6px;
  /* Deler lange ord/verdier i stedet for å sprenge layouten. */
  overflow-wrap: break-word;
}
/* Blanke linjer i kildeteksten skal lage avsnitt, ikke doble mellomrom. */
.record-item .main .desc:not(:last-child) { margin-bottom: 2px; }
.record-item .main .sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.record-item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-left: 6px;
}
.badge.warn { background: #fbe9e5; color: var(--danger); }

.record-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.record-form h4 { margin-top: 0; }

/* Document upload */
.doc-upload-box { margin-bottom: 20px; }
.doc-upload-box h4 { margin: 0 0 4px; color: var(--primary-dark); }
.doc-upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.doc-upload-row input[type="file"] {
  flex: 1;
  min-width: 240px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
}
.doc-upload-row input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  padding: 8px 14px;
  margin-right: 12px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: background 0.15s ease;
}
.doc-upload-row input[type="file"]::file-selector-button:hover {
  background: var(--primary-dark);
}
.doc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.doc-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.doc-item .main { flex: 1; min-width: 200px; }
.doc-item .filename { font-weight: 600; }
.doc-item .date { color: var(--text-muted); font-size: 0.8rem; margin: 2px 0 4px; }
.doc-item .summary { font-size: 0.88rem; color: var(--text); }
.doc-item .counts { font-size: 0.8rem; color: var(--primary-dark); margin-top: 4px; }
.doc-item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.status-badge.processing { background: #fff7e6; color: #7a5c00; }
.status-badge.done { background: var(--primary-light); color: var(--primary-dark); }
.status-badge.error { background: #fbe9e5; color: var(--danger); }
.status-badge.dismissed { background: var(--border); color: var(--text-muted); }

/* Measured values inside a test */
.value-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.value-table td {
  padding: 4px 10px 4px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.value-table tr:last-child td { border-bottom: none; }
.value-table td.num { font-weight: 600; white-space: nowrap; }
.value-table td.ref { color: var(--text-muted); white-space: nowrap; }

.value-details { margin-top: 8px; }
.value-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--primary-dark);
  font-weight: 600;
}
.value-details[open] summary { margin-bottom: 2px; }

.values-editor { margin: 4px 0 14px; }
.values-editor > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.value-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
}
.value-row input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}
.value-row .v-remove { padding: 4px 10px; line-height: 1.2; }

@media (max-width: 640px) {
  .value-row { grid-template-columns: 1fr 1fr auto; }
  .value-row .v-name { grid-column: 1 / -1; }
  .value-table { font-size: 0.82rem; }
}

/* Document review panel */
.review-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  margin-top: -10px;
  margin-bottom: 10px;
}
.review-panel .hint { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 14px; }
.review-group { margin-bottom: 16px; }
.review-group h5 { margin: 0 0 8px; color: var(--primary-dark); }
.review-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.review-item-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.review-item .form-grid { margin-bottom: 0; }
.review-item .field { margin-bottom: 8px; }

/* Vet page */
.vet-lookup {
  max-width: 440px;
  margin: 70px auto;
  padding: 0 20px;
  text-align: center;
}
.vet-lookup h1 { color: var(--primary-dark); }
.vet-lookup .code-input {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}
.vet-result { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.readonly-note {
  background: #fff7e6;
  border: 1px solid #f0dba6;
  color: #7a5c00;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* Print / export view */
.print-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.print-page {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px 60px;
  color: var(--text);
}
.print-header { border-bottom: 2px solid var(--primary); margin-bottom: 20px; padding-bottom: 12px; }
.print-header.has-photo { display: flex; gap: 16px; align-items: center; }
.print-photo { width: 90px; height: 90px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.print-header h1 { margin: 0 0 4px; color: var(--primary-dark); }
.print-header p { margin: 2px 0; color: var(--text-muted); font-size: 0.92rem; }
.print-header .print-meta { font-size: 0.78rem; margin-top: 8px; }
.print-section { margin-bottom: 22px; break-inside: avoid; }
.print-section h2 { font-size: 1.1rem; color: var(--primary-dark); border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 10px; }
.print-empty { color: var(--text-muted); font-size: 0.9rem; }
.print-item { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); break-inside: avoid; }
.print-item:last-child { border-bottom: none; }
.print-item-head { display: flex; justify-content: space-between; gap: 10px; }
.print-date { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.print-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.print-desc { font-size: 0.9rem; margin-top: 4px; white-space: pre-wrap; }

@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .print-page { margin: 0; max-width: none; }
}

/* Account / deletion */
.account-box {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.account-box h3 { margin: 0 0 6px; font-size: 1rem; color: var(--text-muted); }
.account-box .hint { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.delete-summary {
  background: #fbe9e5;
  border: 1px solid #f0c3b8;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 0.9rem;
  color: var(--danger);
  max-width: 560px;
}
.delete-summary ul { margin: 8px 0 0; padding-left: 1.1em; }
.delete-summary li { margin-bottom: 4px; }

/* Consent */
.consent-wrap {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 20px 60px;
}
.consent-wrap h1 { margin-top: 0; color: var(--primary-dark); }
.consent-intro { color: var(--text); line-height: 1.55; }
.consent-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.consent-section h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--primary-dark);
}
.consent-section p { margin: 0; line-height: 1.55; font-size: 0.92rem; }
.consent-section.important {
  background: #fff7e6;
  border: 1px solid #f0dba6;
  border-radius: 8px;
  padding: 12px 14px;
}
.consent-section.important h3 { color: #7a5c00; }

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.consent-check input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.consent-check label {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 400;
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.link-button:hover { background: none; color: var(--primary-dark); }

/* Confirm modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 28, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.modal-box p {
  margin: 0 0 18px;
  color: var(--text);
  line-height: 1.5;
}
.modal-box .form-actions { margin-top: 0; }

footer.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 30px 20px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .animal-header { flex-direction: column; }
  .share-box { width: 100%; }

  /* iOS zooms the whole page in when a focused input's text is under 16px.
     Bumping these to exactly 16px keeps the layout still while typing. */
  .field input[type="text"],
  .field input[type="email"],
  .field input[type="password"],
  .field input[type="date"],
  .field input[type="number"],
  .field select,
  .field textarea {
    font-size: 16px;
  }

  /* Comfortable touch targets - the small variants are fine with a mouse but
     too tight for a thumb. */
  button, .btn { padding: 11px 16px; }
  button.small, .btn.small { padding: 8px 12px; font-size: 0.85rem; }
  .tabs button { padding: 12px 14px; }

  /* Actions wrap instead of squeezing into an unreadable row. */
  .record-item { flex-direction: column; }
  .record-item .actions { width: 100%; }
  .record-item .actions button,
  .record-item .actions .btn { flex: 1; text-align: center; }
  .doc-item .actions { width: 100%; }
  .doc-item .actions button { flex: 1; }
  /* Let these keep their natural width and wrap onto a second line rather
     than being squeezed equally wide (which breaks the labels mid-word). */
  .share-actions button { white-space: nowrap; }

  /* The animal photo and its buttons sit side by side rather than stacked,
     so the header doesn't eat the whole first screen. */
  .animal-identity { flex-direction: row; align-items: center; gap: 14px; }
  .animal-photo-actions { flex-direction: row; }

  .doc-upload-row { flex-direction: column; align-items: stretch; }
  .doc-upload-row button { width: 100%; }

  footer.app-footer { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
}

/* Keep content clear of the rounded corners / camera notch on modern phones. */
@supports (padding: max(0px)) {
  .topbar {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .container,
  .vet-result {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* ---- Vaksinedekning ---- */
.coverage-box { margin-bottom: 18px; }
.coverage-box h4 { margin: 0 0 12px; }
.cov-list { display: flex; flex-direction: column; }
.cov-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(120px, 1fr) minmax(0, 1.4fr);
  gap: 4px 14px;
  align-items: baseline;
  padding: 9px 0 9px 12px;
  border-top: 1px solid var(--border);
  /* Fargestripen bærer statusen, så raden kan leses uten å lese teksten. */
  border-left: 3px solid transparent;
}
.cov-row:first-child { border-top: none; }
.cov-row.ok      { border-left-color: var(--primary); }
.cov-row.snart   { border-left-color: #d99a2b; }
.cov-row.forfalt { border-left-color: var(--danger); }
.cov-row.ukjent  { border-left-color: var(--border); }
.cov-name { font-weight: 600; font-size: 0.92rem; }
.cov-status { font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.cov-row.snart .cov-status   { color: #8a5a00; font-weight: 600; }
.cov-row.forfalt .cov-status { color: var(--danger); font-weight: 600; }
.cov-row.ukjent .cov-status  { color: var(--text-muted); }
.cov-src { font-size: 0.8rem; color: var(--text-muted); }
.cov-note {
  margin: 12px 0 0;
  font-size: 0.83rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
@media (max-width: 640px) {
  .cov-row { grid-template-columns: 1fr; gap: 2px; padding-left: 10px; }
}
