/* ==========================================================================
   INTERNODE SOVEREIGN CONTROL PLANE — DESIGN SYSTEM & STYLESHEET
   100% Native Standard CSS — Zero Dependencies — Single Consolidated Bundle
   ========================================================================== */

/* ==========================================================================
   INTERNODE ARCADE HUB - DESIGN SYSTEM & THEME TOKENS
   Matte Charcoal & Industrial Safety Orange (Strictly 0-Dependency)
   ========================================================================== */

:root {
  color-scheme: dark;
  /* Color Palette - Tokyo Night Dark (Default) */
  --bg-primary: #0f1117;
  --bg-secondary: #161822;
  --bg-tertiary: #1a1d2b;
  --bg-surface: #161822;
  --bg-surface-elevated: #1a1d2b;
  --bg-surface-hover: #24283b;
  --bg-surface-active: #2f344d;
  --bg-drawer: #13141c;
  --bg-glass: rgba(22, 24, 34, 0.85);
  --bg-glass-heavy: rgba(15, 17, 23, 0.94);

  /* Hairline & Structural Borders */
  --border-subtle: rgba(122, 162, 247, 0.12);
  --border-medium: rgba(122, 162, 247, 0.22);
  --border-highlight: rgba(122, 162, 247, 0.40);
  --border-color: rgba(122, 162, 247, 0.15);
  
  /* Primary Functional Accent - Tokyo Night Neon Blue */
  --accent: #7aa2f7;
  --accent-glow: rgba(122, 162, 247, 0.35);
  --accent-orange: #7aa2f7;
  --accent-orange-hover: #89b4fa;
  --accent-orange-active: #6366f1;
  --accent-orange-dim: rgba(122, 162, 247, 0.15);
  --accent-orange-border: rgba(122, 162, 247, 0.45);
  --accent-orange-solid-text: #0f1117;

  /* Secondary Status Accents */
  --status-ok: #22c55e;
  --status-warn: #f59e0b;
  --status-err: #ef4444;

  /* Typography */
  --text-primary: #c0caf5;
  --text-secondary: #7982a9;
  --text-muted: #565f89;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout Measurements (Standardized Modern Anchored Bars) */
  --header-height: 48px;
  --footer-height: 32px;
  --drawer-width: 380px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --glass-blur: 16px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s cubic-bezier(0.16, 1, 0.3, 1);

  /* Modern CSS OKLCH & Color-Mix Tokens */
  --accent-oklch: oklch(72% 0.19 240);
  --accent-mix-surface: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-mix-hover: color-mix(in srgb, var(--accent) 80%, white);
  --accent-mix-active: color-mix(in srgb, var(--accent) 80%, black);
  --border-mix: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ==========================================================================
   STUDIO THEME PRESETS (OKLCH / HSL Token Palettes)
   ========================================================================== */

/* 0. Sovereign Obsidian & Emerald (Default) */
:root[data-theme="default"],
:root[data-theme="sovereign-obsidian"],
:root[data-theme="obsidian-emerald"] {
  --bg-primary: #050508;
  --bg-secondary: #0c0d14;
  --bg-tertiary: #111116;
  --bg-surface: #0c0d14;
  --bg-surface-elevated: #111116;
  --bg-surface-hover: #191b26;
  --bg-surface-active: #222534;
  --bg-drawer: #090a0f;
  --bg-glass: rgba(12, 13, 20, 0.85);
  --bg-glass-heavy: rgba(5, 5, 8, 0.94);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-highlight: rgba(16, 185, 129, 0.40);
  --border-color: rgba(255, 255, 255, 0.1);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --accent-orange: #10b981;
  --accent-orange-hover: #34d399;
  --accent-orange-active: #059669;
  --accent-orange-dim: rgba(16, 185, 129, 0.15);
  --accent-orange-border: rgba(16, 185, 129, 0.45);
  --accent-orange-solid-text: #050508;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

/* 0b. Tokyo Night Dark */
:root[data-theme="tokyo-night"] {
  --bg-primary: #0f1117;
  --bg-secondary: #161822;
  --bg-tertiary: #1a1d2b;
  --bg-surface: #161822;
  --bg-surface-elevated: #1a1d2b;
  --bg-surface-hover: #24283b;
  --bg-surface-active: #2f344d;
  --bg-drawer: #13141c;
  --bg-glass: rgba(22, 24, 34, 0.85);
  --bg-glass-heavy: rgba(15, 17, 23, 0.94);
  --border-subtle: rgba(122, 162, 247, 0.12);
  --border-medium: rgba(122, 162, 247, 0.22);
  --border-highlight: rgba(122, 162, 247, 0.40);
  --border-color: rgba(122, 162, 247, 0.15);
  --accent: #7aa2f7;
  --accent-glow: rgba(122, 162, 247, 0.35);
  --accent-orange: #7aa2f7;
  --accent-orange-hover: #89b4fa;
  --accent-orange-active: #6366f1;
  --accent-orange-dim: rgba(122, 162, 247, 0.15);
  --accent-orange-border: rgba(122, 162, 247, 0.45);
  --accent-orange-solid-text: #0f1117;
  --text-primary: #c0caf5;
  --text-secondary: #7982a9;
  --text-muted: #565f89;
}

/* 1. Industrial Safety Orange */
:root[data-theme="obsidian-orange"],
:root[data-theme="safety-orange-industrial"] {
  --bg-primary: #0c0e12;
  --bg-secondary: #14171e;
  --bg-tertiary: #1a1a1e;
  --bg-surface: #14171e;
  --bg-surface-elevated: #1a1a1e;
  --bg-surface-hover: #232328;
  --bg-surface-active: #2b2b32;
  --bg-drawer: #14171e;
  --bg-glass: rgba(20, 23, 30, 0.82);
  --bg-glass-heavy: rgba(12, 14, 18, 0.92);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-highlight: rgba(255, 255, 255, 0.25);
  --border-color: rgba(255, 255, 255, 0.10);
  --accent: #ff6b00;
  --accent-glow: rgba(255, 107, 0, 0.35);
  --accent-orange: #ff6b00;
  --accent-orange-hover: #ff8533;
  --accent-orange-active: #e05e00;
  --accent-orange-dim: rgba(255, 107, 0, 0.14);
  --accent-orange-border: rgba(255, 107, 0, 0.45);
  --accent-orange-solid-text: #0c0e12;
  --text-primary: #f1f3f7;
  --text-secondary: #9da6b5;
  --text-muted: #5e6777;
}

/* 2. Phosphor Emerald Matrix */
:root[data-theme="matrix-emerald"],
:root[data-theme="emerald-matrix"] {
  --bg-primary: #050b06;
  --bg-secondary: #0a160d;
  --bg-tertiary: #102115;
  --bg-surface: #0a160d;
  --bg-surface-elevated: #102115;
  --bg-surface-hover: #162d1d;
  --bg-surface-active: #1d3925;
  --bg-drawer: #0a160d;
  --bg-glass: rgba(10, 22, 13, 0.85);
  --bg-glass-heavy: rgba(5, 11, 6, 0.94);
  --border-subtle: rgba(0, 255, 102, 0.12);
  --border-medium: rgba(0, 255, 102, 0.22);
  --border-highlight: rgba(0, 255, 102, 0.40);
  --border-color: rgba(0, 255, 102, 0.15);
  --accent: #00ff66;
  --accent-glow: rgba(0, 255, 102, 0.40);
  --accent-orange: #00ff66;
  --accent-orange-hover: #33ff85;
  --accent-orange-active: #00cc52;
  --accent-orange-dim: rgba(0, 255, 102, 0.15);
  --accent-orange-border: rgba(0, 255, 102, 0.45);
  --accent-orange-solid-text: #050b06;
  --text-primary: #e6ffe6;
  --text-secondary: #70b880;
  --text-muted: #3d6e47;
}

/* 3. High-Contrast Cyberpunk Neon */
:root[data-theme="cyberpunk-neon"],
:root[data-theme="cyberpunk"] {
  --bg-primary: #0a0614;
  --bg-secondary: #140d24;
  --bg-tertiary: #1c1333;
  --bg-surface: #140d24;
  --bg-surface-elevated: #1c1333;
  --bg-surface-hover: #261a45;
  --bg-surface-active: #32225a;
  --bg-drawer: #140d24;
  --bg-glass: rgba(20, 13, 36, 0.85);
  --bg-glass-heavy: rgba(10, 6, 20, 0.94);
  --border-subtle: rgba(0, 245, 255, 0.15);
  --border-medium: rgba(0, 245, 255, 0.28);
  --border-highlight: rgba(0, 245, 255, 0.50);
  --border-color: rgba(0, 245, 255, 0.18);
  --accent: #00f5ff;
  --accent-glow: rgba(0, 245, 255, 0.45);
  --accent-orange: #00f5ff;
  --accent-orange-hover: #33f7ff;
  --accent-orange-active: #00c4cc;
  --accent-orange-dim: rgba(0, 245, 255, 0.15);
  --accent-orange-border: rgba(0, 245, 255, 0.45);
  --accent-orange-solid-text: #0a0614;
  --text-primary: #f5f0ff;
  --text-secondary: #b39ddb;
  --text-muted: #7960a3;
}

/* 4. Nordic Titanium Frost */
:root[data-theme="titanium-frost"],
:root[data-theme="titanium-silver"] {
  --bg-primary: #0f1318;
  --bg-secondary: #181d24;
  --bg-tertiary: #212730;
  --bg-surface: #181d24;
  --bg-surface-elevated: #212730;
  --bg-surface-hover: #2a323d;
  --bg-surface-active: #343d4a;
  --bg-drawer: #181d24;
  --bg-glass: rgba(24, 29, 36, 0.85);
  --bg-glass-heavy: rgba(15, 19, 24, 0.94);
  --border-subtle: rgba(226, 232, 240, 0.12);
  --border-medium: rgba(226, 232, 240, 0.22);
  --border-highlight: rgba(226, 232, 240, 0.40);
  --border-color: rgba(226, 232, 240, 0.15);
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --accent-orange: #38bdf8;
  --accent-orange-hover: #60a5fa;
  --accent-orange-active: #0284c7;
  --accent-orange-dim: rgba(56, 189, 248, 0.15);
  --accent-orange-border: rgba(56, 189, 248, 0.45);
  --accent-orange-solid-text: #0f1318;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

/* 5. Arcade Velvet Crimson */
:root[data-theme="velvet-crimson"],
:root[data-theme="crimson-cyber"] {
  --bg-primary: #12080a;
  --bg-secondary: #1d0f12;
  --bg-tertiary: #28151a;
  --bg-surface: #1d0f12;
  --bg-surface-elevated: #28151a;
  --bg-surface-hover: #351c23;
  --bg-surface-active: #43242c;
  --bg-drawer: #1d0f12;
  --bg-glass: rgba(29, 15, 18, 0.85);
  --bg-glass-heavy: rgba(18, 8, 10, 0.94);
  --border-subtle: rgba(239, 68, 68, 0.15);
  --border-medium: rgba(239, 68, 68, 0.28);
  --border-highlight: rgba(239, 68, 68, 0.50);
  --border-color: rgba(239, 68, 68, 0.18);
  --accent: #ef4444;
  --accent-glow: rgba(239, 68, 68, 0.40);
  --accent-orange: #ef4444;
  --accent-orange-hover: #f87171;
  --accent-orange-active: #dc2626;
  --accent-orange-dim: rgba(239, 68, 68, 0.15);
  --accent-orange-border: rgba(239, 68, 68, 0.45);
  --accent-orange-solid-text: #12080a;
  --text-primary: #fff1f2;
  --text-secondary: #fca5a5;
  --text-muted: #991b1b;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-hover);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

/* Base Form & Interactive Elements */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  color-scheme: dark;
}

/* Sleek Dark Theme Dropdown Select & Options */
select,
.select-input,
.studio-select-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  background-color: var(--bg-surface-elevated, #1a1a1e);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff6b00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 11px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 4px);
  color: var(--text-primary, #f1f3f7);
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 2.2rem 0.45rem 0.75rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast, 0.15s ease), background-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
  color-scheme: dark;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  /* Ensures full-width when used in flex/grid containers */
  width: 100%;
  box-sizing: border-box;
}

select:hover,
.select-input:hover,
.studio-select-input:hover {
  background-color: var(--bg-surface-hover, #232328);
  border-color: var(--accent-orange-border, rgba(255, 107, 0, 0.45));
  color: var(--text-primary, #f1f3f7);
}

select:focus,
select:focus-visible,
.select-input:focus,
.select-input:focus-visible,
.studio-select-input:focus,
.studio-select-input:focus-visible {
  border-color: var(--accent-orange, #ff6b00);
  box-shadow: 0 0 0 1px var(--accent-orange, #ff6b00), 0 0 12px rgba(255, 107, 0, 0.25);
}

select option,
.select-input option,
.studio-select-input option {
  background-color: #14171e;
  color: #f1f3f7;
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
}

select option:hover,
select option:focus,
select option:checked,
.select-input option:hover,
.select-input option:focus,
.select-input option:checked,
.studio-select-input option:hover,
.studio-select-input option:focus,
.studio-select-input option:checked {
  background-color: #1a1a1e;
  color: #ff6b00;
  font-weight: 700;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* WCAG 2.2 AAA Accessible focus rings — single global source of truth */
:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.75);
  transition: outline-offset 0.1s ease;
}

/* ==========================================================================
   MICRO-TOOLTIP SYSTEM
   Industrial Matte Dark Tooltips with Safety Orange Accent & Shortcut Badges
   ========================================================================== */
.hub-tooltip-bubble {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.hub-tooltip-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hub-tooltip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-orange);
  flex-shrink: 0;
}

.hub-tooltip-shortcut {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 1px 4px;
  color: var(--text-secondary);
}



/* ==========================================================================
   INTERNODE CORE LAYOUT & WORKSTATION CHROME
   ========================================================================== */

/* ==========================================================================
   INTERNODE ARCADE HUB - LAYOUT & NAVIGATION
   Command Deck Header, Edge Chevron Handles, Dual Slide-out Drawers
   ========================================================================== */

/* Native Cross-Document View Transitions (Hardware-Accelerated Zero-Flash Morphing) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.16s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ambient Matrix Background Canvas - Disabled By Default */
.matrix-canvas,
#matrix-canvas,
.internode-fx-canvas,
#internode-fx-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none !important;
}

.matrix-canvas.canvas-fx-active,
#matrix-canvas.canvas-fx-active,
.internode-fx-canvas.canvas-fx-active,
#internode-fx-canvas.canvas-fx-active,
[data-canvas-fx="enabled"] .matrix-canvas,
[data-canvas-fx="enabled"] #matrix-canvas,
[data-canvas-fx="enabled"] .internode-fx-canvas,
[data-canvas-fx="enabled"] #internode-fx-canvas {
  display: block !important;
}

html {
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

/* body base styles consolidated in hub-theme.css */

body.page-workspace,
html:has(body.page-workspace) {
  overflow: hidden !important;
  height: 100vh !important;
}

/* Top Command Deck Header */
.hub-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1020 !important;
  height: var(--header-height);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  flex: 1;
}

.header-brand-mark {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.header-brand-mark:hover {
  opacity: 0.85;
}

.header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1025;
  pointer-events: none;
}

.header-center > * {
  pointer-events: auto;
}


.header-game-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  transition: opacity 0.22s var(--transition-normal), transform 0.22s var(--transition-normal);
}

body.toast-active .header-game-title {
  opacity: 0 !important;
  transform: scale(0.96);
  pointer-events: none;
}

/* --- High-Precision Netcode Telemetry Badge --- */
.header-net-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: help;
  user-select: none;
  height: 24px;
}

.header-net-status .net-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: net-pulse 2s infinite ease-in-out;
}

