/* ═══════════════════════════════════════════════════════════════
   TFXS Docs — Styles
   Dark neon OrangeRed documentation portal
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface2: #161616;
  --surface3: #1a1a1a;
  --border: #1e1e1e;
  --border2: #2a2a2a;
  --accent: #FF4500;
  --accent2: #FF6B35;
  --gold: #FFD700;
  --green: #00FF7F;
  --red: #DC143C;
  --blue: #4FC3F7;
  --purple: #BB86FC;
  --cyan: #00BCD4;
  --text: #e0e0e0;
  --text-dim: #888;
  --text-bright: #fff;
  --header-h: 56px;
  --sidebar-w: 270px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

.accent { color: var(--accent); }

/* ═══ BACKGROUND GLOW ═══ */
.bg-glow, .bg-glow2 {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-glow {
  background:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(255,69,0,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255,107,53,0.04) 0%, transparent 50%);
}
.bg-glow2 {
  background:
    radial-gradient(ellipse 40% 30% at 60% 10%, rgba(255,215,0,0.03) 0%, transparent 50%),
    radial-gradient(ellipse 30% 40% at 10% 90%, rgba(0,188,212,0.03) 0%, transparent 50%);
}

/* ═══ HEADER ═══ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header-brand { display: flex; align-items: center; gap: 8px; }
.brand-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: 1px;
  white-space: nowrap;
}
.header-doc-title {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.header-doc-title:not(:empty)::before {
  content: '—';
  margin-right: 10px;
  color: var(--border2);
}
.header-user {
  font-size: 13px;
  color: var(--text-dim);
}
.tier-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}
.tier-badge.silver { background: rgba(192,192,192,0.1); color: #C0C0C0; border: 1px solid rgba(192,192,192,0.2); }
.tier-badge.gold { background: rgba(255,215,0,0.1); color: #FFD700; border: 1px solid rgba(255,215,0,0.2); }

.btn-back {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); }

.btn-logout {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ═══ LOGIN VIEW ═══ */
#loginView {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}
.login-hero {
  text-align: center;
  margin-bottom: 30px;
}
.login-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,69,0,0.06);
  border: 1px solid rgba(255,69,0,0.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.login-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: 2px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 10px;
  max-width: 440px;
}
.login-subtitle strong { color: var(--text); }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  position: relative;
  overflow: hidden;
}
.card-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
}
.login-card-inner {
  padding: 32px 28px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.3;
  transition: opacity 0.3s;
}
.step.active { opacity: 1; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.step.active .step-num {
  background: var(--accent);
  color: #fff;
}
.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.step-line {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}

.uid-input-group label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
}
.input-wrapper {
  position: relative;
}
.input-wrapper .input-icon-svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.input-wrapper input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 16px 12px 42px;
  color: var(--text-bright);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.input-wrapper input:focus {
  border-color: var(--accent);
}
.input-wrapper input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}
.input-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  opacity: 0.6;
}

.telegram-login-area {
  margin-top: 24px;
}
.tg-divider {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 16px;
  position: relative;
}
.tg-divider::before, .tg-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background: var(--border);
}
.tg-divider::before { left: 0; }
.tg-divider::after { right: 0; }
.tg-divider span {
  background: var(--surface);
  padding: 0 12px;
  position: relative;
}
#telegramWidget {
  display: flex;
  justify-content: center;
}

/* ═══ LIBRARY VIEW ═══ */
#libraryView {
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 60px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.library-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 20px;
}
.library-header h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  color: var(--text-bright);
}
.library-header p {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 8px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Doc Cards ── */
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.doc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  transition: opacity 0.3s;
}
.doc-card.ultimate::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.doc-card.sniper::before { background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.doc-card.guide::before { background: linear-gradient(90deg, var(--gold), var(--accent2)); }

.doc-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.doc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.doc-card.ultimate .doc-card-icon { background: rgba(255,69,0,0.08); color: var(--accent); }
.doc-card.sniper .doc-card-icon { background: rgba(0,188,212,0.08); color: var(--cyan); }
.doc-card.guide .doc-card-icon { background: rgba(255,215,0,0.08); color: var(--gold); }

.doc-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.doc-card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}
.doc-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
}
.doc-card-meta .meta-tag {
  background: rgba(255,255,255,0.04);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.doc-card-meta .meta-sections {
  color: var(--text-dim);
}
.doc-card .doc-card-arrow {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--border2);
  transition: all 0.25s;
}
.doc-card:hover .doc-card-arrow {
  color: var(--accent);
  transform: translateY(-50%) translateX(4px);
}

