/* ==========================================================================
   FriendDex AI — Flagship Design System & Stylesheet
   Designed with Apple / Linear / Sony Interactive / Bilibili UI Aesthetics
   ========================================================================== */

:root {
  /* Surface & Background Hierarchy */
  --bg-primary: #07090e;
  --bg-secondary: #0d111a;
  --bg-surface: rgba(18, 24, 38, 0.55);
  --bg-surface-elevated: rgba(26, 35, 54, 0.7);
  --bg-card: rgba(14, 19, 31, 0.72);
  --bg-card-hover: rgba(22, 30, 48, 0.88);
  --bg-glass: rgba(10, 14, 23, 0.78);
  --bg-glass-heavy: rgba(7, 9, 14, 0.92);

  /* Hairline Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(56, 189, 248, 0.35);
  --border-accent-purple: rgba(168, 85, 247, 0.35);

  /* Refined Jewel Accents */
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #c084fc;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-rose: #f43f5e;
  --accent-rose-light: #fb7185;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Fonts */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Layered Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-subtle: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow-cyan: 0 0 24px rgba(6, 182, 212, 0.18), 0 0 4px rgba(56, 189, 248, 0.3);
  --shadow-glow-purple: 0 0 24px rgba(139, 92, 246, 0.18), 0 0 4px rgba(192, 132, 252, 0.3);

  /* Glass Blur */
  --glass-blur: blur(20px) saturate(180%);
  --glass-blur-sm: blur(12px) saturate(160%);
  
  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.25s;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 182, 212, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.06), transparent 60%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(16, 185, 129, 0.04), transparent 50%);
  background-attachment: fixed;
}

#threeBgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.app-container,
.enrollment-gate-screen,
.modal-overlay,
.toast-container {
  position: relative;
  z-index: 1;
}

/* Base Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

::selection {
  background: rgba(6, 182, 212, 0.35);
  color: #fff;
}

/* ==========================================================================
   APP LAYOUT & HEADER (TOP NAVIGATION)
   ========================================================================== */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  gap: 20px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.top-nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.top-nav-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Brand Container */
.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(139, 92, 246, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px rgba(6, 182, 212, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.brand-container:hover .brand-logo {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.accent-text {
  background: linear-gradient(135deg, var(--accent-cyan-light), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan-light);
  vertical-align: middle;
  display: inline-block;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Status Bar in Header */
.system-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.status-pill.status-online {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald-light);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald-light);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: pulseDot 2.2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* Modern Segmented Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  white-space: nowrap;
  user-select: none;
}

.nav-tab i {
  font-size: 0.82rem;
  transition: transform var(--duration-fast) ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab:hover i {
  transform: translateY(-1px);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.nav-tab.active i {
  color: var(--accent-cyan-light);
}

.nav-tab.admin-nav-tab {
  color: var(--accent-amber-light);
}
.nav-tab.admin-nav-tab.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fff;
}

/* User Profile Header Widget */
.user-profile-widget {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  user-select: none;
  box-shadow: var(--shadow-xs);
}

.user-profile-widget:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
}

.user-avatar-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.user-avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-in-app-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.user-vault-tag {
  font-size: 0.65rem;
  color: var(--accent-cyan-light);
  font-family: var(--font-mono);
  font-weight: 500;
}

.user-chevron {
  font-size: 0.68rem;
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-smooth);
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 0, 0, 0.8);
  z-index: 10000;
  animation: dropdownIn 0.18s var(--ease-spring);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-header {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-header strong {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

.dropdown-item {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) ease;
}

.dropdown-item i {
  font-size: 0.88rem;
  width: 18px;
  text-align: center;
  color: var(--accent-cyan-light);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.dropdown-item.text-danger {
  color: var(--accent-rose-light);
}
.dropdown-item.text-danger i {
  color: var(--accent-rose-light);
}
.dropdown-item.text-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #fff;
}

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.2;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0891b2, #0369a1);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-magic {
  background: linear-gradient(135deg, #ec4899, #8b5cf6, #06b6d4);
  background-size: 200% 200%;
  animation: gradientFlow 5s ease infinite;
  color: #ffffff;
  font-weight: 700;
  padding: 11px 20px;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-magic:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-sm {
  padding: 5px 11px;
  font-size: 0.78rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 11px 22px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
  border-radius: var(--radius-xs);
}

/* Inputs, Textareas & Selects */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--accent-cyan-light);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

/* Custom Range Slider (Linear/Apple Quality) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 10px rgba(6, 182, 212, 0.4);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 14px rgba(6, 182, 212, 0.7);
}

/* ==========================================================================
   MAIN CONTENT CONTAINER
   ========================================================================== */

.main-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: paneEntrance 0.22s var(--ease-spring);
}

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

/* ==========================================================================
   TAB 1: FREUNDE-GALERIE & DUAL-RATING CARDS
   ========================================================================== */

.pane-header {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
  pointer-events: none;
}

.search-box input {
  padding-left: 40px;
  padding-right: 36px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 4px;
}
.clear-search-btn:hover {
  color: var(--text-primary);
}

.quick-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Category Filter Pills */
.circle-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}

