/* ============================================================================
 * KL-AUDIT v3.0 // 43PR HYPRLAND SEC-OPS HUD STYLESHEET
 * Extracted directly from 43PR/dotfiles (.config/quickshell/Theme.qml,
 * Bar.qml, PerspectivePanel.qml, SettingsWindow.qml, ThemesPage.qml)
 * ============================================================================ */

@property --ang {
  syntax: '<angle>';
  inherits: false;
  initial-value: 135deg;
}

:root {
  /* Default Theme: 43pr GOLD ("gold" in ThemesPage.qml) */
  --bg: #120f05;
  --bg-panel: #120f05;
  --surface: #1a1608;
  --track-bg: #161616;
  --fg: #f5e6b8;
  --muted: #8c7a3c;
  --faint: #5c4f24;
  --border: #3a3218;
  --border-accent: #635118;
  --accent: #ffc832;
  --accent2: #e6a817;
  --danger: #ff003c;
  --warn: #f5a623;
  --ok: #00ff9c;

  /* 43pr Hub Knobs (Theme.qml lines 10-32) */
  --bg-alpha: 0.78;
  --radius: 10px;
  --bar-radius: 16px;
  --tilt-strength: 7;
  --border-opacity: 1.0;
  --blur-px: 18px;

  /* 43pr Exact Qt Easing Curves (Claude Opus 5.5 derivation from Qt QEasingCurve) */
  --ease-out-back: cubic-bezier(0.3333, 1.5672, 0.6667, 1);
  --ease-out-cubic: cubic-bezier(0.3333, 1, 0.6667, 1);
  --anim-fast: 120ms;
  --anim-med: 220ms;
  --anim-slow: 380ms;

  /* 43pr Typography (Theme.qml lines 13-24) */
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  --text-title: 18px;
  --text-section: 15px;
  --text-group: 12px;
  --text-body: 11px;
  --text-small: 10px;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Allow text selection on code, file paths, SHAs, and R0 IDs (per Claude audit) */
.selectable, code, pre, .file-path-cell, .sha-cell, .r0-badge, .insp-meta-val {
  user-select: text;
  cursor: text;
}

/* ============================================================================
 * BACKGROUND LAYER (43pr Abstract Geometric + Tactical Grid + Crosshair 3x3)
 * ============================================================================ */
.desktop-wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 52% 46%, rgba(255, 255, 255, 0.035) 0%, transparent 58%),
    radial-gradient(circle at 18% 82%, rgba(255, 0, 60, 0.03) 0%, transparent 45%),
    linear-gradient(180deg, rgba(10, 12, 16, 0.4) 0%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: none;
}

.desktop-wallpaper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* 43pr Tactical 3x3 Crosshair Overlay (frame_8s.jpg / Target Lock) */
.tactical-reticle-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--anim-med) var(--ease-out-cubic);
}
.tactical-reticle-overlay.active {
  opacity: 1;
}
.reticle-grid-line-v1, .reticle-grid-line-v2 {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 2%, var(--accent) 50%, transparent 98%);
  opacity: 0.28;
}
.reticle-grid-line-v1 { left: 33.333%; }
.reticle-grid-line-v2 { left: 66.666%; }

.reticle-grid-line-h1, .reticle-grid-line-h2 {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 2%, var(--accent) 50%, transparent 98%);
  opacity: 0.28;
}
.reticle-grid-line-h1 { top: 33.333%; }
.reticle-grid-line-h2 { top: 66.666%; }

.reticle-intersection {
  position: absolute;
  font-size: 9px;
  color: var(--accent);
  opacity: 0.65;
  padding: 4px 6px;
  letter-spacing: 0.5px;
}

/* ============================================================================
 * HYPRLAND WINDOW BORDER SYSTEM (Theme.qml _borderLua: "full" vs "corner")
 * ============================================================================ */
.hypr-win {
  position: relative;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) calc(var(--bg-alpha) * 100%), transparent);
  backdrop-filter: blur(var(--blur-px));
  -webkit-backdrop-filter: blur(var(--blur-px));
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    border-color var(--anim-med) var(--ease-out-cubic),
    opacity var(--anim-med) var(--ease-out-cubic),
    transform var(--anim-med) var(--ease-out-cubic);
}