.doc-card-locked {
  opacity: 0.35;
  pointer-events: none;
}
.doc-card-locked .doc-card-lock {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ═══ READER VIEW ═══ */
#readerView {
  padding-top: var(--header-h);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.reader-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: rgba(14,14,14,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  padding-bottom: 40px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), width 0.35s cubic-bezier(.4,0,.2,1);
}

/* Desktop collapse: slide sidebar off-screen */
.sidebar-hidden .reader-sidebar {
  transform: translateX(-100%);
}
.sidebar-hidden .reader-content {
  margin-left: 0;
  max-width: 960px;
  margin-right: auto;
}
/* Show FAB when sidebar is hidden on desktop */
.sidebar-hidden .toc-fab {
  display: flex;
}

.toc-header {
  padding: 20px 16px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(14,14,14,0.98);
}
.toc-collapse-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border2);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.toc-collapse-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,69,0,0.06);
}
.toc-list {
  padding: 8px 0;
}

/* ── Collapsible TOC Groups ── */
.toc-group {
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.toc-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.toc-group-header:hover {
  background: rgba(255,255,255,0.02);
}
.toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 20px;
  opacity: 0.45;
  flex-shrink: 0;
}
.toc-link {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-link:hover, .toc-link.active {
  color: var(--accent);
}
.toc-link.active ~ .toc-chevron {
  color: var(--accent);
}
.toc-chevron {
  color: var(--text-dim);
  opacity: 0.4;
  transition: transform 0.25s, opacity 0.2s;
  flex-shrink: 0;
}
.toc-group.collapsed .toc-chevron {
  transform: rotate(-90deg);
}
.toc-group-header:hover .toc-chevron {
  opacity: 0.8;
}

/* children (collapsible) */
.toc-children {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s;
  opacity: 1;
}
.toc-group.collapsed .toc-children {
  max-height: 0;
  opacity: 0;
}
.toc-child-link {
  display: block;
  padding: 6px 16px 6px 46px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  opacity: 0.7;
  border-left: 2px solid transparent;
  line-height: 1.4;
}
.toc-child-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.015);
  opacity: 1;
}
.toc-child-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(255,69,0,0.04);
  opacity: 1;
}

/* active group highlight */
.toc-group:has(.active) .toc-num {
  color: var(--accent);
  opacity: 1;
}

/* ── Content ── */
.reader-content {
  margin-left: var(--sidebar-w);
  padding: 40px 40px 80px;
  max-width: calc(var(--sidebar-w) + 900px);
  min-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  height: calc(100vh - var(--header-h));
  transition: margin-left 0.35s cubic-bezier(.4,0,.2,1), max-width 0.35s cubic-bezier(.4,0,.2,1);
}

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 101;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Overlay (mobile) ── */
.reader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}

/* ── TOC FAB (mobile) ── */
.toc-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 40;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,69,0,0.3);
  transition: transform 0.2s;
}
.toc-fab:active { transform: scale(0.92); }

/* ═══ DOC CONTENT STYLES ═══ */
/* These style the HTML loaded from content/ fragments */

.doc-hero {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}
.doc-hero-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.doc-hero-badge.ultimate { background: rgba(255,69,0,0.1); color: var(--accent); }
.doc-hero-badge.sniper { background: rgba(0,188,212,0.1); color: var(--cyan); }
.doc-hero-badge.guide { background: rgba(255,215,0,0.1); color: var(--gold); }

