:root {
  color-scheme: dark;
  --bg: #0f1620;
  --bg-elevated: #151d28;
  --surface: #1a2330;
  --surface-hover: #222c3a;
  --card-bg: #1a2330;
  --border: #2a3544;
  --border-bright: #3d4d62;
  --text: #eef2f7;
  --muted: #8b9cb0;
  --accent: #4da8ff;
  --accent-dim: #2d7fc4;
  --accent-hover: #7bc0ff;
  --accent-glow: rgba(77, 168, 255, 0.35);
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(77, 168, 255, 0.12);
  --card-img-fill: #0d1117;
  --btn-fg: #051018;
  --input-bg: #0d1218;
  --filter-bar-bg: rgba(26, 35, 48, 0.92);
  --filter-bar-input-bg: #121a24;
  --filter-bar-input-border: #3d4f63;
  --header-bg: rgba(18, 24, 34, 0.9);
  --alert-error-fg: #fecaca;
  --alert-error-bg: rgba(248, 113, 113, 0.12);
  --alert-ok-fg: #bbf7d0;
  --alert-ok-bg: rgba(74, 222, 128, 0.1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #dbe4ef;
  --bg-elevated: #eef2f7;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --card-bg: #ffffff;
  --border: #d1d9e4;
  --border-bright: #b8c4d4;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.25);
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 40px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 16px 48px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.15);
  --card-img-fill: #e2e8f0;
  --btn-fg: #ffffff;
  --input-bg: #ffffff;
  --filter-bar-bg: rgba(255, 255, 255, 0.97);
  --filter-bar-input-bg: #ffffff;
  --filter-bar-input-border: #b8c5d6;
  --header-bg: rgba(248, 250, 252, 0.94);
  --alert-error-fg: #991b1b;
  --alert-error-bg: rgba(220, 38, 38, 0.1);
  --alert-ok-fg: #166534;
  --alert-ok-bg: rgba(22, 163, 74, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, #141d28 0%, var(--bg) 38%, #0c121a 100%),
    radial-gradient(ellipse 100% 75% at 50% -28%, rgba(77, 168, 255, 0.24), transparent 58%),
    radial-gradient(ellipse 55% 45% at 100% 5%, rgba(77, 168, 255, 0.12), transparent 48%),
    radial-gradient(ellipse 50% 40% at 0% 95%, rgba(77, 168, 255, 0.1), transparent 52%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body {
  background-image:
    linear-gradient(180deg, #e8eef6 0%, var(--bg) 42%, #cfd9e8 100%),
    radial-gradient(ellipse 100% 72% at 50% -24%, rgba(37, 99, 235, 0.16), transparent 52%),
    radial-gradient(ellipse 50% 40% at 100% 8%, rgba(37, 99, 235, 0.1), transparent 46%),
    radial-gradient(ellipse 45% 38% at 0% 92%, rgba(37, 99, 235, 0.07), transparent 50%);
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
}

.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 800;
  font-size: clamp(0.78rem, 0.42rem + 1.35vw, 1.12rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
}
.logo:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.65rem;
  flex-wrap: wrap;
}

.nav > a:not(.btn) {
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  transition: background 0.18s var(--ease-out), color 0.18s ease;
}
.nav > a:not(.btn):hover {
  color: var(--text);
  background: rgba(77, 168, 255, 0.1);
}
[data-theme="light"] .nav > a:not(.btn):hover {
  background: rgba(37, 99, 235, 0.08);
}

.nav-user-menu {
  position: relative;
}
.nav-user-menu__summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 1.6rem 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  transition: background 0.18s var(--ease-out), color 0.18s ease, border-color 0.18s ease;
}
.nav-user-menu__summary::-webkit-details-marker {
  display: none;
}
.nav-user-menu__summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.75;
  pointer-events: none;
}
.nav-user-menu[open] .nav-user-menu__summary::after {
  margin-top: 0.05rem;
  transform: rotate(-135deg);
}
.nav-user-menu__summary:hover {
  color: var(--text);
  background: rgba(77, 168, 255, 0.1);
}
[data-theme="light"] .nav-user-menu__summary:hover {
  background: rgba(37, 99, 235, 0.08);
}
.nav-user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 12.5rem;
  padding: 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-user-menu__link {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-user-menu__link:hover {
  color: var(--text);
  background: rgba(77, 168, 255, 0.1);
}
[data-theme="light"] .nav-user-menu__link:hover {
  background: rgba(37, 99, 235, 0.08);
}

.main {
  flex: 1;
  padding: 1.75rem 0 3.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  background: var(--bg-elevated);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .site-footer {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.about-page__body {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}
.about-page__body p {
  margin: 0 0 0.85rem;
}
.about-page__form-title {
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(1.65rem, 2.5vw, 2rem);
  margin: 0 0 1.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.35s var(--ease-out), border-color 0.25s ease, transform 0.35s var(--ease-out);
}

/* Forside: annoncekort (billede → titel → teaser → metdata → prislinje) */
.card--listing {
  border-radius: calc(var(--radius) + 2px);
}
.card--listing:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.card:not(.card--listing):hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card--listing__media {
  display: block;
  aspect-ratio: 4/3;
  background: var(--card-img-fill);
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
}
.card--listing__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
  transition: transform 0.5s var(--ease-out);
}
.card--listing:hover .card--listing__media img {
  transform: scale(1.06);
}
.card--listing__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 10rem;
}

.card--listing__body {
  padding: 1.1rem 1.2rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-hover) 100%);
}

