:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #2a2a2a;
  --muted: #666;
  --accent: #3a6b4a;
  --accent-dark: #2a5036;
  --border: #e5e3db;
  --error: #b83232;
  --success: #3a6b4a;
  --radius: 8px;
}

html[data-theme="dark"] {
  --bg: #17181b;
  --surface: #1f2024;
  --text: #e8e8ea;
  --muted: #9a9aa0;
  --accent: #7bbd91;
  --accent-dark: #5d9e73;
  --border: #2d2f35;
  --error: #e36d6d;
  --success: #7bbd91;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #15161a;
  color: var(--text);
}
html[data-theme="dark"] input:disabled {
  background: #2a2b30;
  color: var(--muted);
}
html[data-theme="dark"] .btn-ghost:hover {
  background: #2a2c32;
}
html[data-theme="dark"] .toast {
  background: #24262b;
  color: var(--text);
}
html[data-theme="dark"] .data-table tbody tr:hover {
  background: #23252a;
}
html[data-theme="dark"] code {
  background: #2a2c32;
}

html[data-size="large"] { font-size: 18px; }
html[data-size="xl"] { font-size: 20px; }

/* Mørk-tema overrides for pastell-farger brukt på tvers */
html[data-theme="dark"] .btn-danger:hover { background: #3a1e1e; }
html[data-theme="dark"] .badge-public,
html[data-theme="dark"] .badge-approved,
html[data-theme="dark"] .checkin-success,
html[data-theme="dark"] .stat-block.pending,
html[data-theme="dark"] .notice-success,
html[data-theme="dark"] .status-paid,
html[data-theme="dark"] .child-turlag-chip {
  background: #1e2a22;
  color: var(--accent);
}
html[data-theme="dark"] .badge-shared {
  background: #1e2534;
  color: #a0b8d0;
}
html[data-theme="dark"] .checkin-error,
html[data-theme="dark"] .flagged-row,
html[data-theme="dark"] .danger-zone {
  background: #2a1e1e;
}
html[data-theme="dark"] .danger-zone {
  border-color: #3a2626;
}
html[data-theme="dark"] .danger-action {
  border-bottom-color: #2a2222;
}
html[data-theme="dark"] .data-table tbody tr:hover,
html[data-theme="dark"] .clickable-row:hover {
  background: #242529;
}
html[data-theme="dark"] .info-panel,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .edit-banner,
html[data-theme="dark"] .alerts-panel,
html[data-theme="dark"] .alert-card {
  background: #2e2a1a;
  border-color: #4a4020;
  color: #d9c878;
}
html[data-theme="dark"] .info-panel > summary,
html[data-theme="dark"] .info-panel p,
html[data-theme="dark"] .alerts-title,
html[data-theme="dark"] .alert-count {
  color: #d9c878;
}
html[data-theme="dark"] .alert-card:hover {
  background: #3a3420;
  border-color: #6a5a28;
}
html[data-theme="dark"] .alert-label {
  color: #d9c878;
}
html[data-theme="dark"] body.system-mode .page h1 {
  color: var(--text);
}
html[data-theme="dark"] .danger-zone strong {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 2.5rem; /* plass for fixed footer */
  overflow-x: hidden; /* fang utilsiktet horisontal overflow på små skjermer */
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-dark); }

/* --- Topbar --- */
#topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
}
.topbar-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  padding-right: 0.5rem;
  border-right: 1px solid var(--border);
  margin-right: 0.25rem;
}
.lang-switcher,
.filter-select {
  font-size: 0.9rem;
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- Layout --- */
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page {
  max-width: 52rem;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.page h1, .page h2 {
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* --- Forms --- */
.auth-wrap {
  max-width: 26rem;
  margin: 3rem auto;
}

/* --- Login fullskjerm-kart --- */
body.login-body {
  overflow: hidden;
  padding-bottom: 0;
}
body.login-body #topbar,
body.login-body #footer {
  display: none;
}
body.login-body #app {
  max-width: none;
  margin: 0;
  padding: 0;
}
.login-bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #2a3038 url('/img/login-bg.webp') center/cover no-repeat;
}
/* ============================================================
   Auth-kort (login / register / glemt passord)
   Alltid lyst tema, uansett system-/app-preferanser.
   Felles tokens for konsistent utseende på tvers av sidene.
   ============================================================ */
.login-form-float {
  --auth-text: #2a2a2a;
  --auth-muted: #5a5a5a;
  --auth-border: #e0ddd2;
  --auth-link: #2a5036;
  --auth-link-hover: #1a3322;
  --auth-primary: #3a6b4a;
  --auth-primary-hover: #2a5036;

  position: fixed;
  z-index: 10;
  /* Sentrer kortet i området UNDER marqueen (140px), ikke i hele viewporten.
     Formel: midten av "marquee_bottom..viewport_bottom" = (140+vh)/2.
     Kortets topp-kant = midten - cardHeight/2. Antar ~480px kort.
       (140 + vh)/2 - 240  =  50vh - 170
     Bruker dvh (dynamic viewport height) som speiler synlig høyde på iOS;
     fallback til vh for eldre browsere. Klamper til min 150px. */
  /* Enkel posisjonering — media queries skaler avstand fra topp etter
     viewport-høyde. Pålitelig på alle browsers (ingen calc/max/dvh-quirks). */
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2rem 1.75rem 1.25rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  color-scheme: light;
  color: var(--auth-text);
}

/* Kortets ytre stack */
.login-form-float {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* Skaler kort-avstand fra topp etter viewport-høyde */
@media (min-height: 800px) {
  .login-form-float { top: 220px; }
}
@media (min-height: 1000px) {
  .login-form-float { top: 320px; }
}

/* Form-innhold stables med litt mer luft */
.login-form-float > form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-form-float h1 {
  margin: 0 0 0.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: 1.75rem;
  color: var(--auth-text);
  line-height: 1.2;
}
.login-form-float p {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--auth-text);
}
.login-form-float .muted { color: var(--auth-muted); }

/* Labels: stack med liten gap mellom tekst og input */
.login-form-float label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--auth-text);
}