.doc-hero h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 8px;
}
.doc-hero-sub {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ── Sections ── */
.doc-section {
  margin-bottom: 50px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.doc-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.doc-section-num {
  background: var(--accent);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  min-width: 30px;
  text-align: center;
}
.doc-section-num.cyan { background: var(--cyan); color: #000; }
.doc-section-num.gold { background: var(--gold); color: #000; }

.doc-section h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
}
.doc-section-desc {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.8;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: 12px;
  border-left: 3px solid var(--accent);
}
.doc-section-desc.cyan-border { border-left-color: var(--cyan); }
.doc-section-desc.gold-border { border-left-color: var(--gold); }

/* ── Param Table ── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}
.param-table thead th {
  background: var(--surface2);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 10px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
}
.param-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.025);
  transition: background 0.15s;
}
.param-table tbody tr:hover {
  background: rgba(255,69,0,0.02);
}
.param-table td {
  padding: 9px 14px;
  vertical-align: top;
}
.p-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--blue);
  font-size: 12px;
  white-space: nowrap;
}
.p-default {
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
  font-size: 12px;
}

/* ── Tags ── */
.tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.tag-v11 { background: rgba(255,69,0,0.12); color: var(--accent); }
.tag-new { background: rgba(0,255,127,0.15); color: var(--green); }
.tag-smc { background: rgba(0,188,212,0.12); color: var(--cyan); }
.tag-important { background: rgba(255,69,0,0.12); color: var(--accent); }
.tag-safety { background: rgba(220,20,60,0.12); color: var(--red); }
.tag-optional { background: rgba(136,136,136,0.12); color: var(--text-dim); }

/* ── Tip Boxes ── */
.tip-box {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  margin: 14px 0;
}
.tip-box.tip { background: rgba(0,255,127,0.04); border-left: 3px solid var(--green); color: var(--green); }
.tip-box.warn { background: rgba(255,69,0,0.04); border-left: 3px solid var(--accent); color: var(--accent2); }
.tip-box.danger { background: rgba(220,20,60,0.04); border-left: 3px solid var(--red); color: var(--red); }
.tip-box.info { background: rgba(0,188,212,0.04); border-left: 3px solid var(--cyan); color: var(--cyan); }
.tip-box.gold-tip { background: rgba(255,215,0,0.04); border-left: 3px solid var(--gold); color: var(--gold); }

.tip-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* ── Enum List ── */
.enum-list {
  margin: 6px 0;
  padding-left: 0;
  list-style: none;
}
.enum-list li {
  padding: 3px 0 3px 16px;
  position: relative;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.enum-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.enum-list li code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple);
  font-size: 11px;
  background: rgba(187,134,252,0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Visual box (portal guide) ── */
.visual-box {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
  position: relative;
  overflow: hidden;
}
.visual-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
}
.vb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vb-label::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.mock-input {
  background: #0d0d0d;
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text-dim);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  width: 100%;
  margin: 5px 0;
}
.mock-input.filled { color: var(--text-bright); border-color: rgba(255,69,0,0.25); }
.mock-select { @extend .mock-input; }
.mock-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 14px;
  width: 100%;
  text-align: center;
}
.mock-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  background: rgba(0,255,127,0.04);
  border: 1px solid rgba(0,255,127,0.12);
  padding: 12px 16px;
  border-radius: 10px;
  letter-spacing: 1px;
  text-align: center;
  margin: 10px 0;
}
.mock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.mock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 10px;
  margin-bottom: 2px;
}
.mock-select {
  background: #0d0d0d;
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text-dim);
  font-size: 13px;
  width: 100%;
  margin: 5px 0;
}
.mock-select.filled { color: var(--text-bright); border-color: rgba(255,69,0,0.25); }

/* ── Step list (portal guide) ── */
.step-list-doc {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  counter-reset: slist;
}
.step-list-doc li {
  counter-increment: slist;
  padding: 9px 0 9px 42px;
  position: relative;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.025);
  line-height: 1.7;
}
.step-list-doc li::before {
  content: counter(slist);
  position: absolute;
  left: 0; top: 9px;
  background: rgba(255,69,0,0.08);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}
.step-list-doc li:last-child { border-bottom: none; }
.step-list-doc li code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,69,0,0.06);
  color: var(--accent2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.step-list-doc li strong { color: var(--text-bright); }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 10px 0; }
