/* =========================================================================
   ZERO FANS — styles for every page (fan site). Studio adds studio/assets/studio.css.
   html.zf = every page, html.page-<name> = one page (same pattern as Haru Haru).
   Design tokens from the mockups (design/*.dc.html), see CLAUDE.md §7.
   ========================================================================= */
:root {
  --bg: #0b0b0f;
  --bg-alt: #101015;
  --surface: #16161d;
  --surface-2: #1b1b23;
  --surface-3: #202029;
  --border: #26262e;
  --border-strong: #3f3f46;
  --border-dashed: #52525b;
  --text: #f4f4f5;
  --text-soft: #e4e4e7;
  --text-dim: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --lime: #c6ff3d;
  --lime-hover: #e2ff9a;
  --lime-bg: #1f2a0a;
  --amber: #ffb547;
  --amber-bg: #1e1a10;
  --paper: #f4f1e8;
  --ink: #1c1b18;
  --font-display: 'Space Grotesk', 'Kantumruy Pro', sans-serif;
  --font-body: 'Kantumruy Pro', system-ui, sans-serif;
  --stripes: repeating-linear-gradient(135deg, #1b1b23 0 12px, #202029 12px 24px);
  --stripes-dark: repeating-linear-gradient(135deg, #16161d 0 14px, #1b1b23 14px 28px);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lime); text-decoration: none; }
a:hover { color: var(--lime-hover); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--font-display); }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.lime { color: var(--lime); }
.amber { color: var(--amber); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.eyebrow { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.eyebrow-lime { font-size: 13px; color: var(--lime); text-transform: uppercase; letter-spacing: 0.12em; }
.label-caps { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }

.container { max-width: 1280px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font-weight: 400; white-space: nowrap; text-align: center;
}
a.btn { color: var(--text); }
.btn:hover { border-color: #52525b; }
.btn-primary, a.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); color: var(--bg); }
.btn-following, a.btn-following { border-color: var(--lime); color: var(--lime); font-weight: 600; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--bg); font-weight: 600; }
.btn-white { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.btn-dashed { border-style: dashed; border-color: var(--border-dashed); }
.btn-ghost { border: 0; color: var(--muted); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-xs { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; }
.btn-icon.sm { width: 40px; height: 40px; }
.btn-bare { border: 0; background: transparent; color: var(--text); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }

/* chip toggles (filters) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); }
.chip[aria-pressed='true'] { border-color: var(--lime); background: var(--lime); color: var(--bg); font-weight: 600; }
.chip.sm { min-height: 40px; padding: 0 14px; }

/* segmented control */
.segment { display: flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; }
.segment button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--text-dim); }
.segment button[aria-pressed='true'], .segment button[aria-selected='true'] { background: var(--lime); color: var(--bg); font-weight: 600; }
.segment button.white[aria-pressed='true'], .segment button.white[aria-selected='true'] { background: var(--text); }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.06em; line-height: 1.5; white-space: nowrap; }
.badge-artist { background: var(--lime); color: var(--bg); }
.badge-staff { background: var(--text); color: var(--bg); }
.badge-leader { background: var(--amber); color: var(--bg); }
.badge-super { border: 1px solid var(--lime); color: var(--lime); padding: 1px 8px; }
.badge-fan { background: var(--border); color: var(--text-dim); font-weight: 600; }
.badge.lg { font-size: 12px; padding: 3px 10px; }
.badge-super.lg { padding: 2px 10px; }
.badge.xs { font-size: 10px; padding: 2px 6px; }
.badge-super.xs { padding: 1px 6px; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.card-lime { border-color: var(--lime); }
.card-amber { border-color: var(--amber); }
.pad { padding: 22px; }
.pad-sm { padding: 14px; }
.placeholder { background: var(--stripes); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.avatar { border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: var(--muted); flex: none; }
.logo-mark { display: inline-flex; width: 36px; height: 36px; border: 2px solid var(--lime); border-radius: 50%; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: var(--lime); flex: none; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-word { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.04em; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); }
.input {
  min-height: 46px; padding: 0 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); width: 100%;
}
.input.dark { background: var(--bg); }
.input.round { border-radius: 999px; padding: 0 14px; }
textarea.input { padding: 12px; resize: vertical; min-height: auto; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text-dim); }
.check input { width: 18px; height: 18px; accent-color: var(--lime); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- Site header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 28px; font-size: 15px; }
.nav-links a { color: var(--text-dim); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-links a:hover { color: var(--text); }
.lang-picker { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-dim); }
.lang-picker select { min-height: 40px; border: 0; background: var(--bg); color: var(--text); font-size: 14px; outline: none; }
.search-pill { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.search-pill input { width: 170px; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none; }
.me-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text); }
a.me-pill:hover { color: var(--text); border-color: var(--border-strong); }
.me-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.guest-strip { background: var(--lime); color: var(--bg); }
.guest-strip a { color: var(--bg); font-weight: 700; text-decoration: underline; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); font-size: 14px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { width: 100%; max-width: 420px; padding: 32px; border-radius: 22px; background: var(--surface); border: 1px solid var(--lime); display: flex; flex-direction: column; gap: 16px; text-align: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--lime); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100% - 32px); }

