:root {
  --paper: #fbf4e4;
  --paper-2: #f4ead3;
  --ink: #1d1811;
  --ink-2: #5d5344;
  --ink-3: #928673;
  --line: rgba(29, 24, 17, 0.12);
  --sun: #f5a300;
  --sun-2: #ffd25e;
  --sun-soft: #fff0c7;
  --shade: #5b6b82;
  --shade-soft: #dfe4ec;
  --cloud: #b4a78f;
  --closed: #b6a9c9;
  --glass: rgba(251, 244, 228, 0.93);
  --shadow: 0 10px 40px rgba(29, 24, 17, 0.18), 0 2px 6px rgba(29, 24, 17, 0.08);
  --r: 18px;
  --display: "Fraunces", Georgia, serif;
  --ui: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font: 15px/1.4 var(--ui); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

#globe { position: fixed; inset: 0; }
.cesium-viewer-bottom { display: none; }
/* map attribution (OSM/CARTO, or Google when its 3D tiles are on) must stay visible */
#credits { position: fixed; right: 68px; bottom: 88px; z-index: 3; font-size: 10.5px; color: var(--ink-2);
  background: rgba(251, 244, 228, 0.8); padding: 2px 8px; border-radius: 6px; max-width: 60vw; }
#credits a { color: inherit; }
#credits .cesium-credit-lightbox-overlay { z-index: 30; }

