:root {
  --navy: #10202c;
  --navy-2: #1b3242;
  --ink: #14212b;
  --muted: #5e6b74;
  --yellow: #ffc53d;
  --yellow-soft: #fdf0c8;
  --gold-ink: #9a6b00;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(16, 32, 44, 0.1);
  --brand-grad: linear-gradient(110deg, #a9d8d8 0%, #c5d7b1 45%, #e9cf78 100%);
  --shadow: 0 10px 30px rgba(16, 32, 44, 0.18), 0 2px 6px rgba(16, 32, 44, 0.08);
  --r: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #dfe8e6;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 1px;
  border-radius: 6px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  font: 600 11px/1.5 Inter, sans-serif; text-align: center;
}

#map { position: fixed; inset: 0; touch-action: none; }
#weatherfx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Live weather chip */
#weatherChip {
  position: fixed; left: 16px; bottom: 40px; z-index: 2; display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(16,32,44,.12); font-size: 13px; font-weight: 700; color: var(--navy);
}
#weatherChip[hidden] { display: none; }
#weatherChip small { font-weight: 500; color: var(--muted); font-size: 12px; }
#weatherChip[aria-pressed="false"] { opacity: .6; }
#weatherChip[aria-pressed="false"] span { filter: grayscale(1); }
#weatherChip.pop { animation: pulse .5s cubic-bezier(.3,1.6,.5,1); }
.lweather { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--navy); background: var(--yellow-soft); padding: 3px 10px; border-radius: 999px; animation: swap .35s ease; }
.lweather[hidden] { display: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* ---------- building labels ---------- */
.blabel {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 6px 10px 7px; border: 0; border-radius: 12px;
  background: var(--navy); color: #fff; text-align: left;
  box-shadow: 0 6px 16px rgba(16,32,44,.28);
  transform-origin: 50% 100%; white-space: nowrap; will-change: transform;
}
.blabel::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px;
  background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px;
}
.blabel b { font: 600 12.5px/1.2 Poppins, Inter, sans-serif; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.blabel span { font-size: 11px; color: var(--yellow); font-weight: 600; }
.blabel.ghost { background: rgba(255,255,255,.85); color: var(--muted); }
.blabel.ghost span { color: var(--muted); font-weight: 500; }
.blabel:hover { background: var(--navy-2); }
.blabel.ghost:hover { background: #fff; }

/* ---------- Tilo's speech bubble ---------- */
#bubble {
  position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; max-width: 240px; width: max-content;
  padding: 8px 12px; border-radius: 16px; background: #fff; color: var(--ink); border: 2px solid var(--ink);
  font: 600 13px/1.35 Inter, sans-serif; box-shadow: 0 6px 18px rgba(16,32,44,.2);
  opacity: 0; transition: opacity .18s; margin-top: -10px;
}
#bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: #fff;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateX(-50%) rotate(45deg);
}
#bubble.show { opacity: 1; }

/* ---------- top HUD ---------- */
.top {
  position: fixed; top: 16px; left: 16px; width: min(560px, calc(100vw - 32px));
  padding: 14px; border-radius: 24px; background: var(--brand-grad);
  box-shadow: var(--shadow); display: grid; gap: 10px; z-index: 5;
  transition: transform .45s cubic-bezier(.3,.9,.3,1), opacity .3s;
}
.brand { display: flex; align-items: center; gap: 8px; font: 700 15px Poppins, sans-serif; color: var(--navy); }
.brand em { font-style: normal; font-weight: 600; opacity: .6; }
.searchwrap { position: relative; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px;
  padding: 5px 5px 5px 14px; box-shadow: 0 1px 0 rgba(16,32,44,.06);
}
.search > svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
#q { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 15px; padding: 9px 0; background: transparent; }
#q::placeholder { color: #8a949b; }
#q::-webkit-search-cancel-button { display: none; }
#locate {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--navy); display: grid; place-items: center;
}
#locate svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
#locate:hover { background: var(--navy-2); }
#suggest {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px;
  list-style: none; background: #fff; border-radius: 14px; box-shadow: var(--shadow);
}
#suggest li { padding: 9px 12px; border-radius: 9px; font-size: 14px; cursor: pointer; }
#suggest li:hover, #suggest li.on { background: var(--yellow-soft); }
.types { display: flex; gap: 8px; }
.type {
  border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.45);
  padding: 7px 14px; border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--navy);
}
.type.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.type:disabled { cursor: default; opacity: .75; }
.type small { font-weight: 500; font-size: 10px; opacity: .7; margin-left: 2px; }