.card--listing__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}
.card--listing__title a {
  color: var(--text);
  text-decoration: none;
}
.card--listing__title a:hover {
  color: var(--accent);
}

.card--listing__teaser {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.card--listing__rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 0.65rem;
}

.card--listing__facts {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
}
.card--listing__facts li {
  margin: 0 0 0.2rem;
}
.card--listing__fact-label {
  color: var(--muted);
  font-weight: 500;
}

.card--listing__pricebar {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding: 0.65rem 0.75rem;
  margin-left: -0.15rem;
  margin-right: -0.15rem;
  margin-bottom: -0.05rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(77, 168, 255, 0.12), rgba(77, 168, 255, 0.04));
  border: 1px solid rgba(77, 168, 255, 0.18);
}
[data-theme="light"] .card--listing__pricebar {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
  border-color: rgba(37, 99, 235, 0.15);
}
.card--listing__price-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.card--listing__price-value {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
[data-theme="light"] .card--listing__price-value {
  color: var(--accent-dim);
}

.card-img {
  aspect-ratio: 4/3;
  background: var(--card-img-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-title {
  font-weight: 600;
  color: var(--text);
}
.card-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.card-price {
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  padding-top: 0.5rem;
}

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select,
textarea {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(165deg, var(--accent-hover) 0%, var(--accent) 45%, var(--accent-dim) 100%);
  color: var(--btn-fg);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 12px var(--accent-glow), var(--shadow-sm);
  transition: transform 0.18s var(--ease-out), box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover {
  filter: brightness(1.06);
  color: var(--btn-fg);
  box-shadow: 0 4px 20px var(--accent-glow), var(--shadow-sm);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border-bright);
  box-shadow: none;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(77, 168, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(77, 168, 255, 0.2);
}
[data-theme="light"] .btn-secondary:hover {
  background: rgba(37, 99, 235, 0.06);
}
.btn-small {
  padding: 0.42rem 0.85rem;
  font-size: 0.875rem;
}
.btn-danger {
  background: linear-gradient(165deg, #f87171 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(248, 113, 113, 0.35);
}
.btn-danger:hover {
  filter: brightness(1.08);
  color: #fff;
  box-shadow: 0 4px 18px rgba(248, 113, 113, 0.4);
}

.listing-screen-print {
  margin: 0 0 0.35rem;
}
.listing-screen-print__link {
  font-size: 0.875rem;
  font-weight: 600;
}
.listing-view-stat {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}
.listing-view-stat__hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
}

.listing-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin: 0;
}
.listing-actions__leading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: center;
}
.listing-actions__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}
@media (min-width: 720px) {
  .listing-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.25rem;
  }
  .listing-actions__leading {
    flex: 0 0 auto;
  }
  .listing-actions__secondary {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: min(100%, 20rem);
  }
}
.listing-actions__delete {
  display: inline;
  margin: 0;
}
.listing-actions__sold {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 0;
}
.listing-sold-mark-form__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  margin: 0;
  white-space: nowrap;
}
.listing-sold-mark-form__label select {
  min-width: 8.5rem;
  font-size: 0.875rem;
}
.listing-actions__sold-note {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Bekræftelsesdialog (slet annonce m.m.) — <dialog> */
.fly-dialog {
  border: none;
  padding: 0;
  max-width: min(26rem, calc(100vw - 2rem));
  width: 100%;
  margin: auto;
  background: transparent;
  color: var(--text);
}
.fly-dialog::backdrop {
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
[data-theme="light"] .fly-dialog::backdrop {
  background: rgba(22, 30, 44, 0.45);
}
.fly-dialog__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 1.35rem 1.4rem 1.25rem;
}
.fly-dialog__title {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.fly-dialog__body {
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}
.fly-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  align-items: center;
}

.listing-contact__gate {
  margin: 0;
  line-height: 1.45;
  font-size: 0.95rem;
}
.listing-contact__register-link {
  white-space: nowrap;
}

/* Solgt-skilt over billede (forside, detalje, mine annoncer) */
.media-sold-wrap {
  position: relative;
  display: block;
}
.media-sold-wrap--sold .card--listing__media,
.media-sold-wrap--sold .card-img {
  opacity: 0.92;
}
.sold-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(15, 20, 28, 0.55) 0%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.card--listing .sold-overlay {
  border-radius: 0;
}
.detail-gallery .media-sold-wrap .sold-overlay {
  border-radius: var(--radius);
}
.sold-overlay__text {
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #fff;
  font-size: clamp(1rem, 3.2vw, 1.65rem);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  padding: 0.45em 0.85em;
  transform: rotate(-8deg) scale(1);
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 50%, #7f1d1d 100%);
  box-shadow:
    0 8px 32px rgba(220, 38, 38, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: sold-pulse 2.5s ease-in-out infinite;
}
@keyframes sold-pulse {
  0%,
  100% {
    box-shadow:
      0 8px 32px rgba(220, 38, 38, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.25),
      0 0 0 2px rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow:
      0 10px 40px rgba(220, 38, 38, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 0 2px rgba(255, 255, 255, 0.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sold-overlay__text {
    animation: none;
  }
}

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.alert-error {
  background: var(--alert-error-bg);
  border: 1px solid var(--danger);
  color: var(--alert-error-fg);
}
.alert-ok {
  background: var(--alert-ok-bg);
  border: 1px solid var(--ok);
  color: var(--alert-ok-fg);
}

.profile-delete-zone {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  max-width: 520px;
}
.profile-delete-zone h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 520px;
}
.form-stack--wide {
  max-width: 640px;
}
.form-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.form-stack .form-section-title:first-child {
  margin-top: 0;
}

/* Rediger annonce: overskuelige kort og gitter */
.listing-edit-page {
  max-width: 52rem;
  margin: 0 auto;
}
.listing-edit-body .main {
  padding-top: 1.25rem;
}
.listing-edit-page__head {
  margin-bottom: 1.25rem;
}
.listing-edit-page__summary {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 40rem;
}
.listing-edit-form.form-stack--wide {
  max-width: none;
  gap: 0;
}
.listing-edit-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.35rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
/* display:flex på kort overskriver ellers [hidden] fra browseren */
.listing-edit-card[hidden] {
  display: none !important;
}
.listing-edit-card > * + * {
  margin-top: 1rem;
}
.listing-edit-card:last-of-type {
  margin-bottom: 1.5rem;
}
.listing-edit-card__title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.listing-edit-card__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 999px;
  background: linear-gradient(165deg, var(--accent-hover), var(--accent-dim));
  color: var(--btn-fg);
  flex-shrink: 0;
}
.listing-edit-card__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}
.listing-edit-card .form-hint {
  margin-top: 0.35rem;
}
.listing-edit-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .listing-edit-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}
.listing-edit-producer-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.listing-edit-producer-field > label[for="producer-preset"] {
  font-size: inherit;
}
.listing-edit-producer-custom {
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}
.listing-edit-producer-custom__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.listing-edit-location-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.listing-edit-kind-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 28rem;
}
.listing-edit-active-duration {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 22rem;
  margin-top: 0.35rem;
}
.listing-edit-active-duration select {
  font: inherit;
}
.listing-edit-aircraft-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.listing-edit-price {
  max-width: 14rem;
}
.listing-edit-price-reg {
  align-items: end;
}
.listing-edit-price-reg .listing-edit-price,
.listing-edit-price-reg .listing-edit-registration {
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.listing-edit-registration input {
  font: inherit;
  letter-spacing: 0.04em;
}
.listing-edit-images__heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
}
.listing-edit-images__grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-bottom: 0.75rem;
}
.listing-edit-image-tile {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--card-img-fill);
}
.listing-edit-image-tile img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.listing-edit-image-tile label {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  cursor: pointer;
}
.listing-edit-image-tile__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-hover);
  border-top: 1px solid var(--border);
  word-break: break-all;
}
.listing-edit-image-tile__bar input {
  margin: 0;
  flex-shrink: 0;
}
.listing-edit-upload {
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--input-bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.listing-edit-upload:focus-within {
  border-color: var(--accent);
  background: rgba(77, 168, 255, 0.06);
}
[data-theme="light"] .listing-edit-upload:focus-within {
  background: rgba(37, 99, 235, 0.05);
}
.listing-edit-upload input[type="file"] {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.85rem;
}
.listing-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-top: 0.25rem;
  margin-top: 0.25rem;
}
.listing-edit-actions .btn-secondary {
  text-align: center;
}

