/* =========================================================
   Mandarin Pals — hand-drawn paper prototype
   Body: Inter (regular sans). Headings: Inter (sans, weight 700).
   Sketchy borders via rough.js; everything else is plain CSS.
   Light + dark themes via [data-theme="dark"] on <html>.
   ========================================================= */

:root {
  /* Surfaces */
  --paper: #f6efe1;
  --paper-2: #efe6d2;
  --paper-3: #e6dcc4;        /* used for "my request" card highlight */
  --input-bg: rgba(255, 255, 255, 0.55);
  --input-bg-focus: #fffdf5;

  /* Ink */
  --ink: #2a2520;
  --ink-soft: #5a4f44;
  --ink-faint: #8a7e6e;
  --line: #2a2520;

  /* Accents */
  --accent: #c1432a;          /* warm red */
  --brand: #c1432a;           /* primary brand color (alias of accent) */
  --brand-soft: #fbeae3;      /* light warm tint for buttons on cream bg */
  --accent-2: #2f6f8a;        /* ink blue */
  --accent-3: #5b8a3a;        /* mossy green */
  --accent-4: #d29a2a;        /* mustard */
  --highlight: #fff3a8;

  /* HSK scale (warm cream → roasted brown) */
  --hsk0-bg: #e8dec6; --hsk0-fg: #4a3a1a;
  --hsk1-bg: #fce6c2; --hsk1-fg: var(--ink);
  --hsk2-bg: #f7d6a3; --hsk2-fg: var(--ink);
  --hsk3-bg: #f1c585; --hsk3-fg: var(--ink);
  --hsk4-bg: #e0a96a; --hsk4-fg: #fff8ec;
  --hsk5-bg: #c98a4f; --hsk5-fg: #fff8ec;
  --hsk6-bg: #a06b3b; --hsk6-fg: #fff8ec;
  --hsk7-bg: #7e5230; --hsk7-fg: #fff8ec;
  --hsk8-bg: #5d3a22; --hsk8-fg: #fff8ec;
  --hsk9-bg: #2d1c10; --hsk9-fg: #fff8ec;
  --status-open-bg: #d6e9c6;
  --status-full-bg: #f4d4cf;
  --status-closed-bg: #ddd5c4;
  --tz-bg: #e0ecf2;

  /* Decorative (for accent text — same in both themes, uses current accents) */

  /* Shadow + radius */
  --shadow: 2px 3px 0 rgba(42, 37, 32, 0.18);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.2);
  --radius: 14px;

  /* Background tints */
  --tint-red: rgba(193, 67, 42, 0.04);
  --tint-blue: rgba(47, 111, 138, 0.05);
  --texture-line: rgba(42, 37, 32, 0.012);

  /* Primary button label */
  --on-accent: #fff8ec;

  color-scheme: light;
}

/* ===== Dark theme ===== */
[data-theme="dark"] {
  --paper: #1a1612;
  --paper-2: #25201a;
  --paper-3: #2a251e;
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-bg-focus: rgba(255, 255, 255, 0.10);

  --ink: #f0e6d2;
  --ink-soft: #b8a98f;
  --ink-faint: #8a7e6e;
  --line: #f0e6d2;

  --accent: #e85a3c;
  --brand: #e85a3c;
  --brand-soft: rgba(232, 90, 60, 0.16);
  --accent-2: #6cb3d4;
  --accent-3: #9bcb6e;
  --accent-4: #e8b94a;
  --highlight: #5a4a1a;

  --hsk0-bg: #2e2517; --hsk0-fg: #c8b890;
  --hsk1-bg: #4a3a20; --hsk1-fg: #f0e6d2;
  --hsk2-bg: #5a4622; --hsk2-fg: #f0e6d2;
  --hsk3-bg: #6a5424; --hsk3-fg: #f0e6d2;
  --hsk4-bg: #7a6230; --hsk4-fg: #f0e6d2;
  --hsk5-bg: #8a6a3a; --hsk5-fg: #f0e6d2;
  --hsk6-bg: #a06b3b; --hsk6-fg: #f0e6d2;
  --hsk7-bg: #5d3a22; --hsk7-fg: #f0e6d2;
  --hsk8-bg: #3a2418; --hsk8-fg: #f0e6d2;
  --hsk9-bg: #1a1008; --hsk9-fg: #f0e6d2;
  --hsk6-bg: #9a7444; --hsk6-fg: #f0e6d2;
  --status-open-bg: #2c4023;
  --status-full-bg: #4a2520;
  --status-closed-bg: #3a3530;
  --tz-bg: #1f3a4a;

  --shadow: 2px 3px 0 rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.5);

  --tint-red: rgba(232, 90, 60, 0.05);
  --tint-blue: rgba(108, 179, 212, 0.06);
  --texture-line: rgba(240, 230, 210, 0.025);

  --on-accent: #1a1612;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 25% 20%, var(--tint-red), transparent 40%),
    radial-gradient(circle at 80% 70%, var(--tint-blue), transparent 45%),
    repeating-linear-gradient(0deg, var(--texture-line) 0 1px, transparent 1px 4px);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  transition: background-color 0.18s ease, color 0.18s ease;
  font-feature-settings: "ss01", "cv11"; /* slightly more characterful digits/letters */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* All time displays should use tabular numerals so 8:00 and 12:30 line up. */
.time, .bj, .slot .time, .slot .bj, .slot .day, .kbd, .pill.mbti {
  font-variant-numeric: tabular-nums;
}

/* SVG sketchy borders */
.sketch-host { position: relative; }
.sketch-host > svg.sketch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.sketch-host > .content { position: relative; z-index: 1; }

/* ===== Top nav ===== */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--accent); flex: 0 0 auto; min-width: 0; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; color: var(--brand); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-pals {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, var(--brand) 0%, #e8754d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 3px;
  letter-spacing: 0;
  white-space: nowrap;
}
.topnav-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: nowrap;
}
.topnav-actions .nav-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topnav-actions .nav-divider {
  width: 1px;
  height: 22px;
  background: var(--ink-faint);
  margin: 0 4px;
}

/* Unified topnav chip — same shape, border, hover behavior across the row */
.topnav-actions .pill.tz,
.topnav-actions .btn.ghost.tiny,
.topnav-actions .user-chip {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s;
  white-space: nowrap;
}
.topnav-actions .pill.tz:hover,
.topnav-actions .btn.ghost.tiny:hover,
.topnav-actions .user-chip:hover {
  transform: translate(-1px, -1px);
  background: var(--paper-3);
  color: var(--ink);
  border-color: var(--ink);
}
.topnav-actions .pill.tz:active,
.topnav-actions .btn.ghost.tiny:active,
.topnav-actions .user-chip:active {
  transform: translate(1px, 1px);
}
.topnav-actions .user-chip { padding: 0 12px 0 4px; gap: 7px; text-decoration: none; letter-spacing: -0.005em; }
.topnav-actions .user-chip > img,
.topnav-actions .user-chip > .avatar {
  width: 28px !important;
  height: 28px !important;
}
.topnav-actions .user-chip .user-name { font-weight: 600; color: var(--ink); font-size: 13px; }
.topnav-actions .user-chip .user-chip-caret {
  font-size: 9px;
  margin-left: 2px;
  color: var(--ink-soft);
  transition: transform 0.15s ease;
}
.topnav-actions .user-chip[aria-expanded="true"] .user-chip-caret { transform: rotate(180deg); }
.topnav-actions .user-chip[aria-expanded="true"] {
  background: var(--paper-3);
  color: var(--ink);
  border-color: var(--ink);
}

/* User dropdown menu */
.topnav-actions .user-menu { position: relative; }
.topnav-actions .user-menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.topnav-actions .user-menu-pop[hidden] { display: none; }
.topnav-actions .user-menu-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--ink-faint);
  margin-bottom: 4px;
}
.topnav-actions .user-menu-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.topnav-actions .user-menu-meta { font-size: 11px; color: var(--ink-soft); margin-top: 2px; word-break: break-all; }
.topnav-actions .user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s ease;
  width: 100%;
}
.topnav-actions .user-menu-item:hover { background: var(--paper-2); }
.topnav-actions .user-menu-item.is-danger { color: #b91c1c; }
.topnav-actions .user-menu-item.is-danger:hover { background: rgba(239, 68, 68, 0.1); }
.topnav-actions .user-menu-icon { width: 18px; text-align: center; font-size: 14px; }
.topnav-actions .user-menu-divider {
  height: 1px;
  background: var(--ink-faint);
  margin: 4px 4px;
}
.topnav-actions .pill.tz { letter-spacing: 0; }
.topnav-actions .btn.ghost.tiny { box-shadow: none; }
.topnav-actions .btn.ghost.tiny:hover { transform: translate(-1px, -1px); }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s;
}
.theme-toggle:hover { transform: translate(-1px, -1px); background: var(--paper-3); color: var(--ink); border-color: var(--ink); }
.theme-toggle:active { transform: translate(1px, 1px); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===== Layout ===== */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 28px 80px;
}

/* ===== Buttons ===== */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
  box-shadow: var(--shadow);
}
.btn:hover { transform: translate(-1px, -1px); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--ink); }
.btn.secondary { background: var(--paper-2); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-width: 1.5px; }
.btn.danger { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== Cards ===== */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  margin-bottom: 22px;
}
.card h3 { margin: 0 0 8px; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-size: 20px; }
.card h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.card .meta { font-size: 12px; color: var(--ink-faint); }

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 32px;
  align-items: center;
  padding: 36px 0 24px;
}
.hero h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 46px;
  line-height: 1.08;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
/* Marker highlight: warm cream band across the bottom of the text,
   slightly rotated to feel hand-drawn. */
.hero h1 .under {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.hero h1 .under::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  bottom: 0.08em;
  height: 0.42em;
  background: #fde68a;          /* warm yellow highlighter */
  border-radius: 4px;
  transform: rotate(-0.6deg);
  z-index: -1;
  box-shadow: 0 0 0 1px rgba(193, 67, 42, 0.08);
}
.hero p.lede { font-size: 17px; color: var(--ink-soft); margin: 0 0 22px; max-width: 520px; }
.hero .cta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-illu {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}

/* ===== Form ===== */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.form-row .hint { font-size: 12px; color: var(--ink-faint); }
/* Light up a pill when its inner radio/checkbox is checked */
.pill:has(input:checked) {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border-color: var(--ink) !important;
}
.input, .select, .textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 11px;
  border: 1.5px dashed var(--ink-soft);
  background: var(--input-bg);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.1s ease, background 0.1s ease;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-style: solid;
  border-color: var(--accent);
  background: var(--input-bg-focus);
}
.textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error { color: var(--accent); font-size: 12px; margin-top: 2px; min-height: 14px; }

/* ===== Pills / tags ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--highlight);
  color: var(--ink);
  white-space: nowrap;
}
.pill.level-hsk0 { background: var(--hsk0-bg); color: var(--hsk0-fg); }
.pill.level-hsk1 { background: var(--hsk1-bg); color: var(--hsk1-fg); }
.pill.level-hsk2 { background: var(--hsk2-bg); color: var(--hsk2-fg); }
.pill.level-hsk3 { background: var(--hsk3-bg); color: var(--hsk3-fg); }
.pill.level-hsk4 { background: var(--hsk4-bg); color: var(--hsk4-fg); }
.pill.level-hsk5 { background: var(--hsk5-bg); color: var(--hsk5-fg); }
.pill.level-hsk6 { background: var(--hsk6-bg); color: var(--hsk6-fg); }
.pill.level-hsk7 { background: var(--hsk7-bg); color: var(--hsk7-fg); }
.pill.level-hsk8 { background: var(--hsk8-bg); color: var(--hsk8-fg); }
.pill.level-hsk9 { background: var(--hsk9-bg); color: var(--hsk9-fg); }
.pill.status-open { background: var(--status-open-bg); }
.pill.status-full { background: var(--status-full-bg); }
.pill.status-closed { background: var(--status-closed-bg); color: var(--ink-soft); }
.pill.tz { background: var(--paper-2); border: 1.5px solid var(--ink-faint); color: var(--ink-soft); font-weight: 600; }
.pill.muted { background: transparent; color: var(--ink-soft); border-color: var(--ink-faint); }

/* ===== Dashboard sections ===== */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 14px 0 12px;
  gap: 6px 12px;
}
.section-title h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
  flex: 0 0 auto;
  min-width: 0;
}
.section-title .sub {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
  line-height: 1.45;
  min-width: 0;
  /* On wide layouts, push sub to the right; on narrow, it wraps below. */
  margin-left: auto;
}
/* For the home-stats card (long h2 + long sub), let sub wrap to a new line
   so the title isn't crushed. */