/* ---------- filters ---------- */
.filters {
  position: fixed; left: 16px; top: 176px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  max-width: calc(100vw - 32px); z-index: 4;
  transition: transform .45s cubic-bezier(.3,.9,.3,1) .04s, opacity .3s;
}
.filters select:disabled { opacity: .55; cursor: default; }

/* ---------- tucked search bar + handle ---------- */
body.tucked .top, body.tucked .filters { transform: translateY(calc(-100% - 200px)); opacity: 0; pointer-events: none; }
.handle {
  position: fixed; top: 12px; left: 16px; z-index: 6; display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 180px); padding: 9px 14px; border: 0; border-radius: 999px;
  background: var(--brand-grad); color: var(--navy); box-shadow: var(--shadow); font-size: 13.5px;
  transform: translateY(-80px); opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.3,.9,.3,1) .1s, opacity .25s .1s;
}
body.tucked .handle { transform: none; opacity: 1; pointer-events: auto; }
.handle:hover { filter: brightness(1.04); }
.handle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.handle .hplace { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.handle .hmeta { white-space: nowrap; opacity: .75; }
.handle .hdot { width: 8px; height: 8px; border-radius: 50%; background: #ff9a1a; flex: none; }
.handle .hdot[hidden] { display: none; }
.handle .chev { width: 15px; height: 15px; opacity: .7; }
.filters select, .filters > button {
  appearance: none; border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(8px);
  padding: 8px 30px 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: 0 2px 8px rgba(16,32,44,.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2310202c' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.filters > button { padding-right: 12px; background-image: none; }
.filters select.set, .filters > button[aria-pressed="true"] { background-color: var(--navy); color: #fff; border-color: var(--navy); }
.filters select.set {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E");
}
.filters select option { color: var(--ink); background: #fff; }
.count { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--yellow); padding: 5px 10px; border-radius: 999px; }

/* ---------- radar ---------- */
#radar {
  position: fixed; top: 16px; right: 16px; width: 124px; height: 124px; border-radius: 50%;
  box-shadow: var(--shadow); border: 3px solid rgba(255,255,255,.85);
}

.views { position: fixed; top: 60px; right: 150px; display: flex; gap: 8px; }
.views button {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px rgba(16,32,44,.12);
}
.views svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.views button:hover { background: var(--yellow-soft); }
.views button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
#recommended svg { stroke: #d99a00; }
#recommended[aria-pressed="true"] svg { fill: var(--yellow); stroke: var(--yellow); }
.rec { font-style: normal; color: #e0a100; }
.pill.rec { background: var(--yellow); color: var(--navy); font-weight: 600; }

/* Tilo asking a question */
#bubble.asking { pointer-events: auto; max-width: 290px; }
.ask-btns { display: flex; gap: 6px; margin-top: 8px; }
.ask-btns button {
  flex: 1; border: 0; border-radius: 10px; padding: 7px 8px; font: 600 12.5px Inter, sans-serif; white-space: nowrap;
  background: #f1f1ee; color: var(--ink);
}
.ask-btns button[data-a="yes"] { background: var(--navy); color: #fff; }
.ask-btns kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); font-size: 10px; }
.ask-btns button[data-a="no"] kbd { background: #fff; border-color: #ddd; }

/* Overview: labels collapse to count pins, full label on hover */
.blabel .pin { display: none; }
#labels.compact .blabel { padding: 0; border-radius: 999px; background: transparent; box-shadow: none; }
#labels.compact .blabel::after { display: none; }
#labels.compact .blabel b, #labels.compact .blabel span { display: none; }
#labels.compact .blabel .pin {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  background: var(--navy); color: var(--yellow); font: 700 12px/1 Inter, sans-serif; font-style: normal;
  box-shadow: 0 3px 10px rgba(16,32,44,.3); border: 2px solid #fff;
}
#labels.compact .blabel.ghost .pin { background: #fff; color: var(--muted); border-color: #d8dcde; }
#labels.compact .blabel:hover { z-index: 20000 !important; padding: 6px 10px 7px; border-radius: 12px; background: var(--navy); }
#labels.compact .blabel:hover .pin { display: none; }
#labels.compact .blabel:hover b, #labels.compact .blabel:hover span { display: block; }

/* Room badge when the floor isn't known: show seats instead */
.fl.seats { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; line-height: 1; }
.fl.seats small { display: block; font: 500 8.5px/1 Inter, sans-serif; opacity: .8; }

/* ---------- side panel ---------- */
#panel {
  position: fixed; right: 16px; top: 156px; bottom: 84px; width: 340px;
  background: var(--card); backdrop-filter: blur(12px); border-radius: var(--r); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .45s cubic-bezier(.3,.9,.3,1), opacity .3s;
}
/* The list's own collapse control: a chevron in the header (desktop), a grab bar (phones). */
#panelGrab {
  position: absolute; top: 14px; right: 12px; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
#panelGrab:hover { background: var(--yellow-soft); }
#panelGrab svg { width: 16px; height: 16px; fill: none; stroke: var(--navy); stroke-width: 2.4; transition: transform .3s; }
#panelGrab i { display: none; }
#panelBody { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#panel .ph { padding-right: 54px; }
body.panel-peek #panel { bottom: auto; }
body.panel-peek #panelBody > :not(.ph) { display: none; }
body.panel-peek #panel .ph { border-bottom: 0; cursor: pointer; }
body.panel-peek #panelGrab svg { transform: rotate(180deg); }

/* ---------- keys: ⌨ button above the weather pill, panel pops up for a few seconds ---------- */
#keysBtn {
  position: fixed; left: 16px; bottom: 84px; z-index: 3; width: 40px; height: 40px; border-radius: 12px; border: 0;
  display: grid; place-items: center; background: rgba(16,32,44,.86); color: var(--yellow); font-size: 19px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px); transition: transform .2s;
}
#keysBtn:hover { transform: translateY(-2px); }
#soundBtn {
  position: fixed; left: 64px; bottom: 84px; z-index: 3; width: 40px; height: 40px; border-radius: 12px; border: 0;
  display: grid; place-items: center; background: rgba(16,32,44,.86); font-size: 17px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px); transition: transform .2s, opacity .2s;
}
#soundBtn:hover { transform: translateY(-2px); }
#soundBtn svg { width: 20px; height: 20px; fill: none; stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
#soundBtn svg .spk { fill: var(--yellow); }
#soundBtn[aria-pressed="false"] { opacity: .65; }
/* No ⌨ button on touch/narrow screens, so the sound button takes its spot */
body.touch #soundBtn { left: 16px; }
#keysBtn[aria-expanded="true"] { background: var(--navy); box-shadow: 0 0 0 2px var(--yellow), var(--shadow); }
#keys {
  position: fixed; left: 16px; bottom: 134px; z-index: 3; width: max-content; min-width: 220px;
  background: rgba(16,32,44,.9); color: #fff; border-radius: 16px; backdrop-filter: blur(8px); box-shadow: var(--shadow);
  transform-origin: 20px 100%; transform: translateY(8px) scale(.9); opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.3,1.3,.5,1), opacity .2s;
}
#keys.open { transform: none; opacity: 1; pointer-events: auto; }
#keys header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 11px 14px 8px; }
#keys header b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--yellow); }
#keys .kmode { font-size: 11.5px; opacity: .7; white-space: nowrap; }
#keys .klist { display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; align-items: center; margin: 0; padding: 2px 14px 14px; font-size: 12.5px; }
#keys dt { display: flex; gap: 3px; justify-content: flex-end; }
#keys dd { margin: 0; opacity: .9; white-space: nowrap; }
#keys kbd { min-width: 22px; }
/* Keyboard help only makes sense with a keyboard */
body.touch #keys, body.touch #keysBtn, body.touch #modeSwitch { display: none; }
@media (max-width: 760px) { #keys, #keysBtn { display: none; } }

/* ---------- mode switch (bottom right): Tilo Tour ↔ Pilot ---------- */
#modeSwitch {
  position: fixed; right: 16px; bottom: 20px; z-index: 4; display: grid; grid-template-columns: 1fr 1fr;
  padding: 4px; border-radius: 999px; background: var(--card); backdrop-filter: blur(10px);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
#modeSwitch button {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 0; background: none; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--navy);
  white-space: nowrap; transition: color .25s;
}
#modeSwitch button[aria-checked="true"] { color: #fff; }
#modeSwitch .knob {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--navy);
  box-shadow: 0 2px 8px rgba(16,32,44,.3); transition: transform .35s cubic-bezier(.3,1.3,.5,1), background .25s;
}
#modeSwitch.is-pilot .knob { transform: translateX(100%); background: #0e7c8c; }

