/* ── Day Word Play — custom styles ─────────────────────────────────────────── */

:root {
  --bg: #E8E5DF;
  --bg-card: #F0EDE8;
  --bg-pill: #E0DBD3;
  --text-primary: #1C1C1E;
  --text-secondary: #6B6B6B;
  --text-muted: #9A9A9A;
  --accent: #4A7C7C;
  --accent-light: rgba(74, 124, 124, 0.12);
  --accent-hover: #3A6A6A;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --tab-h: 76px;
  --header-h: 64px;

  /* Override Pico */
  --pico-background-color: var(--bg);
  --pico-primary: var(--accent);
  --pico-primary-hover: var(--accent-hover);
  --pico-font-family: 'Inter', -apple-system, sans-serif;
  --pico-border-radius: var(--radius-sm);
}

* { box-sizing: border-box; }

html {
  overflow: hidden;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  margin: 0 auto;
  padding: 0;
  font-family: var(--pico-font-family);
  max-width: 480px;
  height: 100%;
  overflow: hidden;
}

/* ── Loading ─────────────────────────────────────────────────────────────────*/
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: var(--bg);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── App Shell ───────────────────────────────────────────────────────────────*/
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ── Top Header ──────────────────────────────────────────────────────────────*/
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  height: var(--header-h);
  background: var(--bg);
  flex-shrink: 0;
}

.avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-primary);
  transition: opacity 0.15s;
}
.avatar-btn svg { color: var(--text-primary); }
.avatar-btn:hover { opacity: 0.75; }

.app-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.header-left { width: 44px; }
.header-right { width: 44px; }

.help-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: opacity 0.15s;
}
.help-btn svg { width: 20px; height: 20px; }
.help-btn:hover { opacity: 0.75; }

.help-content { margin-top: 8px; }
.help-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.help-step-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.help-example {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Page Content ────────────────────────────────────────────────────────────*/
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
  padding-bottom: calc(var(--tab-h) + 16px);
}

/* ── Bottom Tab Bar ──────────────────────────────────────────────────────────*/
.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--tab-h);
  padding: 0 8px 8px;
  background: var(--bg);
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.active { color: var(--accent); }
.tab-btn.tab-center {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 24px;
  flex-direction: row;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow);
}
.tab-btn.tab-center svg { width: 18px; height: 18px; }

/* ── Word Sub-Tabs ───────────────────────────────────────────────────────────*/
.word-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin: 8px 0 0;
}

.word-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.2px;
}

.word-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Word Display ────────────────────────────────────────────────────────────*/
.word-display {
  text-align: center;
  padding: 40px 0 32px;
}

.word-main {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 16px;
}


.word-definition {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-primary);
  max-width: 340px;
  margin: 0 auto;
}

.word-pos {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Sentence Input ──────────────────────────────────────────────────────────*/
.sentence-section {
  margin-top: 8px;
}

.sentence-section h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sentence-input-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.sentence-input-wrap textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  outline: none;
  color: var(--text-primary);
  min-height: 80px;
  font-family: inherit;
}

.sentence-input-wrap textarea::placeholder { color: var(--text-muted); }

.sentence-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.submitted-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.submitted-card .checkmark {
  font-size: 32px;
  margin-bottom: 8px;
}

.submitted-sentence-text {
  font-size: 16px;
  line-height: 1.6;
  font-style: italic;
  color: var(--text-primary);
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-pill);
  border-radius: var(--radius-sm);
}

/* ── Etymology Box ───────────────────────────────────────────────────────────*/
.etymology-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.etymology-card strong { color: var(--text-primary); }

/* ── Sentence Cards (Vote view) ──────────────────────────────────────────────*/
.vote-date { font-size: 13px; color: var(--text-muted); margin-top: 4px; text-align: center; margin-bottom: 12px; }

.sentence-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.sentence-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.sentence-card.voted { border-color: var(--accent); }
.sentence-card.winner { border-color: #C8A84B; background: #FDFAF0; }

.sentence-card-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 12px;
}

