/* =====================================================================
   RichMood — design system
   ===================================================================== */

:root {
  --bg: #0d1117;
  --bg-elev: #11161d;
  --card: #161b22;
  --card-hover: #1a2029;
  --border: rgba(240, 246, 252, 0.08);
  --border-strong: rgba(240, 246, 252, 0.14);
  --accent: #b8f36b;
  --accent-dim: rgba(184, 243, 107, 0.12);
  --accent-ink: #0d1117;
  --text: #ffffff;
  --text-2: #9299a5;
  --warn: #f2c94c;
  --danger: #ff6b6b;
  --success: #6fe3a7;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --container: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:not(.btn):not(.logo):not(.nav__link):hover { color: var(--accent); }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; color: var(--text-2); background: rgba(255,255,255,0.04); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.section { padding: 96px 0; }
.section--tight { padding: 48px 0; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.accent { color: var(--accent); }
.center { text-align: center; }
.right { text-align: right; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-sm { gap: 8px; }
.gap { gap: 16px; }
.mt { margin-top: 24px; }
.mt-sm { margin-top: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.h1 { font-size: clamp(32px, 4vw, 44px); }
.h2 { font-size: clamp(26px, 3vw, 36px); }
.h3 { font-size: 18px; margin-bottom: 8px; }
.h4 { font-size: 16px; }
.serif { font-family: var(--font-display); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.prose { white-space: pre-line; color: #d7dbe1; }
.split { display: flex; justify-content: space-between; gap: 16px; }
.no-scroll { overflow: hidden; }

/* ---------- Boot loader ---------- */
#page-loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .3s var(--ease);
}
body:not(.is-booting) #page-loader { opacity: 0; pointer-events: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease), backdrop-filter .25s;
}
.site-header.is-scrolled {
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.header__inner { display: flex; align-items: center; height: 68px; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.03em; font-size: 18px; }
.logo__mark { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 24px; }
.nav__links { display: flex; gap: 4px; margin-left: 16px; }
.nav__link { padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: color .2s, background .2s; }
.nav__link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav__link.is-active { color: var(--text); background: rgba(255,255,255,0.06); }
.nav__actions { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--border); background: transparent; border-radius: 10px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--text); transition: transform .25s var(--ease), top .25s var(--ease); }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle.is-open span:first-child { top: 19px; transform: rotate(45deg); }
.nav-toggle.is-open span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px 24px 24px;
    background: rgba(13, 17, 23, 0.97);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links { flex-direction: column; margin: 0; }
  .nav__link { padding: 12px; }
  .nav__actions .btn { flex: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--card); --btn-fg: var(--text); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  font: 600 14px/1 var(--font); letter-spacing: -0.01em;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-border); border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255,255,255,0.24); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-border: var(--accent); }
