:root {
  /* Brand */
  --primary: #22345c;
  --primary-dark: #172542;
  --primary-light: #2e4474;
  --accent: #d64541;
  --accent-dark: #b93a36;
  --accent-blue: #3b5bd6;

  /* Surfaces */
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #182338;
  --muted: #576070;
  --danger: #d64541;
  --danger-dark: #c0322e;
  --warn: #e0a13c;
  --info: #3b5bd6;
  --line: #e5e7eb;

  /* Semantic fills */
  --success-bg: #dcfce7;
  --success-text: #166534;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --info-bg: #dbeafe;
  --info-text: #1e40af;
  --private-bg: #f3e8ff;
  --private-text: #6b21a8;

  /* Shape */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  /* Shadow layers */
  --shadow-sm: 0 1px 2px rgba(34, 52, 92, 0.04), 0 1px 3px rgba(34, 52, 92, 0.06);
  --shadow: 0 4px 12px rgba(34, 52, 92, 0.06), 0 2px 4px rgba(34, 52, 92, 0.04);
  --shadow-md: 0 8px 24px rgba(34, 52, 92, 0.08), 0 4px 12px rgba(34, 52, 92, 0.04);
  --shadow-lg: 0 16px 40px rgba(34, 52, 92, 0.12), 0 6px 16px rgba(34, 52, 92, 0.06);
  --shadow-fab: 0 8px 24px rgba(214, 69, 65, 0.32), 0 4px 10px rgba(214, 69, 65, 0.20);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

#app {
  width: 100%;
  max-width: 390px;
  min-height: 100%;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 16px 32px;
  animation: fadeIn .28s var(--ease-out);
}

#screen-board {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  min-height: 44px;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar-title h1 {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.topbar-title #boardVenueName {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: color .2s, background-color .2s, transform .1s;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-btn:active:not(:disabled) {
  transform: scale(0.92);
  color: var(--primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.text-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  transition: color .2s, background-color .2s;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.text-btn:active {
  color: var(--primary);
  background: rgba(34, 52, 92, 0.06);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .2s, border-color .2s, background-color .2s;
  min-height: 44px;
}

.lang-toggle:active {
  transform: scale(0.94);
  border-color: rgba(34, 52, 92, 0.25);
  background: rgba(34, 52, 92, 0.03);
}

.lang-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  transition: background-color .2s, color .2s;
  pointer-events: none;
}

.lang-seg.active {
  background: var(--primary);
  color: #fff;
}

/* Geo chip */
.geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
  min-height: 34px;
}

.geo-in { background: var(--success-bg); color: var(--success-text); }
.geo-out { background: var(--warn-bg); color: var(--warn-text); }
.geo-unknown { background: #f3f4f6; color: #4b5563; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(34, 52, 92, 0.04);
  transition: box-shadow .2s, transform .15s;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.hint.red { color: var(--danger); }
.hint.warn { color: var(--warn-text); }

/* Forms */
label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #374151;
}

input, select, textarea {
  width: 100%;
  padding: 15px 14px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 16px;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, transform .1s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(34, 52, 92, 0.08);
}

input:disabled, select:disabled, textarea:disabled {
  background: #f9fafb;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: transform .1s var(--ease-spring), box-shadow .2s, background-color .2s, opacity .2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: not-allowed;
  background: #e5e7eb;
  color: #9ca3af;
  box-shadow: none;
  transform: none !important;
  opacity: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 52, 92, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-primary:active:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(34, 52, 92, 0.15);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-secondary:active:not(:disabled) {
  background: #f3f4f6;
}

.btn-danger {
  background: #c0322e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(214, 69, 65, 0.18);
}

.btn-danger:active:not(:disabled) {
  background: var(--accent-dark);
}

.btn-small {
  display: inline-block;
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-xs);
  min-height: 44px;
  min-width: 44px;
}

.fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  right: 18px;
  width: auto;
  padding: 16px 24px;
  border-radius: 50px;
  background: var(--accent);
  box-shadow: var(--shadow-fab);
  z-index: 40;
  font-weight: 800;
}

.fab:active:not(:disabled) {
  background: var(--accent-dark);
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(214, 69, 65, 0.25);
}

