/* Toronto Sky: a light, quiet panel over a dark map. */
@font-face { font-family: Inter; src: url("/fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --ink: #222222;
  --ink-2: #6a6a6a;
  --ink-3: #9a9a9a;
  --line: #e6e6e6;
  --panel: rgba(255, 255, 255, 0.94);
  --accent: #222222;
  --mine: #2f9fe0;
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0d11; color: var(--ink); font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
#map { position: absolute; inset: 0; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: underline; text-decoration-color: rgba(0,0,0,0.25); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

/* ---- panel ---- */
#panel {
  position: absolute; top: 16px; left: 16px; width: 344px; max-height: calc(100vh - 32px); z-index: 5;
  background: var(--panel); backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255,255,255,0.4) inset;
  padding: 26px 26px 22px; overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 26px;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.3s;
}
#panel::-webkit-scrollbar { display: none; }
#panel > * { flex-shrink: 0; } /* scroll, never squash (the photo card would collapse otherwise) */
#panel.collapsed { transform: translateX(-120%); opacity: 0; pointer-events: none; }
.top { display: flex; flex-direction: column; gap: 6px; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row h1 { flex: 1; }
h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
.sub { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #1a8a50; background: #eaf7ef; padding: 5px 11px 5px 9px; border-radius: 999px; white-space: nowrap; }
.live .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #1fbf6e; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.round { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px; }
.round:hover { border-color: var(--ink); }
.round.float { position: absolute; top: 16px; left: 16px; z-index: 5; width: 40px; height: 40px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
#recenter { top: auto; left: auto; right: 16px; bottom: 132px; }
#recenter svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
section { display: flex; flex-direction: column; gap: 12px; }
h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: 0; color: var(--ink); }
.hint { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }

/* ---- chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: var(--ink); }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.small { padding: 6px 12px; font-size: 12.5px; }

/* ---- boarding pass: the aircraft over the house ---- */
#pass { position: absolute; top: 16px; right: 16px; z-index: 5; width: 330px; display: flex; flex-direction: column; gap: 12px; }
.pass { background: #fff; border-radius: 22px; box-shadow: 0 12px 40px rgba(0,0,0,0.28); overflow: hidden; cursor: pointer; animation: rise .35s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.pass:hover { box-shadow: 0 16px 48px rgba(0,0,0,0.34); }
.pass-photo { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; background: #eceef1; }
.pass-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; font-size: 12.5px; color: var(--ink-2); }
.pass-head > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-tag { flex: none; }
.pass-head b { color: var(--ink); font-weight: 650; }
.pass-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: #eef6ff; color: #1b6fd1; }
.pass-tag.dep { background: #fff3e6; color: #c9701a; }
.pass-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 18px 6px; }
.pass-code { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.pass-code small { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pass-code.right { text-align: right; }
.pass-arrow { display: flex; align-items: center; gap: 6px; color: var(--ink-3); padding: 0 8px 14px; }
.pass-arrow i { display: block; width: 34px; height: 1px; background: var(--line); }
.pass-arrow svg { width: 18px; height: 18px; fill: var(--ink); }
.pass-tear { height: 0; border-top: 1.5px dashed var(--line); margin: 8px 0 2px; }
/* the tear notches are punched out of the card itself (a mask), so the map shows through */
.pass { --tear-y: 60%; -webkit-mask: radial-gradient(circle 10px at 0 var(--tear-y), transparent 98%, #000 100%), radial-gradient(circle 10px at 100% var(--tear-y), transparent 98%, #000 100%); -webkit-mask-composite: source-in; mask: radial-gradient(circle 10px at 0 var(--tear-y), transparent 98%, #000 100%), radial-gradient(circle 10px at 100% var(--tear-y), transparent 98%, #000 100%); mask-composite: intersect; }
.pass-facts { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 10px; padding: 12px 18px 16px; }
.pass-facts div { min-width: 0; }
.pass-facts small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; white-space: nowrap; }
.pass-facts span { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-variant-numeric: tabular-nums; }
.pass-facts .eta span { color: #1b6fd1; }
@media (max-width: 640px) { #pass { top: 12px; left: 12px; right: 12px; width: auto; } .pass-photo { aspect-ratio: 16 / 6; } .pass-code { font-size: 30px; } }

/* ---- legend ---- */
#altbar { height: 6px; border-radius: 3px; }
#altticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: -4px; }
.rings { font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rings div { display: flex; align-items: center; gap: 8px; }
.ring { flex: none; display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--mine); }
.ring.ov { border-color: var(--ink); }
footer { padding-top: 2px; font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }

/* ---- follow card over the map ---- */
#follow { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; width: min(560px, calc(100vw - 32px)); background: #fff; border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.3); animation: rise .3s cubic-bezier(.2,.8,.2,1); }
#follow-img { width: 96px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; background: #eceef1; }
.follow-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 13px; color: var(--ink-2); }
.follow-text b { font-size: 15px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#follow-route { color: var(--ink); font-weight: 600; letter-spacing: 0.02em; }
#follow-route:empty { display: none; }
.follow-actions { display: flex; gap: 6px; flex: none; }
body.following #panel { opacity: 0.35; }
body.following #panel:hover { opacity: 1; }
@media (max-width: 640px) { #follow { bottom: auto; top: 12px; } }

/* ---- toast ---- */
#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px); background: rgba(34,34,34,0.94); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,0.3); opacity: 0; transition: opacity .3s, transform .3s; z-index: 7; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- maplibre controls, tooltips ---- */
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: 0 6px 20px rgba(0,0,0,0.25) !important; }
.maplibregl-ctrl-attrib { font-size: 10px; }

@media (max-width: 640px) {
  #panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 52vh; padding: 20px 20px 16px; gap: 20px; }
  #panel.collapsed { transform: translateY(120%); }
  .round.float { top: auto; bottom: 16px; left: 16px; }
  .floating { bottom: auto; top: 14px; }
}