.circle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-normal) var(--ease-smooth);
  box-shadow: var(--shadow-xs);
}

.circle-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.circle-pill.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan-light);
  font-weight: 700;
}

.circle-pill .badge-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.custom-select-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  outline: none;
  cursor: pointer;
}

/* Profiles Grid */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.grid-loading, .empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.grid-loading i, .empty-state i {
  font-size: 2.5rem;
  margin-bottom: 14px;
  color: var(--accent-cyan-light);
}

/* Tactile Friend Profile Card */
.friend-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--duration-normal) var(--ease-spring);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.friend-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md), var(--shadow-glow-cyan);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-avatar-wrapper {
  position: relative;
  width: 62px;
  height: 62px;
  flex-shrink: 0;
}

.card-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
  border: 2px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--accent-cyan-light);
}

.circle-tag-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--accent-cyan-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-nickname {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.card-uid-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.2);
  font-weight: 600;
}

.card-vibe-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.card-bio {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.22);
}

.card-bottom-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Micro Rating Badges */
.card-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.rating-personal {
  background: rgba(6, 182, 212, 0.12) !important;
  color: var(--accent-cyan-light) !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
}

.rating-elite {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald-light);
}

.rating-solid {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan-light);
}

.rating-wackel {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber-light);
}

.rating-critical {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose-light);
}

.badge-mini-rating {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-mini-rating.private {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.28);
}
.badge-mini-rating.ai {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple-light);
  border: 1px solid rgba(139, 92, 246, 0.28);
}

/* ==========================================================================
   TAB 2: LIVE FACE SCANNER HUD (SONY ALPHA / BROADCAST CAMERA GRADE)
   ========================================================================== */

.scanner-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

@media (max-width: 1024px) {
  .scanner-layout {
    grid-template-columns: 1fr;
  }
}

.scanner-viewport-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.card-header-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-left h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.live-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
  animation: pulseDot 1.6s infinite;
}

.fps-tag, .active-scans-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020408;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-medium);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

#webcamVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scannerCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}
.camera-placeholder i {
  font-size: 3rem;
  color: var(--accent-cyan-light);
}

/* Minimalist Precision HUD Reticle */
.hud-reticle {
  position: absolute;
  inset: 20px;
  pointer-events: none;
}

.reticle-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(56, 189, 248, 0.5);
}
.reticle-corner.tl { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.reticle-corner.tr { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; }
.reticle-corner.bl { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; }
.reticle-corner.br { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; }

.scanner-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scanner-sidebar .sidebar-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.scanner-sidebar h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan-light);
  font-size: 0.92rem;
  font-weight: 700;
}

.live-matched-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}

.live-match-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  animation: fadeIn 0.18s ease;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.live-match-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-highlight);
  transform: translateX(2px);
}

.live-match-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--accent-cyan-light);
}

.live-match-details {
  flex: 1;
  min-width: 0;
}

.live-match-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.live-match-conf {
  font-size: 0.72rem;
  color: var(--accent-emerald-light);
  font-family: var(--font-mono);
}

/* ==========================================================================
   TAB 3: NEUEN FREUND ERFASSEN (CAPTURE STUDIO)
   ========================================================================== */

.capture-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.capture-header h2 {
  font-size: 1.45rem;
  margin-bottom: 4px;
}
.capture-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  max-width: 800px;
}

.capture-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .capture-grid {
    grid-template-columns: 1fr;
  }
}

.capture-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.capture-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.dropzone {
  position: relative;
  min-height: 200px;
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  overflow: hidden;
}

