/* Layout og komponenter. Farger hentes fra theme.css. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Hindrer at dobbelttrykk zoomer inn (kniping for å zoome virker fortsatt) */
html { touch-action: manipulation; }
body {
  font-family: var(--font-main); font-size: 16px; line-height: 1.45;
  background: var(--app-bg); color: var(--app-text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
img { max-width: 100%; display: block; }
a { color: var(--link-text); }
.muted { color: var(--app-text-muted); }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
main { flex: 1; padding: 8px 18px calc(96px + env(safe-area-inset-bottom)); }

/* Topplinje */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px; background: var(--header-bg); color: var(--header-text);
}
.brand { display: block; line-height: 0; text-decoration: none; }
.brand .logo { width: 62px; }
.bell { position: relative; background: none; border: 0; padding: 6px; color: var(--bell-icon); }
.bell .dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--notif-dot); }

/* Menylinje */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--tabbar-bg);
  border-top: 1px solid var(--tabbar-border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px;
  text-decoration: none; font-size: 0.75rem; color: var(--tabbar-icon);
}
.tabbar a[aria-current="page"] { color: var(--tabbar-icon-active); font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; }

/* Typografi */
h1 { font-size: 2rem; line-height: 1.05; letter-spacing: -0.035em; margin: 8px 0 16px; font-weight: 800; }
h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin: 24px 0 10px; font-weight: 700; }
h3 { font-size: 1.05rem; margin: 0; font-weight: 700; }

/* Knapper */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 700;
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text);
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-danger { background: var(--btn-danger-bg); color: var(--btn-danger-text); }
.btn-ghost { background: none; color: var(--btn-ghost-text); padding: 8px 10px; }
.btn-block { width: 100%; }
.btn-small { padding: 8px 12px; border-radius: 11px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:active:not(:disabled) { transform: scale(0.98); }

/* Skjema */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--input-border);
  background: var(--input-bg); color: var(--input-text);
}
.input:focus { outline: none; border-color: var(--input-focus); }
.error { color: var(--error-text); font-size: 0.92rem; min-height: 1.2em; margin: 4px 0 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }

input[type="range"] {
  width: 100%; accent-color: var(--slider-fill);
  /* Dra i slideren skal styre slideren, ikke zoome eller scrolle siden */
  touch-action: none; -webkit-user-select: none; user-select: none;
  padding: 10px 0; /* større treffområde for fingeren */
}
/* To like store felt ved siden av hverandre */
/* Ett felt i hver ende, like brede og like høye */
.field-pair { display: flex; justify-content: space-between; align-items: end; gap: 12px; width: 100%; }
.field-pair > div { flex: 0 1 46%; max-width: 165px; }
.field-pair > div:last-child .label { justify-content: flex-end; }
.field-pair > div:last-child .input { text-align: right; }
.field-pair .input { height: 48px; }

.stepper {
  display: flex; align-items: center; width: 100%; height: 48px;
  border: 1.5px solid var(--input-border); border-radius: 12px; background: var(--stepper-bg);
}
.stepper button { border: 0; background: none; width: 44px; height: 100%; font-size: 1.3rem; font-weight: 700; flex-shrink: 0; }
.stepper output { flex: 1; text-align: center; font-weight: 700; font-size: 1.1rem; }

