/* RiseItSocial — design tokens */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e4e9f0;
  --brand: #1d4ed8;
  --brand-600: #2563eb;
  --brand-50: #eef3ff;
  --brand-ink: #ffffff;
  --accent: #f97316;
  --green: #16a34a;
  --red: #e11d48;
  --amber: #d97706;
  --violet: #7c3aed;
  --teal: #0d9488;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #111827; --surface-2: #1a2333; --text: #e5e9f0; --muted: #94a3b8; --line: #243042;
    --brand: #3b82f6; --brand-600: #60a5fa; --brand-50: #172554; --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: .45em 0; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }
textarea { resize: vertical; }
code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* utilities */
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; } .block { display: block; }
.row { display: flex; align-items: center; } .col { display: flex; flex-direction: column; } .wrap { flex-wrap: wrap; }
.between { justify-content: space-between; } .end { justify-content: flex-end; align-items: flex-end; } .end-y { align-items: flex-end; }
.gap { gap: 16px; } .gap-s { gap: 8px; } .grow { flex: 1; min-width: 0; } .center { text-align: center; }
.pad { padding: 0 16px; } .pad-s { padding: 12px 14px; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flip { transform: rotate(180deg); }
.req { color: var(--red); }

/* ---------- layout ---------- */

.topbar { display: none; }
.layout { display: grid; grid-template-columns: 250px minmax(0, 660px) 330px; gap: 20px; justify-content: center; min-height: 100vh; padding: 0 12px; }
.main { min-width: 0; background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding-bottom: 48px; min-height: 100vh; }
.main:focus { outline: none; }
.nav, .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 4px; scrollbar-width: thin; }
.nav { display: flex; flex-direction: column; gap: 10px; }
.side { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }

.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; display: flex; flex-direction: column; }
.logo-text b { color: var(--brand); display: inline; }
.logo-text small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.brand { padding: 4px 10px 8px; }
.brand:hover { text-decoration: none; }