@media (max-width: 350px) {
  .fab { left: 16px; right: 16px; }
}

/* Login */
.login-wrap {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  /* fixed, self-fitting login: exactly one viewport, no scroll in any direction */
  height: 100vh;            /* fallback for browsers without dvh */
  height: 100dvh;
  min-height: 100dvh;       /* override .screen's min-height:100vh */
  overflow: hidden;
  overscroll-behavior: none;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.login-wrap::before {
  content: '';
  position: absolute;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(34, 52, 92, 0.22) 0%, rgba(34, 52, 92, 0.04) 45%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.login-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.logo {
  font-size: 56px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.logo-img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  display: block;
  box-shadow: 0 16px 40px rgba(34, 52, 92, 0.28), 0 6px 16px rgba(34, 52, 92, 0.16);
  border: 3px solid rgba(255, 255, 255, 0.6);
}

.app-name {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.tagline {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  color: #333;
  border: 1.5px solid var(--line);
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  box-shadow: var(--shadow-md);
  transition: transform .1s var(--ease-spring), box-shadow .2s, border-color .2s, background-color .2s;
  position: relative;
  z-index: 1;
}

.google-btn:hover {
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

.google-btn:active {
  transform: scale(0.98);
  background: #f9fafb;
}

.google-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.login-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.login-footer {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.login-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 14px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  color: #a82824;   /* darker scarf-red: >=4.5:1 on --bg */
  text-decoration: none;
  border-radius: var(--radius-pill);
  position: relative;
  z-index: 1;
  transition: background-color .2s, transform .1s;
}
.login-support:hover { background: rgba(168, 40, 36, 0.08); }
.login-support:active { transform: scale(0.96); }

/* email login */
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.login-or::before, .login-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-email {
  width: 100%;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.login-email input { margin-bottom: 10px; }
.login-email #emailSwitch { margin-top: 6px; align-self: center; }

/* Short viewports (small phones, landscape, keyboard open): compress so the
   fixed no-scroll login still fits without clipping. */
@media (max-height: 720px) {
  .login-wrap {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .logo { margin-bottom: 8px; }
  .logo-img { width: 68px; height: 68px; border-radius: 16px; }
  .app-name { font-size: 22px; margin-bottom: 3px; }
  .tagline { margin-bottom: 12px; font-size: 14px; }
  .google-btn { padding: 12px 20px; font-size: 16px; }
  .login-or { margin: 10px 0; }
  .login-email input { margin-bottom: 8px; }
  .login-note { margin-top: 8px; }
  .login-footer { margin-top: 6px; }
  .login-support { margin-top: 2px; min-height: 40px; }
}

/* Confirm dialog */
.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn { flex: 1; }

.confirm-dialog { align-items: center; }

.confirm-dialog .sheet {
  border-radius: var(--radius);
  padding-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

/* Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid rgba(34, 52, 92, 0.04);
  transition: transform .12s var(--ease-spring), box-shadow .2s, border-color .2s;
}

.row:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

.row-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.row-title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.row-meta {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.badge-public { background: var(--info-bg); color: var(--info-text); }
.badge-private { background: var(--private-bg); color: var(--private-text); }
.badge-pending { background: var(--warn-bg); color: var(--warn-text); }
.badge-admin { background: var(--info-bg); color: var(--info-text); }

/* Group board */
.section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 24px 0 12px;
  padding-left: 4px;
}

.court-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  border-left: 5px solid var(--primary);
  position: relative;
  overflow: hidden;
  transition: transform .12s, box-shadow .2s;
}

.court-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-blue));
  opacity: 0.15;
}

.court-card:active {
  transform: scale(0.99);
}

.court-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}
.court-header > div:first-child { min-width: 0; }

.court-name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.court-captain {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}

.court-time {
  font-size: 16px;
  font-weight: 800;
  margin: 10px 0;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.court-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.account-chip {
  background: #eef1f8;
  color: #374151;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  border: 1px solid rgba(34, 52, 92, 0.05);
  border-left: 2px solid rgba(34, 52, 92, 0.3);
}

.release-btn {
  font-size: 13px;
  color: #c0322e;
  background: #fef2f2;
  border: none;
  padding: 7px 13px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-weight: 700;
  transition: background-color .2s, transform .1s;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.release-btn:active {
  transform: scale(0.96);
  background: #fee2e2;
}

/* Account pool */
.pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pool-chip {
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  cursor: default;   /* board pool is informational; only claim-sheet chips are selectable */
  border: 2px solid transparent;
  user-select: none;
  transition: transform .12s var(--ease-spring), box-shadow .2s, background-color .2s, border-color .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

/* only the claim-sheet pool chips are interactive */
#claimPool .pool-chip.pool-available { cursor: pointer; }

.pool-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

#claimPool .pool-chip.pool-available:active {
  transform: scale(0.95);
}

.pool-available {
  background: #e8ecf7;
  color: var(--primary);
  border: 1.5px solid rgba(34, 52, 92, 0.12);
  box-shadow: var(--shadow-sm);
}

#claimPool .pool-chip.pool-available:hover {
  box-shadow: var(--shadow);
}

.pool-available.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 52, 92, 0.08);
}