.dropzone:hover {
  border-color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.04);
}

.dropzone-content {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}
.dropzone-content i {
  font-size: 2.2rem;
  color: var(--accent-cyan-light);
  margin-bottom: 8px;
}
.dropzone-content p {
  color: var(--text-primary);
  font-size: 0.88rem;
  margin-bottom: 3px;
}
.dropzone-content span {
  font-size: 0.72rem;
}

.preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}
.preview-wrapper img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.remove-photo-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--accent-rose-light);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-fast) ease;
}
.remove-photo-btn:hover {
  transform: scale(1.1);
}

.detected-faces-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 10px;
  border: 1px solid var(--border-subtle);
}

.box-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--accent-cyan-light);
  margin-bottom: 8px;
  font-weight: 600;
}

.face-crops-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.face-crop-item {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.face-crop-item.selected {
  border-color: var(--accent-cyan-light);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.face-crop-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Redundancy Alert Card */
.redundancy-alert-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.alert-icon {
  font-size: 1.3rem;
  color: var(--accent-amber-light);
}

.alert-body h4 {
  color: var(--accent-amber-light);
  font-size: 0.9rem;
  margin-bottom: 3px;
}
.alert-body p {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.redundancy-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notes-input-group label,
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.notes-templates {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.notes-templates span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.template-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 3px 9px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}
.template-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 10px;
}

@media (max-width: 768px) {
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 12px;
}

.form-submit-row {
  margin-top: 12px;
}

/* ==========================================================================
   TAB 4: MEMORY TIMELINE
   ========================================================================== */

.timeline-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}

.timeline-stream {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 0;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple));
  opacity: 0.35;
}

.timeline-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 24px;
}

.timeline-dot {
  position: absolute;
  left: 14px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2.5px solid var(--accent-cyan-light);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.timeline-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform var(--duration-fast) ease;
  box-shadow: var(--shadow-xs);
}
.timeline-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.timeline-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.timeline-friend-name {
  font-weight: 700;
  color: var(--accent-cyan-light);
  font-size: 0.9rem;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
  color: #fff;
}

.timeline-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}

.timeline-notes {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   MODALS & DOSSIER (FREUNDEBUCH 2.0)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 5, 9, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

.modal-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 0, 0, 0.85);
  animation: modalScaleUp 0.22s var(--ease-spring);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card.dossier-modal {
  max-width: 880px;
  padding: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}
.modal-close-btn:hover {
  background: var(--accent-rose);
  color: #fff;
  transform: rotate(90deg);
}

.dossier-hero {
  position: relative;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16) 0%, rgba(139, 92, 246, 0.14) 50%, rgba(7, 9, 14, 0.96) 100%);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.dossier-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.14) 0%, transparent 60%),
              radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.14) 0%, transparent 60%);
  pointer-events: none;
}

.dossier-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
}

.dossier-avatar-wrapper {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.dossier-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2.5px solid var(--accent-cyan-light);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(6, 182, 212, 0.35);
}

.dossier-avatar.card-avatar-placeholder {
  width: 100%;
  height: 100%;
  font-size: 2rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.1);
  border: 2.5px solid var(--accent-cyan-light);
}

.dossier-header-titles {
  flex: 1;
  min-width: 0;
}

.dossier-name-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.dossier-vibe-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan-light);
}

.dossier-uid-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan-light);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}
.dossier-uid-badge:hover {
  background: var(--accent-cyan);
  color: #04101e;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.dossier-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.dossier-circle-tag {
  color: var(--accent-cyan-light);
  font-weight: 600;
}

.dossier-archetype-tag {
  color: var(--accent-purple-light);
  font-weight: 600;
}

/* Dossier Navigation Tabs */
.dossier-nav-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: rgba(12, 16, 26, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.dossier-nav-btn {
  background: transparent;
  border: none;
  padding: 11px 16px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all var(--duration-fast) ease;
}

.dossier-nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.dossier-nav-btn.active {
  color: var(--accent-cyan-light);
  border-bottom-color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.06);
}

.dossier-tab-content {
  padding: 22px 26px;
  max-height: 62vh;
  overflow-y: auto;
}

/* ==========================================================================
   DUAL RATING ARCHITECTURE (HERO DISPLAY)
   ========================================================================== */