.home-stats .section-title,
.home-demo .section-title { flex-direction: column; align-items: flex-start; }
.home-stats .section-title .sub,
.home-demo .section-title .sub { margin-left: 0; }

/* ===== Request card ===== */
.req-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

/* Home preview section (visible to logged-out visitors) */
.home-preview { margin-top: 36px; }
.home-preview .section-title { margin-bottom: 16px; }
.home-preview .section-title .sub { font-style: italic; }
.home-cta { display: flex; justify-content: center; margin-top: 22px; }
.preview-card { cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease; position: relative; }
.preview-card:hover { transform: translateY(-2px); }
.preview-blur .req-author-id strong { color: var(--ink-faint); letter-spacing: 2px; font-weight: 400; }
.preview-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  color: var(--ink-faint);
  font-size: 16px;
  font-weight: 700;
}
.preview-cta { background: var(--paper-2) !important; color: var(--ink) !important; border: 1.5px solid var(--ink) !important; box-shadow: none !important; }
.preview-cta:hover { background: var(--accent) !important; color: var(--on-accent) !important; }
.preview-foot { gap: 8px; }

/* Home: stats + demo side by side */
.home-stats-and-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 36px; align-items: stretch; }
.home-stats-and-demo > .sketch-host { display: flex; flex-direction: column; }
.home-stats-and-demo > .sketch-host > .content { flex: 1; }
@media (max-width: 900px) { .home-stats-and-demo { grid-template-columns: 1fr; } }

/* Home: popular levels bar chart */
.home-stats { padding: 24px; }
.home-stats .section-title { margin-bottom: 18px; }
.levels-chart { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.levels-bar-row { display: flex; align-items: center; gap: 10px; }
.levels-bar-label { min-width: 56px; text-align: center; flex: 0 0 auto; }
.levels-bar-track { flex: 1; height: 22px; background: var(--paper-2); border: 1.5px solid var(--ink-faint); border-radius: 999px; overflow: hidden; }
.levels-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, #e08a4a 100%); border-radius: 999px; transition: width 0.6s ease; }
.levels-bar-count { min-width: 28px; text-align: right; font-weight: 700; color: var(--ink); font-size: 14px; }

/* Home: 6s demo "video" (CSS-animated slides) */
.home-demo { padding: 24px; }
.demo-stage { padding: 0; }
.demo-frame { position: relative; height: 220px; }
.demo-slide { position: absolute; inset: 0; opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease, transform 0.5s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; }
.demo-slide-1 { animation: demo-show 6s infinite; animation-delay: 0s; }
.demo-slide-2 { animation: demo-show 6s infinite; animation-delay: 2s; }
.demo-slide-3 { animation: demo-show 6s infinite; animation-delay: 4s; }
@keyframes demo-show {
  0%, 28% { opacity: 1; transform: translateY(0); }
  33%, 95% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 0; transform: translateY(8px); }
}
.demo-step-tag { font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-size: 14px; padding: 4px 12px; background: var(--ink); color: var(--paper); border-radius: 999px; }
.demo-mock { background: var(--paper); border: 1.5px solid var(--ink-faint); border-radius: 10px; padding: 18px; width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.demo-mock-bar { height: 14px; background: var(--paper-2); border-radius: 4px; }
.demo-mock-bar-thin { height: 6px; width: 60%; }
.demo-mock-cards { display: flex; gap: 8px; }
.demo-mock-card { flex: 1; height: 60px; background: var(--paper-2); border: 1.5px solid var(--ink-faint); border-radius: 6px; position: relative; }
.demo-mock-card::before { content: ''; position: absolute; top: 8px; left: 8px; right: 30%; height: 6px; background: var(--ink-faint); border-radius: 2px; }
.demo-mock-card::after { content: ''; position: absolute; top: 22px; left: 8px; right: 60%; height: 4px; background: var(--ink-faint); border-radius: 2px; opacity: 0.6; }
.demo-mock-card-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.demo-mock-title { height: 18px; background: var(--ink); border-radius: 4px; width: 70%; }
.demo-mock-pills { display: flex; gap: 6px; }
.demo-pill { height: 16px; width: 40px; background: var(--paper-2); border: 1px solid var(--ink-faint); border-radius: 999px; }
.demo-mock-text { height: 10px; background: var(--paper-2); border-radius: 2px; }
.demo-mock-text-short { width: 50%; }
.demo-mock-cta { height: 28px; background: var(--ink); border-radius: 6px; margin-top: 4px; width: 50%; align-self: center; }
.demo-mock-icon { font-size: 36px; text-align: center; }
.demo-mock-detail { gap: 8px; }
.demo-mock-join { align-items: center; }
.demo-caption { font-size: 13px; color: var(--ink-soft); font-style: italic; margin-top: 6px; }

/* Home: why sign up grid */
.home-why { margin-top: 40px; }
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.why-card { padding: 22px; background: var(--paper); border-radius: 12px; border: 1.5px solid var(--ink-faint); position: relative; }
.why-card .why-icon { font-size: 32px; margin-bottom: 8px; }
.why-card h3 { margin: 0 0 6px; font-family: 'Inter', system-ui, sans-serif; font-size: 18px; font-weight: 700; color: var(--ink); }
.why-card p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
@media (max-width: 720px) {
  .why-grid { grid-template-columns: 1fr; }
  .demo-frame { height: 320px; }
}
.req-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  transition: transform 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.req-card:hover { transform: translateY(-2px); }

/* (req-top / req-head removed — card now uses vertical title/author/timezone stack) */
/* Card top: title on its own row, then author row, then timezone row */
.req-card .req-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  min-height: 2.4em;  /* always reserve 2 lines */
}
.req-card .req-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.req-card .req-author-row .req-author-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.req-card .req-author-row .req-author-id strong {
  color: var(--ink);
  font-weight: 600;
}
.req-card .req-tz-row,
.req-card .req-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: -2px;
  flex-wrap: wrap;
}
.req-card .req-meta-row {
  padding-bottom: 4px;
  border-bottom: 1.5px dashed var(--ink-faint);
  margin-bottom: 2px;
}
/* Force the timezone hint onto its own line; "Starts" goes on the next line. */
.req-card .req-meta-row .tz-hint {
  flex: 0 0 100%;
}
.req-card .req-tz-row + .req-tz-row { margin-top: 2px; }  /* tight stack for tz + starts */
.req-card .req-tz-row .dot-sep,
.req-card .req-meta-row .dot-sep { color: var(--ink-faint); }
.req-card .start-hint { display: inline-flex; align-items: center; gap: 4px; }
.req-card .start-hint .cal-icon { width: 13px; height: 13px; flex: 0 0 auto; }
.req-card .start-hint .start-label { color: var(--ink-faint); margin-right: 1px; }
.req-card .start-hint .start-value { color: var(--ink); font-weight: 600; }
.req-card .req-bio {
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.45;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.req-card .req-desc {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  min-height: 60px;            /* reserve ~2.5 lines (2 lines + breathing room) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  padding: 4px 0;
}
.req-card .slot-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  min-height: 116px;           /* reserve 5 slots (5×20 + 4×4) so Mon–Fri cases fit */
}
.slot-list { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.req-card .slot,
.slot-list .slot {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  column-gap: 8px;
  font-variant-numeric: tabular-nums;
}
.req-card .slot-head,
.slot-list .slot-head {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  column-gap: 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-faint);
  padding: 0 0 4px;
  border-bottom: 1px dashed var(--ink-faint);
  margin-bottom: 4px;
}
.req-card .slot-head span:nth-child(2),
.slot-list .slot-head span:nth-child(2) { text-align: left; }
.req-card .slot-head span:nth-child(3),
.slot-list .slot-head span:nth-child(3) { text-align: right; }
.req-card .slot .day,
.slot-list .slot .day { font-weight: 600; }
.req-card .slot .time,
.slot-list .slot .time { color: var(--ink); }
.req-card .slot .bj,
.slot-list .slot .bj { color: var(--ink-faint); font-size: 12px; text-align: right; white-space: nowrap; }
.req-card .req-tags {
  min-height: 24px;            /* always reserve 1 row of topic pills */
  align-items: center;
}
/* Footer: status / count / match (top) | centered CTA button (bottom) */
.req-card .req-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: auto;            /* pin to bottom when cards are uneven */
  padding-top: 12px;
  border-top: 1.5px dashed var(--ink-faint);
}
.req-card .req-foot-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  text-align: center;
}
.req-card .req-cta {
  width: 100%;
  max-width: 260px;
  padding: 9px 16px;
  font-size: 13px;
  text-align: center;
  background: var(--ink);     /* dark CTA — high contrast */
  color: var(--paper);
  border-color: var(--ink);
}
.req-card .req-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Secondary actions row used by My requests cards (Close/Delete/Leave) */
.req-card .req-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Legacy class kept for any other usage; behaves like req-foot now. */
.req-card .req-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.req-card .match-bar {
  height: 6px;
  width: 64px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
[data-theme="dark"] .req-card .match-bar { background: rgba(255, 255, 255, 0.08); }
.req-card .match-bar > span {
  display: block;
  height: 100%;
  background: var(--accent-3);
  border-radius: 999px;
}
.req-card .match-label {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-3);
}
.req-card.is-mine { background: var(--paper-3); }

/* ===== Slot picker ===== */
.slot-picker { display: flex; flex-direction: column; gap: 8px; }
.slot-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.slot-row .day-select { width: 100%; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper-2);
}
.filter-bar .field { display: flex; align-items: center; gap: 6px; font-size: 13px; flex: 0 0 auto; white-space: nowrap; }
.filter-bar select, .filter-bar input { padding: 6px 10px; font-size: 13px; border: 1.5px dashed var(--ink-soft); border-radius: 8px; background: var(--input-bg); font-family: inherit; color: var(--ink); }

/* ===== Timezone banner ===== */
.tz-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper-2);
  margin-bottom: 18px;
  font-size: 13px;
}
.tz-banner .note { color: var(--ink-soft); }
.tz-banner strong { color: var(--ink); }

/* Admin mode banner — shown under the TZ banner for staff users */
/* Stack the external-classes box and admin banner with consistent gap.
   Using flex column prevents adjacent-sibling margin collapse so the gap
   is exactly the sum of the two margins. */
.app-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.app-banner-stack > * { margin: 0 !important; }

.admin-mode-banner {
  background: linear-gradient(0deg, var(--accent-2) 0%, var(--accent-2-soft, #fde0d0) 100%);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.app[data-theme="dark"] .admin-mode-banner {
  background: rgba(194, 65, 12, 0.18);
  border-color: var(--ink-soft);
}

/* ===== Empty / placeholder ===== */
.empty {
  text-align: center;
  padding: 30px 12px;
  color: var(--ink-soft);
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
}

/* ===== Auth modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 18px;
  padding: 20px 22px 16px;
  position: relative;
}
.modal.wide { max-width: 880px; }
.modal.wider { max-width: 1024px; }
.modal h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 24px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.modal .modal-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 18px; }
.modal .switch-line { font-size: 13px; color: var(--ink-soft); margin-top: 12px; text-align: center; }
.modal .switch-line a { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline dotted; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--ink-soft);
}

/* Confirm dialog */
.confirm-modal { padding: 4px 0 0; }
.confirm-msg { font-size: 15px; line-height: 1.5; color: var(--ink); margin: 6px 0 0; }
.confirm-hint { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; padding: 8px 10px; background: var(--paper-2); border-radius: 8px; }

/* ===== Avatar ===== */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--on-accent);
  border: 2px solid var(--ink);
  flex-shrink: 0;
}

/* Hand-drawn SVG avatar host. The face strokes use currentColor. */
.avatar-host {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  flex-shrink: 0;
  color: #2a2520;            /* dark stroke on colored bg; stickers look the same in both modes */
  overflow: hidden;
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.15);
}
.avatar-host svg { width: 70%; height: 70%; display: block; }

/* ===== Avatar picker (profile) ===== */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.avatar-pick {
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 14px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
}
.avatar-pick:hover { transform: scale(1.06); }
.avatar-pick.selected {
  border-color: var(--accent);
  background: var(--paper-2);
}
.avatar-pick .avatar-host { width: 100%; height: 100%; }
@media (max-width: 820px) {
  .avatar-picker { grid-template-columns: repeat(4, 1fr); }
}

