/* ============================================
   Prism — Stylesheet
   Warm peach / coral theme
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* --- CSS Variables (colors, spacing) --- */
:root {
  --bg:        #fff9f6;   /* very light peach background */
  --card:      #ffffff;   /* white cards */
  --border:    #f0e6df;   /* soft peach border */
  --primary:   #e8835a;   /* warm coral — buttons, links */
  --primary-fg:#ffffff;   /* text on primary */
  --muted:     #f5ede8;   /* muted backgrounds */
  --muted-fg:  #8c7060;   /* muted text */
  --fg:        #3d2b1f;   /* main text */
  --danger:    #e05757;   /* red for warnings */
  --radius:    14px;      /* border radius */
  --shadow:    0 2px 12px rgba(60,30,10,0.07);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: 100%;
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 90px; }

/* ============================================
   Email action page
   ============================================ */
.auth-action-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(232,131,90,0.16), transparent 34%),
    var(--bg);
}
.auth-action-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}
.auth-action-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-action-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 22px;
}
.auth-action-status-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: rgba(232,131,90,0.12);
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
}
.auth-action-status-icon.error {
  background: #fff0f0;
  color: var(--danger);
}
.auth-action-card h1 {
  font-size: 22px;
  line-height: 1.35;
  margin-bottom: 8px;
}
.auth-action-card p {
  font-size: 14px;
  color: var(--muted-fg);
  margin-bottom: 18px;
}
.auth-action-error {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid #f5c0c0;
  border-radius: 12px;
  background: #fff0f0;
  color: #8c1c1c;
  font-size: 13px;
  text-align: left;
}
.auth-action-buttons {
  display: grid;
  gap: 10px;
}

/* ============================================
   Layout
   ============================================ */
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* --- Pages --- */
.page { display: none; flex-direction: column; min-height: 100vh; }
.page.active { display: flex; }

/* --- Top bar (shown when logged in) --- */
#topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
#topbar.visible { display: flex; }
.topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.logo-badge {
  width: 30px; height: 30px;
  background: var(--muted); color: var(--primary-fg);
  border: 1px solid rgba(232,131,90,0.18);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(60,30,10,0.08);
}
.logo-badge img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.logo-badge span {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--primary);
  color: var(--primary-fg);
}
.topbar-actions { display: flex; gap: 6px; align-items: center; position: relative; }
.notification-wrap { position: relative; }
.notification-bell {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  position: relative;
}
#notification-count {
  display: none;
  position: absolute;
  top: -5px; right: -4px;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
}
#notification-count.visible { display: block; }
.notification-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  width: min(320px, 86vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.notification-panel.visible { display: block; }
.notification-head {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.notification-item {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
  background: var(--card);
  border: none;
  border-bottom: 1px solid var(--border);
}
.notification-item.unread { background: #eff6ff; }
.notification-item small, .notification-empty { color: var(--muted-fg); font-size: 12px; }
.notification-empty { padding: 16px 12px; text-align: center; }
.notification-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.email-verification-banner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin: 16px 0 4px;
  padding: 14px 16px;
  border: 1px solid #f1cbb4;
  border-radius: var(--radius);
  background: #fff3ea;
  color: var(--fg);
}
.email-verification-banner strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.email-verification-banner p {
  font-size: 12px;
  color: var(--muted-fg);
}
.email-verification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted-fg);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.lang-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(60,30,10,0.06);
}

/* --- Bottom nav (mobile / main nav when logged in) --- */
#bottomnav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 100;
}
#bottomnav.visible { display: flex; }
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px;
  background: none; border: none;
  font-size: 10px; color: var(--muted-fg);
  gap: 3px;
  transition: color 0.15s;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 20px; height: 20px; }
.nav-label { font-size: 10px; font-weight: 500; }

