:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #21253a;
  --border: #2e3250;
  --text: #e8eaf0;
  --text-2: #9ca3c0;
  --muted: #5a6080;
  --accent: #6c8bff;
  --accent-hover: #5577f0;
  --accent-2: #b06cff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── AUTH ─────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(108,139,255,.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(176,108,255,.08) 0%, transparent 60%),
              var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo h1 { font-size: 26px; font-weight: 700; margin: 10px 0 4px; }
.auth-logo p { color: var(--text-2); font-size: 13px; }


/* ── FORMS ─────────────────────────────────────────── */
.auth-form, .grid-form { display: flex; flex-direction: column; gap: 16px; }
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full-width { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 500; color: var(--text-2); }

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
input[type=date] { color-scheme: dark; }

.form-error {
  background: rgba(248,113,113,.12);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  padding: 8px 12px;
  font-size: 13px;
}
.hint { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: rgba(248,113,113,.15); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.25); }
.btn-success { background: rgba(52,211,153,.15); color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.btn-success:hover { background: rgba(52,211,153,.25); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn.full { width: 100%; justify-content: center; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-2); padding: 4px; border-radius: 4px; transition: color .15s; }
.icon-btn:hover { color: var(--text); }

/* ── APP LAYOUT ─────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: rgba(108,139,255,.15); color: var(--accent); }

.badge {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  color: #fff;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-2); }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

/* ── PAGES ─────────────────────────────────────────── */
.page { display: none; flex-direction: column; flex: 1; }
.page.active { display: flex; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { font-size: 20px; font-weight: 600; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.page-tabs { display: flex; gap: 4px; }
.tab-btn {
  padding: 6px 14px;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-count {
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 0 5px;
  font-size: 11px;
}

/* ── TREE ─────────────────────────────────────────── */
.tree-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle, rgba(108,139,255,.04) 1px, transparent 1px) 0 0/30px 30px;
}
.tree-viewport {
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.tree-viewport:active { cursor: grabbing; }

.tree-node rect {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
  rx: 8;
  transition: stroke .15s;
}
.tree-node:hover rect { stroke: var(--accent); }
.tree-node.male rect { stroke-left: 3px solid var(--accent); }
.tree-node.deceased rect { opacity: .7; stroke-dasharray: 4 2; }

.tree-link { fill: none; stroke: var(--border); stroke-width: 1.5; }
.tree-marriage-link { fill: none; stroke: var(--warning); stroke-width: 1.5; stroke-dasharray: 4 3; }

/* ── MEMBERS GRID ─────────────────────────────────────────── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 28px;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.member-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }

.member-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.member-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-card-name { font-weight: 600; font-size: 14px; }
.member-card-dates { font-size: 12px; color: var(--text-2); }
.member-card-place { font-size: 11px; color: var(--muted); }

.search-input {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  width: 220px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* ── PROPOSALS ─────────────────────────────────────────── */
.proposals-list { padding: 16px 28px; display: flex; flex-direction: column; gap: 12px; }

.proposal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.proposal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.proposal-meta { flex: 1; }
.proposal-member { font-weight: 600; font-size: 15px; }
.proposal-by { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.proposal-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status-pending { background: rgba(251,191,36,.15); color: var(--warning); border: 1px solid rgba(251,191,36,.3); }
.status-approved { background: rgba(52,211,153,.15); color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.status-rejected { background: rgba(248,113,113,.15); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }

.proposal-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.change-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
}
.change-chip span { color: var(--text-2); }
.change-chip b { color: var(--accent); }

.proposal-description { font-size: 13px; color: var(--text-2); margin-bottom: 12px; font-style: italic; }

.proposal-confirmations {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.confirm-dots { display: flex; gap: 4px; }
.confirm-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.confirm-dot.filled { background: var(--success); border-color: var(--success); }

.proposal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── USERS TABLE ─────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 28px;
  width: calc(100% - 56px);
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table tr:hover td { background: var(--surface-2); }

.role-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.role-admin { background: rgba(108,139,255,.15); color: var(--accent); }
.role-member { background: var(--surface-2); color: var(--text-2); }

/* ── MEMBER DETAIL ─────────────────────────────────────────── */
.member-detail { display: flex; flex-direction: column; gap: 20px; }
.member-detail-top { display: flex; gap: 20px; align-items: flex-start; }
.member-detail-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  overflow: hidden; flex-shrink: 0;
}
.member-detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-detail-info h3 { font-size: 20px; font-weight: 700; }
.member-detail-info p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-row { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.detail-value { font-size: 14px; }
.detail-bio { color: var(--text-2); font-size: 13px; line-height: 1.6; padding-top: 8px; border-top: 1px solid var(--border); }
.detail-burial { padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.detail-burial-place { font-size: 13px; color: var(--text-2); }
.detail-burial-map { height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; }
.detail-relations { display: flex; flex-wrap: wrap; gap: 8px; }
.relation-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px; cursor: pointer;
  text-decoration: none; color: var(--text); transition: border-color .15s;
}
.relation-chip:hover { border-color: var(--accent); color: var(--accent); }
.relation-label { color: var(--muted); margin-right: 2px; }

/* Upload area */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: border-color .15s;
  margin-top: 8px;
}
.photo-upload-area:hover { border-color: var(--accent); color: var(--accent); }

/* ── MODALS ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-lg { max-width: 640px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 20px; line-height: 1;
  padding: 2px 6px; border-radius: 4px; transition: color .15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}
.modal-footer > div { display: flex; gap: 8px; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  padding: 48px 24px;
}
.empty-state p { font-size: 14px; }

/* ── TOAST ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── UTILITIES ─────────────────────────────────────────── */
.hidden { display: none !important; }
.sep { width: 1px; height: 16px; background: var(--border); }

/* ── BURIAL MAP CARD ──────────────────────────────────── */
.burial-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.burial-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.burial-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.burial-card input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.burial-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.burial-map-hint {
  font-size: 11px;
  color: var(--text-2);
}
#burial-map {
  height: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 0;
}
.burial-coords {
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}
.burial-clear-btn { align-self: flex-start; }

/* ── ACCOUNT PAGE ─────────────────────────────────────── */
.account-content {
  padding: 20px 28px;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.account-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ── MOBILE BOTTOM NAV ─────────────────────────────────── */
.mobile-bottom-nav {
  display: none; /* скрыто везде по умолчанию */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 0 2px;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 9px;
  font-weight: 500;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: color .15s;
  position: relative;
}
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item svg { flex-shrink: 0; }
.mob-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
}

/* Десктоп: скрываем мобильный нав принудительно */
@media (min-width: 768px) {
  .mobile-bottom-nav { display: none !important; }
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 767px) {

  /* App — фиксированная высота экрана */
  .app {
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  /* Sidebar — hidden, replaced by bottom nav */
  .sidebar { display: none; }

  /* Main content fills remaining height, scrollable */
  .main-content {
    margin-left: 0;
    height: 100%;
    overflow-y: auto;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  /* Tree container — reset min-height, flex:1 сам займёт остаток */
  .tree-container { min-height: 300px; }

  /* Auth — full-screen card on small phones */
  .auth-screen { align-items: flex-start; padding: 0; }
  .auth-card {
    border-radius: 0;
    min-height: 100svh;
    padding: 48px 24px 32px;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Page header */
  .page-header {
    padding: 14px 16px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-header h2 { font-size: 18px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .search-input { flex: 1; min-width: 0; width: auto; }

  /* Tabs in proposals */
  .page-tabs { width: 100%; }
  .tab-btn { flex: 1; justify-content: center; padding: 6px 8px; font-size: 11px; }

  /* Tree zoom buttons smaller */
  #page-tree .page-actions { gap: 4px; }

  /* Members grid — 2 columns */
  .members-grid {
    grid-template-columns: 1fr 1fr;
    padding: 12px 12px;
    gap: 10px;
  }
  .member-card { padding: 14px 10px; gap: 8px; }
  .member-photo { width: 52px; height: 52px; font-size: 18px; }
  .member-card-name { font-size: 13px; }

  /* Proposals */
  .proposals-list { padding: 12px 12px; }
  .proposal-card { padding: 14px; }
  .proposal-header { flex-direction: column; gap: 8px; }
  .proposal-status { align-self: flex-start; }
  .proposal-actions { flex-direction: column; }
  .proposal-actions .btn { width: 100%; justify-content: center; }

  /* Grid form — single column */
  .grid-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .field.full-width { grid-column: 1; }

  /* Modal — bottom sheet */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 92svh;
    animation: sheetUp .25s ease;
  }
  .modal-header { padding: 16px 20px 14px; }
  .modal-body { padding: 16px 20px; }
  .modal-footer {
    padding: 12px 20px;
    flex-direction: column-reverse;
    gap: 8px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .modal-footer .btn,
  .modal-footer > div { width: 100%; }
  .modal-footer .btn { justify-content: center; }
  .modal-footer > div { display: flex; flex-direction: column; gap: 8px; }

  /* Member detail photo + info stack */
  .member-detail-top { flex-direction: column; align-items: center; text-align: center; }
  .detail-grid { grid-template-columns: 1fr; }

  /* Account page */
  .account-content { padding: 16px 12px; }
  .account-section { padding: 16px; }

  /* Users table — horizontal scroll */
  #users-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 12px; }
  .data-table { margin: 16px 0; width: 100%; min-width: 480px; }

  /* Toast — bottom center above nav */
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .toast { max-width: 100%; }

}

@media (max-width: 400px) {
  .members-grid { grid-template-columns: 1fr; }
  .tab-btn span { display: none; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
