/* Openings web — charcoal / amber dining-night (mirrors iOS DesignSystem) */
:root {
  --night: #12141a;
  --night-elevated: #1c2129;
  --night-soft: #242933;
  --ink: #f5f0e6;
  --ink-muted: #b3ada1;
  --ink-faint: #7a7870;
  --ember: #dba351;
  --ember-soft: rgba(219, 163, 81, 0.18);
  --ember-deep: #b87a2e;
  --live: #73b88c;
  --watching: #8cb2d1;
  --paused: #e09e61;
  --danger: #db6157;
  --resy: #eb6b61;
  --opentable: #d98c38;
  --sevenrooms: #6b9ec7;
  --doordash: #e6594d;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-brand: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.openings {
  font-family: var(--font-body);
  background: var(--night);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
}

.openings-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(219, 163, 81, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 100%, rgba(30, 46, 56, 0.55), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%, rgba(0,0,0,0.18)),
    var(--night);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1.15rem 3.5rem;
}

.brand {
  font-family: var(--font-brand);
  font-size: clamp(2.1rem, 6vw, 2.65rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.tagline { color: var(--ink-muted); font-size: 0.95rem; margin-top: 0.35rem; }
.hint { color: var(--ink-faint); font-size: 0.78rem; margin-top: 0.35rem; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.topbar-meta a { color: var(--ember); text-decoration: none; }
.topbar-meta a:hover { text-decoration: underline; }

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.live-dot i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint);
  display: inline-block;
}
.live-dot.on i {
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(115, 184, 140, 0.25);
  animation: pulse 1.4s ease-in-out infinite;
}
.live-dot.on { color: var(--live); }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid rgba(122, 120, 112, 0.25);
  padding-bottom: 0.15rem;
}
.tab {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--ember); border-bottom-color: var(--ember); }
.tab:hover { color: var(--ink); }

.panel { display: none; }
.panel.active { display: block; animation: fadeUp 0.35s ease-out; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.label-caps {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.45rem;
}

.chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.15rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid rgba(122, 120, 112, 0.25);
  background: var(--night-soft);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.chip.on {
  background: var(--ember-soft);
  border-color: rgba(219, 163, 81, 0.55);
  color: var(--ember);
}

.search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--night-elevated);
  border: 1px solid rgba(122, 120, 112, 0.2);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin: 0.75rem 0 1rem;
}
.search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.search input::placeholder { color: var(--ink-faint); }
.search .icon { color: var(--ink-faint); font-size: 0.9rem; }

.filters-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filters-row select {
  background: var(--night-elevated);
  border: 1px solid rgba(122, 120, 112, 0.25);
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-family: inherit;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0.5rem 0 0.85rem;
}
.section-head h2 {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}
.section-head .count { color: var(--ink-faint); font-size: 0.8rem; }

.row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--night-elevated);
  border: 1px solid rgba(122, 120, 112, 0.12);
  border-radius: var(--radius-lg);
  margin-bottom: 0.55rem;
  transition: border-color 0.2s, transform 0.15s;
}
.row:hover { border-color: rgba(219, 163, 81, 0.28); }
.row.clickable { cursor: pointer; }

.logo {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--night-soft);
  border: 1px solid rgba(122, 120, 112, 0.18);
  flex-shrink: 0;
}
.logo-ph {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-brand);
  font-size: 1.15rem;
  color: var(--ember);
}

.row-body { min-width: 0; flex: 1; }
.row-body strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vibe-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.vibe-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--night-soft);
  color: var(--ink-faint);
}

.platform-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.platform-badge.resy { background: rgba(235, 107, 97, 0.18); color: var(--resy); }
.platform-badge.opentable { background: rgba(217, 140, 56, 0.18); color: var(--opentable); }
.platform-badge.sevenrooms { background: rgba(107, 158, 199, 0.18); color: var(--sevenrooms); }
.platform-badge.doordash { background: rgba(230, 89, 77, 0.18); color: var(--doordash); }

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}
.btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.12s, transform 0.12s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-primary { background: var(--ember); color: var(--night); }
.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid rgba(122, 120, 112, 0.45);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.7rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.status-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.status-pill.watching { background: rgba(140, 178, 209, 0.18); color: var(--watching); }
.status-pill.notified { background: rgba(115, 184, 140, 0.18); color: var(--live); }
.status-pill.paused { background: rgba(224, 158, 97, 0.18); color: var(--paused); }
.status-pill.expired,
.status-pill.cancelled { background: rgba(122, 120, 112, 0.2); color: var(--ink-faint); }

.empty {
  padding: 1.25rem;
  background: var(--night-elevated);
  border: 1px solid rgba(122, 120, 112, 0.18);
  border-radius: var(--radius-lg);
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.empty strong { color: var(--ink); display: block; margin-bottom: 0.3rem; }

.footer-meta {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
.disclaimer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(122, 120, 112, 0.2);
  font-size: 0.7rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
.disclaimer strong { color: var(--paused); }

/* Watch sheet */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.sheet {
  background: var(--night-elevated);
  border: 1px solid rgba(122, 120, 112, 0.25);
  border-radius: var(--radius-lg) var(--radius-lg) 12px 12px;
  padding: 1.25rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeUp 0.25s ease-out;
}
.sheet h3 {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}
.sheet .sub { color: var(--ink-muted); font-size: 0.8rem; margin-bottom: 1rem; }
.sheet label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0.65rem 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet input, .sheet select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(122, 120, 112, 0.3);
  background: var(--night);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
}
.sheet .sheet-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.sheet .sheet-actions .btn { flex: 1; padding: 0.7rem; }
.sheet .msg { font-size: 0.8rem; margin-top: 0.65rem; min-height: 1.1em; }
.sheet .msg.ok { color: var(--live); }
.sheet .msg.err { color: var(--danger); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.sheet .section-label {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0.85rem 0 0.45rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.sheet .section-label strong { color: var(--ink); font-weight: 600; }
.sheet .party-chips, .sheet .date-strip, .sheet .dow-chips {
  display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sheet .party-chips::-webkit-scrollbar,
.sheet .date-strip::-webkit-scrollbar { display: none; }
.sheet .party-chips .chip {
  flex: 0 0 auto;
  border-radius: 999px;
  width: 2.55rem; height: 2.55rem;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(122, 120, 112, 0.18);
  border: none;
  color: var(--ink-muted);
  font-weight: 600;
}
.sheet .party-chips .chip.on {
  background: #f4f1ea;
  color: #12110f;
  border: none;
}
.sheet .date-card {
  flex: 0 0 auto;
  width: 4.1rem;
  min-height: 4.6rem;
  border-radius: 14px;
  border: none;
  background: rgba(122, 120, 112, 0.18);
  color: var(--ink-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.15rem;
  padding: 0.55rem 0.35rem;
  cursor: pointer;
  font-family: inherit;
}
.sheet .date-card .d-top { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sheet .date-card .d-num { font-size: 1.25rem; font-weight: 700; line-height: 1; color: inherit; }
.sheet .date-card .d-mon { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; }
.sheet .date-card.on {
  background: #f4f1ea;
  color: #12110f;
}
.sheet .dow-chips .chip {
  flex: 0 0 auto;
  border-radius: 999px;
  width: 2.4rem; height: 2.4rem;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; }
  .row-actions { flex-direction: row; }
}
