/* ============================================================
   CivicVoice — Facebook-style layout
   Base type is 16px for easy reading; nothing on the page is under 14px.
   ============================================================ */
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #050505;
  --text-2: #65676b;
  --text-3: #8a8d91;
  --line: #e4e6eb;
  --hover: #f2f2f2;
  --press: #e4e6eb;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --brand-soft-2: #e0e7ff;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.2);
  --shadow-2: 0 2px 8px rgba(0,0,0,.18);
  --topbar: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 var(--font);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }

/* ---------- Top bar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar); z-index: 50;
  background: var(--card); box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; height: 100%; padding: 0 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark svg { display: block; }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: -.3px; color: var(--brand); }
.search { position: relative; display: flex; align-items: center; max-width: 320px; width: 100%; }
.search > svg { position: absolute; left: 12px; width: 18px; height: 18px; fill: var(--text-2); pointer-events: none; }
.search input {
  width: 100%; height: 40px; border: 0; border-radius: 20px; background: var(--bg);
  padding: 0 14px 0 38px; outline: none; font-size: 16px;
}
.search input:focus { background: #e8eaee; }
.top-nav { display: flex; gap: 4px; justify-self: center; }
.top-nav a {
  display: flex; align-items: center; justify-content: center; width: 96px; height: var(--topbar);
  border-bottom: 3px solid transparent; color: var(--text-2); border-radius: 8px 8px 0 0;
}
.top-nav a:hover { background: var(--hover); text-decoration: none; }
.top-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.top-nav a.active:hover { background: transparent; }
.top-nav svg { width: 28px; height: 28px; fill: currentColor; }
.top-nav .nav-label { display: none; }
.top-actions .btn .nav-label { margin-left: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--text);
}
.icon-btn:hover { background: #d8dadf; }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--card);
}
.avatar-btn { padding: 0; border: 0; background: transparent; border-radius: 50%; }
.menu {
  position: absolute; right: 0; top: 48px; width: 280px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-2); padding: 8px; z-index: 60;
}
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 0; background: transparent; color: var(--text); text-align: left; font-size: 16px;
}
.menu a:hover, .menu button:hover { background: var(--hover); text-decoration: none; }
.menu .menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .menu-head b { display: block; }
.menu svg { width: 20px; height: 20px; fill: var(--text-2); }
.top-actions { position: relative; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: calc(var(--topbar) + 16px) 16px 32px;
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 24px; align-items: start;
}
.col-left, .col-right { position: sticky; top: calc(var(--topbar) + 16px); }
.col-main { display: flex; flex-direction: column; gap: 16px; max-width: 680px; margin: 0 auto; width: 100%; }
.layout.wide { grid-template-columns: 280px minmax(0, 1fr); }
.layout.wide .col-right { display: none; }
.layout.wide .col-main { max-width: 920px; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.layout.single .col-left, .layout.single .col-right { display: none; }
.layout.single .col-main { max-width: 720px; }

/* Left nav */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: var(--text); font-weight: 600; border: 0; background: transparent; text-align: left; width: 100%;
}
.side-nav a:hover, .side-nav button:hover { background: var(--press); text-decoration: none; }
.side-nav a.active { color: var(--brand); background: var(--brand-soft); }
.side-nav svg { width: 26px; height: 26px; fill: currentColor; flex: 0 0 auto; }
.side-nav .badge { position: static; margin-left: auto; border: 0; }
.side-section { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-section h4 { margin: 0 0 8px 12px; font-size: 15px; color: var(--text-2); font-weight: 700; }
.side-person { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--text); }
.side-person:hover { background: var(--press); text-decoration: none; }
.side-person .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-person .sub { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 14px 16px; }
.card h3 { margin: 0 0 10px; font-size: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 0; }
.card-head h3 { margin: 0; font-size: 17px; color: var(--text-2); }
.link-btn { background: transparent; border: 0; color: var(--brand); font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--brand-soft); }

