/* Radio Indundi app */
:root {
  --brand: #0E7C3A;
  --accent: #CE1126;
  --bg: #0b0f0d;
  --surface: #141a17;
  --surface-2: #1c2420;
  --line: #26302b;
  --text: #eef3f0;
  --muted: #8d9a93;
  --radius: 16px;
  --tabbar-h: 62px;
  --mini-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8f7;
    --surface: #ffffff;
    --surface-2: #eef2f0;
    --line: #e1e7e4;
    --text: #101714;
    --muted: #5f6d66;
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  overscroll-behavior-y: none;
}
body.has-mini { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 16px); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
#view { max-width: 680px; margin: 0 auto; min-height: 60vh; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; flex: 1; }
.brand strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { font-size: 12px; color: var(--muted); }
.btn-install { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.btn-install svg { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.outline { border: 1px solid var(--line); }

/* ---------- live ---------- */
.live { text-align: center; padding: 26px 20px 8px; }
.live-art { position: relative; width: min(64vw, 260px); aspect-ratio: 1; margin: 0 auto 18px; }
.live-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; box-shadow: 0 20px 60px -20px color-mix(in srgb, var(--brand) 70%, transparent); background: var(--surface); }
.eq { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: flex; gap: 3px; align-items: flex-end; height: 22px; padding: 4px 8px; border-radius: 999px; background: var(--accent); opacity: 0; transition: opacity .3s; }
.eq i { width: 3px; height: 30%; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; } .eq i:nth-child(5) { animation-delay: -.45s; }
body.live-on.is-playing .eq { opacity: 1; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--accent); margin-bottom: 6px; }
.live-title { margin: 0; font-size: 24px; line-height: 1.2; }
.live-sub { margin: 4px 0 18px; color: var(--muted); }
.live-btn { width: 76px; height: 76px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid; place-items: center; box-shadow: 0 10px 30px -8px var(--brand); transition: transform .15s; position: relative; }
.live-btn svg { width: 34px; height: 34px; }
.live-btn.sm { width: 64px; height: 64px; }
.live-btn:active { transform: scale(.94); }
.live-status { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.loading::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; border-top-color: currentColor; animation: spin .9s linear infinite; }
.live-btn.loading::after { border-top-color: var(--brand); inset: -7px; }
@keyframes spin { to { transform: rotate(360deg); } }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live-cards { padding: 18px 16px 0; display: grid; gap: 10px; }