/* Inputs: tving lyse — iOS Safari styler ellers svart ved system-dark */
.login-form-float input,
.login-form-float select,
html[data-theme="dark"] .login-form-float input,
html[data-theme="dark"] .login-form-float select {
  background: #fff;
  color: var(--auth-text);
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  -webkit-text-fill-color: var(--auth-text);
}
.login-form-float input:focus,
.login-form-float select:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(58, 107, 74, 0.18);
}
.login-form-float input::placeholder { color: #9a9a9a; }

/* Hovedknapp: full bredde, fast lys-tema-aksent */
.login-form-float .btn-primary {
  background: var(--auth-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.login-form-float .btn-primary:hover { background: var(--auth-primary-hover); }
.login-form-float .btn-primary:active { transform: translateY(1px); }

/* Lenker mellom auth-sider */
.login-form-float a {
  color: var(--auth-link);
  text-decoration: none;
}
.login-form-float a:hover { color: var(--auth-link-hover); }
.login-form-float .auth-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-align: center;
}

/* Notice-bokser (f.eks. "registrering stengt") */
.login-form-float .notice {
  background: #f3f8f4;
  border: 1px solid #d4e6d8;
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--auth-text);
}

/* Footer: lang-switcher + personvern/vilkår — felles for alle 3 sider */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--auth-border);
  font-size: 0.78rem;
}
.auth-lang-switcher {
  background: #fff;
  border: 1px solid var(--auth-border);
  color: var(--auth-text);
  font-size: 0.78rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
}
.auth-footer-legal { text-align: right; }
.auth-footer-legal a { color: var(--auth-link); }
.auth-footer-legal a:hover { color: var(--auth-link-hover); }

/* Flip-host: kort som spinner mellom auth-tilstandene */
.login-form-float { perspective: 900px; }
.auth-form-flip {
  transform-origin: center center;
  backface-visibility: hidden;
  overflow: hidden;  /* slik at høyde-animasjon ikke lekker innhold */
}
@keyframes authFlipOut {
  to { transform: rotateY(-90deg); opacity: 0; }
}
@keyframes authFlipIn {
  from { transform: rotateY(90deg); opacity: 0; }
  to   { transform: rotateY(0); opacity: 1; }
}
.auth-form-flip.flipping-out { animation: authFlipOut 180ms ease-in forwards; }
.auth-form-flip.flipping-in  { animation: authFlipIn 220ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .auth-form-flip.flipping-out,
  .auth-form-flip.flipping-in { animation: none; }
}

/* Marquee-strip øverst på login */
.login-marquee {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  overflow: hidden;
  height: 140px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0));
  pointer-events: none;
}
.login-marquee-track {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  width: max-content;
  animation: loginMarquee 200s linear infinite;
}
.login-marquee-track .marquee-item {
  flex-shrink: 0;
  width: 180px;
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.login-marquee-track .marquee-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.login-marquee-track .marquee-caption {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.login-marquee-track .marquee-caption .muted {
  color: rgba(255,255,255,0.7);
}
@keyframes loginMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (max-width: 700px) {
  .login-form-float {
    /* Behold den vertikale posisjonen fra hovedreglene (top: 150/220/320).
       Override kun horisontal: full bredde med side-margin. */
    left: 1rem;
    right: 1rem;
    width: auto;
    transform: none;
    padding: 1.25rem;
  }
  .login-feature-card {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}
.auth-form, .profile-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.profile-form {
  margin-bottom: 1.5rem;
}
.profile-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.profile-side .profile-form {
  margin-bottom: 0;
}
.auth-form h1, .profile-form h2 {
  margin: 0 0 0.5rem;
  font-weight: 300;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
input, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
input:disabled {
  background: #f0ede5;
  color: var(--muted);
}

button {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: white;
  margin-top: 0.5rem;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-align: center;
}
.auth-status {
  text-align: center;
  color: var(--muted);
  padding: 1rem 0;
}

/* --- Toast --- */
#toast-host {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}
.toast {
  background: var(--surface);
  border-left: 3px solid var(--muted);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 20rem;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }

/* --- Nav --- */
.topbar-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  flex: 1;  /* push profile/lang switchers til høyre */
}
.topbar-nav a {
  color: var(--muted);
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.15s;
}
.topbar-nav a:hover {
  color: var(--text);
  text-decoration: none;
}
.topbar-nav a.active {
  color: var(--text);
  font-weight: 500;
}
.topbar-nav a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
/* Drawer-aktiv: tydelig venstre-bord */
.mobile-drawer a.active {
  color: var(--accent);
  font-weight: 500;
  border-left: 3px solid var(--accent);
  padding-left: calc(0.5rem - 3px);
}
.topbar-logout {
  font-size: 0.9rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.topbar-logout:hover {
  color: var(--error);
}
.topbar-logout-icon {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  line-height: 0;
}
.topbar-logout-icon svg {
  display: block;
}

/* Hjelpemodus-toggle i topbaren — speiler logout-knappens stil */
.topbar-help {
  font-size: 0.9rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.topbar-help:hover { color: var(--accent); }
.topbar-help.active {
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(58, 107, 74, 0.25);
}
.topbar-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  line-height: 0;
  width: 32px;
  height: 32px;
}
.topbar-help-icon svg { display: block; }

/* --- Avatar-/kontomeny (desktop dropdown) --- */
.account-menu {
  position: relative;
  margin-left: auto;  /* skyv menyen til høyre kant av nav */
}
.account-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  user-select: none;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::marker { content: ''; }
.account-menu > summary:hover { background: var(--bg); }
.account-menu[open] > summary { background: var(--bg); }
.account-menu-icon,
.account-menu-caret { display: inline-flex; align-items: center; line-height: 0; }
.account-menu-caret { color: var(--muted); transition: transform 0.15s; }
.account-menu[open] .account-menu-caret { transform: rotate(180deg); }
.account-menu-name { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  z-index: 60;
}
.account-menu-panel a,
.account-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.account-menu-panel a:hover,
.account-menu-panel button:hover {
  background: var(--bg);
  color: var(--accent);
}
/* Hjelp- og logg ut-knappene arver topbar-stil; nøytraliser sær-stiler i panelet */
.account-menu-panel .topbar-help,
.account-menu-panel .topbar-logout { color: var(--text); }
.account-menu-panel .topbar-help.active {
  color: var(--accent);
  background: var(--bg);
  border-radius: 6px;
  box-shadow: none;
}
.account-menu-panel .topbar-logout:hover { color: var(--error); }
.account-menu-panel .system-link { color: var(--accent); font-weight: 500; }

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0.25rem;
}
.drawer-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.6rem 0.5rem 0.2rem;
}

/* (i)-knapper som dukker opp i help-mode på alle [data-help]-elementer */
body.help-mode [data-help] {
  position: relative;
}
body.help-mode [data-help]::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  pointer-events: none;
  opacity: 0.45;
}
.help-icon {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--surface);
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.help-icon:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
}

