/* ==========================================================================
   Design System & Theme Tokens (Dark & Light)
   ========================================================================== */

:root {
  /* Common Accent Colors */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  /* Dimensions & Spacing */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Dark Theme (Default) --- */
html[data-theme="dark"] {
  --bg-page: #090d16;
  --bg-header: rgba(9, 13, 22, 0.85);
  --bg-nav: rgba(9, 13, 22, 0.92);
  --bg-card: rgba(18, 24, 38, 0.82);
  --bg-card-hover: rgba(26, 35, 54, 0.92);
  --bg-item: rgba(255, 255, 255, 0.04);
  --bg-item-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(13, 18, 30, 0.9);
  --bg-trackpad: rgba(13, 18, 32, 0.95);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(59, 130, 246, 0.6);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-modal: 0 20px 45px -5px rgba(0, 0, 0, 0.75);
  
  --track-bg: rgba(255, 255, 255, 0.07);
}

/* --- Light Theme --- */
html[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-header: rgba(255, 255, 255, 0.88);
  --bg-nav: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-item: #f8fafc;
  --bg-item-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-trackpad: #f1f5f9;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --border-focus: rgba(59, 130, 246, 0.6);

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-card: 0 2px 12px -2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 40px -8px rgba(0, 0, 0, 0.18);
  
  --track-bg: rgba(0, 0, 0, 0.06);
}

/* Base Reset & Smooth Transitions */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 76px); /* padding for bottom nav bar */
  transition: background-color var(--transition-normal), color var(--transition-normal);
  user-select: none;
  -webkit-user-select: none;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.hide {
  display: none !important;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Pulsing Status Dot with Animated Ring */
.status-pulse-wrapper {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  transition: all var(--transition-normal);
  z-index: 2;
}

.status-ring {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.2);
  opacity: 0;
  z-index: 1;
}

.status-indicator-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

.status-indicator-dot.online + .status-ring {
  background-color: rgba(16, 185, 129, 0.25);
  animation: pulseRipple 2.2s infinite ease-out;
  opacity: 1;
}

@keyframes pulseRipple {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

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

.device-name {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.25;
}

.status-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon Buttons (Tactile & Smooth) */
.icon-btn {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-item-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

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

/* Spinning Animation for Refresh */
.spinning {
  animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Views & Content Container
   ========================================================================== */
.content-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 14px;
}

.app-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: viewFadeIn 0.25s ease-out;
}

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

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 10px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.section-badge.live-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-pill {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(59, 130, 246, 0.2);
  white-space: nowrap;
}

/* ==========================================================================
   Power Control Buttons Grid
   ========================================================================== */
.power-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.power-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-item);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.power-btn:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.power-btn:active {
  transform: scale(0.96) translateY(0);
}

.btn-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-spring);
}

.power-btn:hover .btn-icon-wrapper {
  transform: scale(1.06);
}