.pool-available.selected::before {
  background: #fff;
  opacity: 1;
  box-shadow: inset 0 0 0 1.5px #fff;
}

.pool-locked {
  background: #f3f4f6;
  color: var(--muted);
  cursor: default;
  border-style: dashed;
  border-color: #e5e7eb;
}

.pool-locked::before {
  opacity: 0.35;
}

/* Sheet / modal */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 35, 56, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 50;
}

.sheet-overlay.active { display: flex; }

.sheet {
  background: var(--card);
  width: 100%;
  max-width: 390px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px 18px calc(34px + env(safe-area-inset-bottom));
  animation: slideUp .32s var(--ease-out);
  box-shadow: 0 -8px 40px rgba(24, 35, 56, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.8; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sheet-title {
  font-size: 19px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.02em;
}

.close-sheet {
  background: #f3f4f6;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s, color .2s, transform .1s;
  line-height: 1;
}

.close-sheet:active {
  transform: scale(0.92);
  background: #e5e7eb;
  color: var(--text);
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toggle {
  width: 52px;
  min-height: 44px;
  padding: 7px 0;
  background: transparent;
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
  transition: background-color .25s var(--ease-spring);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 0;
  width: 52px;
  height: 30px;
  background: var(--line);
  border-radius: var(--radius-pill);
  transition: background-color .25s var(--ease-spring);
}

.toggle.on::before { background: var(--primary); }

.toggle::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s var(--ease-spring);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.toggle.on::after { transform: translateX(22px); }

/* Time presets */
.time-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.time-presets .btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  min-height: 44px;
}

/* Empty */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.empty-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
}

.empty-illo {
  width: 148px;
  height: 148px;
  display: block;
  margin: 0 auto 14px;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

/* Avatars */
.avatar-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform .1s;
}
.avatar-btn:active { transform: scale(0.94); }
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card);
  box-shadow: var(--shadow-sm);
  background: #eef1f8;
  display: block;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.avatar-opt {
  padding: 0;
  border: 3px solid transparent;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  aspect-ratio: 1;
  overflow: hidden;
  transition: border-color .2s, transform .1s;
}
.avatar-opt img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-opt.selected { border-color: var(--primary); }
.avatar-opt:active { transform: scale(0.93); }

/* Member admin */
.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.member-row:last-child { border-bottom: none; }
.member-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }

.member-row .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Reveal dialog */
.reveal-row {
  background: #f9fafb;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(34, 52, 92, 0.05);
}

.reveal-name {
  font-weight: 800;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

.reveal-field {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 3px;
}

.reveal-value {
  font-size: 18px;
  font-weight: 800;
  font-family: ui-monospace, monospace;
  word-break: break-all;
  color: var(--text);
  letter-spacing: -0.01em;
}

.reveal-mask {
  filter: blur(5px);
  cursor: pointer;
  user-select: none;
  color: var(--primary);
  transition: filter .2s;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(24, 35, 56, 0.92);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .35s var(--ease-out);
  max-width: calc(100% - 32px);
  text-align: center;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: rgba(185, 28, 28, 0.92);
}

/* Utility */
.mt-2 { margin-top: 14px; }
.status-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 500;
}
.spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
