/* ============================================================
   PeaceBridge — shared stylesheet  (v2, publish-ready)
   Clean, trustworthy, community-focused. Blue + green accents.
   ============================================================ */

:root {
  /* Brand */
  --blue-50:  #eef4fe;
  --blue-100: #d9e7fd;
  --blue-500: #2f6fe4;
  --blue-600: #1f5bd0;
  --blue-700: #1848a8;
  --green-50:  #e9f8f1;
  --green-100: #cff0e0;
  --green-500: #17a56d;
  --green-600: #108a5a;
  --green-700: #0c6e48;

  /* Neutrals */
  --bg:        #eef2f8;
  --surface:   #ffffff;
  --surface-2: #f5f7fb;
  --border:    #e4e9f1;
  --ink:       #1a2534;
  --ink-2:     #51607a;
  --ink-3:     #8a97ad;

  /* Feedback */
  --red-50:  #fdeeee;
  --red-500: #d64545;
  --red-600: #b93838;
  --amber-50:  #fdf5e6;
  --amber-600: #b07514;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(23, 35, 56, .04), 0 6px 20px rgba(23, 35, 56, .06);
  --shadow-lg: 0 10px 40px rgba(23, 35, 56, .16), 0 2px 8px rgba(23, 35, 56, .08);
  --grad-brand: linear-gradient(135deg, var(--blue-600), var(--green-500));
  --grad-blue:  linear-gradient(135deg, #2f6fe4, #1a4fc0);
  --grad-green: linear-gradient(135deg, #1cb377, #0f8a58);

  --topbar-h: 62px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* motion */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
/* Staff-only elements stay hidden until JS confirms the viewer is staff. */
html:not(.is-staff) .staff-only { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue-100); }

img, svg { display: block; max-width: 100%; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* slim scrollbars */
* { scrollbar-width: thin; scrollbar-color: #c3cddd transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c3cddd; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes grad-pan { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Cross-page fade (Chromium; harmless no-op elsewhere) */
@view-transition { navigation: auto; }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes vt-out { to { opacity: 0; } }
::view-transition-old(root) { animation: vt-out .14s ease both; }
::view-transition-new(root) { animation: vt-in .22s var(--ease-out) both; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  border: 1.5px solid transparent;
  transition: background .16s, color .16s, border-color .16s, box-shadow .16s, transform .12s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.98); }

.btn-primary { background: var(--grad-blue); color: #fff; box-shadow: 0 3px 12px rgba(31, 91, 208, .3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(31, 91, 208, .42); filter: brightness(1.06); transform: translateY(-1px); }

.btn-green { background: var(--grad-green); color: #fff; box-shadow: 0 3px 12px rgba(16, 138, 90, .28); }
.btn-green:hover { box-shadow: 0 6px 20px rgba(16, 138, 90, .4); filter: brightness(1.06); transform: translateY(-1px); }

.btn-soft { background: var(--blue-50); color: var(--blue-700); }
.btn-soft:hover { background: var(--blue-100); }

.btn-soft-green { background: var(--green-50); color: var(--green-700); }
.btn-soft-green:hover { background: var(--green-100); }

.btn-outline { border-color: var(--border); background: var(--surface); color: var(--ink); }
.btn-outline:hover { border-color: #b9c5d8; background: var(--surface-2); }

.btn-danger { background: var(--red-50); color: var(--red-600); }
.btn-danger:hover { background: #f9dcdc; }

.btn-danger-solid { background: linear-gradient(135deg, #de5454, #c23a3a); color: #fff; box-shadow: 0 3px 12px rgba(214, 69, 69, .3); }
.btn-danger-solid:hover { filter: brightness(1.06); }

.btn-sm { padding: 6px 13px; font-size: 13.5px; }
.btn-lg { padding: 13px 26px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--ink-2); background: transparent;
  position: relative; flex: none;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 21px; height: 21px; transition: transform .25s var(--ease-spring); }
.icon-btn:hover svg { transform: scale(1.12); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red-500); border: 2px solid var(--surface);
}

/* ------------------------------------------------------------
   Badges, pills, avatars
   ------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid transparent;
}
.badge svg { width: 12px; height: 12px; }
.badge-blue   { background: var(--blue-50);  color: var(--blue-700); border-color: var(--blue-100); }
.badge-green  { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.badge-red    { background: var(--red-50);   color: var(--red-600); border-color: #f2caca; }
.badge-amber  { background: var(--amber-50); color: var(--amber-600); border-color: #f3dfb6; }
.badge-dark   { background: var(--ink);      color: #fff; }
.badge-gray   { background: var(--surface-2); color: var(--ink-3); }

.pill {
  margin-left: auto;
  background: var(--blue-600); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
}
.pill-green { background: var(--green-600); }
.pill-gray  { background: var(--ink-3); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  font-weight: 700; font-size: 15px; color: #fff;
  background: var(--grad-brand);
  flex: none; user-select: none;
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, .12);
}
.avatar:hover { text-decoration: none; }
button.avatar, a.avatar { cursor: pointer; transition: box-shadow .2s ease, transform .25s var(--ease-spring); }
button.avatar:hover, a.avatar:hover { box-shadow: 0 0 0 3px var(--blue-100), inset 0 -8px 14px rgba(0,0,0,.12); transform: scale(1.05); }
.avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 112px; height: 112px; font-size: 40px; border: 5px solid var(--surface); box-shadow: 0 6px 20px rgba(23,35,56,.18); }
.av-b  { background: linear-gradient(135deg, #2f6fe4, #6d9bf0); }
.av-g  { background: linear-gradient(135deg, #17a56d, #5cc79c); }
.av-t  { background: linear-gradient(135deg, #0f8f9c, #48bcc7); }
.av-p  { background: linear-gradient(135deg, #7a5fd0, #a48ee6); }
.av-o  { background: linear-gradient(135deg, #d97a2b, #eaa668); }
.av-r  { background: linear-gradient(135deg, #c94f6d, #e08ba0); }

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2351607a' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.select-inline { width: auto; padding: 7px 34px 7px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.checkbox-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--blue-600); flex: none; }

/* Toggle switch */
.switch {
  width: 46px; height: 26px; border-radius: 999px; flex: none;
  background: #c8d1de; position: relative;
  transition: background .25s ease;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left .3s var(--ease-spring);
}
.switch[aria-checked="true"] { background: var(--green-500); }
.switch[aria-checked="true"] .knob { left: 23px; }

/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  transition: box-shadow .3s ease, background .3s ease;
}
.topbar.scrolled {
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 24px rgba(23, 35, 56, .09);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 21px; font-weight: 800; color: var(--ink);
  letter-spacing: -.3px; flex: none;
}
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-logo {
  width: 37px; height: 37px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-brand);
  color: #fff; flex: none;
  box-shadow: 0 3px 10px rgba(31, 91, 208, .35);
}
.brand-logo svg { width: 21px; height: 21px; }

.search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 999px; padding: 8px 16px;
  color: var(--ink-3);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--blue-500); background: var(--surface); box-shadow: 0 0 0 3px var(--blue-100); }
.search svg { width: 17px; height: 17px; flex: none; }
.search input { border: none; background: none; outline: none; font: inherit; width: 100%; color: var(--ink); }

.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hamburger { display: none; }

/* Popover menus (notifications, account) */
.pop-wrap { position: relative; }
.pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 82;
  width: 330px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
}
.pop.open { display: block; animation: pop-in .3s var(--ease-spring); }
.pop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 6px;
}
.pop-head h4 { font-size: 15px; }
.pop-head button { font-size: 12.5px; font-weight: 600; color: var(--blue-600); }
.pop-row {
  display: flex; gap: 11px; align-items: flex-start; width: 100%;
  padding: 10px 12px; border-radius: 11px; text-align: left;
  color: inherit;
}
.pop-row:hover { background: var(--surface-2); text-decoration: none; }
.pop-row .grow { flex: 1; min-width: 0; }
.pop-row strong { display: block; font-size: 13.5px; }
.pop-row .sub { font-size: 12.5px; color: var(--ink-3); }
.pop-row .npin { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); margin-top: 7px; flex: none; }
.pop-row svg.mi { width: 19px; height: 19px; color: var(--ink-2); flex: none; margin-top: 1px; }
.pop-sep { height: 1px; background: var(--border); margin: 6px 10px; }
.pop-row.danger { color: var(--red-600); }
.pop-row.danger svg.mi { color: var(--red-600); }

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */
.modal-back {
  position: fixed; inset: 0; z-index: 92;
  background: rgba(15, 23, 38, .52);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-back.open { display: flex; }
.modal-back.open { animation: vt-in .2s ease both; }
.modal {
  width: min(500px, 100%);
  max-height: 90vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  animation: pop-in .32s var(--ease-spring);
}
.modal h3 { font-size: 19px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* ------------------------------------------------------------
   App shell — 3 column layout
   ------------------------------------------------------------ */
.shell {
  max-width: 1360px; margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 24px 16px 90px;
  align-items: start;
}
.shell-2col { grid-template-columns: 280px minmax(0, 1fr); }
.main { min-width: 0; display: grid; gap: 18px; align-content: start; }

/* Left sidebar nav */
.sidenav {
  position: sticky; top: calc(var(--topbar-h) + 24px);
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow-y: auto;
  display: grid; gap: 6px; align-content: start;
  padding-right: 4px;
}
.nav-group { display: grid; gap: 2px; }
.nav-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3);
  margin: 14px 14px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 10px 14px; border-radius: 12px;
  font-weight: 600; font-size: 15px; color: var(--ink-2);
  position: relative;
  transition: background .15s, color .15s, transform .22s var(--ease-out);
}
.nav-item svg { width: 21px; height: 21px; flex: none; }
.nav-item:hover { background: #e6ecf5; color: var(--ink); text-decoration: none; transform: translateX(3px); }
.nav-item.active:hover { transform: none; }
.nav-item.active { background: linear-gradient(90deg, var(--blue-50), rgba(238, 244, 254, .4)); color: var(--blue-700); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3.5px; border-radius: 99px; background: var(--grad-brand);
}
.nav-item.active svg { color: var(--blue-600); }

.side-note {
  margin-top: 14px;
  background: linear-gradient(135deg, var(--green-50), var(--blue-50));
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  padding: 15px 16px;
  font-size: 13.5px; color: var(--ink-2);
}
.side-note strong { display: flex; align-items: center; gap: 7px; color: var(--green-700); font-size: 14px; margin-bottom: 5px; }
.side-note strong svg { width: 16px; height: 16px; }

/* Right sidebar */
.rightbar {
  position: sticky; top: calc(var(--topbar-h) + 24px);
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow-y: auto;
  display: grid; gap: 18px; align-content: start;
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid rgba(228, 233, 241, .8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: rise .45s var(--ease-out) both;
  transition: box-shadow .3s ease;
}

/* staggered entrance for the main column */
.main > :nth-child(1) { animation-delay: .02s; }
.main > :nth-child(2) { animation-delay: .06s; }
.main > :nth-child(3) { animation-delay: .1s; }
.main > :nth-child(4) { animation-delay: .14s; }
.main > :nth-child(5) { animation-delay: .18s; }
.main > :nth-child(6) { animation-delay: .22s; }
.main > :nth-child(n+7) { animation-delay: .26s; }
.rightbar > :nth-child(1) { animation-delay: .12s; }
.rightbar > :nth-child(2) { animation-delay: .18s; }
.rightbar > :nth-child(n+3) { animation-delay: .24s; }
.card-tight { padding: 16px; }
.card h3 { font-size: 16.5px; margin-bottom: 4px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; }
.card-head .link-sm { font-size: 13.5px; font-weight: 600; }
.card-sub { color: var(--ink-2); font-size: 14px; }

.list { display: grid; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-size: 14.5px; }
.list-row .sub { font-size: 13px; color: var(--ink-3); }

/* Page header block */
.page-head h1 { font-size: 27px; letter-spacing: -.5px; }
.page-head p { color: var(--ink-2); margin-top: 4px; max-width: 62ch; }
.page-head { display: grid; gap: 2px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   Tabs
   ------------------------------------------------------------ */
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
}
.tab {
  padding: 10px 16px;
  font-weight: 600; font-size: 14.5px; color: var(--ink-2);
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
  border-radius: 8px 8px 0 0;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--ink); background: rgba(238, 244, 254, .7); }
.tab.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.tab .count { color: var(--ink-3); font-weight: 700; margin-left: 5px; font-size: 13px; }
.tab.active .count { color: var(--blue-600); }
[data-panel] { display: none; }
[data-panel].active { display: block; }
[data-panel].active.grid-gap { display: grid; gap: 18px; }

/* Segmented chips (group filters etc.) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1.5px solid var(--border);
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: #b9c5d8; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }

/* ------------------------------------------------------------
   Composer
   ------------------------------------------------------------ */
.composer .composer-top { display: flex; gap: 12px; align-items: flex-start; }
.composer textarea {
  flex: 1; border: none; resize: none; outline: none;
  font: inherit; font-size: 16.5px; color: var(--ink);
  min-height: 56px; padding-top: 8px; width: 100%;
}
.composer textarea::placeholder { color: var(--ink-3); }
.composer-bar {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 12px; padding-top: 12px;
  flex-wrap: wrap;
}
.composer-tool {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px;
  transition: background .15s;
}
.composer-tool:hover { background: var(--surface-2); text-decoration: none; }
.composer-tool svg { width: 17px; height: 17px; }
.composer-tool .tg { color: var(--green-600); }
.composer-tool .tb { color: var(--blue-600); }
.composer-tool .tp { color: #7a5fd0; }
.composer-tool.on { background: var(--blue-50); color: var(--blue-700); }
.composer-bar .btn { margin-left: auto; }

/* photo preview in composer */
.photo-preview { position: relative; margin-top: 10px; }
.photo-preview img { border-radius: 12px; width: 100%; max-height: 300px; object-fit: cover; }
.photo-preview .icon-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(20, 28, 40, .65); color: #fff;
}
.photo-preview .icon-btn:hover { background: rgba(20, 28, 40, .85); }

/* poll builder in composer */
.poll-builder {
  margin-top: 12px; display: grid; gap: 8px;
  background: var(--surface-2); border-radius: 12px; padding: 12px;
}
.poll-builder .row .input { background: var(--surface); }
.poll-builder .pb-note { font-size: 12.5px; color: var(--ink-3); }

/* Audience selector */
.audience-wrap { position: relative; display: inline-block; }
.audience-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2);
  padding: 5px 12px; border-radius: 999px;
  transition: background .15s;
}
.audience-btn:hover { background: #e8edf5; }
.audience-btn svg { width: 13px; height: 13px; }
.audience-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 260px; padding: 6px; display: none;
}
.audience-menu.open { display: block; animation: pop-in .16s ease; }
.audience-menu button {
  display: flex; gap: 11px; align-items: flex-start; width: 100%;
  padding: 9px 11px; border-radius: 8px; text-align: left;
}
.audience-menu button:hover { background: var(--surface-2); }
.audience-menu button.selected { background: var(--blue-50); }
.audience-menu svg { width: 17px; height: 17px; margin-top: 2px; color: var(--ink-2); flex: none; }
.audience-menu strong { display: block; font-size: 14px; }
.audience-menu span { font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------
   Posts
   ------------------------------------------------------------ */
.post-head { display: flex; gap: 12px; align-items: center; position: relative; }
.pop.gen { min-width: 235px; top: calc(100% + 2px); }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who strong { font-size: 15px; }
.post-head .who strong a { color: inherit; }
.post-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-3); flex-wrap: wrap;
}
.post-meta svg { width: 12.5px; height: 12.5px; }
.post-meta .aud { display: inline-flex; align-items: center; gap: 4px; }
.post-body { margin-top: 12px; font-size: 15.5px; }
.post-body p + p { margin-top: 10px; }
.topic-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--blue-50); color: var(--blue-700);
  font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  margin-bottom: 10px;
}
.post-image {
  margin-top: 12px; border-radius: 12px;
  min-height: 190px;
  display: flex; align-items: flex-end; padding: 14px;
  color: #fff; font-weight: 600; font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.post-image img { border-radius: 12px; width: 100%; max-height: 380px; object-fit: cover; }
.post-stats {
  display: flex; gap: 14px; align-items: center;
  font-size: 13.5px; color: var(--ink-3);
  padding: 12px 2px 10px;
  border-bottom: 1px solid var(--border);
}
.post-stats .likes { display: inline-flex; align-items: center; gap: 6px; }
.post-stats .likes .heart {
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--grad-brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.post-stats .likes .heart svg { width: 11px; height: 11px; color: #fff; }
.post-stats .right { margin-left: auto; display: flex; gap: 14px; }

.post-actions { display: flex; gap: 4px; padding-top: 8px; }
.post-action {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 6px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.post-action svg { width: 19px; height: 19px; }
.post-action:hover { background: var(--surface-2); text-decoration: none; }
.post-action.liked { color: var(--blue-600); }
.post-action.liked svg { fill: var(--blue-600); animation: like-pop .45s var(--ease-spring); }

/* Comments */
.comments { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 14px; display: grid; gap: 12px; }
.comment { display: flex; gap: 10px; }
.comment-bubble {
  background: var(--surface-2);
  border-radius: 4px 16px 16px 16px;
  padding: 9px 14px; font-size: 14.5px;
  max-width: 100%;
}
.comment-bubble strong { display: block; font-size: 13.5px; }
.comment-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; padding-left: 8px; }
.comment-meta button { font-weight: 600; color: var(--ink-3); font-size: 12.5px; }
.comment-meta button:hover { color: var(--blue-600); }
.comment-form { display: flex; gap: 10px; align-items: center; }
.comment-form input {
  flex: 1; border: none; background: var(--surface-2);
  border-radius: 999px; padding: 10px 16px;
  font: inherit; outline: none;
}
.comment-form input:focus { box-shadow: 0 0 0 2px var(--blue-500); }

/* Shared / quoted post */
.quoted {
  margin-top: 12px; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
  background: var(--surface-2);
}
.quoted .post-head .avatar { width: 34px; height: 34px; font-size: 12.5px; }
.quoted .post-body { margin-top: 8px; font-size: 14.5px; }

/* ------------------------------------------------------------
   Polls
   ------------------------------------------------------------ */
.poll { margin-top: 14px; display: grid; gap: 9px; }
.poll-option {
  position: relative; overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 600; font-size: 14.5px; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.poll-option:hover { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.poll-fill {
  position: absolute; inset: 0; width: 0;
  background: linear-gradient(90deg, var(--blue-50), #e4eefc);
  transition: width .8s var(--ease-out);
  z-index: 0;
}
.poll-option > span { position: relative; z-index: 1; }
.poll-pct { color: var(--ink-2); font-size: 13.5px; min-width: 40px; text-align: right; }
.poll.voted .poll-option { cursor: default; }
.poll.voted .poll-option:hover { border-color: var(--border); box-shadow: none; }
.poll.voted .poll-option.chosen { border-color: var(--blue-600); }
.poll.voted .poll-option.chosen .poll-fill { background: linear-gradient(90deg, var(--blue-100), #cbdefb); }
.poll-meta { font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------
   Settings pages
   ------------------------------------------------------------ */
.setting {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.setting:last-child { border-bottom: none; padding-bottom: 4px; }
.setting:first-of-type { padding-top: 6px; }
.setting-info { flex: 1; min-width: 0; }
.setting-info strong { display: block; font-size: 15px; }
.setting-info p { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.setting .select-inline { flex: none; }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; margin-bottom: 2px;
}
.section-title svg { width: 21px; height: 21px; color: var(--blue-600); }
.section-title.green svg { color: var(--green-600); }

/* Alert banners */
.banner {
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; gap: 14px; align-items: flex-start;
  animation: rise .35s ease both;
}
.banner svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.banner strong { display: block; margin-bottom: 3px; }
.banner p { font-size: 14px; }
.banner .banner-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.banner-warn  { background: var(--amber-50); color: #7c5410; border: 1px solid #f3dfb6; }
.banner-warn svg { color: var(--amber-600); }
.banner-danger { background: var(--red-50); color: #7f2d2d; border: 1px solid #f2caca; }
.banner-danger svg { color: var(--red-500); }
.banner-info  { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); }
.banner-green { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }

/* Session / device rows */
.device-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.device-icon svg { width: 22px; height: 22px; }
.device-icon.alert { background: var(--red-50); color: var(--red-500); }

/* ------------------------------------------------------------
   Tables (admin)
   ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3);
  padding: 10px 12px; border-bottom: 1.5px solid var(--border);
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfd; }
.table .cell-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table .who-cell { display: flex; align-items: center; gap: 10px; }
tr.row-done { opacity: .55; }

/* Admin stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(228, 233, 241, .8);
  box-shadow: var(--shadow); padding: 16px 18px;
  border-top: 4px solid var(--blue-600);
  animation: rise .35s ease both;
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat.green { border-top-color: var(--green-500); }
.stat.amber { border-top-color: #e0a52e; }
.stat.red   { border-top-color: var(--red-500); }
.stat .num { font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
.stat .lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat .delta { font-size: 12.5px; margin-top: 3px; color: var(--ink-3); }
.stat .delta.up { color: var(--green-600); }
.stat .delta.down { color: var(--red-500); }

/* simple bar chart */
.chart { display: flex; gap: 10px; align-items: flex-end; height: 150px; padding-top: 8px; }
.chart .bar-w {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px;
}
.chart .bar {
  width: 100%; max-width: 40px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #5a8ceb, var(--blue-600));
  transition: filter .15s;
}
.chart .bar:hover { filter: brightness(1.12); }
.chart .bar.g { background: linear-gradient(180deg, #35c48b, var(--green-600)); }
.chart .lbl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--blue-600); }
.chart-legend i.g { background: var(--green-600); }

/* Review queue cards */
.review-item { border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.review-item + .review-item { margin-top: 12px; }
.review-excerpt {
  background: var(--surface-2); border-left: 3px solid var(--ink-3);
  border-radius: 6px; padding: 10px 14px;
  font-size: 14px; color: var(--ink-2); margin: 10px 0 12px;
  font-style: italic;
}
.review-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-foot .spacer { flex: 1; }

/* ------------------------------------------------------------
   Messages / chat
   ------------------------------------------------------------ */
.chat-layout {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(228, 233, 241, .8);
  box-shadow: var(--shadow); overflow: hidden;
  height: calc(100vh - var(--topbar-h) - 48px);
  min-height: 480px;
}
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 16px 16px 0; }
.chat-list-head h2 { font-size: 20px; margin-bottom: 10px; }
.chat-list-scroll { overflow-y: auto; flex: 1; padding: 8px; }
.convo {
  display: flex; gap: 11px; align-items: center; width: 100%;
  padding: 11px 12px; border-radius: 12px; text-align: left;
  transition: background .12s;
}
.convo:hover { background: var(--surface-2); }
.convo.active { background: var(--blue-50); }
.convo .grow { flex: 1; min-width: 0; }
.convo strong { display: block; font-size: 14.5px; }
.convo .last { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.unread .last { color: var(--ink); font-weight: 600; }
.convo .when { font-size: 12px; color: var(--ink-3); flex: none; }
.convo .dot { width: 10px; height: 10px; background: var(--blue-600); border-radius: 50%; flex: none; }

.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-pane-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  position: relative;
}
.chat-pane-head .pop.gen { top: calc(100% - 6px); right: 12px; }
.chat-pane-head strong { font-size: 15.5px; display: block; }
.chat-pane-head .sub { font-size: 12.5px; color: var(--green-600); font-weight: 600; }
.chat-pane-head .grow { flex: 1; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px 18px; display: grid; gap: 10px; align-content: start; }
.chat-note {
  justify-self: center; text-align: center;
  font-size: 12.5px; color: var(--ink-3);
  background: var(--surface-2); border-radius: 999px;
  padding: 6px 16px; max-width: 90%;
  display: flex; gap: 6px; align-items: center;
}
.chat-note svg { width: 13px; height: 13px; flex: none; }
.msg { max-width: 72%; padding: 9px 14px; font-size: 14.5px; border-radius: 16px; width: fit-content; animation: rise .25s ease both; }
.msg.in  { background: var(--surface-2); border-bottom-left-radius: 4px; justify-self: start; }
.msg.out { background: var(--grad-blue); color: #fff; border-bottom-right-radius: 4px; justify-self: end; }
.msg-time { font-size: 11.5px; color: var(--ink-3); padding: 0 6px; }
.msg-time.out { justify-self: end; }
.chat-input {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1; border: none; background: var(--surface-2);
  border-radius: 999px; padding: 11px 18px;
  font: inherit; outline: none;
}
.chat-input input:focus { box-shadow: 0 0 0 2px var(--blue-500); }

/* Message request card */
.request-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.request-card + .request-card { margin-top: 10px; }
.request-card .req-head { display: flex; gap: 11px; align-items: center; }
.request-card .req-msg {
  background: var(--surface-2); border-radius: 10px;
  padding: 9px 13px; font-size: 13.5px; color: var(--ink-2);
  margin: 10px 0;
}
.request-card .req-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   Groups
   ------------------------------------------------------------ */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.group-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(228, 233, 241, .8);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  animation: rise .35s ease both;
  transition: transform .18s, box-shadow .18s;
}
.group-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.group-card:hover .group-cover { transform: scale(1.06); }
.group-cover { height: 88px; position: relative; transition: transform .6s var(--ease-out); }
.group-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.14));
}
.group-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.group-body h3 { font-size: 16px; }
.group-body .desc { font-size: 13.5px; color: var(--ink-2); flex: 1; }
.group-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.gc-1 { background: linear-gradient(120deg, #1f5bd0, #4d8bef); }
.gc-2 { background: linear-gradient(120deg, #108a5a, #3dbb8b); }
.gc-3 { background: linear-gradient(120deg, #0f8f9c, #43b8c4); }
.gc-4 { background: linear-gradient(120deg, #7a5fd0, #a48ee6); }
.gc-5 { background: linear-gradient(120deg, #d97a2b, #ecad72); }
.gc-6 { background: linear-gradient(120deg, #35507a, #5f7ba8); }

/* ------------------------------------------------------------
   Profile
   ------------------------------------------------------------ */
.profile-hero {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(228, 233, 241, .8);
  box-shadow: var(--shadow); overflow: hidden;
  animation: rise .35s ease both;
}
.profile-cover {
  height: 210px;
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(23,165,109,.55), transparent 60%),
    radial-gradient(500px 260px at 15% 90%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(115deg, var(--blue-700), var(--blue-500) 55%, var(--green-500));
}
.profile-row {
  display: flex; gap: 18px; align-items: flex-end;
  padding: 0 24px 20px; margin-top: -48px;
  flex-wrap: wrap;
}
.profile-id { flex: 1; min-width: 200px; padding-top: 54px; }
.profile-id h1 { font-size: 25px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-id .handle { color: var(--ink-3); font-size: 14.5px; }
.profile-id .bio { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; max-width: 56ch; }
.profile-actions { display: flex; gap: 10px; padding-top: 54px; flex-wrap: wrap; }
.profile-stats {
  display: flex; gap: 28px; padding: 14px 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.profile-stats b { font-size: 17px; }
.profile-stats span { color: var(--ink-3); font-size: 13.5px; display: block; }

/* About rows with visibility markers */
.about-row { display: flex; gap: 13px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.about-row:last-child { border-bottom: none; }
.about-row svg { width: 19px; height: 19px; color: var(--ink-3); flex: none; }
.about-row .vis { margin-left: auto; }

/* ------------------------------------------------------------
   Landing page
   ------------------------------------------------------------ */
.land-nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.land-nav-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 20px;
}
.land-links { display: flex; gap: 20px; margin-left: 12px; }
.land-links a { color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.land-links a:hover { color: var(--blue-600); text-decoration: none; }
.land-nav-inner .cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.hero {
  background:
    radial-gradient(900px 420px at 110% -10%, rgba(23,165,109,.16), transparent 65%),
    radial-gradient(800px 420px at -10% 0%, rgba(47,111,228,.14), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
/* slow ambient glow blobs */
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px); pointer-events: none;
}
.hero::before {
  width: 440px; height: 440px; top: -140px; left: -130px;
  background: radial-gradient(circle, rgba(47,111,228,.28), transparent 68%);
  animation: float-y 11s ease-in-out infinite;
}
.hero::after {
  width: 400px; height: 400px; bottom: -160px; right: -90px;
  background: radial-gradient(circle, rgba(23,165,109,.26), transparent 68%);
  animation: float-y 13s ease-in-out infinite reverse;
}
.hero-inner { position: relative; z-index: 1; }
.hero-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px;
  padding: 80px 20px 88px; align-items: center;
}
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); letter-spacing: -1.4px; line-height: 1.1; }
.hero h1 em { font-style: normal; background: var(--grad-blue); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .grn { background: var(--grad-green); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-top: 18px; font-size: 18px; color: var(--ink-2); max-width: 54ch; }
.hero-ctas { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 20px; margin-top: 26px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.hero-trust span { display: inline-flex; gap: 7px; align-items: center; font-weight: 600; }
.hero-trust svg { width: 16px; height: 16px; color: var(--green-600); }
.hero-art { min-width: 0; animation: float-y 7s ease-in-out infinite; }

.land-section { max-width: 1120px; margin: 0 auto; padding: 76px 20px; }
.land-section > h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.6px; text-align: center; }
.land-section > .sect-sub { text-align: center; color: var(--ink-2); max-width: 62ch; margin: 12px auto 0; font-size: 16.5px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 44px; }
.feature {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(228, 233, 241, .8);
  box-shadow: var(--shadow); padding: 26px 24px;
  border-top: 4px solid var(--blue-600);
  transition: transform .18s, box-shadow .18s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature:nth-child(even) { border-top-color: var(--green-500); }
.feature .f-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-50); color: var(--blue-600); margin-bottom: 15px;
  transition: transform .35s var(--ease-spring);
}
.feature:hover .f-icon { transform: scale(1.1) rotate(-4deg); }
.feature:nth-child(even) .f-icon { background: var(--green-50); color: var(--green-600); }
.feature .f-icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 17.5px; margin-bottom: 7px; }
.feature p { font-size: 14.5px; color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 44px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid rgba(228,233,241,.8); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px 24px; transition: transform .18s, box-shadow .18s; }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-brand);
  color: #fff; font-weight: 800; font-size: 15px; margin-bottom: 13px;
  box-shadow: 0 3px 10px rgba(31,91,208,.3);
}
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { font-size: 14.5px; color: var(--ink-2); }

.stats-band {
  background: linear-gradient(115deg, var(--blue-700), var(--blue-600) 45%, var(--green-600), var(--blue-600));
  background-size: 220% 220%;
  animation: grad-pan 16s ease infinite;
  color: #fff;
}
.stats-band-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 26px; padding: 56px 20px; text-align: center;
}
.stats-band b { display: block; font-size: 38px; letter-spacing: -1px; }
.stats-band span { opacity: .85; font-size: 14.5px; }

.cta-panel {
  background:
    radial-gradient(500px 200px at 90% -20%, rgba(23,165,109,.12), transparent 60%),
    radial-gradient(500px 200px at 10% 120%, rgba(47,111,228,.1), transparent 60%),
    var(--surface);
  border: 1px solid rgba(228,233,241,.8);
  border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 56px 28px; text-align: center;
  max-width: 860px; margin: 0 auto;
}
.cta-panel h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.5px; }
.cta-panel p { color: var(--ink-2); margin: 12px auto 26px; max-width: 52ch; }

.footer { background: #141e2c; color: #b6c2d4; margin-top: 40px; }
.footer-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px; padding: 52px 20px 36px;
}
.footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer a { display: block; color: #b6c2d4; font-size: 14px; padding: 4px 0; }
.footer a:hover { color: #fff; }
.footer button.flink { display: block; color: #b6c2d4; font-size: 14px; padding: 4px 0; text-align: left; }
.footer button.flink:hover { color: #fff; }
.footer .brand { color: #fff; margin-bottom: 10px; }
.footer .brand em { background: linear-gradient(135deg, #7db4ff, #6fe3ae); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer p { font-size: 13.5px; max-width: 34ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 18px 20px; text-align: center; font-size: 13px; color: #8b99ad;
}

/* ------------------------------------------------------------
   Auth page
   ------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-side {
  background:
    radial-gradient(700px 400px at 20% 110%, rgba(23,165,109,.35), transparent 60%),
    radial-gradient(500px 300px at 90% 0%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(150deg, var(--blue-700), var(--blue-600));
  color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: center; gap: 26px;
}
.auth-side .brand { color: #fff; font-size: 24px; }
.auth-side .brand em { background: linear-gradient(135deg, #cfe2ff, #9ff0cd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side h2 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.6px; max-width: 18ch; }
.auth-points { display: grid; gap: 16px; max-width: 420px; }
.auth-points div { display: flex; gap: 13px; align-items: flex-start; font-size: 14.5px; color: #dbe7fb; }
.auth-points svg { width: 20px; height: 20px; color: #9ff0cd; flex: none; margin-top: 1px; }
.auth-points b { color: #fff; display: block; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card .card { padding: 28px; }
.auth-switch { text-align: center; font-size: 14.5px; color: var(--ink-2); margin-top: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.code-inputs { display: flex; gap: 9px; justify-content: center; }
.code-inputs input {
  width: 46px; height: 54px; text-align: center;
  font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.code-inputs input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.auth-step { display: none; }
.auth-step.active { display: block; animation: rise .3s ease both; }

/* ------------------------------------------------------------
   Toasts
   ------------------------------------------------------------ */
.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: rgba(23, 33, 48, .95); color: #fff;
  backdrop-filter: blur(6px);
  border-radius: 13px; padding: 13px 18px;
  font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; gap: 11px; align-items: center;
  animation: toast-in .25s ease;
}
.toast svg { width: 18px; height: 18px; color: #6fe3ae; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------
   Mobile bottom nav + drawer
   ------------------------------------------------------------ */
.mobilenav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 55;
  display: none;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.mobilenav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  padding: 5px 0; border-radius: 9px;
}
.mobilenav a:hover { text-decoration: none; }
.mobilenav a svg { width: 22px; height: 22px; }
.mobilenav a.active { color: var(--blue-600); }

.backdrop {
  position: fixed; inset: 0; z-index: 64;
  background: rgba(20, 28, 40, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.backdrop.show { opacity: 1; pointer-events: auto; }

/* Security helpers */
.code-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  font-family: ui-monospace, Consolas, monospace; font-size: 14px;
  margin-bottom: 16px;
}
.code-grid span {
  background: var(--surface-2); border-radius: 8px;
  padding: 8px 10px; text-align: center; letter-spacing: .06em; font-weight: 600;
}
.qr-box {
  width: 150px; height: 150px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; margin: 0 auto 14px; background: #fff;
}

/* ------------------------------------------------------------
   Utilities
   ------------------------------------------------------------ */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.muted { color: var(--ink-3); font-size: 13.5px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.search-hidden { display: none !important; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 260px minmax(0, 1fr); }
  .rightbar { display: none; }
}

@media (max-width: 920px) {
  .shell, .shell-2col { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .hamburger { display: inline-flex; }
  .sidenav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: min(300px, 84vw); max-height: none;
    background: var(--surface);
    padding: 18px 14px;
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidenav.open { transform: none; }
  .mobilenav { display: flex; }
  .search { max-width: none; }
  .top-actions .icon-btn:not(.keep) { display: none; }

  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - 92px); }
  .chat-list { display: none; }
  .chat-layout.show-list .chat-list { display: flex; }
  .chat-layout.show-list .chat-pane { display: none; }
  .chat-back { display: inline-flex !important; }

  .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 56px; gap: 34px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .land-links { display: none; }
}

@media (max-width: 560px) {
  .brand-name { display: none; }
  .profile-cover { height: 150px; }
  .msg { max-width: 86%; }
  .footer-inner { grid-template-columns: 1fr; }
  .code-inputs input { width: 40px; height: 48px; }
  .setting { flex-wrap: wrap; }
  .pop { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 8px); width: auto; }
}
.chat-back { display: none; }