.header-net-status[data-quality="excellent"] {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.header-net-status[data-quality="good"] {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.35);
  color: #38bdf8;
}

.header-net-status[data-quality="fair"] {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fef08a;
}

.header-net-status[data-quality="poor"] {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fca5a5;
}

.header-net-status[data-quality="offline"] {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.header-net-status[data-quality="offline"] .net-status-dot {
  animation: none;
  box-shadow: none;
  opacity: 0.5;
}

@keyframes net-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Operator Controls Header Right Deck */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 20;
  flex-shrink: 0;
}

/* Operator Badge in Header: LOG IN / SIGN UP (cyan) when unauthenticated, USERNAME (green) when authenticated */
.operator-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 4px);
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.operator-badge:hover,
.operator-badge:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-orange-border, rgba(255, 123, 0, 0.45));
  color: var(--text-primary, #ffffff);
  transform: translateY(-1px);
}

.operator-badge:active {
  transform: translateY(0);
  background: rgba(255, 123, 0, 0.15);
}

.operator-badge.authenticated {
  display: inline-flex !important;
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.operator-badge.authenticated:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Lock Command Deck Button in Header */
.btn-lock-deck {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  box-sizing: border-box;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 0.6875rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  cursor: pointer;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-lock-deck:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

/* In-Frame Adaptability (hides duplicate chrome when rendered in iframes) */
body.in-iframe {
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  min-height: 100% !important;
  overflow-y: auto !important;
  background: transparent !important;
}
body.in-iframe .hub-header,
body.in-iframe .hub-footer,
body.in-iframe .dock-drawer,
body.in-iframe .drawer-backdrop,
body.in-iframe .drawer-tab {
  display: none !important;
}
body.in-iframe .hub-main {
  padding: 1rem !important;
  min-height: 100% !important;
  max-width: 100% !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.brand-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent-orange);
  border-radius: 2px;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: var(--accent-orange-dim);
  border: 1px solid var(--accent-orange-border);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

/* Nav Tabs */
.header-nav,
.footer-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar,
.footer-nav::-webkit-scrollbar { display: none; }

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

.nav-tab-btn.active {
  color: var(--accent-orange);
  background: var(--accent-orange-dim, rgba(16, 185, 129, 0.12));
  border-color: var(--accent-orange-border);
  box-shadow: inset 0 -2px 0 var(--accent-orange), 0 0 12px var(--accent-glow, rgba(16, 185, 129, 0.2));
}

.hub-footer .nav-tab-btn.active {
  box-shadow: inset 0 2px 0 var(--accent-orange), 0 0 12px var(--accent-glow, rgba(16, 185, 129, 0.2));
}


.telemetry-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.telemetry-item + .telemetry-item {
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-ok);
}
.status-dot.warn { background: var(--status-warn); }
.status-dot.err { background: var(--status-err); }

/* Main Hub Content Area (80% standard width, clean header clearance, no artificial bottom overflow) */
.hub-main {
  position: relative !important;
  z-index: 1 !important;
  max-width: 80% !important;
  width: 80% !important;
  margin: 0 auto !important;
  padding: calc(var(--header-height) + 6px) 0 calc(var(--footer-height) + 1.25rem) 0 !important;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  box-sizing: border-box;
  overflow-y: visible !important;
  overflow-x: hidden;
  transition: padding var(--transition-fast);
}

/* Footer */
.hub-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--footer-height);
  min-height: var(--footer-height);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 1rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  z-index: 1020 !important;
  flex-shrink: 0;
  line-height: 1;
  gap: 0.5rem;
  box-sizing: border-box !important;
}

.footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-shortcuts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.shortcut-pill {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.125rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.shortcut-pill:hover,
.shortcut-pill:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-orange-border, rgba(255, 123, 0, 0.45));
  color: var(--text-primary);
  transform: translateY(-1px);
}

.shortcut-pill:active {
  transform: translateY(0);
  background: rgba(255, 123, 0, 0.15);
}

.shortcut-pill .shortcut-key {
  color: var(--accent-orange);
  font-weight: 700;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  flex-shrink: 0;
}

.footer-brand-mark {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.footer-brand-mark:hover {
  opacity: 0.85;
}

.internode-tesseract-svg {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 6px var(--accent-glow, rgba(16, 185, 129, 0.45)));
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hub-footer strong {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-orange);
}

@media (max-width: 640px) {
  .hub-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: var(--footer-height);
    padding: 0.2rem 0.5rem;
    text-align: center;
  }

  .footer-center {
    width: 100%;
    justify-content: center;
  }

  .footer-shortcuts {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  .shortcut-pill {
    padding: 0.15rem 0.35rem;
    font-size: 0.65rem;
  }
}



@media (max-width: 768px) {
  .hub-header {
    padding: 0 0.75rem;
  }
  .telemetry-strip {
    display: none;
  }
  .hub-main {
    padding: calc(var(--header-height) + 1rem) 0.75rem calc(var(--footer-height) + 1rem) !important;
  }
}

/* ==========================================================================
   COMMAND DECK HEADER-CENTERED TOAST NOTIFICATIONS
   Centered inside the 50px header bar across the entire suite and games
   ========================================================================== */