/* Modal med hjelpetekst */
.help-modal { max-width: 32rem; }
.help-modal-body {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0.5rem 0 1rem;
  white-space: pre-wrap;
}

/* Barn-modus: subtil gul linje øverst som visuell påminnelse */
body.child-mode #topbar {
  border-top: 3px solid #e6d48a;
  background: #fffdf4;
}
html[data-theme="dark"] body.child-mode #topbar {
  background: #2d2a1e;
}

/* --- Generic --- */
.muted { color: var(--muted); }
.section { margin-top: 2rem; }
.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.btn-small { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-danger { color: var(--error); }
.btn-danger:hover { background: #fbe5e5; }
/* Primary + danger combo: solid rød "destructive primary" */
.btn-primary.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}
.btn-primary.btn-danger:hover {
  background: #8a1f1f;
  border-color: #8a1f1f;
  color: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- Turlag list --- */
.turlag-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 0.5rem;
}
.turlag-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.turlag-card:hover { border-color: var(--accent); text-decoration: none; }
.turlag-card-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.turlag-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
}

.role-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  letter-spacing: 0.02em;
}
.role-admin { background: var(--accent); color: white; }

.badge-private, .badge-public {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
}
.badge-public { background: #e0f0e4; color: var(--accent-dark); }

/* --- Inline/join form --- */
.inline-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}
.inline-form h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 500;
}
.inline-form-row {
  display: flex;
  gap: 0.5rem;
}
.inline-form-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-results {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.75rem;
}
.search-result {
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.search-result:hover { border-color: var(--accent); text-decoration: none; }

/* --- Turlag detail --- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin: 1.5rem 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab-link:hover { color: var(--text); text-decoration: none; }
.tab-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
/* Grupperte system-faner som dropdowns: Innhold / Moderering / Plattform.
   Kompakt på én linje; gjenbruker .account-menu-dropdownstilen. */
.tabs.system-tabs {
  overflow: visible;   /* så dropdown-panelene ikke klippes av nav-en */
  align-items: center;
  gap: 0.5rem;
}
.tab-dropdown {
  position: relative;
  margin-left: 0;      /* nøytraliser .account-menu sin margin-left:auto */
  align-self: center;
}
.tab-dropdown-trigger { color: var(--muted); padding: 0.5rem 0.75rem; }
.tab-dropdown-trigger.active { color: var(--accent); font-weight: 500; }
.tab-dropdown .account-menu-panel {
  left: 0;
  right: auto;         /* venstrejuster panelet under triggeren */
  min-width: 180px;
}
.account-menu-panel .menu-item-active { color: var(--accent); font-weight: 500; }
.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
@media (max-width: 700px) {
  .tabs { gap: 0; }
  .tab-link {
    flex: 1;
    justify-content: center;
    padding: 0.85rem 0.4rem;
  }
  .tab-text { display: none; }
  .tab-icon svg { width: 22px; height: 22px; }
}

.edit-banner {
  background: #fff6dc;
  border: 1px solid #e6d48a;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #6b5200;
  font-size: 0.9rem;
}
.edit-banner button {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
}
.edit-banner-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Admin-info-banner: ting som krever oppmerksomhet (ikke edit-mode) */
.admin-alerts-banner {
  background: #e6f0fb;
  border: 1px solid #b9d3ee;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #1f4870;
  font-size: 0.9rem;
}
html[data-theme="dark"] .admin-alerts-banner {
  background: #1c2a3a;
  border-color: #2a4060;
  color: #cfe1f2;
}
.admin-alerts-title {
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.admin-alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-alerts-list li {
  padding: 0.3rem 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  line-height: 1.5;
}
.admin-alerts-list li:first-child { border-top: none; }
.admin-alerts-banner a { color: inherit; text-decoration: underline; }

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}
.info-list dt {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.info-list dd {
  margin: 0;
}

.invitation-code-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.invitation-code-row code {
  background: var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}

/* --- Tables --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table tbody tr:hover { background: #f7f5ef; }
.data-table tfoot .totals-row td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  background: var(--surface);
}
html[data-theme="dark"] .data-table tfoot .totals-row td {
  border-top-color: var(--border);
}

/* --- Wide page for map/grid-layouts --- */
.page-wide {
  max-width: 1200px;
}

/* Generisk to-kolonne layout som stables på smale skjermer */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
@media (max-width: 780px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

/* Grid av kort som auto-flyter (for turlag-lister o.l.) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.tab-header h2 {
  margin: 0;
  font-weight: 400;
  font-size: 1.25rem;
}

/* --- Maps --- */
.map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Gjør Leaflet-markører mer synlige (skygge under + ikke for små) */
.map .leaflet-interactive {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

/* "Zoom inn for å vise poster"-overlay på store turlag-kart */
.overview-map-overlay {
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  color: #2a2a2a;
  pointer-events: none;
}

/* Høyde-legend nederst i kartet */
.altitude-legend {
  background: rgba(255, 255, 255, 0.92);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.2;
  min-width: 120px;
}
.altitude-legend-title {
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
}
.altitude-legend-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right,
    rgb(46, 125, 50) 0%,
    rgb(239, 108, 0) 50%,
    rgb(198, 40, 40) 100%);
  margin-bottom: 0.25rem;
}
.altitude-legend-labels {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.map-picker {
  height: 500px;
  cursor: crosshair;
}

/* Foreslå ny post — modal med kart-velger */
.suggest-modal { max-width: 30rem; width: 100%; }
.suggest-map { height: 240px; border-radius: var(--radius); overflow: hidden; margin-top: 0.25rem; }
.suggest-coord-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.35rem 0; }
.suggest-coord { font-size: 0.85rem; }
.suggest-targets { margin: 0.25rem 0 0.5rem; }
.suggest-targets-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.suggest-target { display: block; padding: 0.15rem 0; font-size: 0.95rem; }

/* Post-forslag i Administrer-fanen */
.suggestion-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.suggestion-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 1rem; }
.suggestion-meta { font-size: 0.85rem; margin-top: 0.15rem; }
.suggestion-comment { margin-top: 0.35rem; font-style: italic; }
.suggestion-row .suggestion-main { flex: 1; }
.suggestion-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); flex: none; }
.suggest-img-preview { max-width: 100%; max-height: 160px; border-radius: var(--radius); margin-top: 0.35rem; display: block; }
.suggest-file { font-size: 0.9rem; }

