* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}

header { text-align: center; margin-bottom: 12px; }
h1 { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.sub { font-size: 12px; color: #888; }

.filters { margin-bottom: 14px; }
.filter-row {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.chip {
  padding: 7px 12px; border-radius: 999px;
  background: #fff; border: 1px solid #d1d1d6;
  font-size: 13px; color: #1d1d1f; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.chip.active {
  background: #1f5fbf; color: #fff; border-color: #1f5fbf;
}
.chip.fav.active { background: #e69b00; border-color: #e69b00; }

.list { display: flex; flex-direction: column; gap: 12px; }
.section-header {
  font-size: 13px; font-weight: 700; color: #1f5fbf;
  margin: 8px 2px -4px;
  padding-bottom: 4px; border-bottom: 1px solid #d8dde5;
  letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) {
  .section-header { color: #9bb8ea; border-bottom-color: #38383a; }
}
.empty {
  text-align: center; padding: 40px 20px; color: #999;
  background: #fff; border-radius: 16px;
}

.card {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  background: #fff; border-radius: 14px; padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  overflow: hidden;
}
.card.no-thumb { grid-template-columns: 1fr; }
.card .thumb {
  display: block; width: 96px; height: 96px; border-radius: 10px;
  overflow: hidden; background: #eef1f5; flex-shrink: 0;
}
.card .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card .thumb img[src=""] { display: none; }

.body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-top, .row-bot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.venue-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: #eaeef7; color: #1f5fbf; font-weight: 600; white-space: nowrap;
}
.venue-tag.plats   { background: #f5e9f1; color: #a93380; }
.venue-tag.mot     { background: #e8f2ea; color: #2a7a3c; }
.date {
  font-size: 12px; color: #666;
  font-variant-numeric: tabular-nums; text-align: right;
  white-space: nowrap; flex-shrink: 0;
}
.title {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  word-break: break-word;
}
.title a { color: #1d1d1f; text-decoration: none; }
.title a:hover { text-decoration: underline; }
.desc {
  font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.category {
  font-size: 11px; color: #888;
}
.fav-btn {
  font-size: 20px; line-height: 1; cursor: pointer;
  background: transparent; border: none; color: #bbb; padding: 4px 6px;
}
.fav-btn.on { color: #f4a620; }

footer {
  margin-top: 20px; text-align: center; font-size: 11px; color: #aaa;
}
footer a { color: #888; }

dialog {
  border: none; border-radius: 14px; padding: 20px;
  max-width: 90%; width: 320px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
dialog::backdrop { background: rgba(0,0,0,.3); }
dialog h3 { margin-bottom: 6px; }
dialog .muted { font-size: 12px; color: #777; margin-bottom: 12px; }
dialog input {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid #d1d1d6; border-radius: 8px; margin-bottom: 12px;
}
dialog .dlg-row { display: flex; gap: 8px; justify-content: flex-end; }
dialog button {
  padding: 8px 16px; border: none; border-radius: 8px;
  font-size: 14px; cursor: pointer;
}
#pass-ok { background: #1f5fbf; color: #fff; }

@media (prefers-color-scheme: dark) {
  body { background: #000; color: #f2f2f7; }
  .chip { background: #1c1c1e; border-color: #38383a; color: #f2f2f7; }
  .card { background: #1c1c1e; box-shadow: none; }
  .card .thumb { background: #2c2c2e; }
  .title a { color: #f2f2f7; }
  .date, .desc, .category, .sub { color: #999; }
  .empty, dialog { background: #1c1c1e; color: #f2f2f7; }
  .venue-tag { background: #2a2a2e; color: #9bb8ea; }
  .venue-tag.plats { background: #3a2433; color: #e09abf; }
  .venue-tag.mot   { background: #223b28; color: #96d6a4; }
  dialog input { background: #2c2c2e; border-color: #48484a; color: #f2f2f7; }
}
