:root {
  --bg: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d9d9de;
  --accent: #c8102e;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --surface: #1c1c1f; --text: #f2f2f4; --muted: #a1a1a8; --border: #333338; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
[hidden] { display: none !important; }
a { color: inherit; }

/* Landing */
.home { max-width: 720px; margin: 0 auto; padding: 12vh 16px 40px; text-align: center; }
.home h1 { font-size: 2rem; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; text-decoration: none; transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.icon { font-size: 3rem; }
.card-title { font-size: 1.4rem; font-weight: 600; }
.card-meta { color: var(--muted); font-size: .9rem; }

/* Viewer */
.viewer { display: flex; flex-direction: column; height: 100%; }
.bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.btn, select {
  font: inherit; font-size: .9rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: .4; cursor: default; }
select { max-width: 280px; }
.tabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tabs a { padding: 6px 14px; text-decoration: none; font-size: .9rem; }
.tabs a.active { background: var(--accent); color: #fff; }
.notes { flex: 1; min-width: 0; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#open { margin-left: auto; }

.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.stage iframe { border: 0; background: #fff; }
.stage.full iframe { width: 100%; height: 100%; }
.stage.phone { padding: 24px; }
.stage.phone iframe {
  width: 390px; height: 844px; max-height: 100%; flex-shrink: 0;
  border-radius: 40px; box-shadow: 0 0 0 10px #1d1d1f, 0 20px 50px rgba(0,0,0,.3);
}
.empty { color: var(--muted); }