/* ── brand ── */
/* desktop: sits in the top of the list panel; phone: floating pill (see media query) */
.brand {
  position: fixed; top: 30px; left: 32px; width: 344px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  z-index: 5;
}
.logo { margin: 0; line-height: 0; }
.logo img { height: 38px; width: auto; display: block; }
.disc { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--sun-2), var(--sun)); box-shadow: 0 0 0 4px rgba(245, 163, 0, 0.18); }
.now { color: var(--ink-2); font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── list panel ── */
.panel {
  position: fixed; top: 14px; left: 14px; bottom: 96px; width: 380px;
  display: flex; flex-direction: column; background: var(--glass);
  border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  z-index: 4; overflow: hidden;
}
.grip { display: none; }
.panel-head { padding: 90px 18px 10px; border-bottom: 1px solid var(--line); }
.panel h1 { font: 700 28px/1.05 var(--display); letter-spacing: -0.02em; margin: 0 0 4px; }
.sub { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; }
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #fffdf7; outline: none;
}
.search input:focus { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(245, 163, 0, 0.2); }
.ghost { border: 1px solid var(--line); background: #fffdf7; border-radius: 12px; padding: 8px 12px; font-weight: 500; }
.ghost:hover { border-color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 13px; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1; }
.row {
  display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; padding: 10px; border-radius: 12px; cursor: pointer;
}
.row:hover, .row.sel { background: rgba(255, 255, 255, 0.7); }
.row.has-img { grid-template-columns: 22px 1fr 64px; }
.row .thumb { grid-column: 3; grid-row: 1 / span 3; width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--paper-2); align-self: center; }
.row.has-img .meta, .row.has-img .strip { grid-column: 2; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--shade); }
.dot.sun { background: var(--sun); box-shadow: 0 0 0 4px rgba(245, 163, 0, 0.22); }
.dot.cloud { background: var(--cloud); }
.dot.closed { background: var(--closed); box-shadow: inset 0 0 0 2px #8a7fa0; }
.row .when.closed { color: #6f6386; }
.legend { list-style: none; margin: 0; padding: 8px 18px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; margin: 0; box-shadow: none; }
.legend .dot.closed { box-shadow: inset 0 0 0 1.5px #8a7fa0; }
.daystrip u { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(111, 99, 134, .55) 0 2px, rgba(182, 169, 201, .35) 2px 5px); }
.card .hoursline { margin: 0 0 8px; font-size: 13.5px; font-weight: 500; }
.card .big.closed { color: #6f6386; }
.row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { grid-column: 2; color: var(--ink-2); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.row .when { font-weight: 500; color: var(--ink); }
.row .when.sun { color: #9a6300; }
.strip { grid-column: 2; margin-top: 6px; }
.empty { padding: 30px 14px; color: var(--ink-2); text-align: center; }
.fineprint { margin: 0; padding: 10px 18px 14px; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
.fineprint a { color: inherit; }

.search-summary { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; }
.search-summary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.search-summary li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.search-summary .change { font-size: 13.5px; font-weight: 700; color: var(--ink); padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }
.row .when.win { color: #9a6300; font-weight: 700; }
.track b.win { position: absolute; top: -3px; bottom: -3px; border: 2px solid #fffdf7; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.logo a { display: inline-block; }

/* day strip: sun segments across the daylight span */
.daystrip { position: relative; height: 8px; border-radius: 4px; background: var(--shade-soft); overflow: hidden; }
.daystrip i { position: absolute; top: 0; bottom: 0; background: var(--sun); }
.daystrip b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); border-radius: 1px; }

/* ── map controls ── */
.mapctl {
  position: fixed; right: 14px; bottom: 120px; z-index: 4; display: flex; flex-direction: column;
  background: var(--glass); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px); overflow: hidden;
}
.mapctl button {
  width: 44px; height: 44px; border: 0; background: transparent; font: 500 22px/1 var(--ui); color: var(--ink);
  display: grid; place-items: center; touch-action: manipulation;
}
.mapctl button + button { border-top: 1px solid var(--line); }
.mapctl button:hover { background: rgba(255, 255, 255, 0.7); }
.mapctl button:active { background: var(--sun-soft); }
#north svg { transition: transform .15s; }

/* ── venue card ── */
.card {
  position: fixed; right: 14px; top: 14px; width: 340px; z-index: 6;
  background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  padding: 18px;
}
.card .photo { margin: -18px -18px 14px; position: relative; }
.card .photo img { display: block; width: 100%; height: 170px; object-fit: cover; border-radius: var(--r) var(--r) 0 0; background: var(--paper-2); }
.card .photo figcaption { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 6px; }
.card .photo + h2 { margin-top: 0; }
.card .close { z-index: 2; }
.card h2 { font: 700 24px/1.1 var(--display); margin: 0 30px 4px 0; letter-spacing: -0.01em; }
.card .close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(29, 24, 17, 0.07); font-size: 18px; line-height: 1; }
.card .kind { color: var(--ink-2); margin: 0 0 14px; font-size: 13.5px; }
.card .big { font: 700 20px/1.2 var(--display); margin: 0 0 4px; }
.card .big.sun { color: #9a6300; }
.card .note { color: var(--ink-2); font-size: 13px; margin: 0 0 14px; }
.card .daystrip { height: 14px; border-radius: 7px; }
.card .hours { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin: 4px 0 14px; }
.card .links { display: flex; gap: 8px; flex-wrap: wrap; }
.card .links a { text-decoration: none; }
.btn { display: inline-block; background: var(--ink); color: var(--paper); border-radius: 12px; padding: 9px 14px; font-weight: 500; }
.btn.book { background: var(--sun); color: var(--ink); font-weight: 700; }
.btn.alt { background: #fffdf7; color: var(--ink); border: 1px solid var(--line); }
.windows { margin: 0 0 14px; padding: 0; list-style: none; font-size: 13.5px; }
.windows li { display: inline-block; background: var(--sun-soft); border-radius: 8px; padding: 3px 8px; margin: 0 4px 4px 0; }

/* ── time bar ── */
.timebar {
  position: fixed; left: 408px; right: 14px; bottom: 14px; height: 68px; z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.days { display: flex; background: rgba(29, 24, 17, 0.06); border-radius: 12px; padding: 3px; }
.days button { border: 0; background: transparent; border-radius: 9px; padding: 6px 10px; font-size: 13px; font-weight: 500; }
.days button.on { background: #fffdf7; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.round { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--sun); color: var(--ink); font-size: 15px; box-shadow: 0 2px 8px rgba(245, 163, 0, 0.4); }
.round.on { background: var(--ink); color: var(--sun); }
.slider { position: relative; flex: 1; height: 42px; }
.track { position: absolute; left: 0; right: 0; top: 17px; height: 8px; border-radius: 4px; background: #2d3446; }
.track i:first-child { border-radius: 4px 0 0 4px; }
.track i { position: absolute; top: 0; bottom: 0; }
.slider input { position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.slider input::-webkit-slider-runnable-track { height: 42px; background: transparent; }
.slider input::-moz-range-track { background: transparent; }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: 10px; border-radius: 50%; background: #fffdf7; border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.slider input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fffdf7; border: 3px solid var(--ink); }
.slider output { position: absolute; top: -14px; transform: translateX(-50%); font: 700 13px/1 var(--ui); background: var(--ink); color: var(--paper); padding: 4px 7px; border-radius: 7px; pointer-events: none; white-space: nowrap; }


/* ── phone ── */
@media (max-width: 760px) {
  .brand {
    top: 10px; left: 10px; width: auto; max-width: calc(100% - 20px); flex-direction: row; align-items: center;
    gap: 10px; padding: 6px 12px 6px 9px; background: var(--glass); border-radius: 999px;
    box-shadow: var(--shadow); backdrop-filter: blur(10px); white-space: nowrap;
  }
  .logo img { height: 24px; }
  .now { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .panel { left: 0; right: 0; width: auto; top: auto; bottom: 0; height: 46vh; border-radius: var(--r) var(--r) 0 0; transition: height .25s; padding-bottom: 76px; }
  .panel.min { height: 262px; }
  .grip { display: block; width: 100%; height: 18px; border: 0; background: transparent; position: relative; flex: none; }
  .grip::after { content: ""; position: absolute; left: 50%; top: 7px; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--line); }
  .panel-head { padding: 0 14px 8px; }
  .panel h1 { font-size: 21px; }
  .fineprint { display: none; }
  .legend { padding: 6px 14px; font-size: 11.5px; }
  .timebar { left: 0; right: 0; bottom: 0; border-radius: 0; height: 72px; padding: 0 12px env(safe-area-inset-bottom); gap: 8px; }
  .days button { padding: 6px 7px; font-size: 12px; }
  #nowbtn { padding: 8px 9px; }
  /* phone: the card is a bottom sheet above the time bar */
  .card {
    left: 0; right: 0; top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); width: auto;
    max-height: 64vh; overflow-y: auto; border-radius: var(--r) var(--r) 0 0; padding: 18px 16px 16px;
    box-shadow: 0 -10px 30px rgba(29, 24, 17, .2); overscroll-behavior: contain;
  }
  .card .photo { margin: -18px -16px 14px; }
  .card .photo img { height: 150px; }
  .card .close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
  #credits { bottom: auto; top: 58px; right: 10px; }
  .mapctl { right: 10px; bottom: auto; top: 86px; }
  .mapctl button { width: 42px; height: 42px; }
  .card:not([hidden]) ~ #credits { display: none; }
}

/* ── boot loader: sky, the logo sun crossing an arc, real loading steps ── */
.boot {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #4fa6e0 0%, #9fd3f2 55%, #e3f2fb 100%);
  transition: opacity .45s ease, visibility .45s;
}
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-sky { position: relative; flex: 1; min-height: 200px; }
.boot-arc { position: absolute; left: 6%; right: 6%; top: 18%; width: 88%; height: 70%; }
.boot-sun {
  position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; left: 8%; top: 82%;
  animation: boot-cross 2.8s linear infinite;
  filter: drop-shadow(0 0 16px rgba(255, 250, 225, .95));
}
/* points on a parabola, so the sun rises and sets across any screen width */
@keyframes boot-cross {
  0%   { left: 8%;  top: 82%; opacity: 0; }
  8%   { opacity: 1; }
  20%  { left: 25%; top: 44%; }
  35%  { left: 39%; top: 27%; }
  50%  { left: 50%; top: 23%; }
  65%  { left: 61%; top: 27%; }
  80%  { left: 75%; top: 44%; }
  92%  { opacity: 1; }
  100% { left: 92%; top: 82%; opacity: 0; }
}
.boot-card {
  background: #fff; border-radius: 28px 28px 0 0; padding: 26px 22px calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 30px rgba(30, 80, 120, .12);
}
.boot-logo { height: 28px; width: auto; display: block; margin-bottom: 14px; }
.boot-title { font: 800 30px/1 "Fraunces", Georgia, serif; letter-spacing: -0.02em; margin: 0 0 6px; color: #1b211e; }
.boot-sub { margin: 0 0 18px; color: #4a524d; font-size: 15px; }
.boot-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.boot-steps li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #8a918c; transition: color .2s; }
.boot-steps li::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none; box-sizing: border-box;
  border: 2px solid #d6dcd9; transition: background .2s, border-color .2s;
}
.boot-steps li.busy { color: #1b211e; }
.boot-steps li.busy::before { border-color: #faae2c; border-top-color: transparent; animation: boot-spin .8s linear infinite; }
.boot-steps li.ok { color: #1b211e; }
.boot-steps li.ok::before {
  border-color: #faae2c; background: #faae2c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3 5 8.7l4.5-5' fill='none' stroke='%231b211e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (min-width: 761px) {
  .boot { align-items: center; justify-content: center; }
  .boot-sky { position: absolute; inset: 0; }
  .boot-card { position: relative; width: 400px; border-radius: 28px; box-shadow: 0 20px 60px rgba(30, 80, 120, .25); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-sun { animation: none; left: 50%; top: 23%; }
  .boot-steps li.busy::before { animation: none; }
}