/* Avatars */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; color: #fff; background: #94a3b8; overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.md { width: 48px; height: 48px; font-size: 20px; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; }
.avatar.xl { width: 168px; height: 168px; font-size: 64px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 8px; border: 0; font-weight: 600; font-size: 15px; background: var(--line); color: var(--text); white-space: nowrap;
}
.btn:hover { background: #d8dadf; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-follow.following { background: var(--line); color: var(--text); }
.btn-follow.following:hover { background: #fee2e2; color: var(--red); }
.btn-follow.following:hover .label { display: none; }
.btn-follow.following:hover::after { content: "Unfollow"; }

/* Pills / chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 17px; border: 0; background: var(--line); font-weight: 600; font-size: 14px; color: var(--text);
}
.chip:hover { background: #d8dadf; }
.chip.active { background: var(--brand); color: #fff; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .2px;
  background: var(--line); color: var(--text-2); text-transform: capitalize;
}
.pill.local { background: #dcfce7; color: #166534; }
.pill.state { background: #dbeafe; color: #1e40af; }
.pill.national { background: #fce7f3; color: #9d174d; }
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.rejected { background: #fee2e2; color: #991b1b; }
.pill.approved { background: #dcfce7; color: #166534; }
.verified { display: inline-flex; vertical-align: -3px; margin-left: 4px; }
.verified svg { width: 18px; height: 18px; fill: var(--brand); }

/* Feed tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; padding: 12px 8px; border: 0; background: transparent; font-weight: 700; color: var(--text-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button:hover { background: var(--hover); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }

/* Composer */
.composer { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.composer button.prompt {
  flex: 1; text-align: left; height: 42px; border-radius: 21px; border: 0; background: var(--bg); color: var(--text-2);
  padding: 0 16px; font-size: 16px;
}
.composer button.prompt:hover { background: #e4e6ea; }
.composer-actions { display: flex; border-top: 1px solid var(--line); margin: 0 16px; }
.composer-actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 0; background: transparent; font-weight: 600; color: var(--text-2); border-radius: 8px; }
.composer-actions button:hover { background: var(--hover); }
.composer-actions svg { width: 22px; height: 22px; }

/* Post / poll cards */
.post { display: flex; flex-direction: column; }
.post-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 0; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .name { font-weight: 700; display: inline; }
.post-head .name a { color: var(--text); }
.post-head .meta { font-size: 14px; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.post-head .meta a { color: var(--text-2); }
.post-body { padding: 10px 16px 4px; }
.post-title { font-size: 19px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.post-title a { color: var(--text); }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-text.clamped { max-height: 9.8em; overflow: hidden; position: relative; }
.post-text.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(transparent, #fff); }
.see-more { background: transparent; border: 0; color: var(--text-2); font-weight: 600; padding: 2px 0; }
.see-more:hover { text-decoration: underline; }
.post-stats { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 14px; color: var(--text-2); }
.post-actions { display: flex; border-top: 1px solid var(--line); margin: 0 12px; padding: 4px 0; }
.post-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 6px; border: 0; background: transparent;
  border-radius: 6px; color: var(--text-2); font-weight: 600; font-size: 15px;
}
.post-actions button:hover { background: var(--hover); }
.post-actions button.on { color: var(--brand); }
.post-actions svg { width: 20px; height: 20px; fill: currentColor; }
.kebab { margin-left: auto; }

/* Comments */
.comments { border-top: 1px solid var(--line); padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .bubble { background: var(--bg); border-radius: 16px; padding: 8px 12px; max-width: 100%; }
.comment .bubble b { font-size: 14px; }
.comment .bubble p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .ctime { font-size: 13px; color: var(--text-2); margin: 2px 0 0 12px; }
.comment .ctime button { background: transparent; border: 0; color: var(--text-2); font-size: 13px; padding: 0; margin-left: 10px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 160px; border: 0; border-radius: 18px; background: var(--bg);
  padding: 9px 14px; outline: none;
}
.comment-form textarea:focus { background: #e8eaee; }

/* Polls */
.poll-q { font-size: 19px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.poll-q a { color: var(--text); }
.poll-desc { color: var(--text-2); margin: 0 0 10px; }
.poll-options { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 12px; }
.poll-opt {
  text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 8px; padding: 10px 14px; font-weight: 600;
}
.poll-opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.poll-bar { position: relative; border-radius: 8px; background: var(--bg); padding: 10px 14px; overflow: hidden; }
.poll-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-soft-2); width: 0; transition: width .5s ease; }
.poll-bar.mine .fill { background: #c7d2fe; }
.poll-bar .lbl { position: relative; display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.poll-bar .lbl span:last-child { color: var(--text-2); font-weight: 700; }
.poll-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 16px 12px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }

/* Right sidebar widgets */
.widget .mini-poll { padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.widget .mini-poll:first-of-type { border-top: 0; }
.mini-poll .mq { font-weight: 700; margin: 0 0 4px; line-height: 1.3; }
.mini-poll .mq a { color: var(--text); }
.mini-poll .by { font-size: 14px; color: var(--text-2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.mini-poll .poll-options { padding: 0; gap: 6px; }
.mini-poll .poll-opt { padding: 8px 12px; font-size: 15px; }
.mini-poll .poll-bar { padding: 7px 12px; font-size: 15px; }
.widget .person-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.widget .person-row .info { flex: 1; min-width: 0; }
.widget .person-row .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget .person-row .info b a { color: var(--text); }
.widget .person-row .info span { font-size: 14px; color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget .foot { padding: 10px 16px 12px; }
.widget .empty { padding: 14px 16px; color: var(--text-2); }

/* Leader cards (directory) */
.leader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.leader-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 14px 14px; gap: 6px; }
.leader-card .avatar { margin-bottom: 4px; }
.leader-card b { font-size: 17px; }
.leader-card b a { color: var(--text); }
.leader-card .sub { font-size: 14px; color: var(--text-2); }
.leader-card .cnt { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }

/* Profile */
.profile-cover {
  height: 240px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #0ea5e9);
  background-size: cover; background-position: center; position: relative;
}
.profile-cover .cover-btn { position: absolute; right: 14px; bottom: 14px; }
.profile-top { display: flex; align-items: flex-end; gap: 18px; padding: 0 20px; margin-top: -48px; flex-wrap: wrap; }
.profile-top .avatar { border: 4px solid var(--card); box-shadow: var(--shadow); }
.profile-top .pinfo { flex: 1; min-width: 200px; padding: 8px 0 10px; }
.profile-top h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.profile-top .ptitle { color: var(--text-2); font-size: 16px; margin-top: 2px; }
.profile-top .pstats { display: flex; gap: 16px; margin-top: 8px; font-size: 15px; color: var(--text-2); flex-wrap: wrap; }
.profile-top .pstats b { color: var(--text); }
.profile-top .pbtns { display: flex; gap: 8px; padding-bottom: 14px; }
.profile-tabs { display: flex; border-top: 1px solid var(--line); margin-top: 8px; padding: 0 8px; }
.profile-tabs button { padding: 14px 16px; border: 0; background: transparent; font-weight: 700; color: var(--text-2); border-bottom: 3px solid transparent; }
.profile-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.profile-tabs button:hover { background: var(--hover); }
.about-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; padding: 14px 16px; }
.about-grid dt { color: var(--text-2); font-weight: 600; }
.about-grid dd { margin: 0; white-space: pre-wrap; }
.avatar-edit { position: relative; }
.avatar-edit .cam { position: absolute; right: 6px; bottom: 6px; width: 36px; height: 36px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; border: 1px solid #ccd0d5; border-radius: 8px; padding: 0 12px; background: var(--card); outline: none; font-size: 16px;
}
.field textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.field .hint { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.alert { padding: 12px 14px; border-radius: 8px; font-weight: 500; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); }
.alert-warn { background: #fef3c7; color: #92400e; }

/* Auth pages */
.auth { max-width: 440px; margin: 24px auto; }
.auth .logo { text-align: center; margin-bottom: 16px; }
.auth .logo b { display: block; font-size: 32px; color: var(--brand); letter-spacing: -.5px; }
.auth .logo p { margin: 4px 0 0; color: var(--text-2); }
.auth .card { padding: 20px; }
.auth .switch { text-align: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Empty states */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty-state svg { width: 64px; height: 64px; fill: #cbd5e1; margin-bottom: 8px; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; font-size: 20px; }
.empty-state p { margin: 0 0 14px; }
.loading { text-align: center; color: var(--text-3); padding: 24px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-more { text-align: center; padding: 6px 0 2px; }

/* Notifications */
.notif { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { background: var(--brand-soft); }
.notif .nmsg { flex: 1; }
.notif .ntime { font-size: 14px; color: var(--brand); font-weight: 600; }
.notif.read .ntime { color: var(--text-2); font-weight: 500; }
.notif .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-top: 8px; flex: 0 0 auto; }
.notif.read .dot { visibility: hidden; }

/* Admin */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px 16px; }
.stat { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-size: 26px; color: var(--brand); line-height: 1.1; }
.stat span { font-size: 14px; color: var(--text-2); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--text-2); font-size: 14px; border-top: 0; }
.table .actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 240px; }
.table-wrap { overflow-x: auto; }
.queue-item { padding: 14px 16px; border-top: 1px solid var(--line); }
.queue-item:first-child { border-top: 0; }
.queue-item .qh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.queue-item .qbody { background: var(--bg); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; margin: 8px 0; }
.queue-item .qactions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-select { height: 32px; border-radius: 6px; border: 1px solid #ccd0d5; padding: 0 6px; font-size: 14px; background: var(--card); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(255,255,255,.75); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 24px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); width: 100%; max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head .close { position: absolute; right: 12px; top: 12px; }
.modal-body { padding: 16px; }
.modal-foot { padding: 0 16px 16px; display: flex; gap: 8px; justify-content: flex-end; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row input { flex: 1; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(92vw, 420px); }
.toast { background: #1c1e21; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-2); font-weight: 500; animation: pop .2s ease; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Mobile bottom bar */
.bottombar { display: none; }
.mobile-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 16px; }
  .layout.wide { grid-template-columns: 220px minmax(0, 1fr); }
  .top-nav a { width: 72px; }
}
@media (max-width: 900px) {
  .layout, .layout.wide, .layout.single { grid-template-columns: minmax(0, 1fr); padding: calc(var(--topbar) + 12px) 12px 84px; }
  .col-left, .col-right { display: none; }
  .mobile-only { display: block; }
  .top-nav { display: none; }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .brand-name { display: none; }
  .topbar-left .search { max-width: none; flex: 1; }
  .bottombar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 62px; background: var(--card);
    box-shadow: 0 -1px 3px rgba(0,0,0,.12); z-index: 50; padding-bottom: env(safe-area-inset-bottom);
  }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); font-size: 12px; font-weight: 600; position: relative; }
  .bottombar a.active { color: var(--brand); }
  .bottombar svg { width: 26px; height: 26px; fill: currentColor; }
  .bottombar .badge { top: 6px; right: calc(50% - 22px); }
  .profile-cover { height: 160px; }
  .profile-top { margin-top: -40px; }
  .profile-top .avatar { width: 120px; height: 120px; font-size: 48px; }
  .profile-top h1 { font-size: 24px; }
  .about-grid { grid-template-columns: 1fr; }
  .modal-back { padding: 16px 8px; }
}
@media (max-width: 480px) {
  .search { max-width: none; }
  .search input { height: 36px; }
  .leader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .row { flex-direction: column; gap: 12px; }
}
