:root {
  --ink: #15262e;
  --paper: #f3f8f7;
  --teal: #0d8a84;
  --ember: #e85d4c;
  --sand: #d4ebe8;
  --teal-rgb: 13, 138, 132;
  --ember-rgb: 232, 93, 76;
  --ink-rgb: 21, 38, 46;
  --muted: #5a6f76;
  --line: rgba(21, 38, 46, 0.12);
  --radius: 12px;
  --font-display: "Outfit", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 0%, rgba(var(--ember-rgb), 0.14), transparent 42%),
    radial-gradient(ellipse at 92% 8%, rgba(var(--teal-rgb), 0.16), transparent 44%),
    linear-gradient(180deg, #f7fbfa 0%, var(--paper) 42%, #e5f3f1 100%);
}

body {
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.6rem;
}

h1 { font-size: 1.85rem; }
h2 { font-size: 1.25rem; }

.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }
.flash {
  background: rgba(var(--teal-rgb), 0.1);
  border-left: 3px solid var(--teal);
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line);
  color: var(--teal);
  background: rgba(255,255,255,0.55);
  margin-left: 0.35rem;
  vertical-align: middle;
}

.badge.muted { color: var(--muted); }

.event-list,
.post-list,
.simple-list,
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-list li,
.post-list li {
  margin: 0 0 0.65rem;
}

.event-link,
.post-link {
  display: block;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.event-link--cover {
  padding: 0;
}

.event-cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sand);
}

.event-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-meta {
  display: block;
  padding: 1rem;
}

.event-link:hover,
.post-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(44, 42, 38, 0.08);
}

.event-link strong,
.post-link strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.event-link .muted,
.post-link .muted {
  display: block;
  margin-bottom: 0.25rem;
}

.post-link--thumb {
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
  padding: 0.65rem;
}

.post-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand);
}

.post-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(13, 138, 132, 0.18), transparent 55%),
    linear-gradient(225deg, rgba(232, 93, 76, 0.16), transparent 50%),
    var(--sand);
}

.post-meta {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.2rem 0.2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-image.is-hovedbilde {
  outline: 2px solid rgba(13, 138, 132, 0.35);
  outline-offset: 2px;
  border-radius: calc(var(--radius) + 2px);
}

.event-hero {
  margin: 0.5rem 0 1rem;
}

.event-hero img,
.post-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.img-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.img-actions {
  margin: 0.4rem 0 0;
}

.cover-picker {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr 1fr;
}

.cover-picker li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
}

.cover-picker li.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(13, 138, 132, 0.2);
}

.cover-picker img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.cover-picker-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
}

.bilde-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 18, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bilde-overlay[hidden] {
  display: none !important;
}

.bilde-overlay-panel {
  position: relative;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  background: #111;
  border-radius: 10px;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.bilde-overlay-panel img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.bilde-overlay-close {
  position: sticky;
  top: 0.4rem;
  float: right;
  margin: 0.4rem 0.4rem 0 0;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

body.overlay-open {
  overflow: hidden;
}

.feillogg {
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow: auto;
}

.admin-prompt-tekst {
  width: 100%;
  min-height: 24rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  resize: vertical;
  white-space: pre;
  overflow: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sted-kart {
  width: 100%;
  height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 0.6rem 0;
  z-index: 1;
}

.sted-kart-pending {
  margin: 0.4rem 0 0;
}

.sted-panel h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 1rem 0 0.4rem;
}

.sted-bilde-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.sted-bilde-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.sted-bilde-list img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.notif-item {
  margin-top: 0;
}

.notif-item .notif-link {
  padding: 0;
}

.notif-historikk-lenke {
  margin: 0.5rem 0 0;
  text-align: center;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-list li {
  border-bottom: 1px solid var(--line);
}

.notif-list li:last-child {
  border-bottom: none;
}

.notif-link {
  display: block;
  padding: 0.7rem 0;
  color: inherit;
  text-decoration: none;
}

.notif-link:hover {
  text-decoration: none;
  color: var(--teal);
}

.notif-link em {
  font-style: normal;
  font-weight: 700;
  font-family: var(--font-display);
}

.push-panel {
  margin-top: 1.25rem;
}

.push-panel--embedded {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(44, 42, 38, 0.12);
}

.push-panel h2,
.push-panel--embedded > h3:first-child {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.push-panel h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
}

.push-panel-status {
  margin: 0 0 0.75rem;
}

.push-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 600;
}

.push-toggle input {
  margin-top: 0.2rem;
}

.push-device-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.push-device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.push-device-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.simple-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.idisp-admin-bruker-rad {
  width: 100%;
}

.idisp-admin-order {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  min-width: 5.5rem;
}

.idisp-admin-order input[type="number"] {
  width: 4.5rem;
  padding: 0.35rem 0.45rem;
}

.user-admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
}

.user-admin-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.8rem;
  width: 100%;
  padding: 0.35rem 0;
  color: inherit;
  text-decoration: none;
}