/* Corner border gradient mode (45deg, solid at TL/BR, transparent between) */
body[data-border-style="corner"] .hypr-win {
  border: 1px solid transparent;
  background:
    linear-gradient(
      color-mix(in srgb, var(--surface) calc(var(--bg-alpha) * 100%), #000),
      color-mix(in srgb, var(--surface) calc(var(--bg-alpha) * 100%), #000)
    ) padding-box,
    linear-gradient(
      var(--ang),
      var(--border-accent) 0%,
      var(--border-accent) 18%,
      transparent 32%,
      transparent 68%,
      var(--border-accent) 82%,
      var(--border-accent) 100%
    ) border-box;
}

body[data-border-style="corner"] .hypr-win.focused {
  background:
    linear-gradient(
      color-mix(in srgb, var(--surface) calc(var(--bg-alpha) * 100%), #000),
      color-mix(in srgb, var(--surface) calc(var(--bg-alpha) * 100%), #000)
    ) padding-box,
    linear-gradient(
      var(--ang),
      var(--accent) 0%,
      var(--accent) 22%,
      transparent 38%,
      transparent 62%,
      var(--accent) 78%,
      var(--accent) 100%
    ) border-box;
  animation: hyprBorderAngle 6s linear infinite;
}

body[data-border-style="full"] .hypr-win.focused {
  border-color: var(--accent);
}

@keyframes hyprBorderAngle {
  to { --ang: 495deg; }
}

.hypr-win.danger-focus {
  border-color: var(--danger) !important;
}

/* Window Title Header inside Tiled Windows */
.win-bar {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
  font-size: var(--text-small);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.win-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.win-bar-title {
  color: var(--fg);
  font-weight: 700;
}

.win-bar-tag {
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-accent);
  color: var(--muted);
  font-size: 9px;
}

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

.win-btn {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--anim-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.win-btn:hover, .win-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}
.win-btn.danger {
  border-color: rgba(255, 0, 60, 0.45);
  color: var(--danger);
}
.win-btn.danger:hover, .win-btn.danger.active {
  background: var(--danger);
  color: #000;
  font-weight: 700;
}

/* ============================================================================
 * AUTHENTIC 43PR VERTICAL LEFT SIDEBAR (High-Visibility Framed Tactical Buttons)
 * ============================================================================ */
.qs-bar {
  position: fixed;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 60px;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 92%, #000);
  backdrop-filter: blur(var(--blur-px));
  -webkit-backdrop-filter: blur(var(--blur-px));
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  transition: all var(--anim-med) var(--ease-out-cubic);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75);
}

.bar-lane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.bar-section-div {
  width: 100%;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 2px;
}

/* Framed Sidebar Action Buttons (.bar-mod-btn) */
.bar-mod-btn {
  width: 50px;
  min-height: 36px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-accent);
  color: var(--fg);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
  padding: 4px 2px;
  transition: all var(--anim-fast);
}
.bar-mod-btn:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.bar-mod-btn.danger-btn {
  border-color: rgba(255, 0, 60, 0.65);
  background: rgba(255, 0, 60, 0.14);
}
.bar-mod-btn.danger-btn:hover {
  background: var(--danger);
  color: #fff;
}
.bar-btn-ico {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}
.bar-mod-btn.danger-btn .bar-btn-ico {
  color: var(--danger);
}
.bar-mod-btn.danger-btn:hover .bar-btn-ico {
  color: #fff;
}
.bar-btn-lbl {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--fg);
  text-transform: uppercase;
}
.bar-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 11px;
  border: 1px solid #000;
}

/* StatBadge Capsule (F/S, R0 BUG) */
.stat-badge {
  width: 50px;
  padding: 4px 2px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: all var(--anim-fast);
}
.stat-badge:hover {
  border-color: var(--accent);
}
.stat-badge.warn {
  border-color: rgba(255, 0, 60, 0.65);
  background: rgba(255, 0, 60, 0.14);
}
.stat-badge-lbl {
  font-size: 7.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.stat-badge-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}
.stat-badge.warn .stat-badge-val {
  color: var(--danger);
}

