:root {
  --bg: #f4f5f7; --card: #fff; --text: #1c1e21; --sub: #6b7280; --line: #e5e7eb;
  --ok: #15803d; --ok-bg: #dcfce7; --full: #b91c1c; --full-bg: #fee2e2; --accent: #2563eb; --star: #d97706;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315; --card: #1c1f23; --text: #e8eaed; --sub: #9aa0a6; --line: #2d3238;
    --ok: #86efac; --ok-bg: #14532d; --full: #fca5a5; --full-bg: #7f1d1d; --accent: #60a5fa; --star: #fbbf24;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
header {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
h1 { font-size: 1.05rem; margin: 0; }
#updated { font-size: .75rem; color: var(--sub); }
#refresh {
  font-size: 1rem; font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 8px; padding: 10px 18px;
}
#refresh:disabled { opacity: .5; }
main { padding: 0 16px 16px; max-width: 960px; margin: 0 auto; }
main h2 { font-size: .85rem; color: var(--sub); margin: 20px 0 8px; }
.filters { display: flex; gap: 8px; }
#pref, #query {
  font-size: 1rem; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
#query { flex: 1; min-width: 0; }
#results {
  list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto;
  background: var(--card); border-radius: 12px;
}
.result { display: flex; align-items: center; padding-right: 8px; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; }
.pick {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left;
  font-size: .95rem; color: var(--text); background: none; border: 0; padding: 10px 16px;
}
.place, #results-note, .empty, .time { font-size: .75rem; color: var(--sub); }
#results-note:not(:empty) { margin-top: 8px; }
.favorite {
  flex-shrink: 0; font-size: 1.3rem; line-height: 1; color: var(--sub);
  background: none; border: 0; padding: 6px 8px;
}
.favorite.on { color: var(--star); }
.favorite:disabled { opacity: .3; }
.stores { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.store { background: var(--card); border-radius: 12px; padding: 14px 16px; scroll-margin-top: 80px; }
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.store-head .favorite { margin: -6px -8px; }
.store h3 { font-size: 1rem; margin: 0; }
.store h3 a { color: inherit; text-decoration: none; }
.time { margin-top: 8px; text-align: right; }
.seat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem;
}
.status {
  flex-shrink: 0; font-weight: 600; font-size: .85rem; padding: 3px 10px; border-radius: 999px;
  color: var(--ok); background: var(--ok-bg);
}
.status.full { color: var(--full); background: var(--full-bg); }
.message { color: var(--sub); font-size: .85rem; padding-top: 8px; border-top: 1px solid var(--line); }