.user-admin-link:hover .user-admin-name,
.user-admin-link:focus .user-admin-name {
  text-decoration: underline;
}

.user-admin-name {
  font-weight: 600;
}

.user-admin-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.admin-bruker-action {
  display: inline-block;
  margin: 0 0.4rem 0.5rem 0;
}

.profil-slett-varslingar {
  margin-top: 1rem;
}

.profil-notisar-lenke {
  margin: 1rem 0 0;
}

.pin-reset-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.pin-reset-form input[type="text"] {
  width: 7.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
}

.profil-panel {
  text-align: center;
}

.profil-avatar {
  width: 110px;
  height: 110px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--sand);
}

.profil-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.5rem;
}

.post-gallery {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.post-image {
  margin: 0;
}

.post-image figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.caption-form {
  margin-top: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.caption-form[hidden] {
  display: none !important;
}

.caption-empty[hidden] {
  display: none !important;
}

.text-block .text-body {
  white-space: pre-wrap;
  margin-bottom: 0.5rem;
}

.comment-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.comment-list li:last-child {
  border-bottom: none;
}

@media (min-width: 700px) {
  .post-gallery {
    grid-template-columns: 1fr 1fr;
  }
}

#loginW, #passWorld {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem 1.4rem;
  box-shadow: 0 18px 40px rgba(21, 38, 46, 0.08);
}

.login-card .brand {
  display: block;
  font-size: 2.6rem;
  margin: 0 0 0.15rem;
  color: var(--ink);
}

.login-lead {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.login-error {
  color: #8a2b1a;
  background: rgba(232, 93, 76, 0.12);
  padding: 0.6rem 0.75rem;
  margin: 0 0 1rem;
  list-style: none;
}

label {
  display: block;
  margin: 0 0 0.9rem;
}

label span,
label strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; }

label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

label.check input { width: auto; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover { text-decoration: none; filter: brightness(1.05); }

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-secondary {
  background: var(--sand);
  color: var(--ink);
}

.btn-danger {
  background: transparent;
  color: var(--ember);
  border: 1px solid rgba(232, 93, 76, 0.35);
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.file-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.inline-form label { margin: 0; flex: 1; min-width: 160px; }

.fb-print-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f3f8f7;
  border-bottom: 1px solid rgba(44, 42, 38, 0.12);
  position: sticky;
  top: 0;
  z-index: 20;
}

.fb-book {
  margin: 1rem auto;
  max-width: min(100%, calc(var(--fb-w) * 1.2));
}

.fb-page {
  width: var(--fb-w);
  min-height: var(--fb-h);
  max-width: 100%;
  margin: 0 auto 1.5rem;
  padding: 8mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 2px 12px rgba(44, 42, 38, 0.12);
  break-after: page;
  page-break-after: always;
  display: flex;
  flex-direction: column;
}

.fb-page--tekst {
  justify-content: flex-start;
  gap: 0.75rem;
}

.fb-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: #15262e;
}

.fb-page-text {
  margin: 0;
  line-height: 1.45;
  font-size: 0.95rem;
}

.fb-page--bilder {
  padding: 4mm;
}

.fb-grid {
  flex: 1;
  display: grid;
  gap: 3mm;
  min-height: 0;
  height: 100%;
}

.fb-grid--helside {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.fb-grid--g2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.fb-grid--g3x4 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.fb-grid--g4x4 {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.fb-grid--midt_rundt {
  grid-template-columns: 1fr 1.35fr 1fr;
  grid-template-rows: 1fr 1.35fr 1fr;
  grid-template-areas:
    "a b c"
    "d m e"
    "f g h";
}

.fb-area-a { grid-area: a; }
.fb-area-b { grid-area: b; }
.fb-area-c { grid-area: c; }
.fb-area-d { grid-area: d; }
.fb-area-m { grid-area: m; }
.fb-area-e { grid-area: e; }
.fb-area-f { grid-area: f; }
.fb-area-g { grid-area: g; }
.fb-area-h { grid-area: h; }

.fb-cell {
  position: relative;
  overflow: hidden;
  background: #eee;
  min-height: 0;
}

.fb-cell--midt {
  /* midt har egen grid-area */
}

.fb-cell--empty {
  background: transparent;
}

.fb-cell-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fb-edit-thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.fb-edit-thumbs li {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fb-edit-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #ddd;
}

.fb-edit-thumbs .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.fb-crop-wrap {
  max-width: 520px;
}

.fb-crop-frame {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #222;
  position: relative;
  margin-bottom: 1rem;
}

.fb-crop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media print {
  .no-print,
  .topbar-shell,
  .topbar-wrap,
  .topbar,
  .flash {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .fb-book {
    margin: 0;
    max-width: none;
  }

  .fb-page {
    width: var(--fb-w);
    height: var(--fb-h);
    min-height: var(--fb-h);
    margin: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .fb-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}

.kal-ikon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.kal-ikon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid rgba(13, 138, 132, 0.15);
  border-radius: 8px;
  background: #f3f8f7;
  color: #0d8a84;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0;
}

.kal-ikon-btn.is-selected {
  border-color: #e85d4c;
  background: rgba(232, 93, 76, 0.12);
  color: #e85d4c;
}

.kal-hendelse-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kal-hendelse-kort {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f3f8f7;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid #0d8a84;
}

.kal-hendelse-kort:hover {
  background: rgba(13, 138, 132, 0.08);
}

.kal-ikon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #0d8a84;
  color: #fff;
  flex-shrink: 0;
}

.kal-ikon-lg {
  font-size: 2rem;
}

.kal-hendelse-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kal-hendelse-vis {
  text-align: center;
}

.kal-hendelse-vis-ikon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #0d8a84;
  color: #fff;
  margin-bottom: 1rem;
}

.kal-dato {
  font-weight: 600;
  color: #e85d4c;
}

.kal-tekst {
  margin-top: 1rem;
  line-height: 1.5;
  text-align: left;
}

.kal-melding-vis h1 {
  font-size: 1.35rem;
}

.notif-link--melding .notif-type {
  color: #e85d4c;
}

.notif-link--kalender .notif-type {
  color: #0d8a84;
}

.notif-historikk .notif-link {
  opacity: 0.85;
}

.msg-ok {
  background: rgba(13, 138, 132, 0.12);
  color: #0d8a84;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.msg-warn {
  background: rgba(232, 93, 76, 0.12);
  color: #e85d4c;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.msg-error {
  background: rgba(138, 43, 26, 0.12);
  color: #8a2b1a;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.msg-error.simple-list {
  list-style: disc;
  padding-left: 2rem;
}

.schema-table {
  width: 100%;
  border-collapse: collapse;
}

.schema-table th,
.schema-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(44, 42, 38, 0.1);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-row label {
  flex: 1;
  min-width: 140px;
}

.kal-melding-form fieldset {
  margin: 1rem 0;
  border: 1px solid rgba(44, 42, 38, 0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.badge-kal-gjent {
  background: rgba(13, 138, 132, 0.15);
  color: #0d8a84;
}

.badge-kal-barnevakt {
  display: inline-block;
  margin-top: 0.2rem;
  background: rgba(232, 93, 76, 0.14);
  color: #8a3a14;
}

.badge-kal-barnevakt--ingen {
  background: rgba(232, 93, 76, 0.2);
  color: #7a2e0c;
}

.badge-kal-barnevakt--forespurt {
  background: rgba(232, 168, 56, 0.22);
  color: #6b4a0a;
}

.badge-kal-barnevakt--avklart {
  background: rgba(13, 138, 132, 0.15);
  color: #0d8a84;
}

.kal-kommende-inn .badge-kal-barnevakt {
  margin-top: 0.35rem;
}

.kal-kommende-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kal-kommende-list > li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kal-kommende-list > li .kal-kommende-kort {
  flex: 1;
  min-width: 0;
}

.kal-kommende-kort {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f3f8f7;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid #0d8a84;
  box-shadow: 0 1px 3px rgba(44, 42, 38, 0.06);
}

.kal-kommende-kort:hover {
  background: rgba(13, 138, 132, 0.08);
}

@keyframes kal-pagar-vri {
  0%, 100% { transform: rotate(-0.45deg); }
  50% { transform: rotate(0.45deg); }
}

.kal-ikon--pagar {
  transform-origin: center center;
  animation: kal-pagar-vri 5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .kal-ikon--pagar {
    animation: none;
  }
}

.kal-kommende-inn {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kal-bruker-valg {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
}

.kal-bruker-valg label {
  margin: 0;
  min-width: 10rem;
}

.kal-manad-visning {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kal-manad-tittel {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  margin: 0 0 0.65rem;
  color: #0d8a84;
}

.kal-manad-tabell {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #f3f8f7;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(13, 138, 132, 0.12);
}

.kal-manad-tabell th {
  padding: 0.45rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  border-bottom: 1px solid rgba(13, 138, 132, 0.1);
}

.kal-manad-tabell td {
  vertical-align: top;
  height: 3.6rem;
  border-bottom: 1px solid rgba(13, 138, 132, 0.08);
  border-right: 1px solid rgba(13, 138, 132, 0.06);
  padding: 0;
}

.kal-manad-tabell td:last-child {
  border-right: 0;
}

.kal-dag--tom {
  background: rgba(44, 42, 38, 0.03);
}

.kal-dag-knapp,
.kal-dag-innhold {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  height: 100%;
  min-height: 3.4rem;
  padding: 0.35rem 0.4rem;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
}

.kal-dag-knapp {
  cursor: pointer;
}

.kal-dag-knapp:hover,
.kal-dag-knapp:focus-visible {
  background: rgba(13, 138, 132, 0.08);
  outline: none;
}

.kal-dag--idag .kal-dag-knapp,
.kal-dag--idag .kal-dag-innhold {
  box-shadow: inset 0 0 0 2px #0d8a84;
}

.kal-dag--aktiv .kal-dag-nr {
  font-weight: 700;
}

.kal-dag-nr {
  font-size: 0.9rem;
  line-height: 1;
}

.kal-dag-prikkar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
}

.kal-dag-prikk {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.kal-manad-forklaring {
  margin: 0;
  font-size: 0.9rem;
}

.kal-manad-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.9rem;
}

.kal-manad-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kal-dag-panel {
  margin-top: 0.25rem;
}

.kal-dag-panel-hovud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kal-dag-panel-tittel {
  margin: 0;
  font-size: 1.1rem;
}

.kal-dag-panel.is-open {
  /* shown via hidden attr remove */
}

.kal-slide {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
}

.kal-slide[hidden] {
  display: none !important;
}

.kal-slide.is-open {
  pointer-events: auto;
}

.kal-slide-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(44, 42, 38, 0.45);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.kal-slide.is-open .kal-slide-backdrop {
  opacity: 1;
}

.kal-slide-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(28rem, 100%);
  max-width: 100%;
  background: #f3f8f7;
  box-shadow: -8px 0 28px rgba(44, 42, 38, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kal-slide.is-open .kal-slide-panel {
  transform: translateX(0);
}

.kal-slide-innhold {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.1rem 2rem;
}

.kal-slide-innhold .kal-hendelse-vis {
  margin-top: 0.25rem;
}

.kal-slide-innhold .kal-hendelse-vis h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
}

.kal-slide-dag-tittel {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}

.kal-slide-tilbake {
  margin: 0 0 0.75rem;
}

.kal-slide-tilbake-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.kal-slide-tilbake-btn:hover {
  opacity: 0.8;
}

@media (max-width: 640px) {
  .kal-manad-tabell td {
    height: 3.1rem;
  }

  .kal-dag-knapp,
  .kal-dag-innhold {
    min-height: 3rem;
    padding: 0.25rem 0.28rem;
  }

  .kal-dag-nr {
    font-size: 0.8rem;
  }

  .kal-dag-prikk {
    width: 0.45rem;
    height: 0.45rem;
  }

  .kal-slide-panel {
    width: 100%;
  }
}

.kal-aktiv-bruker-valg {
  margin-bottom: 0.75rem;
}

.kal-tid-valg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.kal-tid-valg select {
  flex: 1;
  min-width: 0;
}

.kal-tid-kolon {
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.kal-liste-hint {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
}

.kal-liste {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.kal-liste > li {
  margin: 0 0 0.65rem;
}

.kal-liste > li:last-child {
  margin-bottom: 0;
}

.kal-subnav .btn.is-active {
  background: #0d8a84;
  color: #fff;
  border-color: #0d8a84;
}

@media (max-width: 768px) {
  .actions.kal-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .actions.kal-subnav .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
    line-height: 1.2;
  }
}

.kal-side-tittel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.kal-side-tittel h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.kal-side-tittel-handlinger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.kal-verge-badge {
  display: inline-flex;
  align-items: center;
  max-width: 8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #0d8a84;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kal-verge-badge:hover {
  background: #236663;
  color: #fff;
  text-decoration: none;
}

.kal-ny-knapp {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 4px solid #0d8a84;
  background: transparent;
  color: #0d8a84;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}

.kal-ny-knapp:hover {
  border-color: #236663;
  color: #236663;
  background: transparent;
  text-decoration: none;
}

.kal-forekomst-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kal-forekomst-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(44, 42, 38, 0.08);
}

.kal-forekomst-rad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.kal-forekomst-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.kal-ikon--sm {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.beskjed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.beskjed-kort {
  display: block;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 3px rgba(44, 42, 38, 0.06);
}

.beskjed-kort-hode {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.45rem;
}

.beskjed-kort-tittel {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}

.beskjed-kort-hode .badge {
  margin-left: 0;
}

.beskjed-kort .badge--aktiv {
  color: #0d8a84;
  border-color: rgba(13, 138, 132, 0.25);
  background: rgba(13, 138, 132, 0.08);
}

.beskjed-kort .badge--planlagd {
  color: #e85d4c;
  border-color: rgba(232, 93, 76, 0.25);
  background: rgba(232, 93, 76, 0.1);
}

.beskjed-kort .badge--regelmessig {
  color: #d4ebe8;
  border-color: rgba(46, 95, 138, 0.25);
  background: rgba(46, 95, 138, 0.1);
}

.beskjed-kort .badge--utgatt {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.beskjed-kort-tekst {
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.beskjed-kort-fot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
}

.beskjed-kort-fot .muted {
  font-variant-numeric: tabular-nums;
}

.beskjed-kort-handlinger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.beskjed-kort-slett {
  display: inline;
  margin: 0;
}

.kal-feed-panel .kal-feed-url {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
}

.kal-feed-panel .actions {
  margin-top: 0.75rem;
}


.topbar-shell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  flex: 1;
  min-width: 0;
}

.topbar .brand,
.brand {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.topbar-title {
  flex: 1;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar-nav {
  display: flex;
  gap: 0.85rem;
  margin-left: auto;
}

.topbar-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.topbar-notif {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.topbar-notif.has-unread {
  color: var(--teal);
}

.topbar-notif.has-unread .topbar-notif-count {
  background: var(--teal);
  color: #fff;
}

.topbar-notif-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(13, 138, 132, 0.12);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

body > .flash {
  max-width: 720px;
  margin: 0.75rem auto 0;
  padding-left: 1rem;
  padding-right: 1rem;
}

.panel {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
}

@media (max-width: 768px) {
  .actions.admin-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .actions.admin-subnav .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
  }
}

.topbar-menu-btn {
  display: none;
}

.topbar-actions {
  display: none;
}

.topbar-notif-mobile {
  display: none;
}

.topbar-notif-desktop {
  display: inline-flex;
}

.topbar-menu-icon {
  position: relative;
  display: block;
  width: 1.35rem;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: background 0.15s ease;
}

.topbar-menu-icon::before,
.topbar-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.15s ease, top 0.15s ease;
}

.topbar-menu-icon::before {
  top: -7px;
}

.topbar-menu-icon::after {
  top: 7px;
}

body.nav-open .topbar-menu-icon {
  background: transparent;
}

body.nav-open .topbar-menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

body.nav-open .topbar-menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (min-width: 769px) {
  .topbar-nav {
    display: flex;
    gap: 0.85rem;
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  .topbar-shell {
    flex-wrap: nowrap;
    padding: 0.85rem 1rem;
  }

  .topbar-wrap {
    flex: 1;
  }

  .topbar {
    flex-wrap: nowrap;
  }

  .topbar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
    flex-shrink: 0;
  }

  .topbar-notif-mobile {
    display: inline-flex;
  }

  .topbar-notif-desktop {
    display: none;
  }

  .topbar-notif-mobile .topbar-notif {
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
  }

  .topbar-notif-mobile .topbar-notif:hover {
    background: rgba(13, 138, 132, 0.08);
  }

  .topbar-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }

  .topbar-menu-btn:hover {
    background: rgba(13, 138, 132, 0.08);
  }

  .topbar-nav {
    display: none;
  }

  body.nav-open .topbar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: 0;
    padding: 4.25rem 1rem 1.5rem;
    background:
      linear-gradient(180deg, rgba(247, 251, 250, 0.99) 0%, rgba(243, 248, 247, 0.99) 100%);
    border-top: 0;
    overflow-y: auto;
    z-index: 40;
  }

  body.nav-open .topbar-shell {
    position: relative;
    z-index: 50;
  }

  body.nav-open .topbar-menu-btn {
    position: relative;
    z-index: 51;
  }

  body.nav-open .topbar-notif-mobile {
    position: relative;
    z-index: 51;
  }

  body.nav-open .topbar-nav a {
    padding: 0.85rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
  }

  body.nav-open .topbar-nav a:last-child {
    border-bottom: 0;
  }

  body.nav-open .page,
  body.nav-open > .flash,
  body.nav-open .bilde-overlay {
    display: none !important;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* Sjekkliste */

.sjekk-indikator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0d8a84;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.sjekk-indikator--liten {
  font-size: 0.9em;
}

.sjekk-indikator--manglar {
  color: #0d8a84;
  opacity: 0.7;
}

.sjekk-indikator--paagar {
  color: #e85d4c;
}

.sjekk-indikator--ferdig {
  color: #0d8a84;
}

.sjekk-badge-oblig {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e85d4c;
  margin-left: 0.35rem;
}

.sjekk-admin-punkt-liste,
.sjekk-punkt-liste,
.sjekk-utfylling-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sjekk-punkt-liste {
  list-style: decimal;
  padding-left: 1.25rem;
}

.sjekk-admin-punkt,
.sjekk-utfylling-rad {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(44, 42, 38, 0.12);
}

.sjekk-admin-punkt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sjekk-admin-nr-tekst {
  font-size: 0.9rem;
}

.sjekk-admin-sort {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  flex-direction: row;
}

.sjekk-lagre-rekkefolgje {
  display: none;
}

.sjekk-rekkefolgje-modus .sjekk-admin-nr-tekst {
  display: none;
}

.sjekk-rekkefolgje-modus .sjekk-admin-sort {
  display: inline-flex;
}

.sjekk-rekkefolgje-modus .sjekk-lagre-rekkefolgje {
  display: inline-block;
  margin-top: 0.75rem;
}

.sjekk-admin-sort span {
  display: inline;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: var(--muted, #6b6560);
}

.sjekk-admin-sort input[type="number"] {
  width: 4.25rem;
  min-height: 2.15rem;
  box-sizing: border-box;
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.sjekk-admin-sort input[type="number"]::-webkit-outer-spin-button,
.sjekk-admin-sort input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sjekk-admin-punkt-inn,
.sjekk-utfylling-inn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sjekk-check-btn {
  border: 0;
  background: transparent;
  padding: 0.1rem;
  cursor: pointer;
  font-size: 1.35rem;
  color: #0d8a84;
  line-height: 1;
}

.sjekk-check-btn.is-on,
.sjekk-check.is-on {
  color: #0d8a84;
}

.sjekk-utfylling-rad.is-sjekka .sjekk-punkt-tekst {
  text-decoration: line-through;
  opacity: 0.75;
}

.sjekk-meta {
  font-size: 0.85rem;
}

.sjekk-ferdig-form {
  margin-top: 1rem;
}

.sjekk-seksjon .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sjekk-legg-til-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(44, 42, 38, 0.12);
}

.sjekk-rediger-punkt {
  margin-bottom: 1.25rem;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid rgba(44, 42, 38, 0.12);
}


