:root {
  --navy: #141c2e;
  --navy-mid: #1a2540;
  --navy-card: #1e2d45;
  --gold: #C4A060;
  --gold-light: #D8BC84;
  --gold-dark: #A08448;
  --platinum: #C0CDD8;
  --text: #EAE2D4;
  --text-body: #C8C2B8;
  --text-muted: #8A9AA8;
  --divider: rgba(196,160,96,0.25);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --panel-w: 420px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif; background: var(--navy); color: var(--text-body);
  overflow: hidden; font-size: 0.95rem; line-height: 1.65;
}

/* ---------- Toppbar ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: 64px;
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: rgba(20,28,46,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}
.brand h1 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.25rem; color: var(--text); white-space: nowrap; }
.brand h1 em { font-style: italic; color: var(--gold-light); }

.searchwrap { position: relative; flex: 1; max-width: 380px; margin-left: auto; }
#search {
  width: 100%; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--divider);
  background: var(--navy-card); color: var(--text); font: inherit; font-size: 0.9rem; outline: none;
}
#search::placeholder { color: var(--text-muted); }
#search:focus { border-color: var(--gold); }
#suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--navy-card); border: 1px solid var(--divider); border-radius: 10px;
  max-height: 320px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
#suggestions div { padding: 9px 14px; cursor: pointer; font-size: 0.88rem; }
#suggestions div small { color: var(--text-muted); margin-left: 6px; }
#suggestions div:hover { background: var(--navy-mid); }

/* ---------- Bunn-bar ---------- */
#bottombar {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 29;
  display: flex; gap: 4px; padding: 6px;
  background: rgba(20,28,46,0.94); backdrop-filter: blur(10px);
  border: 1px solid var(--divider); border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
#bottombar button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 74px; padding: 7px 10px; border: none; border-radius: 11px;
  background: transparent; color: var(--text-body); font: inherit; font-size: 1.05rem; cursor: pointer;
  transition: background 180ms var(--ease-out);
}
#bottombar button span { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--text-muted); }
#bottombar button.on { background: rgba(196,160,96,0.2); color: var(--gold-light); }
#bottombar button.on span { color: var(--gold-light); }
#bottombar button:active { transform: scale(0.97); }

/* ---------- Vær ---------- */
#wxDays {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 28;
  display: flex; gap: 4px; padding: 6px; max-width: calc(100vw - 16px); overflow-x: auto;
  background: rgba(20,28,46,0.94); border: 1px solid var(--divider); border-radius: 14px;
  scrollbar-width: none;
}
#wxDays::-webkit-scrollbar { display: none; }
#wxDays button {
  display: flex; flex-direction: column; align-items: center; min-width: 52px;
  padding: 5px 8px; border: none; border-radius: 9px; background: transparent;
  color: var(--text-body); font: inherit; font-size: 0.72rem; cursor: pointer; white-space: nowrap;
}
#wxDays button b { font-size: 0.78rem; color: var(--text); }
#wxDays button.on { background: var(--gold); }
#wxDays button.on b, #wxDays button.on { color: #16130c; }
.wxmark {
  background: rgba(20,28,46,0.88); border: 1px solid var(--divider); border-radius: 10px;
  padding: 2px 8px; font-size: 0.82rem; color: var(--text); white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35); pointer-events: none;
}
.wxmark b { font-weight: 600; }
#pWx { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; scrollbar-width: none; }
#pWx::-webkit-scrollbar { display: none; }
#pWx div {
  min-width: 46px; text-align: center; padding: 6px 4px; border-radius: 9px;
  background: var(--navy-card); border: 1px solid rgba(196,160,96,0.12); font-size: 0.7rem; color: var(--text-muted);
}
#pWx div b { display: block; font-size: 0.8rem; color: var(--text); font-weight: 600; }
#pWx div span { font-size: 1rem; display: block; margin: 2px 0; }