/* ===== MBTI pill ===== */
.pill.mbti {
  background: var(--paper-2);
  color: var(--ink);
  border: 1.5px solid var(--ink-soft);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  cursor: help;
}

/* ===== MBTI picker ===== */
.mbti-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.mbti-tile {
  border: 2px solid var(--ink-faint);
  background: var(--paper);
  cursor: pointer;
  padding: 8px 6px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
  text-align: center;
}
.mbti-tile:hover { transform: translateY(-1px); border-color: var(--ink); }
.mbti-tile.selected {
  border-color: var(--accent);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.mbti-tile .mbti-code {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.mbti-tile .mbti-name {
  font-size: 10px;
  color: var(--ink-soft);
}
@media (max-width: 820px) {
  .mbti-picker { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Profile header (preview at top of profile page) ===== */
.profile-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 4px 0 6px;
}
.profile-header .avatar-host {
  width: 96px; height: 96px;
}
@media (max-width: 820px) {
  .profile-header { flex-direction: column; align-items: flex-start; }
  .profile-header .avatar-host { width: 72px; height: 72px; }
}

/* ===== Detail page creator block ===== */
.detail-creator {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 4px 0 6px;
}
.member-chip { padding: 3px 8px 3px 4px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--ink-faint); }

/* ===== Prominent Back button (detail page) ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease;
  cursor: pointer;
  font-family: inherit;
}
.back-btn:hover { transform: translate(-1px, -1px); background: var(--paper-3); }
.back-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0,0,0,0.2); }
.back-btn .back-arrow { font-size: 15px; line-height: 1; }

/* ===== Toast ===== */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-soft);
  animation: toastIn 0.2s ease;
}
.toast.error { background: var(--accent); color: var(--on-accent); }
.toast.success { background: var(--accent-3); color: var(--on-accent); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Decorative scribbles ===== */
.scribble {
  position: absolute;
  pointer-events: none;
  color: var(--accent);
}

/* ===== App nav: centered top bar (with icons) ===== */
.app-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 10px auto 18px;
  padding: 6px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.app-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-nav-item:hover { color: var(--ink); background: var(--paper-2); }
.app-nav-item.active {
  color: var(--on-accent);
  background: var(--accent);
}
.app-nav-item.active:hover { color: var(--on-accent); background: var(--accent); }
.app-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: color 0.15s;
}
.app-nav-item:hover .app-nav-icon { color: var(--ink); }
.app-nav-item.active .app-nav-icon { color: var(--on-accent); }
.app-nav-icon .nav-svg {
  width: 16px;
  height: 16px;
  display: block;
}
.app-nav-label { line-height: 1; }

/* On phone, the bar can still wrap but keep the centered look */
@media (max-width: 720px) {
  .app-nav { gap: 2px; padding: 4px; }
  .app-nav-item { padding: 7px 10px; font-size: 13px; }
}

/* ===== Email admin sub-nav (History / Templates / SMTP) ===== */
.email-subnav {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  width: fit-content;
}
.email-subnav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.email-subnav button:hover { color: var(--ink); background: var(--paper-3); }
.email-subnav button.active {
  color: var(--on-accent);
  background: var(--accent);
}
.email-subnav .esn-num {
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.email-subnav button.active .esn-num {
  background: rgba(255, 255, 255, 0.18);
  color: var(--on-accent);
}

/* Email type list (left column in History) */
.email-type-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.email-type-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}
.email-type-list .etl-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Email template editor */
.tpl-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tpl-editor {
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
}
.tpl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tpl-head h4 { margin: 0; font-size: 14px; }
.tpl-editor .form-row { margin-bottom: 8px; }
.tpl-editor .form-row label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.tpl-editor .form-row code {
  background: var(--paper);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--ink-faint);
}
.tpl-editor .input,
.tpl-editor .textarea {
  width: 100%;
  font-family: 'Inter', monospace;
  font-size: 13px;
}
.tpl-editor .textarea {
  resize: vertical;
  min-height: 120px;
}

/* Old subnav (kept for any legacy reference; not used) */
.subnav {
  display: flex; gap: 6px; margin: 6px 0 18px;
  padding: 4px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav button {
  background: transparent; border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-soft);
  padding: 8px 16px; cursor: pointer;
  border-radius: 999px;
  margin: 0 2px 0 0;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.subnav button:hover { color: var(--ink); background: var(--paper-2); }
.subnav button.active {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 1.5px 2px 0 var(--ink);
  border: 1.5px solid var(--ink);
}
.subnav button.active:hover { color: var(--on-accent); background: var(--accent); }

/* Class progress vertical timeline */
.class-timeline { position: relative; padding: 4px 0 4px 32px; margin: 8px 0; }
.class-timeline .timeline-rail {
  position: absolute;
  left: 14px; top: 12px; bottom: 12px;
  width: 2px;
  background: var(--ink-faint);
  border-radius: 1px;
}
.timeline-step { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.timeline-step .tl-dot {
  position: absolute;
  left: -32px; top: 4px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  border-radius: 50%;
  font-size: 14px;
  z-index: 1;
}
.timeline-step .tl-body { flex: 1; min-width: 0; }
.timeline-step .tl-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.timeline-step .tl-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.timeline-step.tl-done .tl-dot { background: var(--accent); border-color: var(--ink); }
.timeline-step.tl-done .tl-title { color: var(--ink); }
.timeline-step.tl-current .tl-dot { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193, 67, 42, 0.18); }
.timeline-step.tl-current .tl-title { color: var(--ink); }
.timeline-step.tl-future .tl-dot { background: var(--paper); border-color: var(--ink-faint); opacity: 0.7; }
.timeline-step.tl-future .tl-title { color: var(--ink-soft); font-weight: 500; }
.timeline-step.tl-future .tl-sub { color: var(--ink-faint); }

/* Group chat card */
.chat-card { margin-top: 18px; }
.chat-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.chat-card-head h3 { margin: 0; }
.chat-locked { padding: 22px 18px; text-align: center; }
.chat-locked-icon { font-size: 32px; margin-bottom: 8px; }
.chat-locked-msg { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 12px; }
.chat-progress { height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; max-width: 360px; margin: 0 auto; }
.chat-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #e08a4a); transition: width 0.3s ease; }

.chat-thread { max-height: 360px; overflow-y: auto; padding: 4px 4px 12px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { padding: 30px 12px; text-align: center; color: var(--ink-faint); font-style: italic; font-size: 13px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg-avatar { flex: 0 0 28px; }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.chat-msg-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.chat-msg-time { font-size: 11px; color: var(--ink-faint); }
.chat-msg-text { font-size: 14px; color: var(--ink); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chat-msg.is-system .chat-msg-body { padding: 6px 10px; background: var(--paper-2); border-radius: 8px; font-style: italic; color: var(--ink-soft); font-size: 12px; }

.chat-composer { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1.5px dashed var(--ink-faint); position: relative; }
.chat-composer-row { display: flex; gap: 8px; width: 100%; }
.chat-input { flex: 1; min-width: 0; }
.chat-tool { white-space: nowrap; }

/* @ mention autocomplete */
.chat-mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 6px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 2px 3px 0 var(--ink);
  overflow: hidden;
  z-index: 10;
}
.chat-mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}
.chat-mention-item:hover, .chat-mention-item.active { background: var(--accent); color: var(--on-accent); }
.chat-mention-item:hover .cam-avatar, .chat-mention-item.active .cam-avatar { background: var(--paper); }

/* Muted banner */
.chat-muted-banner {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 10px;
}

/* Pinned section */
.chat-pinned {
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.chat-pinned-label { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.chat-msg.is-pinned { padding: 4px 0; }

/* Mention highlight */
.chat-mention { background: rgba(193, 67, 42, 0.12); color: var(--accent-3); padding: 1px 4px; border-radius: 4px; font-weight: 600; }

/* Message actions row */
.chat-msg-actions {
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s ease;
  margin-top: 4px;
}
.chat-msg:hover .chat-msg-actions { opacity: 1; }
.chat-action {
  background: transparent; border: 1px solid transparent; cursor: pointer;
  font-size: 11px; padding: 2px 6px; border-radius: 4px; color: var(--ink-soft);
}
.chat-action:hover { background: var(--paper-2); color: var(--ink); }
.chat-action.danger:hover { background: #fee2e2; color: #b91c1c; }
.chat-msg-pin { font-size: 12px; }

/* Poll */
.chat-msg.is-poll { /* extra emphasis */ }
.chat-msg-poll-tag { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(193, 67, 42, 0.1); padding: 1px 6px; border-radius: 4px; }
.chat-poll-question { font-weight: 600; font-size: 14px; color: var(--ink); margin: 4px 0 8px; }
.chat-poll-options { display: flex; flex-direction: column; gap: 6px; }
.chat-poll-option {
  position: relative; display: block; width: 100%;
  background: var(--paper); border: 1.5px solid var(--ink-faint);
  border-radius: 6px; padding: 8px 10px; cursor: pointer; text-align: left;
  overflow: hidden; transition: border-color 0.15s ease, background 0.15s ease;
}
.chat-poll-option:hover:not(.closed) { border-color: var(--accent); background: var(--paper-2); }
.chat-poll-option.voted { border-color: var(--accent); background: rgba(193, 67, 42, 0.05); }
.chat-poll-option.closed { cursor: default; opacity: 0.8; }
.chat-poll-bar {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: rgba(193, 67, 42, 0.12);
  transition: width 0.3s ease;
  z-index: 0;
}
.chat-poll-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.chat-poll-check { color: var(--accent); font-weight: 700; width: 14px; }
.chat-poll-text { flex: 1; font-size: 13px; }
.chat-poll-pct { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.chat-poll-voters { position: relative; z-index: 1; font-size: 11px; color: var(--ink-soft); margin-top: 2px; padding-left: 22px; }

/* Admin menu */
.chat-admin-menu {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 6px 0;
  z-index: 1000;
  min-width: 240px;
}
.chat-admin-menu .cam-head { padding: 8px 12px; font-size: 12px; color: var(--ink-soft); border-bottom: 1px dashed var(--ink-faint); margin-bottom: 4px; }
.cam-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer;
  padding: 8px 12px; font-size: 13px; color: var(--ink);
}
.cam-item:hover { background: var(--paper-2); }
.cam-item.danger:hover { background: #fee2e2; color: #b91c1c; }

/* Deleted message */
.chat-msg.is-deleted { opacity: 0.5; }
.class-timeline { position: relative; padding: 4px 0 4px 32px; margin: 8px 0; }
.class-timeline .timeline-rail {
  position: absolute;
  left: 14px; top: 12px; bottom: 12px;
  width: 2px;
  background: var(--ink-faint);
  border-radius: 1px;
}
.timeline-step { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.timeline-step .tl-dot {
  position: absolute;
  left: -32px; top: 4px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  border-radius: 50%;
  font-size: 14px;
  z-index: 1;
}
.timeline-step .tl-body { flex: 1; min-width: 0; }
.timeline-step .tl-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.timeline-step .tl-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }

.timeline-step.tl-done .tl-dot { background: var(--accent); border-color: var(--ink); }
.timeline-step.tl-done .tl-title { color: var(--ink); }
.timeline-step.tl-current .tl-dot { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193, 67, 42, 0.18); }
.timeline-step.tl-current .tl-title { color: var(--ink); }
.timeline-step.tl-future .tl-dot { background: var(--paper); border-color: var(--ink-faint); opacity: 0.7; }
.timeline-step.tl-future .tl-title { color: var(--ink-soft); font-weight: 500; }
.timeline-step.tl-future .tl-sub { color: var(--ink-faint); }

/* Course details card (admin-edited, member-confirmed) */
.course-card { margin-top: 18px; }
.course-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.course-head h3 { margin: 0; }
.pill.course-status-draft { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--ink-faint); font-size: 11px; }
.pill.course-status-pending { background: rgba(245, 158, 11, 0.12); color: #92400e; border: 1px solid #f59e0b; font-size: 11px; }
.pill.course-status-confirmed { background: rgba(34, 197, 94, 0.14); color: #166534; border: 1px solid #22c55e; font-size: 11px; }
.pill.course-status-in-progress { background: var(--accent); color: var(--on-accent); border-color: var(--ink); font-size: 11px; }

.form-grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .form-grid-3 { grid-template-columns: 1fr; } }

.course-summary { background: var(--paper-2); border-radius: 10px; padding: 16px; border: 1px solid var(--ink-faint); }
.course-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.course-summary-grid .span-2 { grid-column: span 2; }
.course-summary-grid > div { display: flex; flex-direction: column; gap: 2px; }
.course-summary-grid .muted { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.course-summary-grid .strong { font-size: 15px; color: var(--ink); font-weight: 600; }

.course-confirm-section { margin-top: 14px; }
.course-confirm-section h4 { margin: 14px 0 8px; font-size: 14px; }
.course-confirm-list { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
@media (min-width: 721px) {
  .course-confirm-list { grid-template-columns: 1fr 1fr; }
}
.course-confirm-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--paper-2); border-radius: 6px; min-width: 0; }
.course-confirm-row .member-chip { min-width: 0; flex: 1; }
.course-confirm-row .member-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.course-confirm-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.cc-confirmed { background: rgba(34, 197, 94, 0.14); color: #166534; }
.cc-rejected { background: rgba(239, 68, 68, 0.14); color: #991b1b; }
.cc-pending { background: var(--paper); color: var(--ink-soft); border: 1px dashed var(--ink-faint); }

.course-confirm-actions { padding: 12px; background: var(--paper-2); border-radius: 8px; border: 1px dashed var(--ink-faint); }
.course-admin-finalize { margin-top: 12px; padding: 12px; background: rgba(193, 67, 42, 0.05); border-radius: 8px; border: 1.5px solid var(--accent); }
.course-admin-finalize h4 { margin: 0 0 6px; font-size: 13px; color: var(--accent); }

.course-locked-banner { margin-top: 14px; padding: 10px 14px; background: rgba(34, 197, 94, 0.1); border: 1.5px solid #22c55e; border-radius: 8px; text-align: center; font-weight: 600; color: #166534; }

/* ===== Payment section (course card) ===== */
.course-payment-section {
  margin-top: 18px;
  padding: 14px;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 12px;
  background: var(--paper-2);
}
.course-payment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.course-payment-head h4 { margin: 0; }
.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) { .pay-method-grid { grid-template-columns: 1fr; } }
.pay-method-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  box-shadow: 2px 2px 0 var(--ink);
}
.pay-method-tile:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.pay-method-tile.is-paid {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
  box-shadow: 2px 2px 0 #22c55e;
}
.pay-method-tile-emoji { font-size: 26px; }
.pay-method-tile-label { font-weight: 700; font-size: 13px; }
.pay-method-tile-status { font-size: 11px; color: var(--ink-soft); }
.pay-method-tile.is-paid .pay-method-tile-status { color: #16a34a; font-weight: 600; }

.pay-modal-qr { text-align: center; padding: 12px; background: #fff; border-radius: 8px; }
.pay-modal-qr img { width: 240px; height: 240px; object-fit: contain; border-radius: 4px; }
.pay-modal-instructions {
  padding: 14px;
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.admin-payment-status { font-size: 13px; }
.admin-payment-status summary { cursor: pointer; padding: 6px 0; color: var(--ink-soft); }
.admin-payment-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.admin-payment-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--paper); border-radius: 6px; }

/* Course page link card (inside the confirmation section) */
.course-page-link-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: linear-gradient(0deg, var(--accent-2) 0%, var(--paper-2) 100%);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}
.app[data-theme="dark"] .course-page-link-card {
  background: rgba(194, 65, 12, 0.18);
}

/* ===== Course page (standalone view) ===== */
.course-page-wrap { max-width: 1100px; margin: 0 auto; }
.course-page-back { margin-bottom: 12px; }
.course-page-hero { margin-bottom: 14px; }
.course-page-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--ink-soft); text-transform: uppercase;
  margin-bottom: 4px;
}
.course-page-title { font-size: 32px; font-weight: 800; margin: 0 0 10px; }
.course-page-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.course-page-desc { font-size: 15px; line-height: 1.55; margin: 14px 0 0; color: var(--ink); }
.course-page-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
@media (max-width: 880px) { .course-page-grid { grid-template-columns: 1fr; } }
.course-page-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.course-page-info-grid .strong { font-size: 16px; font-weight: 700; margin-top: 2px; }

.course-page-checkout h3 { margin: 0 0 8px; }
.course-page-form .form-row { margin-bottom: 10px; }
.form-row-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.course-page-stripe-note {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--paper-2);
  border-radius: 6px;
  margin-bottom: 10px;
}
.course-page-stripe-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: #635bff; color: #fff;
  padding: 2px 6px; border-radius: 3px;
}
.course-page-pay-btn { width: 100%; margin-top: 4px; }
.course-page-paid {
  text-align: center;
  padding: 14px 8px;
  background: rgba(34, 197, 94, 0.08);
  border: 1.5px solid #22c55e;
  border-radius: 10px;
}
.course-page-paid.is-pending {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}
.course-page-paid.is-pending .course-page-paid-icon {
  background: #f59e0b;
}
.course-page-paid-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: #22c55e; color: white; font-size: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

/* Pay method tile: pending state (awaiting admin confirmation) */
.pay-method-tile.is-pending {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
  box-shadow: 2px 2px 0 #f59e0b;
}
.pay-method-tile.is-pending .pay-method-tile-status { color: #b45309; font-weight: 600; }

/* ===== Admin: Orders page ===== */
.orders-table { width: 100%; font-size: 13px; }
.orders-table-head, .orders-table-row {
  display: grid;
  grid-template-columns: 130px 1.4fr 1.4fr 1fr 90px 120px 100px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
}
.orders-table-head {
  background: var(--paper-2);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--ink);
}
.orders-table-row { border-bottom: 1px solid var(--ink-faint); }
.orders-table-row:last-child { border-bottom: none; }
.orders-table-row:hover { background: var(--paper-2); }
.orders-table-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--ink-soft); }
@media (max-width: 1200px) {
  .orders-table-head, .orders-table-row {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
  .orders-table-head > div:nth-child(n+5),
  .orders-table-row > div:nth-child(n+5) { display: none; }
  .orders-table-head, .orders-table-row { padding: 8px 10px; font-size: 12px; }
}

/* ===== Admin: Payments page ===== */
.payment-overview {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  margin-bottom: 18px;
}
.payment-overview-icon { font-size: 28px; flex-shrink: 0; }
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 960px) { .payment-grid { grid-template-columns: 1fr; } }
.payment-method-card.is-disabled { opacity: 0.85; }
.payment-method-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.payment-method-title { display: flex; align-items: center; gap: 10px; flex: 1; }
.payment-method-emoji { font-size: 26px; }
.payment-label-input { font-size: 16px; font-weight: 700; }
.input-plain { background: transparent; border-color: transparent; padding: 4px 6px; }
.input-plain:hover, .input-plain:focus { background: var(--paper); border-color: var(--ink-faint); }
.payment-qr-row { display: grid; grid-template-columns: 180px 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 600px) { .payment-qr-row { grid-template-columns: 1fr; } }
.payment-qr-preview {
  width: 180px; height: 180px;
  background: #fff;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.payment-qr-preview img { width: 100%; height: 100%; object-fit: contain; }
.payment-qr-placeholder { padding: 10px; }
.payment-qr-actions { display: flex; flex-direction: column; gap: 6px; }
.payment-method-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }

/* iOS-style toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider {
  position: relative;
  width: 44px; height: 24px;
  background: var(--ink-faint);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-slider { background: var(--accent-2); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { opacity: 0.5; cursor: not-allowed; }
.switch-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); min-width: 50px; }
.switch input:checked + .switch-slider + .switch-label { color: var(--accent-2); }

/* ===== Responsive — mobile-first refinements ===== */
.course-card { margin-top: 18px; }
.course-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.course-head h3 { margin: 0; }
.pill.course-status-draft { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--ink-faint); font-size: 11px; }
.pill.course-status-pending { background: rgba(245, 158, 11, 0.12); color: #92400e; border: 1px solid #f59e0b; font-size: 11px; }
.pill.course-status-confirmed { background: rgba(34, 197, 94, 0.14); color: #166534; border: 1px solid #22c55e; font-size: 11px; }
.pill.course-status-in-progress { background: var(--accent); color: var(--on-accent); border-color: var(--ink); font-size: 11px; }

.form-grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .form-grid-3 { grid-template-columns: 1fr; } }

.course-summary { background: var(--paper-2); border-radius: 10px; padding: 16px; border: 1px solid var(--ink-faint); }
.course-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.course-summary-grid .span-2 { grid-column: span 2; }
.course-summary-grid > div { display: flex; flex-direction: column; gap: 2px; }
.course-summary-grid .muted { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.course-summary-grid .strong { font-size: 15px; color: var(--ink); font-weight: 600; }

/* Tablet / small laptop */
@media (max-width: 900px) {
  .topnav { padding: 14px 22px; }
  .topnav-actions { gap: 8px; }
  .app { padding: 8px 22px 60px; }
  .req-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* Phone */
@media (max-width: 720px) {
  /* Topnav: drop the brand sub, shrink user name area, tighten gap */
  .topnav { padding: 10px 14px; gap: 8px; }
  .brand-sub { display: none; }
  .brand-text { display: none; }  /* on phones, brand is just the icon */
  .brand { gap: 0; }
  .topnav-actions { gap: 6px; }
  .topnav-actions .nav-cluster { gap: 4px; }
  .topnav-actions .pill.tz { display: none; }  /* too wide for phones — tz info is on home/header anyway */
  .topnav-actions .row > .muted { display: none; } /* hide "Mia" beside avatar on phones */
  .topnav-actions .btn { font-size: 12px; padding: 6px 10px; white-space: nowrap; }
  .theme-toggle { width: 32px; height: 32px; }
  .inbox-btn { width: 32px; height: 32px; font-size: 14px; }
  .admin-badge { padding: 0; width: 32px; height: 32px; justify-content: center; }
  .admin-badge-text { display: none; }
  .admin-badge-icon { font-size: 14px; }

  .app { padding: 6px 16px 56px; }

  /* Hero */
  .hero { grid-template-columns: 1fr; gap: 20px; padding: 22px 0 14px; }
  .hero h1 { font-size: 34px; }
  .hero .cta-row { gap: 8px; }
  .hero .cta-row .btn { flex: 1 1 auto; min-width: 0; }
  .hero-illu { aspect-ratio: 16 / 11; }

  /* Section titles */
  .section-title h2 { font-size: 20px; }
  .section-title .sub { font-size: 12px; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr; }
  .slot-row { grid-template-columns: 1fr 1fr auto; }
  .slot-row .day-select { grid-column: 1 / -1; }

  /* Cards / cards grids */
  .req-list { grid-template-columns: 1fr; gap: 14px; }
  .req-card { padding: 14px 16px; }
  .req-card h3 { font-size: 17px; }
  .req-card .req-author-row { font-size: 11.5px; }
  .card { padding: 16px; }
  .card h3 { font-size: 18px; }

  /* Filter bar stacks and wraps more aggressively */
  .filter-bar { padding: 10px 12px; gap: 8px; }
  .filter-bar .field { font-size: 12px; }
  .filter-bar select, .filter-bar input { font-size: 12px; padding: 5px 8px; }

  /* TZ banner — keep the facts, drop the note on small screens */
  .tz-banner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tz-banner .note { display: none; }

  /* Top stat card stacks */
  .card[style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; }
  .card[style*="grid-template-columns:1fr 1fr 1fr"] > .content > div:nth-child(3) {
    grid-column: 1 / -1;
  }

  /* Detail page */
  .detail-creator { flex-direction: column; align-items: flex-start; gap: 10px; }
  .detail-creator .avatar-host { width: 56px !important; height: 56px !important; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .profile-header .avatar-host { width: 64px !important; height: 64px !important; }

  /* Modal: go nearly full-width */
  .modal { max-width: none; border-radius: 14px; }
  .modal-backdrop { padding: 8px; }

  /* Buttons row: wrap + stack when many */
  .row[style*="justify-content:flex-end"] { flex-wrap: wrap; }

  /* Pickers collapse to fewer columns */
  .avatar-picker { grid-template-columns: repeat(4, 1fr); }
  .mbti-picker { grid-template-columns: repeat(2, 1fr); }

  /* Slot row in cards: still fits, just ensure min-width */
  .slot-list .slot { gap: 4px; }
  .slot-list .slot .bj { font-size: 11px; }
}

/* Very small phones */
@media (max-width: 420px) {
  .hero h1 { font-size: 30px; }
  .req-card h3 { font-size: 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .field { width: 100%; }
  .filter-bar select, .filter-bar input { flex: 1; min-width: 0; }
}

/* ===== Misc utility ===== */
.row { display: flex; gap: 10px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--ink-soft); }
.spacer-sm { height: 8px; }
.spacer-md { height: 16px; }
.spacer-lg { height: 28px; }

/* ===== My requests: 3-column grid of full req-cards ===== */
.myreq-section-head {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 10px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.myreq-section-head .muted { font-size: 13px; font-weight: 500; }

.myreq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.myreq-grid > .req-card { height: 100%; }

@media (max-width: 720px) {
  .myreq-grid { grid-template-columns: 1fr; }
}
.kbd {
  font-family: 'Inter', monospace;
  font-size: 12px;
  border: 1px solid var(--ink-faint);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--paper-2);
}

/* ===== Timezone hint (clock icon + label) ===== */
.tz-hint {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tz-hint .clock-icon {
  width: 11px; height: 11px;
  flex-shrink: 0;
  color: var(--ink-soft);
  align-self: center;
}
.tz-hint .tz-label {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.01em;
}
a.link {
  color: var(--accent);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 500;
}

/* ===== Login / signup card on home (when unauth) ===== */
.auth-card-wrap { display: flex; flex-direction: column; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }

/* ===== Decorative italic note (used for callouts) ===== */
.note {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  color: var(--accent-2);
  display: inline-block;
}

/* ===== Native select dropdowns in dark mode ===== */
[data-theme="dark"] .select,
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .filter-bar input,
[data-theme="dark"] select.input {
  color-scheme: dark;
}

/* =========================================================
   Admin backend layout
   ========================================================= */

/* When admin mode, let the app container go full-width so the
   sidebar can be a proper nav. */
.app.admin-mode {
  max-width: none;
  padding: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 90px);
  background: var(--paper);
  margin: 0 -28px;
  padding: 0 28px;
}

/* ===== Sidebar ===== */
.admin-sidebar {
  background: var(--paper-2);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .sketch {
  display: none;              /* no outer border on the sidebar itself */
}
.admin-sidebar .content {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
}
.admin-sidebar-head {
  padding: 18px 18px 14px;
  border-bottom: 1.5px dashed var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-logo {
  width: 38px; height: 38px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 2px solid var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--ink);
}
.admin-brand {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
}
.admin-tag {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.admin-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  width: 100%;
  transition: background 0.12s ease, color 0.12s ease;
}
.admin-nav-item:hover:not(.disabled) { background: var(--paper-3); }
.admin-nav-item.active {
  background: var(--paper);
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: 9px;
  box-shadow: 1px 1px 0 var(--ink-faint);
}
.admin-nav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.admin-nav-icon {
  font-size: 15px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: color 0.15s;
}
.admin-nav-item:hover .admin-nav-icon { color: var(--ink); }
.admin-nav-item.active .admin-nav-icon { color: var(--accent); }
.admin-nav-icon .nav-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.admin-nav-label { flex: 1; }
.admin-soon {
  font-size: 9px;
  text-transform: uppercase;
  background: var(--paper-3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.admin-sidebar-foot {
  padding: 12px 14px 16px;
  border-top: 1.5px dashed var(--ink-faint);
}
.admin-sidebar-foot .btn { width: 100%; justify-content: center; }

/* ===== Main area ===== */
.admin-main {
  padding: 24px 28px 60px;
  overflow-x: auto;
  position: relative;
}

.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 12px;
}
.admin-page-head h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ===== KPI cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--paper);
  padding: 16px 18px;
  position: relative;
  min-height: 100px;
}
.kpi-card .kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  font-weight: 600;
}
.kpi-card .kpi-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 40px;
  font-weight: 700;
  margin: 4px 0 2px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.kpi-card .kpi-trend {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
}
.kpi-card .kpi-trend.up { color: var(--accent-3); }
.kpi-card .kpi-trend.warn { color: var(--accent); }

/* ===== Two-col layout (dashboard widgets) ===== */
.admin-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.admin-two-col .card { margin: 0; }
.admin-two-col h3 { margin: 0 0 10px; font-size: 16px; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; }

/* ===== Activity feed ===== */
.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.activity-feed li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--ink-faint);
}
.activity-feed li:last-child { border-bottom: none; }
.activity-line { display: flex; align-items: baseline; gap: 6px; line-height: 1.4; }
.activity-icon { flex-shrink: 0; }
.activity-meta { font-size: 11px; color: var(--ink-faint); margin-top: 2px; padding-left: 22px; }

/* ===== Mini chart ===== */
.mini-chart {
  width: 100%;
  height: 130px;
  display: block;
  margin: 4px 0 8px;
}
.mini-chart-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.mini-chart-foot strong {
  color: var(--ink);
  font-weight: 700;
}

/* ===== Filters ===== */
.admin-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.admin-filters .input { flex: 1 1 200px; max-width: 320px; }
.admin-filters .select { flex: 0 0 auto; min-width: 120px; }

/* Admin Classes filter: 2-row layout (4 items per row, search spans 2 cols on row 1) */
.admin-filters-tall {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  align-items: center;
  padding: 12px 14px;
  background: var(--paper-2);
  border-radius: 12px;
  gap: 8px 10px;
  width: 100%;
  box-sizing: border-box;
}
.admin-filters-tall > * {
  min-width: 0;
}
.admin-filters-tall .input {
  grid-column: 1 / 2;
  min-width: 0;
}
.admin-filters-tall .select,
.admin-filters-tall > .btn {
  padding: 6px 10px;
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 1080px) {
  .admin-filters-tall {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
  .admin-filters-tall .input { grid-column: 1 / 3; }
}
@media (max-width: 720px) {
  .admin-filters-tall {
    grid-template-columns: 1fr 1fr;
  }
  .admin-filters-tall .input { grid-column: 1 / 3; }
}

/* ===== Admin table ===== */
.admin-table {
  background: var(--paper);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}
.admin-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--paper-2);
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1.5px solid var(--ink);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-faint);
  vertical-align: middle;
}
.admin-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}
.admin-table tbody tr:hover { background: var(--paper-2); }
.admin-table tbody tr:last-child td { border-bottom: none; }