/* --- Main content area --- */
.main-content {
  flex: 1;
  padding-bottom: 72px; /* space for bottom nav */
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  border: none; transition: opacity 0.15s;
  cursor: pointer;
}
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--fg); }
.btn-ghost { background: transparent; color: var(--muted-fg); border: none; padding: 8px 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-sm { padding: 12px 16px; }

/* ============================================
   Form helpers
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--fg); }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

.notice {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted-fg);
  display: flex; gap: 8px; align-items: flex-start;
}
.notice.warning { background: #fff8e1; border-color: #f9c84e; color: #7a5a00; }
.notice.danger-notice { background: #fff0f0; border-color: #f5c0c0; color: #8c1c1c; }

/* ============================================
   Landing page
   ============================================ */
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  max-width: 800px; margin: 0 auto; width: 100%;
}
.landing-header .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.landing-header nav { display: flex; gap: 10px; align-items: center; }
.hero {
  text-align: center;
  padding: 60px 24px 40px;
  max-width: 600px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px;
  font-size: 12px; font-weight: 600; color: var(--primary);
  margin-bottom: 20px;
}
.hero h1 { font-size: 32px; font-weight: 700; line-height: 1.3; margin-bottom: 14px; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--muted-fg); font-size: 15px; margin-bottom: 28px; }
.hero-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.steps {
  background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 40px 24px;
}
.steps-inner { max-width: 700px; margin: 0 auto; }
.steps h2 { text-align: center; font-size: 18px; margin-bottom: 28px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.step { text-align: center; }
.step-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.step-icon svg { width: 24px; height: 24px; color: var(--primary); }
.step-num { font-size: 11px; font-weight: 700; color: var(--muted-fg); margin-bottom: 4px; }
.step h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.step p { font-size: 13px; color: var(--muted-fg); }
.landing-footer {
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px; color: var(--muted-fg);
}
.landing-footer a { color: var(--muted-fg); margin: 0 8px; }

/* ============================================
   Auth pages (login / signup)
   ============================================ */
.auth-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-box { width: 100%; max-width: 380px; }
.auth-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.auth-icon svg { width: 28px; height: 28px; color: var(--primary); }
.auth-title { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { text-align: center; font-size: 13px; color: var(--muted-fg); margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted-fg); }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted-fg); cursor: pointer; }
.check-row input { width: auto; flex-shrink: 0; margin-top: 3px; accent-color: var(--primary); }

/* ============================================
   Onboarding
   ============================================ */