/* ---------- Stjerneliste ---------- */
#listPanel {
  position: fixed; top: 64px; left: 0; bottom: 0; width: 360px; z-index: 31;
  background: var(--navy-mid); border-right: 1px solid var(--divider);
  overflow-y: auto; transform: translateX(0); transition: transform 320ms var(--ease-out);
}
#listPanel[hidden] { display: block; transform: translateX(-105%); visibility: hidden; }
#listBody { padding: 18px; }
#listBody h2 { font-family: 'Playfair Display', serif; color: var(--text); font-size: 1.3rem; margin-bottom: 10px; }
.staritem {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 8px; margin-bottom: 6px; border: 1px solid rgba(196,160,96,0.15); border-radius: 12px;
  background: var(--navy-card); color: var(--text-body); font: inherit; cursor: pointer;
}
.staritem img { width: 64px; height: 46px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.staritem .ph { width: 64px; height: 46px; border-radius: 8px; background: var(--navy); flex-shrink: 0; }
.staritem b { color: var(--text); font-size: 0.88rem; display: block; }
.staritem small { color: var(--text-muted); font-size: 0.72rem; }
.staritem .rm { margin-left: auto; color: var(--text-muted); font-size: 1.1rem; padding: 4px 8px; }
#listBody .empty { color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Filterrad ---------- */
#filters {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 25;
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  pointer-events: none;
}
.fgroup { display: flex; gap: 6px; pointer-events: auto; }
.catscroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.catscroll::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(138,154,168,0.4);
  background: rgba(20,28,46,0.92); color: var(--text-muted); font: inherit; font-size: 0.78rem;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 180ms var(--ease-out);
}
.chip.on { color: #16130c; border-color: var(--gold-dark); background: var(--gold); font-weight: 600; }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.chip:active { transform: scale(0.97); transition-duration: 100ms; }
#starOnly.on { color: #16130c; }

/* ---------- Kart ---------- */
#map { position: fixed; inset: 0; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(20,28,46,0.7) !important; color: var(--text-muted); }
.maplibregl-ctrl-attrib a { color: var(--text-muted) !important; }

#hovercard {
  position: fixed; z-index: 28; pointer-events: none;
  background: var(--navy-card); border: 1px solid var(--divider); border-radius: 8px;
  padding: 6px 10px; font-size: 0.8rem; color: var(--text); max-width: 240px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
#hovercard small { color: var(--text-muted); display: block; }

#stats {
  position: fixed; left: 12px; bottom: 12px; z-index: 20;
  background: rgba(20,28,46,0.85); border: 1px solid var(--divider); border-radius: 8px;
  padding: 4px 10px; font-size: 0.72rem; color: var(--text-muted);
}

/* ---------- Stedspanel ---------- */
#panel {
  position: fixed; top: 64px; right: 0; bottom: 0; width: var(--panel-w); z-index: 32;
  background: var(--navy-mid); border-left: 1px solid var(--divider);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(0); transition: transform 320ms var(--ease-out);
}
#panel[hidden] { display: block; transform: translateX(105%); visibility: hidden; }
#closePanel, #closeRoute {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,28,46,0.75); color: var(--text); font-size: 1.3rem; line-height: 1;
}
#closePanel:active, #closeRoute:active { transform: scale(0.97); }

#gallery { position: relative; height: 250px; background: var(--navy-card); overflow: hidden; }
#galleryTrack { display: flex; height: 100%; transition: transform 320ms var(--ease-out); }
#galleryTrack img { width: var(--panel-w); height: 100%; object-fit: cover; flex-shrink: 0; }
#galleryTrack .noimg { width: var(--panel-w); height: 100%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.85rem; }
.gbtn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,28,46,0.65); color: var(--text); font-size: 1.25rem; line-height: 1;
}
.gbtn.prev { left: 10px; } .gbtn.next { right: 10px; }
#gCount {
  position: absolute; bottom: 8px; right: 10px; z-index: 4;
  background: rgba(20,28,46,0.75); border-radius: 999px; padding: 2px 9px; font-size: 0.7rem; color: var(--text);
}

#panelBody { padding: 16px 18px 26px; }
#pCats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
#pCats span {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px; color: #fff;
}
#pName { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.55rem; color: var(--text); line-height: 1.2; }
#pWhere { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin: 4px 0 2px; }
#pStars { color: var(--gold); font-size: 0.9rem; margin-bottom: 10px; }
#pStars .pr { color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.1em; margin-left: 8px; }
#pWhy { color: var(--text-body); margin-bottom: 14px; }