.segmented {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--segmented-bg); border: 1px solid var(--segmented-border);
}
.segmented button {
  border: 0; background: none; border-radius: 999px; padding: 8px 16px;
  font-size: 0.88rem; font-weight: 600; color: var(--segmented-text); white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.segmented button[aria-pressed="true"] {
  background: var(--segmented-active-bg); color: var(--segmented-active-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
/* Full bredde, som feltene over: hvert valg tar like stor plass */
.segmented-block .segmented, .segmented-full { display: flex; width: 100%; }
.segmented-block .segmented button, .segmented-full button {
  flex: 1 1 0; padding: 9px 10px; white-space: normal; line-height: 1.2;
}
/* Tynn skillevegg inni pillen */
.segmented-divider { flex: 0 0 1px; align-self: stretch; margin: 7px 0; background: var(--segmented-divider); border-radius: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--chip-border); background: var(--chip-bg); color: var(--chip-text);
  border-radius: 999px; padding: 7px 13px; font-size: 0.92rem;
}
.chip[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: transparent; }

/* Søkepanel */
.search-panel { display: grid; gap: 18px; margin-bottom: 8px; }
.search-panel .label { font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; display: flex; justify-content: space-between; }
.loc-status { font-size: 0.9rem; margin-top: 6px; }

/* Aktivitetskort */
.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 18px; padding: 14px 16px;
}
.place-head { display: flex; gap: 12px; align-items: flex-start; }
.place-emoji { font-size: 1.7rem; line-height: 1; padding-top: 2px; }
.place-body { flex: 1; min-width: 0; }
.place-title { color: var(--card-title); font-size: 1.08rem; font-weight: 700; margin: 0; }
.place-cat { color: var(--card-meta); font-size: 0.88rem; }
.place-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 0.92rem; }
.place-distance { color: var(--distance-text); font-weight: 600; }
.price { font-weight: 700; }
.price-tier-1 { color: var(--price-tier-1); }
.price-tier-2 { color: var(--price-tier-2); }
.price-tier-3 { color: var(--price-tier-3); }
.group-note { display: inline-block; margin-top: 8px; font-size: 0.85rem; padding: 3px 9px; border-radius: 8px; background: var(--group-note-bg); color: var(--group-note-text); }
.place-details { margin-top: 10px; font-size: 0.9rem; color: var(--card-meta); display: grid; gap: 3px; }
.place-actions { display: flex; gap: 8px; margin-top: 12px; }
.place-actions .btn { flex: 1; }
.save-btn { background: none; border: 0; padding: 4px; color: var(--save-icon); }
.save-btn[aria-pressed="true"] { color: var(--save-icon-active); }
.save-btn svg { width: 26px; height: 26px; }
.estimate-note { font-size: 0.8rem; color: var(--card-meta); }

.empty { text-align: center; padding: 40px 10px; color: var(--app-text-muted); }
.empty .btn { margin-top: 14px; }

/* Grupper */
.group-item { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.avatars { display: flex; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--avatar-bg); color: var(--avatar-text); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
  border: 2px solid var(--avatar-ring);
}
.avatars .avatar + .avatar { margin-left: -10px; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }

/* Billett = bekreftet plan */
.ticket {
  position: relative; background: var(--ticket-bg); color: var(--ticket-text);
  border-radius: 16px; padding: 14px 18px; margin: 4px 0 12px;
  -webkit-mask: radial-gradient(circle 11px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 11px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 11px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.ticket-kicker { font-size: 0.82rem; color: var(--ticket-muted); font-weight: 600; }
.ticket-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0; }
.ticket-when { font-weight: 600; }
.ticket-arrivals { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; }
.arrived { background: var(--arrived-badge-bg); color: var(--arrived-badge-text); border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.ticket-mini { padding: 8px 14px; margin: 8px 0 0; }
.ticket-mini .ticket-name { font-size: 1rem; }

/* Chat */
.chat {
  /* Låst til skjermen. Høyden settes også fra JavaScript når tastaturet åpnes (iPhone). */
  position: fixed; top: 0; left: 0; right: 0; margin: 0 auto;
  width: 100%; max-width: 560px; height: 100vh; height: var(--chat-height, 100dvh);
  display: flex; flex-direction: column; overflow: hidden; background: var(--chat-bg);
}
body.in-chat { position: fixed; inset: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
html { overscroll-behavior-y: none; }
.chat-head { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.chat-head .title { flex: 1; min-width: 0; }
.chat-head .title h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .title small { color: var(--app-text-muted); }
.chat-plan { flex-shrink: 0; padding: 0 14px; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; min-width: 0; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 28px; height: 28px; font-size: 0.75rem; }
.msg-col { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.msg.mine .msg-col { align-items: flex-end; }
.msg-name { font-size: 0.78rem; color: var(--app-text-muted); margin: 0 0 2px 4px; }
.bubble {
  padding: 9px 13px; border-radius: 18px; background: var(--bubble-other-bg); color: var(--bubble-other-text);
  white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; border: 0; text-align: left;
}
.msg.mine .bubble { background: var(--bubble-mine-bg); color: var(--bubble-mine-text); }
.msg-system { align-self: center; text-align: center; font-size: 0.85rem; color: var(--system-msg-text); max-width: 90%; }
.msg-activity { max-width: 94%; width: 94%; }
.msg-activity .msg-col { flex: 1; }
.msg-activity .card { width: 100%; min-width: 0; }
.proposed-time { font-weight: 600; margin-top: 8px; font-size: 0.95rem; }
.vote-btn { width: 100%; margin-top: 10px; background: var(--vote-bg); color: var(--vote-text); }
.vote-btn[aria-pressed="true"] { background: var(--vote-active-bg); color: var(--vote-active-text); }
.vote-bar { height: 5px; border-radius: 3px; background: var(--vote-bar-track); margin-top: 8px; overflow: hidden; }
.vote-bar > i { display: block; height: 100%; background: var(--vote-bar-fill); transition: width .3s; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  border: 1.5px solid transparent; background: var(--reaction-bg); border-radius: 999px; padding: 1px 8px; font-size: 0.85rem;
}
.reaction[aria-pressed="true"] { background: var(--reaction-active-bg); border-color: var(--reaction-active-border); }
.reaction-picker { align-self: flex-start; display: flex; gap: 2px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 999px; padding: 3px 6px; margin-top: 4px; }
.reaction-picker button { border: 0; background: none; font-size: 1.25rem; padding: 2px 5px; }
.composer {
  flex-shrink: 0; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--composer-bg); border-top: 1px solid var(--composer-border);
}
.composer .input { border-radius: 22px; }
.composer .btn { border-radius: 22px; }

/* Modal / ark nedenfra */
.modal-backdrop { position: fixed; inset: 0; background: var(--modal-backdrop); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--modal-bg); width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up .22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.modal h2 { margin-top: 0; }
.pick-list { display: grid; gap: 8px; margin-bottom: 14px; }
.pick-list label { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1.5px solid var(--input-border); border-radius: 12px; }
.pick-list input { accent-color: var(--slider-fill); width: 18px; height: 18px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-text); padding: 11px 18px; border-radius: 14px; z-index: 60;
  font-size: 0.95rem; max-width: 90vw; animation: sheet-up .2s ease-out;
}

/* Innlogging */
.auth { padding: calc(40px + env(safe-area-inset-top)) 22px 40px; max-width: 440px; margin: 0 auto; }
.auth-brand { margin: 0 0 4px; line-height: 0; }
.auth-brand .logo { width: min(220px, 60vw); }
.auth-tagline { font-size: 1.2rem; margin: 10px 0 30px; }
.avatar-picker { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar-picker label { cursor: pointer; }

/* Tilbakemelding */
.stars { display: flex; gap: 4px; }
.stars button { background: none; border: 0; font-size: 2.2rem; color: var(--star-empty); padding: 0 2px; line-height: 1; }
.stars button.on { color: var(--star-full); }

.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.notif { display: block; text-decoration: none; color: inherit; }
.notif.unread { border-color: var(--input-focus); }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Bilder i chat */
.chat-image { display: block; border: 0; padding: 0; background: none; border-radius: 16px; overflow: hidden; max-width: 260px; }
.chat-image img { width: 100%; max-height: 340px; object-fit: cover; }
.msg.mine .chat-image + .bubble, .chat-image + .bubble { margin-top: 4px; }
.image-viewer { position: fixed; inset: 0; z-index: 70; background: var(--image-viewer-bg); display: grid; place-items: center; padding: 16px; }
.image-viewer img { max-height: 92dvh; max-width: 100%; object-fit: contain; border-radius: 8px; }
.composer .attach { flex-shrink: 0; width: 46px; padding: 0; font-size: 1.25rem; }

/* Avlyst forslag */
.msg-activity.cancelled .card { opacity: 0.6; }
.msg-activity.cancelled .place-title { text-decoration: line-through; color: var(--cancelled-text); }
.cancelled-badge { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 8px; background: var(--cancelled-badge-bg); color: var(--cancelled-badge-text); font-weight: 600; font-size: 0.88rem; }
.cancel-link { margin-top: 6px; padding-left: 0; font-size: 0.88rem; }
.ticket-cancel { margin-top: 10px; background: var(--ticket-cancel-bg); color: var(--ticket-cancel-text); }

/* Medlemsliste */
.member-row { display: flex; align-items: center; gap: 10px; }
.member-row .name { flex: 1; }
.owner-tag { font-size: 0.8rem; color: var(--app-text-muted); }

/* AI-søk */
.ai-box { background: var(--ai-box-bg); border: 1.5px solid var(--ai-box-border); border-radius: 18px; padding: 14px 16px; }
.ai-box h3 { margin-bottom: 8px; }
.ai-reason { color: var(--ai-reason-text); margin: 10px 0 0; font-size: 0.95rem; }

/* Uleste meldinger */
.tabbar a { position: relative; }
.tab-dot { position: absolute; top: 7px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--unread-dot); }
.unread-badge { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--unread-badge-bg); color: var(--unread-badge-text); font-size: 0.8rem; font-weight: 700; text-align: center; vertical-align: 2px; }

/* Lesebekreftelser */
.receipts { display: flex; justify-content: flex-end; gap: 2px; margin-top: -4px; }
.receipts .avatar { width: 16px; height: 16px; font-size: 0.55rem; border-width: 1px; }
.receipts-label { font-size: 0.72rem; color: var(--receipt-text); margin-right: 4px; align-self: center; }

/* Lange ord og lenker skal brytes i stedet for å presse siden bredere */
#app { overflow-x: clip; }
.card, .place-title, .place-cat, .place-details, .msg-system, .ai-reason, .toast { overflow-wrap: anywhere; }
.composer .input { min-width: 0; font-size: 16px; } /* 16px hindrer at iPhone zoomer inn på feltet */
.chat-image { max-width: min(260px, 100%); }
.bubble[data-picker] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.msg.mine .reaction-picker { align-self: flex-end; }

/* Åpent nå */
.open-badge { font-size: .82rem; font-weight: 700; color: var(--open-text); }
.open-badge.soon { color: var(--open-soon-text); }
.open-badge.closed { color: var(--open-closed-text); }

/* Historikk */
.history-item { display: flex; gap: 12px; align-items: flex-start; }
.history-item .when { font-size: .85rem; color: var(--card-meta); }
.history-rating { color: var(--star-full); }

/* Personvern og vilkår */
.legal { max-width: 560px; }
.legal h2 { font-size: 1.1rem; margin-top: 24px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal-links { font-size: .85rem; text-align: center; margin-top: 18px; }

/* Vurderinger fra andre brukere */
.rating-badge { font-weight: 700; color: var(--star-full); }
.rating-count { font-weight: 600; color: var(--card-meta); font-size: .85rem; }
.reviews { margin-top: 10px; display: grid; gap: 6px; }
.review { margin: 0; font-size: .9rem; color: var(--card-meta); }
.review-stars { color: var(--star-full); }

/* Velkomstboks */
.intro { background: var(--intro-bg); border: 1.5px solid var(--intro-border); border-radius: 18px; padding: 16px 18px; margin-top: 8px; }
.intro h2 { margin: 0 0 8px; font-size: 1.15rem; }
.intro ol { margin: 0 0 12px; padding-left: 20px; }
.intro li { margin-bottom: 6px; }

/* Invitasjon */
.invite-card { text-align: center; }
.invite-card .avatars { justify-content: center; margin: 12px 0; }

/* Kart */
body.map-open { overflow: hidden; }
.map-overlay { position: fixed; inset: 0; z-index: 40; background: var(--app-bg); display: flex; flex-direction: column; }
.map-top {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--header-bg);
}
.map-count { color: var(--app-text-muted); font-size: .9rem; }
.map { flex: 1; min-height: 0; background: var(--map-bg); }
/* Kartflisene er lyse, så vi demper dem litt for å passe det mørke temaet */
.map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.7); }
.leaflet-container { font-family: var(--font-main); background: var(--map-bg) !important; }
.leaflet-control-attribution { background: var(--card-bg) !important; color: var(--card-meta) !important; font-size: .7rem; }
.leaflet-control-attribution a { color: var(--link-text) !important; }
.leaflet-bar a { background: var(--card-bg) !important; color: var(--app-text) !important; border-color: var(--card-border) !important; }