/* ---------- pilot view (first-person cockpit) ---------- */
body.pilot #panel, body.pilot #labels .blabel.ghost { opacity: 0; pointer-events: none; }
body.pilot #panel { transform: translateX(calc(100% + 24px)); }
body.pilot #pad { bottom: 190px; }
body.pilot #modeSwitch { bottom: 150px; }
body.pilot .views, body.pilot #searchHandle { display: none; }
#cockpit { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
#cockpit[hidden] { display: none; }
.ck-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, transparent 60%, rgba(16,32,44,.35) 100%),
    linear-gradient(to bottom, rgba(16,32,44,.18), transparent 12%);
}
/* Plane nose + propeller, banking a little against the turn */
.ck-nose {
  position: absolute; left: 50%; bottom: -8px; width: min(760px, 110vw); margin-left: calc(min(760px, 110vw) / -2);
  transform-origin: 50% 100%; transition: transform .1s linear;
}
.ck-nose svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 -6px 18px rgba(16,32,44,.25)); }
.ck-prop {
  --spin: .3s;
  position: absolute; left: 50%; top: 45%; width: 54%; aspect-ratio: 1; transform: translate(-50%, -50%);
}
.ck-prop .blur {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(248,214,109,.0) 12%, rgba(248,214,109,.16) 40%, rgba(248,214,109,.28) 68%, rgba(248,214,109,0) 71%);
}
.ck-prop .blade {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 7%; margin-left: -3.5%; border-radius: 50%;
  background: linear-gradient(to bottom, rgba(248,214,109,.55), rgba(248,214,109,.08) 45%, rgba(248,214,109,.08) 55%, rgba(248,214,109,.55));
  animation: propspin var(--spin) linear infinite;
}
.ck-prop .b2 { animation-delay: calc(var(--spin) / -4); }
@keyframes propspin { to { transform: rotate(360deg); } }
.ck-dash {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 10px;
}
.gauge {
  width: 92px; padding: 7px 6px 6px; border-radius: 14px; background: rgba(16,32,44,.9); color: #fff; text-align: center;
  border: 2px solid #111; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
  display: grid; justify-items: center; line-height: 1.1;
}
.gauge small { font-size: 9.5px; letter-spacing: .08em; opacity: .7; }
.gauge b { font: 700 22px/1.15 Poppins, sans-serif; color: var(--yellow); font-variant-numeric: tabular-nums; }
/* Compass tape across the top */
.ck-compass {
  position: absolute; top: 12px; left: 50%; width: min(420px, 70vw); height: 34px; transform: translateX(-50%);
  overflow: hidden; border-radius: 10px; background: rgba(16,32,44,.72); border: 2px solid #111;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.ck-tape { position: absolute; left: 50%; top: 0; bottom: 0; }
.ck-tape span { position: absolute; top: 0; transform: translateX(-50%); }
.ck-tape .lbl { top: 7px; font: 700 13px Inter, sans-serif; color: #fff; }
.ck-tape .tick { top: 4px; width: 2px; height: 8px; background: rgba(255,255,255,.45); }
.ck-caret { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; margin-left: -6px; border: 6px solid transparent; border-bottom-color: var(--yellow); }
/* Target readout */
.ck-target {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 8px; border-radius: 14px; background: rgba(16,32,44,.82); color: #fff; max-width: min(420px, 86vw);
}
.ck-target[hidden] { display: none; }
.ck-target .ck-arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-size: 14px; flex: none; transition: transform .15s linear; }
.ck-target b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-target small { font-size: 12px; color: var(--yellow); }
.ck-target.in-range { box-shadow: 0 0 0 2px var(--yellow), 0 0 22px rgba(255,197,61,.5); }
/* Tilo on the radio */
.ck-radio {
  position: absolute; top: 112px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 16px; background: #fff; border: 2px solid var(--ink); max-width: min(440px, 90vw);
  box-shadow: 0 8px 22px rgba(16,32,44,.25);
}
.ck-radio[hidden] { display: none; }
.ck-radio.in { animation: swap .3s ease; }
.ck-radio img { width: 40px; height: auto; flex: none; }
.ck-radio small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.ck-radio p { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; }
@media (max-width: 760px) {
  .gauge { width: 74px; }
  .gauge b { font-size: 18px; }
  .ck-compass { top: 12px; width: 52vw; left: 12px; transform: none; }
  .ck-target { top: 58px; }
  .ck-radio { top: 112px; }
}

/* ---------- shortlist ---------- */
.views .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff5a6e; color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
}
.views .badge[hidden] { display: none; }
#shortlistBtn svg { stroke: #ff5a6e; }
#shortlistBtn.pulse { animation: pulse .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes pulse { 40% { transform: scale(1.15); } }
.dir li { position: relative; }
.heart {
  position: absolute; right: 8px; top: 10px; z-index: 1; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: #ff5a6e; font-size: 18px; line-height: 1;
}
.heart:hover { background: rgba(255,90,110,.1); }
.heart[aria-pressed="true"] { animation: pulse .4s; }
.dir .row { padding-right: 40px; }
.dbtns { display: flex; gap: 8px; }