#pLinks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
#pLinks a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 10px; font-size: 0.8rem; font-weight: 500;
  text-decoration: none; color: var(--text); background: var(--navy-card);
  border: 1px solid var(--divider); transition: all 180ms var(--ease-out);
}
#pLinks a.primary { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #16130c; border: none; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  #pLinks a:hover { border-color: var(--gold); transform: translateY(-1px); }
  #pLinks a.primary:hover { filter: brightness(1.06); }
}
#pLinks a:active { transform: scale(0.97); }
.routebtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 10px; font: inherit; font-size: 0.8rem; font-weight: 500;
  color: #eaf2fb; background: #2c5c8f; border: 1px solid #4a90d9; cursor: pointer;
  transition: all 180ms var(--ease-out);
}
.routebtn:active { transform: scale(0.97); }

.psec { margin-bottom: 16px; }
.psec h3 {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 7px;
}
.psec ul { list-style: none; }
.psec li { padding-left: 16px; position: relative; margin-bottom: 4px; font-size: 0.88rem; }
.psec li::before { content: '—'; position: absolute; left: 0; color: var(--gold); }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.psec table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.psec td { padding: 4px 0; border-bottom: 1px solid rgba(196,160,96,0.12); vertical-align: top; }
.psec td:first-child { color: var(--text-muted); padding-right: 8px; white-space: nowrap; }
.uv { color: var(--text-muted); font-style: italic; }
#pAttr { font-size: 0.66rem; color: var(--text-muted); margin: 6px 0 14px; line-height: 1.5; }
#pAttr a { color: var(--text-muted); }

.favbtn {
  width: 100%; padding: 11px; border-radius: 10px; border: 1px solid var(--divider);
  background: var(--navy-card); color: var(--text-body); font: inherit; font-size: 0.85rem; cursor: pointer;
  transition: all 180ms var(--ease-out);
}
.favbtn.on { border-color: var(--gold); color: var(--gold-light); background: rgba(196,160,96,0.14); }
#pDrive { font-size: 0.85rem; color: var(--gold-light); margin: -6px 0 10px; min-height: 1.2em; }
.favbtn:active { transform: scale(0.97); }

/* ---------- Rutepanel ---------- */
#routePanel {
  position: fixed; top: 64px; left: 0; bottom: 0; width: 360px; z-index: 31;
  background: var(--navy-mid); border-right: 1px solid var(--divider);
  overflow-y: auto; transform: translateX(0); transition: transform 320ms var(--ease-out);
}
#routePanel[hidden] { display: block; transform: translateX(-105%); visibility: hidden; }
#routeBody { padding: 18px; }
#routeBody h2 { font-family: 'Playfair Display', serif; color: var(--text); font-size: 1.3rem; margin: 4px 0 2px; }
#routeBody .rmeta { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; }
#routeBody .rsum { margin: 10px 0 16px; font-size: 0.87rem; }
.leg { border-left: 2px solid var(--divider); padding: 2px 0 14px 14px; position: relative; }
.leg::before { content: ''; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.leg h4 { color: var(--text); font-size: 0.85rem; font-weight: 600; }
.leg p { font-size: 0.8rem; margin: 3px 0; }
.leg .stops { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.leg .stops button {
  border: 1px solid var(--divider); background: var(--navy-card); color: var(--text-body);
  border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 0.72rem; cursor: pointer;
}
.leg .stops button:hover { border-color: var(--gold); color: var(--text); }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  :root { --panel-w: 100vw; }
  #topbar { height: 56px; padding: 0 12px; gap: 10px; }
  .brand h1 { font-size: 0.98rem; }
  .searchwrap { max-width: none; }
  #filters { top: 56px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #filters::-webkit-scrollbar { display: none; }
  #panel, #routePanel, #listPanel { top: auto; }
  #bottombar { bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100% - 20px); justify-content: space-around; }
  #bottombar button { min-width: 0; flex: 1; }
  #listPanel { width: 100vw; bottom: 0; max-height: 65vh; border-radius: 18px 18px 0 0; border-right: none; border-top: 1px solid var(--divider); }
  #listPanel[hidden] { transform: translateY(105%); }
  #panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 72vh;
    border-left: none; border-top: 1px solid var(--divider); border-radius: 18px 18px 0 0;
    transform: translateY(0); transition: transform 320ms var(--ease-out);
  }
  #panel[hidden] { transform: translateY(105%); }
  #galleryTrack img, #galleryTrack .noimg { width: 100vw; }
  #gallery { height: 210px; }
  #routePanel { width: 100vw; top: auto; bottom: 0; max-height: 65vh; border-radius: 18px 18px 0 0; }
  #routePanel[hidden] { transform: translateY(105%); }
  #stats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