/* Søkefelt over postlista */
.post-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.post-search {
  flex: 1;
  max-width: 22rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.post-search-count { font-size: 0.85rem; white-space: nowrap; }

.posts-layout {
  display: grid;
  grid-template-columns: 1fr 22rem;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .posts-layout {
    grid-template-columns: 1fr;
  }
  .map { height: 300px; }
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.25rem;
  max-height: 400px;
  overflow-y: auto;
}
.post-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s;
}
.post-row:hover { border-color: var(--accent); }
.post-row.inactive { opacity: 0.55; }
.post-row-inner {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
}
.post-row-inner:hover { text-decoration: none; }
.post-row-main { margin-bottom: 0.25rem; }
.post-row-meta { font-size: 0.85rem; }

/* --- Post form layout --- */
.post-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .post-form-layout {
    grid-template-columns: 1fr;
  }
}
.post-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.post-form h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.03em;
}
.post-form textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  resize: vertical;
}
.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* --- Post row: make it a flex-row so edit link sits on the right --- */
.post-row {
  position: relative;
  display: flex;
  align-items: center;
}
.post-row-inner {
  flex: 1;
}
.post-edit-link {
  margin-right: 0.75rem;
}

/* --- Post detail layout --- */
.post-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.post-detail-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;  /* la grid-cellen krympe under innholds-bredde på mobil */
}
.post-detail-col .card-title {
  margin: 0 0 0.5rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 900px) {
  .post-detail-layout {
    grid-template-columns: 1fr;
  }
  .post-detail-layout .map { height: 300px; }
}