.dual-rating-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .dual-rating-container {
    grid-template-columns: 1fr;
  }
}

.dual-rating-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.dual-rating-box.personal-box {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.06) 0%, rgba(13, 18, 28, 0.95) 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: var(--shadow-sm);
}

.dual-rating-box.personal-box:hover {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: var(--shadow-md), 0 0 16px rgba(6, 182, 212, 0.1);
}

.dual-rating-box.ai-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(13, 18, 28, 0.95) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: var(--shadow-sm);
}

.dual-rating-box.ai-box:hover {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: var(--shadow-md), 0 0 16px rgba(139, 92, 246, 0.1);
}

.dual-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dual-rating-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.privacy-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.dual-rating-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rating-display-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan-light);
}

.rating-helper-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dossier-rating-verdict {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

/* Dossier Steckbrief Grid */
.steckbrief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.steckbrief-card {
  background: var(--bg-surface);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.steckbrief-card h5 {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.steckbrief-card p {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.flags-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .flags-grid {
    grid-template-columns: 1fr;
  }
}

.green-flags-box {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.green-flags-box h5 {
  color: var(--accent-emerald-light);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.red-flags-box {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.red-flags-box h5 {
  color: var(--accent-rose-light);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

/* ==========================================================================
   BIOPSYCHOLOGICAL MATRIX (STÄRKEN & SCHWÄCHEN)
   ========================================================================== */

.biopsych-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .biopsych-grid {
    grid-template-columns: 1fr;
  }
}

.matrix-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.matrix-card.psych-strengths {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
}
.matrix-card.psych-strengths h5 {
  color: var(--accent-emerald-light);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.matrix-card.psych-weaknesses {
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.25);
}
.matrix-card.psych-weaknesses h5 {
  color: var(--accent-rose-light);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.matrix-card.physical-strengths {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.25);
}
.matrix-card.physical-strengths h5 {
  color: var(--accent-cyan-light);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.matrix-card.physical-weaknesses {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.25);
}
.matrix-card.physical-weaknesses h5 {
  color: var(--accent-amber-light);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.matrix-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.tactics-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}
.tactics-box h5 {
  color: var(--accent-purple-light);
  font-size: 0.9rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tactics-box p {
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ==========================================================================
   AI CHAT WITH FRIEND PERSONA
   ========================================================================== */

.ai-friend-chat-box {
  display: flex;
  flex-direction: column;
  height: 360px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.ai-chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.4;
}
.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #ffffff;
  font-weight: 500;
}
.chat-bubble.ai {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.ai-chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}

.quick-prompts-bar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.25);
}
.quick-ai-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) ease;
}
.quick-ai-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan-light);
  border-color: var(--border-highlight);
}

/* ==========================================================================
   AUTH MODAL & LOGIN
   ========================================================================== */

.auth-modal-card {
  max-width: 420px;
  text-align: center;
}
.auth-header h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.auth-header p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 18px;
}
.btn-google-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #1f2937;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.btn-google-login:hover {
  background: #f8fafc;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.auth-divider {
  position: relative;
  text-align: center;
  margin: 18px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-subtle);
}
.auth-divider span {
  position: relative;
  background: var(--bg-secondary);
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Master Admin PIN Access Card */
.admin-pin-access-card {
  margin-top: 12px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) ease;
}
.admin-pin-access-card:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   SETTINGS TAB
   ========================================================================== */

.settings-container {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan-light);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.settings-save-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.save-status-msg {
  font-size: 0.85rem;
  color: var(--accent-emerald-light);
}

/* ==========================================================================
   ADMIN CONTROL DASHBOARD
   ========================================================================== */

.admin-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-header-row h2 {
  font-size: 1.5rem;
  margin-bottom: 3px;
}
.admin-header-row p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.admin-quick-actions {
  display: flex;
  gap: 8px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.admin-stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-section-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.admin-section-card h3 {
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.admin-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.admin-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.badge-role.admin {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber-light);
}
.badge-role.user {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.22);
  color: var(--accent-cyan-light);
}

.badge-enroll-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
}
.badge-enroll-status.verified {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald-light);
}
.badge-enroll-status.pending {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose-light);
}

/* ==========================================================================
   WEEKLY AUDIT MODAL
   ========================================================================== */