/* ---------- cards & lists ---------- */
.card { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); align-items: center; }
.card.is-live { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.thumb.ph { display: grid; place-items: center; color: var(--muted); }
.card .body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.card .title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 13px; }
.hosts { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { display: grid; gap: 10px; padding: 12px 16px; }
.row-wrap { position: relative; }
.row-wrap .card { padding-right: 112px; }
.row-actions { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.section { padding: 8px 0 0; }
.section-title { margin: 18px 16px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.state { text-align: center; color: var(--muted); padding: 40px 24px; }
.state .btn-ghost { margin-top: 12px; }

.seg { display: flex; gap: 6px; padding: 12px 16px 0; }
.seg button { padding: 7px 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--text); color: var(--bg); }

/* ---------- buttons ---------- */
.btn-follow { padding: 7px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; min-width: 92px; transition: all .15s; }
.btn-follow.on { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-follow.big { padding: 9px 20px; }
.btn-follow:active { transform: scale(.96); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.btn-ghost svg { width: 18px; height: 18px; }
.btn-ghost.wide { display: flex; width: calc(100% - 32px); margin: 12px 16px; padding: 12px; }

/* ---------- avatars ---------- */
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.sm { width: 28px; height: 28px; }
.avatar.lg { width: 64px; height: 64px; }
.avatar.xl { width: 92px; height: 92px; }
.avatar.initials { display: inline-grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 40%, #000)); font-size: 15px; }
.avatar.xl.initials { font-size: 30px; }
.avatar.profile { width: 92px; height: 92px; border: 4px solid var(--bg); margin-top: -46px; }
.avatar.profile.initials { font-size: 30px; }

/* ---------- presenters ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tile a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; width: 100%; }
.tile strong { margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile .meta { font-size: 12px; min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.followers { color: var(--muted); font-size: 13px; }
.followers b { color: var(--text); }

.cover { height: 120px; background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand) 35%, #000) 60%, var(--accent)); }
.profile-head { padding: 12px 16px 6px; }
.profile-head h2 { margin: 8px 0 0; font-size: 22px; line-height: 1.2; }
.profile-head.with-avatar { position: relative; }
.profile-actions { display: flex; gap: 8px; align-items: center; margin: 12px 0 6px; flex-wrap: wrap; }
.profile-actions.top { position: absolute; right: 16px; top: 10px; margin: 0; }
.profile-stats { margin: 8px 0 4px; }
.bio { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.chips-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 6px 16px 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip-person { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 72px; font-size: 12px; text-align: center; }
.chip-person span { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs-inline { display: flex; border-bottom: 1px solid var(--line); margin-top: 10px; position: sticky; top: calc(60px + var(--safe-t)); background: var(--bg); z-index: 5; }
.tabs-inline button { flex: 1; padding: 14px 6px; font-weight: 600; color: var(--muted); position: relative; font-size: 14px; }
.tabs-inline button.on { color: var(--text); }
.tabs-inline button.on::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 48px; height: 4px; border-radius: 4px; background: var(--brand); }

/* ---------- hero (show) ---------- */
.hero { position: relative; aspect-ratio: 16 / 8; background: var(--surface-2); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), transparent 55%); }
.pill-live { position: absolute; left: 16px; top: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.pill-live .live-dot { background: #fff; }

/* ---------- episodes ---------- */
.ep { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ep-play { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.ep-play.active { background: var(--brand); color: #fff; }
.ep-play.loading::after { border-top-color: var(--brand); }
.ep-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ep-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-acts { flex: none; }
.ep-detail { padding: 18px 16px 0; text-align: center; }
.ep-art { width: min(60vw, 240px); aspect-ratio: 1; object-fit: cover; border-radius: 22px; margin: 0 auto 16px; background: var(--surface); }
.ep-detail h2 { margin: 0; font-size: 20px; }
.ep-detail .meta a { color: var(--brand); font-weight: 600; }
.scrub { margin: 18px 0 6px; }
.scrub input { width: 100%; accent-color: var(--brand); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 6px 0 10px; }
.ep-detail .prose { text-align: left; }

/* ---------- news feed (X-style) ---------- */
.feed { border-top: 1px solid var(--line); }
.post { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.post:active { background: var(--surface); }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 5px; font-size: 14px; color: var(--muted); min-width: 0; }
.post-head .who { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-head .cat { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.post-head time { white-space: nowrap; }
.post-title { margin: 2px 0 2px; font-size: 16px; line-height: 1.3; }
.post-text { margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { display: inline-block; margin-top: 2px; color: var(--brand); font-weight: 600; font-size: 14px; }
@media (prefers-color-scheme: dark) { .read-more, .ep-detail .meta a { color: color-mix(in srgb, var(--brand) 55%, #fff); } }
.post-img { margin-top: 10px; width: 100%; max-height: 360px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.post-acts { display: flex; justify-content: space-between; max-width: 320px; margin-top: 8px; margin-left: -8px; }
.act { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 500; }
.act svg { width: 19px; height: 19px; }
.act .n { min-width: 8px; }
.act.like.on { color: #f91880; }
.act.like.on svg { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.3); } }
.act.like:not(.on) svg { fill: none; stroke: currentColor; stroke-width: 2; }
.post-acts .act:first-child svg, .actions-row .act:not(.like) svg { fill: currentColor; }
.actions-row { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0; }

/* ---------- article ---------- */
.article { padding: 14px 16px 0; }
.post-head.big { gap: 10px; font-size: 14px; }
.post-head.big > div { display: flex; flex-direction: column; line-height: 1.25; }
.post-head.big strong { color: var(--text); }
.article h1 { font-size: 24px; line-height: 1.25; margin: 14px 0 12px; }
.article-img { width: 100%; border-radius: 16px; margin-bottom: 14px; }
.prose { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.prose img, .prose iframe, .prose video { max-width: 100%; height: auto; border-radius: 12px; }
.prose iframe { aspect-ratio: 16 / 9; width: 100%; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose figure { margin: 14px 0; }
.prose blockquote { margin: 14px 0; padding-left: 14px; border-left: 3px solid var(--brand); color: var(--muted); }
.prose h2, .prose h3 { line-height: 1.3; }

/* ---------- comments ---------- */
.comments { padding: 0 16px 10px; }
.comments .section-title { margin-left: 0; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment p { margin: 2px 0 0; overflow-wrap: anywhere; }
.comment.pending { opacity: .7; }
.comment-form { margin-top: 12px; display: grid; gap: 8px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; resize: none; }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.comment-row { display: flex; gap: 8px; align-items: flex-end; }
.btn-send { padding: 11px 18px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; }
.btn-send:disabled { opacity: .5; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- mini player ---------- */
.mini {
  position: fixed; left: 8px; right: 8px; z-index: 30;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 6px);
  height: var(--mini-h); max-width: 664px; margin: 0 auto;
  display: flex; align-items: center; gap: 4px; padding: 0 6px 0 8px;
  background: var(--surface-2);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
}
.mini[hidden] { display: none; }
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; height: 100%; }
.mini-art { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface); }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-play { position: relative; width: 44px; height: 44px; }
.mini-play svg { width: 26px; height: 26px; }
.mini-close svg { width: 18px; height: 18px; opacity: .6; }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.mini-progress[hidden] { display: none; }
.mini-progress i { display: block; height: 100%; width: 0; background: var(--brand); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { color: var(--brand); }
@media (prefers-color-scheme: dark) { .tabbar a.on svg { color: color-mix(in srgb, var(--brand) 50%, #fff); } }
.tabbar svg { width: 24px; height: 24px; }
.tab-live-dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); display: none; }
body.live-on .tab-live-dot { display: block; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.offline { position: sticky; top: 0; z-index: 25; background: var(--accent); color: #fff; text-align: center; font-size: 13px; padding: calc(6px + var(--safe-t)) 12px 6px; }
.offline[hidden] { display: none; }
.skel-wrap { display: grid; gap: 10px; padding: 12px 16px; }
.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 88px; }
.skel.hero { height: 200px; } .skel.tile { height: 190px; } .skel.post { height: 150px; } .skel.line { height: 44px; }
.grid .skel-wrap { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); padding: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
