:root {
  --ink: #1f2933;
  --soft: #5b6875;
  --line: #d9dee3;
  --bg: #ffffff;
  --tint: #f4f5f7;
  --accent: #1f2933;
  --meet: #f2b632;
  --bad: #b3261e;
  --p1: #d1495b; --p2: #2a7fbf; --p3: #2e9e5b; --p4: #dd7a12; --p5: #7b4fc4; --p6: #0d8f99;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--tint); }
#map { position: fixed; inset: 0; }

#panel {
  position: fixed; top: 12px; left: 12px; bottom: 12px; width: 380px;
  overflow-y: auto; background: var(--bg); border-radius: 10px;
  padding: 18px; box-shadow: 0 2px 14px rgb(0 0 0 / .18);
  display: flex; flex-direction: column; gap: 14px;
}
h1 { font-size: 20px; margin: 0 0 2px; letter-spacing: -.01em; }
header p { margin: 0; color: var(--soft); }

#people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person { position: relative; display: flex; align-items: center; gap: 8px; }
.dot {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.person input {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg); text-overflow: ellipsis;
}
.person input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.remove {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none;
  font-size: 18px; line-height: 1; color: var(--soft); cursor: pointer;
}
.remove:hover { background: var(--tint); color: var(--ink); }

.suggest {
  position: absolute; z-index: 5; top: 40px; left: 32px; right: 36px; margin: 0; padding: 4px 0;
  list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .16);
}
.suggest li { padding: 7px 10px; cursor: pointer; }
.suggest li small { display: block; color: var(--soft); }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--tint); }

.actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
button { font: inherit; cursor: pointer; }
#go {
  height: 38px; padding: 0 14px; border: 0; border-radius: 7px;
  background: var(--accent); color: #fff; font-weight: 600;
}
#go:disabled { background: var(--line); color: var(--soft); cursor: default; }
.quiet { height: 38px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--ink); }
.quiet:hover { background: var(--tint); }
.quiet:disabled { color: var(--soft); cursor: default; background: none; }
.hint { margin: 8px 0 0; color: var(--soft); font-size: 13px; }

#result { border-top: 1px solid var(--line); padding-top: 14px; }
#result h2 { font-size: 17px; margin: 0 0 2px; }
#result .lead { margin: 0 0 10px; color: var(--soft); }
#result .error { color: var(--bad); margin: 0; }
#result .kind { margin: 0 0 6px; color: var(--soft); font-size: 13px; }
#result .links { margin: 0 0 10px; display: flex; gap: 14px; }
#result .links a { color: inherit; }
#result h3 { font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--soft); }
.others { list-style: none; margin: 0 0 8px; padding: 0; }
.others button {
  display: grid; grid-template-columns: 1fr auto; column-gap: 8px; width: 100%; padding: 7px 8px; text-align: left;
  border: 0; border-radius: 7px; background: none; color: inherit;
}
.others button:hover { background: var(--tint); }
.other-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.other-time { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; text-align: right; }
.other-sub { grid-column: 1 / 3; color: var(--soft); font-size: 13px; }
.times { list-style: none; margin: 0 0 10px; padding: 0; }
.times li {
  display: grid; grid-template-columns: 24px 1fr auto; column-gap: 8px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--tint);
}
.times .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.times .when { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.times .sub { grid-column: 2 / 4; display: flex; justify-content: space-between; color: var(--soft); font-size: 13px; }
.times a, footer a, .more a { color: inherit; }
.more { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.note { margin: 10px 0 0; font-size: 13px; color: var(--soft); }
.searching { display: flex; align-items: center; gap: 10px; color: var(--soft); margin: 0; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 4s; } }

footer { margin-top: auto; font-size: 12px; color: var(--soft); }
.version { white-space: nowrap; }

.pin {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / .45); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: grab;
}
.pin:active { cursor: grabbing; }
.meet-pin {
  width: 34px; height: 34px; border-radius: 50%; background: var(--meet); border: 3px solid var(--ink);
  box-shadow: 0 1px 6px rgb(0 0 0 / .5);
}

/* Phone: the map on top, the panel as a sheet below it. */
@media (max-width: 720px) {
  #map { bottom: 52%; }
  #panel {
    top: 48%; left: 0; right: 0; bottom: 0; width: auto;
    border-radius: 14px 14px 0 0; padding: 14px 16px;
  }
  #map .maplibregl-ctrl-bottom-right { margin-bottom: 18px; }
  header p { display: none; }
  .suggest { top: auto; bottom: 40px; }
}