.weekly-audit-card {
  max-width: 760px !important;
  width: 95% !important;
}

.audit-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.audit-highlight-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform var(--duration-fast) ease;
}

.audit-highlight-card:hover {
  transform: translateY(-2px);
}

.audit-highlight-card.mvp {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.05);
}
.audit-highlight-card.gainer {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.05);
}
.audit-highlight-card.drop {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.05);
}
.audit-highlight-card.ghost {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.05);
}

.highlight-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.audit-highlight-card.mvp .highlight-badge { color: var(--accent-amber-light); }
.audit-highlight-card.gainer .highlight-badge { color: var(--accent-emerald-light); }
.audit-highlight-card.drop .highlight-badge { color: var(--accent-rose-light); }
.audit-highlight-card.ghost .highlight-badge { color: var(--accent-purple-light); }

.audit-highlight-card h4 {
  font-size: 0.98rem;
  margin-bottom: 3px;
  color: #fff;
}

.audit-highlight-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.audit-summary-box {
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.audit-summary-box h5 {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--accent-cyan-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   GATEKEEPER & RECONCILIATION MODALS
   ========================================================================== */

.enrollment-gate-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 30%, rgba(13, 17, 26, 0.98), #05070a 90%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.enrollment-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(6, 182, 212, 0.15);
  animation: fadeIn 0.3s ease;
}

.gate-steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.gate-step {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.gate-step.active {
  color: var(--accent-cyan-light);
}
.gate-step .step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
}
.gate-step.active .step-num {
  background: var(--accent-cyan);
  color: #030a14;
  font-weight: 800;
}

.reconciliation-card {
  max-width: 820px;
  background: #0b0e17;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(139, 92, 246, 0.2);
}

.recon-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--accent-purple-light);
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.recon-decision-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.recon-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.recon-radio-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
}

.recon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .recon-grid {
    grid-template-columns: 1fr;
  }
}

.recon-col {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.input-readonly {
  background: rgba(0, 0, 0, 0.45) !important;
  color: #64748b !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  cursor: not-allowed;
}

.input-unlocked {
  background: rgba(0, 0, 0, 0.25) !important;
  color: #fff !important;
  border-color: var(--accent-cyan-light) !important;
  cursor: text !important;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.25s var(--ease-spring);
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald-light);
}
.toast.toast-error {
  border-color: rgba(244, 63, 94, 0.35);
  color: var(--accent-rose-light);
}
.toast.toast-info {
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan-light);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(35px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE TOP-NAV
   ========================================================================== */

@media (max-width: 1100px) {
  .system-status-bar {
    display: none;
  }
}

@media (max-width: 850px) {
  .top-nav {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 10px;
  }
  .top-nav-center {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding: 3px;
    justify-content: flex-start;
  }
  .user-dropdown-menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 28px);
  }
}

/* ==========================================================================
   SPECIALIZED MICRO-COMPONENTS
   ========================================================================== */

.btn-audit {
  border-color: rgba(168, 85, 247, 0.35);
  color: var(--accent-purple-light);
  background: rgba(139, 92, 246, 0.08);
}
.btn-audit:hover {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(168, 85, 247, 0.5);
  color: #fff;
}

.gate-admin-bypass {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.gate-admin-label {
  font-size: 0.8rem;
  color: var(--accent-amber-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gate-admin-input-group {
  display: flex;
  gap: 6px;
}

.gate-admin-input {
  width: 120px !important;
  padding: 5px 10px !important;
  font-size: 0.82rem !important;
  font-family: var(--font-mono) !important;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4) !important;
}

.btn-admin-unlock {
  color: var(--accent-amber-light);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}
.btn-admin-unlock:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-amber);
  color: #fff;
}

.personal-rating-form-box {
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.06) 0%, rgba(13, 18, 28, 0.8) 100%);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: var(--shadow-xs);
}

.personal-rating-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.personal-rating-label {
  margin: 0 !important;
  font-weight: 700 !important;
  color: var(--accent-cyan-light) !important;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem !important;
}

.personal-rating-badge {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-cyan-light);
  font-family: var(--font-mono);
}

.personal-rating-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

/* ==========================================================================
   3D SOCIAL CONSTELLATION GRAPH & HUD STYLING
   ========================================================================== */