.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.cell-user .user-name { font-weight: 600; font-size: 13px; }
.cell-user .user-id { font-size: 10px; font-family: 'SF Mono', Menlo, monospace; opacity: 0.7; }

.cell-payments { display: flex; flex-direction: column; gap: 2px; }
.cell-payments .pay-progress {
  font-size: 12px; font-weight: 700; color: var(--ink);
  display: inline-flex; align-items: center; gap: 4px;
}
.cell-payments .pay-progress.is-complete { color: #16a34a; }
.cell-payments .pay-progress.is-complete::before { content: '✓ '; }
.cell-payments .pay-pending { font-size: 10px; color: #b45309; font-weight: 600; }

.cell-email { font-size: 12.5px; color: var(--ink-soft); }

.admin-mini-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Topnav admin entry button */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  box-shadow: 1px 2px 0 var(--ink);
  transition: transform 0.08s ease;
}
.admin-badge:hover { transform: translate(-1px, -1px); }
.admin-badge:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }

/* In the topnav, make admin badge match the other 36px chips */
.topnav-actions .admin-badge {
  height: 36px;
  padding: 0 14px;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.1s ease, background 0.15s ease;
}
.topnav-actions .admin-badge:hover { transform: translate(-1px, -1px); background: var(--accent); }
.topnav-actions .admin-badge:active { transform: translate(1px, 1px); }
.topnav-actions .admin-badge-icon { font-size: 14px; }

/* ===== Admin drawer (user detail) ===== */
.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 49;
  animation: fadeIn 0.18s ease;
}
.admin-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 500px;
  max-width: 100vw;
  background: var(--paper);
  z-index: 50;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--ink);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.22s ease;
  overflow: hidden;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.admin-drawer-head {
  padding: 12px 18px;
  border-bottom: 1.5px dashed var(--ink-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper-2);
  flex-shrink: 0;
}
.admin-drawer-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
}
.admin-drawer-foot {
  padding: 12px 18px;
  border-top: 1.5px dashed var(--ink-faint);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--paper-2);
  flex-shrink: 0;
}
.drawer-user-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1.5px dashed var(--ink-faint);
}
.drawer-user-block h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 24px;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.drawer-section-head {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 8px;
  letter-spacing: 0.01em;
}
.drawer-class-list, .drawer-activity {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 13px;
}
.drawer-class-list li, .drawer-activity li {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.drawer-class-list a {
  color: var(--accent);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 500;
}
.drawer-class-list a:hover { color: var(--ink); }
.drawer-activity li { font-size: 12.5px; color: var(--ink-soft); }

/* ===== Mobile responsive for admin ===== */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 200px 1fr; }
  .admin-main { padding: 18px 18px 40px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-layout {
    grid-template-columns: 1fr;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .admin-sidebar { border-bottom: 2px solid var(--ink); }
  .admin-sidebar-head { display: none; }            /* mobile: just nav + footer */
  .admin-sidebar-foot { display: none; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding: 8px 10px; gap: 4px; }
  .admin-nav-item { white-space: nowrap; flex-shrink: 0; padding: 6px 10px; font-size: 13px; }
  .admin-nav-item.active { border-left: none; border-bottom: 3px solid var(--accent); padding-left: 10px; }
  .admin-main { padding: 14px 12px 40px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-page-head { flex-direction: column; }
  .admin-drawer { width: 100vw; max-width: 100vw; border-left: none; }
  .admin-table { font-size: 12px; overflow-x: auto; }
  .admin-table table { min-width: 720px; }
}

/* =========================================================
   Announcement banner (home page)
   ========================================================= */
.announcement-banner {
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-soft);
  border-radius: 12px;
  padding: 10px 16px;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.announcement-icon { font-size: 18px; flex-shrink: 0; }
.announcement-banner span:last-child { flex: 1; }

/* =========================================================
   Maintenance page
   ========================================================= */
.maintenance-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 560px;
  margin: 40px auto;
}
.maintenance-illu { font-size: 80px; margin-bottom: 18px; }
.maintenance-page h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 32px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.maintenance-announcement {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-soft);
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
}

/* =========================================================
   Report link on user cards
   ========================================================= */
.report-link {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--ink-faint);
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.report-link:hover {
  background: var(--paper-2);
  color: var(--ink);
  transform: translateY(-1px);
}

/* =========================================================
   Admin: nav badge count (e.g. for moderation queue)
   ========================================================= */
.admin-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  margin-left: auto;
}

/* =========================================================
   User status mini badges (in drawer header)
   ========================================================= */
.status-mini {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.status-suspended { background: var(--accent-4); color: var(--ink); }
.status-banned { background: var(--accent); color: var(--on-accent); }

/* =========================================================
   Admin Classes (request management) page
   ========================================================= */
.cell-class-title { font-weight: 600; font-size: 13px; }
.cell-class-meta { font-size: 11px; }
.cell-class { position: relative; padding-right: 50px; }
.stale-flag {
  position: absolute;
  top: 0; right: 0;
  font-size: 9px;
  background: var(--accent-4);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================================
   Admin Moderation page
   ========================================================= */
.report-card {
  background: var(--paper);
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
  position: relative;
}
.report-card.dismissed, .report-card.actioned { opacity: 0.7; }
.report-card.dismissed { background: var(--paper-2); }
.report-card.actioned { background: var(--paper-2); }
.report-card .sketch { display: none; }
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed var(--ink-faint);
}
.report-type {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  letter-spacing: 0.02em;
}
.report-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  letter-spacing: 0.02em;
}
.report-status.status-pending { background: var(--accent-4); color: var(--ink); }
.report-status.status-dismissed { background: var(--paper-3); color: var(--ink-soft); }
.report-status.status-actioned { background: var(--accent-3); color: var(--on-accent); }
.report-reason {
  font-style: italic;
  font-size: 14px;
  padding: 8px 0;
  color: var(--ink);
}
.report-content {
  background: var(--paper-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 6px;
}
.report-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1.5px dashed var(--ink-faint);
}

/* =========================================================
   Admin Analytics charts
   ========================================================= */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.analytics-grid .card h3 { margin: 0 0 4px; font-size: 16px; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; }
.hand-chart {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 6px;
}

/* KPI strip */
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 16px;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  position: relative;
  box-shadow: 2px 2px 0 var(--ink);
}
.kpi-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.kpi-body { min-width: 0; }
.kpi-label {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 2px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1;
  margin-bottom: 2px;
  color: var(--ink);
}
.kpi-sub {
  font-size: 11px;
  color: var(--ink-soft);
}
@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Admin System page
   ========================================================= */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--paper-3);
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--ink);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--paper);
}

