/* SoMe — rolig, moderne design. Mobil først, lys og mørk modus. */

:root {
  --bg: #f4795b;
  --surface: #ffffff;
  --surface-2: #f1eee8;
  --surface-3: #e6e2da;
  --border: #e7e3db;
  --text: #17171b;
  --text-2: #5b5a58;
  --text-3: #6b6864;
  --accent: #0e5b5e;
  --accent-hover: #0a4b4e;
  --accent-ink: #ffffff;
  --accent-soft: #e2efee;
  --accent-soft-ink: #0e5b5e;
  --link: #0e5b5e;
  --danger: #bd213f;
  --danger-soft: #fdecef;
  --warn: #a96500;
  --warn-soft: #fff4e0;
  --ok: #0c8f62;
  --shadow: 0 1px 2px rgba(20, 22, 40, 0.04), 0 4px 16px rgba(20, 22, 40, 0.05);
  --shadow-lg: 0 -8px 40px rgba(20, 22, 40, 0.18);
  --header-bg: rgba(244, 121, 91, 0.9);

  /* Bakgrunner for innlegg (nøklene er lagret i databasen) */
  --t-gul: #fdf3d7;
  --t-gronn: #dff5e8;
  --t-bla: #ddeefe;
  --t-rosa: #fde4ec;
  --t-oransje: #feeadb;
  --t-lilla: #ebe7ff;

  /* quipu: petrol, korall, nesten svart og kremhvit */
  --brand: #17171b;
  --coral: #f4795b;
  --coral-ink: #17171b;
  --cream: #f7f5f1;
  /* Tekst og lenker som ligger rett på bakgrunnsfargen (ikke på kort) */
  --on-bg: #17171b;
  --on-bg-2: rgba(23, 23, 27, 0.82);
  --icon-tile: #0e5b5e;
  --icon-mark: #f7f5f1;

  --radius: 16px;
  --radius-sm: 12px;
  --tap: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e5b5e;
    --surface: #0f2b2d;
    --surface-2: #163739;
    --surface-3: #21474a;
    --border: #1f4245;
    --text: #f3f1ed;
    --text-2: #c2cccb;
    --text-3: #a3b4b3;
    --accent: #f4795b;
    --accent-hover: #f68c72;
    --accent-ink: #17171b;
    --accent-soft: #183d3f;
    --accent-soft-ink: #8fd3cd;
    --link: #7cc9c2;
    --danger: #ff5c78;
    --danger-soft: #3a1820;
    --warn: #f0b44c;
    --warn-soft: #33270f;
    --ok: #3ccf95;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 -8px 40px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(14, 91, 94, 0.9);

    --brand: #f7f5f1;
    --on-bg: #f7f5f1;
    --on-bg-2: rgba(247, 245, 241, 0.82);
    --icon-tile: #f7f5f1;
    --icon-mark: #0e5b5e; /* petrol blir for mørk mot mørk bakgrunn, så logoen er korall */

    --t-gul: #3a3220;
    --t-gronn: #1d3328;
    --t-bla: #1c2d40;
    --t-rosa: #3b2029;
    --t-oransje: #3b2a1e;
    --t-lilla: #2b2650;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

button, label, summary, a, input, select, textarea { touch-action: manipulation; }
button { font: inherit; color: inherit; }
svg.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

h1, h2, h3 { letter-spacing: -0.015em; line-height: 1.2; }
h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 700; }
h3 { margin: 0; font-size: 1.05rem; font-weight: 650; }

/* ---------- Topp ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; color: var(--brand); }

/* Logo: Q-merke + ordbilde. Høyden på ordbildet styrer størrelsen. */
.lockup { display: inline-flex; align-items: center; color: var(--brand); }
.lockup .mark { height: 1.25em; width: 1.25em; }
.lockup .wordmark { height: 0.85em; width: auto; margin-left: 0.3em; margin-top: 0.12em; }
.header-lockup { font-size: 26px; }
.hero-lockup { font-size: 64px; flex-direction: column; }
.hero-lockup .mark { height: 1.3em; width: 1.3em; }
.hero-lockup .wordmark { margin: 0.3em 0 0; height: 0.62em; }
.app-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--icon-tile); color: var(--icon-mark); overflow: hidden; }
.app-icon .mark { width: 100%; height: 100%; }
.me { display: flex; gap: 6px; align-items: center; min-width: 0; }

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px calc(16px + var(--safe-right)) 24px calc(16px + var(--safe-left));
}

/* ---------- Flater ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 2px 12px; }
.section-title h2 { margin: 0; }
.lead { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Skjema ---------- */
label.field { display: block; margin-bottom: 14px; font-size: 0.875rem; font-weight: 600; color: var(--text-2); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--text-2); margin: 4px 0 16px; }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }

/* 16 px eller mer hindrer at iPhone zoomer inn når man trykker i et felt. */
input, textarea, select {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  background: var(--surface-2);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; min-height: 0; padding: 0; display: inline-block; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: right 18px center, right 13px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw .icon-btn { position: absolute; right: 2px; bottom: 2px; }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row > input { flex: 1 1 160px; width: auto; margin-top: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid .full { grid-column: 1 / -1; }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
}
.btn.block { width: 100%; }
.btn.small { min-height: 40px; font-size: 0.9rem; padding: 8px 14px; border-radius: 10px; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.soft { background: var(--accent-soft); color: var(--accent-soft-ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; }
@media (hover: hover) {
  .btn:hover { background: var(--accent-hover); }
  .btn.secondary:hover, .btn.ghost:hover { background: var(--surface-3); }
  .btn.soft:hover { filter: brightness(0.97); }
  .btn.danger:hover { filter: brightness(0.97); }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  flex: none;
}
.icon-btn:active { background: var(--surface-3); }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); color: var(--text); } }

.link { background: none; border: none; color: var(--link); font-weight: 600; cursor: pointer; padding: 10px 2px; min-height: var(--tap); }
.link.danger { color: var(--danger); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill svg.icon { width: 16px; height: 16px; }
.pill.low { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1.35rem;
  line-height: 1;
  flex: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 1rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.7rem; }
.avatars-stack { display: flex; }
.avatars-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatars-stack .avatar:first-child { margin-left: 0; }

/* ---------- Innlogging ---------- */
.auth { max-width: 400px; margin: 0 auto; padding-top: 4vh; }
.auth-hero { text-align: center; margin: 12px 0 24px; }
.auth-hero .brand-title { margin: 0 0 14px; line-height: 1; }
.auth-hero h1 { font-size: 1.9rem; margin: 14px 0 6px; font-weight: 800; letter-spacing: -0.03em; }
.auth-hero p { margin: 0; color: var(--text-2); }
.auth .card { padding: 20px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--text-2); font-size: 0.95rem; }

/* ---------- Feed ---------- */
.compose-prompt { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 12px 14px; }
.compose-prompt .fake-input {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.compose-prompt .icon-btn { background: var(--coral); color: var(--coral-ink); }
.compose-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: -4px 4px 14px; font-size: 0.85rem; color: var(--text-3); }

.notice { display: flex; gap: 12px; align-items: flex-start; }
.notice svg.icon { color: var(--accent); margin-top: 2px; }
.notice p { margin: 2px 0 0; }

.post { padding: 14px 14px 6px; }
.post .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post .who { flex: 1; min-width: 0; }
.post .name { font-weight: 650; }
.post .meta { color: var(--text-3); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kind-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}
.kind-tag svg.icon { width: 14px; height: 14px; }
.post .body {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.post .body .sticker { margin-left: 6px; font-size: 1.3em; vertical-align: -0.1em; }
.post .actions { display: flex; gap: 2px; margin-top: 4px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.post .actions .btn.ghost { min-height: 40px; padding: 8px 10px; font-size: 0.85rem; font-weight: 600; color: var(--text-3); }
.post .actions .btn.ghost svg.icon { width: 16px; height: 16px; }
.post.flagged { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.t-gul { background: var(--t-gul); }
.t-gronn { background: var(--t-gronn); }
.t-bla { background: var(--t-bla); }
.t-rosa { background: var(--t-rosa); }
.t-oransje { background: var(--t-oransje); }
.t-lilla { background: var(--t-lilla); }

.media { margin-top: 10px; }
.media img, .media video, .preview img, .preview video {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.media video, .preview video { background: #000; }
.status-note {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 0 0; padding: 8px 10px;
  border-radius: 10px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 0.85rem; font-weight: 600;
}
.status-note svg.icon { width: 16px; height: 16px; }
.status-note.danger { background: var(--danger-soft); color: var(--danger); }

.feed-end { text-align: center; padding: 28px 16px; }
.feed-end .end-icon, .blocked .end-icon {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-soft-ink);
  margin-bottom: 10px;
}
.feed-end .end-icon svg.icon, .blocked .end-icon svg.icon { width: 26px; height: 26px; }
.feed-end p { margin: 4px 0 14px; color: var(--text-2); }

.blocked { text-align: center; padding: 40px 20px; margin-top: 8vh; }
.blocked p { color: var(--text-2); margin: 6px 0 0; }

/* ---------- Introduksjon ---------- */
.intro { text-align: center; padding: 28px 22px 20px; margin-top: 2vh; }
.intro .end-icon {
  display: inline-grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-soft-ink);
  margin: 14px 0 12px;
}
.intro .end-icon svg.icon { width: 30px; height: 30px; }
.intro h2 { font-size: 1.4rem; margin-bottom: 10px; }
.intro p { color: var(--text-2); margin: 0 0 10px; text-align: left; }
.intro-dots { display: flex; justify-content: center; gap: 6px; }
.intro-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: width 0.2s, background 0.2s; }
.intro-dots i.on { width: 20px; background: var(--coral); }
.intro-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.intro-nav .btn:last-child { min-width: 140px; }

.audience { display: flex; align-items: center; gap: 6px; min-width: 0; }
.audience svg.icon { width: 15px; height: 15px; flex: none; }
.composer .audience { margin: 12px 0 0; font-size: 0.8rem; color: var(--text-3); }

/* ---------- Ark (bottom sheet) ---------- */
.sheet-layer { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 14, 0.45); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 8px calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 6px; }
.sheet-layer.open .sheet-backdrop { opacity: 1; }
.sheet-layer.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; }