.onboarding-wrap {
  flex: 1; padding: 30px 20px;
  max-width: 500px; margin: 0 auto; width: 100%;
}
.progress-bar { display: flex; gap: 6px; margin-bottom: 28px; }
.progress-segment { height: 4px; flex: 1; border-radius: 4px; background: var(--muted); transition: background 0.3s; }
.progress-segment.done { background: var(--primary); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--card); font-size: 13px; cursor: pointer;
  transition: all 0.15s; color: var(--fg);
}
.chip:hover { border-color: var(--primary); }
.chip.selected { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.onboarding-step { display: none; flex-direction: column; gap: 20px; }
.onboarding-step.active { display: flex; }

/* ============================================
   Feed / posts
   ============================================ */
.page-header { padding: 20px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.page-title { font-size: 18px; font-weight: 700; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.tab {
  padding: 10px 4px; margin-right: 20px;
  border: none; background: none; font-size: 14px;
  color: var(--muted-fg); border-bottom: 2px solid transparent;
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* composer prompt */
.composer-prompt {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; margin: 12px 0; color: var(--muted-fg);
  font-size: 14px; transition: border-color 0.15s;
}
.composer-prompt:hover { border-color: var(--primary); }
.composer-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--muted);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.composer-avatar svg { width: 16px; height: 16px; color: var(--primary); }

/* post card */
.post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.post-card-sample {
  background: #fffdfb;
  border-style: dashed;
}
.post-card-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.badge-question  { background: #dbeafe; color: #1d4ed8; }
.badge-story     { background: #ede9fe; color: #6d28d9; }
.badge-advice    { background: #dcfce7; color: #15803d; }
.badge-resource  { background: #ffedd5; color: #c2410c; }
.badge-channel   { background: var(--muted); color: var(--primary); font-size: 11px; }
.badge-language  { background: #eef2ff; color: #4338ca; }
.badge-mood      { background: #fce7f3; color: #be185d; }
.badge-sample    { background: #f5ede8; color: #7c6254; }
.cw-box {
  border: 1px solid #f9c84e;
  background: #fff8e1;
  color: #7a5a00;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
}
.cw-box-strong {
  border-color: #f5c0c0;
  background: #fff0f0;
  color: #8c1c1c;
}
.cw-title { font-weight: 700; }
.cw-detail.strong { font-weight: 700; }
.cw-hidden-body {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  color: var(--muted-fg);
  background: var(--muted);
  font-size: 13px;
  text-align: center;
}
.mute-placeholder {
  border: 1px dashed #c7d2fe;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tag-clickable {
  border: none;
  cursor: pointer;
  color: var(--primary);
}
.tag-filter-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
  font-size: 13px;
  color: var(--muted-fg);
}
.post-search-box { margin: 12px 0 0; }
.online-indicator {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  display: inline-flex;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
}
.learning-resource-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.learning-resource-card h3,
.learn-intro h2 {
  font-size: 15px;
  font-weight: 700;
}
.learning-resource-card p,
.learn-intro p {
  font-size: 13px;
  color: var(--muted-fg);
}
.learn-intro {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.learning-card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: grid;
  gap: 7px;
  color: var(--fg);
  cursor: pointer;
}
.learning-card:hover,
.learning-card.active {
  border-color: #2563eb;
  box-shadow: var(--shadow);
}
.learning-card strong {
  font-size: 14px;
}
.learning-card p,
.learning-detail-card p {
  font-size: 13px;
  color: var(--muted-fg);
}
.learning-detail-card {
  margin-bottom: 12px;
}
.learning-detail-card h2 {
  font-size: 17px;
  margin-bottom: 8px;
}
.learning-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.learning-note {
  background: var(--muted);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}
.learning-note strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.learning-empty-detail {
  color: var(--muted-fg);
  margin-bottom: 12px;
}
.priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.priority-high { background: #fee2e2; color: #b91c1c; }
.priority-medium { background: #fef3c7; color: #92400e; }
.priority-low { background: #e0f2fe; color: #0369a1; }
.trigger-warning {
  font-size: 11px; background: #fff8e1; border: 1px solid #f9c84e;
  color: #7a5a00; border-radius: 6px; padding: 3px 8px; margin-bottom: 6px; display: inline-block;
}
.post-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; line-height: 1.4; }
.post-card .body-excerpt { font-size: 13px; color: var(--muted-fg); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-fg);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
}
.reaction-btn:hover,
.reaction-btn.active {
  border-color: var(--primary);
  background: rgba(232,131,90,0.12);
  color: var(--primary);
}
.post-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.post-author { font-size: 12px; color: var(--muted-fg); }
.post-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.post-action-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted-fg); background: none; border: none;
  cursor: pointer; padding: 0; transition: color 0.15s;
}
.post-action-btn:hover { color: var(--primary); }
.post-action-btn.reacted { color: #e05757; }
.post-action-btn svg { width: 14px; height: 14px; }
.follow-text { color: #2563eb; font-weight: 700; }
.follow-text:hover { color: #1d4ed8; }
.save-text { color: #5f6f52; font-weight: 700; }
.save-text.saved { color: var(--primary); }
.danger-text { color: var(--danger); }
.author-line { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mini-avatar {
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
}
.mini-avatar-xs { width: 20px; height: 20px; }
.mini-avatar-sm { width: 28px; height: 28px; }
.mini-avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.mini-avatar.avatar-emoji,
.profile-avatar.avatar-emoji {
  color: var(--fg);
  background: var(--muted);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 16px;
  line-height: 1;
}
.mini-avatar-xs.avatar-emoji { font-size: 12px; }
.mini-avatar-sm.avatar-emoji { font-size: 17px; }
.mini-avatar.avatar-image,
.profile-avatar.avatar-image {
  background-size: cover;
  background-position: center;
}
.profile-avatar.avatar-emoji { font-size: 34px; }

/* ============================================
   Post detail
   ============================================ */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted-fg); background: none; border: none;
  cursor: pointer; padding: 0; margin-bottom: 12px;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--fg); }
.back-btn svg { width: 14px; height: 14px; }
.post-full-body { font-size: 14px; line-height: 1.8; color: var(--fg); margin: 12px 0 16px; }
.post-detail-card .post-full-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.9;
}
.profile-link-btn { color: #2563eb; font-weight: 700; margin-bottom: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.comments-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.comment:last-child { border-bottom: none; }
.comment-author { font-weight: 600; font-size: 12px; margin-bottom: 3px; color: var(--muted-fg); }
.comment-body { color: var(--fg); }
.comment-form { display: flex; gap: 8px; margin-top: 14px; }
.comment-form textarea { border-radius: 12px; min-height: 70px; }
.reply-text { color: #2563eb; font-weight: 700; }
.replies {
  margin: 8px 0 0 18px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.reply {
  padding: 9px 0;
  font-size: 13px;
}
.reply-form {
  display: grid;
  gap: 8px;
  margin: 10px 0 0 18px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.reply-form textarea {
  min-height: 64px;
  border-radius: 12px;
}

/* ============================================
   Channels
   ============================================ */
.channel-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
}
.channel-hash { font-size: 20px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.channel-info { flex: 1; min-width: 0; }
.channel-info h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.channel-info p { font-size: 12px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-btn.following { background: var(--muted); color: var(--muted-fg); }
.search-box { position: relative; margin-bottom: 14px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-fg); pointer-events: none; }
.search-box input { padding-left: 36px; }

/* ============================================
   Resources
   ============================================ */
.emergency-card {
  background: #fff4f0;
  border: 1px solid #f3d2c8;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.emergency-card h3 { font-size: 13px; font-weight: 700; color: #8c3b2c; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.emergency-card h3 svg { width: 15px; height: 15px; }
.resource-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 7px rgba(60,30,10,0.035);
}
.resource-card-emergency {
  background: #fffaf7;
  border-color: #f2c9bc;
}
.resource-card-top,
.resource-card-middle,
.resource-card-bottom { display: grid; gap: 10px; }
.resource-card-middle,
.resource-card-bottom { margin-top: 12px; }
.resource-card h3 { font-size: 15px; font-weight: 700; line-height: 1.4; margin: 0; }
.resource-description { font-size: 13px; color: var(--muted-fg); line-height: 1.75; margin: 0; }
.resource-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.resource-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-fg);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.resource-badge-emergency {
  background: #ffe8df;
  color: #9a4b35;
}
.resource-badge-soft {
  background: #fff1d6;
  color: #805d1c;
}
.resource-meta {
  display: grid;
  gap: 7px;
  background: #fbf2ed;
  border: 1px solid #f3e4dc;
  border-radius: 12px;
  padding: 11px 12px;
}
.resource-meta-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-fg);
}
.resource-meta-row strong { color: var(--fg); font-weight: 700; }
.resource-meta-row-subtle {
  font-size: 11px;
  color: #a48a7b;
  padding-top: 2px;
}
.resource-meta-row-subtle strong { color: #9b8173; font-weight: 600; }
.resource-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.resource-tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff6f0;
  border: 1px solid #f2e1d8;
  color: #7f6252;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.resource-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}
.resource-action-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
}
.resource-action-stack-site-centered {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(180px, 100%);
}
.resource-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  padding: 6px 11px;
  border: 1px solid #eadbd3;
  border-radius: 999px;
  background: #fff;
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
}
.resource-action:hover { border-color: var(--primary); text-decoration: none; }
.resource-action svg { width: 13px; height: 13px; flex-shrink: 0; }
.resource-action-phone {
  background: #fff7f3;
  border-color: #efcfc1;
  color: #7e3f2c;
}
.resource-action-phone.is-emergency {
  background: #ffece5;
  border-color: #efc4b4;
}
.resource-action-phone .resource-action-main {
  font-size: 12px;
  color: #6f3828;
}
.resource-action-main { font-variant-numeric: tabular-nums; }
.resource-action-note {
  padding: 0 8px;
  font-size: 10px;
  color: var(--muted-fg);
  line-height: 1.3;
  text-align: center;
}
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.filter-chip {
  padding: 5px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--card); font-size: 12px; font-weight: 500; color: var(--muted-fg);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.filter-chip.active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }

/* ============================================
   Profile
   ============================================ */
.profile-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 20px 20px;
  margin-bottom: 14px;
  overflow: hidden;
}
.profile-banner {
  min-height: 108px;
  margin: 0 -20px 0;
  background: linear-gradient(135deg, #f8d4c1, #d9eef2 52%, #f7e8b8);
  border-bottom: 1px solid var(--border);
}
.profile-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: -26px;
  margin-bottom: 10px;
}
.profile-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--muted); display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 12px;
}
.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 4px solid var(--card);
  color: #fff;
  margin-bottom: 0;
}
.profile-avatar-large.avatar-emoji {
  color: var(--fg);
  font-size: 34px;
}
.profile-avatar-large.avatar-image {
  color: transparent;
  background-size: cover;
  background-position: center;
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-id { font-size: 12px; color: var(--muted-fg); margin-bottom: 10px; font-family: monospace; }
.profile-note, .profile-bio, .activity-row {
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 10px;
}
.profile-bio { color: var(--fg); white-space: pre-wrap; }
.pinned-post {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
  background: var(--muted);
  cursor: pointer;
}
.pinned-post p {
  color: var(--muted-fg);
  font-size: 12px;
  margin-top: 4px;
}
.pronoun-badge { background: #e0f2fe; color: #0369a1; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { background: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.tag.primary { background: rgba(232,131,90,0.15); color: var(--primary); }
.stats-row { display: flex; gap: 18px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { font-size: 18px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--muted-fg); }
.activity-row {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}
.menu-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
}
.menu-section-title {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-fg);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s; font-size: 14px;
  background: none; border-left: none; border-right: none; width: 100%; text-align: left;
  color: var(--fg);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--muted); }
.menu-item svg { width: 16px; height: 16px; color: var(--muted-fg); flex-shrink: 0; }
.menu-item .menu-arrow { margin-left: auto; color: var(--muted-fg); font-size: 16px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.blocked-user-row .btn { margin-left: auto; }

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: min(760px, 92vh);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-head h3 { font-size: 16px; }
.icon-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-fg);
}
.modal-gap { margin-bottom: 12px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-help {
  font-size: 12px;
  color: var(--muted-fg);
  margin: -2px 0 12px;
}
.delete-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}
.delete-choice input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--danger);
}
.privacy-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.privacy-box h4 { font-size: 13px; }
.avatar-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fffdfb;
}
.avatar-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.avatar-editor-head h4 { font-size: 13px; }
.avatar-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.avatar-type-btn {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted-fg);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 8px;
}
.avatar-type-btn.active {
  border-color: var(--primary);
  background: rgba(232,131,90,0.12);
  color: var(--primary);
}
.avatar-swatch-grid,
.emoji-choice-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.avatar-swatch,
.emoji-choice {
  min-height: 42px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
.avatar-swatch.selected,
.emoji-choice.selected {
  border-color: var(--fg);
  box-shadow: 0 0 0 2px rgba(232,131,90,0.18);
}
.emoji-choice {
  background: var(--card);
  border-color: var(--border);
  font-size: 22px;
}
.avatar-image-controls {
  display: grid;
  gap: 8px;
}
.avatar-image-controls input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ============================================
   New post form
   ============================================ */
.new-post-wrap { padding: 20px 0; }
.question-guide-card {
  display: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  color: #1e3a8a;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.question-guide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.question-guide-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}
.question-guide-card li {
  margin-bottom: 4px;
}
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-btn {
  padding: 8px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--card); font-size: 12px; font-weight: 600; color: var(--muted-fg);
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.type-btn.selected { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.tag-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.tw-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--danger); background: #fff0f0;
  border: 1px solid #f5c0c0; border-radius: 999px;
  cursor: pointer; padding: 6px 12px; font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tw-toggle:hover { background: #ffe3e3; border-color: var(--danger); color: #b42318; }
.anon-notice {
  display: flex; align-items: center; gap: 8px;
  background: var(--muted); border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: var(--muted-fg);
}
.anon-notice svg { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.sensitive-warning {
  display: none;
  background: #fff8e1; border: 1px solid #f9c84e;
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: #7a5a00;
}
.sensitive-warning.visible { display: flex; gap: 8px; align-items: flex-start; }

/* ============================================
   Empty states / Loading
   ============================================ */
.empty-state {
  text-align: center; padding: 48px 20px;
}
.empty-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--muted);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.empty-icon svg { width: 28px; height: 28px; color: var(--primary); }
.empty-state h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--muted-fg); margin-bottom: 18px; }

/* skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, #fff 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px; height: 16px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================
   Toast notification
   ============================================ */
#toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #3d2b1f; color: #fff; padding: 10px 20px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================
   Static info pages (guidelines / privacy / help)
   ============================================ */
.info-wrap { max-width: 600px; margin: 0 auto; padding: 24px 20px 60px; }
.info-header { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.info-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--muted); display: flex; align-items: center; justify-content: center; }
.info-icon svg { width: 20px; height: 20px; color: var(--primary); }
.info-wrap h1 { font-size: 20px; font-weight: 700; }
.info-wrap h2 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; }
.info-wrap p, .info-wrap li { font-size: 14px; color: var(--muted-fg); line-height: 1.8; }
.info-wrap ul { padding-left: 18px; }
.info-wrap li { margin-bottom: 4px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--card); border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; text-align: left; color: var(--fg);
}
.faq-a { padding: 0 16px 14px; font-size: 13px; color: var(--muted-fg); line-height: 1.7; }
.support-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

/* ============================================
   Responsive tweaks
   ============================================ */
@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-grid { grid-template-columns: 1fr; }
  .tag-input-row { grid-template-columns: 1fr; }
  .email-verification-banner { flex-direction: column; }
  .email-verification-actions { width: 100%; justify-content: stretch; }
  .email-verification-actions .btn { flex: 1; min-width: 0; }
  .avatar-swatch-grid,
  .emoji-choice-grid { grid-template-columns: repeat(3, 1fr); }
  .learning-resource-card { align-items: flex-start; flex-direction: column; }
  .question-guide-head { align-items: flex-start; flex-direction: column; }
  .landing-header { align-items: flex-start; gap: 12px; }
  .landing-header nav { flex-wrap: wrap; justify-content: flex-end; }
  .topbar-actions { align-items: center; }
  .resource-card { padding: 14px; }
  .resource-meta-row { grid-template-columns: 1fr; gap: 2px; }
  .resource-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 7px; }
  .resource-action {
    min-height: 34px;
    padding-inline: 9px;
  }
  .resource-action-note { padding-inline: 6px; }
}