/* --- Check-in card --- */
.checkin-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
}
.checkin-status {
  font-size: 0.9rem;
  color: var(--muted);
}
.checkin-status:empty,
.checkin-result:empty { display: none; }
.checkin-status.error { color: var(--error); }
.checkin-success {
  background: #e0f0e4;
  color: var(--accent-dark);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0;
}
.checkin-warning {
  background: #fff6dc;
  color: #6b5200;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0;
}
.checkin-error {
  background: #fbe5e5;
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0;
}
.countdown {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.countdown-time {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 500;
}

/* --- Info-panel (utvidbar) --- */
.info-panel {
  margin-bottom: 1.5rem;
  background: #fff6dc;
  border: 1px solid #e6d48a;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.info-panel > summary {
  cursor: pointer;
  font-weight: 500;
  color: #6b5200;
  user-select: none;
  list-style: none;
}
.info-panel > summary::-webkit-details-marker {
  display: none;
}
.info-panel[open] > summary {
  margin-bottom: 0.5rem;
}
.info-panel p {
  margin: 0.5rem 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Varder grid --- */
.wallet-display {
  margin-top: 0.5rem;
  font-size: 1.1rem;
}
.wallet-total {
  font-size: 1.5rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.varde-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.varde-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.varde-card.archived {
  opacity: 0.65;
}
.varde-card.has-image {
  background-size: cover;
  background-position: center;
  background-color: var(--surface); /* fallback under image */
  overflow: hidden;
}
.varde-card.has-image .varde-card-header h3 {
  background: rgba(255,255,255,0.94);
  color: var(--text);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.varde-card.has-image .stat-block {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.varde-card.has-image .btn-ghost {
  background: rgba(255,255,255,0.94);
  border-color: rgba(0,0,0,0.08);
  color: var(--text);
}
.varde-card.has-image .btn-ghost:hover {
  background: #fff;
  color: var(--accent);
}
.varde-card.has-image .upgrade-section {
  background: rgba(255,255,255,0.94);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border-top: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.child-last-checkin {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

.varde-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.varde-card-header h3 {
  margin: 0;
  font-weight: 500;
  font-size: 1.1rem;
}

.badge-archived, .badge-full, .badge-shared {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--border);
  margin-left: 0.4rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.badge-full {
  background: #fff6dc;
  color: #6b5200;
}
.badge-shared {
  background: #e0ecf5;
  color: #2a4d7a;
}

.varde-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.stat-block {
  background: var(--bg);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
}
.stat-block.pending {
  background: #e0f0e4;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 1rem;
}

.upgrade-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.upgrade-meta {
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.upgrade-short {
  color: var(--error);
  font-weight: 500;
}
.upgrade-cost {
  opacity: 0.7;
}

/* --- Modal (season form) --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.modal h2 {
  margin: 0 0 0.5rem;
  font-weight: 300;
  font-size: 1.5rem;
}

/* --- Seasons --- */
.section-title {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2rem 0 0.75rem;
  font-weight: 500;
}
.section-title:first-of-type { margin-top: 0.5rem; }
.season-card {
  margin-bottom: 0.75rem;
}
.season-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.season-card-header h4 {
  margin: 0;
  font-weight: 500;
  font-size: 1.1rem;
}

/* --- Leaderboard --- */
.leaderboard-meta {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Ekspress-handlinger i system-poster-tabellen */
.post-express-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.filter-bar label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.filter-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* --- Gruppe-pills --- */
.group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.group-pill {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.group-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}
.group-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.group-admin-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  display: grid;
  gap: 0.5rem;
}
.group-admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-wide {
  max-width: 40rem;
}
.notice {
  background: #fff6dc;
  border-left: 3px solid #e6d48a;
  padding: 0.75rem 1rem;
  color: #6b5200;
  font-size: 0.9rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.leaderboard-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.leaderboard-table tr.is-self {
  background: #e0f0e4;
}
.leaderboard-table tr.is-self:hover {
  background: #d0e6d6;
}
html[data-theme="dark"] .leaderboard-table tr.is-self {
  background: #1e2a22;
}
html[data-theme="dark"] .leaderboard-table tr.is-self:hover {
  background: #25342b;
}
.rank-cell {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  width: 3rem;
}
.self-badge {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.85rem;
}
.completed-badge {
  color: var(--accent);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* --- Profile switcher --- */
.profile-switcher {
  font-size: 0.9rem;
  border: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border-radius: 4px;
  font-family: inherit;
  margin-left: 0.5rem;
  max-width: 10rem;
}
.profile-switcher.active {
  background: #fff6dc;
  border-color: #e6d48a;
  color: #6b5200;
  font-weight: 500;
}

/* --- Network page --- */
.conn-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.5rem;
}
.conn-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.conn-row .role-badge {
  margin-left: 0.5rem;
}
.conn-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Share modal --- */
.share-form {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.share-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.share-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 0.5rem;
}
.status-active { color: var(--success); font-size: 0.85rem; }
.status-expired, .status-revoked { color: var(--muted); font-size: 0.85rem; }

/* --- Subscription --- */
.tier-display {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tier-badge {
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.tier-pro {
  background: var(--accent);
  color: white;
}
.tier-free {
  background: var(--border);
  color: var(--text);
}

.upgrade-card .feature-list {
  margin: 0.5rem 0 1.5rem;
  padding-left: 1.5rem;
  color: var(--text);
}
.upgrade-card .feature-list li {
  margin-bottom: 0.25rem;
}

/* --- Tier-kort --- */
.tier-card {
  padding: 1.75rem 1.5rem;
}
.tier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tier-card-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.tier-price {
  font-weight: 500;
  color: var(--text);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.status-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.status-paid {
  background: #e0f0e4;
  color: var(--accent-dark);
}
.status-manual {
  background: #fff6dc;
  color: #6b5200;
}
.tier-details {
  margin: 1rem 0 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature-heading {
  margin: 1.25rem 0 0.5rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Features med ✓-ikon i stedet for bullet */
.feature-list-check {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.feature-list-check li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.5rem;
  color: var(--text);
}
.feature-list-check li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.pay-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
/* Pris-visning på gratis-oppgradering: «Gratis nå» + overstrøket 149 */
.upgrade-price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0.25rem 0 0.75rem;
}
.upgrade-price-free {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
}
.upgrade-price-was {
  color: var(--muted);
  text-decoration: line-through;
}
.pay-button-disabled {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pay-button-disabled button {
  opacity: 0.5;
  cursor: not-allowed;
}

.notice-success {
  background: #e0f0e4;
  border-left-color: var(--success);
  color: var(--accent-dark);
}

/* --- System admin (egen visuell identitet) --- */
.system-link {
  color: #c4a000 !important;
  font-weight: 500;
}
body.system-mode #topbar {
  background: #1f1f2e;
  border-bottom-color: #3a3a4e;
}

.impersonate-banner {
  background: #c62828;
  color: #fff;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 200;
}
.impersonate-banner .btn-ghost {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  margin-top: 0;
}
.impersonate-banner .btn-ghost:hover {
  background: rgba(255,255,255,0.35);
}
body.impersonating {
  outline: 3px solid #c62828;
  outline-offset: -3px;
}

.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: #f7f5ef;
}
.contrib-group {
  margin-bottom: 1.5rem;
}
.contrib-group-title {
  margin: 0.75rem 0 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.audit-metadata {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: 0.75rem;
  cursor: pointer;
  min-width: 0;
}
.audit-metadata.expanded {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
}

.alerts-panel {
  background: #fff6dc;
  border: 1px solid #e6d48a;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.alerts-title {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b5200;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}
.alert-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e6d48a;
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.alert-card:hover {
  border-color: #c28500;
  background: #fffaee;
  text-decoration: none;
}
.alert-count {
  font-size: 1.5rem;
  font-weight: 500;
  color: #c28500;
  min-width: 2rem;
  text-align: center;
}
.alert-label {
  font-size: 0.85rem;
  flex: 1;
}

.connect-code-card .connect-code-display {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.25rem;
}
.connect-code-value {
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.connect-code-timer {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.clickable-link {
  color: var(--accent);
  cursor: pointer;
}
.clickable-link:hover {
  text-decoration: underline;
}

.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.5rem;
  display: grid;
  gap: 0.25rem;
}
.activity-item {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-left: 3px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  align-items: baseline;
}
.activity-item.flagged {
  border-left-color: var(--error);
  background: #fdf7f7;
}
.activity-item.activity-user_created {
  border-left-color: var(--accent);
}
.activity-item.activity-org_created {
  border-left-color: #c4a000;
}

/* Audit-feed: fargede venstrekanter etter action-kategori */
.audit-item .audit-actor {
  font-weight: 500;
}
.audit-item .audit-action {
  font-family: monospace;
  font-size: 0.78rem;
  background: var(--bg);
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
}
.audit-item .audit-entity {
  font-size: 0.85rem;
}
.audit-item.audit-system { border-left-color: #c4a000; }
.audit-item.audit-org { border-left-color: var(--accent); }
.audit-item.audit-turlag { border-left-color: var(--accent); }
.audit-item.audit-post { border-left-color: #2a6fb8; }
.audit-item.audit-checkin { border-left-color: #2a6fb8; }
.audit-item.audit-varde { border-left-color: #b07c2d; }
.audit-item.audit-auth { border-left-color: #7a3f9a; }
.audit-item.audit-user { border-left-color: var(--muted); }
.audit-imp {
  background: #fbe5e5;
  color: var(--error);
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  margin-left: 0.4rem;
}
html[data-theme="dark"] .audit-imp {
  background: #3a1e1e;
}
.activity-ts {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-family: monospace;
}
.activity-title {
  font-weight: 500;
}
.activity-sub {
  font-size: 0.75rem;
}

.orphan-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
}
.orphan-list li {
  padding: 0.2rem 0;
}
body.system-mode #topbar .brand,
body.system-mode #topbar .topbar-nav a {
  color: #e8e8ee;
}
body.system-mode #topbar .topbar-nav a:hover {
  color: #ffd700;
}
body.system-mode .page h1 {
  color: #1f1f2e;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stats-combo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
.stat-combo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.stat-combo-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.stat-combo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.9rem;
}
.stat-combo-item strong {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-right: 0.25rem;
}
@media (max-width: 780px) {
  .stats-combo {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: left;
}
.stat-card-value {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-card-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}
.action-stack button { font-size: 0.75rem; padding: 0.2rem 0.5rem; }

.badge-pending_approval {
  background: #fff6dc;
  color: #6b5200;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.badge-approved {
  background: #e0f0e4;
  color: var(--accent-dark);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.badge-private_only {
  background: var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* --- Footer (fixed nederst på skjerm) --- */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  background: var(--surface);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}
.footer-inner a {
  color: var(--muted);
}
.footer-inner a:hover {
  color: var(--text);
  text-decoration: none;
}

/* --- GDPR section --- */
.gdpr-action {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;
}
.gdpr-action > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.gdpr-action > div > button {
  align-self: flex-start;
}
.profile-form hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

/* --- Radius input with live display --- */
.radius-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.radius-row input {
  flex: 1;
}
.radius-display {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--accent);
  min-width: 4.5rem;
  text-align: right;
}

/* --- Danger zone (arkiv/forlat-seksjon på oversikt) --- */
.danger-zone {
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid #e8cfcf;
  border-radius: var(--radius);
  background: #fdf7f7;
}
.danger-zone-title {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--error);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.danger-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0e4e4;
}
.danger-action:last-child { border-bottom: none; }
.danger-action > div:first-child {
  flex: 1;
}
.danger-action strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.danger-action .muted {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Forlat turlag — nøytral medlemshandling på Oversikt (ikke faresone) */
.turlag-leave-section {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.leave-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.leave-action > div:first-child { flex: 1; }
.leave-action strong { display: block; margin-bottom: 0.15rem; }
.leave-action .muted { font-size: 0.85rem; line-height: 1.4; }

/* Opplåsingskort på Administrer-fanen (edit-mode låst) */
.admin-unlock-card {
  text-align: center;
  max-width: 30rem;
  margin: 2rem auto;
}
.admin-unlock-card h3 { margin: 0 0 0.5rem; }
.admin-unlock-card p { margin: 0 0 1.25rem; }

/* Publiser turlag (offentlig/privat) */
.publish-section {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.publish-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.publish-row > div:first-child { flex: 1; min-width: 0; }
.publish-row strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.publish-row .muted {
  font-size: 0.85rem;
  line-height: 1.4;
}
.badge-pending {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  background: #fff6dc;
  color: #5b4a00;
}
html[data-theme="dark"] .badge-pending {
  background: #3a3220;
  color: #f0e5c0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.page-indicator {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.flagged-row {
  background: #fdf7f7;
}

/* Skjermleser-only */
.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;
}

/* --- Barn: Turlag-modal --- */
.turlag-modal-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.75rem;
  display: grid;
  gap: 0.4rem;
}
.turlag-modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.turlag-modal-row .btn-primary,
.turlag-modal-row .btn-ghost {
  margin-top: 0;
  flex-shrink: 0;
}

/* Statistikk-kort på turlag-overview */
.turlag-stats-section {
  margin: 1.5rem 0;
}
.turlag-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.turlag-stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.turlag-stats-card-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.turlag-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.25rem 0;
  font-size: 0.85rem;
}
.turlag-stats-row.primary {
  font-size: 1rem;
  padding-bottom: 0.45rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}
.turlag-stats-row.primary .turlag-stats-row-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
}
.turlag-stats-row-value { font-weight: 500; color: var(--text); }
.turlag-stats-footer {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-align: center;
}
@media (max-width: 700px) {
  .turlag-stats-grid { grid-template-columns: 1fr; }
}

/* Aktivitet-kort: kompakt telling + lister for meg og nettverket */
.post-activity-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.post-activity-count-value {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.post-activity-count-value.muted { font-size: 0.85rem; font-weight: 400; }
.post-activity-count-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}
.post-activity-subhead {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.3rem;
}
.post-activity-subhead:first-child { margin-top: 0; }
.post-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}
.post-activity-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.post-activity-list li:last-child { border-bottom: none; }
.post-activity-empty { padding: 0.3rem 0; font-size: 0.85rem; }

/* Info-stripe øverst i sjekk-inn-kortet på post-detail */
.post-info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.post-info-item {
  text-align: center;
}
.post-info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.post-info-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

/* Værvarsel-kort på post-detail */
.weather-card .weather-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}
.weather-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
}
.weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  min-width: 0;
}
.weather-day-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.weather-weekday,
.weather-daymonth { display: block; }
.weather-icon { font-size: 1.6rem; line-height: 1; }
.weather-temp { font-weight: 500; }
.weather-precip, .weather-wind { font-size: 0.75rem; }
.weather-wind-arrow {
  display: inline-block;
  font-size: 0.9rem;
  line-height: 1;
}
.weather-attribution {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
}
@media (max-width: 700px) {
  .weather-row {
    /* Litt smalere kolonner, scroller horisontalt om viewport er trang */
    grid-template-columns: repeat(7, minmax(54px, 1fr));
  }
  .weather-day { padding: 0.35rem 0.15rem; }
  .weather-icon { font-size: 1.4rem; }
  .weather-day-label { font-size: 0.65rem; }
  .weather-temp { font-size: 0.9rem; }
  .weather-precip, .weather-wind { font-size: 0.7rem; }
}

/* Observasjonspanel i sysadmin-turlag-modal */
.org-inspect-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.9rem 1rem;
  background: #fff6dc;
  border: 1px solid #e5d9a6;
  border-radius: var(--radius);
}
html[data-theme="dark"] .org-inspect-panel {
  background: #3a3220;
  border-color: #4a4020;
  color: #f0e5c0;
}
.org-inspect-title {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.org-inspect-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.org-inspect-item {
  padding: 0.35rem 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.85rem;
  line-height: 1.4;
}
.org-inspect-item:first-child { border-top: none; }
.org-inspect-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius);
  background: #e5d9a6;
  color: #5b4a00;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.35rem;
}
html[data-theme="dark"] .org-inspect-tag {
  background: #5c4a1f;
  color: #f0e5c0;
}

/* Sysadmin turlag-redigering */
.org-edit-card label,
.add-member-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.org-edit-card .form-row,
.add-member-card .form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.org-edit-card .form-row > label,
.add-member-card .form-row > label {
  margin-bottom: 0;
}
@media (max-width: 700px) {
  .org-edit-card .form-row,
  .add-member-card .form-row {
    grid-template-columns: 1fr;
  }
}

/* Nettverk-ledertavle seksjon */
.network-leaderboard-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.leaderboard-table .corrected-lower {
  color: #b88500;
  font-weight: 500;
}
html[data-theme="dark"] .leaderboard-table .corrected-lower {
  color: #e6c068;
}
.leaderboard-footnote {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* All-time-stats-kort øverst på /innsjekk */
.lifetime-stats-section {
  margin-bottom: 1.5rem;
}
.lifetime-stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lifetime-stat {
  text-align: center;
  padding: 0.25rem 0.5rem;
}
.lifetime-stat-value {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
}
.lifetime-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}
.lifetime-stat-primary .lifetime-stat-value {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 600;
}
@media (max-width: 600px) {
  .lifetime-stats-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .lifetime-stat-value { font-size: 1.4rem; }
  .lifetime-stat-primary .lifetime-stat-value { font-size: 1.7rem; }
}

/* --- Quick check-in (/innsjekk) --- */
.quick-checkin-section {
  margin-bottom: 2.5rem;
}
.quick-checkin-heading {
  margin: 0 0 0.75rem;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.checkin-gps-status,
.checkin-gps-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}
.checkin-gps-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}
.checkin-gps-refresh { margin-left: auto; }
.checkin-gps-acc-bad {
  color: #b88500;
  font-weight: 500;
}
html[data-theme="dark"] .checkin-gps-acc-bad { color: #e6c068; }
.checkin-gps-warn {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fff6dc;
  border: 1px solid #e5d9a6;
  border-radius: var(--radius);
  color: #5b4a00;
  font-size: 0.8rem;
  line-height: 1.4;
}
html[data-theme="dark"] .checkin-gps-warn {
  background: #3a3220;
  border-color: #4a4020;
  color: #f0e5c0;
}
.checkin-gps-error {
  background: #fbe5e5;
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0 0 0.75rem;
}
.checkin-map {
  height: 260px;
  margin-bottom: 1rem;
}
.checkin-quick-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.5rem;
}
.checkin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.checkin-row.in-range {
  border-color: var(--accent);
  background: #f3f8f4;
}
html[data-theme="dark"] .checkin-row.in-range {
  background: #1e2a22;
}
.checkin-row-main {
  flex: 1;
  min-width: 0;
}
.checkin-row-name {
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.checkin-row-meta {
  font-size: 0.85rem;
}
.checkin-row-result {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  min-height: 0;
}
.checkin-row-result:empty { display: none; }
.checkin-row-action {
  flex-shrink: 0;
}
.checkin-row-action button {
  white-space: nowrap;
  margin-top: 0;
}
.checkin-history-meta {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.recent-checkins-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  display: grid;
  gap: 0.35rem;
}
.recent-checkins-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* User-marker (blå dott) */
.user-location-marker {
  background: #2a6fb8;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  width: 16px;
  height: 16px;
}

/* Post-markør: ✓ for besøkt, ? for ubesøkt. Farget bakgrunn = høyde. */
.post-map-marker {
  background: transparent;
  border: none;
}
.post-map-marker > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.post-map-marker-visited > span {
  font-size: 16px;
}

@media (max-width: 600px) {
  .checkin-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .checkin-row-action button {
    width: 100%;
  }
}

/* --- Post-bilder (frimerke-komprimert) --- */
.post-image-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0.5rem 0;
}
.post-image-section > label {
  font-size: 0.85rem;
  color: var(--muted);
}
.post-image-preview {
  max-width: 128px;
  max-height: 128px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg);
  display: block;
}
.post-image-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.post-image-dropzone:hover,
.post-image-dropzone:focus-visible {
  border-color: var(--accent);
}
.post-image-dropzone.dragover {
  border-color: var(--accent);
  background: #e0f0e4;
}
.post-image-drop-prompt {
  font-size: 0.9rem;
  text-align: center;
  pointer-events: none;
}
.post-image-file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.post-image-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Thumbnail i post-lister */
.post-row-thumb,
.checkin-row-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}
.checkin-row-thumb {
  margin-right: 0.75rem;
}
.post-row-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.post-row-content {
  flex: 1;
  min-width: 0;
}

/* Post-detail: bidrag (når posten mangler bilde) */
.contribution-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.contribution-card .card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.contrib-upload {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contrib-preview {
  max-width: 128px;
  max-height: 128px;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
  margin: 0 auto;
}
.contrib-disclaimer {
  font-size: 0.8rem;
  line-height: 1.4;
}
.contrib-admin-title {
  margin: 0.5rem 0 0.25rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contrib-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.contrib-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.contrib-row-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: transform 0.12s;
}
.contrib-row-thumb:hover {
  transform: scale(1.05);
}
.contrib-row-meta {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
}
.contrib-credit {
  font-size: 0.8rem;
}
.contrib-row-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Lightbox for bilde-forhåndsvisning */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: grid;
  place-items: center;
  z-index: 1100;
  padding: 2rem;
  cursor: zoom-out;
}
.image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  width: 52px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  transition: background 0.15s;
  display: grid;
  place-items: center;
  margin-top: 0;
}
.lightbox-nav:hover {
  background: rgba(0,0,0,0.85);
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-counter {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
@media (max-width: 600px) {
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-nav { width: 44px; height: 44px; }
}
.contrib-row-actions .btn-primary,
.contrib-row-actions .btn-ghost {
  margin-top: 0;
}

/* Post-detail: stort bilde */
.post-image-card {
  padding: 0;
  overflow: hidden;
}
.post-detail-image {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}
.post-image-notice {
  margin: 0;
  border-radius: 0;
  font-size: 0.8rem;
}
.post-image-credit {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-style: italic;
  border-top: 1px solid var(--border);
}
.post-image-description {
  margin: 0;
  padding: 0.9rem 1.1rem 1.1rem;
  line-height: 1.55;
  border-top: 1px solid var(--border);
}

.post-detail-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.post-detail-spacer { flex: 1; min-width: 0.5rem; }
.post-detail-nav-prev,
.post-detail-nav-next {
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 700px) {
  .post-detail-spacer { display: none; }
  .post-detail-nav-prev,
  .post-detail-nav-next { max-width: 10rem; }
}
.post-detail-subheader {
  margin-top: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.post-detail-subheader h1 {
  font-size: 1.4rem;
  margin: 0;
}

/* Oversikts-kart på turlag-detail overview-tab */
.overview-map {
  height: 320px;
  margin-bottom: 1.25rem;
}

/* Utvalgte turlag (liste) på /turlag */
.turlag-featured-section {
  margin: 1.5rem 0;
}
.turlag-featured-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.turlag-featured-item {
  border-bottom: 1px solid var(--border);
}
.turlag-featured-item:last-child { border-bottom: none; }
.turlag-featured-link {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
}
.turlag-featured-link:hover {
  background: rgba(0,0,0,0.03);
  text-decoration: none;
}
html[data-theme="dark"] .turlag-featured-link:hover { background: rgba(255,255,255,0.04); }
.turlag-featured-name { margin-bottom: 0.15rem; }
.turlag-featured-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.turlag-featured-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Kart over offentlige turlag på /turlag */
.turlag-discover-map {
  height: 460px;
  margin: 0.5rem 0 1.5rem;
}
@media (max-width: 700px) {
  .turlag-discover-map { height: 340px; }
}

.turlag-mine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.turlag-mine-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}
.turlag-mine-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.turlag-mine-card-primary {
  border-color: var(--primary);
  background: var(--primary-bg, var(--surface));
}
.turlag-mine-card .muted {
  font-size: 0.8rem;
  text-transform: capitalize;
}

.turlag-description {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.turlag-description-edit {
  margin-bottom: 1.25rem;
}
.turlag-description-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  resize: vertical;
}

.radius-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.radius-input-small {
  width: 4rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.9rem;
}

/* Karusell av område-bilder */
.org-carousel-wrap {
  margin-bottom: 1.5rem;
}
.org-carousel {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  cursor: grab;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: auto;
}
.org-carousel::-webkit-scrollbar {
  display: none;
}
.org-carousel.dragging {
  cursor: grabbing;
}
.org-carousel-thumb {
  height: 180px;
  width: auto;
  flex-shrink: 0;
  border-radius: var(--radius);
  cursor: zoom-in;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  user-select: none;
  -webkit-user-drag: none;
}

/* Bilde-redigering (admin+edit-mode) */
.org-image-manager {
  margin-bottom: 1.5rem;
}
.org-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.org-image-tile {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.org-image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
.org-image-delete {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 1;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
}
.org-image-delete:hover {
  background: var(--error);
}

/* Turlag-header: dropdown + handlinger */
.turlag-page-header {
  flex-wrap: wrap;
  gap: 1rem;
}
.turlag-header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.turlag-switcher {
  font-size: 1.25rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
  max-width: 100%;
}
.turlag-switcher:focus {
  outline: none;
  border-color: var(--accent);
}
.turlag-status-pill {
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg);
  border-radius: 999px;
}
.turlag-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
/* Knapper i en horisontal rad skal ikke arve form-submit margin-top */
.actions-row .btn-primary,
.actions-row .btn-ghost,
.turlag-header-actions .btn-primary,
.turlag-header-actions .btn-ghost,
.post-detail-header-actions .btn-primary,
.post-detail-header-actions .btn-ghost {
  margin-top: 0;
}

/* Leaflet-popup for poster — med thumbnail */
.post-popup {
  min-width: 140px;
  text-align: center;
}
.post-popup .post-popup-thumb {
  display: block;
  width: 100%;
  max-width: 180px;
  max-height: 140px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 auto 0.35rem;
}
.post-popup .popup-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.post-popup .popup-post-link {
  display: block;
  color: var(--accent);
  text-decoration: none;
}
.post-popup .popup-post-link:hover {
  text-decoration: underline;
}
.post-popup .popup-thumb-link {
  display: block;
}

/* --- Burger / mobile drawer --- */
.burger-btn {
  display: none;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.burger-icon,
.burger-icon::before,
.burger-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.burger-icon {
  position: relative;
}
.burger-icon::before,
.burger-icon::after {
  content: '';
  position: absolute;
  left: 0;
}
.burger-icon::before { top: -7px; }
.burger-icon::after  { top: 7px; }

body.menu-open .burger-icon {
  background: transparent;
}
body.menu-open .burger-icon::before {
  transform: translateY(7px) rotate(45deg);
}
body.menu-open .burger-icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-drawer {
  position: fixed;
  top: 56px;
  right: 0;
  left: auto;
  bottom: 0;
  width: min(340px, 88vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 0.5rem 1rem calc(env(safe-area-inset-bottom, 0) + 1rem);
  box-shadow: -6px 0 18px rgba(0,0,0,0.18);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.menu-open .mobile-drawer {
  transform: translateX(0);
}
.mobile-drawer a,
.mobile-drawer button {
  display: flex;
  align-items: center;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 1.05rem;
  text-align: left;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  min-height: 48px;
}
.mobile-drawer a:last-child,
.mobile-drawer button:last-child {
  border-bottom: none;
}
.mobile-drawer a:active,
.mobile-drawer button:active {
  background: rgba(0,0,0,0.04);
}
html[data-theme="dark"] .mobile-drawer a:active,
html[data-theme="dark"] .mobile-drawer button:active {
  background: rgba(255,255,255,0.06);
}
.mobile-drawer a:hover { text-decoration: none; color: var(--accent); }

/* Backdrop bak drawer — dimmer innholdet og lukker ved tap */
.mobile-drawer-backdrop {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 10000;
}
body.menu-open .mobile-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.menu-open { overflow: hidden; }

@media (max-width: 780px) {
  .topbar-nav {
    display: none;
  }
  .burger-btn {
    display: inline-flex;
    margin-left: auto;
  }
  .profile-switcher {
    max-width: 8rem;
  }
  .brand {
    padding-right: 0;
    border-right: none;
  }
  #topbar {
    padding: 0 1rem;
  }
  .topbar-inner {
    gap: 0.75rem;
  }
}

/* --- Report modal --- */
.report-modal {
  max-width: 40rem;
}
.report-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.report-section-title {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
}
.report-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.report-category-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.report-category-option:hover {
  border-color: var(--accent);
}
.report-category-option input[type="radio"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.report-category-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(58, 107, 74, 0.06);
}
.report-category-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
}
.report-category-label .muted {
  font-size: 0.8rem;
}
.report-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.report-fields-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.report-fields-section label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.report-fields-section label > span {
  font-size: 0.85rem;
  color: var(--muted);
}
.report-fields-section input,
.report-fields-section select,
.report-fields-section textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
.report-pick-map {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.report-coords-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .report-category-grid {
    grid-template-columns: 1fr;
  }
  .report-coords-row {
    grid-template-columns: 1fr;
  }
}

/* --- System reports tab --- */
.report-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
}
.report-row-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.report-row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}
.report-row-head strong {
  font-size: 1rem;
}
.report-cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(58, 107, 74, 0.1);
  color: var(--accent);
}
.report-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}
.report-status-pending { background: rgba(220, 160, 30, 0.12); color: #b97a00; }
.report-status-resolved { background: rgba(58, 107, 74, 0.12); color: var(--accent); }
.report-status-rejected { background: rgba(180, 60, 60, 0.12); color: #b94343; }
.report-payload-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}
.report-payload-list li {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0.5rem;
}
.report-payload-list li > span:first-child {
  color: var(--muted);
}
.report-attachment-thumb {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin-top: 0.25rem;
  cursor: zoom-in;
}
.report-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 12rem;
}
@media (max-width: 720px) {
  .report-row {
    grid-template-columns: 1fr;
  }
  .report-row-actions {
    min-width: 0;
  }
  .report-payload-list li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