.config-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.config-list li { padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.config-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* =========================================================
   Inbox button (topnav) + Inbox modal
   ========================================================= */
.inbox-btn {
  position: relative;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease;
}
.inbox-btn:hover { transform: translate(-1px, -1px); background: var(--paper-3); border-color: var(--ink); }
.inbox-btn:active { transform: translate(1px, 1px); }
.inbox-btn .nav-svg { width: 16px; height: 16px; }
.inbox-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding-bottom: 1px;  /* visual centering tweak */
}

.inbox-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  min-height: 400px;
  max-height: 560px;
}
.inbox-list {
  border-right: 1.5px dashed var(--ink-faint);
  overflow-y: auto;
  background: var(--paper-2);
}
.inbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px dashed var(--ink-faint);
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
}
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover { background: var(--paper-3); }
.inbox-row.read { opacity: 0.6; }
.inbox-row.read .inbox-subject { font-weight: 500; }
.inbox-type-icon {
  flex-shrink: 0;
  font-size: 16px;
  width: 22px;
  text-align: center;
  line-height: 1.2;
}
.inbox-row-text { flex: 1; min-width: 0; }
.inbox-subject {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
  word-break: break-word;
}
.inbox-preview {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.inbox-time { font-size: 10px; }
.inbox-dot {
  position: absolute;
  top: 12px; right: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.inbox-detail {
  padding: 20px 24px;
  overflow-y: auto;
  background: var(--paper);
}
.email-head { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1.5px dashed var(--ink-faint); }
.email-subject {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}
.email-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}
.email-meta .muted { display: inline-block; min-width: 36px; }
.email-body {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--ink);
}

@media (max-width: 720px) {
  .inbox-wrap { grid-template-columns: 1fr; }
  .inbox-list { max-height: 180px; }
}

/* =========================================================
   Admin: Mail server table
   ========================================================= */
.email-subject-cell { font-weight: 500; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-type-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-soft);
  background: var(--paper-2);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.email-type-tag.type-welcome { background: #d6e9c6; }
.email-type-tag.type-class-created { background: var(--paper-3); }
.email-type-tag.type-join { background: #d6e9c6; }
.email-type-tag.type-report { background: #f4d4cf; }
.email-type-tag.type-report-resolved { background: #d6e9c6; }
.email-type-tag.type-admin-broadcast { background: var(--highlight); }
.email-type-tag.type-test { background: #e0ecf2; }

/* =========================================================
   My Level section
   ========================================================= */
.level-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 880px) {
  .level-method-grid { grid-template-columns: 1fr; }
}
.level-method {
  border: 1.5px dashed var(--ink-faint);
  border-radius: 14px;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--paper-2);
  transition: border-color 0.15s, transform 0.15s;
}
.level-method:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.level-method-emoji {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 2px;
}
.level-method-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.level-method-desc {
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
  flex: 1;
}
.level-method .btn {
  align-self: flex-start;
  margin-top: 4px;
  text-decoration: none;
}

.level-panel {
  margin-top: 16px;
  border-top: 1.5px dashed var(--ink-faint);
  padding-top: 16px;
}
.level-panel[hidden] { display: none; }
.level-panel-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--ink);
}

.level-hsk-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 880px) {
  .level-hsk-grid { grid-template-columns: repeat(2, 1fr); }
}
.level-hsk-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  padding: 10px 6px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 64px;
}
.level-hsk-tile input { position: absolute; opacity: 0; pointer-events: none; }
.level-hsk-tile-name {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}
.level-hsk-tile-desc {
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 3px;
  line-height: 1.3;
}
.level-hsk-tile:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
}
.level-hsk-tile:has(input:checked) .level-hsk-tile-name { color: var(--paper); }
.level-hsk-tile:has(input:checked) .level-hsk-tile-desc { color: rgba(255,255,255,0.7); }

.level-sub-question {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  background: var(--paper-2);
}
.level-sub-question[hidden] { display: none; }
.level-sub-q-label {
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--ink);
}
.level-yesno {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.15s, background 0.15s;
}
.level-yesno:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.level-yesno input { accent-color: var(--ink); }

/* Test panel */
.level-test-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.level-test-q {
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 12px;
  padding: 16px;
}
.level-test-q-num {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 6px;
  font-weight: 600;
}
.level-test-q-text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
  line-height: 1.4;
  color: var(--ink);
}
.level-test-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-test-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.4;
  background: var(--paper);
  transition: border-color 0.15s, background 0.15s;
}
.level-test-opt:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.level-test-opt input { accent-color: var(--ink); }
.level-test-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-faint);
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  flex-shrink: 0;
}
.level-test-opt:has(input:checked) .level-test-opt-letter {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* "I don't know" option: italic + dashed, slightly muted */
.level-test-opt.is-iknow {
  border-style: dashed;
  background: var(--paper-2);
  color: var(--ink-faint);
  font-style: italic;
}
.level-test-opt.is-iknow .level-test-opt-letter {
  border-style: dashed;
  color: var(--ink-faint);
}
.level-test-opt.is-iknow:has(input:checked) {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  border-style: solid;
  font-style: italic;
}
.level-test-opt.is-iknow:has(input:checked) .level-test-opt-letter {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  border-style: solid;
}

/* Result panel */
.level-result-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 14px;
  position: relative;
}
.level-result-card::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 14px;
  pointer-events: none;
  transform: rotate(-0.5deg);
}
.level-result-num {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 40px;
  color: var(--ink);
  line-height: 1;
  flex-shrink: 0;
}
.level-result-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

/* =========================================================
   Level test modal
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
  animation: modalFadeIn 0.18s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: var(--paper);
  border-radius: 18px;
  border: 1.5px solid var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  animation: modalSlideUp 0.22s ease-out;
}
@keyframes modalSlideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-card .modal-head {
  padding: 18px 22px 14px;
  border-bottom: 1.5px dashed var(--ink-faint);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-card .modal-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 18px;
  margin: 0;
  color: var(--ink);
}
.modal-card .modal-body {
  padding: 22px;
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}
.modal-card .modal-foot {
  padding: 14px 22px;
  border-top: 1.5px dashed var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper-2);
  flex-wrap: wrap;
}
.modal-card .modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px 8px;
  margin: -4px -8px 0 0;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.modal-card .modal-close:hover {
  color: var(--ink);
  background: var(--paper-2);
}
.level-test-modal .modal-body {
  min-height: 280px;
}

/* Self-declare modal: confirm note when HSK 4+ is selected */
.level-self-modal .modal-body { min-height: 280px; }
.level-self-note {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--hsk4-bg, #e0a96a);
  color: var(--hsk4-fg, #fff8ec);
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
}
.level-self-note[hidden] { display: none; }
.level-self-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-weight: 800;
  flex-shrink: 0;
}

/* Admin Users table: level source column + cell-level styling */
.admin-table .cell-level { white-space: nowrap; }
.admin-table .cell-level-source { font-size: 12px; color: var(--ink-soft); }
.admin-table .cell-level-source span { display: inline-flex; align-items: center; gap: 4px; }

/* Admin user detail: small status tags for pinyin/chars */
.admin-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-faint);
  background: var(--paper);
  letter-spacing: 0.01em;
}
.admin-tag.tag-ok { background: #d6e9c6; color: #2d4a1a; border-color: #b4cfa0; }
.admin-tag.tag-mid { background: #fce6c2; color: #5a4a1a; border-color: #e7c994; }
.admin-tag.tag-warn { background: #f4d4cf; color: #5a2a1f; border-color: #dfb2a8; }
[data-theme="dark"] .admin-tag.tag-ok { background: #2a3a1a; color: #c6dcb3; border-color: #3a5028; }
[data-theme="dark"] .admin-tag.tag-mid { background: #3a2e1a; color: #d8c590; border-color: #4a3a22; }
[data-theme="dark"] .admin-tag.tag-warn { background: #3a221a; color: #d8a896; border-color: #4a2e22; }

/* External classes promotion box (pinned below timezone banner) */
.external-classes-box { margin: 0 0 18px; }
.external-classes-box .content {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--paper-2) 0%, var(--paper) 100%);
}
.external-classes-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.external-classes-body {
  flex: 1;
  min-width: 0;
}
.external-classes-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.external-classes-text {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}
.external-classes-text strong { color: var(--ink); font-weight: 700; }
.external-classes-cta-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  align-items: stretch;
  min-width: 180px;
}
.external-classes-cta {
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  justify-content: center;
}
@media (max-width: 720px) {
  .external-classes-box .content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .external-classes-cta-group { width: 100%; }
  .external-classes-cta { width: 100%; }
}

/* =========================================================
   Hand-drawn scrollbar style (CSS)
   Paper-tone track, ink-tone thumb, hidden native arrows
   ========================================================= */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-soft) var(--paper-2);
}
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
  background: transparent;
}
::-webkit-scrollbar-track {
  background: var(--paper-2);
  border-radius: 7px;
  border: 1.5px dashed var(--ink-faint);
  margin: 4px 2px;
}
::-webkit-scrollbar-track:hover {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: var(--paper);
  border-radius: 7px;
  border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper-2);
  min-height: 36px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--paper-2);
  box-shadow: inset 0 0 0 2px var(--paper);
}
::-webkit-scrollbar-thumb:active {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}
/* Hide the up/down arrows — they're clunky and don't fit the look */
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
::-webkit-scrollbar-corner {
  background: transparent;
}
/* Dark mode tweaks */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #2a2018;
  border-color: var(--ink-faint);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3a2e22;
  border-color: var(--ink-soft);
  box-shadow: inset 0 0 0 2px #2a2018;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #4a3a28;
}

/* =========================================================
   Onboarding tour (first-time user guide)
   ========================================================= */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}
.onboarding-center-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  animation: onbFadeIn 0.25s ease;
}
.onboarding-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--paper);
  border-radius: 18px;
  pointer-events: auto;
  animation: onbPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10000;
}
.onboarding-card .content {
  padding: 32px 28px 24px;
  text-align: center;
}
.onboarding-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}
.onboarding-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.onboarding-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.onboarding-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 18px;
}
.onboarding-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--ink-faint);
  transition: all 0.2s ease;
}
.onboarding-dot.done {
  background: var(--ink-soft);
}
.onboarding-dot.active {
  background: var(--ink);
  transform: scale(1.4);
}
.onboarding-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.onboarding-actions .btn { min-width: 90px; justify-content: center; }

/* Spotlight cutout */
.onboarding-spotlight {
  position: fixed;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 10000;
  transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: onbGlow 2.4s ease-in-out infinite;
}
@keyframes onbGlow {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.55), 0 0 24px rgba(0,0,0,0.3); }
  50%      { box-shadow: 0 0 0 9999px rgba(0,0,0,0.55), 0 0 32px rgba(0,0,0,0.45); }
}

/* Tooltip for spotlight step */
.onboarding-tooltip {
  position: fixed;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  pointer-events: auto;
  z-index: 10001;
  animation: onbPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.onboarding-tooltip .content {
  padding: 16px 18px;
}
.onboarding-tooltip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.onboarding-icon-sm {
  font-size: 22px;
  line-height: 1;
}
.onboarding-step-num {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 700;
}
.onboarding-title-sm {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--ink);
}
.onboarding-body-sm {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.onboarding-actions-sm {
  display: flex;
  align-items: center;
  gap: 6px;
}
.onboarding-actions-sm .btn { flex: 0 0 auto; }
.onboarding-progress-sm {
  display: flex;
  gap: 4px;
  margin-right: auto;
}
.onboarding-dot-sm {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--ink-faint);
}
.onboarding-dot-sm.done { background: var(--ink-soft); }
.onboarding-dot-sm.active { background: var(--ink); transform: scale(1.4); }

@keyframes onbFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes onbPop {
  from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@media (max-width: 600px) {
  .onboarding-tooltip { width: 280px !important; }
}

/* =========================================================
   Tutors (admin-curated public page)
   ========================================================= */
.tutors-page {
  max-width: 1200px;
}
.tutors-page-head {
  margin-bottom: 18px;
}
.tutors-page-head h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tutors-wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: tutorWave 2.5s ease-in-out infinite;
}
@keyframes tutorWave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.tutor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1100px) {
  .tutor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tutor-grid { grid-template-columns: 1fr; }
}

