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

  :root {
    --bg:      #0a0a0a;
    --bg2:     #111111;
    --card:    #161616;
    --border:  #242424;
    --pink:    #e0527a;
    --pink2:   #c94070;
    --text:    #ffffff;
    --muted:   #888888;
    --dim:     #555555;
  }

  html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
  }

  /* ── NAVBAR ── */
  nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 60px;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .hamburger {
    display: flex; flex-direction: column; gap: 5px;
    cursor: pointer; padding: 4px; background: none; border: none;
  }
  .hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px;
  }
  .nav-logo { font-size: 1rem; font-weight: 700; color: var(--text); text-decoration: none; }
  .nav-login {
    display: flex; align-items: center; gap: 7px;
    background: rgba(224,82,122,0.12);
    border: 1px solid rgba(224,82,122,0.3);
    border-radius: 10px; padding: 7px 14px;
    color: var(--pink); font-size: 0.82rem; font-weight: 500;
    text-decoration: none; transition: background 0.2s;
  }
  .nav-login:hover { background: rgba(224,82,122,0.2); }

  /* ── DRAWER ── */
  .overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
  }
  .overlay.open { opacity: 1; pointer-events: all; }
  .drawer {
    position: fixed; top: 0; left: 0; z-index: 201;
    width: min(300px, 82vw); height: 100vh;
    background: var(--bg2); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px 14px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
  }
  .drawer.open { transform: translateX(0); }
  .drawer-brand {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px 16px; margin-bottom: 4px;
  }
  .drawer-brand span { font-size: 1rem; font-weight: 700; }
  .drawer-section {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
  }
  .drawer-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; color: var(--text); text-decoration: none;
    font-size: 0.9rem; font-weight: 500;
    border-bottom: 1px solid var(--border); transition: background 0.15s;
    cursor: pointer; background: none; border: none; width: 100%; border-bottom: 1px solid var(--border);
  }
  .drawer-item:last-child { border-bottom: none; }
  .drawer-item:hover { background: rgba(255,255,255,0.04); }
  .drawer-item svg { color: var(--muted); flex-shrink: 0; }
  .drawer-login {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; color: var(--pink); text-decoration: none;
    font-size: 0.9rem; font-weight: 500;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; transition: background 0.15s;
  }
  .drawer-login:hover { background: rgba(224,82,122,0.07); }

  /* ── HERO ── */
  .hero {
    position: relative;
    padding: 60px 24px 52px;
    text-align: center; overflow: hidden;
  }
  .hero-glow {
    position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(ellipse 90% 70% at 50% 120%, rgba(160,35,75,0.38) 0%, transparent 65%),
      radial-gradient(ellipse 50% 40% at 50% 70%,  rgba(120,20,55,0.2) 0%, transparent 70%);
  }
  .hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(224,82,122,0.1);
    border: 1px solid rgba(224,82,122,0.25);
    border-radius: 100px; padding: 5px 14px;
    font-size: 0.72rem; font-weight: 600;
    color: var(--pink); letter-spacing: 0.05em; text-transform: uppercase;
    margin-bottom: 22px; position: relative;
  }
  .hero-badge-dot {
    width: 5px; height: 5px; background: var(--pink); border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
  }
  @keyframes blink {
    0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
  }
  .hero-title {
    font-size: 2.7rem; font-weight: 900;
    line-height: 1.05; letter-spacing: -0.035em;
    margin-bottom: 4px; color: var(--text); position: relative;
  }
  .hero-title-accent {
    display: block;
    background: linear-gradient(95deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .hero-subtitle {
    font-size: 0.84rem; color: var(--muted); line-height: 1.7;
    margin: 18px auto 30px; max-width: 290px; position: relative;
  }
  .hero-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--pink); border-radius: 100px;
    padding: 13px 28px; font-size: 0.88rem; font-weight: 700;
    color: #fff; text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 28px rgba(224,82,122,0.35);
    position: relative;
  }
  .hero-cta:hover { background: var(--pink2); transform: translateY(-1px); }

  /* ── STATS ── */
  .stats {
    display: flex; align-items: center; justify-content: center;
    padding: 16px 24px;
    background: rgba(255,255,255,0.025);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .stats-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
  }
  .stats-row {
    display: inline-flex; align-items: center; gap: 8px;
    line-height: 1;
  }
  .stats svg { color: var(--muted); display: block; }
  .stats-num { font-size: 1.2rem; font-weight: 800; line-height: 1; }
  .stats-label { font-size: 0.72rem; color: var(--muted); }

  /* ── SECTION ── */
  .section { padding: 36px 20px; }
  .section-title { font-size: 1.55rem; font-weight: 800; margin-bottom: 8px; line-height: 1.2; }
  .section-title mark {
    background: linear-gradient(90deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; background-color: transparent;
  }
  .section-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.6; margin-bottom: 22px; }

  /* ── FEATURE CARDS ── */
  .feature-card {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 16px; padding: 20px; margin-bottom: 10px;
    position: relative; overflow: hidden;
  }
  .feature-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.35), transparent);
  }
  .feat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .feat-icon { color: var(--text); flex-shrink: 0; }
  .feat-title { font-size: 0.98rem; font-weight: 700; }
  .feat-desc { font-size: 0.81rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
  .feat-more {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.76rem; color: var(--dim);
    text-decoration: none; transition: color 0.2s;
  }
  .feat-more:hover { color: var(--text); }

  /* ── BIO ── */
  .bio-section {
    padding: 4px 20px 40px;
    border-top: 1px solid var(--border);
    margin-top: -10px;
  }
  .bio-section-label {
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
    color: var(--dim); text-transform: uppercase;
    margin-bottom: 14px; margin-top: 28px;
  }
  .bio-card {
    background: #000; border: 1px solid var(--border);
    border-radius: 20px; padding: 28px 20px;
    text-align: center; position: relative; overflow: hidden;
  }
  .bio-card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 80% 55% at 50% 110%, rgba(160,35,75,0.2) 0%, transparent 65%);
  }
  .bio-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.4), transparent);
  }
  .avatar-wrap { position: relative; display: inline-block; margin-bottom: 14px; }
  .avatar-ring {
    position: absolute; inset: -3px; border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), #7b2d4a, var(--pink2)); z-index: 0;
  }
  .avatar {
    position: relative; z-index: 1;
    width: 78px; height: 78px; border-radius: 50%;
    border: 3px solid #000; object-fit: cover; display: block;
  }
  .handle {
    font-size: 1.15rem; font-weight: 800;
    color: var(--text); text-decoration: none;
    display: block; margin-bottom: 6px;
    letter-spacing: -0.02em; position: relative;
  }
  .handle:hover { color: var(--pink); }
  .bio-subtitle {
    font-size: 0.78rem; color: var(--muted); line-height: 1.65;
    margin-bottom: 18px; position: relative;
  }
  .bio-tags {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    margin-bottom: 20px; position: relative;
  }
  .bio-tag {
    font-size: 0.69rem; font-weight: 500; padding: 4px 11px;
    background: rgba(224,82,122,0.08);
    border: 1px solid rgba(224,82,122,0.2);
    border-radius: 100px; color: var(--pink);
  }
  .bio-cta {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px; padding: 10px 22px;
    font-size: 0.81rem; font-weight: 500;
    color: var(--text); text-decoration: none;
    transition: background 0.2s; position: relative;
  }
  .bio-cta:hover { background: rgba(255,255,255,0.1); }

  /* ── FOOTER ── */
  .footer { border-top: 1px solid var(--border); padding: 22px 20px; text-align: center; }
  .gh-link {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--muted); text-decoration: none;
    font-size: 0.8rem; font-weight: 500; transition: color 0.2s;
  }
  .gh-link:hover { color: var(--text); }

  /* ── WIKI PAGE ── */
  #wiki-page, #abi-page {
    display: none;
    min-height: calc(100vh - 60px);
    padding: 0;
  }
  #wiki-page.active, #abi-page.active { display: block; }
  #main-page.hidden { display: none; }

  .wiki-header {
    position: relative; overflow: hidden;
    padding: 36px 24px 28px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(160,35,75,0.12) 0%, transparent 100%);
  }
  .wiki-header::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.4), transparent);
  }
  .wiki-back {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px; padding: 7px 16px;
    font-size: 0.8rem; font-weight: 500;
    color: var(--muted); cursor: pointer;
    margin-bottom: 20px; transition: all 0.2s;
  }
  .wiki-back:hover { background: rgba(255,255,255,0.1); color: var(--text); }
  .wiki-title {
    font-size: 2rem; font-weight: 900;
    letter-spacing: -0.03em; line-height: 1.1;
  }
  .wiki-title span {
    background: linear-gradient(95deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .wiki-subtitle {
    font-size: 0.82rem; color: var(--muted); margin-top: 8px; line-height: 1.5;
  }
  .wiki-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .wiki-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(224,82,122,0.08);
    border: 1px solid rgba(224,82,122,0.2);
    border-radius: 6px; padding: 4px 10px;
    font-size: 0.7rem; font-weight: 600;
    color: var(--pink); letter-spacing: 0.04em;
  }

  /* ── MARKDOWN RENDER AREA ── */
  .md-body {
    padding: 28px 20px 60px;
    max-width: 100%;
    line-height: 1.65;
    font-size: 0.875rem;
    color: #e6edf3;
  }

  /* GitHub-dark markdown styles */
  .md-body h1, .md-body h2, .md-body h3,
  .md-body h4, .md-body h5, .md-body h6 {
    color: var(--text); font-weight: 700;
    margin: 1.5em 0 0.6em; line-height: 1.25;
    letter-spacing: -0.02em;
  }
  .md-body h1 { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.035em;
    background: linear-gradient(95deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; display: inline-block; margin-bottom: 4px;
  }
  .md-body h2 {
    font-size: 1.2rem; padding-bottom: 0.4em;
    border-bottom: 1px solid var(--border);
    color: var(--text); -webkit-text-fill-color: var(--text);
  }
  .md-body h3 { font-size: 1rem; color: #cdd9e5; -webkit-text-fill-color: #cdd9e5; }
  .md-body h4 { font-size: 0.9rem; color: var(--muted); -webkit-text-fill-color: var(--muted); }

  .md-body p { margin: 0 0 1em; }

  .md-body a { color: var(--pink); text-decoration: none; }
  .md-body a:hover { text-decoration: underline; color: var(--pink2); }

  .md-body strong { font-weight: 700; color: var(--text); }
  .md-body em { font-style: italic; color: #cdd9e5; }

  .md-body hr {
    border: none; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 2em 0;
  }

  .md-body blockquote {
    border-left: 3px solid var(--pink);
    margin: 1em 0; padding: 10px 16px;
    background: rgba(224,82,122,0.05);
    border-radius: 0 8px 8px 0;
    color: var(--muted); font-size: 0.83rem;
  }
  .md-body blockquote p { margin: 0; }

  .md-body ul, .md-body ol {
    padding-left: 1.5em; margin: 0 0 1em;
  }
  .md-body li { margin: 0.3em 0; }
  .md-body li::marker { color: var(--pink); }

  .md-body code {
    font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 2px 6px;
    color: #f0a0c0;
  }

  .md-body pre {
    margin: 1em 0; border-radius: 10px;
    border: 1px solid var(--border);
    overflow-x: auto;
    background: #0d1117 !important;
    position: relative;
  }
  .md-body pre::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.3), transparent);
    border-radius: 10px 10px 0 0;
  }
  .md-body pre code {
    background: none !important; border: none; padding: 14px 16px;
    display: block; font-size: 0.78rem; color: #e6edf3;
    line-height: 1.6; overflow-x: auto;
  }

  /* Tables */
  .md-body table {
    width: 100%; border-collapse: collapse;
    margin: 1em 0; font-size: 0.8rem;
    overflow-x: auto; display: block;
  }
  .md-body thead tr {
    background: rgba(224,82,122,0.08);
    border-bottom: 2px solid rgba(224,82,122,0.25);
  }
  .md-body th {
    padding: 8px 12px; text-align: left;
    font-weight: 700; color: var(--pink);
    white-space: nowrap; font-size: 0.75rem; letter-spacing: 0.04em;
  }
  .md-body td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    color: #cdd9e5; vertical-align: top;
  }
  .md-body tbody tr:hover { background: rgba(255,255,255,0.025); }
  .md-body td code { font-size: 0.74rem; }

  /* details/summary */
  .md-body details {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px; margin: 0.7em 0;
  }
  .md-body summary {
    cursor: pointer; font-weight: 600;
    color: var(--text); font-size: 0.875rem;
    list-style: none; display: flex; align-items: center; gap: 8px;
  }
  .md-body summary::before {
    content: "▶"; font-size: 0.65rem; color: var(--pink);
    transition: transform 0.2s;
  }
  .md-body details[open] summary::before { transform: rotate(90deg); }
  .md-body details[open] { padding-bottom: 10px; }
  .md-body details pre { margin-top: 12px; }

  /* Align center divs */
  .md-body div[align="center"] { text-align: center; }
  .md-body div[align="center"] img {
    max-width: 180px; border-radius: 12px; margin: 0 auto 16px;
    display: block;
  }

  /* img badges from shields.io */
  .md-body img[src*="shields.io"] {
    border-radius: 4px; margin: 2px;
    display: inline !important;
  }
  .md-body img { max-width: 100%; border-radius: 8px; }

  /* ──────────────────────────────────────────── */
  /* ── AUTH PAGES (LOGIN + REGISTER) ─────────── */
  /* ──────────────────────────────────────────── */
  #auth-page {
    display: none;
    min-height: calc(100vh - 60px);
    position: relative;
    overflow: hidden;
    padding: 40px 20px 60px;
  }
  #auth-page.active { display: block; }

  /* ambient animated background */
  .auth-bg {
    position: absolute; inset: 0; pointer-events: none; z-index: 0;
    overflow: hidden;
  }
  .auth-bg::before,
  .auth-bg::after {
    content: ''; position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.55;
    animation: floatBlob 14s ease-in-out infinite;
  }
  .auth-bg::before {
    width: 360px; height: 360px;
    left: -120px; top: -100px;
    background: radial-gradient(circle, rgba(224,82,122,0.55), transparent 70%);
  }
  .auth-bg::after {
    width: 420px; height: 420px;
    right: -160px; bottom: -120px;
    background: radial-gradient(circle, rgba(160,35,95,0.45), transparent 70%);
    animation-delay: -7s;
  }
  @keyframes floatBlob {
    0%, 100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(40px,-30px) scale(1.1); }
    66%      { transform: translate(-30px,40px) scale(0.95); }
  }

  /* subtle grid */
  .auth-grid {
    position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background-image:
      linear-gradient(rgba(224,82,122,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(224,82,122,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 80%);
  }

  /* container */
  .auth-wrap {
    position: relative; z-index: 2;
    max-width: 420px; margin: 0 auto;
  }

  /* back button */
  .auth-back {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px; padding: 7px 14px;
    font-size: 0.78rem; font-weight: 500;
    color: var(--muted); cursor: pointer;
    margin-bottom: 22px; transition: all 0.25s;
  }
  .auth-back:hover {
    background: rgba(255,255,255,0.08); color: var(--text);
    transform: translateX(-2px);
  }

  /* header */
  .auth-head { text-align: center; margin-bottom: 26px; }
  .auth-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(224,82,122,0.2), rgba(224,82,122,0.05));
    border: 1px solid rgba(224,82,122,0.3);
    margin-bottom: 16px;
    box-shadow: 0 8px 28px rgba(224,82,122,0.25);
    animation: logoFloat 4s ease-in-out infinite;
  }
  @keyframes logoFloat {
    0%, 100% { transform: translateY(0); box-shadow: 0 8px 28px rgba(224,82,122,0.25); }
    50%      { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(224,82,122,0.4); }
  }
  .auth-title {
    font-size: 1.85rem; font-weight: 900;
    letter-spacing: -0.035em; line-height: 1.1;
    margin-bottom: 8px;
  }
  .auth-title span {
    background: linear-gradient(95deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .auth-subtitle {
    font-size: 0.82rem; color: var(--muted); line-height: 1.6;
  }

  /* tabs */
  .auth-tabs {
    display: flex; gap: 4px; padding: 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
  }
  .auth-tab {
    flex: 1; padding: 10px 14px;
    font-size: 0.84rem; font-weight: 600;
    color: var(--muted); cursor: pointer;
    background: none; border: none; border-radius: 9px;
    transition: color 0.25s;
    position: relative; z-index: 2;
  }
  .auth-tab.active { color: var(--text); }
  .auth-tab-indicator {
    position: absolute; top: 4px; bottom: 4px;
    left: 4px; width: calc(50% - 4px);
    background: linear-gradient(135deg, rgba(224,82,122,0.25), rgba(224,82,122,0.1));
    border: 1px solid rgba(224,82,122,0.35);
    border-radius: 9px; z-index: 1;
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 4px 16px rgba(224,82,122,0.2);
  }
  .auth-tab-indicator.right {
    transform: translateX(calc(100% + 0px));
  }

  /* card */
  .auth-card {
    position: relative;
    background: linear-gradient(180deg, rgba(22,22,22,0.95), rgba(10,10,10,0.95));
    border: 1px solid var(--border);
    border-radius: 20px; padding: 26px 22px;
    backdrop-filter: blur(14px);
    overflow: hidden;
  }
  .auth-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.5), transparent);
  }
  .auth-card::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 90% 50% at 50% 0%, rgba(224,82,122,0.08), transparent 60%);
  }

  /* forms */
  .auth-form {
    display: none; position: relative; z-index: 1;
    animation: formFadeIn 0.4s cubic-bezier(0.22,1,0.36,1);
  }
  .auth-form.active { display: block; }
  @keyframes formFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* input groups */
  .field {
    margin-bottom: 14px;
    position: relative;
    opacity: 0; transform: translateY(8px);
    animation: fieldIn 0.45s cubic-bezier(0.22,1,0.36,1) forwards;
  }
  .field:nth-child(1) { animation-delay: 0.05s; }
  .field:nth-child(2) { animation-delay: 0.1s; }
  .field:nth-child(3) { animation-delay: 0.15s; }
  .field:nth-child(4) { animation-delay: 0.2s; }
  .field:nth-child(5) { animation-delay: 0.25s; }
  .field:nth-child(6) { animation-delay: 0.3s; }
  @keyframes fieldIn {
    to { opacity: 1; transform: translateY(0); }
  }
  .field-label {
    display: block; font-size: 0.72rem; font-weight: 600;
    color: var(--muted); letter-spacing: 0.04em;
    text-transform: uppercase; margin-bottom: 7px;
  }
  .field-input {
    position: relative;
    display: flex; align-items: center;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  }
  .field-input svg {
    flex-shrink: 0; margin-left: 14px;
    color: var(--dim); transition: color 0.25s;
  }
  .field-input input {
    flex: 1; min-width: 0;
    background: none; border: none; outline: none;
    padding: 13px 14px 13px 10px;
    font-size: 0.9rem; color: var(--text);
    font-family: inherit;
  }
  .field-input input::placeholder { color: var(--dim); }
  .field-input:hover {
    border-color: rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.55);
  }
  .field-input:focus-within {
    border-color: var(--pink);
    background: rgba(224,82,122,0.04);
    box-shadow: 0 0 0 3px rgba(224,82,122,0.12);
  }
  .field-input:focus-within svg { color: var(--pink); }

  .field-toggle {
    background: none; border: none; cursor: pointer;
    padding: 0 14px; color: var(--dim);
    display: flex; align-items: center;
    transition: color 0.2s;
  }
  .field-toggle:hover { color: var(--text); }

  /* password strength meter */
  .strength {
    height: 3px; margin-top: 8px; border-radius: 2px;
    background: rgba(255,255,255,0.06); overflow: hidden;
  }
  .strength-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #e04f4f, #e0a04f, #e0e04f, #7ee04f);
    background-size: 400% 100%; background-position: 0% 50%;
    transition: width 0.35s cubic-bezier(0.22,1,0.36,1), background-position 0.35s;
    border-radius: 2px;
  }
  .strength-hint {
    font-size: 0.68rem; color: var(--dim);
    margin-top: 6px; letter-spacing: 0.03em;
    transition: color 0.25s;
  }

  /* options row */
  .auth-options {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 18px; font-size: 0.78rem;
  }
  .checkbox {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; color: var(--muted); user-select: none;
  }
  .checkbox input { position: absolute; opacity: 0; pointer-events: none; }
  .checkbox-box {
    width: 16px; height: 16px; border-radius: 5px;
    border: 1.5px solid var(--border);
    background: rgba(0,0,0,0.4);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
  }
  .checkbox input:checked + .checkbox-box {
    background: var(--pink);
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(224,82,122,0.18);
  }
  .checkbox-box svg {
    opacity: 0; transform: scale(0.5);
    transition: all 0.2s;
  }
  .checkbox input:checked + .checkbox-box svg {
    opacity: 1; transform: scale(1);
  }
  .auth-options a {
    color: var(--pink); text-decoration: none;
    font-weight: 500; transition: color 0.2s;
  }
  .auth-options a:hover { color: var(--pink2); }

  /* submit */
  .auth-submit {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, var(--pink), var(--pink2));
    border: none; border-radius: 12px;
    padding: 14px 22px;
    font-size: 0.9rem; font-weight: 700; font-family: inherit;
    color: #fff; cursor: pointer;
    box-shadow: 0 8px 28px rgba(224,82,122,0.35);
    transition: transform 0.2s, box-shadow 0.25s, filter 0.2s;
    position: relative; overflow: hidden;
  }
  .auth-submit:hover {
    transform: translateY(-1px); filter: brightness(1.08);
    box-shadow: 0 12px 32px rgba(224,82,122,0.45);
  }
  .auth-submit:active { transform: translateY(0); }
  .auth-submit::before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
  }
  .auth-submit:hover::before { left: 100%; }
  .auth-submit.loading { pointer-events: none; filter: saturate(0.7) brightness(0.85); }
  .auth-submit.loading .submit-label { opacity: 0; }
  .auth-submit .spinner {
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff; border-radius: 50%;
    opacity: 0;
    animation: spin 0.7s linear infinite;
  }
  .auth-submit.loading .spinner { opacity: 1; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* divider */
  .auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0 16px;
    font-size: 0.7rem; color: var(--dim);
    letter-spacing: 0.12em; text-transform: uppercase;
  }
  .auth-divider::before,
  .auth-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }

  /* oauth */
  .oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .oauth-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 10px; font-size: 0.82rem; font-weight: 500;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text); cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
  }
  .oauth-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
  }
  .oauth-btn svg { flex-shrink: 0; }

  /* footnote */
  .auth-foot {
    text-align: center; margin-top: 18px;
    font-size: 0.78rem; color: var(--muted);
  }
  .auth-foot button {
    background: none; border: none; cursor: pointer;
    color: var(--pink); font-weight: 600;
    font-family: inherit; font-size: inherit;
    transition: color 0.2s;
  }
  .auth-foot button:hover { color: var(--pink2); }

  /* page enter anim */
  @keyframes authEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  #auth-page.active .auth-wrap { animation: authEnter 0.45s cubic-bezier(0.22,1,0.36,1); }

  /* small screens */
  @media (max-width: 380px) {
    .auth-card { padding: 22px 18px; }
    .auth-title { font-size: 1.6rem; }
    .oauth-row { grid-template-columns: 1fr; }
  }

  /* ──────────────────────────────────────────── */
  /* ── PROFILE PAGE ──────────────────────────── */
  /* ──────────────────────────────────────────── */
  #profile-page {
    display: none;
    min-height: calc(100vh - 60px);
    position: relative;
    overflow: hidden;
  }
  #profile-page.active { display: block; animation: pageEnter 0.4s cubic-bezier(0.22,1,0.36,1); }
  @keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .profile-banner {
    height: 140px; position: relative;
    background:
      radial-gradient(ellipse 60% 100% at 30% 120%, rgba(224,82,122,0.55) 0%, transparent 60%),
      radial-gradient(ellipse 50% 100% at 80% 120%, rgba(160,35,95,0.4) 0%, transparent 60%),
      linear-gradient(180deg, #1a0d14, #0a0a0a);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
  }
  .profile-banner::before {
    content: ''; position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(224,82,122,0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(224,82,122,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, #000, transparent);
    -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  }
  .profile-banner::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.5), transparent);
  }

  .profile-wrap {
    max-width: 480px; margin: 0 auto;
    padding: 0 20px 60px;
    position: relative;
  }

  .profile-head {
    margin-top: -56px; position: relative;
    display: flex; align-items: flex-end; gap: 16px;
    margin-bottom: 18px;
  }
  .profile-avatar-wrap {
    position: relative; flex-shrink: 0;
  }
  .profile-avatar-ring {
    position: absolute; inset: -3px; border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), #7b2d4a, var(--pink2));
    animation: rotateRing 8s linear infinite;
  }
  @keyframes rotateRing { to { transform: rotate(360deg); } }
  .profile-avatar {
    position: relative; z-index: 1;
    width: 96px; height: 96px; border-radius: 50%;
    border: 4px solid var(--bg);
    background: var(--card); object-fit: cover;
    display: block;
  }
  .profile-status {
    position: absolute; bottom: 4px; right: 4px; z-index: 2;
    width: 18px; height: 18px; border-radius: 50%;
    background: #4fe07a; border: 3px solid var(--bg);
    box-shadow: 0 0 12px rgba(79,224,122,0.5);
    animation: pulseDot 2s ease-in-out infinite;
  }
  @keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 12px rgba(79,224,122,0.5); }
    50%      { box-shadow: 0 0 20px rgba(79,224,122,0.9); }
  }
  .profile-edit-btn {
    margin-bottom: 8px;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 14px;
    font-size: 0.78rem; font-weight: 600;
    color: var(--text); cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
    margin-left: auto;
  }
  .profile-edit-btn:hover {
    background: rgba(224,82,122,0.12);
    border-color: rgba(224,82,122,0.35);
    color: var(--pink);
  }

  .profile-meta { padding: 0 4px 18px; }
  .profile-name {
    font-size: 1.5rem; font-weight: 900;
    letter-spacing: -0.03em; line-height: 1.1;
  }
  .profile-handle {
    font-size: 0.85rem; color: var(--muted);
    margin-top: 2px;
  }
  .profile-bio {
    margin-top: 12px;
    font-size: 0.85rem; color: #cdd9e5; line-height: 1.55;
  }
  .profile-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 14px;
  }
  .profile-myposts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
  .mypost-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .mypost-top { display:flex; gap:8px; align-items:center; font-size:0.72rem; color: var(--muted); flex-wrap:wrap; }
  .mypost-cat {
    padding: 2px 8px; border-radius: 4px;
    background: rgba(224,82,122,0.1); color: var(--pink);
    font-weight: 600; letter-spacing: 0.03em;
  }
  .mypost-kind {
    padding: 2px 8px; border-radius: 4px;
    font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; font-size: 0.65rem;
  }
  .mypost-kind.is-thread { background: rgba(82,170,224,0.12); color: #52aae0; }
  .mypost-kind.is-comment { background: rgba(255,255,255,0.06); color: var(--muted); }
  .mypost-thread {
    color: var(--text); font-size: 0.85rem; font-weight: 700;
    text-decoration: none; cursor: pointer;
  }
  .mypost-thread:hover { color: var(--pink); }
  .mypost-body {
    font-size: 0.82rem; color: var(--text); line-height: 1.5;
    white-space: pre-wrap; word-wrap: break-word;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  }
  .mypost-actions { display:flex; gap:6px; flex-wrap:wrap; }
  .mypost-actions button {
    padding: 5px 11px; border-radius: 7px;
    background: transparent; border: 1px solid var(--border);
    color: var(--muted); cursor: pointer;
    font-family: inherit; font-size: 0.74rem; font-weight: 500;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
  }
  .mypost-actions button:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
  .mypost-actions .mypost-del:hover { color: #ff7a7a; border-color: rgba(255,122,122,0.4); background: rgba(255,122,122,0.06); }
  .mypost-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
  .mypost-edit-ta {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 9px 11px; font-size: 0.84rem; color: var(--text);
    font-family: inherit; outline: none; resize: vertical; min-height: 70px;
  }
  .mypost-edit-ta:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(224,82,122,0.12); }

  .profile-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 22px;
  }
  .profile-stat {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px 10px;
    text-align: center; position: relative; overflow: hidden;
    transition: transform 0.25s, border-color 0.25s;
  }
  .profile-stat:hover {
    transform: translateY(-2px);
    border-color: rgba(224,82,122,0.3);
  }
  .profile-stat::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.3), transparent);
  }
  .profile-stat-num {
    font-size: 1.3rem; font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .profile-stat-label {
    font-size: 0.68rem; color: var(--muted);
    margin-top: 2px; letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .profile-section-label {
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
    color: var(--dim); text-transform: uppercase;
    margin: 22px 0 10px;
  }

  .profile-info-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
  }
  .profile-info-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
  }
  .profile-info-row:last-child { border-bottom: none; }
  .profile-info-row svg { color: var(--muted); flex-shrink: 0; }
  .profile-info-row .k { color: var(--muted); flex: 0 0 90px; }
  .profile-info-row .v { color: var(--text); font-weight: 500; }

  .profile-signout {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(224,82,122,0.08);
    border: 1px solid rgba(224,82,122,0.25);
    border-radius: 12px; padding: 13px 16px;
    font-size: 0.86rem; font-weight: 600;
    color: var(--pink); cursor: pointer;
    font-family: inherit;
    margin-top: 20px;
    transition: all 0.25s;
  }
  .profile-signout:hover {
    background: rgba(224,82,122,0.14);
    border-color: rgba(224,82,122,0.4);
  }

  /* edit modal */
  .edit-modal {
    position: fixed; inset: 0; z-index: 300;
    display: none; align-items: flex-end; justify-content: center;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    animation: fadeIn 0.25s;
  }
  .edit-modal.open { display: flex; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .edit-sheet {
    width: 100%; max-width: 480px;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    padding: 22px 20px 26px;
    animation: slideUp 0.35s cubic-bezier(0.22,1,0.36,1);
    position: relative;
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .edit-sheet::before {
    content: ''; position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border);
  }
  .edit-title {
    font-size: 1.15rem; font-weight: 800;
    margin: 8px 0 18px; text-align: center;
  }
  .edit-actions { display: flex; gap: 8px; margin-top: 8px; }
  .edit-actions button { flex: 1; }
  .edit-cancel {
    padding: 12px; border-radius: 11px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text); font-weight: 600; font-family: inherit;
    cursor: pointer; transition: background 0.2s;
  }
  .edit-cancel:hover { background: rgba(255,255,255,0.1); }

  /* toast */
  .toast {
    position: fixed; left: 50%; bottom: 24px;
    transform: translate(-50%, 100px);
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 18px;
    font-size: 0.85rem; color: var(--text);
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 400; opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s;
    pointer-events: none;
  }
  .toast.show { transform: translate(-50%, 0); opacity: 1; }
  .toast.success { border-color: rgba(79,224,122,0.4); }
  .toast.error { border-color: rgba(224,79,79,0.4); }
  .toast svg { flex-shrink: 0; }

  /* ──────────────────────────────────────────── */
  /* ── FORUM ─────────────────────────────────── */
  /* ──────────────────────────────────────────── */
  #forum-page { display: none; min-height: calc(100vh - 60px); }
  #forum-page.active { display: block; animation: pageEnter 0.4s cubic-bezier(0.22,1,0.36,1); }

  .forum-wrap { max-width: 520px; margin: 0 auto; padding: 28px 20px 60px; }
  @media (min-width: 820px) {
    .forum-wrap { max-width: 780px; padding: 40px 32px 80px; }
    .forum-title { font-size: 2.4rem; }
    .forum-sub   { font-size: 0.9rem; }
    .thread-card { padding: 18px 20px; }
    .thread-title { font-size: 1.05rem; }
    .thread-excerpt { font-size: 0.85rem; -webkit-line-clamp: 3; }
  }
  @media (min-width: 1200px) {
    .forum-wrap { max-width: 900px; }
  }
  .forum-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
  }
  @media (max-width: 480px) {
    .forum-head { align-items: stretch; }
    .forum-head > div:first-child { flex: 1 1 100%; }
    .forum-new-btn { width: 100%; justify-content: center; padding: 12px; font-size: 0.88rem; }
    .forum-title { font-size: 1.5rem; }
  }
  .forum-title {
    font-size: 1.75rem; font-weight: 900;
    letter-spacing: -0.035em; line-height: 1.1;
  }
  .forum-title span {
    background: linear-gradient(95deg, var(--pink), var(--pink2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .forum-sub { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

  .forum-new-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--pink), var(--pink2));
    border: none; border-radius: 11px; padding: 10px 14px;
    color: #fff; font-weight: 600; font-size: 0.82rem; cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(224,82,122,0.3);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    flex-shrink: 0;
  }
  .forum-new-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
  .forum-new-btn svg { flex-shrink: 0; }

  .forum-categories {
    display: flex; gap: 6px; overflow-x: auto;
    padding-bottom: 6px; margin-bottom: 18px;
    scrollbar-width: none;
  }
  .forum-categories::-webkit-scrollbar { display: none; }
  .forum-chip {
    flex-shrink: 0;
    padding: 7px 14px; border-radius: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    font-size: 0.76rem; font-weight: 500;
    color: var(--muted); cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
  }
  .forum-chip:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
  .forum-chip.active {
    background: rgba(224,82,122,0.12);
    border-color: rgba(224,82,122,0.4);
    color: var(--pink);
  }

  .thread-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px;
    margin-bottom: 10px; cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
    position: relative; overflow: hidden;
    animation: fieldIn 0.45s cubic-bezier(0.22,1,0.36,1) backwards;
  }
  .thread-card:hover {
    border-color: rgba(224,82,122,0.3);
    transform: translateY(-2px);
    background: #1a1a1a;
  }
  .thread-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224,82,122,0.3), transparent);
    opacity: 0; transition: opacity 0.25s;
  }
  .thread-card:hover::before { opacity: 1; }
  .thread-top {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px; font-size: 0.72rem; color: var(--muted);
  }
  .thread-cat {
    padding: 2px 8px; border-radius: 4px;
    background: rgba(224,82,122,0.1);
    color: var(--pink);
    font-weight: 600; letter-spacing: 0.03em;
  }
  .thread-cat.pinned { background: rgba(224,180,82,0.12); color: #e0b452; }
  .thread-title {
    font-size: 0.95rem; font-weight: 700; line-height: 1.35;
    margin-bottom: 6px; letter-spacing: -0.01em;
  }
  .thread-excerpt {
    font-size: 0.8rem; color: var(--muted);
    line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 12px;
  }
  .thread-meta {
    display: flex; align-items: center; gap: 14px;
    font-size: 0.72rem; color: var(--dim);
  }
  .thread-meta .a { display: flex; align-items: center; gap: 5px; }
  .thread-meta img { width: 18px; height: 18px; border-radius: 50%; }
  .thread-meta svg { opacity: 0.7; }

  .forum-empty {
    text-align: center; padding: 60px 20px;
    color: var(--muted); font-size: 0.85rem;
  }

  /* thread detail */
  #thread-page { display: none; min-height: calc(100vh - 60px); }
  #thread-page.active { display: block; animation: pageEnter 0.4s cubic-bezier(0.22,1,0.36,1); }
  .thread-wrap { max-width: 520px; margin: 0 auto; padding: 24px 20px 140px; }
  @media (min-width: 820px) {
    .thread-wrap { max-width: 780px; padding: 36px 32px 160px; }
    .thread-header h1 { font-size: 1.9rem; }
    .post-card { padding: 20px 22px; }
    .post-body { font-size: 0.95rem; }
    .post-head img { width: 38px; height: 38px; }
    .post-who { font-size: 0.9rem; }
  }
  @media (min-width: 1200px) {
    .thread-wrap { max-width: 880px; }
  }
  .thread-header {
    padding-bottom: 16px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }
  .thread-header h1 {
    font-size: 1.4rem; font-weight: 900;
    line-height: 1.2; letter-spacing: -0.02em;
    margin: 10px 0 8px;
  }
  .thread-header .thread-top { font-size: 0.72rem; }

  .post-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px;
    margin-bottom: 10px;
    animation: fieldIn 0.4s cubic-bezier(0.22,1,0.36,1) backwards;
  }
  .post-card.op {
    background: linear-gradient(180deg, rgba(224,82,122,0.04), var(--card));
    border-color: rgba(224,82,122,0.2);
  }
  .post-card.is-reply {
    margin-left: 18px;
    border-left: 2px solid rgba(224,82,122,0.35);
  }
  @media (min-width: 820px) {
    .post-card.is-reply { margin-left: 32px; }
  }
  .post-card.highlight {
    animation: flashPink 1.4s ease-out;
  }
  @keyframes flashPink {
    0%   { box-shadow: 0 0 0 3px rgba(224,82,122,0.5); border-color: rgba(224,82,122,0.6); }
    100% { box-shadow: 0 0 0 0 rgba(224,82,122,0); }
  }

  /* quote preview on a post - "replying to @user" */
  .post-quote {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 8px 10px; margin-bottom: 10px;
    background: rgba(255,255,255,0.025);
    border-left: 2px solid rgba(224,82,122,0.5);
    border-radius: 6px;
    font-size: 0.78rem; color: var(--muted);
    cursor: pointer; transition: background 0.2s;
  }
  .post-quote:hover { background: rgba(224,82,122,0.06); }
  .post-quote svg { flex-shrink: 0; opacity: 0.7; margin-top: 2px; }
  .post-quote-inner { flex: 1; min-width: 0; }
  .post-quote-who {
    color: var(--pink); font-weight: 600; font-size: 0.75rem;
    margin-bottom: 2px;
  }
  .post-quote-body {
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
  }

  /* reply button on each post */
  .post-reply-btn {
    margin-top: 10px; padding: 4px 10px; border-radius: 6px;
    background: transparent; border: 1px solid var(--border);
    color: var(--muted); cursor: pointer;
    font-family: inherit; font-size: 0.74rem; font-weight: 500;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
  }
  .post-reply-btn:hover {
    color: var(--pink); border-color: rgba(224,82,122,0.4);
    background: rgba(224,82,122,0.06);
  }
  .post-reply-btn svg { flex-shrink: 0; }

  .post-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .post-actions .post-reply-btn { margin-top: 0; }
  .post-edit-btn {
    padding: 4px 10px; border-radius: 6px;
    background: transparent; border: 1px solid var(--border);
    color: var(--muted); cursor: pointer;
    font-family: inherit; font-size: 0.74rem; font-weight: 500;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.2s;
  }
  .post-edit-btn:hover {
    color: var(--pink); border-color: rgba(224,82,122,0.4);
    background: rgba(224,82,122,0.06);
  }
  .post-del-btn:hover {
    color: #ff7a7a; border-color: rgba(255,122,122,0.4);
    background: rgba(255,122,122,0.06);
  }
  .post-edit-ta {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-size: 0.88rem; color: var(--text);
    font-family: inherit; outline: none; resize: vertical; min-height: 80px;
  }
  .post-edit-ta:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(224,82,122,0.12); }
  .post-edit-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
  .post-edit-actions button {
    padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; color: var(--muted);
    cursor: pointer; font-family: inherit; font-size: 0.78rem; font-weight: 600;
    transition: all 0.2s;
  }
  .post-edit-actions .post-edit-save {
    background: linear-gradient(135deg, var(--pink), var(--pink2));
    border-color: transparent; color: #fff;
  }
  .post-edit-actions button:hover { filter: brightness(1.1); }

  .post-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
    justify-content: space-between;
  }
  .post-head-main { display:flex; align-items:center; gap:10px; min-width: 0; }

  /* reply-context banner above the textarea */
  .reply-context {
    max-width: 520px; margin: 0 auto 8px;
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 12px;
    background: rgba(224,82,122,0.08);
    border: 1px solid rgba(224,82,122,0.25);
    border-radius: 10px;
    font-size: 0.78rem; color: var(--text);
    animation: replyCtxIn 0.25s cubic-bezier(0.22,1,0.36,1);
  }
  @media (min-width: 820px) {
    .reply-context { max-width: 780px; }
  }
  @keyframes replyCtxIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .reply-context-body { flex: 1; min-width: 0; }
  .reply-context-who {
    color: var(--pink); font-weight: 600; font-size: 0.75rem;
    margin-bottom: 2px;
  }
  .reply-context-preview {
    color: var(--muted); font-size: 0.74rem; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .reply-context-close {
    flex-shrink: 0; background: none; border: none; color: var(--muted);
    cursor: pointer; padding: 2px; border-radius: 4px;
    transition: color 0.2s, background 0.2s;
  }
  .reply-context-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }
  .post-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
  }
  .post-head img {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--border);
  }
  .post-who { font-size: 0.82rem; font-weight: 600; }
  .post-when { font-size: 0.7rem; color: var(--dim); }
  .post-body {
    font-size: 0.88rem; line-height: 1.6; color: #e6edf3;
    white-space: pre-wrap; word-break: break-word;
  }
  .post-body code {
    font-family: 'SF Mono', 'Fira Mono', monospace; font-size: 0.8rem;
    background: rgba(255,255,255,0.07); border-radius: 4px;
    padding: 2px 6px; color: #f0a0c0;
  }

  .reply-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
  }
  .reply-bar.show { transform: translateY(0); }
  .reply-inner {
    max-width: 520px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 8px;
  }
  @media (min-width: 820px) {
    .reply-inner { max-width: 780px; }
    .reply-bar { padding: 14px 24px; }
  }
  .reply-row {
    display: flex; gap: 8px; align-items: center; width: 100%;
  }
  .reply-inner textarea {
    flex: 1; min-height: 44px; max-height: 120px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 11px 14px; font-size: 0.88rem; color: var(--text);
    font-family: inherit; outline: none; resize: none;
    line-height: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .reply-inner textarea:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(224,82,122,0.12);
  }
  .reply-send {
    flex-shrink: 0; align-self: stretch;
    width: 64px; min-height: 44px; border-radius: 11px;
    background: linear-gradient(135deg, var(--pink), var(--pink2));
    border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(224,82,122,0.3);
    transition: transform 0.2s, filter 0.2s;
  }
  .reply-send:hover { transform: translateY(-1px); filter: brightness(1.08); }
  .reply-send:disabled { opacity: 0.5; pointer-events: none; }

  .reply-signin {
    max-width: 520px; margin: 0 auto;
    text-align: center; font-size: 0.84rem; color: var(--muted);
  }
  .reply-signin button {
    background: none; border: none; color: var(--pink);
    font-weight: 600; cursor: pointer; font-family: inherit; font-size: inherit;
  }

  /* new thread modal uses .edit-modal/.edit-sheet reused */

  /* ── RESPONSIVE: tablet (≥ 640px) ── */
  @media (min-width: 640px) {
    .hero { padding: 84px 24px 72px; }
    .hero-title { font-size: 3.8rem; }
    .hero-subtitle { font-size: 1.05rem; max-width: 540px; margin-left: auto; margin-right: auto; }
    .stats { gap: 40px; padding: 24px; }
    .section { padding: 56px 32px; max-width: 820px; margin: 0 auto; }
    .section-title { font-size: 2rem; }
    .feature-card { padding: 26px 28px; }
    .feat-title { font-size: 1.08rem; }
    .feat-desc { font-size: 0.9rem; }
    .footer { padding: 30px; }
    .profile-wrap { max-width: 720px; padding: 0 32px 80px; }
    .profile-banner { height: 180px; }
    .bio-section { padding: 4px 32px 60px; }
  }

  /* ── RESPONSIVE: desktop (≥ 960px) ── */
  @media (min-width: 960px) {
    nav { padding: 0 32px; }
    .hero { padding: 120px 24px 96px; }
    .hero-title { font-size: 4.6rem; }
    .section { max-width: 980px; padding: 72px 40px; }
    .features-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    }
    .feature-card { margin-bottom: 0; }
    .profile-wrap { max-width: 860px; }
  }

  /* ── RESPONSIVE: small phones (≤ 380px) ── */
  @media (max-width: 380px) {
    .hero { padding: 40px 16px 40px; }
    .hero-title { font-size: 2.15rem; }
    .hero-subtitle { font-size: 0.82rem; }
    .section { padding: 28px 16px; }
    .section-title { font-size: 1.35rem; }
    .feature-card { padding: 16px; }
    .bio-section { padding: 4px 16px 32px; }
    .profile-wrap { padding: 0 14px 60px; }
    .profile-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .profile-actions { width: 100%; }
    .profile-actions > * { flex: 1; justify-content: center; }
    .oauth-row { grid-template-columns: 1fr; }
    .forum-wrap { padding: 20px 14px 60px; }
    .thread-wrap { padding: 18px 14px 140px; }
    .reply-bar { padding: 10px 14px; }
  }

  /* safe-area insets for iOS notch */
  @supports (padding: max(0px)) {
    nav { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .reply-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  }

  /* stop iOS from zooming on input focus (inputs <16px trigger zoom) */
  @media (max-width: 760px) {
    input, textarea, select { font-size: 16px !important; }
  }