.hub-toast-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: var(--header-height, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.hub-toast {
  background: #14171e;
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-sm, 4px);
  padding: 5px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8), 0 0 12px var(--accent-orange-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.22s var(--transition-normal), transform 0.22s var(--transition-normal);
  white-space: nowrap;
  max-width: 90vw;
}

.hub-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hub-toast-icon {
  font-size: 0.8125rem;
  line-height: 1;
}

.hub-toast.toast-success {
  border-color: var(--status-ok, #22c55e);
  color: #86efac;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(34, 197, 94, 0.25);
}

.hub-toast.toast-warning {
  border-color: var(--status-warn, #f59e0b);
  color: #fde68a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(245, 158, 11, 0.25);
}

.hub-toast.toast-error {
  border-color: var(--status-err, #ef4444);
  color: #fca5a5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(239, 68, 68, 0.25);
}

.hub-toast.toast-info {
  border-color: var(--accent-orange, #ff6b00);
  color: #fed7aa;
}

/* ==========================================================================
   UNIFIED SUITE CARDS, METRICS & BUTTONS
   ========================================================================== */

/* Workstation Cards */
.hero-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 12px);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.metric-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.metric-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #38bdf8;
}

/* Companion Box */
.companion-banner {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.companion-code-display {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

/* Action Buttons */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.station-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.station-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-orange-border);
  color: var(--accent-orange);
}

.station-btn.primary {
  background: var(--accent-orange);
  color: var(--accent-orange-solid-text, #050508);
  border-color: var(--accent-orange);
}

.station-btn.primary:hover {
  background: var(--accent-orange-hover);
}

.station-btn.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.station-btn.danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Badge Status */
.badge-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  letter-spacing: 0.04em;
}

.badge-unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-orange, #10b981);
  border: 1px solid var(--accent-orange-border, rgba(16, 185, 129, 0.4));
}

.badge-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Embedded Frame Container */
.embedded-frame-container {
  width: 100%;
  height: calc(100vh - var(--header-height) - var(--footer-height) - 3rem);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.embedded-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* NOC Audit Log Table */
.noc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: left;
}

.noc-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.noc-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.noc-table tr:hover {
  background: rgba(16, 185, 129, 0.04);
}

/* ==========================================================================
   SOVEREIGN USER PROFILE & IDENTITY STYLES
   ========================================================================== */
.profile-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.85rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-tabs-nav::-webkit-scrollbar { display: none; }

.profile-subtab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.profile-subtab-btn:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-subtle);
}

.profile-subtab-btn.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
}

.profile-page-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.security-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.security-dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.security-dashboard-col .profile-page-card {
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .security-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .security-dashboard-col {
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {
  .profile-page-card {
    padding: 1.25rem 1rem;
  }
}


.sov-account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sov-account-title {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.04em;
}

.sov-section-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.sov-avatar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sov-avatar-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
}

.sov-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-orange-border);
  background: var(--bg-surface-elevated);
}

.sov-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 200px;
}

.sov-username-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sov-username-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.sov-avatar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.sov-link-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.sov-link-btn:hover {
  color: var(--accent-orange);
  text-decoration: underline;
}

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

.sov-header-auth-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.sov-meta-line {
  margin: 0.85rem 0 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}

/* Sovereign Profile 2-Column Responsive Flex Layout */
.sov-profile-columns {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.sov-profile-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sov-profile-col .sov-field-group {
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .sov-profile-columns {
    flex-direction: column;
    gap: 1.25rem;
  }
}

.sov-field-group {
  margin-bottom: 1.25rem;
}

.sov-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.sov-field-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.sov-input,
.sov-textarea,
.sov-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sov-textarea {
  resize: vertical;
  min-height: 60px;
}

.sov-input:focus,
.sov-textarea:focus,
.sov-select:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px var(--accent-orange-dim);
}

.btn-pwd-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.btn-pwd-eye:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.btn-pwd-eye:focus-visible {
  outline: 1px solid var(--accent-orange);
  border-radius: var(--radius-sm);
}

.sov-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.sov-between-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sov-count-badge {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.sov-card-drawer {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-fast);
}

.sov-card-drawer:hover {
  border-color: var(--border-medium);
}

.sov-drawer-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sov-drawer-subheading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.sov-section-divider {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 1.5rem 0;
}

.sov-card-header {
  margin-bottom: 1.25rem;
}

.sov-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sov-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

.sov-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.sov-save-btn {
  background: var(--accent-orange);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.65rem 2.25rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.sov-save-btn:hover {
  background: var(--accent-orange-hover);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.sov-save-btn:active {
  transform: translateY(0);
}

.btn-play-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-play-action.primary {
  background: var(--accent-orange);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.btn-play-action.primary:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-1px);
}

.btn-play-action.secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-play-action.secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-orange-border);
  color: var(--accent-orange);
}

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-badge.operator {
  background: var(--accent-orange-dim);
  color: var(--accent-orange);
  border: 1px solid var(--accent-orange-border);
}

.role-badge.guest {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ==========================================================================
   MODERN CYBER PILL TOGGLE SWITCH
   ========================================================================== */
.pill-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  user-select: none;
  cursor: pointer;
}

.pill-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  flex-shrink: 0;
}

.pill-toggle-switch .pill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.pill-toggle-switch[data-checked="true"] {
  background: var(--accent-orange-dim);
  border-color: var(--accent-orange-border);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.pill-toggle-switch[data-checked="true"] .pill-thumb {
  transform: translateX(22px);
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
}

.pill-toggle-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.pill-toggle-switch[data-checked="true"] + .pill-toggle-label {
  color: var(--accent-orange);
}

/* ==========================================================================
   🖨️ Clean Sheet Print & PDF Export Rules (@media print)
   Isolates content and completely hides deck drawers, toggle tabs, canvas,
   and interactive station chrome so print/PDF generation renders cleanly.
   ========================================================================== */
@media print {
  /* 1. Suppress all sliding deck drawers, tabs, backdrops, and ambient canvas */
  #drawer-left,
  #drawer-right,
  #drawer-top,
  #drawer-bottom,
  .dock-drawer,
  .drawer-tab,
  .drawer-backdrop,
  .matrix-canvas,
  #matrix-canvas,
  .internode-fx-canvas,
  #internode-fx-canvas,
  .hub-footer,
  .footer-shortcuts,
  #header-operator-controls,
  .btn-dock-toggle,
  .btn-lock-deck,
  .cookie-banner,
  .modal-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* 2. Reset html and body backgrounds to clean printable canvas */
  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* 3. Expand main viewport and content cards to full width */
  .hub-main,
  #app-viewport,
  .deck-container,
  .station-card,
  .widget-container,
  .storage-card,
  .profile-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    position: static !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* 4. Streamline header for print */
  .hub-header {
    position: static !important;
    border-bottom: 1px solid #cbd5e1 !important;
    background: transparent !important;
    padding: 0.5rem 0 !important;
  }

  .header-brand-mark,
  .header-nav {
    color: #0f172a !important;
  }

  /* 5. Clean text contrast for paper */
  h1, h2, h3, h4, p, span, td, th {
    color: #0f172a !important;
    text-shadow: none !important;
  }

  pre, code {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
  }
}

/* ==========================================================================
   BLEEDING-EDGE MODERN CSS ENGINE (2026 STANDARDS)
   ========================================================================== */

/* 1. CSS @starting-style entry transition for native dialogs */
@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.97);
  }
}

