:root { --bg:#fff; --fg:#111; --muted:#666; --card:#fff; --border:#eaeaea; --shadow:0 2px 10px rgba(0,0,0,.06); }
* { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin:0; font-family:"Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg); color:var(--fg); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
.app-header { position:sticky; top:0; z-index:10; background:#fff; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:12px 16px; }
.brand { font-size:18px; margin:0; letter-spacing:.2px; }
.view { padding:12px 12px 72px; max-width:820px; margin:0 auto; }
.tabs { position:sticky; top:56px; z-index:9; display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:8px 0; background:#fff; }
.tab { padding:10px 8px; border:1px solid var(--border); background:#fff; border-radius:10px; font-weight:600; }
.tab.active { outline:2px solid #111; }
.panel { display:none; }
.panel.active { display:block; }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:14px; box-shadow:var(--shadow); }
.card + .card { margin-top:12px; }
.card-head h2 { margin:0 0 4px; font-size:18px; }
.muted { color:var(--muted); }
.tiny { font-size:12px; }
.big { font-size:20px; line-height:1.5; }
.ref { margin-top:6px; }
.row { display:flex; gap:8px; margin-top:10px; }
.btn { appearance:none; border:1px solid #111; background:#111; color:#fff; padding:10px 12px; border-radius:10px; font-weight:600; }
.btn.outline { background:#fff; color:#111; }
.btn.small { padding:6px 10px; font-size:14px; }
.list { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.list li { border:1px solid var(--border); border-radius:12px; padding:12px; background:#fff; }
.list h3 { margin:0 0 6px; font-size:16px; }
.list p { margin:0; }
audio { width:100%; display:block; }
.video-grid { display:grid; grid-template-columns:1fr; gap:12px; }
/* Instagram-like preview card */
.ig-card { border-radius:12px; overflow:hidden; background:#000; color:#fff; position:relative; aspect-ratio:16/9; display:flex; align-items:flex-end; padding:10px; }
.ig-card img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
/* ensure embedded iframe fits inside preview card when we render oEmbed HTML inline */
.ig-card iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.ig-card .meta { position:relative; z-index:2; backdrop-filter: blur(6px); background:rgba(0,0,0,0.35); padding:6px 8px; border-radius:8px; margin:8px; font-weight:600; }

/* Modal */
.ig-modal { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.85); z-index:1000; padding:16px; }
.ig-frame { width:100%; max-width:820px; height:80vh; background:#111; border-radius:12px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.ig-frame iframe { width:100%; height:100%; border:0; }
.ig-close { position:fixed; right:12px; top:12px; background:#fff; color:#111; border-radius:999px; width:40px; height:40px; border:none; font-size:22px; }
.ig-nav { position:fixed; top:50%; transform:translateY(-50%); background:rgba(255,255,255,0.06); color:#fff; border:none; width:44px; height:60px; font-size:28px; }
.ig-prev { left:8px; }
.ig-next { right:8px; }
.app-footer { padding:14px; text-align:center; color:var(--muted); border-top:1px solid var(--border); }
@media (min-width:640px){ .tabs{ top:64px } .view{ padding:16px 16px 90px } .video-grid{ grid-template-columns:1fr 1fr } }
@media (prefers-reduced-motion: no-preference){
  .tab, .btn { transition: transform .08s ease, box-shadow .12s ease; }
  .btn:active, .tab:active { transform: scale(.98); }
}