/* Soft White × Navy × Gold — HK YouTube Restaurants */
:root {
  --bg: #f7f5f1;
  --bg-elev: #fffcf7;
  --ink: #1a2332;
  --ink-soft: #4a5568;
  --muted: #8a93a3;
  --navy: #1e3a5f;
  --navy-deep: #152a45;
  --blue: #2f5d9f;
  --gold: #c9a227;
  --gold-soft: #e8d48b;
  --gold-bg: #f8f1d8;
  --line: #e6e1d6;
  --shadow: 0 12px 40px rgba(26, 35, 50, 0.12);
  --radius: 16px;
  --font: "Barlow", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --s: #b45309;
  --a: #1d4ed8;
  --b: #0f766e;
  --c: #64748b;
  --stretch: #7c3aed;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.app {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  grid-template-rows: auto 1fr;
  height: 100%;
  max-height: 100dvh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(180deg, var(--bg-elev), #f3efe8);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy), var(--navy-deep));
  color: var(--gold-soft);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.35);
  flex-shrink: 0;
}
.brand-text h1 {
  margin: 0;
  font-family: var(--cond);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy-deep);
  line-height: 1.1;
}
.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.topbar-stats {
  display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end;
}
.stat-pill {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.stat-pill strong { color: var(--navy); font-weight: 600; }

.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 15;
}

.search-block { padding: 0.9rem 1rem 0.5rem; border-bottom: 1px solid var(--line); }
#search {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 93, 159, 0.15);
}
.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.65rem;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--blue); color: var(--navy); }
.chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.chip-s.active { background: var(--s); border-color: var(--s); }
.chip-a.active { background: var(--a); border-color: var(--a); }
.chip-b.active { background: var(--b); border-color: var(--b); }
.chip-c.active { background: var(--c); border-color: var(--c); }
.chip-stretch.active { background: var(--stretch); border-color: var(--stretch); }

.list-meta {
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.resto-list {
  list-style: none;
  margin: 0;
  padding: 0 0.5rem 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.resto-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.resto-item:hover, .resto-item:focus-visible {
  background: #f0ebe3;
  outline: none;
}
.resto-item.active {
  background: var(--gold-bg);
  border-color: var(--gold-soft);
}
.resto-item .names { min-width: 0; }
.resto-item .name-en {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.25;
}
.resto-item .name-zh {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}
.resto-item .meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.badge {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.badge-S { background: linear-gradient(145deg, #d97706, #92400e); box-shadow: 0 2px 8px rgba(180,83,9,0.35); }
.badge-A { background: linear-gradient(145deg, #3b82f6, #1e40af); }
.badge-B { background: linear-gradient(145deg, #14b8a6, #0f766e); }
.badge-C { background: linear-gradient(145deg, #94a3b8, #475569); }
.badge-STRETCH { background: linear-gradient(145deg, #a78bfa, #6d28d9); font-size: 0.65rem; letter-spacing: 0; padding: 0 0.15rem; }
.vid-count {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.2rem;
}

.pending-block {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px dashed var(--line);
  background: #faf7f2;
}
.pending-block h2 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.pending-block ul { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--ink-soft); }

.map-wrap {
  position: relative;
  min-height: 0;
  background: #dce3ea;
}
#map { width: 100%; height: 100%; }

.toggle-list {
  display: none;
  position: absolute;
  top: 12px; left: 12px;
  z-index: 1000;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}

/* Custom Leaflet markers */
.pin {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 4px 12px rgba(26,35,50,0.35);
  display: grid; place-items: center;
}
.pin span {
  transform: rotate(45deg);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.72rem;
  color: #fff;
  line-height: 1;
}
.pin-S { width: 40px; height: 40px; background: linear-gradient(145deg, #f59e0b, #b45309); }
.pin-S span { font-size: 0.85rem; }
.pin-A { background: linear-gradient(145deg, #60a5fa, #1d4ed8); }
.pin-B { background: linear-gradient(145deg, #2dd4bf, #0f766e); }
.pin-C { background: linear-gradient(145deg, #94a3b8, #475569); }
.pin-STRETCH { background: linear-gradient(145deg, #c4b5fd, #7c3aed); }
.pin-wrap { background: transparent !important; border: none !important; }

/* Detail sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  visibility: hidden;
}
.sheet.open {
  pointer-events: auto;
  visibility: visible;
}
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(21, 42, 69, 0.35);
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(440px, 100%);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet.open .sheet-panel { transform: translateX(0); }
.sheet-handle { display: none; }
.sheet-close {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  z-index: 2;
}
.sheet-close:hover { color: var(--ink); background: #fff; }
.sheet-body {
  padding: 1.4rem 1.35rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.sheet-kicker {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-right: 2.5rem;
}
.sheet-title {
  margin: 0;
  font-family: var(--cond);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.sheet-zh {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.sheet-facts {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin: 0.9rem 0 0;
}
.fact {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.fact strong { color: var(--navy); font-weight: 600; }
.geo-warn {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.8rem;
}
.sheet-notes {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.sheet-notes h3, .videos-head h3 {
  margin: 0 0 0.4rem;
  font-family: var(--cond);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.videos-head { margin: 1.25rem 0 0.55rem; display: flex; align-items: baseline; justify-content: space-between; }
.videos-head .count { font-size: 0.8rem; color: var(--muted); }
.video-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.video-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.video-link:hover {
  border-color: #c53030;
  box-shadow: 0 4px 16px rgba(197, 48, 48, 0.12);
  transform: translateY(-1px);
}
.yt-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: #ff0000;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.video-link .label {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}
.video-link .sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
  word-break: break-all;
}
.empty-videos {
  padding: 1rem;
  border-radius: 12px;
  background: #f3efe8;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.leaflet-container { font: inherit; background: #d8e0e8; }
.leaflet-control-zoom a {
  border-radius: 8px !important;
  color: var(--navy) !important;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: absolute;
    top: 64px; left: 0; bottom: 0;
    width: min(360px, 92vw);
    z-index: 1100;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .map-wrap { grid-column: 1; grid-row: 2; }
  .toggle-list { display: inline-flex; }
  .topbar { flex-wrap: wrap; }
  .topbar-stats { width: 100%; justify-content: flex-start; }
  .sheet-panel {
    right: 0; left: 0; top: auto; bottom: 0;
    width: 100%;
    height: min(78dvh, 640px);
    border-radius: 20px 20px 0 0;
    transform: translateY(105%);
  }
  .sheet.open .sheet-panel { transform: translateY(0); }
  .sheet-handle {
    display: block;
    width: 42px; height: 4px;
    border-radius: 999px;
    background: var(--line);
    margin: 0.65rem auto 0;
  }
}