/* 2. Responsive Card Rules (Zero DevTools Container Deprecation Warnings) */
@media (max-width: 520px) {
  .card-header,
  .metric-row,
  .station-actions {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .telemetry-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 3. CSS Subgrid Alignment for Metric & Telemetry Grids */
@supports (grid-template-rows: subgrid) {
  .metrics-grid,
  .telemetry-grid {
    grid-template-rows: repeat(auto-fit, minmax(80px, 1fr));
  }
  .metrics-grid > .metric-card,
  .telemetry-grid > .telemetry-card {
    grid-row: span 2;
    display: grid;
    grid-template-rows: subgrid;
  }
}

/* 4. Modern CSS :has() State Selectors */
body:has(#drawer-top[data-state="expanded"]),
body:has(#drawer-top.active) {
  --header-indicator-color: var(--accent);
}

body:has(.auth-modal.active),
body:has(.cmd-palette-backdrop.active),
body:has(.modal-overlay.active),
body:has(.modal-overlay[style*="display: flex"]) {
  overflow: hidden !important;
}

/* Global Centered Modal Overlay Guarantee */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000 !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 1.5rem;
}

.modal-card {
  position: relative;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  margin: auto !important;
  box-sizing: border-box;
}

.auth-form-group:has(:user-invalid),
.form-group:has(:user-invalid) {
  border-color: var(--status-err, #ef4444) !important;
}

.auth-form-group:has(:focus-visible),
.form-group:has(:focus-visible) {
  border-color: var(--accent) !important;
}

/* 5. Global :focus-visible — consolidated to hub-theme.css */

/* 6. High-Performance Shimmer Skeleton Utility */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: var(--radius-sm, 4px);
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.15) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: skeleton-shimmer 1.8s infinite;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* 7. Content-Visibility Virtualization for Dense NOC Tables & Logs */
.noc-table tbody tr,
.audit-table tbody tr,
.storage-table tbody tr,
.log-stream-row {
  content-visibility: auto;
  contain-intrinsic-size: 0 38px;
}

/* ==========================================================================
   SCOPED JWT TOKEN GENERATOR & IN-BROWSER INSPECTOR (0-DEPENDENCY SUITE)
   ========================================================================== */
.jwt-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .jwt-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.jwt-panel-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.jwt-token-box {
  background: #06070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  word-break: break-all;
  user-select: text;
  max-height: 140px;
  overflow-y: auto;
}

.jwt-part-header {
  color: #f87171 !important;
  font-weight: 700;
}

.jwt-part-dot {
  color: #64748b !important;
  font-weight: 700;
  padding: 0 1px;
}

.jwt-part-payload {
  color: #c084fc !important;
  font-weight: 700;
}

.jwt-part-signature {
  color: #38bdf8 !important;
  font-weight: 700;
}

.jwt-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.jwt-pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jwt-pill-btn:hover {
  border-color: var(--accent-orange-border);
  color: var(--accent-orange);
}

.jwt-pill-btn.active {
  background: var(--accent-orange-dim);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  font-weight: 700;
}

.jwt-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.jwt-scope-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}

.jwt-scope-item:hover {
  border-color: var(--border-medium);
}

.jwt-scope-item input[type="checkbox"] {
  accent-color: var(--accent-orange);
  cursor: pointer;
}

.jwt-json-viewer {
  background: #06070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
}

.jwt-countdown-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #34d399;
}

.jwt-viewer-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #06070a;
}

.jwt-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.jwt-viewer-header.header-type {
  color: #f87171;
  border-left: 3px solid #f87171;
}

.jwt-viewer-header.payload-type {
  color: #c084fc;
  border-left: 3px solid #c084fc;
}

.jwt-viewer-card .jwt-json-viewer {
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}


/* ==========================================================================
   SOVEREIGN AUTH MODAL & FREQUENCY MODULATION COOKIE CONSENT
   ========================================================================== */

/* =====================================================================
   INTERNODE SOVEREIGN GATE & PROTOCOL THEME (CSS)
   Theme Studio Pro Bridge: Fully mapped to Theme Studio custom properties
   with fallback to Sovereign Obsidian/Emerald defaults.
   ===================================================================== */