.listing-contact {
  margin-top: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.listing-contact h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.listing-qa {
  margin-top: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.listing-qa h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.listing-qa__thread {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.listing-qa__thread:first-of-type {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
}
.listing-qa__meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.listing-qa__body {
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.45;
}
.listing-qa__reply {
  margin: 0.75rem 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-dim);
}
.listing-qa__form {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.listing-qa__form textarea {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}

.listing-specs {
  margin-top: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.listing-specs h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.listing-specs__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
  font-size: 0.95rem;
}
.listing-specs__grid dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}
.listing-specs__grid dd {
  margin: 0;
}
.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-stack label.login-remember {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.form-stack label.login-remember input {
  margin: 0;
  width: auto;
  accent-color: var(--accent);
}
.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 800px) {
  .detail-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.detail-main-img {
  aspect-ratio: 4/3;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.detail-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-main-img--zoomable img {
  cursor: zoom-in;
}

.listing-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.listing-lightbox__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 12, 18, 0.92);
  cursor: pointer;
}
.listing-lightbox__frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 2rem;
  pointer-events: none;
}
.listing-lightbox__frame > * {
  pointer-events: auto;
}
.listing-lightbox__img {
  max-width: min(96vw, 1400px);
  max-height: min(88vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.listing-lightbox__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-lightbox__close:hover {
  background: var(--surface-hover);
}
.listing-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.listing-lightbox__nav:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}
.listing-lightbox__prev {
  left: 0.5rem;
}
.listing-lightbox__next {
  right: 0.5rem;
}
@media (max-width: 600px) {
  .listing-lightbox__nav {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.35rem;
  }
  .listing-lightbox__prev {
    left: 0.25rem;
  }
  .listing-lightbox__next {
    right: 0.25rem;
  }
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.thumbs a {
  width: 72px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.85;
}
.thumbs a:hover,
.thumbs a.active {
  border-color: var(--accent);
  opacity: 1;
}
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-stats-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}
.admin-stats-banner strong {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.admin-stats-banner span {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 42rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
}
.admin-table th {
  background: var(--surface);
}

.image-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.image-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.image-preview {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Forside: søgning, kategori, filtre */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.75rem;
  background: var(--filter-bar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-card);
}

.filters-bar__search {
  display: flex;
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 360px;
  border: 1px solid var(--filter-bar-input-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--filter-bar-input-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .filters-bar__search {
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.filters-bar__input {
  flex: 1;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  min-width: 0;
  color: var(--text);
}
.filters-bar__input:focus {
  outline: none;
}

.filters-bar__search:focus-within {
  box-shadow: 0 0 0 2px var(--accent), inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .filters-bar__search:focus-within {
  box-shadow: 0 0 0 2px var(--accent), inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.filters-bar__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  flex-shrink: 0;
  border: none;
  background: linear-gradient(165deg, var(--accent-hover), var(--accent-dim));
  color: var(--btn-fg);
  cursor: pointer;
  padding: 0;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.filters-bar__search-btn:hover {
  filter: brightness(1.08);
}
.filters-bar__search-btn:active {
  transform: scale(0.96);
}

.filters-bar__select {
  flex: 0 1 200px;
  min-width: 160px;
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--filter-bar-input-border);
  background: var(--filter-bar-input-bg);
  color: var(--text);
  appearance: none;
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238fa3b6' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

[data-theme="light"] .filters-bar__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c6778' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

/* Tema-knap (sol = skift til lyst, måne = skift til mørkt) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle__icon {
  display: none;
  line-height: 0;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  display: flex;
}

[data-theme="light"] .theme-toggle__icon--moon {
  display: flex;
}