.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-links a, .bottom-nav a { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 500; position: relative; }
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a.active { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.count, .dot-count { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; margin-left: auto; line-height: 1.5; }
.raise-cta { margin-top: 6px; }
.nav-user { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.nav-user .who { display: flex; gap: 10px; align-items: center; color: var(--text); flex: 1; min-width: 0; }
.nav-user .who .col { min-width: 0; } .nav-user .who strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottom-nav { display: none; }

.page-head { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 19px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; text-align: center; padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; background: var(--surface-2); }
.feed-note { padding: 6px 16px; margin: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }

.loading { display: grid; place-items: center; padding: 60px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { opacity: .4; }
.notice { margin: 12px 16px; padding: 10px 14px; border-radius: var(--radius-s); background: var(--brand-50); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.notice.warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
@media (prefers-color-scheme: dark) { .notice.warn { background: #2a1606; border-color: #7c2d12; color: #fdba74; } }
.section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.section h2 { margin-bottom: 10px; }

/* ---------- elements ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-s); border: 1px solid transparent; background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn.subtle { color: var(--muted); }
.btn.sm { padding: 6px 12px; font-size: 13px; } .btn.big { padding: 12px 20px; font-size: 15px; } .btn.block { width: 100%; }
.btn.icon-only { padding: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn.on-img { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.45); color: #fff; }
.badge-host .dot-count { position: absolute; top: 0; right: -2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.side .card h3 { margin-bottom: 6px; }

.avatar { --h: 220; display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: hsl(var(--h) 60% 50%); color: #fff; font-weight: 700; font-size: 15px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.avatar.ring { border: 4px solid var(--surface); }

.badge { display: inline-flex; align-items: center; gap: 3px; margin: 0 4px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.badge.verified { background: var(--brand-50); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.xs { padding: 1px 8px; font-size: 11px; }
.tone-grey { background: var(--surface-2); color: var(--muted); }
.tone-blue { background: #e0ecff; color: #1d4ed8; } .tone-amber { background: #fef3c7; color: #b45309; }
.tone-violet { background: #ede9fe; color: #6d28d9; } .tone-teal { background: #ccfbf1; color: #0f766e; }
.tone-green { background: #dcfce7; color: #15803d; } .tone-red { background: #ffe4e6; color: #be123c; }
@media (prefers-color-scheme: dark) {
  .tone-blue { background: #172554; color: #93c5fd; } .tone-amber { background: #3a2604; color: #fcd34d; } .tone-violet { background: #2e1065; color: #c4b5fd; }
  .tone-teal { background: #042f2e; color: #5eead4; } .tone-green { background: #052e16; color: #86efac; } .tone-red { background: #4c0519; color: #fda4af; }
}

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
button.chip { cursor: pointer; } .chip.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.progress.lg { height: 10px; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s; }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.search.big { margin: 12px 16px; }

.side-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); border-top: 1px solid var(--line); }
.side-row:first-of-type { border-top: 0; }
.side-row:hover { text-decoration: none; } .side-row:hover strong, .side-row:hover b { color: var(--brand); }
.hash { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 25%, transparent); margin-right: 4px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.side-foot { padding: 0 6px; line-height: 1.8; }
.side-foot a { color: var(--muted); }

/* ---------- hero ---------- */

.hero { margin: 14px 16px; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand-50), var(--surface) 70%); border: 1px solid var(--line); display: grid; gap: 18px; }
.hero h2 { font-size: 24px; margin: 8px 0 4px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.pillars div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); color: var(--brand); font-size: 13px; }
.pillars b { color: var(--text); }

/* ---------- posts ---------- */

.composer { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.composer textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; background: var(--surface); }
.post-as { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.post-as select { width: auto; min-width: 0; flex: 1; padding: 4px 8px; font-size: 13px; }
.post-as { min-width: 0; }
.composer-bar { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.tool { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; list-style: none; }
.tool::-webkit-details-marker { display: none; }
.tool:hover { background: var(--surface-2); color: var(--brand); }
.preview-wrap { position: relative; margin-top: 8px; }
.preview-wrap .preview { border-radius: 12px; max-height: 280px; object-fit: cover; width: 100%; }
.preview-wrap .remove-img { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; }

.post { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.post:hover { background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.post-row { display: flex; gap: 12px; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; }
.post-head .name { font-weight: 700; color: var(--text); }
.post-body { margin: 4px 0 8px; overflow-wrap: anywhere; }
.post-body .tag, .issue-desc .tag { font-weight: 500; }
.post-media img { border-radius: 12px; max-height: 420px; width: 100%; object-fit: cover; border: 1px solid var(--line); margin-bottom: 8px; }
.rerise-head { color: var(--muted); font-size: 13px; font-weight: 600; margin: 0 0 6px 54px; }
.rerise-head a { color: var(--muted); }
.thread-root .post { background: var(--surface-2); }

.embed { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: var(--text); background: var(--surface); }
.embed:hover { border-color: var(--brand); text-decoration: none; }
.embed strong { display: block; }
.embed .kicker { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.embed.live { background: #fff1f2; border-color: #fecdd3; } .embed.live .kicker { color: var(--red); }
.embed.live.ended { background: var(--surface-2); border-color: var(--line); } .embed.live.ended .kicker { color: var(--muted); }
@media (prefers-color-scheme: dark) { .embed.live { background: #2a0a12; border-color: #4c0519; } }
.embed.quote { display: block; }
.embed.quote img { border-radius: 8px; margin-top: 6px; max-height: 200px; object-fit: cover; }
.cat-ico { font-size: 22px; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }

.post-actions { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.act { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); padding: 6px 8px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.act::-webkit-details-marker { display: none; }
.act:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.act .emo { font-size: 15px; filter: grayscale(1); opacity: .75; transition: transform .15s; }
.act.on .emo { filter: none; opacity: 1; transform: scale(1.12); }
.act.agree.on { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.act.disagree.on { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.act.rerise.on { color: var(--brand); background: var(--brand-50); }
.act.on:not(.agree):not(.disagree):not(.rerise) { color: var(--brand); }

.menu-wrap { position: relative; }
.menu-wrap > summary { list-style: none; cursor: pointer; }
.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; min-width: 200px; }
.menu.right { right: 0; }
.menu button, .menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .danger { color: var(--red); }
.emoji-wrap .menu { left: 0; right: auto; }
.menu-wrap:not([open]) > .menu { display: none !important; }
.emoji-grid { display: grid !important; grid-template-columns: repeat(8, 1fr); gap: 2px; width: min(300px, calc(100vw - 40px)); }
.emoji-grid button { font-size: 20px; padding: 5px; justify-content: center; }
.emoji-host { position: relative; display: flex; flex-direction: column; gap: 6px; }
.load-more { margin: 12px 16px; width: calc(100% - 32px); }

/* ---------- lists & cards ---------- */

.issue-row, .community-row, .thread-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.issue-row:hover, .community-row:hover, .thread-row:hover { background: var(--surface-2); text-decoration: none; }
.issue-row strong, .community-row strong { display: block; }
.issue-row .grow > span, .community-row .grow > span { display: block; }
.section .community-row, .section .issue-row { padding-left: 0; padding-right: 0; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.thumb.cat, .thumb.comm { display: grid; place-items: center; background: var(--surface-2); font-size: 28px; color: var(--brand); font-weight: 800; }
.thumb.comm { width: 48px; height: 48px; font-size: 20px; background: var(--brand-50); }
.thumb.xl { width: 80px; height: 80px; font-size: 38px; }
.side-row .thumb { width: 40px; height: 40px; font-size: 18px; }
.thread-row.unread b, .notif.unread { font-weight: 700; }
.thread-row.unread { background: var(--brand-50); }
.thread-row.active { background: var(--surface-2); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.campaign-card { padding: 0; overflow: hidden; color: var(--text); display: flex; flex-direction: column; }
.campaign-card:hover { border-color: var(--brand); text-decoration: none; }
.campaign-card > img, .cover-ph { height: 120px; width: 100%; object-fit: cover; }
.cover-ph { display: grid; place-items: center; font-size: 40px; background: linear-gradient(135deg, #1e3a8a, #f97316); }
.campaign-card h3 { margin: 8px 0 2px; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.topic-card { padding: 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; }
.topic-card span { font-size: 12px; color: var(--muted); }
.topic-card.hot { background: var(--brand); color: #fff; border-color: var(--brand); } .topic-card.hot span { color: #dbeafe; }
.topic-card:hover { border-color: var(--brand); text-decoration: none; }

.notif { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 400; }
.notif.unread { background: var(--brand-50); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif-ico { font-size: 18px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }

/* ---------- profile, community, page ---------- */

.cover, .banner { height: 170px; background: linear-gradient(120deg, #1e3a8a, #2563eb 45%, #f97316); background-size: cover; background-position: center; position: relative; }
.banner.tall { height: 200px; }
.cover.edit { border-radius: var(--radius); display: flex; align-items: flex-end; justify-content: flex-end; padding: 10px; }
.profile-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.profile .profile-body > .row:first-child, .banner + .profile-body > .row:first-child, .banner + .profile-body > .notice + .row { margin-top: -44px; }
.profile-name { font-size: 22px; margin: 6px 0 0; }
.comm-av { background: var(--brand); border-radius: 22px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.stat-row { display: flex; gap: 18px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.stat-row b { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 4px; }
.stats div { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 22px; } .stats span { font-size: 12px; color: var(--muted); }
.rules { white-space: pre-line; background: var(--surface-2); padding: 12px; border-radius: 12px; }

/* ---------- forms ---------- */

.form { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
.card.form { padding: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; min-width: 0; }
.form legend { font-weight: 700; padding: 0 6px; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check, .radio { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; cursor: pointer; }
.check input, .radio input, .pick input { width: auto; margin-top: 4px; flex: none; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.field { flex-direction: row !important; align-items: center; gap: 0 !important; position: relative; }
.field > svg { position: absolute; left: 12px; color: var(--muted); }
.field input { padding-left: 40px; }
.field .icon-btn { position: absolute; right: 4px; }
.similar { padding: 10px 12px; border-radius: var(--radius-s); background: #fffbeb; border: 1px solid #fde68a; display: flex; flex-direction: column; gap: 4px; }
@media (prefers-color-scheme: dark) { .similar { background: #2a1d04; border-color: #713f12; } }
.map { height: 240px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.map-ph { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; }
.dropzone { flex-direction: row !important; align-items: center; justify-content: center; gap: 10px !important; padding: 18px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); cursor: pointer; }
.dropzone:hover { border-color: var(--brand); color: var(--brand); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumb-item { position: relative; } .thumb-item img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; }
.thumb-item .icon-btn { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: rgba(0,0,0,.6); color: #fff; }
.fold { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
.fold > summary { padding: 12px 14px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fold-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick { flex-direction: row !important; gap: 10px !important; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 400 !important; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 140px; min-width: 0; max-width: 100%; padding: 8px 10px; font-size: 14px; }
select { max-width: 100%; text-overflow: ellipsis; }
.filters .check { font-size: 14px; }

/* ---------- issue / campaign detail ---------- */

.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.issue-main { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.issue-side { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.issue-title { font-size: 22px; margin: 0; }
.author-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.author-line a { color: var(--text); }
.issue-desc { font-size: 15px; overflow-wrap: anywhere; }
.gallery { display: grid; gap: 6px; border-radius: 12px; overflow: hidden; }
.gallery.g2 { grid-template-columns: 1fr 1fr; } .gallery.g3, .gallery.g4 { grid-template-columns: repeat(4, 1fr); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery.g1 img { aspect-ratio: 16 / 9; }
.counts span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); } .counts b { color: var(--text); }
.issue-actions .btn { flex: 1 1 auto; }
.issue-main .tabs { margin: 6px -16px 0; }

.stepper { list-style: none; margin: 8px 0; padding: 0; }
.stepper li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.stepper li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.stepper li:last-child::before { display: none; }
.stepper .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; z-index: 1; color: #fff; }
.stepper li.done .dot { background: var(--brand); border-color: var(--brand); }
.stepper li.done::before { background: var(--brand); }
.stepper li.current .dot { background: var(--surface); border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.stepper li.pending { color: var(--muted); }
.stepper li.terminal .dot { background: var(--muted); border-color: var(--muted); color: #fff; }
.stepper li.tone-rejected .dot { background: var(--red); border-color: var(--red); }
.rep-mini { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); color: var(--text); }
.rep-mini:hover { text-decoration: none; }
.actions-card { display: flex; flex-direction: column; gap: 8px; }

.history { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; }
.hist { padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.hist.src-representative { border-left: 3px solid var(--violet); }
.hist.src-moderator { border-left: 3px solid var(--brand); }
.history.compact li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.evidence { background: var(--surface-2); padding: 8px 10px; border-radius: 8px; display: flex; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; }
.links li { overflow-wrap: anywhere; }
.milestones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.milestones li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.milestones select { width: auto; padding: 4px 8px; font-size: 13px; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: 12px; flex: none; }

/* ---------- pages & chat ---------- */

.plan { margin: 14px 16px 0; background: linear-gradient(135deg, var(--brand-50), var(--surface)); }
.price { font-size: 22px; font-weight: 800; color: var(--brand); } .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.features { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; }
.features li { display: flex; gap: 6px; align-items: center; } .features svg { color: var(--green); }
.steps-list { margin: 0; padding-left: 20px; }

.chat { display: flex; flex-direction: column; height: calc(100vh - 2px); }
.chat .notice { margin: 8px 16px 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); align-self: flex-start; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
.bubble.mine .muted, .bubble.mine a { color: #dbeafe; }
.chat-form { display: flex; gap: 6px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form .emoji-wrap .menu { top: auto; bottom: calc(100% + 6px); }

/* ---------- auth ---------- */

body.auth-mode .nav, body.auth-mode .side, body.auth-mode .bottom-nav, body.auth-mode .topbar { display: none !important; }
body.auth-mode .layout { display: block; padding: 0; }
body.auth-mode .main { border: 0; padding: 0; max-width: none; }
.auth { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; min-height: 100vh; }
.auth-form { padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; gap: 6px; background: var(--surface); }
.auth-brand { margin-bottom: 16px; }
.auth-brand .logo-text { font-size: 26px; }
.auth h1 { font-size: 28px; margin: 0; } .auth .accent { color: var(--brand); }
.auth-art { position: relative; overflow: hidden; color: #fff; }
.auth-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-quote { position: absolute; left: 40px; right: 40px; bottom: 48px; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.auth-quote h2 { font-size: 34px; }

/* ---------- admin ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
.kpi > svg { color: var(--brand); margin-bottom: 4px; }
.kpi span { color: var(--muted); font-size: 13px; } .kpi b { font-size: 26px; }
.small-kpis .kpi b { font-size: 20px; }
a.kpi:hover { border-color: var(--brand); text-decoration: none; }
.up { color: var(--green) !important; } .down { color: var(--red) !important; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.donut-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; }
.donut-n { font-size: 7px; font-weight: 800; fill: var(--text); }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 180px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.legend span { width: 10px; height: 10px; border-radius: 3px; flex: none; } .legend b { margin-left: auto; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.bar-row i { display: block; height: 8px; border-radius: 4px; background: var(--brand); }
.report { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.report.appeal { border-color: #fde68a; }
.report form input { width: auto; min-width: 180px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table select { width: auto; padding: 4px 6px; }
.prose { max-width: 680px; padding-top: 12px; padding-bottom: 24px; } .prose h2 { margin-top: 1.4em; } .lead { font-size: 17px; }

/* ---------- dialog & toasts ---------- */

.dialog { border: 0; border-radius: 16px; padding: 0 20px; width: min(92vw, 460px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(15, 23, 42, .5); }
.dialog h2 { margin: 0; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(92vw, 420px); }
.toast { display: block; background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .4s, transform .4s; }
.toast.success { background: var(--green); color: #fff; } .toast.error { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(10px); }
a.toast:hover { text-decoration: none; }

/* ---------- live calls ---------- */

body.in-call .side { display: none; }
body.in-call .layout { grid-template-columns: 250px minmax(0, 1fr); }
.call { display: flex; flex-direction: column; height: 100vh; }
.call-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.call-head h1 { font-size: 18px; margin: 0; }
.call-body { flex: 1; display: flex; min-height: 0; }
.video-grid { flex: 1; display: grid; gap: 10px; padding: 10px; overflow-y: auto; align-content: center; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); background: #0b0e14; }
.tile { position: relative; aspect-ratio: 16 / 9; background: #1b2230; border-radius: 14px; overflow: hidden; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: none; }
.tile.local video { transform: scaleX(-1); } .tile.local.screen video { transform: none; object-fit: contain; }
.tile.has-video video { display: block; }
.tile-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.tile.has-video .tile-fallback { display: none; }
.tile-name { position: absolute; left: 10px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 3px 10px; border-radius: 8px; font-size: 13px; }
.call-chat { width: 300px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.call-chat form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); align-items: center; }
.call-chat .emoji-wrap .menu { top: auto; bottom: calc(100% + 6px); }
.chat-row div { overflow-wrap: anywhere; }
.call-controls { display: flex; justify-content: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ctl { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 10px 16px; cursor: pointer; font-weight: 600; }
.ctl.off { background: #ffe4e6; color: #be123c; border-color: #fecdd3; } .ctl.on { background: var(--brand-50); border-color: var(--brand); }
.ctl.danger { background: var(--red); color: #fff; border-color: var(--red); }
#chatToggle { display: none; }

/* ---------- responsive ---------- */

@media (min-width: 1000px) {
  .issue-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .issue-side { padding: 16px 16px 16px 0; }
  .issue-main .tabs { margin-right: 0; }
}
@media (min-width: 1240px) { .layout { grid-template-columns: 250px minmax(0, 720px) 330px; } }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 76px minmax(0, 680px); }
  body.in-call .layout { grid-template-columns: 76px minmax(0, 1fr); }
  .side { display: none; }
  .nav { align-items: center; }
  .nav .lbl, .nav .logo-text, .raise-cta span, .nav-user .who .col, .nav-user .btn { display: none; }
  .nav-links a { justify-content: center; padding: 10px; }
  .nav-links a .count { position: absolute; top: 2px; right: 2px; }
  .raise-cta { padding: 10px; }
  .nav-user { flex-direction: column; border: 0; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .layout, body.in-call .layout { display: block; padding: 0; }
  .nav { display: none; }
  .main { border: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom) + var(--admob-h, 0px)); min-height: auto; }
  .topbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 8; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .logo-text { font-size: 18px; }
  .page-head { top: 52px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 11px; flex: 1; justify-content: center; border-radius: 0; color: var(--muted); }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav a.raise svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--brand); color: #fff; margin-top: -18px; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 40%, transparent); }
  .bottom-nav .count { position: absolute; top: 4px; right: 22%; margin: 0; }
  .act .lbl { display: none; }
  .tool .lbl { display: none; }
  .post-actions { justify-content: space-between; margin-left: -6px; }
  .post-actions .grow { display: none; }
  .act { padding: 6px 5px; gap: 3px; }
  .post { padding: 12px; } .post-row { gap: 10px; }
  .rerise-head { margin-left: 52px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .thumb { width: 54px; height: 54px; }
  .issue-row .col.end .muted { display: none; }
  .gallery.g3, .gallery.g4 { grid-template-columns: 1fr 1fr; }
  .toasts { bottom: 84px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding: 32px 20px; }
  .chat { height: calc(100dvh - 52px - 72px); }
  body.in-call .bottom-nav, body.in-call .topbar { display: none; }
  body.in-call .main { padding-bottom: 0; }
  .call { height: 100dvh; }
  .call-chat { display: none; position: absolute; inset: 60px 0 70px; width: auto; background: var(--surface); z-index: 4; }
  .call.chat-open .call-chat { display: flex; }
  .call-body { position: relative; }
  #chatToggle { display: inline-block; }
  .video-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .ctl span { display: none; }
  .emoji-grid { grid-template-columns: repeat(7, 1fr); }
}

/* ---------- video uploads ---------- */

.post-video { position: relative; margin-bottom: 8px; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.post-video video { width: 100%; max-height: 520px; display: block; background: #000; }
.vid-len { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; pointer-events: none; }
.preview-wrap video.preview { width: 100%; max-height: 300px; border-radius: 12px; background: #000; }
.upload-bar { position: relative; height: 26px; margin-top: 6px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.upload-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--brand) 25%, transparent); transition: width .2s; }
.upload-bar span { position: relative; padding: 0 10px; line-height: 26px; font-weight: 600; }

/* ---------- live broadcast ---------- */

.live-badge { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 5px; vertical-align: middle; animation: pulse 1.6s infinite; }
.meter { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; white-space: nowrap; }
.meter span { display: inline-flex; align-items: center; gap: 4px; }
.meter .billing { color: var(--amber); font-weight: 700; }
.stage-empty { grid-column: 1 / -1; text-align: center; padding: 40px; color: #94a3b8; }
.role-chip { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.2); }
.chat-row .role-chip { background: var(--brand-50); color: var(--brand); }
.role-host { background: var(--red) !important; color: #fff !important; }
.role-guest { background: var(--violet) !important; color: #fff !important; }
.chat-row.from-stage { background: var(--brand-50); border-radius: 8px; padding: 4px 8px; }
.invite-form { display: flex; gap: 6px; }
.invite-form input { width: 190px; border-radius: 999px; padding: 8px 12px; }
.viewer-note { align-self: center; }
.is-viewer .video-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.billing-box { border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.billing-box ul { margin: 0; padding-left: 18px; }
.warn-text { color: var(--amber); }
@media (prefers-color-scheme: dark) { .billing-box { background: #2a1d04; border-color: #713f12; } }
@media (max-width: 720px) {
  .meter { font-size: 12px; padding: 4px 8px; }
  .invite-form input { width: 140px; }
  .call-head { flex-wrap: wrap; }
}

/* ---------- install banner (PWA) ---------- */

.install-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 90; width: min(94vw, 460px); display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
@media (max-width: 720px) { .install-bar { bottom: calc(80px + env(safe-area-inset-bottom)); } }
@media (display-mode: standalone) { .install-bar { display: none; } }

.danger-zone { margin: 8px 16px 24px; border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.danger-zone > summary { color: var(--red); }

/* ---------- sponsored ads ---------- */

.ad-card { background: color-mix(in srgb, var(--brand-50) 35%, var(--surface)); }
.ad-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sponsored { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--surface); }
.ad-body { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); color: var(--text); }
.ad-body:hover { border-color: var(--brand); text-decoration: none; }
.ad-body img { width: 100%; max-height: 300px; object-fit: cover; }
.ad-text { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.ad-body:not(:has(img)) .ad-text { padding-top: 12px; }
.ad-cta { align-self: flex-start; margin: 0 12px 12px; }
.menu-note { padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; max-width: 260px; }
.ad-create { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1000px) { .ad-create { grid-template-columns: minmax(0, 1fr) 280px; } .ad-create aside { position: sticky; top: 70px; align-self: start; } }
.ad-row { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.admin-ad { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.admin-ad-preview { max-width: 420px; }

/* ---------- ideas ---------- */

.idea-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.idea-card:hover { border-color: var(--brand); text-decoration: none; }
.idea-title { font-size: 16px; line-height: 1.3; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.idea-detail { display: flex; flex-direction: column; gap: 10px; }
.idea-detail h1 { margin: 0; font-size: 22px; }
.idea-detail h3 { margin: 8px 0 0; font-size: 15px; }
.idea-detail p { margin: 0; }
.idea-response { border-left: 4px solid var(--brand); }
.pick-list { max-height: 260px; overflow: auto; }

.grievance-ref { background: var(--brand-50); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.confirm-card .row { flex-wrap: wrap; }

/* ---------- language toggle ---------- */
.lang-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 13px; cursor: pointer; min-width: 40px; }
.lang-toggle:hover { border-color: var(--brand); color: var(--brand); }
.nav-lang { padding: 4px 12px; }