/* ---------- Phone-style pages ---------- */
.phone-page { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.phone-pad { padding: 8px 20px 22px; gap: 16px; }
.status-box { padding: 12px 14px; border-radius: 12px; background: var(--lime-bg); border: 1px solid var(--lime); font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { min-height: 48px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 16px; white-space: nowrap; }
.tab[aria-selected='true'] { border-bottom-color: var(--lime); color: var(--text); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.table { width: 100%; min-width: 640px; border-collapse: collapse; }
.table th { background: var(--surface); text-align: left; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; padding: 12px 16px; font-weight: 600; }
.table td { padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-wd { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 104px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; min-width: 0; }
.cal-day[aria-pressed='true'] { border-color: var(--lime); }
.cal-day .num { font-size: 14px; font-weight: 600; }
.cal-ev { font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 5px; color: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal.compact { gap: 6px; }
.cal.compact .cal-day { min-height: 84px; padding: 6px; border-radius: 10px; background: var(--bg); gap: 3px; }
.cal.compact .cal-ev { font-size: 11px; padding: 2px 5px; border-radius: 4px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Dashboard (Studio / Artist view) ---------- */
.dash { display: flex; min-height: 100dvh; }
.dash-side { width: 270px; flex: none; padding: 22px 18px; border-right: 1px solid var(--border); background: var(--bg-alt); display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav button { display: flex; justify-content: space-between; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; color: var(--text-dim); text-align: left; }
.dash-nav button:hover { background: var(--surface); }
.dash-nav button .count { color: var(--muted); }
.dash-nav button[aria-current='page'] { background: var(--lime); color: var(--bg); font-weight: 600; }
.dash-nav button[aria-current='page'] .count { color: var(--bg); }
.dash-main { flex: 1; min-width: 0; padding: 32px 40px 60px; display: flex; flex-direction: column; gap: 26px; max-width: 1180px; }
.dash-title { font-size: 36px; }
.stat { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.stat .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; }

/* chat bubbles */
.bubble { max-width: 78%; padding: 10px 14px; font-size: 15px; }
.bubble.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--lime); color: var(--bg); }
.bubble.mine.amber { background: var(--amber); }
.bubble.theirs { align-self: flex-start; border-radius: 14px 14px 14px 4px; background: var(--border); color: var(--text); }

/* list items (letters, conversations) */
.list-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; width: 100%; }
.list-item[aria-current='true'] { border-color: var(--lime); background: var(--lime-bg); }
.list-item.amber[aria-current='true'] { border-color: var(--amber); background: var(--amber-bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); display: inline-block; }

/* letter paper */
.paper { background: var(--paper); color: var(--ink); border-radius: 18px; }
.paper .btn { border-color: #a8a29e; color: #44403c; }
.paper .btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.paper .btn-ink-outline { border-color: var(--ink); color: var(--ink); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dash { flex-direction: column; }
  .dash-side { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); }
  .dash-nav { flex-direction: row; overflow-x: auto; }
  .dash-nav button { white-space: nowrap; gap: 8px; flex: none; }
  .dash-side .side-foot { display: none; }
  .dash-main { padding: 24px 16px 48px; }
}
@media (max-width: 760px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .nav-links { order: 3; width: 100%; gap: 20px; overflow-x: auto; flex-wrap: nowrap; }
  .nav-links a { white-space: nowrap; }
  .search-pill { display: none; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .cal { gap: 4px; }
  .cal-day { min-height: 64px; padding: 4px; border-radius: 8px; }
  .cal-ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .dash-title { font-size: 28px; }
}
@media (max-width: 480px) {
  .hide-xs { display: none !important; }
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Plain-HTML additions ---------- */
.hidden, [hidden] { display: none !important; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }
.page-error { padding: 80px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.provider-btn { min-height: 54px; border-radius: 999px; border: 0; font-weight: 600; font-size: 16px; width: 100%; }
.oauth-slot { display: flex; justify-content: center; min-height: 44px; }
.studio-only { display: none; }
