/* ═══════════════════════════════════════════════════
   NORMASHIELD OPERATOR DASHBOARD
   Design: Forensic Record v3.0
   ════════════════════════════════════════════════════ */
:root {
  --bg-dark:    #0c0c09;
  --bg-sidebar: #0f0f0c;
  --bg-card:    #1a1b16;
  --bg-input:   #131310;
  --border:     rgba(230,220,170,0.07);
  --border-hi:  rgba(230,220,170,0.13);

  --text:   #e8e4d9;
  --muted:  #6a6655;
  --muted2: #8a8670;

  --primary:  #3d7a56;
  --accent:   #4a7fa3;
  --amber:    #c4901f;
  --red:      #9e3025;
  --blue:     #4a7fa3;
  --indigo:   #4a7fa3;

  --gold:     #c4901f;
  --gold-hi:  #e0a830;
  --gold-pale:rgba(196,144,31,0.10);
  --steel:    #4a7fa3;
  --steel-hi: #6b9fc4;

  --primary-glow: rgba(61,122,86,0.15);
  --accent-glow:  rgba(74,127,163,0.12);

  --r-lg: 6px;
  --r-md: 4px;
  --r-sm: 3px;

  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

/* Firefox scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  font-size: 0.9rem;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Touch targets */
button, a, [onclick], label { touch-action: manipulation; }
input, textarea, select { -webkit-appearance: none; appearance: none; }

/* Focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* iOS safe area */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  @media (max-width: 480px) {
    .sidebar-nav {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(56px + env(safe-area-inset-bottom));
    }
    .panel { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  }
}

h1, h2, h3 { color: #fff; font-weight: 600; line-height: 1.2; }
a { color: var(--primary); text-decoration: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════ LAYOUT ════════ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ════════ SIDEBAR ════════ */
.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: width 0.2s ease;
}

.sidebar-header {
  padding: 1.75rem 1.5rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header svg { width: 28px; height: 28px; }
.sidebar-logo-link { line-height: 0; display: flex; align-items: center; flex-shrink: 0; }
.sidebar-title {
  font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(90deg, #fff, #6ee7b7);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-subtitle {
  font-size: 0.72rem; color: var(--primary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; color: var(--muted2);
  border-radius: var(--r-md); font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative; cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item span { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(16,185,129,0.12); color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--primary); border-radius: 0 3px 3px 0;
}

/* sidebar-footer removed - content moved to topbar */

.token-display {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-md);
  padding: 0.65rem 1rem;
  display: flex; align-items: center; gap: 8px;
}
.token-display svg { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.token-display-label { font-size: 0.75rem; color: var(--muted2); }
.token-display-value { font-family: var(--mono); font-size: 1rem; font-weight: 700; color: var(--primary); margin-left: auto; }
.token-display.low {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.22);
}
.token-display.low svg,
.token-display.low .token-display-value {
  color: var(--amber);
}
.token-display-value.empty { color: var(--red); }

.user-info { display: flex; flex-direction: column; gap: 3px; }
#currentUser { font-weight: 600; color: #fff; font-size: 0.92rem; }

.btn-text {
  background: transparent; color: var(--muted2);
  font-weight: 500; font-family: var(--font); border: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 0; font-size: 0.9rem;
  transition: color 0.15s;
}
.btn-text:hover { color: #fff; }
.btn-text svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ════════ TOPBAR ════════ */
.topbar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 1rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10,15,22,0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  margin-right: auto;
  color: var(--muted2); font-size: 0.88rem;
}

.topbar-user #currentUser { font-weight: 600; color: #fff; }

.topbar .token-display {
  padding: 0.4rem 0.85rem;
}

/* ════════ MAIN ════════ */
.main-content {
  flex: 1; overflow-y: auto;
  background: radial-gradient(ellipse at 70% 0%, rgba(16,185,129,0.06) 0%, var(--bg-dark) 55%);
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.panel { padding: 2.5rem; }

/* ════════ PANELS ════════ */
.panel { display: none; animation: fadeUp 0.3s ease forwards; }
.panel.active { display: block; }
.panel-header { margin-bottom: 2rem; }
.panel-header h1 { font-size: 1.75rem; margin-bottom: 0.3rem; }
.panel-header p { color: var(--muted2); font-size: 0.9rem; }
.flex-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* ════════ KPI CARDS ════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  transition: transform 0.2s, border-color 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-hi); }

.kpi-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.green  { background: rgba(16,185,129,0.15); color: #34d399; }
.kpi-icon.amber  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.kpi-icon.blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.kpi-icon.cyan   { background: rgba(6,182,212,0.15);  color: #22d3ee; }

.kpi-label { font-size: 0.78rem; color: var(--muted2); font-weight: 500; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.kpi-value { font-size: 1.9rem; font-weight: 700; color: #fff; line-height: 1; }
.kpi-value.low { color: var(--amber); }
.kpi-value.warn { color: var(--red); }

.low-tokens-box {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-lg);
  border: 1px solid rgba(245,158,11,0.24);
  background: rgba(245,158,11,0.08);
}
.low-tokens-box svg {
  width: 28px;
  height: 28px;
  color: var(--amber);
  flex-shrink: 0;
}
.low-tokens-box h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.low-tokens-box p {
  color: var(--muted2);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ════════ QUICK ACTIONS ════════ */
.quick-actions { margin-bottom: 2rem; }
.qa-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; margin-bottom: 0.85rem; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

.qa-btn {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.1rem 1.25rem;
  text-align: left; color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer; text-decoration: none;
}
.qa-btn:hover { transform: translateY(-2px); color: var(--text); }

.qa-btn-url:hover   { border-color: rgba(6,182,212,0.5);   background: rgba(6,182,212,0.05); }
.qa-btn-photo:hover { border-color: rgba(16,185,129,0.5);  background: rgba(16,185,129,0.05); }
.qa-btn-file:hover  { border-color: rgba(245,158,11,0.5);  background: rgba(245,158,11,0.05); }

.qa-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.qa-icon svg { width: 20px; height: 20px; }
.qa-btn-url   .qa-icon { background: rgba(6,182,212,0.15);   color: #22d3ee; }
.qa-btn-photo .qa-icon { background: rgba(16,185,129,0.15);  color: #34d399; }
.qa-btn-file  .qa-icon { background: rgba(245,158,11,0.15);  color: #fbbf24; }

.qa-text { flex: 1; }
.qa-text strong { display: block; font-size: 0.92rem; color: #fff; font-weight: 600; margin-bottom: 2px; }
.qa-text span   { font-size: 0.80rem; color: var(--muted2); }
.qa-arrow { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }

/* ════════ CHARTS ════════ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
}
.chart-card h3 { font-size: 0.95rem; margin-bottom: 1.25rem; color: var(--muted2); font-weight: 600; }
.chart-container { height: 250px; }

/* ════════ RECENT LIST ════════ */
.recent-list { display: flex; flex-direction: column; gap: 0.5rem; }

.recent-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }

.recent-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.recent-icon svg { width: 16px; height: 16px; }
.recent-icon.url         { background: rgba(6,182,212,0.12);   color: #22d3ee; }
.recent-icon.camera      { background: rgba(16,185,129,0.12);  color: #34d399; }
.recent-icon.file        { background: rgba(245,158,11,0.12);  color: #fbbf24; }
.recent-icon.onion       { background: rgba(139,92,246,0.12);  color: #c4b5fd; }
.recent-icon.social      { background: rgba(236,72,153,0.12);  color: #f9a8d4; }
.recent-icon.email       { background: rgba(20,184,166,0.12);  color: #5eead4; }
.recent-icon.ai          { background: rgba(99,102,241,0.12);  color: #a5b4fc; }
.recent-icon.log         { background: rgba(234,88,12,0.12);   color: #fdba74; }

.recent-info { flex: 1; min-width: 0; }
.recent-label { font-size: 0.85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-date  { font-size: 0.76rem; color: var(--muted2); margin-top: 2px; }

.btn-sm {
  padding: 4px 10px; border-radius: var(--r-sm); font-size: 0.78rem; font-weight: 600;
  background: rgba(16,185,129,0.1); color: var(--primary);
  border: 1px solid rgba(16,185,129,0.2);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-sm:hover { background: var(--primary); color: #fff; }

.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted2); font-size: 0.88rem;
}

/* ════════ FILTER BAR ════════ */
.filter-bar {
  margin-bottom: 1.25rem;
  display: flex; gap: 0.85rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.search-input {
  width: 100%; max-width: 380px;
  padding: 9px 14px;
  background: var(--bg-input); border: 1px solid var(--border-hi);
  border-radius: var(--r-md); color: #fff; font-size: 0.88rem; font-family: var(--font);
}
.search-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-input::placeholder { color: var(--muted); }

/* ════════ TABLE ════════ */
.table-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.data-table th {
  color: var(--muted); font-weight: 600; font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(0,0,0,0.15);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.td-mono    { font-family: var(--mono); font-size: 0.82rem; color: var(--muted2); }
.td-muted   { color: var(--muted); }
.td-details { font-family: var(--mono); font-size: 0.79rem; color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-empty   { text-align: center; padding: 2.5rem !important; color: var(--muted2); }

/* ── Checkbox selezione log ── */
.log-cb-cell { width: 36px; padding: 0 8px !important; text-align: center; }
.log-cb-cell input[type="checkbox"],
thead input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--primary);
}
.btn-danger-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px; border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.1); color: #f87171;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-danger-sm:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.55); }

/* ── Righe espandibili ── */
.log-expandable-row { cursor: pointer; transition: background 0.15s; }
.log-expandable-row:hover { background: rgba(255,255,255,0.025) !important; }
.log-expandable-row.log-row-open { background: rgba(99,102,241,0.07) !important; }

.log-expand-cell {
  text-align: center;
  padding: 0 6px !important;
  width: 28px;
  color: var(--muted);
}
.log-expand-chevron {
  width: 15px; height: 15px;
  transition: transform 0.2s ease;
  display: inline-block; vertical-align: middle;
  opacity: 0.5;
}
.log-expandable-row:hover .log-expand-chevron { opacity: 1; }
.log-expandable-row.log-row-open .log-expand-chevron { transform: rotate(180deg); opacity: 1; }

.log-detail-row { display: none; }
.log-detail-row.log-detail-open { display: table-row; }

.log-detail-cell {
  padding: 0 !important;
  background: rgba(10, 12, 20, 0.55) !important;
  border-top: none !important;
}
.log-detail-inner {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  animation: logDetailExpand 0.18s ease;
}
@keyframes logDetailExpand {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.log-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 20px;
}
.log-detail-field { display: flex; flex-direction: column; gap: 3px; }
.log-detail-label {
  font-size: 0.68rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.log-detail-value {
  font-size: 0.82rem; color: var(--text2, #cbd5e1);
  font-family: var(--mono); word-break: break-all; line-height: 1.4;
}
.log-detail-value.muted { color: var(--muted2); }
.log-detail-full { grid-column: 1 / -1; }
.log-detail-section-title {
  font-size: 0.72rem; font-weight: 700; color: var(--indigo, #818cf8);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px;
  grid-column: 1 / -1;
}

.acq-label {
  max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem;
}

.row-actions { display: flex; gap: 6px; align-items: center; }

/* ════════ BADGES ════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 10px;
  font-size: 0.74rem; font-weight: 600;
  background: rgba(16,185,129,0.15); color: #6ee7b7;
  width: fit-content;
}

.badge-action {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 10px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-red   { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.badge-blue  { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-cyan   { background: rgba(6,182,212,0.15);   color: #67e8f9; }
.badge-amber  { background: rgba(245,158,11,0.15);  color: #fcd34d; }
.badge-violet { background: rgba(139,92,246,0.15);  color: #c4b5fd; }
.badge-pink   { background: rgba(236,72,153,0.15);  color: #f9a8d4; }
.badge-teal   { background: rgba(20,184,166,0.15);  color: #5eead4; }
.badge-indigo { background: rgba(99,102,241,0.15);  color: #a5b4fc; }
.badge-orange { background: rgba(234,88,12,0.15);   color: #fdba74; }
.badge-muted  { background: rgba(255,255,255,0.07); color: var(--muted2); }

/* ════════ BUTTONS ════════ */
button { cursor: pointer; font-family: var(--font); border: none; transition: all 0.18s ease; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; padding: 9px 20px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 0.88rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }
.btn-primary:active { transform: translateY(0); }

.btn-download {
  background: rgba(16,185,129,0.1); color: var(--primary);
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600;
  border: 1px solid rgba(16,185,129,0.2); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.18s ease;
}
.btn-download:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-danger {
  background: rgba(239,68,68,0.1); color: var(--red);
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600;
  border: 1px solid transparent;
}
.btn-danger:hover { background: var(--red); color: #fff; }

/* ════════ UTILITIES ════════ */
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }

/* ════════ ACQUISITION TYPE CARDS ════════ */
.acq-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.acq-type-card {
  display: flex; align-items: flex-start; gap: 1.1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  text-align: left; color: var(--text);
  cursor: pointer; font-family: var(--font);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  position: relative; overflow: hidden;
}
.acq-type-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity 0.2s;
}
.acq-type-card:hover { transform: translateY(-3px); }

.acq-type-url::before    { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.acq-type-photo::before  { background: linear-gradient(90deg, #10b981, #059669); }
.acq-type-file::before   { background: linear-gradient(90deg, #f59e0b, #d97706); }
.acq-type-onion::before  { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.acq-type-social::before { background: linear-gradient(90deg, #ec4899, #be185d); }

.acq-type-url:hover    { border-color: rgba(6,182,212,0.4);   background: rgba(6,182,212,0.04); }
.acq-type-photo:hover  { border-color: rgba(16,185,129,0.4);  background: rgba(16,185,129,0.04); }
.acq-type-file:hover   { border-color: rgba(245,158,11,0.4);  background: rgba(245,158,11,0.04); }
.acq-type-onion:hover  { border-color: rgba(139,92,246,0.4);  background: rgba(139,92,246,0.04); }
.acq-type-social:hover { border-color: rgba(236,72,153,0.4);  background: rgba(236,72,153,0.04); }

.acq-type-url:hover::before,
.acq-type-photo:hover::before,
.acq-type-file:hover::before,
.acq-type-onion:hover::before,
.acq-type-social:hover::before { opacity: 1; }

.acq-type-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.acq-type-icon svg { width: 24px; height: 24px; }

.acq-type-url    .acq-type-icon { background: rgba(6,182,212,0.12);  color: #22d3ee; }
.acq-type-photo  .acq-type-icon { background: rgba(16,185,129,0.12); color: #34d399; }
.acq-type-file   .acq-type-icon { background: rgba(245,158,11,0.12); color: #fbbf24; }
.acq-type-onion  .acq-type-icon { background: rgba(139,92,246,0.12); color: #a78bfa; }
.acq-type-social .acq-type-icon { background: rgba(236,72,153,0.12); color: #f472b6; }

.acq-type-body { flex: 1; min-width: 0; }
.acq-type-num  { font-size: 0.68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.acq-type-title { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.acq-type-desc  { font-size: 0.82rem; color: var(--muted2); line-height: 1.55; margin-bottom: 0.85rem; }
.acq-type-tags  { display: flex; flex-wrap: wrap; gap: 6px; }
.acq-type-tags span {
  font-size: 0.71rem; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--muted2); border: 1px solid var(--border);
}
.acq-type-arrow { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; margin-top: 4px; }
.acq-type-arrow svg { width: 20px; height: 20px; }

/* ════════ NO TOKENS BOX ════════ */
.no-tokens-box {
  text-align: center; padding: 2.5rem; margin-bottom: 1.5rem;
  background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--r-lg);
}
.no-tokens-box h3 { font-size: 1.1rem; margin: 0.75rem 0 0.4rem; }
.no-tokens-box p  { color: var(--muted2); font-size: 0.88rem; }

/* ════════ ACQUISITION MODAL ════════ */
.acq-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.acq-overlay.open { opacity: 1; pointer-events: all; }

.acq-modal {
  position: relative;
  background: #0d1622; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 2.5rem;
  width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform 0.25s;
}
.acq-overlay.open .acq-modal { transform: translateY(0); }
.acq-modal.modal-wide { max-width: 1040px; }

.acq-modal-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-family: var(--font);
}
.acq-modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.acq-modal-close svg { width: 16px; height: 16px; }

/* ════════ MODAL FORM STYLES ════════ */
.modal-title   { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 0.4rem; }
.modal-subtitle { font-size: 0.88rem; color: var(--muted); margin-bottom: 2rem; }

.form-group { margin-bottom: 1.25rem; }
.case-form-block {
  margin-bottom: 1.4rem; padding: 1rem 1rem 0.15rem;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  background: rgba(255,255,255,0.03);
}
.case-form-header { margin-bottom: 0.9rem; }
.case-form-title  { margin: 0 0 0.3rem; font-size: 0.9rem; font-weight: 700; color: #fff; }
.case-form-subtitle { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.55; }
.case-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.case-form-full { grid-column: 1 / -1; }

.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 0.5rem;
}
.form-input {
  width: 100%; padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #fff; font-family: var(--font); font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-input:focus {
  border-color: rgba(16,185,129,0.5);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.form-input::placeholder { color: rgba(136,146,164,0.5); }
.form-textarea { min-height: 92px; resize: vertical; line-height: 1.55; }

/* modal buttons */
.acq-modal .btn-primary {
  width: 100%; padding: 0.9rem; border-radius: 12px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 700; color: #fff;
  transition: opacity 0.2s, transform 0.1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font);
}
.acq-modal .btn-primary:hover { opacity: 0.9; }
.acq-modal .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.acq-modal .btn-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.acq-modal .btn-green  { background: linear-gradient(135deg, #10b981, #059669); }
.acq-modal .btn-amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.acq-modal .btn-onion  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.acq-modal .btn-social { background: linear-gradient(135deg, #ec4899, #be185d); }

/* ════════ PROGRESS BAR ════════ */
.progress-wrap {
  display: none; margin-top: 1.5rem;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 1.25rem;
}
.progress-label {
  font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 8px;
}
.progress-bar-track {
  height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s ease; width: 0%;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(16,185,129,0.2); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════ RESULT BOX ════════ */
.result-box {
  display: none; margin-top: 1.5rem;
  background: rgba(16,185,129,0.05); border: 1px solid rgba(16,185,129,0.2);
  border-radius: 12px; padding: 1.5rem;
}
.result-box.error {
  background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2);
}
.result-title {
  font-size: 0.9rem; font-weight: 700; color: #6ee7b7; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 6px;
}
.result-box.error .result-title { color: #fca5a5; }
.result-download {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 1rem; padding: 0.6rem 1.25rem;
  background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3);
  border-radius: 8px; color: #6ee7b7; font-size: 0.85rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s;
}
.result-download:hover { background: rgba(16,185,129,0.25); }
.result-download svg { width: 15px; height: 15px; }
.result-primary-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.result-primary-actions .result-download { margin-top: 0; }
.result-download-secondary {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #e5e7eb;
}
.result-download-secondary:hover {
  background: rgba(255,255,255,0.1);
}
/* ════════ URL RESULT SECTIONS ════════ */
.url-result-section { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.url-result-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.url-section-title { font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 0.9rem; }
.url-section-note  { margin-top: 0.85rem; color: var(--muted); font-size: 0.82rem; line-height: 1.7; }

.url-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.url-summary-card {
  display: flex; flex-direction: column; gap: 0.28rem;
  padding: 0.95rem 1rem; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03);
}
.url-summary-card-wide { grid-column: 1 / -1; }
.url-card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.url-card-value { color: #fff; font-size: 0.86rem; font-family: var(--mono); word-break: break-word; }

.url-preview-shell { border-radius: 16px; overflow: hidden; border: 1px solid rgba(59,130,246,0.18); background: rgba(255,255,255,0.03); }
.url-preview-image { display: block; width: 100%; height: auto; }

.url-inline-links, .url-result-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.url-inline-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.55rem 0.95rem; border-radius: 999px;
  border: 1px solid rgba(59,130,246,0.22); background: rgba(59,130,246,0.08);
  color: #bfdbfe; text-decoration: none; font-size: 0.82rem; font-weight: 600;
  transition: all 0.2s;
}
.url-inline-link:hover { color: #fff; border-color: rgba(59,130,246,0.4); background: rgba(59,130,246,0.16); }
.url-inline-link-strong { border-color: rgba(16,185,129,0.26); background: rgba(16,185,129,0.1); color: #86efac; }
.url-inline-link-strong:hover { border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.18); }

.url-table-wrap {
  overflow-x: auto; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; background: rgba(255,255,255,0.02);
}
.url-data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.url-data-table th, .url-data-table td {
  padding: 0.75rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left; vertical-align: top;
}
.url-data-table tr:last-child td { border-bottom: none; }
.url-data-table th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.url-data-table td { color: #fff; font-size: 0.8rem; }

.url-host-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.url-host-card { padding: 0.95rem 1rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); }
.url-host-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; }
.url-host-name  { color: #fff; font-size: 0.86rem; font-weight: 700; word-break: break-all; }
.url-host-badge { flex-shrink: 0; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700; color: #93c5fd; background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.16); }
.url-host-meta  { color: var(--muted); font-size: 0.79rem; line-height: 1.65; }
.url-file-link  { color: #bfdbfe; text-decoration: none; }
.url-file-link:hover { color: #fff; text-decoration: underline; }

/* Camera */
#cameraPreview {
  width: 100%; border-radius: 12px; overflow: hidden;
  background: #000; aspect-ratio: 16/9; display: none; margin-bottom: 1rem;
}
#cameraPreview video { width: 100%; height: 100%; object-fit: cover; }
#capturedCanvas { display: none; width: 100%; border-radius: 12px; margin-bottom: 1rem; }

/* Drop zone */
.drop-zone {
  border: 2px dashed rgba(255,255,255,0.12); border-radius: 12px;
  padding: 2.5rem; text-align: center; cursor: pointer;
  transition: all 0.2s; margin-bottom: 1.25rem;
}
.drop-zone:hover, .drop-zone.dragover { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.03); }
.drop-zone svg { width: 40px; height: 40px; color: var(--muted); margin-bottom: 0.75rem; }
.drop-zone p { color: var(--muted); font-size: 0.88rem; }
.drop-zone p strong { color: #fff; }
.drop-zone .file-selected { color: var(--amber); font-weight: 600; margin-top: 0.5rem; font-size: 0.85rem; }
#fileInput { display: none; }

.history-modal-loading { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.9rem; }

.local-storage-notice {
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text);
  line-height: 1.6;
  font-size: 0.9rem;
}

.local-storage-notice strong {
  color: #f59e0b;
}

/* ════════ GUIDE PANEL ════════ */
.guide-intro {
  display: flex; gap: 1rem; align-items: flex-start;
  background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.18);
  border-radius: var(--r-lg); padding: 1.1rem 1.25rem; margin-bottom: 1rem;
  text-align: left;
}
.guide-intro-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(16,185,129,0.15); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.guide-intro-icon svg { width: 20px; height: 20px; }
.guide-intro h3 { font-size: 0.95rem; margin-bottom: 0.3rem; text-align: left; }
.guide-intro p { color: var(--muted2); font-size: 0.85rem; line-height: 1.55; margin: 0; text-align: left; }
.guide-intro p strong { color: #fff; }

.guide-notice {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.22);
  border-radius: var(--r-md); padding: 0.85rem 1rem; margin-bottom: 1.5rem;
  font-size: 0.85rem; color: var(--muted2); line-height: 1.55; text-align: left;
}
.guide-notice svg { width: 16px; height: 16px; color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.guide-notice p { margin: 0; text-align: left; }
.guide-notice p strong { color: #fff; }

/* -- Tool cards -- */
.guide-tool {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 1.25rem; overflow: hidden;
  text-align: left;
}
.guide-tool-flat { border-color: var(--border); }

.guide-tool-header {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.guide-header-blue   { background: rgba(59,130,246,0.08); }
.guide-header-green  { background: rgba(16,185,129,0.08); }
.guide-header-amber  { background: rgba(245,158,11,0.08); }
.guide-header-purple { background: rgba(139,92,246,0.08); }
.guide-header-gray   { background: rgba(255,255,255,0.03); }

.guide-tool-badge {
  font-family: var(--mono); font-size: 1.25rem; font-weight: 700;
  opacity: 0.22; flex-shrink: 0; min-width: 1.75rem;
}
.guide-tool-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.guide-tool-icon svg { width: 19px; height: 19px; }
.guide-header-blue   .guide-tool-icon { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.guide-header-green  .guide-tool-icon { background: rgba(16,185,129,0.15);  color: #34d399; }
.guide-header-amber  .guide-tool-icon { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.guide-header-purple .guide-tool-icon { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.guide-header-gray   .guide-tool-icon { background: rgba(255,255,255,0.06); color: var(--muted2); }

.guide-tool-header h2 { font-size: 1rem; margin-bottom: 0.15rem; text-align: left; }
.guide-tool-header p  { font-size: 0.8rem; color: var(--muted2); margin: 0; text-align: left; }

.guide-tool-body { padding: 1.25rem; }

/* -- Two-column layout -- */
.guide-col-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem;
}
.guide-col { display: flex; flex-direction: column; text-align: left; }
.guide-col p { font-size: 0.85rem; color: var(--muted2); line-height: 1.6; margin-bottom: 0.6rem; text-align: left; }
.guide-col p strong { color: #fff; }
.guide-col code {
  font-family: var(--mono); font-size: 0.78rem;
  background: rgba(255,255,255,0.08); border-radius: 4px; padding: 1px 5px;
}

.guide-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.6rem; text-align: left;
}

/* -- List -- */
.guide-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.4rem;
  font-size: 0.85rem; color: var(--muted2); line-height: 1.5; text-align: left;
}
.guide-list li { display: flex; gap: 0.5rem; align-items: flex-start; }
.guide-list li > span { flex: 1; min-width: 0; }
.guide-list li::before {
  content: '-'; color: var(--primary); font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}
.guide-list li strong { color: #fff; }

/* -- Steps -- */
.guide-steps {
  list-style: none; display: flex; flex-direction: column; gap: 0.65rem;
  font-size: 0.85rem; text-align: left;
}
.guide-steps li { display: flex; gap: 0.7rem; align-items: flex-start; }
.guide-step-num {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border-hi);
  font-size: 0.72rem; font-weight: 700; color: var(--muted2);
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.guide-steps li div { color: var(--muted2); line-height: 1.55; text-align: left; }
.guide-steps li div strong { color: #fff; }
.guide-steps li div code {
  font-family: var(--mono); font-size: 0.76rem;
  background: rgba(255,255,255,0.08); border-radius: 4px; padding: 1px 5px;
}

/* -- File tree -- */
.guide-file-tree {
  background: rgba(0,0,0,0.2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0.65rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-bottom: 1rem; text-align: left;
}
.guide-file { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted2); }
.guide-file code {
  font-family: var(--mono); font-size: 0.75rem; color: #93c5fd;
  background: transparent; padding: 0;
}
.guide-file-icon { font-size: 0.85rem; }

/* -- Formats grid -- */
.guide-formats-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; text-align: left; }
.guide-format-group { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.guide-format-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); min-width: 85px;
}
.guide-format-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.guide-format-tags span {
  font-size: 0.7rem; font-weight: 600; font-family: var(--mono);
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-hi);
  color: var(--muted2);
}

/* -- Tip box -- */
.guide-tip {
  display: flex; gap: 0.65rem; align-items: flex-start;
  background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-md); padding: 0.85rem 1rem;
  font-size: 0.82rem; color: var(--muted2); line-height: 1.55;
  margin-top: auto; text-align: left;
}
.guide-tip svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.guide-tip p { margin: 0; text-align: left; }
.guide-tip p strong { color: #fff; }
.guide-tip code {
  font-family: var(--mono); font-size: 0.76rem;
  background: rgba(255,255,255,0.08); border-radius: 4px; padding: 1px 5px;
}

.guide-tip-purple {
  background: rgba(139,92,246,0.07); border-color: rgba(139,92,246,0.22);
}
.guide-tip-purple svg { color: #a78bfa; }
.guide-tip-pink {
  background: rgba(236,72,153,0.07); border-color: rgba(236,72,153,0.22);
}
.guide-tip-pink svg { color: #f472b6; }

/* ════════ ACCORDION GUIDE ════════ */
#panel-guide { text-align: left; }
.guide-accordion {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.guide-accordion:last-child { margin-bottom: 0; }

.guide-acc-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.guide-acc-blue   { background: rgba(59,130,246,0.07); }
.guide-acc-green  { background: rgba(16,185,129,0.07); }
.guide-acc-amber  { background: rgba(245,158,11,0.07); }
.guide-acc-purple { background: rgba(139,92,246,0.07); }
.guide-acc-pink   { background: rgba(236,72,153,0.07); }
.guide-acc-gray   { background: rgba(255,255,255,0.03); }
.guide-acc-cyan   { background: rgba(6,182,212,0.07); }
.guide-acc-teal   { background: rgba(13,122,138,0.07); }
.guide-acc-indigo { background: rgba(99,102,241,0.07); }
.guide-acc-orange { background: rgba(234,88,12,0.07);  }

.guide-acc-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.guide-acc-num {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--muted2);
  min-width: 22px;
}
.guide-acc-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.guide-acc-icon svg { width: 18px; height: 18px; }
.guide-acc-blue   .guide-acc-icon { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.guide-acc-green  .guide-acc-icon { background: rgba(16,185,129,0.15);  color: #34d399; }
.guide-acc-amber  .guide-acc-icon { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.guide-acc-purple .guide-acc-icon { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.guide-acc-pink   .guide-acc-icon { background: rgba(236,72,153,0.15);  color: #f472b6; }
.guide-acc-gray   .guide-acc-icon { background: rgba(255,255,255,0.06); color: var(--muted2); }
.guide-acc-cyan   .guide-acc-icon { background: rgba(6,182,212,0.15);   color: #22d3ee; }
.guide-acc-teal   .guide-acc-icon { background: rgba(13,122,138,0.15);  color: #14b8c8; }
.guide-acc-indigo .guide-acc-icon { background: rgba(99,102,241,0.15);  color: #a5b4fc; }
.guide-acc-orange .guide-acc-icon { background: rgba(234,88,12,0.15);   color: #fdba74; }

.guide-acc-meta h2 { font-size: 0.95rem; margin: 0 0 0.1rem; text-align: left; }
.guide-acc-meta p  { font-size: 0.78rem; color: var(--muted2); margin: 0; text-align: left; line-height: 1.45; }

.guide-acc-sections { padding: 0; }

.guide-sub {
  border-bottom: 1px solid var(--border);
}
.guide-sub:last-child { border-bottom: none; }

.guide-sub-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  text-align: left;
}
.guide-sub-title::-webkit-details-marker { display: none; }
.guide-sub-title::after {
  content: '›';
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted2);
  display: inline-block;
  transition: transform 0.2s ease;
}
details[open] > .guide-sub-title::after {
  transform: rotate(90deg);
}
.guide-sub-title:hover { background: rgba(255,255,255,0.03); }

.guide-sub-body {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
}
.guide-sub-body .guide-list      { margin-bottom: 0.75rem; }
.guide-sub-body .guide-steps     { margin-bottom: 0.75rem; }
.guide-sub-body .guide-tip       { margin-top: 0.75rem; }
.guide-sub-body .guide-tip-purple{ margin-top: 0.75rem; }
.guide-sub-body p {
  font-size: 0.84rem;
  color: var(--muted2);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  text-align: left;
}
.guide-sub-body p:last-child { margin-bottom: 0; }
.guide-sub-body p strong { color: #fff; }

/* ════════ RESPONSIVE ════════ */

/* ── ≤ 1100px - Guide layout ── */
@media (max-width: 1100px) {
  .guide-col-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .panel { padding: 2rem 1.75rem; }
}

/* ── ≤ 900px - Tablet: icon-only sidebar ── */
@media (max-width: 900px) {
  .sidebar { width: 64px; flex-shrink: 0; }
  .sidebar-title, .sidebar-subtitle, .nav-item span { display: none; }
  .sidebar-header { padding: 1.25rem 0; justify-content: center; }
  .sidebar-logo-link { margin: 0 auto; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item.active::before { display: none; }
  .nav-item.active { background: rgba(16,185,129,0.15); }
  .sidebar-nav { padding: 1rem 0.5rem; gap: 6px; }

  .topbar { padding: 0.65rem 1rem; gap: 0.65rem; }
  .topbar .btn-text span,
  .topbar .token-display-label,
  .topbar-user #currentRole { display: none; }
  .topbar .token-display { padding: 0.35rem 0.65rem; }

  .panel { padding: 1.5rem 1.25rem; }
  .panel-header.flex-between { flex-direction: column; align-items: flex-start; }
  .panel-header h1 { font-size: 1.5rem; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-wrap: wrap; gap: 0.65rem; }
  .search-input { max-width: 280px; }

  /* Acq-type cards: 2 columns */
  .acq-type-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── ≤ 768px - Tablet portrait / large phone ── */
@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .nav-item { padding: 10px; }

  .topbar { padding: 0.6rem 0.85rem; }
  .topbar-user { display: none; }

  .panel { padding: 1.25rem 1rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .qa-grid { grid-template-columns: 1fr; }

  /* Table horizontal scroll */
  .table-container { border-radius: var(--r-md); }
  .data-table { min-width: 500px; }

  .filter-bar { align-items: stretch; }
  .search-input { max-width: none; width: 100%; }

  /* Acq modal on mobile */
  .acq-overlay { padding: 0; align-items: flex-end; }
  .acq-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 95dvh;
    max-height: 95vh;
    padding: 1.75rem 1.25rem 2rem;
  }
  .acq-modal.modal-wide {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
  }
}

/* ── ≤ 600px - Mobile ── */
@media (max-width: 600px) {
  .sidebar { width: 52px; }
  .nav-item { padding: 9px 8px; }
  .sidebar-header { padding: 1rem 0; }

  .topbar { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .topbar .token-display { display: none; } /* too cramped */

  .panel { padding: 1rem 0.875rem; }
  .panel-header h1 { font-size: 1.3rem; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .kpi-card { padding: 1rem; gap: 0.75rem; }
  .kpi-icon { width: 40px; height: 40px; border-radius: 10px; }
  .kpi-value { font-size: 1.6rem; }

  .qa-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-input { max-width: none; }

  .acq-type-grid { grid-template-columns: 1fr; }

  .flex-between { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .flex-between .btn-primary,
  .flex-between .btn-primary-op { width: 100%; justify-content: center; }
}

/* ── ≤ 480px - Small mobile ── */
@media (max-width: 480px) {
  .sidebar { width: 0; overflow: hidden; border-right: none; }
  .main-content { width: 100%; }
  .dashboard-layout { flex-direction: column; }

  /* Floating bottom navigation to replace sidebar */
  .sidebar-nav {
    display: flex; flex-direction: row; flex-wrap: nowrap;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    width: 100%; padding: 0;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    border-right: none;
    height: 56px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar-header { display: none; }
  .nav-item {
    flex: 1; min-width: 52px; max-width: 72px;
    flex-direction: column; gap: 3px;
    padding: 6px 4px 4px;
    border-radius: 0;
    justify-content: center;
    align-items: center;
  }
  .nav-item span {
    display: block !important;
    font-size: 0.58rem;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 64px;
  }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.active::before { display: none; }
  .nav-item.active {
    background: rgba(16,185,129,0.12);
    border-top: 2px solid var(--primary);
    padding-top: 4px;
  }

  /* Topbar: take full width */
  .topbar { padding: 0.5rem 0.875rem; }
  .topbar-user { display: flex; }

  /* Add bottom padding to content so it's not hidden by bottom nav */
  .panel { padding: 1rem 0.875rem 5rem; }
  .main-content { padding-bottom: 0; }

  /* KPI grid: 2x2 */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
  .kpi-card { padding: 0.85rem; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .kpi-icon { width: 36px; height: 36px; }
  .kpi-value { font-size: 1.5rem; }

  /* Full modal on tiny screens */
  .acq-modal { padding: 1.25rem 1rem 1.5rem; }
  .panel-header h1 { font-size: 1.2rem; }

  /* Table: min-width for scroll */
  .data-table { min-width: 450px; }
  .data-table th, .data-table td { padding: 0.65rem 0.85rem; }
}

/* ── ≤ 380px - Tiny phones ── */
@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .nav-item { min-width: 44px; }
  .nav-item span { display: none !important; }
  .topbar { padding: 0.45rem 0.75rem; }
}

/* ════════ BADGE ════════ */
.badge-required {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: rgba(16,185,129,0.15);
  color: var(--primary);
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ════════ 2FA PANEL ════════ */
.guide-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.btn-primary-op {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
}
.btn-primary-op:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary-op:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-danger-op {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: rgba(239,68,68,0.12);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-danger-op:hover { background: rgba(239,68,68,0.22); border-color: rgba(239,68,68,0.6); }
.btn-danger-op:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: transparent;
  color: var(--muted2);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.error-text {
  color: var(--red);
  font-size: 0.82rem;
  min-height: 1.2em;
}

/* ════════ IDLE TIMEOUT MODAL ════════ */
.idle-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.idle-overlay.open { opacity: 1; pointer-events: all; }

.idle-modal {
  background: #0d1622; border: 1px solid rgba(245,158,11,0.35);
  border-radius: 20px; padding: 2.5rem 2rem;
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: 0 0 40px rgba(245,158,11,0.12);
}

.idle-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  color: #f59e0b;
}
.idle-icon svg { width: 26px; height: 26px; }

.idle-title {
  font-size: 1.2rem; font-weight: 700; color: #fff;
  margin: 0 0 0.5rem;
}

.idle-body {
  font-size: 0.85rem; color: var(--muted2);
  margin: 0 0 0.25rem; line-height: 1.5;
}

.idle-countdown {
  font-size: 3rem; font-weight: 800;
  color: #f59e0b; line-height: 1;
  margin: 0.75rem 0;
}
.idle-countdown.urgent { color: var(--red); }

.idle-actions {
  display: flex; gap: 0.75rem; justify-content: center;
  margin-top: 1.75rem;
}

.idle-btn-stay {
  flex: 1; padding: 9px 0; border-radius: var(--r-sm);
  background: rgba(16,185,129,0.12); color: #34d399;
  border: 1px solid rgba(16,185,129,0.25);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.idle-btn-stay:hover { background: #10b981; color: #fff; border-color: #10b981; }

.idle-btn-logout {
  flex: 1; padding: 9px 0; border-radius: var(--r-sm);
  background: rgba(239,68,68,0.1); color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.idle-btn-logout:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ════════ SOCIAL ACQUISITION STEPS ════════ */
.social-step-card {
  display: flex; gap: .85rem; align-items: flex-start;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem;
}
.social-step-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,#ec4899,#be185d); color: #fff;
  font-size: .78rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.social-step-body { flex: 1; min-width: 0; }
.social-step-title { font-size: .88rem; font-weight: 700; color: #fff; margin-bottom: .3rem; }
.social-step-desc { font-size: .8rem; color: var(--muted2); line-height: 1.55; }
.btn-social-open {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(236,72,153,.15); border: 1px solid rgba(236,72,153,.35);
  color: #f9a8d4; border-radius: 8px; padding: 7px 12px;
  font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .2s;
}
.btn-social-open:hover:not(:disabled) { background: rgba(236,72,153,.28); }
.btn-social-open:disabled { opacity: .4; cursor: not-allowed; }
.btn-relay-check {
  margin-top: .6rem; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  color: var(--muted2); border-radius: 8px; padding: 6px 12px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.btn-relay-check:hover:not(:disabled) { background: rgba(255,255,255,.1); color: #fff; }
.btn-relay-check:disabled { opacity: .5; cursor: not-allowed; }

/* ── Social interactive browser session ─────────────────────────────── */
.social-browser-bar {
  display: flex; align-items: center; gap: .4rem;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: .4rem .6rem;
}
.social-browser-indicator { width: 18px; display: flex; align-items: center; justify-content: center; }
.social-browser-address {
  flex: 1; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; color: var(--text);
  font-size: .78rem; padding: .3rem .6rem; outline: none;
}
.social-browser-address:focus { border-color: rgba(236,72,153,.5); }
.social-browser-go {
  background: rgba(236,72,153,.15); border: 1px solid rgba(236,72,153,.35);
  color: #f9a8d4; border-radius: 5px; font-size: .75rem;
  padding: .3rem .7rem; cursor: pointer; white-space: nowrap;
  transition: background .2s;
}
.social-browser-go:hover { background: rgba(236,72,153,.28); }
.social-browser-viewport {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,.1);
  border-top: none;
  overflow: hidden;
}
.social-browser-spinner-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); z-index: 3;
}
.social-browser-keyboard {
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: .45rem .6rem;
}
.social-browser-keyboard input {
  flex: 1; min-width: 120px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; color: var(--text);
  font-size: .78rem; padding: .3rem .6rem; outline: none;
}
.social-browser-keyboard input:focus { border-color: rgba(236,72,153,.4); }
.social-kb-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--muted2); border-radius: 5px;
  font-size: .75rem; padding: .3rem .55rem;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.social-kb-btn:hover { background: rgba(255,255,255,.14); color: var(--text); }
.btn-capture-session {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: .75rem; width: 100%;
  background: linear-gradient(135deg, rgba(236,72,153,.18), rgba(190,24,93,.18));
  border: 1px solid rgba(236,72,153,.4);
  color: #f9a8d4; border-radius: 8px;
  font-size: .85rem; font-weight: 600;
  padding: .65rem 1.2rem; cursor: pointer; transition: all .2s;
}
.btn-capture-session:hover { background: linear-gradient(135deg,rgba(236,72,153,.3),rgba(190,24,93,.3)); border-color: rgba(236,72,153,.65); }
.btn-capture-session:disabled { opacity: .5; cursor: not-allowed; }
@keyframes social-click-ripple {
  from { transform: scale(1); opacity: .8; }
  to   { transform: scale(3.5); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   TRAINING PANEL
═══════════════════════════════════════════════════════════════ */
.training-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .training-layout { grid-template-columns: 1fr; }
}

/* ── Sidebar ── */
.training-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.training-module {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.training-module-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.training-module-header:hover { background: rgba(255,255,255,0.04); }
.training-module-header.active { background: rgba(16,185,129,0.06); border-left: 3px solid var(--primary); }
.training-module-badge {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; font-family: var(--font-mono);
  flex-shrink: 0;
}
.badge-awareness { background: rgba(16,185,129,0.15);  color: #34d399; }
.badge-ir        { background: rgba(239,68,68,0.15);   color: #fca5a5; }
.badge-forensics { background: rgba(99,102,241,0.15);  color: #a5b4fc; }
.training-module-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.training-module-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.training-module-sub   { font-size: 0.72rem; color: var(--muted2); }
.training-module-chevron { width: 15px; height: 15px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.training-module-header.active .training-module-chevron { transform: rotate(90deg); }
.training-topic-list {
  display: none;
  flex-direction: column;
  padding: 0 0 0.5rem;
  border-top: 1px solid var(--border);
}
.training-topic-list.open { display: flex; }
.training-topic-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.48rem 1rem 0.48rem 1.15rem;
  background: none; border: none; cursor: pointer;
  font-size: 0.8rem; color: var(--muted2);
  text-align: left; transition: color 0.15s, background 0.15s;
  font-family: var(--font);
}
.training-topic-btn::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  transition: background 0.15s;
}
.training-topic-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.training-topic-btn.active { color: var(--primary); }
.training-topic-btn.active::before { background: var(--primary); }

/* ── Content Area ── */
.training-content-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.training-module-content { display: none; flex-direction: column; gap: 1rem; }
.training-module-content.active { display: flex; }

.training-module-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.35rem 1.5rem;
}
.training-intro-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.85rem; }
.training-intro-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.intro-awareness { background: rgba(16,185,129,0.12); }
.intro-ir        { background: rgba(239,68,68,0.12); }
.intro-forensics { background: rgba(99,102,241,0.12); }
.training-intro-title h2 { font-size: 1.15rem; margin: 0 0 0.25rem; }
.training-intro-title p  { font-size: 0.83rem; color: var(--muted2); margin: 0; line-height: 1.5; }
.training-std-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.training-std-pill {
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(99,102,241,0.12); color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.2);
}
.training-std-pill.green { background: rgba(16,185,129,0.12); color: #34d399; border-color: rgba(16,185,129,0.2); }
.training-std-pill.red   { background: rgba(239,68,68,0.12);  color: #fca5a5; border-color: rgba(239,68,68,0.2); }

/* Article card */
.training-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  scroll-margin-top: 1rem;
}
.training-article-header {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: background 0.15s;
  list-style: none;
  user-select: none;
}
.training-article-header::-webkit-details-marker { display: none; }
.training-article-header:hover { background: rgba(255,255,255,0.03); }
details.training-article[open] > .training-article-header {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.training-art-num {
  font-size: 0.68rem; font-weight: 700; font-family: var(--font-mono);
  color: var(--muted);
  min-width: 32px;
}
.training-art-title { flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.training-art-tags  { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.training-art-tag {
  font-size: 0.67rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--muted2);
}
.training-art-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
details.training-article[open] .training-art-chevron { transform: rotate(90deg); }
.training-article-body {
  padding: 1.2rem 1.5rem 1.35rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.training-article-body p { font-size: 0.86rem; color: var(--muted2); line-height: 1.65; margin: 0; }
.training-article-body p strong { color: var(--text); }
.training-article-body ul, .training-article-body ol {
  margin: 0; padding-left: 1.25rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.training-article-body li { font-size: 0.85rem; color: var(--muted2); line-height: 1.6; }
.training-article-body li strong { color: var(--text); }

/* Callout box */
.training-callout {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--r-sm);
  padding: 0.85rem 1rem;
}
.training-callout svg { width: 15px; height: 15px; color: #a5b4fc; flex-shrink: 0; margin-top: 2px; }
.training-callout p { margin: 0; font-size: 0.83rem; color: var(--muted2); line-height: 1.55; }
.training-callout p strong { color: #a5b4fc; }
.training-callout.green { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.18); }
.training-callout.green svg { color: var(--primary); }
.training-callout.green p strong { color: #34d399; }
.training-callout.red { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.18); }
.training-callout.red svg { color: #fca5a5; }
.training-callout.red p strong { color: #fca5a5; }
.training-callout.amber { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.18); }
.training-callout.amber svg { color: #fbbf24; }
.training-callout.amber p strong { color: #fbbf24; }

/* Keypoints grid */
.training-keypoints {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px,100%), 1fr));
  gap: 0.65rem;
}
.training-keypoint {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.75rem 0.9rem;
}
.training-keypoint strong { font-size: 0.82rem; color: var(--text); display: block; margin-bottom: 0.3rem; }
.training-keypoint span  { font-size: 0.78rem; color: var(--muted2); line-height: 1.5; }

/* Numbered steps in training */
.training-steps { display: flex; flex-direction: column; gap: 0.6rem; }
.training-step {
  display: flex; gap: 0.85rem; align-items: flex-start;
}
.training-step-n {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  background: rgba(16,185,129,0.15); color: #34d399;
  margin-top: 2px;
}
.training-step-n.red  { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.training-step-n.blue { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.training-step-body { font-size: 0.85rem; color: var(--muted2); line-height: 1.6; }
.training-step-body strong { color: var(--text); }

/* Phase timeline for IR */
.training-picerl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(110px,100%),1fr));
  gap: 0.5rem;
}
.training-picerl-step {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.7rem 0.8rem;
  text-align: center;
}
.training-picerl-step .phase-letter { font-size: 1.4rem; font-weight: 900; color: var(--primary); font-family: var(--font-mono); }
.training-picerl-step .phase-name   { font-size: 0.72rem; color: var(--muted2); margin-top: 4px; line-height: 1.3; }
.training-picerl-step.active-phase  { border-color: var(--primary); background: rgba(16,185,129,0.07); }

/* Section divider title */
.training-section-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  padding: 0.5rem 0 0.3rem;
}

/* ── Training Quiz ─────────────────────────────────────────────────────────── */
.training-quiz-section {
  margin-top: 2rem; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 2rem;
}

/* Intro card */
.quiz-intro-state {
  display: flex; align-items: flex-start; gap: 1.25rem;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 1.5rem;
}
.quiz-intro-icon {
  flex-shrink: 0; width: 44px; height: 44px;
  background: rgba(16,185,129,0.12); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.quiz-intro-icon svg { width: 22px; height: 22px; stroke: var(--primary); }
.quiz-intro-body h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--text); }
.quiz-intro-body p  { margin: 0 0 1rem; font-size: .88rem; color: var(--text-muted); }

/* Loading spinner */
.quiz-loading {
  display: flex; align-items: center; gap: .75rem;
  padding: 2rem; color: var(--text-muted); font-size: .9rem;
}
.quiz-loading svg { width: 20px; height: 20px; stroke: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }

/* Form wrapper */
.quiz-form { display: flex; flex-direction: column; gap: 1.5rem; }
.quiz-form-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: .75rem; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.quiz-form-header h3 { margin: 0; font-size: 1rem; color: var(--text); }
.quiz-progress {
  font-size: .82rem; color: var(--text-muted); background: rgba(255,255,255,0.05);
  padding: 3px 10px; border-radius: 20px;
}
.quiz-countdown {
  font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(124,58,237,0.12); color: #a78bfa;
  padding: 3px 14px; border-radius: 20px; border: 1px solid rgba(124,58,237,0.28);
  letter-spacing: .04em;
}
.quiz-countdown.warning {
  background: rgba(239,68,68,0.12); color: #fca5a5;
  border-color: rgba(239,68,68,0.38);
  animation: countdown-pulse .9s ease-in-out infinite;
}
@keyframes countdown-pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* Question items */
.quiz-questions-list { display: flex; flex-direction: column; gap: 1.5rem; }
.quiz-q {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 1.25rem;
}
.quiz-q-num  { margin: 0 0 .25rem; font-size: .75rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.quiz-q-of   { color: var(--text-muted); font-weight: 400; }
.quiz-q-text { margin: 0 0 1rem; font-size: .93rem; color: var(--text); font-weight: 500; line-height: 1.5; }
.quiz-opts   { display: flex; flex-direction: column; gap: .5rem; }
.quiz-opt {
  display: flex; align-items: center; gap: .75rem; cursor: pointer;
  padding: .6rem .9rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.07);
  transition: background .15s, border-color .15s;
}
.quiz-opt:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.13); }
.quiz-opt input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.quiz-opt:has(input:checked) { background: rgba(16,185,129,0.07); border-color: rgba(16,185,129,0.3); }
.quiz-opt-letter {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.06); font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.quiz-opt:has(input:checked) .quiz-opt-letter { background: var(--primary); color: #000; }
.quiz-opt-text { font-size: .88rem; color: var(--text); line-height: 1.4; }

/* Form footer */
.quiz-form-footer {
  display: flex; justify-content: flex-end; gap: .75rem;
  padding-top: .75rem; border-top: 1px solid rgba(255,255,255,0.07);
}

/* Certificate download button */
.btn-cert-download {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 8px; font-size: .88rem; font-weight: 600;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; text-decoration: none; border: none; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn-cert-download:hover { opacity: .88; transform: translateY(-1px); }

/* Result card */
.quiz-result-card {
  border-radius: 12px; padding: 1.75rem; border: 1px solid;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.quiz-result-card.passed { background: rgba(16,185,129,0.07); border-color: rgba(16,185,129,0.25); }
.quiz-result-card.failed { background: rgba(239,68,68,0.06);  border-color: rgba(239,68,68,0.22); }
.quiz-result-header { display: flex; align-items: center; gap: 1.25rem; }
.quiz-result-icon {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900;
}
.passed .quiz-result-icon { background: rgba(16,185,129,0.2);  color: #34d399; }
.failed .quiz-result-icon { background: rgba(239,68,68,0.18);  color: #fca5a5; }
.quiz-result-info h3   { margin: 0 0 .3rem; font-size: 1.1rem; }
.passed .quiz-result-info h3 { color: #34d399; }
.failed .quiz-result-info h3 { color: #fca5a5; }
.quiz-result-score     { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.quiz-result-threshold { margin: .25rem 0 0; font-size: .82rem; color: var(--text-muted); }
.quiz-result-bar-wrap  { height: 8px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
.quiz-result-bar       { height: 100%; border-radius: 4px; transition: width .5s ease; }
.passed .quiz-result-bar { background: var(--primary); }
.failed .quiz-result-bar { background: #ef4444; }
.quiz-result-congrats  { margin: 0; font-size: .9rem; color: #34d399; }
.quiz-result-actions   { display: flex; justify-content: flex-end; padding-top: .5rem; }

/* Wrong answers list */
.quiz-wrong-section { display: flex; flex-direction: column; gap: .75rem; }
.quiz-wrong-title   { margin: 0 0 .5rem; font-size: .85rem; font-weight: 700; color: #fca5a5; text-transform: uppercase; letter-spacing: .05em; }
.quiz-wrong-item {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(239,68,68,0.15);
  border-radius: 8px; padding: .9rem 1rem;
}
.quiz-wrong-q    { margin: 0 0 .4rem; font-size: .88rem; color: var(--text); font-weight: 500; }
.quiz-wrong-your { margin: 0; font-size: .85rem; color: var(--text-muted); }
.quiz-wrong-your span { color: #fca5a5; font-weight: 600; margin-right: 4px; }

/* Quiz sidebar button */
.training-quiz-btn {
  display: flex !important; align-items: center; gap: 7px;
  margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.07) !important;
  padding-top: 10px !important; color: var(--primary) !important;
  font-weight: 600 !important;
}
.training-quiz-btn svg { width: 13px; height: 13px; stroke: currentColor; flex-shrink: 0; }
.training-quiz-btn:hover { background: rgba(16,185,129,0.08) !important; }
.training-quiz-btn.active { background: rgba(16,185,129,0.12) !important; color: var(--primary) !important; }

.training-quiz-final-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 12px 14px; margin-top: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(79,70,229,0.15));
  border: 1px solid rgba(124,58,237,0.35); border-radius: 8px;
  color: #a78bfa; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; text-align: left; transition: all 0.18s ease;
  letter-spacing: 0.01em;
}
.training-quiz-final-btn:hover { background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(79,70,229,0.25)); border-color: rgba(124,58,237,0.55); color: #c4b5fd; }
.training-quiz-final-btn.active { background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(79,70,229,0.3)); border-color: #7c3aed; color: #ddd6fe; }
.training-quiz-final-btn.locked { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.training-quiz-final-btn.locked:hover { background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(79,70,229,0.15)); border-color: rgba(124,58,237,0.35); color: #a78bfa; }
.sidebar-cert-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px; margin-top: 6px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
  border-radius: 8px; color: #34d399; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; text-align: left; transition: all 0.18s ease;
}
.sidebar-cert-btn:hover { background: rgba(16,185,129,0.18); border-color: rgba(16,185,129,0.5); color: #6ee7b7; }

/* Finale lock state */
.qfm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.qfm-item { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--text-muted); }
.qfm-item.passed { color: #34d399; }
.qfm-dot { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: rgba(255,255,255,0.06); }
.qfm-item.passed .qfm-dot { background: rgba(16,185,129,0.2); color: #34d399; }
.qfm-item.pending .qfm-dot { background: rgba(255,255,255,0.06); color: var(--text-muted); }