.view-mode-toggle {
  display: inline-flex;
  background: rgba(10, 14, 23, 0.75);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  gap: 3px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.view-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #fff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.constellation-view-wrapper {
  position: relative;
  width: 100%;
  height: 680px;
  min-height: 520px;
  background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.85) 0%, rgba(7, 9, 14, 0.98) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(6, 182, 212, 0.07);
  overflow: hidden;
  margin-top: 12px;
}

#threeConstellationCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#threeConstellationCanvas:active {
  cursor: grabbing;
}

/* Constellation HUD Overlays */
.constellation-hud-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}

.constellation-hud-top > * {
  pointer-events: auto;
}

.constellation-title-badge {
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: var(--shadow-md);
}

.constellation-title-badge h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.constellation-title-badge p {
  margin: 2px 0 0 0;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.constellation-controls-bar {
  display: flex;
  gap: 8px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.constellation-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.constellation-hud-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.constellation-hud-btn.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan-light);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Constellation HUD Bottom Info */
.constellation-hud-bottom {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}

.constellation-hud-bottom > * {
  pointer-events: auto;
}

.constellation-legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  max-width: 600px;
}

.constellation-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.03);
}

.constellation-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.constellation-fps-counter {
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-emerald-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Constellation Tooltip Card */
.constellation-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 14px;
  width: 280px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(6, 182, 212, 0.25);
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.constellation-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -105%);
}

.constellation-tooltip-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.constellation-tooltip-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.constellation-tooltip-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan-light);
  border: 2px solid var(--accent-cyan);
  font-size: 1.1rem;
}

.constellation-tooltip-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.constellation-tooltip-info span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.constellation-tooltip-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.constellation-tooltip-bio {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 6px 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.constellation-tooltip-hint {
  font-size: 0.72rem;
  color: var(--accent-cyan-light);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

/* Gatekeeper 3D Hologram Canvas */
.gate-3d-hologram-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

#gatekeeper3DCanvas {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: block;
}

/* ==========================================================================
   FBI PROFILER & RATING RATIONALE (EVIDENZBASIERTER BEWEISBERICHT)
   ========================================================================== */

.fbi-profiler-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rating-rationale-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.rating-rationale-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.rationale-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.rationale-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rationale-hero-title h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.fbi-badge-pill {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rationale-score-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.rationale-score-val {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}

.rationale-score-max {
  font-size: 1rem;
  color: var(--text-muted);
}

.rationale-justification-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3.5px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.rationale-justification-box h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan-light);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rationale-justification-box p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.rationale-factors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .rationale-factors-grid {
    grid-template-columns: 1fr;
  }
}

.factor-column {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.factor-column-title {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.positive-column-title {
  color: #34d399;
}

.risk-column-title {
  color: #fb7185;
}

.factors-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.factor-chip {
  font-size: 0.84rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.factor-chip-positive {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #d1fae5;
}

.factor-chip-risk {
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.2);
  color: #ffe4e6;
}

.loyalty-prognosis-bar {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.loyalty-prognosis-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.loyalty-prognosis-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* FBI Behavioral Matrix Grid */
.behavioral-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.behavioral-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
}

.behavioral-card-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.behavioral-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* ==========================================================================
   SOCIAL GRAPH & BEZIEHUNGS-RADAR (READ-ONLY)
   ========================================================================== */

.social-radar-sidebar-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.65) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.social-radar-peer-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--duration-fast) ease;
}

.social-radar-peer-card:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(56, 189, 248, 0.25);
}

.radar-peer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-cyan);
  flex-shrink: 0;
}

.radar-peer-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1.5px solid var(--border-subtle);
  flex-shrink: 0;
}

.radar-peer-info {
  flex: 1;
  min-width: 0;
}