.place-marker .pin {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg); background: var(--pin-bg); border: 2px solid var(--pin-border);
  font-size: 1.05rem; box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.place-marker .pin > * { transform: rotate(45deg); }
.place-marker .pin.tier-1 { border-color: var(--price-tier-1); }
.place-marker .pin.tier-2 { border-color: var(--price-tier-2); }
.place-marker .pin.tier-3 { border-color: var(--price-tier-3); }
.place-marker.selected .pin { background: var(--pin-selected-bg); transform: rotate(-45deg) scale(1.18); }
.me-marker span { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--me-dot); border: 3px solid var(--pin-bg); box-shadow: 0 0 0 4px var(--me-halo); }

.map-card {
  position: relative; margin: 0 10px calc(10px + env(safe-area-inset-bottom)); padding: 14px 16px;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 18px;
  animation: sheet-up .18s ease-out; max-height: 45dvh; overflow-y: auto;
}
.map-card-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--app-text-muted); font-size: 1.6rem; line-height: 1; }
.map-card .place-actions { flex-wrap: wrap; }
.map-card .place-actions .btn { flex: 1 1 auto; text-decoration: none; justify-content: center; white-space: nowrap; }

/* Bekreft e-post */
.verify-banner { border-color: var(--verify-border); background: var(--verify-bg); }