.btn--primary:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 8px 24px -8px rgba(184, 243, 107, 0.5); }
.btn--ghost { --btn-bg: transparent; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-border: rgba(255, 107, 107, 0.35); }
.btn--danger:hover:not(:disabled) { border-color: var(--danger); background: rgba(255,107,107,0.08); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn--xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 52px; padding: 0 28px; font-size: 15px; }
.btn--block { width: 100%; }
.btn.is-loading { cursor: progress; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: 20px; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Spinner & skeleton ---------- */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
.spinner--sm { width: 14px; height: 14px; border-width: 2px; }
.btn--primary .spinner { border-color: rgba(13,17,23,0.2); border-top-color: var(--accent-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: inline-block; background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.skeleton--num { width: 64px; height: 1em; vertical-align: middle; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card__title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--accent { color: var(--accent); background: var(--accent-dim); }
.badge--success { color: var(--success); background: rgba(111, 227, 167, 0.1); }
.badge--warn { color: var(--warn); background: rgba(242, 201, 76, 0.1); }
.badge--danger { color: var(--danger); background: rgba(255, 107, 107, 0.1); }
.badge--muted { color: var(--text-2); background: rgba(255,255,255,0.05); }
.pill { display: inline-flex; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12px; font-weight: 600; color: var(--text); }
.pill--sm { padding: 2px 8px; font-size: 11px; }
.example-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); background: rgba(242, 201, 76, 0.1); border: 1px dashed rgba(242, 201, 76, 0.4); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--accent { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }

/* ---------- Avatar ---------- */
.avatar { display: grid; place-items: center; border-radius: 50%; background: linear-gradient(140deg, #222a35, #1a2029); border: 1px solid var(--border-strong); font-weight: 700; color: var(--accent); overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 38px; height: 38px; font-size: 15px; }
.avatar--lg { width: 64px; height: 64px; font-size: 24px; }
.avatar--xl { width: 96px; height: 96px; font-size: 36px; }

/* ---------- Progress ---------- */
.progress { height: 6px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .9s var(--ease); }
.progress--lg { height: 10px; margin: 16px 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: #d7dbe1; display: flex; justify-content: space-between; gap: 8px; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea {
  width: 100%;
  font: 15px/1.4 var(--font);
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.field ::placeholder { color: #5d6470; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 12.5px; }
.field__hint { font-size: 12.5px; color: var(--text-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400 !important; color: var(--text-2) !important; cursor: pointer; justify-content: flex-start !important; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.check a { color: var(--accent); }
.form-message { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.form-message--error { color: #ffb3b3; background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.25); }
.form-message--success { color: #b9f5d4; background: rgba(111,227,167,0.08); border: 1px solid rgba(111,227,167,0.25); }
.input-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }

.file-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--bg-elev); cursor: pointer; transition: border-color .2s, background .2s; }
.file-drop:hover { border-color: var(--accent); background: rgba(184,243,107,0.03); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); font-size: 18px; flex-shrink: 0; }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { position: relative; display: block; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; background: var(--bg-elev); transition: border-color .2s, background .2s; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:checked) { border-color: var(--accent); background: rgba(184,243,107,0.05); }
.radio-card strong { display: block; font-size: 14px; }
@media (max-width: 520px) { .radio-cards { grid-template-columns: 1fr; } }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength span { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); transition: background .2s; }
.strength[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] span:nth-child(-n+2) { background: var(--warn); }
.strength[data-score="3"] span:nth-child(-n+3) { background: #d8ef6b; }
.strength[data-score="4"] span { background: var(--accent); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font: 600 12px var(--font); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Auth layout ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: calc(100vh - 68px); }
.auth__aside { position: relative; padding: 64px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); overflow: hidden; }
.auth__aside::before { content: ""; position: absolute; inset: -20% -40% auto auto; width: 520px; height: 520px; background: radial-gradient(circle, rgba(184,243,107,0.16), transparent 65%); pointer-events: none; }
.auth__quote { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; font-style: italic; max-width: 460px; }
.auth__main { display: grid; place-items: center; padding: 48px 24px; }
.auth__card { width: 100%; max-width: 420px; }
.auth__card h1 { font-size: 28px; margin-bottom: 6px; }
.auth__switch { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-2); }
.auth__switch a { color: var(--accent); font-weight: 600; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__aside { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -260px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 700px;
  background: radial-gradient(closest-side, rgba(184,243,107,0.15), transparent 70%);
  pointer-events: none;
}
.hero__grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 70%);
}
.hero__inner { position: relative; text-align: center; max-width: 880px; margin: 0 auto; }
.hero__badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--border-strong); background: rgba(22,27,34,0.7); font-size: 13px; color: var(--text-2); margin-bottom: 28px; }
.hero__badge b { background: var(--accent); color: var(--accent-ink); padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.hero h1 { font-size: clamp(40px, 6.6vw, 80px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 600; }
.hero h1 .serif { color: var(--accent); }
.hero p.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--text-2); margin: 24px auto 36px; max-width: 560px; }
.hero__ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero__visual { position: relative; margin: 72px auto 0; max-width: 940px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; text-align: left; }
.hero__visual .card { background: rgba(22,27,34,0.82); backdrop-filter: blur(10px); }
.float { animation: float 6s ease-in-out infinite; }
.float--delay { animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (max-width: 760px) { .hero__visual { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head p { max-width: 520px; margin-top: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; }
.step__num { font-family: var(--font-display); font-style: italic; font-size: 44px; color: var(--accent); line-height: 1; margin-bottom: 20px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 24px; }
.stat__value { font-size: clamp(30px, 3.4vw, 42px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.stat__label { color: var(--text-2); font-size: 13px; margin-top: 6px; }
@media (max-width: 860px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.debt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.debt-grid > .state { grid-column: 1 / -1; }
.debt-card { display: flex; flex-direction: column; gap: 14px; transition: transform .25s var(--ease), border-color .25s, background .25s; }
.debt-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--card-hover); }
.debt-card__head { display: flex; align-items: center; gap: 12px; }
.debt-card__head .badge { margin-left: auto; }
.debt-card__name { font-weight: 600; font-size: 14px; }
.debt-card__title { font-size: 17px; }
.debt-card__desc { font-size: 14px; flex: 1; }
.debt-card__amount { display: flex; justify-content: space-between; align-items: baseline; }
.amount { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.amount--xl { font-size: clamp(32px, 3.6vw, 42px); }

.stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.story { display: flex; flex-direction: column; gap: 16px; }
.story blockquote { margin: 0; font-family: var(--font-display); font-size: 21px; line-height: 1.35; font-style: italic; }
@media (max-width: 860px) { .stories { grid-template-columns: 1fr; } }

.faq { display: grid; gap: 10px; }
.faq__item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.faq__item button { width: 100%; text-align: left; padding: 20px 22px; background: none; border: 0; color: var(--text); font: 600 15px var(--font); display: flex; justify-content: space-between; gap: 16px; cursor: pointer; }
.faq__item button::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; transition: transform .25s var(--ease); }
.faq__item.is-open button::after { transform: rotate(45deg); }
.faq__answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.faq__answer > div { overflow: hidden; padding: 0 22px; color: var(--text-2); }
.faq__item.is-open .faq__answer { grid-template-rows: 1fr; }
.faq__item.is-open .faq__answer > div { padding-bottom: 20px; }

.cta-band { position: relative; overflow: hidden; text-align: center; padding: 72px 24px; border-radius: 28px; border: 1px solid var(--border); background: radial-gradient(ellipse at 50% 120%, rgba(184,243,107,0.18), transparent 60%), var(--card); }
.cta-band h2 { font-size: clamp(28px, 4vw, 46px); letter-spacing: -0.04em; margin-bottom: 16px; }

/* ---------- App pages ---------- */
.page-head { padding: 48px 0 32px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -0.035em; }
.page-head p { margin-top: 8px; }
.page-body { padding-bottom: 96px; }

.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .mini-stats { grid-template-columns: repeat(2, 1fr); } }
.mini-stat { display: grid; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); }
.mini-stat__value { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.timeline__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.timeline__item:last-child { border-bottom: 0; }
.timeline__item .badge { margin-left: 4px; vertical-align: middle; }
.timeline__icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); flex-shrink: 0; }
.timeline a { color: var(--text); font-weight: 600; }

.filters { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 24px; padding: 16px; }
.filters .field input, .filters .field select { padding: 10px 12px; font-size: 14px; }
@media (max-width: 1000px) { .filters { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .filters { grid-template-columns: 1fr; } }

.back-link { display: inline-block; color: var(--text-2); font-size: 14px; margin: 32px 0 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; padding-bottom: 96px; }
.detail-story { display: grid; gap: 28px; padding: 32px; }
.detail-story__head { display: flex; gap: 18px; align-items: flex-start; }
.detail-title { font-size: clamp(24px, 3vw, 34px); margin: 6px 0; letter-spacing: -0.03em; }
.detail-side { position: sticky; top: 88px; display: grid; gap: 6px; }
.detail-side__status { margin-bottom: 12px; }
.detail-side__cta { margin-top: 16px; display: grid; gap: 10px; }
.verified-row { display: flex; gap: 10px; align-items: center; padding-top: 20px; border-top: 1px solid var(--border); }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } .detail-side { position: static; } }

.notice { padding: 14px 16px; border-radius: 12px; font-size: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: #d7dbe1; }
.notice--success { background: rgba(111,227,167,0.07); border-color: rgba(111,227,167,0.25); color: #b9f5d4; }
.notice--warn { background: rgba(242,201,76,0.07); border-color: rgba(242,201,76,0.25); color: #f5dc8d; }
.config-notice { background: rgba(242,201,76,0.1); border-bottom: 1px solid rgba(242,201,76,0.3); color: #f5dc8d; padding: 12px 0; font-size: 14px; }

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .role-grid { grid-template-columns: 1fr; } }
.role-card { position: relative; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; }
.role-card__body { display: grid; gap: 8px; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: var(--bg-elev); transition: border-color .2s, background .2s, transform .2s var(--ease); position: relative; height: 100%; }
.role-card:hover .role-card__body { transform: translateY(-2px); }
.role-card input:checked + .role-card__body { border-color: var(--accent); background: rgba(184,243,107,0.05); }
.role-card input:focus-visible + .role-card__body { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); font-size: 20px; }
.role-card__title { font-size: 18px; font-weight: 600; }
.role-card__check { position: absolute; top: 18px; right: 18px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 13px; color: transparent; transition: all .2s; }
.role-card input:checked + .role-card__body .role-card__check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.profile-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.private-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list__item:last-child { border-bottom: 0; }
.list__main { min-width: 0; }
.list__main a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .list__item { flex-direction: column; align-items: flex-start; } .list__side { justify-content: flex-start; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.tab { height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tab:not([aria-selected="true"]):hover { color: var(--text); }

/* ---------- Admin ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
.admin-list { display: grid; gap: 12px; }
.admin-item { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.admin-item__main { display: grid; gap: 8px; min-width: 0; }
.admin-item__side { display: grid; gap: 8px; align-content: start; }
.admin-item__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.admin-item__details summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.admin-item__details[open] { display: grid; gap: 8px; }
@media (max-width: 860px) { .admin-item { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; background: var(--bg-elev); }
.table tr:last-child td { border-bottom: 0; }
.proof-preview { max-height: 70vh; margin: 0 auto 12px; border-radius: 12px; border: 1px solid var(--border); }

/* ---------- States ---------- */
.state { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; }
.state__icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--text-2); background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.state--error .state__icon { color: var(--danger); }
.state--success .state__icon { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.state__title { font-weight: 600; font-size: 16px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: grid; gap: 10px; max-width: calc(100vw - 48px); }
.toast { padding: 14px 18px; border-radius: 14px; background: #1f2630; border: 1px solid var(--border-strong); box-shadow: 0 20px 40px -16px rgba(0,0,0,0.7); font-size: 14px; max-width: 380px; opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.is-visible { opacity: 1; transform: none; }
.toast--success { border-color: rgba(184,243,107,0.4); }
.toast--error { border-color: rgba(255,107,107,0.45); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(5, 8, 12, 0.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s var(--ease); }
.modal-backdrop.is-open { opacity: 1; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 40px 80px -24px rgba(0,0,0,0.8); transform: translateY(12px) scale(.98); transition: transform .25s var(--ease); }
.modal-backdrop.is-open .modal { transform: none; }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 17px; }
.modal__body { padding: 24px; display: grid; gap: 16px; }
.modal__body form { display: grid; gap: 16px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; margin-top: auto; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 32px; }
.footer__grid a { display: block; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.footer__grid a.logo { display: inline-flex; color: var(--text); margin-bottom: 12px; font-size: 18px; }
.footer__title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.fade-in { animation: fadeIn .7s var(--ease) both; }
.fade-in--2 { animation-delay: .08s; }
.fade-in--3 { animation-delay: .16s; }
.fade-in--4 { animation-delay: .24s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Legal ---------- */
.legal h2 { font-size: 20px; margin: 36px 0 10px; }
.legal p, .legal li { color: #c9ced6; }
.legal ul { padding-left: 20px; }