:root {
  /* Surfaces & Backgrounds */
  --in-bg: var(--bg-primary, #050508);
  --in-card-bg: var(--bg-glass, var(--bg-surface, rgba(10, 10, 15, 0.92)));
  --in-card-border: var(--border-medium, rgba(39, 39, 42, 0.85));
  --in-surface-elevated: var(--bg-surface-elevated, #111116);
  --in-input-bg: var(--bg-surface-elevated, #09090b);
  --in-input-border: var(--border-subtle, #27272a);

  /* Typography */
  --in-text-main: var(--text-primary, #f4f4f5);
  --in-text-muted: var(--text-secondary, #a1a1aa);
  --in-text-subtle: var(--text-muted, #71717a);
  
  /* Primary Accent & Harmonics (Theme Studio Dynamic Accent) */
  --in-accent: var(--accent-primary, #10b981);
  --in-accent-hover: var(--accent-hover, #059669);
  --in-accent-dim: var(--accent-dim, rgba(16, 185, 129, 0.12));
  --in-accent-border: var(--accent-border, rgba(16, 185, 129, 0.35));
  --in-accent-glow: var(--accent-glow, rgba(16, 185, 129, 0.25));

  /* Specific Semantic Colors */
  --in-emerald: var(--color-emerald, #10b981);
  --in-emerald-hover: var(--color-emerald-hover, #059669);
  --in-emerald-soft: var(--color-emerald-soft, rgba(16, 185, 129, 0.12));
  --in-emerald-border: var(--color-emerald-border, rgba(16, 185, 129, 0.35));
  --in-emerald-glow: var(--color-emerald-glow, rgba(16, 185, 129, 0.25));

  --in-cyan: var(--color-cyan, #06b6d4);
  --in-cyan-soft: var(--color-cyan-soft, rgba(6, 182, 212, 0.12));
  --in-sky: var(--color-sky, #38bdf8);
  
  --in-red: var(--color-danger, #ef4444);
  --in-red-soft: var(--color-danger-soft, rgba(239, 68, 68, 0.15));
  --in-red-border: var(--color-danger-border, rgba(239, 68, 68, 0.4));

  /* Fonts & Geometry */
  --in-font-sans: var(--font-main, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  --in-font-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace);
  
  --in-radius-card: var(--radius-card, 16px);
  --in-radius-input: var(--radius-input, 8px);
  --in-radius-btn: var(--radius-btn, 10px);
}

/* Base resets inside the gate overlay */
.internode-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #121316;
  background-image: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(38, 40, 48, 0.7), rgba(14, 15, 18, 0.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: var(--in-font-sans);
  color: var(--in-text-main);
  box-sizing: border-box;
  overflow-y: auto;
  user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.internode-gate-overlay.hidden {
  display: none !important;
}

/* Modal Card */
.internode-card {
  width: 100%;
  max-width: 440px;
  min-height: 708px;
  height: 708px;
  max-height: 96vh;
  overflow: hidden !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  display: flex;
  flex-direction: column;
  background: var(--in-card-bg);
  border: 1px solid var(--in-card-border);
  border-radius: var(--in-radius-card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 0, 0, 0.6);
  padding: 1.15rem 1.75rem 0.85rem 1.75rem;
  box-sizing: border-box;
  animation: inScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.internode-card::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.internode-card::-webkit-scrollbar-track {
  display: none !important;
}
.internode-card::-webkit-scrollbar-thumb {
  display: none !important;
}

.in-modal-header,
.in-header {
  flex: 0 0 auto;
  min-height: 114px;
  max-height: 114px;
  width: 100%;
  margin-bottom: 0.5rem;
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

/* Theme Studio Conforming Anchored Modal Close Button (Borderless & Unclipped) */
.in-modal-close-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: var(--in-radius-btn, 8px);
  background: var(--in-surface-elevated, var(--bg-surface-elevated, rgba(255, 255, 255, 0.05)));
  border: none !important;
  outline: none !important;
  color: var(--in-text-muted, var(--text-secondary, #a1a1aa));
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  z-index: 20;
}

.in-modal-close-btn:hover {
  background: var(--in-red-soft, rgba(239, 68, 68, 0.18));
  border: none !important;
  outline: none !important;
  color: var(--in-red, #ef4444);
  transform: translateY(-1px);
}

.in-modal-close-btn:focus,
.in-modal-close-btn:focus-visible {
  border: none !important;
  outline: none !important;
  background: var(--in-surface-elevated, var(--bg-surface-elevated, rgba(255, 255, 255, 0.1)));
}

.in-modal-close-btn:active {
  border: none !important;
  outline: none !important;
  transform: translateY(0) scale(0.96);
}

.in-brand-icon {
  display: inline-flex;
  padding: 0.6rem;
  border-radius: 14px;
  background: rgba(255, 0, 127, 0.08);
  border: 1px solid rgba(255, 0, 127, 0.25);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.25);
  margin-bottom: 0.45rem;
}

.in-title {
  font-family: var(--in-font-sans);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.in-subtitle {
  font-family: var(--in-font-mono);
  font-size: 0.72rem;
  color: var(--in-text-muted, #a1a1aa);
  margin-top: 0.35rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Feedback Messages */
.in-alert {
  padding: 0.5rem 0.85rem;
  border-radius: var(--in-radius-input);
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.in-alert-error {
  background: var(--in-red-soft);
  border: 1px solid var(--in-red-border);
  color: #fca5a5;
  animation: inShake 0.4s ease;
}

.in-alert-success {
  background: var(--in-emerald-soft);
  border: 1px solid var(--in-emerald-border);
  color: #6ee7b7;
}

.in-alert-info {
  background: rgba(39, 39, 42, 0.6);
  border: 1px solid var(--in-card-border);
  color: var(--in-text-muted);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

/* Forms & Inputs */
.in-form-group {
  margin-bottom: 0.62rem;
  text-align: left;
}

.in-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.22rem;
}

.in-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--in-text-muted, var(--text-secondary, #a1a1aa));
  letter-spacing: 0.02em;
}

.in-input,
.text-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--in-input-bg, var(--bg-surface-elevated, #09090b));
  border: 1px solid var(--in-input-border, var(--border-subtle, #27272a));
  border-radius: var(--in-radius-input, var(--radius-input, 8px));
  padding: 0.5rem 0.8rem;
  color: var(--in-text-main, var(--text-primary, #fff));
  font-family: var(--in-font-mono);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.in-input:focus,
.text-input:focus {
  border-color: var(--in-accent, var(--accent-orange, #10b981));
  box-shadow: 0 0 0 2px var(--in-accent-dim, var(--accent-orange-dim, rgba(16, 185, 129, 0.25)));
}

.in-input[readonly],
.text-input[readonly] {
  background: rgba(24, 24, 27, 0.5);
  color: var(--in-text-subtle, var(--text-muted, #71717a));
  cursor: default;
}

/* Password Toggle */
.in-toggle-btn {
  background: transparent;
  border: none;
  color: var(--in-text-subtle);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
}

.in-toggle-btn:hover {
  color: var(--in-text-main);
}

/* Primary Action Buttons */
.in-btn-primary {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--in-accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: var(--in-radius-btn);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--in-accent-glow);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.in-btn-primary:hover {
  background: var(--in-accent-hover);
  box-shadow: 0 6px 20px var(--in-accent-glow);
}

.in-btn-primary:active {
  transform: scale(0.985);
}

.in-btn-secondary {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(39, 39, 42, 0.6);
  color: var(--in-text-main);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--in-card-border);
  border-radius: var(--in-radius-btn);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.in-btn-secondary:hover {
  background: rgba(63, 63, 70, 0.8);
  border-color: #52525b;
}

.in-link-btn {
  background: transparent;
  border: none;
  color: var(--in-accent);
  font-size: 0.74rem;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.in-link-btn:hover {
  text-decoration: underline;
}

/* 2FA Digit Segment Input */
.in-digit-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.25rem 0;
}

.in-digit-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-family: var(--in-font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 8px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.in-digit-input:focus {
  border-color: var(--in-emerald);
  box-shadow: 0 0 12px var(--in-emerald-glow);
}

/* QR Code Display Card */
.in-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(18, 18, 24, 0.95);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #27272a;
  margin-bottom: 0.65rem;
}

.in-qr-box svg,
.in-qr-box .internode-qr-svg {
  background: #ffffff !important;
  border-radius: 4px;
  padding: 8px;
  box-sizing: content-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.in-secret-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  margin-top: 0.55rem;
  width: 100%;
  box-sizing: border-box;
}

.in-secret-text {
  font-family: var(--in-font-mono);
  font-size: 0.8rem;
  color: var(--in-emerald);
  letter-spacing: 0.05em;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Backup Codes Grid */
.in-backup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  margin: 0.25rem 0 0.45rem 0;
}

.in-backup-code-item {
  font-family: var(--in-font-mono);
  font-size: 0.72rem;
  color: #fff;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.35rem;
  background: #18181b;
  border-radius: 5px;
  text-align: center;
}

/* Footer Attribution */
.in-gate-footer {
  margin-top: 0.75rem;
  font-family: var(--in-font-mono);
  font-size: 0.68rem;
  color: var(--in-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  opacity: 0.85;
}

/* Stealth Wipe Database Trigger */
#in-btn-wipe-database,
.in-wipe-trigger {
  cursor: inherit !important;
  color: inherit !important;
  text-decoration: none !important;
  outline: none !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font: inherit !important;
}

/* =====================================================================
   COOKIE CONSENT: Frequency Modulation Banner & Modal
   ===================================================================== */

.in-protocol-notice,
.in-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--in-card-bg, rgba(10, 10, 15, 0.95));
  border-top: 1px solid var(--in-card-border, rgba(39, 39, 42, 0.85));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.95rem 1.85rem;
  z-index: 10001;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--in-font-sans);
}

.in-protocol-notice.visible,
.in-cookie-banner.visible {
  transform: translateY(0);
}

.in-protocol-notice.hidden,
.in-cookie-banner.hidden {
  display: none !important;
}

.in-cookie-content p {
  font-size: 0.84rem;
  color: var(--in-text-muted, #a1a1aa);
  margin: 0;
  line-height: 1.45;
}

.in-cookie-content strong {
  color: var(--in-text-main, #f4f4f5);
}

.in-cookie-policy-link {
  color: var(--in-accent, #10b981) !important;
  text-decoration: underline;
  margin-left: 0.35rem;
  transition: color 0.15s ease;
}

.in-cookie-policy-link:hover {
  color: var(--in-accent-hover, #34d399) !important;
}

.in-cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.in-cookie-btn {
  font-family: var(--in-font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.6rem 1.15rem;
  border-radius: var(--in-radius-btn, 8px);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.in-cookie-btn.solid {
  background: var(--in-accent, #10b981);
  border: 1px solid var(--in-accent, #10b981);
  color: #ffffff;
  box-shadow: 0 0 15px var(--in-accent-glow, rgba(16, 185, 129, 0.2));
}

.in-cookie-btn.solid:hover {
  background: var(--in-accent-hover, #059669);
  border-color: var(--in-accent-hover, #059669);
  box-shadow: 0 0 22px var(--in-accent-glow, rgba(16, 185, 129, 0.4));
  transform: translateY(-1px);
}

.in-cookie-btn.solid:active {
  transform: translateY(0);
}

.in-cookie-btn.outline {
  background: var(--in-surface-elevated, #111116);
  border: 1px solid var(--in-card-border, rgba(39, 39, 42, 0.85));
  color: var(--in-text-main, #f4f4f5);
}

.in-cookie-btn.outline:hover {
  background: #18181b;
  border-color: #52525b;
  color: #ffffff;
  transform: translateY(-1px);
}

.in-cookie-btn.outline:active {
  transform: translateY(0);
}

/* Cookie Settings Modal */
.in-cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10005;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.in-cookie-modal-overlay.hidden,
.hidden {
  display: none !important;
}

.in-cookie-modal-box {
  background: rgba(15, 17, 23, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  padding: 1.75rem 2rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 35px rgba(16, 185, 129, 0.12);
  color: #f4f4f5;
  font-family: var(--in-font-sans, system-ui, sans-serif);
  animation: inScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.in-cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.in-cookie-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
}

.in-cookie-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  border-radius: 8px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.in-cookie-modal-close:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.in-cookie-modal-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.in-cookie-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 0.95rem 1.15rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all 0.15s ease;
}

.in-cookie-opt:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(16, 185, 129, 0.25);
}

.in-cookie-opt-info h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.in-cookie-opt-info p {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

/* Toggle Switch */
.in-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.in-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.in-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.in-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

input:checked + .in-slider {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
}

input:checked + .in-slider:before {
  transform: translateX(20px);
}

input:disabled + .in-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Animations */
@keyframes inScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes inShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* =====================================================================
   OIDC & FEDERATED AUTH (OPTION #1: VERTICAL STACK)
   ===================================================================== */
.in-oidc-container {
  margin-top: 0;
  width: 100%;
}

.in-oidc-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.85rem 0;
  color: var(--in-text-subtle);
}

.in-oidc-divider::before,
.in-oidc-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--in-card-border, rgba(255, 255, 255, 0.1));
}

.in-oidc-divider span {
  padding: 0 0.85rem;
  font-family: var(--in-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--in-text-subtle);
  background: transparent;
}

.in-oidc-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.in-oidc-list.in-oidc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.in-oidc-list.in-oidc-grid .in-oidc-btn {
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
  justify-content: center;
}

.in-oidc-list.in-oidc-grid .in-oidc-btn-icon {
  margin-right: 6px;
  width: 18px;
}

.in-oidc-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.65rem 1rem 0.65rem max(1rem, calc(50% - 86px));
  width: 100%;
  box-sizing: border-box;
  background: var(--in-surface-elevated, #111116);
  border: 1px solid var(--in-card-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--in-radius-btn, 10px);
  color: var(--in-text-main, #f4f4f5);
  font-family: var(--in-font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.in-oidc-btn:hover {
  background: rgba(39, 39, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.in-oidc-btn:active {
  transform: translateY(0);
}

.in-oidc-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  margin-right: 10px;
}

.in-oidc-btn-icon svg {
  margin-right: 0 !important;
}

.in-oidc-btn-text {
  text-align: left;
  white-space: nowrap;
}

.in-oidc-google:hover {
  border-color: rgba(66, 133, 244, 0.45);
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.18);
}

.in-oidc-github:hover {
  border-color: rgba(240, 246, 252, 0.4);
  box-shadow: 0 4px 14px rgba(240, 246, 252, 0.12);
}

.in-oidc-discord:hover {
  border-color: rgba(88, 101, 242, 0.55);
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.25);
}

.in-oidc-authentik:hover {
  border-color: rgba(253, 90, 31, 0.55);
  box-shadow: 0 4px 14px rgba(253, 90, 31, 0.25);
}

.in-oidc-authelia:hover {
  border-color: rgba(25, 118, 210, 0.55);
  box-shadow: 0 4px 14px rgba(25, 118, 210, 0.25);
}

.in-oidc-keycloak:hover {
  border-color: rgba(0, 192, 243, 0.55);
  box-shadow: 0 4px 14px rgba(0, 192, 243, 0.25);
}

.in-oidc-tailscale:hover {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.in-oidc-passkey:hover {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.in-oidc-oidc:hover {
  border-color: var(--in-accent-border, rgba(16, 185, 129, 0.35));
  box-shadow: 0 4px 14px var(--in-accent-glow, rgba(16, 185, 129, 0.25));
}

/* Remember Me Checkbox Row */
.in-remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0.5rem 0 0.85rem 0;
  user-select: none;
}

.in-remember-checkbox {
  accent-color: var(--in-accent, #10b981);
  width: 15px;
  height: 15px;
  cursor: pointer;
  margin: 0;
}

.in-remember-label {
  font-size: 0.8125rem;
  color: var(--in-text-muted, #a1a1aa);
  cursor: pointer;
  margin: 0;
  line-height: 1;
}

.in-remember-label:hover {
  color: var(--in-text, #f4f4f5);
}

/* 2FA Setup Checkbox Row (Guaranteed Single-Line Horizontal Flex) */
.in-setup-2fa-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0.45rem 0 0.75rem 0;
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}

.in-setup-2fa-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--in-text-muted, #a1a1aa);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.in-setup-2fa-label:hover {
  color: var(--in-text, #f4f4f5);
}

.in-setup-2fa-checkbox {
  accent-color: var(--in-accent, #10b981);
  width: 15px;
  height: 15px;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
  display: inline-block;
}

/* Navigation Link & Modal Footer Styles (100% Symmetrical & Unified) */
.in-advanced-link-wrapper {
  text-align: center;
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.in-advanced-login-link,
.in-btn-back-to-standard,
.in-modal-nav-link {
  font-family: var(--in-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--in-text-subtle, #71717a);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.18s ease, background 0.18s ease;
}

.in-advanced-login-link:hover,
.in-btn-back-to-standard:hover,
.in-modal-nav-link:hover {
  color: var(--in-accent, #10b981);
  background: rgba(16, 185, 129, 0.08);
}

.in-modal-layout,
.in-standard-view-container,
.in-advanced-view-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.in-modal-body,
.in-standard-body,
.in-advanced-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Modal Content Area Centering */
.in-modal-content-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
  box-sizing: border-box;
}

.in-modal-body::-webkit-scrollbar,
.in-standard-body::-webkit-scrollbar,
.in-advanced-body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* .in-advanced-provider-list — canonical rule at L1147 below */

.in-modal-footer,
.in-standard-footer,
.in-advanced-footer {
  flex: 0 0 auto;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-top: 0.55rem;
  padding-bottom: 0.15rem;
  transform: translateY(2px);
  border-top: 1px solid var(--border-subtle, var(--in-card-border, rgba(255, 255, 255, 0.08)));
  box-sizing: border-box;
}

.in-advanced-disclaimer {
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--in-border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--in-text-subtle, #71717a);
  text-align: center;
  line-height: 1.4;
}

.in-advanced-badge {
  font-size: 0.75rem;
  color: var(--in-text-subtle, #71717a);
  margin: 0.35rem 0 0.85rem 0;
  padding-left: 0.5rem;
  line-height: 1.35;
}

.in-advanced-badge-authentik {
  border-left: 2px solid #fd5a1f;
}

.in-advanced-badge-passkey {
  border-left: 2px solid #10b981;
}

/* Provider Info Micro-Badge */
.in-oidc-btn-info-badge {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--in-text-subtle, #71717a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-family: var(--in-font-mono, monospace);
  font-weight: 600;
  opacity: 0.75;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.in-oidc-btn:hover .in-oidc-btn-info-badge,
.in-oidc-btn:focus-visible .in-oidc-btn-info-badge {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

/* =====================================================================
   ADVANCED PROVIDERS & SUBTEXT DESCRIPTIONS (Balanced & Symmetrical)
   ===================================================================== */
.in-advanced-provider-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-evenly;
  margin: 0.35rem 0;
  gap: 0.35rem;
}

.in-advanced-provider-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.in-advanced-provider-desc {
  font-size: 0.69rem;
  color: var(--in-text-subtle, #71717a);
  line-height: 1.3;
  text-align: center;
  padding: 0 0.5rem;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.in-advanced-provider-item:hover .in-advanced-provider-desc {
  color: var(--in-text-muted, #a1a1aa);
}

/* =====================================================================
   SITE-WIDE ACCESSIBLE CSS TOOLTIP (Zero External Dependencies)
   ===================================================================== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(14, 14, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  color: #f4f4f5;
  white-space: normal;
  width: max-content;
  max-width: 310px;
  text-align: center;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
  z-index: 100;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(14, 14, 22, 0.96) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
  z-index: 101;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

/* =====================================================================
   MOBILE RESPONSIVE & DYNAMIC AUTO-FIT
   ===================================================================== */
@media (max-width: 640px), (max-height: 740px) {
  .internode-gate-overlay {
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  }

  .internode-card {
    width: 100%;
    max-width: 420px;
    height: auto;
    min-height: min(540px, calc(100dvh - 1rem));
    max-height: calc(100dvh - 1rem);
    padding: 0.85rem 1rem;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
  }

  .in-modal-body,
  .in-standard-body,
  .in-advanced-body {
    overflow-y: auto !important;
    max-height: none;
    scrollbar-width: thin;
  }

  /* Compact Header on Mobile */
  .in-header {
    margin-bottom: 0.35rem;
  }

  .in-brand-icon {
    padding: 0.4rem;
    border-radius: 12px;
    margin-bottom: 0.3rem;
  }

  .in-brand-icon svg {
    width: 26px !important;
    height: 26px !important;
  }

  .in-title {
    font-size: 0.86rem;
  }

  .in-subtitle {
    font-size: 0.67rem;
    margin-top: 0.15rem;
  }

  /* Feedback Alerts */
  .in-alert {
    padding: 0.35rem 0.6rem;
    font-size: 0.73rem;
    margin-bottom: 0.35rem;
  }

  /* Tighter Form Elements & Inputs */
  .in-form-group {
    margin-bottom: 0.35rem;
  }

  .in-label {
    font-size: 0.71rem;
    margin-bottom: 0.2rem;
  }

  .in-input {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
  }

  .in-pwd-meter-container {
    margin-top: 3px;
  }

  .in-remember-row {
    margin: 0.3rem 0 0.45rem 0;
  }

  .in-remember-label {
    font-size: 0.74rem;
  }

  .in-btn-primary,
  .in-btn-secondary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.55rem 0.95rem;
    font-size: 0.81rem;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Divider & OIDC Stack */
  .in-oidc-divider {
    margin: 0.35rem 0;
  }

  .in-oidc-divider span {
    font-size: 0.63rem;
  }

  .in-oidc-list {
    gap: 0.3rem;
  }

  .in-oidc-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.78rem;
    min-height: 36px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .in-oidc-btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 8px !important;
    flex-shrink: 0 !important;
  }

  .in-oidc-btn-icon svg {
    width: 15px !important;
    height: 15px !important;
    margin-right: 0 !important;
  }

  .in-oidc-btn-text {
    text-align: center !important;
  }

  .in-advanced-link-wrapper {
    margin-top: 0.55rem;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .in-advanced-login-link,
  .in-btn-back-to-standard,
  .in-modal-nav-link {
    font-size: 0.76rem;
    padding: 4px 8px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Advanced Provider List on Mobile (Symmetrical & Equal Height) */
  .in-advanced-view-container {
    height: 100% !important;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
  }

  .in-advanced-provider-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    margin: 0.35rem 0;
    gap: 0.35rem;
  }

  .in-advanced-provider-desc {
    font-size: 0.63rem;
    line-height: 1.25;
  }

  .in-advanced-footer {
    margin-top: 0.4rem;
    gap: 0.4rem;
  }

  .in-advanced-disclaimer {
    padding: 0.4rem 0.6rem;
    font-size: 0.67rem;
    line-height: 1.3;
  }

  /* Mobile Cookie Banner (Compact, stacked, non-intrusive) */
  .in-cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
  }

  .in-cookie-content p {
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: left;
    margin: 0;
  }

  .in-cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .in-cookie-btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.72rem;
    text-align: center;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
  }

  .in-cookie-modal-overlay {
    padding: 0.5rem;
  }

  .in-cookie-modal-box {
    padding: 1.15rem 1rem;
    max-width: 100%;
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
  }
}

/* 2FA Verification Success Pulse Animation */
@keyframes inPulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.55);
    transform: scale(1.04);
  }
}

.in-success-ring {
  transition: all 0.3s ease;
}