.radar-peer-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.radar-peer-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radar-peer-circle-badge {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.radar-peer-relation {
  font-size: 0.76rem;
  color: var(--accent-cyan-light);
  margin-top: 2px;
  line-height: 1.3;
}

/* ==========================================================================
   FLAGSHIP NATIVE MOBILE APP DESIGN SYSTEM (SMARTPHONES / TABLETS)
   ========================================================================== */

/* Floating Camera Flip Button */
.btn-camera-flip-floating {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-camera-flip-floating:active {
  transform: scale(0.9) rotate(180deg);
  background: rgba(56, 189, 248, 0.3);
  border-color: var(--accent-cyan);
}

/* Mobile Bottom Navigation Dock (Hidden on Desktop, Visible on Mobile) */
.mobile-bottom-dock {
  display: none;
}

.bottom-sheet-handle {
  display: none;
}

@media (max-width: 768px) {
  /* Safe Area Root Insets & Touch Optimizations */
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  /* Top Navigation Bar on Mobile */
  .top-nav {
    padding: max(env(safe-area-inset-top, 0px), 8px) 14px 8px 14px;
    height: auto;
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(7, 9, 14, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .top-nav-center {
    display: none !important;
  }

  .top-nav-left .brand-subtitle {
    display: none;
  }

  .top-nav-left .brand-title {
    font-size: 1.15rem;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .system-status-bar {
    display: none;
  }

  .user-profile-widget {
    padding: 4px 8px;
    gap: 6px;
  }

  .user-vault-tag {
    display: none;
  }

  /* Mobile Bottom Navigation Dock */
  .mobile-bottom-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 6px);
    background: rgba(10, 14, 24, 0.94);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
  }

  .mobile-dock-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
  }

  .mobile-dock-btn i {
    font-size: 1.25rem;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  }

  .mobile-dock-btn:active {
    transform: scale(0.92);
  }

  .mobile-dock-btn.active {
    color: var(--accent-cyan-light);
    font-weight: 700;
  }

  .mobile-dock-btn.active i {
    transform: translateY(-2px);
    color: var(--accent-cyan-light);
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.5));
  }

  /* Center Elevated Scan Orb */
  .mobile-dock-center-action {
    position: relative;
    top: -12px;
  }

  .dock-scan-orb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.45), 0 0 0 4px rgba(7, 9, 14, 0.9);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .dock-scan-orb i {
    font-size: 1.35rem !important;
    color: #ffffff !important;
  }

  .mobile-dock-center-action:active .dock-scan-orb {
    transform: scale(0.92);
  }

  .mobile-dock-center-action.active .dock-scan-orb {
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.65), 0 0 0 4px rgba(7, 9, 14, 0.9);
  }

  /* Main Content Area Mobile Spacing */
  .main-content {
    padding: 12px 14px 20px 14px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Tab 1: Gallery on Mobile */
  .gallery-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .gallery-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .gallery-controls-bar {
    flex-direction: column;
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .circle-filter-pills {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .circle-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .circle-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .profiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .profile-card {
    padding: 10px;
    border-radius: var(--radius-md);
  }

  .card-avatar-wrap {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
  }

  .card-name {
    font-size: 0.95rem;
  }

  .card-nickname {
    font-size: 0.76rem;
  }

  .card-tags {
    gap: 4px;
    margin: 6px 0;
  }

  .badge-tag {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .card-dual-rating {
    padding: 6px 8px;
    margin-top: 8px;
  }

  .rating-score-num {
    font-size: 1.1rem;
  }

  /* Tab 2: Live Scanner on Mobile */
  .scanner-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .scanner-viewport-card {
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .video-container {
    height: 380px;
    max-height: 52vh;
    border-radius: var(--radius-sm);
  }

  .scanner-controls {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .scanner-controls .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.92rem;
  }

  /* Tab 3: Capture Studio on Mobile */
  .capture-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dropzone {
    padding: 24px 14px;
  }

  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Tab 4: Timeline on Mobile */
  .timeline-container {
    padding: 0;
  }

  .timeline-item {
    padding-left: 32px;
  }

  .timeline-marker {
    left: 4px;
  }

  /* Mobile Bottom-Sheet Modal Transformation */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 90vh !important;
    margin: 0 !important;
    padding: 16px 18px 24px 18px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.8) !important;
    border-bottom: none !important;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .bottom-sheet-handle {
    display: block;
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    margin: 0 auto 14px auto;
  }

  @keyframes slideUpModal {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .dossier-nav-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .dossier-nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .dossier-tab-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .rating-rationale-hero {
    padding: 14px;
  }

  .rationale-subscores-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .rationale-factors-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .behavioral-matrix-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Gatekeeper Lockscreen on Mobile */
  .gatekeeper-container {
    padding: 20px 14px;
    width: 100vw;
    min-height: 100vh;
    justify-content: flex-start;
  }

  .gate-card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }

  .gate-video-wrapper {
    width: 180px;
    height: 180px;
  }
}