/* ---------- Skriv innlegg ---------- */
.kinds-label { font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.kinds button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer; text-align: left;
  min-width: 0;
}
.kinds button svg.icon { width: 16px; height: 16px; }
.kinds button.selected { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); }

.editor { border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; transition: background 0.2s; }
.editor textarea {
  border: none; border-radius: 0; background: transparent; margin: 0;
  min-height: 120px; resize: none; font-size: 17px; padding: 14px 16px;
}
.editor textarea:focus { box-shadow: none; background: transparent; }
.editor .toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-top: 1px solid var(--border); }
.editor .toolbar .count { margin-left: auto; padding-right: 8px; font-size: 0.8rem; color: var(--text-3); }
.editor .toolbar .icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.editor .toolbar .icon-btn .chosen { font-size: 1.2rem; line-height: 1; }

.picker { margin-top: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stickers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.stickers button { min-height: 44px; border: none; border-radius: 10px; background: transparent; font-size: 1.4rem; cursor: pointer; min-width: 0; }
.stickers button.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.stickers button .icon { color: var(--text-3); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); cursor: pointer; padding: 0; }
.swatch.selected { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--accent); }

.preview { margin-top: 12px; }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 0.85rem; color: var(--text-2); }
progress { flex: 1; height: 6px; border: none; border-radius: 3px; overflow: hidden; background: var(--surface-3); accent-color: var(--accent); -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-3); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.composer-foot select { margin: 0; flex: 1; min-width: 0; }
.composer-foot .to { flex: 1; font-size: 0.875rem; color: var(--text-2); min-width: 0; }
.composer-foot .btn { flex: none; min-width: 110px; }

.warning { display: flex; gap: 8px; align-items: flex-start; background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); margin: 12px 0 0; font-size: 0.925rem; font-weight: 500; }
.warning svg.icon { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Foresatte ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); margin-bottom: 16px; }
.tabs button { min-height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 0.925rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.selected { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs .count { background: var(--danger); color: white; border-radius: 999px; font-size: 0.7rem; padding: 1px 6px; }

.entity-head { display: flex; align-items: center; gap: 12px; }
.entity-head .who { flex: 1; min-width: 0; }
.entity-head .sub { color: var(--text-3); font-size: 0.875rem; }

.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.meter { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.meter .label { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.meter .value { font-size: 1.05rem; font-weight: 700; margin: 2px 0 6px; }
.meter .value span { font-weight: 500; color: var(--text-3); font-size: 0.875rem; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.subhead { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin: 16px 0 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.9rem; font-weight: 500; }
.chip .icon-btn { width: 30px; height: 30px; }
.chip.add { padding: 0 12px 0 8px; gap: 4px; border-style: dashed; color: var(--accent); background: transparent; cursor: pointer; font-weight: 600; }
.chip.add svg.icon { width: 16px; height: 16px; }
.join { margin-top: 10px; }
body.auth-page .topbar { display: none; }
.chip .icon-btn svg.icon { width: 15px; height: 15px; }

.settings { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--danger-soft); color: var(--danger); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.code-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--surface-3); margin-top: 12px; }
.code-box .label { font-size: 0.75rem; color: var(--text-3); font-weight: 600; }
.code-box code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.05rem; font-weight: 600; letter-spacing: 0.08em; user-select: all; -webkit-user-select: all; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; font-size: 0.925rem; }
.switch-row .text small { display: block; color: var(--text-3); font-size: 0.8rem; margin-top: 2px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background 0.2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px var(--accent-soft); }

.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 auto; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: none; padding-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }

.back-head { display: flex; align-items: center; gap: 6px; margin: 0 0 12px -10px; }
.back-head h2 { margin: 0; }

.empty { text-align: center; padding: 28px 16px; color: var(--text-2); }
.empty .end-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); margin-bottom: 8px; }

