:root {
  color-scheme: light;
  --ink: #162033;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(15, 23, 42, 0.12);
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --surface: #f8fafc;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.16),
      transparent 30%
    ),
    linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #e0f2fe 100%);
}

#map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

#menu {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(320px, 1.4fr);
  gap: 18px;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 68px 18px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition:
    width 180ms ease,
    padding 180ms ease,
    box-shadow 180ms ease;
}

#menu.is-minimised {
  left: auto;
  right: 82px;
  width: 54px;
  padding: 6px;
  grid-template-columns: 1fr;
  gap: 0;
}

#menu.is-minimised #people,
#menu.is-minimised #controls {
  display: none;
}

#menu-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid rgba(102, 112, 133, 0.24);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

#menu-toggle::before,
#menu-toggle::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

#menu-toggle::after {
  width: 2px;
  height: 16px;
  opacity: 0;
}

#menu.is-minimised #menu-toggle {
  position: static;
}

#menu.is-minimised #menu-toggle::after {
  opacity: 1;
}

#menu-toggle:hover {
  transform: translateY(-1px);
}

#people {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 44px;
  max-height: 160px;
  overflow: auto;
  padding: 2px;
}

#people:empty::before {
  content: "Added friends will appear here";
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed rgba(102, 112, 133, 0.35);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

#people button,
#controls button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

#people button {
  padding: 9px 13px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: #eff6ff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

#people button[style*="blue"] {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eff6ff;
  color: #1d4ed8 !important;
}

#people button[style*="red"] {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff1f2;
  color: #b42318 !important;
}

#people button:hover,
#controls button:hover {
  transform: translateY(-1px);
}

#people button:focus-visible,
#controls button:focus-visible,
#menu-toggle:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

#controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto auto;
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(102, 112, 133, 0.28);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}

input::placeholder {
  color: #98a2b3;
}

input:focus {
  border-color: rgba(37, 99, 235, 0.75);
  background: #ffffff;
}

#controls button {
  padding: 0 16px;
  white-space: nowrap;
}

#submit {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
}

#submit:hover {
  background: var(--accent-dark);
}

#reload {
  border: 1px solid rgba(102, 112, 133, 0.24);
  background: #ffffff;
  color: var(--ink);
}

#find-restaurants {
  border: 1px solid rgba(13, 148, 136, 0.18);
  background: #ccfbf1;
  color: #0f766e;
}

#restaurant-sidebar {
  position: fixed;
  top: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 6;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  width: min(360px, calc(100% - 48px));
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

#restaurant-sidebar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.restaurant-sidebar-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.restaurant-sidebar-eyebrow {
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#restaurant-sidebar-title {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.2;
}

#restaurant-sidebar-close {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 1px solid rgba(102, 112, 133, 0.24);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

#restaurant-sidebar-close::before,
#restaurant-sidebar-close::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

#restaurant-sidebar-close::before {
  transform: rotate(45deg);
}

#restaurant-sidebar-close::after {
  transform: rotate(-45deg);
}

#restaurant-results {
  min-height: 0;
  overflow: auto;
}

.restaurant-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.restaurant-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restaurant-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.restaurant-name {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
}

.restaurant-name:hover {
  color: var(--accent);
}

.restaurant-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  #menu {
    right: 14px;
    bottom: 14px;
    left: 14px;
    grid-template-columns: 1fr;
    width: calc(100% - 28px);
    padding: 14px 62px 14px 14px;
  }

  #restaurant-sidebar {
    top: 14px;
    bottom: auto;
    left: 14px;
    width: calc(100% - 28px);
    max-height: min(440px, calc(100vh - 150px));
  }

  #menu.is-minimised {
    left: auto;
    right: 90px;
    width: 54px;
    padding: 6px;
  }

        #controls {
          grid-template-columns: 1fr 1fr;
        }

  .field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  #menu {
    max-height: calc(100vh - 28px);
    overflow: auto;
  }

  #controls {
    grid-template-columns: 1fr;
  }

  #controls button {
    width: 100%;
  }

  #restaurant-sidebar {
    max-height: min(420px, calc(100vh - 180px));
  }
}