/* High-Visibility Labeled Workspace Buttons (01 RADAR .. 06 VERDICT) */
.ws-dots-lane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}
.ws-dot {
  width: 50px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-accent);
  color: var(--fg);
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all var(--anim-fast);
}
.ws-dot .ws-num {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}
.ws-dot .ws-lbl {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.ws-dot:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.ws-dot:hover .ws-lbl {
  color: var(--fg);
}
.ws-dot.focused {
  background: var(--accent);
  border-color: var(--fg);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.ws-dot.focused .ws-num,
.ws-dot.focused .ws-lbl {
  color: #000000 !important;
  font-weight: 800;
}
.ws-dot.urgent {
  border-color: rgba(255, 0, 60, 0.7);
}
.ws-dot.urgent .ws-num {
  color: var(--danger);
}

/* Stacked Vertical Clock */
.bar-clock-mod {
  width: 50px;
  padding: 6px 2px;
  border-radius: 7px;
  border: 1px solid var(--border-accent);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--accent);
  transition: all var(--anim-fast);
}
.bar-clock-mod:hover, .bar-clock-mod.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
  color: var(--fg);
}

/* ============================================================================
 * TOP-RIGHT RECORDER OSD PILL (RecorderOSD.qml lines 174-260)
 * ============================================================================ */
.recorder-osd-pill {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 65;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  cursor: grab;
}
.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: hardBlink 1s steps(1) infinite;
}
.rec-dot.paused {
  background: var(--warn);
  animation: none;
}
@keyframes hardBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}
.rec-ctrl-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
}
.rec-ctrl-icon:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
 * HYPRLAND WORKSPACE CONTAINER (6 Discrete Workspaces, Zero Fake Slider)
 * ============================================================================ */
.hypr-stage {
  position: fixed;
  top: 6px;
  bottom: 6px;
  left: 72px;
  right: 6px;
  z-index: 10;
}

.hypr-workspace {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity var(--anim-med) var(--ease-out-cubic),
    transform var(--anim-med) var(--ease-out-cubic);
  content-visibility: hidden;
}

.hypr-workspace.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  content-visibility: visible;
}

/* WS 1 Layout: Left File Tree (355px) | Center Trust Radar (1fr) | Right Threats & Stream (375px) */
#ws-1 {
  grid-template-columns: 355px 1fr 375px;
  grid-template-rows: 1fr;
}

/* WS 2 Layout: Round 0 Census & 2-Axis Matrix */
#ws-2 {
  grid-template-columns: 310px 1fr;
  grid-template-rows: auto 1fr;
}

/* WS 3 Layout: Twin-Service Drift & Source-to-Sink Trace */
#ws-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 220px 1fr;
}

/* WS 4 Layout: Singapore vs Malaysia Cloud & SG Attribution */
#ws-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* WS 5 Layout: DFIR Timeline & Host IOCs */
#ws-5 {
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: 1fr;
}

/* WS 6 Layout: Go-Live Gate & Report Exporter */
#ws-6 {
  grid-template-columns: 380px 1fr;
  grid-template-rows: 1fr;
}

/* ============================================================================
 * PILLAR 2: LIVE AUTO-SCROLLING FILE-SYSTEM TREE (Left Pane of WS 1)
 * ============================================================================ */
.tree-toolbar {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
}
.tree-filter-input {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border-accent);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  outline: none;
}
.tree-filter-input:focus {
  border-color: var(--accent);
}

.tree-col-header {
  display: grid;
  grid-template-columns: 16px 1fr 54px 34px 36px;
  gap: 4px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  text-transform: uppercase;
}

.tree-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 2px 0;
}
.tree-viewport::-webkit-scrollbar {
  width: 4px;
}
.tree-viewport::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 2px;
}

.tree-repo-group {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.035);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.tree-row {
  height: 20px;
  display: grid;
  grid-template-columns: 16px 1fr 54px 34px 36px;
  gap: 4px;
  align-items: center;
  padding: 0 8px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 80ms linear, color 80ms linear;
}
.tree-row:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}

/* Active Laser Scan Head (High-Contrast 43pr Accent Beam) */
.tree-row.scan-head {
  background: var(--accent) !important;
  color: #000000 !important;
  font-weight: 800;
  border-left: 3px solid var(--fg);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.tree-row.scan-head .sha-cell,
.tree-row.scan-head .cls-cell,
.tree-row.scan-head .r0-cell {
  color: #000000 !important;
}

/* Phosphor Trail behind Scan Head */
.tree-row.scan-trail-1 {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--fg);
  border-left-color: var(--accent);
}
.tree-row.scan-trail-2 {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--fg);
}
.tree-row.scan-trail-3 {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

/* File with Confirmed R0 Vulnerability */
.tree-row.has-vuln {
  color: var(--danger);
  background: rgba(255, 0, 60, 0.08);
  border-left-color: var(--danger);
  font-weight: 600;
}

.file-path-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sha-cell {
  font-size: 9px;
  color: var(--faint);
  text-align: right;
}
.cls-cell {
  font-size: 8.5px;
  text-align: center;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.r0-cell {
  font-size: 9px;
  text-align: right;
  font-weight: 700;
}
.r0-cell.vuln {
  color: var(--danger);
}
.r0-cell.clean {
  color: var(--ok);
}

.tree-footer {
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9.5px;
}

/* ============================================================================
 * PILLAR 1: INTERACTIVE RADAR & ARCHITECTURE CALL-PATH GRAPH (Center Pane)
 * ============================================================================ */
.radar-stage-wrap {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.85) 100%);
  overflow: hidden;
}

#tacticalRadarCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Breadcrumb & Attack Replay Toolbar inside Radar */
.radar-top-hud {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}
.radar-breadcrumb {
  pointer-events: auto;
  background: rgba(5, 5, 5, 0.85);
  border: 1px solid var(--border-accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 6px;
}
.radar-replay-bar {
  pointer-events: auto;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* Replay Packet Banner */
.attack-replay-banner {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 340px;
  background: rgba(12, 4, 6, 0.92);
  border: 1px solid var(--danger);
  border-left: 3px solid var(--danger);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 10px;
  z-index: 6;
  display: none;
}
.attack-replay-banner.visible {
  display: block;
}

/* Interactive Node Drill-Down Card inside Radar */
.radar-node-dock {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 315px;
  max-height: calc(100% - 60px);
  background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  z-index: 7;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--anim-med) var(--ease-out-back), opacity var(--anim-fast);
}
.radar-node-dock.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.95);
}

/* ============================================================================
 * PILLAR 3: THREAT CARDS & 43PR FLOATING WINDOWS WITH SVG TRAPEZOID NOTCH
 * ============================================================================ */
.threat-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.threat-item-card {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-accent);
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--anim-fast);
}
.threat-item-card.sev-HIGH {
  border-left-color: var(--warn);
}
.threat-item-card:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}
.threat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  margin-bottom: 3px;
}
.sev-pill {
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 8.5px;
  background: var(--danger);
  color: #fff;
}
.sev-pill.HIGH {
  background: var(--warn);
  color: #000;
}
.threat-item-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.35;
  margin-bottom: 4px;
}
.threat-item-loc {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kernel Heuristic Live Stream */
.heuristic-stream-box {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 9.5px;
  line-height: 1.55;
  background: rgba(0, 0, 0, 0.55);
}
.stream-row {
  display: flex;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
 * 43PR FLOATING OVERLAY WINDOWS (SettingsWindow.qml + Bug Inspector)
 * Includes the signature Trapezoid Top Handle (100x9 SVG curve + 3 snap dots)
 * and PerspectivePanel.qml 3D Tilt!
 * ============================================================================ */
.qs-floating-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--anim-med) var(--ease-out-cubic);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qs-floating-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.qs-perspective-card {
  width: 960px;
  max-width: calc(100vw - 80px);
  height: 620px;
  max-height: calc(100vh - 50px);
  background: color-mix(in srgb, var(--bg-panel) 92%, #000);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: perspective(1024px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(0.88);
  transition:
    transform var(--anim-slow) var(--ease-out-back),
    height var(--anim-med) var(--ease-out-cubic),
    top var(--anim-med) var(--ease-out-cubic);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}
.qs-floating-backdrop.open .qs-perspective-card {
  transform: perspective(1024px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
}

/* Snap positions from SettingsWindow.qml (snapTop, snapCenter, snapBottom) */
.qs-perspective-card.snap-top {
  align-self: flex-start;
  margin-top: 24px;
  height: 420px;
}
.qs-perspective-card.snap-bottom {
  align-self: flex-end;
  margin-bottom: 24px;
  height: 420px;
}

/* Iconic 43pr Top Trapezoid Tab Handle (SettingsWindow.qml lines 617-702) */
.qs-position-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.qs-position-handle svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.qs-snap-dot {
  position: relative;
  z-index: 2;
  font-size: 7px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}
.qs-snap-dot:hover {
  color: var(--accent);
}

/* Code Viewer Table inside Bug Inspector */
.code-viewer-wrap {
  background: #030304;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  overflow: auto;
  max-height: 250px;
  font-size: 10.5px;
  line-height: 1.55;
}
.code-line-row {
  display: grid;
  grid-template-columns: 44px 48px 1fr;
  padding: 0 8px;
  white-space: pre;
}
.code-line-row.target-line {
  background: rgba(255, 0, 60, 0.22);
  border-left: 2px solid var(--danger);
  color: #fff;
  font-weight: 600;
}
.code-line-num {
  color: var(--faint);
  text-align: right;
  padding-right: 10px;
  user-select: none;
}
.code-line-marker {
  color: var(--danger);
  font-weight: 700;
  font-size: 9px;
}

/* ============================================================================
 * 43PR SETTINGS WINDOW LAYOUT (Sidebar + Search + ThemesPage Grid)
 * ============================================================================ */
.qs-settings-body {
  flex: 1;
  display: flex;
  padding: 18px 16px 16px 16px;
  gap: 15px;
  overflow: hidden;
}
.qs-settings-sidebar {
  width: 155px;
  border-right: 1px solid var(--border);
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qs-nav-btn {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--anim-fast);
}
.qs-nav-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}
.qs-nav-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

/* 43pr ThemeButton Grid (2x2 for Gold, Matrix, Cyan, Blood Red) */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.qs-theme-card {
  height: 104px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: transform var(--anim-fast) var(--ease-out-cubic), border-color var(--anim-fast);
}
.qs-theme-card:hover {
  transform: scale(1.02);
  border-color: var(--accent);
}
.qs-theme-card.active {
  border-width: 2px;
  border-color: var(--accent);
}
.qs-mini-win {
  height: 48px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.qs-swatch-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  height: 6px;
}
.qs-swatch-cell {
  border-radius: 1px;
}

/* ============================================================================
 * 43PR CALENDAR & CAVA EQUALIZER FLYOUTS (Anchored next to Left Bar)
 * ============================================================================ */
.qs-flyout-card {
  position: fixed;
  left: 74px;
  z-index: 70;
  background: color-mix(in srgb, var(--bg-panel) 92%, #000);
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent);
  border-radius: 15px;
  padding: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px) scale(0.95);
  transition: all var(--anim-med) var(--ease-out-cubic);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75);
}
.qs-flyout-card.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