/* Handlinger på en melding (trykk og hold) */
.quoted-message { background: var(--bubble-other-bg); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.sheet-actions { display: grid; gap: 8px; }
.sheet-actions .btn { width: 100%; justify-content: center; }
.msg .bubble, .msg .chat-image { -webkit-touch-callout: none; }

/* Underfilter for kategorier */
.chip-sub { font-size: .85rem; padding: 5px 11px; }

/* Kategorivalg */
.search-panel .label-center { justify-content: center; gap: 8px; }
.cat-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cat-tile {
  flex: 0 1 calc(33.333% - 7px); max-width: calc(33.333% - 7px); min-width: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 16px; border: 1.5px solid var(--chip-border);
  background: var(--chip-bg); color: var(--chip-text); font-weight: 600; font-size: .92rem;
  transition: transform .12s ease;
}
.cat-tile:active { transform: scale(.97); }
.cat-tile[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: transparent; }
.cat-emoji { font-size: 1.5rem; line-height: 1; }
.cat-label { line-height: 1.15; text-align: center; }

.chips-center { justify-content: center; }
.sub-filter { margin-top: 14px; padding: 12px 10px; border-left: 0; border-radius: 16px; background: var(--sub-filter-bg); }
.sub-title { text-align: center; font-weight: 700; font-size: .92rem; margin-bottom: 10px; }
.sub-title .muted { font-weight: 600; font-size: .82rem; }

/* Logo med glød: hvit tekst lyser hvitt, nålen lyser grønt */
.logo { position: relative; display: inline-block; line-height: 0; }
.logo img { width: 100%; height: auto; display: block; }
.logo-text { filter: drop-shadow(0 0 5px var(--logo-glow-white)) drop-shadow(0 0 16px var(--logo-glow-white-soft)); }
.logo-pin {
  position: absolute; inset: 0;
  filter: drop-shadow(0 0 5px var(--logo-glow-green)) drop-shadow(0 0 18px var(--logo-glow-green-soft));
}
/* Litt liv i den store logoen på innloggingssiden */
.auth-brand .logo-text { animation: glow-white 4s ease-in-out infinite alternate; }
.auth-brand .logo-pin { animation: glow-green 4s ease-in-out infinite alternate; }
@keyframes glow-white {
  from { filter: drop-shadow(0 0 4px var(--logo-glow-white)) drop-shadow(0 0 14px var(--logo-glow-white-soft)); }
  to   { filter: drop-shadow(0 0 9px var(--logo-glow-white)) drop-shadow(0 0 28px var(--logo-glow-white-soft)); }
}
@keyframes glow-green {
  from { filter: drop-shadow(0 0 5px var(--logo-glow-green)) drop-shadow(0 0 16px var(--logo-glow-green-soft)); }
  to   { filter: drop-shadow(0 0 11px var(--logo-glow-green)) drop-shadow(0 0 32px var(--logo-glow-green-soft)); }
}
.segmented-block { text-align: center; }
.segmented-caption { font-size: .82rem; color: var(--app-text-muted); margin-bottom: 6px; }

/* Innhold i lister og kort skal aldri presse siden bredere enn skjermen */
.list > *, .results > * { min-width: 0; }
.card { overflow: hidden; }

/* Plassholdere mens noe lastes */
.skeleton { display: grid; gap: 10px; }
.skeleton-line { height: 16px; border-radius: 8px; background: var(--skeleton-bg); animation: skeleton 1.4s ease-in-out infinite; }
@keyframes skeleton { 0%, 100% { opacity: .5; } 50% { opacity: .9; } }

/* Profilinnstillinger */
.divider { border: 0; border-top: 1px solid var(--card-border); margin: 16px 0; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; }
.switch-row input { width: 46px; height: 26px; flex-shrink: 0; appearance: none; background: var(--vote-bar-track); border-radius: 999px; position: relative; cursor: pointer; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch-row input:checked { background: var(--btn-primary-bg); }
.switch-row input:checked::after { transform: translateX(20px); }
.tag-current { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--group-note-bg); color: var(--group-note-text); font-weight: 700; }

/* Oppdaterte vilkår */
.terms-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 18px 10px; padding: 10px 14px;
  border-radius: 14px; background: var(--verify-bg); border: 1px solid var(--verify-border); font-size: .92rem; }

/* Velg posisjon på kart */
.map-picker { position: relative; flex: 1; min-height: 0; display: flex; }
.map-picker .map { flex: 1; }
.crosshair {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  font-size: 2.4rem; pointer-events: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6));
}
.picker-info { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.loc-buttons { display: flex; gap: 8px; }
.loc-buttons .btn { flex: 1; justify-content: center; }