.avatar-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 8px 0 16px; }
.avatar-pick button { aspect-ratio: 1; min-height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); font-size: 1.3rem; cursor: pointer; padding: 0; min-width: 0; }
.avatar-pick button.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

.footer p { margin: 0 0 2px; }
a.info-link { display: flex; text-decoration: none; color: inherit; }
.footer { text-align: center; padding: 8px calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left)); color: var(--text-3); font-size: 0.8rem; }

.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 14px;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  font-size: 0.925rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 359px) {
  main { padding-left: 12px; padding-right: 12px; }
  .meters { grid-template-columns: 1fr; }
  .avatar-pick { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kinds button { font-size: 0.85rem; padding: 6px 10px; }
}

/* Større skjermer: arket blir en dialog midt på skjermen. */
@media (min-width: 680px) {
  main { padding-top: 24px; }
  .sheet-layer { align-items: center; }
  .sheet { border-radius: 22px; transform: translateY(24px) scale(0.98); opacity: 0; transition: transform 0.2s, opacity 0.2s; padding-bottom: 20px; }
  .sheet::before { display: none; }
  .sheet-layer.open .sheet { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop, .switch i, .switch i::after { transition: none; }
  .btn:active { transform: none; }
}

/* ---------- Informasjonssiden (om.html) ---------- */
.info { max-width: 720px; padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(32px + var(--safe-bottom)); }
.info-back { display: inline-block; margin-bottom: 8px; }
.info-hero { text-align: center; margin: 12px 0 36px; }
.info-hero img { width: 120px; height: auto; }
.info-hero h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 24px 0 10px; font-weight: 800; letter-spacing: -0.03em; }
.info-hero .lead { max-width: 560px; margin: 0 auto; font-size: 1.1rem; }
.info-section { margin: 0 0 40px; }
.info-section h2 { font-size: 1.4rem; margin-bottom: 12px; }
.info-section > p { margin: 0 0 12px; color: var(--text-2); }
.info-section > p strong { color: var(--text); }

.khipu { margin: 8px 0 20px; padding: 16px 12px 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.khipu svg { display: block; width: 100%; height: auto; }
.khipu .cord path, .khipu .cord.main { fill: none; stroke: var(--text-3); stroke-width: 3; stroke-linecap: round; }
.khipu .cord.main { stroke: var(--text); stroke-width: 7; }
.khipu .knot.petrol { fill: var(--brand-petrol, #0e5b5e); }
.khipu .knot.coral { fill: var(--coral); }
.khipu .knot.ink { fill: var(--text); }

.info-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.info-grid li {
  padding: 12px 14px 12px 44px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); position: relative;
}
.info-grid li strong { color: var(--text); }
.info-grid li::before {
  content: ""; position: absolute; left: 14px; top: 15px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--coral) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317171b' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.info-cards { display: grid; gap: 12px; }
.info-cards .card { margin: 0; }
.info-cards h3 { margin-bottom: 6px; color: var(--accent-soft-ink); }
.info-cards p { margin: 0; color: var(--text-2); }
.info-list { padding-left: 20px; margin: 0; color: var(--text-2); }
.info-list li { margin-bottom: 8px; }
.info-list.sources .link { min-height: 0; padding: 0; text-align: left; }
.info-cta { text-align: center; margin-top: 8px; }

@media (min-width: 640px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .info-cards { grid-template-columns: 1fr 1fr; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-petrol: #2b9c9a; }
}

/* ---------- Tekst rett på bakgrunnsfargen ---------- */
/* Korall (lys) og petrol (mørk) er sterke farger, så tekst utenfor kortene bruker egne farger med god kontrast. */
.topbar .icon-btn, .back-head .icon-btn { color: var(--on-bg); }
.compose-meta, .feed-end, .feed-end p, .footer, .auth-hero p, .auth-switch,
#view > p.muted, .section-title + p.muted, .back-head,
.info-section > p, .info-list, .info-hero .lead, .info-section > p.muted { color: var(--on-bg-2); }
.info-section > p strong, .feed-end h3, .section-title h2, .info-section h2, .info-hero h1 { color: var(--on-bg); }
.auth-switch .link, .footer .link, .feed-end .link, .info-back, .info-list .link, .info-section > p .link {
  color: var(--on-bg); text-decoration: underline; text-underline-offset: 3px;
}
.feed-end .end-icon { background: var(--surface); color: var(--accent-soft-ink); }
.topbar { border-bottom-color: rgba(0, 0, 0, 0.08); }