/* 3D Slice Carousel (hyprquickpaper/shell.qml replica) */
.slice-carousel-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--anim-med) var(--ease-out-cubic);
}
.slice-carousel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.slice-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 420px;
}
.slice-tile {
  width: 145px;
  height: 380px;
  border-radius: 8px;
  border: 1px solid var(--border-accent);
  background: var(--surface);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--anim-slow) var(--ease-out-back);
  position: relative;
  overflow: hidden;
}
.slice-tile:hover, .slice-tile.active {
  width: 195px;
  height: 420px;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 85%, var(--accent) 15%);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85);
}

/* Data tables in WS 2..6 */
.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.sec-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-accent);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--surface);
}
.sec-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.sec-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* ============================================================================
 * 10. CENTER BOTTOM COMMAND BAR & LIVE ENGINE TELEMETRY DRAWER
 * ============================================================================ */
.engine-cmd-bar {
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-top: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--surface) 96%, #000);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 12;
}
.engine-status-pill {
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-accent);
  background: rgba(255, 255, 255, 0.04);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.engine-status-pill.running {
  border-color: var(--danger);
  background: rgba(255, 0, 60, 0.16);
  color: #fff;
}
.engine-prompt-input {
  flex: 1;
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border-accent);
  background: rgba(0, 0, 0, 0.65);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  transition: border-color var(--anim-fast), box-shadow var(--anim-fast);
}
.engine-prompt-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.engine-send-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--anim-fast);
}
.engine-send-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* Live Engine Output Drawer inside Center Radar Window */
.live-engine-drawer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 255px;
  background: rgba(6, 6, 8, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  z-index: 15;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.85);
  transition: all var(--anim-med) var(--ease-out-cubic);
}
.live-engine-drawer.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

/* ============================================================================
 * 11. 43PR PASSKEY SECURITY GATE (Full-Screen Lock Overlay)
 * ============================================================================ */
.passkey-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, rgba(0, 0, 0, 0.96) 65%),
    #050505;
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 280ms var(--ease-out-cubic);
}
.passkey-gate-overlay.unlocked {
  opacity: 0;
  pointer-events: none;
}
.passkey-card {
  width: 460px;
  max-width: calc(100vw - 32px);
  background: color-mix(in srgb, var(--surface) 95%, #000);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 28px 24px 22px 24px;
  position: relative;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.passkey-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--border-accent);
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  outline: none;
}
.passkey-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