.tutor-card {
  margin: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tutor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.tutor-card .content {
  padding: 0;
}
.tutor-card-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--paper-2), var(--paper));
  border-bottom: 1.5px dashed var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tutor-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tutor-photo-fallback {
  font-size: 96px;
  opacity: 0.55;
}
.tutor-play {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.tutor-play:hover {
  background: var(--brand);
  border-color: var(--paper);
  transform: scale(1.08);
}
.tutor-card-body {
  padding: 16px 18px 18px;
}
.tutor-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--ink-faint);
}
.tutor-photo-mini {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tutor-photo-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tutor-photo-mini-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}
.tutor-name-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}
.tutor-name {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 19px;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tutor-name-sub {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.tutor-tagline {
  font-size: 13.5px;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.55;
  font-weight: 500;
}
.tutor-creds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--paper-2);
  border-radius: 8px;
  border: 1px dashed var(--ink-faint);
}
.tutor-cred {
  font-size: 13px;
  color: var(--ink);
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: baseline;
  gap: 4px 8px;
  line-height: 1.4;
}
/* Certificates (3rd item) spans both columns */
.tutor-cred.is-wide {
  grid-column: 1 / -1;
}
.tutor-cred-icon {
  grid-row: span 1;
  font-size: 14px;
  text-align: center;
  line-height: 1.4;
}
.tutor-cred-label {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tutor-cred-value {
  grid-column: 2;
  color: var(--ink);
  font-size: 13px;
}
.tutor-langs {
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.tutor-langs-label {
  font-weight: 700;
  color: var(--ink);
  margin-right: 4px;
}
.tutor-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Normalize the trailing ellipsis style — CSS adds "…" automatically when text is clipped */
  word-break: break-word;
}

/* ---- Admin: Tutors page ---- */
.admin-tutor-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-tutor-row {
  margin: 0;
}
.admin-tutor-row .content {
  padding: 0;
}
.admin-tutor-row-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.admin-tutor-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-tutor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-tutor-photo-placeholder {
  font-size: 28px;
  opacity: 0.7;
}
.admin-tutor-info {
  flex: 1;
  min-width: 0;
}
.admin-tutor-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-tutor-tagline {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 2px 0 4px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.admin-tutor-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-tutor-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.admin-tutor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
}
.admin-tutor-form .card .content {
  padding: 18px 20px;
}
.admin-tutor-form h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--ink);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid label .input,
.form-grid label .textarea,
.admin-tutor-form > .card label .input,
.admin-tutor-form > .card label .textarea {
  margin-top: 4px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.admin-tutor-form > .card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .admin-tutor-row-inner { flex-wrap: wrap; }
  .admin-tutor-actions { width: 100%; }
}
.tutor-photo-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tutor-photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tutor-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tutor-photo-empty {
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
  padding: 0 4px;
}
.empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
}

/* ---- Teachers CTA banner (public page) ---- */
.tutors-cta-banner {
  margin: 0 0 20px;
  background: linear-gradient(135deg, var(--paper) 0%, var(--paper-2) 100%);
}
.tutors-cta-banner .content {
  padding: 18px 22px;
}
.tutors-cta-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}
.tutors-cta-text {
  flex: 1;
  min-width: 0;
}
.tutors-cta-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.tutors-cta-sub {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.tutors-cta-inner .btn.primary {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 540px) {
  .tutors-cta-inner { flex-direction: column; align-items: stretch; }
  .tutors-cta-inner .btn.primary { width: 100%; justify-content: center; }
}

/* ---- Tutor personal-page link (bottom of card) ---- */
.tutor-profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.tutor-profile-link:hover {
  background: var(--brand-soft);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.tutor-profile-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.tutor-profile-arrow {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.12s ease;
}
.tutor-profile-link:hover .tutor-profile-arrow {
  transform: translate(2px, -2px);
}

/* ---- Tutor intro video (admin upload + public player) ---- */
.tutor-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;       /* 4:3 videos letterbox inside the 16:9 frame */
  background: #1a1612;        /* dark letterbox matches the dark theme video bg */
  border-radius: 0;
  outline: none;
}
.tutor-video-loading,
.tutor-video-missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
  background: var(--paper-2);
}
.tutor-video-missing {
  color: var(--accent);
  background: rgba(193, 67, 42, 0.08);
}

/* Admin form: video row + preview */
.tutor-video-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tutor-video-preview {
  width: 240px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tutor-video-preview video,
.tutor-video-preview .tutor-video-preview-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1a1612;
}
.tutor-video-present {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink);
  text-align: center;
  padding: 0 14px;
  line-height: 1.4;
}
.tutor-video-present span {
  font-size: 28px;
}
.tutor-video-size {
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
@media (max-width: 600px) {
  .tutor-video-row { flex-direction: column; }
  .tutor-video-preview { width: 100%; }
}

/* ---- Course starts — Beijing time hint ---- */
.course-tz-hint {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  text-transform: none;
}

/* =========================================================
   Social-share modal
   ========================================================= */
.share-modal-wrap .modal-card,
.share-modal {
  width: 100%;
}
.share-modal {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
.share-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1.5px dashed var(--ink-faint);
}
.share-modal-head h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.01em;
}
.share-modal-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.share-section h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
.share-copy-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.share-tab {
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: 'Inter', sans-serif;
}
.share-tab:hover { color: var(--ink); }
.share-tab.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.share-tab .muted {
  font-weight: 400;
  margin-left: 4px;
  opacity: 0.7;
}
.share-copy-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 110px;
}
.share-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.share-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.12s ease;
  text-align: center;
}
.share-platform:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}
.share-platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.share-platform-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.share-platform-hint {
  font-size: 10.5px;
  color: var(--ink-soft);
  font-weight: 500;
}
.share-image-preview {
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 4px;
}
.share-image-preview img {
  width: 100%;
  height: auto;
  display: block;
}
.share-image-placeholder {
  color: var(--ink-soft);
  font-size: 13px;
  padding: 32px 16px;
  text-align: center;
}
.share-section-wechat {
  border-top: 1.5px dashed var(--ink-faint);
  padding-top: 14px;
}

/* Card action row (personal page link + share button) */
.tutor-actions-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tutor-profile-link {
  margin-top: 0;  /* override the previous 14px since the row handles it */
}
.tutor-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.12s ease;
}
.tutor-share-btn:hover {
  background: var(--paper);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

/* Banner: stack the two CTAs on narrow viewports */
.tutors-cta-cta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .tutors-cta-cta { width: 100%; }
  .tutors-cta-cta .btn { flex: 1; justify-content: center; }
}

/* Card icon button — same visual language as the topnav circular buttons */
.card-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
}
.card-icon-btn:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}
.card-icon-btn:active { transform: translateY(0); }
.card-icon-btn .nav-svg {
  width: 16px;
  height: 16px;
}

/* Sign-up form: compact 2-column layout */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.form-grid-2 .form-row {
  margin-bottom: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.form-grid-2 .form-row input,
.form-grid-2 .form-row select { text-align: left; }
.form-grid-2 .form-row label {
  line-height: 1.25;
  text-align: left;
  display: block;
  margin-bottom: 6px;
}
.form-row-tight {
  margin-top: 12px;
  margin-bottom: 0;
}
@media (max-width: 540px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* Home FAQ section */
.home-faq { margin-top: 40px; max-width: 820px; margin-left: auto; margin-right: auto; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }

/* FAQ + Embed widget — side-by-side on desktop, stacked on mobile */
.home-faqs-and-embed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.home-faqs-and-embed > .home-faq { margin-top: 0; }
.home-faqs-and-embed > .home-embed { margin-top: 0; }
@media (max-width: 900px) {
  .home-faqs-and-embed { grid-template-columns: 1fr; }
}
.faq-item {
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  border-radius: 12px;
  padding: 12px 18px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.faq-item[open] {
  background: var(--paper-2);
  border-color: var(--ink);
}
.faq-item summary {
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}
.faq-item[open] summary::after { content: '−'; }
.faq-a {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Home: embed widget section */
.home-embed { margin-top: 40px; }
.embed-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  border-radius: 14px;
  padding: 24px;
}
@media (max-width: 720px) {
  .embed-demo { grid-template-columns: 1fr; }
}
.embed-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--paper-2) 0%, var(--paper) 100%);
  border: 1.5px dashed var(--ink-faint);
  border-radius: 10px;
  min-height: 160px;
}
.embed-preview-placeholder {
  text-align: center;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.embed-preview-icon {
  font-size: 28px;
  opacity: 0.7;
}
.embed-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.embed-preview-sub {
  font-size: 12.5px;
  max-width: 220px;
  line-height: 1.5;
}
.embed-snippet { text-align: left; }
.embed-code {
  background: #2a2520;
  color: #f6efe1;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 12px;
}
.embed-code code { color: inherit; background: transparent; }

/* The widget itself — same styles as the live widget.js for the preview */
.mp-w { display: inline-block; max-width: 320px; font-family: 'Inter', system-ui, sans-serif; line-height: 1.45; color: #2a2520; text-align: left; }
.mp-w a { text-decoration: none; color: inherit; }
.mp-w-card { background: #f6efe1; border: 1.5px solid #2a2520; border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 0 rgba(0,0,0,0.04); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.mp-w-card:hover { transform: translateY(-2px); box-shadow: 0 4px 0 rgba(0,0,0,0.06); }
.mp-w-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mp-w-logo { width: 32px; height: 32px; border-radius: 8px; background: #c1432a; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.mp-w-mark { font-weight: 800; font-size: 11.5px; color: #c1432a; text-transform: uppercase; letter-spacing: 0.04em; }
.mp-w-title { font-weight: 700; font-size: 15px; line-height: 1.3; margin: 4px 0 8px; color: #2a2520; }
.mp-w-meta { font-size: 12px; color: #5a4f44; display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 8px; }
.mp-w-pill { background: #fff; border: 1px solid #8a7e6e; border-radius: 999px; padding: 2px 8px; font-size: 11.5px; color: #2a2520; }
.mp-w-cta { display: inline-flex; align-items: center; gap: 4px; background: #c1432a; color: #fff !important; padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }

/* Admin FAQ editor */
.faq-admin-list { display: flex; flex-direction: column; gap: 10px; }
.faq-admin-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  transition: border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.faq-admin-row.is-dragging { opacity: 0.4; }
.faq-admin-row:hover { border-color: var(--ink); }
.faq-admin-drag {
  display: flex; align-items: center; justify-content: center;
  cursor: grab; font-size: 20px; color: var(--ink-soft);
  user-select: none; padding: 0 4px;
}
.faq-admin-drag:active { cursor: grabbing; }
.faq-admin-body { display: flex; flex-direction: column; gap: 6px; }
.faq-admin-q { font-weight: 700; font-size: 14px; }
.faq-admin-a { font-size: 13px; line-height: 1.5; resize: vertical; min-height: 50px; }
.faq-admin-actions {
  display: flex; flex-direction: column; align-items: flex-end;
  justify-content: space-between; gap: 4px;
}

/* Viral referral loop — share → signup → auto-thank */
.referral-stats {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}
@media (max-width: 540px) {
  .referral-stats { grid-template-columns: 1fr; }
}
.referral-stat { text-align: center; }
.referral-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.referral-label {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.referral-link-box input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--paper-2);
  cursor: copy;
}

/* Welcome banner for new referees */
.referral-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #fff5ed 0%, #fbeae3 100%);
  border: 1.5px dashed var(--brand);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  flex-wrap: wrap;
}
[data-theme="dark"] .referral-welcome-banner {
  background: linear-gradient(135deg, #3a2520 0%, #2a2018 100%);
  border-color: var(--brand);
}

/* User-menu badge (referral count) */
.user-menu-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
}
[data-theme="dark"] .user-menu-badge {
  background: rgba(193, 67, 42, 0.18);
  color: #f4a08a;
}

/* Admin Content tab — sub-tabs + content cards */
.sub-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid var(--ink-faint);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.sub-tab {
  background: transparent;
  border: 0;
  border-bottom: 2.5px solid transparent;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sub-tab:hover { background: var(--paper-2); color: var(--ink); }
.sub-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); background: var(--paper-2); }
.sub-tab-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--paper-2);
  color: var(--ink-soft);
  padding: 1px 7px;
  border-radius: 999px;
}
.sub-tab.is-active .sub-tab-badge { background: var(--brand-soft); color: var(--brand); }

.ai-content-card {
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-content-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.ai-kind {
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10.5px;
  color: var(--ink);
}
.ai-date { font-size: 11.5px; color: var(--ink-soft); }
.ai-status {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: auto;
}
.ai-status.status-draft { background: #fff4d6; color: #8b6a00; }
[data-theme="dark"] .ai-status.status-draft { background: #4a3a16; color: #f1c66b; }
.ai-status.status-published { background: #d6f0d8; color: #2a6e34; }
[data-theme="dark"] .ai-status.status-published { background: #1c3a1f; color: #6dd586; }

.ai-title { font-weight: 700; font-size: 15px; }
.ai-summary { font-size: 13px; }
.ai-body { font-size: 13.5px; line-height: 1.55; min-height: 120px; resize: vertical; }
.ai-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Outreach card */
.ai-outreach-card {
  background: var(--paper-2);
  border: 1.5px solid var(--ink-faint);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--brand);
}
.ai-outreach-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-outreach-who { font-size: 13.5px; }
.ai-outreach-reason {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.ai-outreach-subject { font-weight: 700; font-size: 14px; }
.ai-outreach-body { font-size: 13.5px; line-height: 1.55; min-height: 100px; resize: vertical; }

.ai-sent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--paper-2);
  border: 1px solid var(--ink-faint);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}
.ai-sent-row > .ai-status { margin-left: 0; }

/* Public blog */
.blog-card {
  margin-bottom: 12px;
}
.blog-card .content h3 a:hover { color: var(--brand) !important; }
.blog-post {
  background: var(--paper);
  padding: 28px 32px;
  max-width: 720px;
  margin: 0 auto;
}
.blog-body { font-size: 15.5px; color: var(--ink); }
.blog-body code { font-size: 0.9em; }

/* AI Provider — status pill + source badge */
.ai-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1.5px solid var(--ink-faint);
  background: var(--paper-2);
  color: var(--ink-soft);
}
.ai-status-pill.is-on {
  background: #d6f0d8;
  color: #2a6e34;
  border-color: #6dd586;
}
[data-theme="dark"] .ai-status-pill.is-on {
  background: #1c3a1f;
  color: #6dd586;
  border-color: #2a6e34;
}
.ai-status-pill.is-off {
  background: var(--paper-2);
  color: var(--ink-soft);
}
.ai-status-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}
.ai-status-pill.is-on .ai-status-dot {
  animation: ai-pulse 1.6s ease-in-out infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.ai-source-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff5ed, #fbeae3);
  color: var(--brand);
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: auto;
  border: 1px solid var(--brand-soft);
}
[data-theme="dark"] .ai-source-badge {
  background: rgba(193,67,42,0.15);
  color: #f4a08a;
  border-color: rgba(193,67,42,0.3);
}
.ai-source-badge.muted-badge {
  background: var(--paper-2);
  color: var(--ink-soft);
  border-color: var(--ink-faint);
  font-weight: 600;
}

/* Viral loop — trending strip + hot badge + picked-for-you */
.viral-trending-strip {
  margin-top: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fff5ed 0%, #fbeae3 100%);
  border: 1.5px dashed var(--brand);
  border-radius: 12px;
}
[data-theme="dark"] .viral-trending-strip {
  background: linear-gradient(135deg, #3a2520 0%, #2a2018 100%);
}
.viral-strip-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  margin-bottom: 8px;
}
.viral-strip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.viral-strip-card {
  display: block;
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.viral-strip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.06);
  border-color: var(--brand);
  color: var(--ink);
}
.viral-strip-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.viral-strip-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.viral-hot-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  background: #ff6b3d;
  color: white;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  animation: viral-pulse 1.8s ease-in-out infinite;
}
@keyframes viral-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}
.req-card.is-picked { border-color: var(--brand); }
.req-card.is-picked .sketch { stroke: var(--brand); }
.viral-picked-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  align-self: flex-start;
}
[data-theme="dark"] .viral-picked-badge {
  background: rgba(193, 67, 42, 0.18);
  color: #f4a08a;
}