.sentence-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sentence-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.voted { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.vote-btn.mine { opacity: 0.3; cursor: default; }
.vote-btn svg { width: 14px; height: 14px; }

.winner-badge {
  font-size: 11px;
  font-weight: 700;
  color: #C8A84B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Group Section ───────────────────────────────────────────────────────────*/
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-top: 24px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.group-list { display: flex; flex-direction: column; gap: 10px; }

.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.group-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.group-card.active { border-color: var(--accent); }

.group-card-info { flex: 1; }
.group-name { font-weight: 600; font-size: 16px; }
.group-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.group-code-badge {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.join-btn {
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.join-btn:hover { opacity: 0.8; }

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: border-color 0.15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Search Input ────────────────────────────────────────────────────────────*/
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.search-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px 12px 40px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

/* ── Leaderboard ─────────────────────────────────────────────────────────────*/
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.leaderboard-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.leaderboard-entry.top-1 { border-color: #C8A84B; background: #FDFAF0; }
.leaderboard-entry.top-2 { border-color: #A0A0A8; }
.leaderboard-entry.top-3 { border-color: #B07A50; }

.rank-badge {
  font-size: 18px;
  font-weight: 800;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.rank-1 { color: #C8A84B; }
.rank-2 { color: #A0A0A8; }
.rank-3 { color: #B07A50; }

.lb-name { flex: 1; font-weight: 600; font-size: 15px; }

.lb-votes {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}
.lb-votes strong { display: block; font-size: 18px; color: var(--text-primary); font-weight: 700; }

/* ── Dictionary ──────────────────────────────────────────────────────────────*/
.page-content.dict-active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dict-sticky-header {
  flex-shrink: 0;
  background: var(--bg);
  z-index: 20;
  padding-bottom: 4px;
}
.dict-scroll-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.dictionary-list { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }

.dict-letter-section { margin-bottom: 4px; }

.dict-letter-header {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  padding: 16px 4px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.dict-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 10px;
}
.dict-word {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dict-pos { font-size: 13px; color: var(--text-muted); font-style: italic; }
.dict-def { font-size: 14px; line-height: 1.6; color: var(--text-secondary); margin-top: 4px; }

.dict-winning-sentence {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.dict-winning-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.dict-winning-text {
  font-size: 14px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}
.dict-winning-author {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.dict-winning-mine {
  background: linear-gradient(135deg, #FFF8E1, #FFE082);
  border: 1.5px solid #FFD54F;
  border-radius: var(--radius-sm);
  padding: 12px;
  border-top: 1.5px solid #FFD54F;
}
.dict-winning-mine .dict-winning-label {
  color: #B8860B;
}

/* ── Alphabet Scroll Index ──────────────────────────────────────────────────*/
.dictionary-container {
  display: flex;
  flex-direction: row;
  gap: 0;
}
.dictionary-container .dictionary-list {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}
.dictionary-list {
  padding-right: 28px;
}
.alpha-index {
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 10;
  padding: 6px 2px;
  background: rgba(232, 229, 223, 0.85);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.alpha-index-letter {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.1s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.alpha-index-letter:hover {
  color: var(--text-primary);
  transform: scale(1.3);
}
.alpha-index-letter.active {
  color: var(--text-primary);
  transform: scale(1.6);
  font-weight: 800;
}

/* ── Profile View ────────────────────────────────────────────────────────────*/
.profile-header {
  text-align: center;
  padding: 32px 0 24px;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 12px;
}
.profile-name { font-size: 22px; font-weight: 700; }
.profile-username { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

.stats-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.danger-btn {
  background: none;
  border: 1px solid rgba(220,53,69,0.3);
  color: #dc3545;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
  transition: background 0.15s;
}
.danger-btn:hover { background: rgba(220,53,69,0.08); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary svg { width: 16px; height: 16px; }
.btn-secondary:hover { background: var(--bg-pill); }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.browse-status {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.browse-status.joined { color: var(--accent); }
.browse-status.pending { color: #c59000; }

/* ── Auth Screen ─────────────────────────────────────────────────────────────*/
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
}
.auth-logo {
  width: 56px;
  height: 56px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-logo svg,
.auth-logo img { width: 100%; height: 100%; display: block; }
.auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: left;
  margin: 0;
  line-height: 1.1;
}
.auth-subtitle { font-size: 15px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

/* OAuth provider buttons (Google / Apple) */
.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.auth-oauth-btn:hover:not(:disabled) {
  background: var(--bg-card);
  border-color: var(--text-muted);
}
.auth-oauth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-oauth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-oauth-logo { width: 18px; height: 18px; flex-shrink: 0; }
.auth-oauth-apple .auth-oauth-logo { color: var(--text-primary); }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.auth-divider span { padding: 0 12px; }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }

.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.form-field input:focus { border-color: var(--accent); }

.auth-submit {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}
.auth-submit:hover { opacity: 0.8; }
.auth-submit:disabled { opacity: 0.4; }

/* ── No Group Prompt ─────────────────────────────────────────────────────────*/
.no-group-prompt {
  text-align: center;
  padding: 60px 20px;
}
.no-group-prompt .emoji { font-size: 48px; margin-bottom: 16px; }
.no-group-prompt h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.no-group-prompt p { color: var(--text-muted); margin-bottom: 24px; font-size: 15px; line-height: 1.6; }

/* ── Error Banner ────────────────────────────────────────────────────────────*/
.error-banner {
  background: rgba(220,53,69,0.1);
  border: 1px solid rgba(220,53,69,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #dc3545;
  font-size: 14px;
  margin: 10px 0;
}

.success-banner {
  background: rgba(74,124,124,0.1);
  border: 1px solid rgba(74,124,124,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--accent);
  font-size: 14px;
  margin: 10px 0;
}

/* ── Group Switcher ──────────────────────────────────────────────────────────*/
.group-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.group-switcher::-webkit-scrollbar { display: none; }

.group-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.group-chip.active { border-color: var(--text-primary); color: var(--text-primary); background: var(--bg-pill); }
.group-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── Utility ─────────────────────────────────────────────────────────────────*/
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 14px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.full-width { width: 100%; }

/* ── Swipe cards (profile group list) ───────────────────────────────────────*/
.swipe-card-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.swipe-action {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}
.swipe-action svg { width: 18px; height: 18px; }

.swipe-action-left {
  left: 0;
  background: var(--accent);
  color: #fff;
}

.swipe-action-right {
  right: 0;
  background: #E53935;
  color: #fff;
}

.swipe-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  will-change: transform;
  margin-bottom: 0 !important;
}

/* ── Reusable sentence pills ─────────────────────────────────────────────────*/
.reusable-sentences {
  margin-bottom: 14px;
  background: var(--accent-light);
  border: 1.5px solid rgba(74,124,124,0.2);
  border-radius: var(--radius);
  padding: 12px;
}
.reusable-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.reusable-header svg { width: 16px; height: 16px; color: var(--accent); }
.reusable-icon { display: flex; }
.reusable-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}
.reusable-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reusable-pill {
  background: #fff;
  border: 1px solid rgba(74,124,124,0.25);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s;
}
.reusable-pill:hover { background: var(--accent-light); border-color: var(--accent); }
.reusable-pill-text { color: var(--text-primary); }
.reusable-pill-source {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.8;
}

/* ── Word highlight (emphasis inside sentences) ───────────────────────────────*/
.word-highlight {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}

/* ── Submit hint (word not yet used) ─────────────────────────────────────────*/
.submit-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* ── Dictionary filter toggle ────────────────────────────────────────────────*/
.dict-filter-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}

.dict-filter-btn {
  flex: 1;
  background: var(--bg-pill);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.dict-filter-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Propose word button ─────────────────────────────────────────────────────*/
.propose-word-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.propose-word-btn:hover { background: var(--accent); color: #fff; }

/* ── Modal overlay ───────────────────────────────────────────────────────────*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-sheet {
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px 40px;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp 0.22s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
}
.modal-close-btn {
  float: right;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: -4px;
}
.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* ── Dict card — my sentence ─────────────────────────────────────────────────*/
.dict-my-sentence {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}
.dict-my-sentence-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  font-style: normal;
  margin-bottom: 4px;
}

/* ── Settings badge ──────────────────────────────────────────────────────────*/
.avatar-btn {
  position: relative;
}
.settings-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e53e3e;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ── Inline join request bubbles (under group cards in profile) ───────────────*/
.join-req-loading {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin: 4px 0;
  opacity: 0.5;
}
.group-join-reqs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 4px;
}
.join-req-bubble {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.join-req-name {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}
.join-req-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.approve-btn-sm, .deny-btn-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.approve-btn-sm {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.approve-btn-sm svg { width: 16px; height: 16px; }
.approve-btn-sm:hover { opacity: 0.85; }
.deny-btn-sm {
  background: var(--bg-card);
  color: var(--text-muted);
}
.deny-btn-sm:hover { color: #dc3545; border-color: #dc3545; }

/* ── Admin card ──────────────────────────────────────────────────────────────*/
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}