#compare {
  width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 22px;
  box-shadow: 0 30px 80px rgba(16,32,44,.4); overflow: hidden; flex-direction: column; background: #fff;
}
#compare[open] { display: flex; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
#compare::backdrop { background: rgba(16,32,44,.45); backdrop-filter: blur(3px); }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cmp-head h2 { margin: 0; font: 600 19px Poppins, sans-serif; }
.cmp-head h2::first-letter { color: #ff5a6e; }
.cmp-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.cmp-actions { display: flex; align-items: center; gap: 8px; }
.linkbtn { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; }
.xbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
.cmp-verdict { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 20px; background: var(--yellow-soft); font-size: 13.5px; }
.cmp-verdict img { width: 44px; height: auto; flex: none; }
.cmp-scroll { overflow: auto; flex: 1; }
.cmp { border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 100%; }
.cmp th, .cmp td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp tbody th { position: sticky; left: 0; z-index: 1; background: #fbfaf7; color: var(--muted); font-weight: 500; white-space: nowrap; width: 140px; }
.cmp thead th { position: sticky; top: 0; z-index: 2; background: #fff; vertical-align: bottom; }
.cmp thead th.corner { left: 0; z-index: 3; background: #fbfaf7; }
.cmp td { min-width: 190px; }
.cmp th.pick { background: var(--yellow-soft); }
.cmp-card { position: relative; display: grid; gap: 3px; width: 190px; }
.cmp-card img, .cmp-card .nophoto { width: 100%; height: 110px; object-fit: cover; border-radius: 12px; background: #eee; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.cmp-card b { font-size: 14px; margin-top: 4px; }
.cmp-card small { font-weight: 500; font-size: 12px; }
.cmp-card .rm {
  position: absolute; top: 6px; right: 6px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.pickbadge { position: absolute; top: 84px; left: 8px; background: var(--navy); color: var(--yellow); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12.5px; }
.na { color: #b7bcc0; }
.yes { color: #1a8f5a; font-weight: 600; }
.best { display: inline-block; margin-left: 6px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--navy); background: var(--yellow); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.cmp tr.section th { color: var(--navy); font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .05em; }
.cmp tr.acts td { display: table-cell; }
.cmp tr.acts .btn { display: flex; width: 100%; margin-bottom: 6px; padding: 8px 10px; font-size: 13px; }
.cmp-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 30px 24px 40px; }
.cmp-empty img { width: 150px; }
.cmp-empty h3 { margin: 6px 0 0; font: 600 18px Poppins, sans-serif; }
.cmp-empty p { margin: 0; color: var(--muted); max-width: 360px; font-size: 14px; }
.cmp-empty kbd { color: var(--navy); background: #f3f1ea; border-color: #ddd; }
.ph { display: flex; gap: 10px; align-items: flex-start; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.ph h2 { margin: 0; font: 600 16px/1.25 Poppins, sans-serif; }
.ph p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.back {
  flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 16px;
}
.back:hover { background: var(--yellow-soft); }
.blist, .dir { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.blist button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 12px;
  background: transparent; text-align: left;
}
.blist button:hover { background: var(--yellow-soft); }
.blist button.ghost { opacity: .5; }
.bic {
  flex: none; width: 26px; height: 34px; border-radius: 5px; position: relative; overflow: hidden;
  background: repeating-linear-gradient(to top, #f4d77f 0 5px, #fff 5px 6.5px); box-shadow: inset 0 0 0 1px rgba(16,32,44,.12);
}
.blist .ghost .bic { background: repeating-linear-gradient(to top, #d0d4d6 0 5px, #fff 5px 6.5px); }
.bt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bt b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt small { font-size: 12px; color: var(--muted); }
.bm { flex: none; text-align: right; font-size: 12.5px; display: flex; flex-direction: column; }
.bm small { color: var(--muted); font-size: 11.5px; }

.dir li { border-radius: 14px; margin-bottom: 4px; }
.dir li.on { background: var(--yellow-soft); box-shadow: inset 0 0 0 1.5px #f1c65a; }
.dir li.ghost { opacity: .5; }
.row { width: 100%; display: flex; gap: 12px; align-items: center; padding: 10px; border: 0; background: transparent; text-align: left; border-radius: 14px; }
.dir li:not(.on) .row:hover { background: rgba(16,32,44,.05); }
.fl {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  background: var(--navy); color: var(--yellow); font: 700 13px Poppins, sans-serif;
}
.dir li.on .fl { background: #ff9a1a; color: #fff; }
.bolt { font-style: normal; }
.act { padding: 0 10px 10px; display: grid; gap: 10px; }
.dir li:not(.on) .act { display: none; }
.act img { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; background: #eee; }
.btns { display: flex; gap: 8px; }
.btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 13.5px; text-decoration: none; border: 0;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghostbtn { background: #fff; border: 1px solid var(--line); }
.btn.ghostbtn kbd { background: var(--yellow-soft); border-color: #f1c65a; color: var(--gold-ink); }
.btn.big { padding: 14px 22px; font-size: 15px; flex: none; }

/* ---------- prompt ---------- */

/* ---------- touch pad ---------- */
#pad { display: none; }
body.touch #pad {
  position: fixed; left: 16px; bottom: 84px; display: grid; gap: 6px;
  grid-template: 'a u b' 'l e r' 'c d f' / 48px 48px 48px;
}
#pad button { width: 48px; height: 48px; border-radius: 14px; border: 0; background: rgba(16,32,44,.85); color: #fff; font-size: 16px; touch-action: none; }
#pad [data-k=up] { grid-area: u; } #pad [data-k=left] { grid-area: l; } #pad [data-k=right] { grid-area: r; }
#pad [data-k=down] { grid-area: d; } #pad [data-act] { grid-area: e; background: var(--yellow); color: var(--navy); }

/* ---------- details dialog ---------- */
#details {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 22px;
  box-shadow: 0 30px 80px rgba(16,32,44,.4); overflow: hidden; flex-direction: column;
}
#details[open] { display: flex; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
#details::backdrop { background: rgba(16,32,44,.45); backdrop-filter: blur(3px); }
@keyframes pop { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.close { position: absolute; top: 12px; right: 12px; z-index: 2; margin: 0; }
.close button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.gallery { position: relative; height: 260px; flex: none; background: #e8e6df; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nophoto { height: 100%; display: grid; place-items: center; color: var(--muted); }
.gnav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); font-size: 22px; line-height: 1;
}
.gnav.prev { left: 12px; } .gnav.next { right: 12px; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); }
.dots i.on { background: #fff; }
.floorbadge { position: absolute; left: 14px; bottom: 12px; background: #ff9a1a; color: #fff; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.dbody { padding: 18px 22px 8px; overflow-y: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 10px; border-radius: 999px; background: var(--yellow-soft); color: var(--gold-ink); font-size: 12.5px; font-weight: 500; }
.pill.instant { background: var(--navy); color: #fff; }
.pill small { opacity: .7; }
.dbody h2 { font: 600 22px/1.25 Poppins, sans-serif; margin: 10px 0 4px; }
.addr { margin: 0; color: var(--muted); font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 16px 0 6px; }
.stats div { padding: 10px 12px; border-radius: 12px; background: #f5f3ee; display: flex; flex-direction: column; }
.stats small { color: var(--muted); font-size: 11.5px; }
.stats b { font: 600 17px Poppins, sans-serif; }
.dbody h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.dbody p { margin: 0; font-size: 14px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; }
.desc { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.note { margin-top: 12px !important; padding: 10px 12px; border-radius: 10px; background: var(--yellow-soft); font-size: 13px !important; }
.dfoot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; border-top: 1px solid var(--line); background: #fff;
}
.dfoot b { font: 700 22px Poppins, sans-serif; }
.dfoot small { color: var(--muted); }

/* ---------- toast + boot ---------- */
#toast {
  position: fixed; top: 20px; left: 50%; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- loader: Tilo flying through the clouds ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  opacity: 0; transition: opacity .35s ease;
}
.loader[hidden] { display: none; }
.loader.in { opacity: 1; }
.loader.full {
  background:
    radial-gradient(circle, rgba(16,32,44,.07) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    var(--brand-grad);
}
.loader.card { background: rgba(16,32,44,.28); backdrop-filter: blur(2px); }

.lcard { width: min(560px, 100%); display: grid; justify-items: center; text-align: center; }
.loader.card .lcard {
  width: min(420px, 100%); background: #fff; border-radius: 26px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(16,32,44,.35); padding-bottom: 20px;
  transform: translateY(14px) scale(.97); transition: transform .35s cubic-bezier(.2,.9,.3,1.2);
}
.loader.card.in .lcard { transform: none; }

.sky { position: relative; width: 100%; height: 250px; overflow: hidden; }
.loader.full .lcard { padding-top: 250px; position: relative; }
.loader.full .sky { position: absolute; top: 0; left: 50%; width: 100vw; transform: translateX(-50%); }
.loader.card .sky { height: 170px; background: var(--brand-grad); }

/* Clouds drift right-to-left at different speeds for parallax */
.cloud {
  position: absolute; left: 100%; width: 110px; height: 34px; border-radius: 40px; background: #fff; opacity: .9;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 50px; height: 50px; left: 16px; top: -24px; }
.cloud::after { width: 38px; height: 38px; left: 52px; top: -16px; }
.c1 { top: 22%; animation-duration: 7s; }
.c2 { top: 64%; animation-duration: 10s; animation-delay: -4s; transform: scale(.7); opacity: .75; }
.c3 { top: 8%; animation-duration: 13s; animation-delay: -9s; transform: scale(.5); opacity: .6; }
.c4 { top: 80%; animation-duration: 5.5s; animation-delay: -2s; transform: scale(1.2); }
@keyframes drift { to { left: -40%; } }

/* Ink speed lines, like the logo */
.streak {
  position: absolute; left: 60%; height: 3px; border-radius: 3px; background: var(--ink); opacity: 0;
  animation: streak 1.1s linear infinite;
}
.s1 { top: 44%; width: 90px; }
.s2 { top: 55%; width: 60px; animation-delay: -.4s; }
.s3 { top: 62%; width: 110px; animation-delay: -.75s; }
.s4 { top: 50%; width: 40px; animation-delay: -.2s; }
@keyframes streak {
  0% { left: 38%; opacity: 0; }
  15% { opacity: .7; }
  100% { left: -10%; opacity: 0; }
}

.spark { position: absolute; font-style: normal; color: #f5b400; animation: twinkle 1.6s ease-in-out infinite; }
.k1 { top: 16%; left: 70%; font-size: 22px; }
.k2 { top: 30%; left: 22%; font-size: 14px; animation-delay: -.5s; color: #5ccfe0; }
.k3 { top: 74%; left: 78%; font-size: 16px; animation-delay: -1s; }
@keyframes twinkle { 50% { transform: scale(.4) rotate(40deg); opacity: .4; } }

/* Tilo: flies in, bobs, then zooms off when loading is done */
.flyer {
  position: absolute; left: 50%; top: 50%; width: 320px;
  transform: translate(-50%, -50%);
}
.loader.card .flyer { width: 220px; }
.loader.in .flyer { animation: flyin .9s cubic-bezier(.2,.8,.25,1); }
@keyframes flyin { from { transform: translate(-50%, -50%) translateX(-110vw); } }
.loader.exit .flyer { transform: translate(-50%, -50%) translate(110vw, -70px) rotate(-10deg); transition: transform .65s cubic-bezier(.5,0,.9,.4); }
.flyer img { width: 100%; display: block; animation: bob 1.7s ease-in-out infinite; transform-origin: 60% 60%; }
@keyframes bob {
  0%, 100% { transform: translateY(-7px) rotate(-2deg); }
  50% { transform: translateY(7px) rotate(1.5deg); }
}

.ltitle { margin: 4px 0 0; font: 700 24px/1.2 Poppins, sans-serif; color: var(--navy); padding: 0 16px; }
.loader.card .ltitle { font-size: 19px; margin-top: 16px; }
.lstatus { margin: 6px 0 0; min-height: 1.5em; font-size: 15px; font-weight: 500; color: var(--navy); opacity: .8; padding: 0 16px; }
.lstatus.swap { animation: swap .35s ease; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } }

/* Flight-path progress bar with a mini Tilo riding the leading edge */
.route { display: flex; align-items: center; gap: 10px; width: min(420px, 100% - 32px); margin-top: 18px; }
.route:not(.named) .from, .route:not(.named) .to { display: none; }
.from, .to { font-size: 12px; font-weight: 600; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to { color: var(--navy); }
.track {
  position: relative; flex: 1; height: 12px; border-radius: 99px;
  background: repeating-linear-gradient(90deg, rgba(16,32,44,.16) 0 10px, transparent 10px 16px), rgba(255,255,255,.55);
  box-shadow: inset 0 0 0 1px rgba(16,32,44,.08);
}
.loader.card .track { background: repeating-linear-gradient(90deg, rgba(16,32,44,.14) 0 10px, transparent 10px 16px), #f1efe8; }
.fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px;
  background: repeating-linear-gradient(-45deg, #ffc53d 0 10px, #ffd76e 10px 20px);
  background-size: 28px 28px; animation: stripes .6s linear infinite;
  box-shadow: 0 0 12px rgba(255,197,61,.6);
}
@keyframes stripes { to { background-position: 28px 0; } }
.mini {
  position: absolute; top: 50%; left: 0; width: 46px; transform: translate(-40%, -62%);
  animation: minibob .9s ease-in-out infinite; pointer-events: none;
}
@keyframes minibob { 50% { margin-top: -3px; } }

.ltip { margin: 18px 0 0; font-size: 13px; color: var(--navy); opacity: .85; padding: 0 16px; min-height: 1.6em; }
.ltip span {
  display: inline-block; margin-right: 4px; padding: 2px 7px; border-radius: 6px; background: var(--navy); color: var(--yellow);
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px;
}
.ltip kbd { background: rgba(16,32,44,.08); border-color: rgba(16,32,44,.18); color: var(--navy); }

@media (max-width: 760px) {
  .sky { height: 200px; }
  .loader.full .lcard { padding-top: 200px; }
  .flyer { width: 250px; }
  .ltitle { font-size: 20px; }
}

.maplibregl-ctrl-bottom-left { bottom: 4px; left: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  #panel { width: 300px; }
}
@media (max-width: 760px) {
  .top { top: 10px; left: 10px; width: calc(100vw - 20px); padding: 10px; gap: 8px; border-radius: 20px; }
  .brand { display: none; }
  .types { overflow-x: auto; }
  .type { white-space: nowrap; padding: 6px 12px; }
  .filters { top: 132px; left: 10px; right: 90px; }
  .filters select, .filters > button { padding-top: 6px; padding-bottom: 6px; font-size: 12px; }
  #radar { top: 132px; right: 10px; width: 72px; height: 72px; }
  .views { top: 212px; right: 10px; flex-direction: column; }
  .views button { padding: 6px 9px; }
  .views span { display: none; }
  #panel { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 36vh; }
  body.touch #pad { left: auto; right: 10px; bottom: calc(36vh + 64px); grid-template-columns: 42px 42px 42px; }
  #pad button { width: 42px; height: 42px; }
  .gallery { height: 200px; }
  .handle { top: 10px; left: 10px; max-width: calc(100vw - 110px); }
  #modeSwitch { display: none; } /* Pilot mode isn't available on phones yet */
  #weatherChip { left: 10px; bottom: auto; top: 60px; padding: 5px 10px; }
  #weatherChip small { display: none; }
  #soundBtn, body.touch #soundBtn { left: 10px; bottom: auto; top: 102px; width: 36px; height: 36px; font-size: 15px; }
  body.tucked #radar { top: 10px; }
  body.tucked .views { top: 90px; }
  /* Bottom sheet: a grab bar across the top of the sheet collapses it to the title strip. */
  #panelGrab { top: 0; left: 0; right: 0; width: auto; height: 22px; border: 0; border-radius: 0; background: transparent; }
  #panelGrab:hover { background: transparent; }
  #panelGrab svg { display: none; }
  #panelGrab i { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(16,32,44,.22); }
  #panel .ph { padding-top: 22px; padding-right: 16px; }
  body.panel-peek #panel { max-height: none; bottom: 10px; }
  body.touch.panel-peek #pad { bottom: 110px; }
  .cmp td, .cmp-card { min-width: 150px; width: 150px; }
  .cmp tbody th { width: 96px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