/* Social Agent — platform tag */
.social-platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--paper-2);
  color: var(--ink);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--ink-faint);
  margin-right: 6px;
}
.social-engagement {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 4px 0;
  font-weight: 600;
}
.social-post-card { border-left-color: #6e58e9; }
[data-social-id] textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }

/* Daily digest log */
.digest-log { display: flex; flex-direction: column; gap: 6px; }
.digest-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--ink-faint);
  border-radius: 8px;
}
.digest-log-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .digest-log-row { flex-direction: column; align-items: flex-start; }
  .digest-log-stats { white-space: normal; }
}

/* Home: 3-up feature cards (Post/See/Join) — 3 rows on mobile */
.home-three-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 720px) {
  .home-three-features { grid-template-columns: 1fr; }
}

/* WeChat H5: floating "open in browser" hint + login button + divider */
.wx-hint-floating {
  position: fixed;
  left: 12px; right: 12px;
  top: 78px;
  z-index: 999;
  pointer-events: auto;
  animation: wx-hint-slide-in 0.3s ease;
}
@keyframes wx-hint-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.wx-hint-card {
  position: relative;
  background: #fff8ed;
  border: 1.5px solid #e8754d;
  border-radius: 12px;
  padding: 12px 36px 12px 14px;
  box-shadow: 0 4px 14px rgba(232, 117, 77, 0.18);
}
[data-theme="dark"] .wx-hint-card {
  background: #2a1f18;
  border-color: #e8754d;
  color: var(--ink);
}
.wx-hint-head {
  font-size: 13.5px;
  font-weight: 700;
  color: #c1432a;
  margin-bottom: 4px;
}
.wx-hint-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.wx-hint-close {
  position: absolute;
  top: 6px; right: 6px;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.wx-hint-close:hover { background: rgba(0,0,0,0.04); color: var(--ink); }

.wx-login-btn {
  background: #07c160 !important;
  color: white !important;
  border: 0;
  font-weight: 600;
}
.wx-login-btn:hover {
  background: #06ad56 !important;
  color: white !important;
}
.login-divider {
  display: flex;
  align-items: center;
  margin: 4px 0 14px;
  color: var(--ink-soft);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink-faint);
}
.login-divider span { padding: 0 12px; }

/* Timezone picker — custom dropdown replacement for <select> */
.tz-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.tz-detect-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff5ed 0%, #fbeae3 100%);
  border: 1.5px solid var(--brand);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tz-detect-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 rgba(193,67,42,0.12); }
.tz-detect-icon { font-size: 24px; line-height: 1; }
.tz-detect-text { flex: 1; display: flex; flex-direction: column; }
.tz-detect-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.tz-detect-value { font-size: 14px; color: var(--ink); font-weight: 600; margin-top: 2px; }
.tz-detect-arrow { color: var(--brand); font-size: 18px; font-weight: 700; }
.tz-divider {
  display: flex;
  align-items: center;
  margin: 4px 0 2px;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tz-divider::before, .tz-divider::after { content: ''; flex: 1; height: 1px; background: var(--ink-faint); }
.tz-divider span { padding: 0 10px; }
.tz-search { width: 100%; }
.tz-results {
  max-height: 280px;
  overflow-y: auto;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  background: var(--paper);
}
.tz-group { padding: 4px 0; }
.tz-group + .tz-group { border-top: 1px solid var(--ink-faint); }
.tz-group-head {
  font-size: 10.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 6px 14px 4px;
  background: var(--paper-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
.tz-item {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
  transition: background 0.1s ease;
}
.tz-item:hover { background: var(--paper-2); }
.tz-item.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.tz-flag { font-size: 16px; line-height: 1; }
.tz-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tz-offset {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tz-item.is-selected .tz-offset { color: var(--brand); }
.tz-now {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
}
.tz-item.is-selected .tz-now { color: var(--brand); font-weight: 600; }
.tz-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}
/* Scrollbar inside the picker (thinner than default) */
.tz-results::-webkit-scrollbar { width: 6px; }
.tz-results::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 3px; }

/* Signup form visual groups */
.signup-group {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--ink-faint);
}
.signup-group:last-of-type {
  border-bottom: 0;
  margin-bottom: 8px;
}
.signup-group-head {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
/* Compact mode for form rows used in signup (less vertical padding) */
.form-row.form-row-tight { margin-bottom: 10px; }
.form-row.form-row-tight .hint { margin-top: 4px; font-size: 11.5px; }

/* Password strength meter */
.pw-strength {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}
.pw-strength-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  width: 120px;
  flex-shrink: 0;
}
.pw-strength-seg {
  height: 5px;
  background: var(--ink-faint);
  border-radius: 999px;
  transition: background-color 160ms ease;
}
.pw-strength-seg.is-on.is-weak   { background: #d6453b; }
.pw-strength-seg.is-on.is-fair   { background: #e8963c; }
.pw-strength-seg.is-on.is-good   { background: #6aa84f; }
.pw-strength-seg.is-on.is-strong { background: #2e8b57; }
.pw-strength-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 48px;
}
.pw-strength-label.is-weak   { color: #d6453b; }
.pw-strength-label.is-fair   { color: #e8963c; }
.pw-strength-label.is-good   { color: #6aa84f; }
.pw-strength-label.is-strong { color: #2e8b57; }

/* Email availability indicator */
.email-availability {
  display: block;
  margin-top: 4px;
  min-height: 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.email-availability.is-available { color: #2e8b57; }
.email-availability.is-taken     { color: #d6453b; }

/* Input wrapper for trailing icon (e.g. password eye toggle) */
.input-wrap {
  position: relative;
  display: block;
}
.input-wrap .input {
  width: 100%;
  padding-right: 42px; /* leave room for the toggle */
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  transition: color 120ms ease, background-color 120ms ease;
}
.pw-toggle:hover {
  color: var(--brand);
  background: var(--brand-soft);
}
.pw-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.pw-toggle:active {
  transform: translateY(-50%) scale(0.92);
}

/* Hupijiao pay modal — channel pills + status indicator */
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 13px;
  background: var(--paper);
  transition: all 140ms ease;
}
.radio-pill input { margin: 0; }
.radio-pill:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.hupijiao-pay-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px dashed var(--ink-faint);
}
.hupijiao-pay-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
}
.hupijiao-pay-status[data-status="pending"] .hupijiao-pay-status-dot {
  background: #e8963c;
  animation: hup-pulse 1.2s ease-in-out infinite;
}
.hupijiao-pay-status[data-status="paid"] {
  background: #e8f3eb;
  border-color: #6aa84f;
  color: #2e8b57;
}
.hupijiao-pay-status[data-status="paid"] .hupijiao-pay-status-dot {
  background: #2e8b57;
  animation: none;
}
.hupijiao-pay-status[data-status="error"],
.hupijiao-pay-status[data-status="closed"] {
  background: #fce8e6;
  border-color: #d6453b;
  color: #c1432a;
}
.hupijiao-pay-status[data-status="error"] .hupijiao-pay-status-dot,
.hupijiao-pay-status[data-status="closed"] .hupijiao-pay-status-dot {
  background: #c1432a;
  animation: none;
}
@keyframes hup-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Hupijiao admin card — channel checkboxes sit inline */
.checkbox-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-row input[type=checkbox] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

/* ============================================================
   Signup wizard — 3-step progress + per-pane transitions
   ============================================================ */
.signup-wizard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signup-step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 0 12px;
  margin: -4px 0 4px;
  border-bottom: 1px dashed var(--ink-faint);
}

.signup-step-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 160ms ease, background-color 160ms ease;
  position: relative;
}

.signup-step-dot.is-done {
  color: var(--brand);
}

.signup-step-dot.is-active {
  color: var(--ink);
}

.signup-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1.5px dashed var(--ink-faint);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.signup-step-dot.is-done .signup-step-num {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.signup-step-dot.is-done .signup-step-num::before {
  content: '✓';
}

.signup-step-dot.is-done .signup-step-num-text {
  display: none;
}

.signup-step-dot.is-active .signup-step-num {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.signup-step-rail {
  flex: 1 1 auto;
  min-width: 16px;
  height: 2px;
  background: var(--ink-faint);
  border-radius: 999px;
  margin: 0 4px;
  align-self: center;
}

.signup-pane {
  animation: signup-pane-in 280ms ease;
}

.signup-pane[hidden] {
  display: none;
}

@keyframes signup-pane-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.signup-pane-head {
  margin-bottom: 12px;
}

.signup-pane-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.signup-pane-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.signup-pane-nav .signup-pane-hint {
  flex: 1 1 auto;
  font-size: 11.5px;
}

/* Password match hint states */
.hint.is-good {
  color: #2e8b57;
  font-weight: 600;
}
.hint.is-bad {
  color: #c1432a;
  font-weight: 600;
}

/* Mobile: stack the step bar vertically */
@media (max-width: 520px) {
  .signup-step-bar {
    flex-wrap: wrap;
    gap: 4px;
  }
  .signup-step-rail {
    display: none;
  }
  .signup-step-dot {
    padding: 4px 8px;
    font-size: 11px;
  }
  .signup-step-label {
    display: none;
  }
}