.checklist li {
  padding: 7px 0 7px 30px;
  position: relative;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.checklist li::before { content: '✓'; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.checklist li.x::before { content: '✗'; color: var(--red); }
.checklist li strong { color: var(--text-bright); }
.checklist li code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,69,0,0.06);
  color: var(--accent2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* tier cards */
.tier-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}
.tier-card-doc {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tier-card-doc.silver { border-color: rgba(192,192,192,0.15); }
.tier-card-doc.gold { border-color: rgba(255,215,0,0.15); }
.tier-card-doc.silver::before, .tier-card-doc.gold::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.tier-card-doc.silver::before { background: linear-gradient(90deg, transparent, #C0C0C0, transparent); }
.tier-card-doc.gold::before { background: linear-gradient(90deg, transparent, #FFD700, transparent); }
.tier-card-name { font-size: 18px; font-weight: 900; letter-spacing: 3px; margin: 6px 0 4px; }
.tier-card-doc.silver .tier-card-name { color: #C0C0C0; }
.tier-card-doc.gold .tier-card-name { color: #FFD700; }
.tier-card-detail {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 6px;
}
.tier-card-detail strong { color: var(--text); }

/* tier-card aliases (standalone manuals use these names) */
.tier-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tier-card.silver { border-color: rgba(192,192,192,0.15); }
.tier-card.gold { border-color: rgba(255,215,0,0.15); }
.tier-card.silver::before, .tier-card.gold::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.tier-card.silver::before { background: linear-gradient(90deg, transparent, #C0C0C0, transparent); }
.tier-card.gold::before { background: linear-gradient(90deg, transparent, #FFD700, transparent); }
.tier-name { font-size: 20px; font-weight: 900; letter-spacing: 3px; margin: 8px 0 4px; }
.tier-card.silver .tier-name { color: #C0C0C0; }
.tier-card.gold .tier-name { color: #FFD700; }
.tier-detail {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 8px;
}
.tier-detail strong { color: var(--text); }

/* inline key tag */
.key-tag {
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
  font-size: 12px;
  background: rgba(0,255,127,0.06);
  padding: 2px 8px;
  border-radius: 5px;
}

/* path visual */
.path-visual {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 10px 0;
  line-height: 2;
}
.path-visual .arrow { color: var(--accent); margin: 0 5px; }
.path-visual .highlight { color: var(--accent2); font-weight: 600; }
.path-visual .url-highlight { color: var(--green); font-weight: 600; }

/* FAQ */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-q::before {
  content: 'Q';
  background: rgba(255,69,0,0.1);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 10px;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.faq-a {
  padding: 0 18px 14px 50px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
}
.faq-a code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent2);
  background: rgba(255,69,0,0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* ── Doc footer ── */
.doc-footer {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  margin-top: 50px;
}

/* ═══ TOAST ═══ */
.toast {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: bottom 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast.show { bottom: 30px; }
.toast.success { border-color: rgba(0,255,127,0.3); color: var(--green); }
.toast.error { border-color: rgba(220,20,60,0.3); color: var(--red); }
.toast.info { border-color: rgba(0,188,212,0.3); color: var(--cyan); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .reader-sidebar {
    transform: translateX(-100%);
  }
  .reader-sidebar.open {
    transform: translateX(0);
  }
  .reader-overlay.open {
    display: block;
  }
  .reader-content {
    margin-left: 0;
    padding: 30px 20px 80px;
  }
  .toc-fab {
    display: flex;
  }
  .toc-collapse-btn {
    display: none;
  }
  .header-doc-title {
    max-width: 140px;
    font-size: 11px;
  }
}
@media (max-width: 640px) {
  .library-grid {
    grid-template-columns: 1fr;
  }
  .login-card-inner {
    padding: 24px 20px;
  }
  .mock-grid {
    grid-template-columns: 1fr;
  }
  .tier-cards {
    grid-template-columns: 1fr;
  }
  .header-user, .logout-text {
    display: none;
  }
  .param-table {
    font-size: 12px;
  }
  .param-table td {
    padding: 7px 10px;
  }
  .doc-card-arrow {
    display: none;
  }
}

/* param table responsive */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

/* ═══ SPINNER ═══ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* selection */
::selection {
  background: rgba(255,69,0,0.2);
  color: var(--text-bright);
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── UID Auth Styles ── */
.uid-input-group { text-align: left; }
.uid-input-group label {
  display: block; font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  color: var(--text-dim); margin-bottom: .5rem; text-transform: uppercase;
}
.input-wrapper {
  position: relative; display: flex; align-items: center;
}
.input-icon-svg {
  position: absolute; left: 14px; color: var(--text-dim); pointer-events: none;
}
.input-wrapper input {
  width: 100%; padding: 14px 16px 14px 42px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; color: #fff; font-size: .95rem; font-family: 'Inter', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrapper input::placeholder { color: rgba(255,255,255,.25); }
.input-wrapper input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,69,0,.15);
}
.input-hint {
  font-size: .72rem; color: var(--text-dim); margin-top: .4rem; opacity: .7;
}
.uid-status {
  font-size: .82rem; margin-top: .6rem; min-height: 1.2em;
  transition: color .2s;
}
.uid-status.error { color: #ff4444; }
.uid-status.success { color: var(--green); }

.btn-verify {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 24px; margin-top: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 10px;
  font-size: .9rem; font-weight: 700; letter-spacing: .06em;
  cursor: pointer; transition: transform .15s, box-shadow .2s, opacity .2s;
  font-family: 'Inter', sans-serif; text-transform: uppercase;
}
.btn-verify:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,69,0,.35);
}
.btn-verify:active:not(:disabled) { transform: scale(.98); }
.btn-verify:disabled { opacity: .6; cursor: not-allowed; }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ═══ DOCUMENT COVER PAGE ═══ */
.doc-cover {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px 40px;
  position: relative;
  overflow: hidden;
  margin: -40px -40px 40px -40px;
  border-bottom: 1px solid var(--border);
}
.doc-cover__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,69,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,69,0,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}
/* gradients per doc type */
.doc-cover--ultimate {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255,69,0,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(255,69,0,0.06) 0%, transparent 50%),
    var(--bg);
}
.doc-cover--sniper {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0,188,212,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(79,195,247,0.06) 0%, transparent 50%),
    var(--bg);
}
.doc-cover--portal {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255,69,0,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255,215,0,0.06) 0%, transparent 50%),
    var(--bg);
}

.doc-cover__logo {
  font-size: 14px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 20px;
  position: relative;
}
.doc-cover--sniper .doc-cover__logo { color: var(--cyan); }

.doc-cover__title {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
  position: relative;
}
.doc-cover--ultimate .doc-cover__title {
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.doc-cover--sniper .doc-cover__title {
  background: linear-gradient(135deg, var(--cyan), var(--blue), #e0e0e0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.doc-cover--portal .doc-cover__title {
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.doc-cover__subtitle {
  font-size: clamp(14px, 2.2vw, 22px);
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 36px;
  position: relative;
}

.doc-cover__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,69,0,0.1);
  border: 1px solid rgba(255,69,0,0.2);
  border-radius: 50px;
  padding: 10px 24px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  position: relative;
}
.doc-cover--sniper .doc-cover__badge {
  background: rgba(0,188,212,0.08);
  border-color: rgba(0,188,212,0.2);
  color: var(--cyan);
}
.doc-cover--portal .doc-cover__badge {
  background: rgba(255,215,0,0.08);
  border-color: rgba(255,215,0,0.2);
  color: var(--gold);
}

.doc-cover__version {
  margin-top: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-dim);
  position: relative;
}

.doc-cover__footer {
  position: absolute;
  bottom: 30px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.5;
}

.doc-cover__scroll {
  position: absolute;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.4;
  animation: coverBounce 2s ease-in-out infinite;
}
@keyframes coverBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Responsive cover */
@media (max-width: 900px) {
  .doc-cover {
    margin: -30px -20px 30px -20px;
    min-height: 70vh;
    padding: 40px 20px 40px;
  }
}
@media (max-width: 640px) {
  .doc-cover__title { font-size: clamp(32px, 8vw, 48px); }
  .doc-cover__badge { font-size: 10px; padding: 8px 16px; }
  .doc-cover__scroll { display: none; }
}