.btn-danger-action .btn-icon-wrapper {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-warning-action .btn-icon-wrapper {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-info-action .btn-icon-wrapper {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.btn-neutral-action .btn-icon-wrapper {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.btn-text-content strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.btn-text-content small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Timer & Scheduled Shutdown Section
   ========================================================================== */
.active-timer-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  animation: bannerFadeIn 0.3s ease;
}

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

.timer-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timer-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.timer-live-countdown {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.timer-banner-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.btn-cancel-timer {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-cancel-timer:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-cancel-timer:active {
  transform: scale(0.94);
}

.timer-mode-tabs {
  display: flex;
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 14px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tab-content {
  display: none;
}

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

.preset-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.chip-btn {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background: var(--bg-item-hover);
  color: var(--text-main);
}

.chip-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--accent-primary);
  font-weight: 700;
}

.chip-btn:active {
  transform: scale(0.95);
}

.custom-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.custom-input-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-with-suffix {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-suffix input {
  width: 70px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  text-align: center;
  outline: none;
}

.input-with-suffix input:focus {
  border-color: var(--border-focus);
}

.input-with-suffix span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.schedule-picker-box {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.schedule-picker-box label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.time-picker-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.time-picker-input:focus {
  border-color: var(--border-focus);
}

.schedule-hint {
  font-size: 0.74rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.timer-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.select-wrapper {
  flex: 1;
}

.select-wrapper select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.select-wrapper select:focus {
  border-color: var(--border-focus);
}

.btn-start-timer {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-start-timer:hover {
  background: var(--accent-primary-hover);
}

.btn-start-timer:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Metrics & Resource Gauges
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

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

.metric-card {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all var(--transition-normal);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.metric-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-icon-mini {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cpu-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

.ram-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.metric-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-val {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
}

.progress-bar-track {
  width: 100%;
  height: 7px;
  background: var(--track-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar-fill.fill-cpu {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.progress-bar-fill.fill-ram {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.disks-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.disk-item {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  transition: all var(--transition-normal);
}

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

.disk-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.disk-val {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
}

.sysinfo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-item);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
}

@media (max-width: 520px) {
  .sysinfo-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.info-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Screen Preview & Interactive Live Monitor
   ========================================================================== */
.live-status-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-stream-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-normal);
}

.live-stream-dot.active {
  background: var(--accent-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  animation: pulseDot 1s infinite alternate;
}

.screen-control-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.btn-fullscreen-main {
  width: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(99, 102, 241, 0.18));
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-primary);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.btn-fullscreen-main:active {
  transform: scale(0.97);
  background: rgba(59, 130, 246, 0.3);
}

.screen-control-sub {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
}

.btn-stream-toggle-main {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-stream-toggle-main.streaming {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
}

.btn-stream-toggle-main:active {
  transform: scale(0.96);
}

.btn-snapshot-main {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-snapshot-main:hover {
  background: var(--bg-item-hover);
}

.btn-snapshot-main:active {
  transform: scale(0.96);
}

.interactive-screen-viewport {
  background: #000;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.live-screen-img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.screen-click-indicator {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  border: 2px solid var(--accent-primary);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: clickRipple 0.4s ease-out forwards;
}

@keyframes clickRipple {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 24px 16px;
  text-align: center;
}

.screen-ph-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.screenshot-img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  display: block;
}

.mini-screen .screenshot-img {
  max-height: 170px;
}

.screenshot-meta {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: #f1f5f9;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   Active Applications List & Search
   ========================================================================== */
.app-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.app-search-wrapper svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.app-search-wrapper input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  padding: 9px 12px 9px 36px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.app-search-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.apps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.apps-list::-webkit-scrollbar {
  width: 5px;
}
.apps-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

.app-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  gap: 12px;
  transition: all var(--transition-fast);
}

.app-item:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-strong);
}

.app-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.app-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.app-info {
  min-width: 0;
}

.app-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.btn-kill {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-red);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-kill:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-kill:active {
  transform: scale(0.93);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 28px;
}

/* ==========================================================================
   VIRTUAL TRACKPAD & REMOTE CONTROLS
   ========================================================================== */
.trackpad-wrapper {
  display: flex;
  gap: 8px;
  height: 230px;
  margin-bottom: 12px;
  touch-action: none;
}

.virtual-trackpad {
  flex: 1;
  background: var(--bg-trackpad);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  touch-action: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: border-color var(--transition-fast);
}

.virtual-trackpad:active {
  border-color: var(--accent-primary);
}

.trackpad-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
  text-align: center;
  padding: 10px;
}

.trackpad-hand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-item);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.trackpad-hint small {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.touch-pointer {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.4);
  border: 2px solid var(--accent-primary);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: pointerPulse 0.6s infinite alternate;
}

@keyframes pointerPulse {
  from { transform: translate(-50%, -50%) scale(0.9); }
  to { transform: translate(-50%, -50%) scale(1.15); }
}

.trackpad-scroll-strip {
  width: 44px;
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  color: var(--text-muted);
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.trackpad-scroll-strip:active {
  background: var(--bg-item-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.scroll-label {
  writing-mode: vertical-rl;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.trackpad-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trackpad-btn {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 13px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.trackpad-btn:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-strong);
}

.trackpad-btn:active {
  transform: scale(0.96);
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
}

/* Remote Text Input Form */
.remote-input-form {
  display: flex;
  gap: 8px;
}

.remote-input-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.86rem;
  font-family: inherit;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
}

.remote-input-form input:focus {
  border-color: var(--border-focus);
}

.btn-send-text {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-send-text:active {
  transform: scale(0.95);
}

/* Windows Macro & Shortcuts Grid */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.macro-btn {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.macro-btn:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-strong);
}

.macro-btn:active {
  transform: scale(0.94);
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
}

.macro-icon {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.macro-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
}

.btn-danger-macro .macro-icon {
  color: var(--accent-red);
}

/* Media Controls Grid */
.media-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 420px) {
  .media-controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.media-btn {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.media-btn:hover {
  background: var(--bg-item-hover);
}

.media-btn:active {
  transform: scale(0.95);
  background: rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   Bottom Navigation Bar (iOS Tactile Floating Bar)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: var(--safe-bottom);
  transition: all var(--transition-normal);
}

.nav-container {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  padding: 6px 12px;
}

.nav-item {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item span {
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================================================
   Modals & Login Overlays
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

.login-card, .confirm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-modal);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.logo-circle {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.login-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Biometric & Face ID Button */
.biometric-login-box {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-face-id {
  width: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(99, 102, 241, 0.16));
  border: 1.5px solid rgba(59, 130, 246, 0.38);
  color: var(--accent-primary);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.btn-face-id:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-primary);
}

.btn-face-id:active {
  transform: scale(0.96);
}

.face-id-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.divider-text span {
  padding: 0 10px;
}

#faceid-enroll-modal {
  z-index: 10001;
}

#faceid-enroll-modal.active {
  display: flex !important;
  opacity: 1 !important;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: all var(--transition-fast);
}

.pin-dot.filled {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transform: scale(1.1);
}

#pin-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.key-btn {
  background: var(--bg-item);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.key-btn:hover {
  background: var(--bg-item-hover);
}

.key-btn:active {
  transform: scale(0.92);
  background: rgba(59, 130, 246, 0.2);
}

.key-btn.action-key {
  font-size: 1rem;
  color: var(--text-secondary);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

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

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

.full-width {
  width: 100%;
}

.error-msg {
  color: var(--accent-red);
  font-size: 0.8rem;
  margin-top: 10px;
  min-height: 18px;
  font-weight: 600;
}

/* ==========================================================================
   Dedicated Confirmation Modal
   ========================================================================== */
#confirm-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  touch-action: auto;
}

#confirm-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#confirm-modal .confirm-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.2);
  animation: modalPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.confirm-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.confirm-icon-circle.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.confirm-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.confirm-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin-bottom: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel {
  background: var(--bg-item);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

.btn-cancel:hover {
  background: var(--bg-item-hover);
}

.btn-confirm-danger {
  background: var(--accent-red);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-confirm-danger:active {
  transform: scale(0.96);
}

.toast-container {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 76px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-modal);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   FULLSCREEN REMOTE DESKTOP OVERLAY
   ========================================================================== */
.btn-fullscreen-btn {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--accent-primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-fullscreen-btn:hover {
  background: rgba(59, 130, 246, 0.25);
}

.btn-fullscreen-btn:active {
  transform: scale(0.95);
}

.quick-fs-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.quick-fs-badge:active {
  transform: scale(0.95);
}

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: -webkit-fill-available;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: none;
  animation: fsFadeIn 0.2s ease-out;
}

@keyframes fsFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.fs-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: calc(var(--safe-top) + 6px) 14px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.fs-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fs-btn-close {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.fs-btn-close:active {
  transform: scale(0.94);
}

.fs-live-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-red);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fs-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fs-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fs-macro-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
}

.fs-macro-chip:active {
  background: var(--accent-primary);
  transform: scale(0.93);
}

.fs-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}

.fs-screen-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.fs-keyboard-drawer {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  width: 92%;
  max-width: 440px;
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  animation: drawerSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes drawerSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.fs-input-form {
  display: flex;
  gap: 8px;
}

.fs-input-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
}

