:root {
  --bg: #1e222b;
  --card: #252a35;
  --card2: #2d3344;
  --gold: #d4af37;
  --gold-dim: rgba(212,175,55,0.15);
  --text: #e8e8e8;
  --muted: #8a8f9e;
  --danger: #e05555;
  --success: #4caf7d;
  --radius: 14px;
  --transition: 0.2s ease;
}

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

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

/* ── SCREENS ── */
.screen { display: none; padding: 16px 16px 80px; animation: fadeIn .25s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── HEADER ── */
.header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}
.header-back {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--card); border: none; color: var(--gold);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: var(--transition);
}
.header-back:hover { background: var(--gold-dim); }
.header h2 { font-size: 17px; font-weight: 600; flex: 1; }
.header-logo { font-size: 15px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid rgba(212,175,55,0.15);
  display: flex; height: 60px; z-index: 20;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; border: none; background: none;
  color: var(--muted); cursor: pointer; font-size: 11px;
  transition: var(--transition);
}
.nav-btn.active { color: var(--gold); }
.nav-btn svg { width: 22px; height: 22px; }

/* ── PROFILE CARDS ── */
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 20px 0 10px;
}
.profile-grid { display: flex; flex-direction: column; gap: 10px; }
.profile-card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: var(--transition);
  border: 1px solid transparent; position: relative; overflow: hidden;
}
.profile-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--gold); border-radius: 3px 0 0 3px;
  opacity: 0; transition: var(--transition);
}
.profile-card:hover, .profile-card:active {
  border-color: var(--gold-dim); background: var(--card2);
}
.profile-card:hover::before { opacity: 1; }
.profile-card-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.profile-card-stats { display: flex; gap: 12px; }
.stat-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.stat-badge span { font-size: 13px; }
.profile-card-date { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* ── PROFILE PAGE TABS ── */
.profile-tabs {
  display: flex; gap: 4px; margin: 16px 0;
  background: var(--card); border-radius: 10px; padding: 4px;
}
.tab-btn {
  flex: 1; padding: 8px; border: none; background: none;
  color: var(--muted); font-size: 13px; font-weight: 500;
  border-radius: 8px; cursor: pointer; transition: var(--transition);
}
.tab-btn.active { background: var(--gold); color: #1e222b; font-weight: 700; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── FILE TIMELINE ── */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; background: var(--card); border-radius: var(--radius);
  cursor: pointer; transition: var(--transition);
}
.timeline-item:hover { background: var(--card2); }
.timeline-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gold-dim); display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex-shrink: 0;
}
.timeline-body { flex: 1; min-width: 0; }
.timeline-date { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.timeline-preview {
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.timeline-type { font-size: 11px; color: var(--gold); font-weight: 500; }

/* ── ANALYSIS BUTTONS ── */
.analysis-grid { display: flex; flex-direction: column; gap: 8px; }
.analysis-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--card);
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: var(--transition); text-align: left; width: 100%;
}
.analysis-btn:hover { border-color: var(--gold-dim); background: var(--card2); }
.analysis-btn.has-result { border-color: rgba(212,175,55,0.3); }
.analysis-btn .icon { font-size: 22px; flex-shrink: 0; }
.analysis-btn .info { flex: 1; }
.analysis-btn .info .name { font-size: 14px; font-weight: 600; color: var(--text); }
.analysis-btn .info .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.analysis-btn .arrow { color: var(--muted); font-size: 18px; }
.analysis-btn.has-result .arrow { color: var(--gold); }

/* ── ANALYSIS RESULT PAGE ── */
.result-content {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  line-height: 1.7; font-size: 14px;
}
.result-content h3 {
  color: var(--gold); font-size: 14px; font-weight: 700;
  margin: 16px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--gold-dim);
}
.result-content h3:first-child { margin-top: 0; }
.result-content p { margin-bottom: 8px; color: var(--text); }
.result-content li { margin-left: 16px; margin-bottom: 4px; }
.result-date { font-size: 11px; color: var(--muted); margin-bottom: 12px; }

.run-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; background: var(--gold);
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 15px; font-weight: 700; color: #1e222b;
  transition: var(--transition); margin-top: 16px;
}
.run-btn:hover { opacity: 0.9; }
.run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── SPINNER ── */
.spinner-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 40px 0;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--gold-dim);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-text { font-size: 14px; color: var(--muted); }

/* ── EMPTY STATE ── */
.empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 48px 16px; text-align: center;
}
.empty-icon { font-size: 48px; opacity: 0.4; }
.empty-title { font-size: 16px; font-weight: 600; }
.empty-text { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--card2); color: var(--text);
  padding: 10px 20px; border-radius: 20px; font-size: 13px;
  opacity: 0; transition: all .3s; z-index: 100; white-space: nowrap;
  border: 1px solid var(--gold-dim);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── FILE DETAIL ── */
.file-detail-text {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; font-size: 13px; line-height: 1.7;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}
.detail-meta { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.meta-chip {
  padding: 4px 10px; border-radius: 20px; font-size: 11px;
  background: var(--gold-dim); color: var(--gold); font-weight: 500;
}
.delete-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px; background: rgba(224,85,85,0.1);
  border: 1px solid rgba(224,85,85,0.3); border-radius: var(--radius);
  cursor: pointer; font-size: 14px; color: var(--danger); margin-top: 12px;
  transition: var(--transition);
}
.delete-btn:hover { background: rgba(224,85,85,0.2); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 4px; }
