/* ==========================================================================
   ND3 MISSION CONTROL 3.0 -- PLATFORM DESIGN SYSTEM & CSS TOKENS
   Executive Vercel/Linear-grade sovereign console design system
   ========================================================================== */

:root {
  /* Dark Theme: Multi-Tier Obsidian & Midnight Slate Surfaces */
  --bg-canvas: #090A0F;
  --bg-surface: #0F1219;
  --bg-card: #141824;
  --bg-card-hover: #1A2030;
  --bg-subtle: #0B0E14;
  --bg-input: #0D1017;
  
  --border-subtle: #1F2636;
  --border-medium: #2D374D;
  --border-focus: #388BFD;
  
  --text-primary: #F0F4F8;   /* WCAG AAA ~14:1 contrast */
  --text-secondary: #94A3B8; /* WCAG AA ~5.5:1 contrast */
  --text-tertiary: #64748B;
  --text-inverse: #090A0F;
  
  --accent-brand: #388BFD;
  --accent-brand-subtle: rgba(56, 139, 253, 0.12);
  --accent-brand-hover: #58A6FF;
  
  /* Semantic Accents */
  --accent-cyan: #06B6D4;
  --accent-blue: #388BFD;
  --accent-purple: #2563EB;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;
  
  /* Status Semantics */
  --status-healthy: #10B981;
  --status-healthy-subtle: rgba(16, 185, 129, 0.12);
  --status-healthy-border: rgba(16, 185, 129, 0.3);
  
  --status-warning: #F59E0B;
  --status-warning-subtle: rgba(245, 158, 11, 0.12);
  --status-warning-border: rgba(245, 158, 11, 0.3);
  
  --status-error: #F43F5E;
  --status-error-subtle: rgba(244, 63, 94, 0.12);
  --status-error-border: rgba(244, 63, 94, 0.3);
  
  --status-standby: #94A3B8;
  --status-standby-subtle: rgba(148, 163, 184, 0.12);
  --status-standby-border: rgba(148, 163, 184, 0.3);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --font-lexend: "Lexend", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Measurements */
  --topbar-height: 58px;
  --sidebar-width: 250px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Depth & Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.65);
}

[data-theme="light"] {
  /* Soft, Anti-Glare Slate Daylight Palette (Neurodivergent & Eye-Friendly) */
  --bg-canvas: #E2E8F0;          /* Soft, restful slate canvas - eliminates harsh glare */
  --bg-surface: #EAEFF5;         /* Structural surface for topbar & sidebar */
  --bg-card: #F8FAFC;            /* Soothing slate-tinted card surface */
  --bg-card-hover: #FFFFFF;      /* Clean contrast lift on hover */
  --bg-subtle: #D8E0E8;          /* Inset wells, meter tracks, capsules */
  --bg-input: #F8FAFC;           /* High readability input background */
  
  --border-subtle: #CBD5E1;      /* Gentle structural line */
  --border-medium: #94A3B8;      /* Distinct card border */
  --border-focus: #2563EB;
  
  --text-primary: #1E293B;       /* Deep slate-800 - crisp yet softer than stark black */
  --text-secondary: #475569;     /* Readable slate-600 */
  --text-tertiary: #64748B;      /* Muted metadata slate-500 */
  --text-inverse: #F8FAFC;
  
  --accent-brand: #2563EB;
  --accent-brand-subtle: rgba(37, 99, 235, 0.12);
  --accent-brand-hover: #1D4ED8;
  
  --status-healthy: #059669;
  --status-healthy-subtle: rgba(5, 150, 105, 0.14);
  --status-healthy-border: rgba(5, 150, 105, 0.35);
  
  --status-warning: #D97706;
  --status-warning-subtle: rgba(217, 119, 6, 0.14);
  --status-warning-border: rgba(217, 119, 6, 0.35);
  
  --status-error: #E11D48;
  --status-error-subtle: rgba(225, 29, 72, 0.14);
  --status-error-border: rgba(225, 29, 72, 0.35);
  
  --status-standby: #64748B;
  --status-standby-subtle: rgba(100, 116, 139, 0.14);
  --status-standby-border: rgba(100, 116, 139, 0.35);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 1px 4px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 6px 16px rgba(15, 23, 42, 0.12);
  --shadow-modal: 0 20px 40px rgba(15, 23, 42, 0.2);
}

/* Typography Preferences */
[data-font="lexend"],
[data-font="lexend"] body,
[data-font="lexend"] button,
[data-font="lexend"] input,
[data-font="lexend"] select,
[data-font="lexend"] textarea {
  font-family: var(--font-lexend) !important;
}
[data-font="lexend"] .brand-title,
[data-font="lexend"] .card-name,
[data-font="lexend"] .panel-title,
[data-font="lexend"] .task-title {
  letter-spacing: 0.1px;
}

/* Accessibility: Skip to Content */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--accent-brand);
  color: #FFFFFF !important;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.15s ease;
  box-shadow: var(--shadow-modal);
}
.skip-link:focus {
  top: 14px;
}

/* Accessibility: Focus Rings */
*:focus-visible {
  outline: 2px solid var(--accent-brand) !important;
  outline-offset: 2px !important;
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pulse-dot {
    animation: none !important;
    box-shadow: none !important;
  }
  .service-card:hover {
    transform: none !important;
  }
  .launch-action:hover {
    transform: none !important;
  }
}

/* Sensory Ergonomics: Low-Stimulation Zen Mode */
[data-sensory="zen"] .pulse-dot {
  animation: none !important;
  box-shadow: none !important;
  background: var(--accent-emerald) !important;
}
[data-sensory="zen"] .meter-bar {
  box-shadow: none !important;
}
[data-sensory="zen"] .service-card {
  box-shadow: none !important;
}
[data-sensory="zen"] .service-card:hover {
  transform: none !important;
}
[data-sensory="zen"] .topbar {
  backdrop-filter: none !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Universal SVG Safeguards */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.brand-icon { width: 16px !important; height: 16px !important; min-width: 16px; min-height: 16px; color: #388BFD; }
.cmd-search-icon { width: 14px !important; height: 14px !important; min-width: 14px; min-height: 14px; stroke: var(--text-tertiary); }
.shield-icon { width: 13px !important; height: 13px !important; min-width: 13px; min-height: 13px; stroke: #A78BFA; }
.sidebar-toggle-icon { width: 16px !important; height: 16px !important; min-width: 16px; min-height: 16px; stroke: currentColor; }
.nav-svg { width: 16px !important; height: 16px !important; min-width: 16px; min-height: 16px; stroke: currentColor; flex-shrink: 0; }
.search-box-icon { width: 14px !important; height: 14px !important; min-width: 14px; min-height: 14px; stroke: var(--text-tertiary); position: absolute; left: 11px; }
.cmd-modal-icon { width: 18px !important; height: 18px !important; min-width: 18px; min-height: 18px; stroke: var(--text-tertiary); }
.launch-svg { width: 12px !important; height: 12px !important; min-width: 12px; min-height: 12px; stroke: currentColor; }
.section-icon-badge svg { width: 14px !important; height: 14px !important; }

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   TOPBAR HEADER
   ========================================================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-height);
  background: rgba(15, 18, 25, 0.85); backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px; z-index: 100; box-shadow: var(--shadow-sm);
}
[data-theme="light"] .topbar { background: rgba(234, 239, 245, 0.92); }

.topbar-left { display: flex; align-items: center; gap: 14px; }

/* Brand Lockup */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; user-select: none; }
.brand-badge {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px;
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.2), rgba(37, 99, 235, 0.25));
  border: 1px solid rgba(56, 139, 253, 0.35); border-radius: var(--radius-sm);
}
.brand-icon { width: 16px; height: 16px; color: #388BFD; }
.brand-tag { font-family: var(--font-mono); font-weight: 800; font-size: 11px; letter-spacing: 0.5px; color: #E2E8F0; }
[data-theme="light"] .brand-tag { color: #1E293B; }
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-weight: 700; font-size: 13.5px; letter-spacing: 0.2px; color: var(--text-primary); line-height: 1.15; }
.brand-sub { font-size: 9.5px; font-weight: 600; letter-spacing: 1px; color: var(--text-tertiary); text-transform: uppercase; font-family: var(--font-mono); }

/* Center Vitals Capsule */
.topbar-center { display: flex; align-items: center; }
.vitals-capsule {
  display: flex; align-items: center; gap: 12px; background: var(--bg-subtle);
  border: 1px solid var(--border-subtle); padding: 5px 14px; border-radius: 20px;
  font-family: var(--font-mono); font-size: 11.5px; user-select: none;
}
.capsule-live { display: flex; align-items: center; gap: 6px; color: var(--accent-emerald); font-weight: 700; font-size: 10px; letter-spacing: 0.5px; }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10B981;
  box-shadow: 0 0 8px #10B981; animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px #10B981; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.capsule-divider { width: 1px; height: 12px; background: var(--border-subtle); }
.capsule-item { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.capsule-label { color: var(--text-tertiary); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.capsule-val { color: var(--text-primary); font-weight: 600; }
.capsule-clock { color: var(--text-secondary); font-size: 11px; }

/* Right Actions */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.cmd-trigger-btn {
  display: flex; align-items: center; gap: 8px; background: var(--bg-input);
  border: 1px solid var(--border-subtle); padding: 6px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all 0.15s ease;
}
.cmd-trigger-btn:hover { border-color: var(--border-medium); color: var(--text-primary); background: var(--bg-card); }
.cmd-search-icon { width: 14px; height: 14px; stroke: var(--text-tertiary); }
.cmd-kbd {
  font-family: var(--font-mono); font-size: 10px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); padding: 2px 6px; border-radius: 4px; color: var(--text-secondary);
}
.btn-icon-toggle {
  width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--bg-subtle);
  border: 1px solid var(--border-subtle); cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 14px; transition: all 0.15s ease;
}
.btn-icon-toggle:hover { background: var(--bg-card-hover); border-color: var(--border-medium); }
.shield-badge {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  background: rgba(37, 99, 235, 0.14); border: 1px solid rgba(56, 139, 253, 0.4);
  border-radius: var(--radius-sm); color: #60A5FA; font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; user-select: none;
}
.shield-icon { width: 13px; height: 13px; stroke: #60A5FA; }

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
  position: fixed; top: var(--topbar-height); bottom: 0; left: 0; width: var(--sidebar-width);
  background-color: var(--bg-surface); border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 90; overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed {
  width: 68px;
  padding: 18px 8px;
}
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .hardware-card,
.sidebar.collapsed .sidebar-host-card {
  display: none !important;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  width: 100%;
}
.sidebar.collapsed .nav-item.active::before {
  left: -8px;
}

.sidebar-section-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; color: var(--text-tertiary);
  text-transform: uppercase; margin: 0 10px 8px; font-family: var(--font-mono);
  white-space: nowrap;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease; position: relative; border: 1px solid transparent;
  white-space: nowrap;
}
.nav-item:hover { background-color: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background-color: var(--accent-brand-subtle); color: var(--accent-brand);
  border-color: rgba(56, 139, 253, 0.25); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent-brand); box-shadow: 0 0 8px var(--accent-brand);
}
.nav-svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }

/* Hardware Vitals Card */
.hardware-card {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 14px 12px; margin: 4px 0 18px;
}
.metric-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-bottom: 5px; }
.metric-name { color: var(--text-secondary); font-weight: 500; }
.metric-pct { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

.meter-track {
  width: 100%; height: 6px; background: rgba(255, 255, 255, 0.06);
  border-radius: 3px; overflow: hidden; margin-bottom: 2px;
}
[data-theme="light"] .meter-track { background: rgba(0, 0, 0, 0.08); }

.meter-bar { height: 100%; border-radius: 3px; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.meter-cpu { background: linear-gradient(90deg, #06B6D4, #3B82F6); box-shadow: 0 0 8px rgba(6, 182, 212, 0.4); }
.meter-ram { background: linear-gradient(90deg, #10B981, #14B8A6); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.meter-disk { background: linear-gradient(90deg, #8B5CF6, #EC4899); box-shadow: 0 0 8px rgba(139, 92, 246, 0.4); }

.uptime-badge {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-subtle);
  font-size: 10.5px; color: var(--text-tertiary); font-family: var(--font-mono);
}
.uptime-badge strong { color: var(--text-secondary); }

/* Sidebar Identity Card */
.sidebar-host-card {
  margin-top: auto; background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 10px 12px; font-size: 11.5px;
}
.host-name { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; font-size: 12px; }
.host-row { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.host-lbl { color: var(--text-tertiary); }
.host-ip { color: var(--accent-cyan); font-weight: 600; font-size: 10.5px; }
.host-ca { color: var(--accent-emerald); font-weight: 600; font-size: 10.5px; }

/* ==========================================================================
   MAIN CONTENT & WORKSPACE
   ========================================================================== */
.main-content {
  margin-left: var(--sidebar-width); margin-top: var(--topbar-height);
  padding: 28px; flex: 1; max-width: 1480px; min-width: 0;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.main-content.sidebar-collapsed {
  margin-left: 68px;
}

/* Fleet Toolbar */
.fleet-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--border-subtle);
}
.filter-pills-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-card);
  border: 1px solid var(--border-subtle); cursor: pointer; transition: all 0.15s ease;
}
.filter-pill:hover { border-color: var(--border-medium); color: var(--text-primary); background: var(--bg-card-hover); }
.filter-pill.active {
  background: rgba(56, 139, 253, 0.14); border-color: rgba(56, 139, 253, 0.5);
  color: #60A5FA; font-weight: 600;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: #60A5FA; box-shadow: 0 0 6px #60A5FA; }
.pill-count {
  font-family: var(--font-mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.07); color: var(--text-tertiary);
}
[data-theme="light"] .pill-count { background: rgba(0, 0, 0, 0.06); }
.filter-pill.active .pill-count { background: rgba(56, 139, 253, 0.25); color: #93C5FD; }

/* Integrated Search Input */
.search-box-wrap { position: relative; display: flex; align-items: center; min-width: 300px; }
.search-box-icon { position: absolute; left: 11px; width: 14px; height: 14px; stroke: var(--text-tertiary); pointer-events: none; }
.search-input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 7px 38px 7px 34px; color: var(--text-primary);
  font-size: 12.5px; font-family: var(--font-sans); outline: none; transition: all 0.15s ease;
}
.search-input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15); }
.search-clear-kbd {
  position: absolute; right: 8px; font-family: var(--font-mono); font-size: 10px;
  padding: 2px 5px; border-radius: 4px; background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  color: var(--text-tertiary); cursor: pointer;
}

/* Sections & Grid */
.sections-stack { display: flex; flex-direction: column; gap: 32px; }
.category-group { display: flex; flex-direction: column; gap: 14px; }
.section-header { display: flex; align-items: center; justify-content: space-between; }
.section-title {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-secondary); font-family: var(--font-mono);
}
.section-icon-badge { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.section-count { font-size: 11px; font-weight: 600; color: var(--text-tertiary); background: var(--bg-subtle); border: 1px solid var(--border-subtle); padding: 1px 7px; border-radius: 12px; }

/* Service Cards */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.service-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  justify-content: space-between; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; box-shadow: var(--shadow-card); min-height: 148px; overflow: hidden;
}
.service-card:hover {
  border-color: var(--border-medium); background: var(--bg-card-hover);
  transform: translateY(-2px); box-shadow: var(--shadow-card-hover);
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-brand-cluster { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-icon-box {
  width: 36px; height: 36px; border-radius: var(--radius-md); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-mono);
  font-weight: 700; font-size: 13px;
}
.card-title-group { display: flex; flex-direction: column; min-width: 0; }
.card-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-proto { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-tertiary); font-weight: 500; }

.card-status-pill {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; flex-shrink: 0;
}
.card-status-pill.live { background: rgba(16, 185, 129, 0.12); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }
.card-status-pill.live .dot { background: #10B981; box-shadow: 0 0 6px #10B981; }
.card-status-pill.standby { background: rgba(148, 163, 184, 0.12); color: #94A3B8; border: 1px solid rgba(148, 163, 184, 0.3); }
.card-status-pill.standby .dot { background: #94A3B8; }
.card-status-pill.stopped, .card-status-pill.error { background: rgba(244, 63, 94, 0.12); color: #FB7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.card-status-pill.stopped .dot { background: #F43F5E; box-shadow: 0 0 6px #F43F5E; }
.dot { width: 6px; height: 6px; border-radius: 50%; }

.card-desc {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 10px; font-size: 11px;
}
[data-theme="light"] .card-bottom { border-top-color: rgba(0, 0, 0, 0.06); }

.access-badge { font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.access-badge.mtls { background: rgba(139, 92, 246, 0.12); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.25); }
.access-badge.public { background: rgba(16, 185, 129, 0.1); color: #6EE7B7; border: 1px solid rgba(16, 185, 129, 0.25); }
.access-badge.internal { background: rgba(100, 116, 139, 0.12); color: #CBD5E1; border: 1px solid rgba(100, 116, 139, 0.25); }
.access-badge.cloud { background: rgba(56, 139, 253, 0.1); color: #93C5FD; border: 1px solid rgba(56, 139, 253, 0.25); }
.access-badge.tls { background: rgba(6, 182, 212, 0.12); color: #67E8F9; border: 1px solid rgba(6, 182, 212, 0.25); }

.launch-action {
  display: inline-flex; align-items: center; gap: 4px; color: var(--accent-blue);
  font-weight: 600; font-size: 11.5px; transition: transform 0.15s ease;
}
.service-card:hover .launch-action { color: #60A5FA; transform: translateX(2px); }
.launch-svg { width: 12px; height: 12px; stroke: currentColor; }

/* Buttons & Common */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-md); font-family: var(--font-sans);
  font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-subtle);
  background-color: var(--bg-card); color: var(--text-primary); transition: all 0.15s ease-in-out;
  user-select: none; text-decoration: none;
}
.btn:hover:not(:disabled) { background-color: var(--bg-card-hover); border-color: var(--border-medium); }
.btn-primary { background-color: var(--accent-brand); color: #fff; border-color: var(--accent-brand); }
.btn-primary:hover:not(:disabled) { background-color: var(--accent-brand-hover); border-color: var(--accent-brand-hover); color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 11.5px; }

/* Panels, Sentinels, Tables */
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.panel-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; max-width: 800px; }

.task-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); }
.task-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.task-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.task-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
.task-controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; background: var(--bg-subtle); border: 1px solid var(--border-subtle); padding: 12px; border-radius: var(--radius-md); margin-bottom: 14px; }
.control-item { display: flex; flex-direction: column; gap: 4px; }
.control-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--text-tertiary); font-family: var(--font-mono); }
.select-ctrl, .input-ctrl { background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 5px 8px; border-radius: var(--radius-sm); font-size: 12px; outline: none; }
.select-ctrl:focus, .input-ctrl:focus { border-color: var(--border-focus); }
.select-mono { font-family: var(--font-mono); }
.time-row { display: flex; align-items: center; gap: 4px; }

.table-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-medium); color: var(--text-secondary); font-size: 11px; font-weight: 600; text-transform: uppercase; font-family: var(--font-mono); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); }
.data-table tr:hover td { background: var(--bg-card-hover); }

/* Whisper Voice Studio */
.whisper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 960px) { .whisper-grid { grid-template-columns: 1fr; } }
.whisper-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); }
.upload-dropzone { border: 2px dashed var(--border-medium); border-radius: var(--radius-md); padding: 32px 16px; text-align: center; cursor: pointer; background: var(--bg-subtle); transition: all 0.15s ease; }
.upload-dropzone:hover { border-color: var(--accent-brand); background: var(--accent-brand-subtle); }
.transcript-box { min-height: 260px; max-height: 460px; overflow-y: auto; background: var(--bg-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; font-family: var(--font-mono); color: var(--text-primary); }

/* Modals & Command Palette */
.modal-backdrop { display: none; position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); z-index: 999; align-items: center; justify-content: center; padding: 20px; }
.standard-modal { background: var(--bg-surface); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); max-width: 850px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-modal); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.btn-close { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px; border-radius: 4px; }
.btn-close:hover { color: var(--text-primary); background: var(--bg-card); }
.modal-body { padding: 20px; overflow-y: auto; font-size: 13px; line-height: 1.6; }
.modal-body pre { background: var(--bg-subtle); border: 1px solid var(--border-subtle); padding: 14px; border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 12px; overflow-x: auto; white-space: pre-wrap; color: var(--text-primary); }

.cmd-modal { background: var(--bg-surface); border: 1px solid var(--border-medium); border-radius: var(--radius-xl); max-width: 600px; width: 100%; box-shadow: var(--shadow-modal); overflow: hidden; }
.cmd-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.cmd-modal-icon { width: 18px; height: 18px; stroke: var(--text-tertiary); flex-shrink: 0; }
.cmd-input { width: 100%; background: transparent; border: none; color: var(--text-primary); font-size: 15px; font-family: var(--font-sans); outline: none; }
.cmd-kbd-esc { font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--bg-subtle); border: 1px solid var(--border-subtle); color: var(--text-tertiary); }
.cmd-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmd-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-md); cursor: pointer; color: var(--text-primary); }
.cmd-item:hover, .cmd-item.selected { background-color: var(--bg-card); }
.cmd-item-title { font-weight: 600; font-size: 13.5px; }
.cmd-item-desc { font-size: 11.5px; color: var(--text-secondary); }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
  .topbar-center { display: none; }
}

/* ==========================================================================
   SOVEREIGN EXECUTIVE COMPANION -- SENSORY-CALM SANCTUARY DESIGN
   ========================================================================== */
.companion-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: calc(100vh - var(--topbar-height) - 48px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.companion-rail {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
}

.rail-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  padding-left: 8px;
}

.channel-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.channel-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.channel-btn.active {
  background: rgba(37, 99, 235, 0.16);
  color: #60A5FA;
  font-weight: 600;
  border-left: 3px solid #2563EB;
}
[data-theme="light"] .channel-btn.active {
  background: rgba(37, 99, 235, 0.12);
  color: #1D4ED8;
  border-left: 3px solid #2563EB;
}

.channel-icon-pill {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.companion-actions-section {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-rail-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.btn-rail-action:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.companion-viewport {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-canvas);
  overflow: hidden;
}

.companion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.companion-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-badge {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.channel-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.companion-feed {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  max-width: 88%;
  line-height: 1.6;
  font-size: 13.5px;
  animation: fadeIn 0.2s ease;
}

.msg-user {
  align-self: flex-end;
  background: #0F2347;
  border: 1px solid #1E3A8A;
  color: #EFF6FF;
}
[data-theme="light"] .msg-user {
  background: #DBEAFE;
  border: 1px solid #93C5FD;
  color: #1E3A8A;
}

.msg-assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.msg-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.msg-role-pill {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.msg-body {
  word-break: break-word;
  line-height: 1.65;
}

.msg-body p {
  margin: 0 0 10px 0;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-body strong {
  font-weight: 600;
  color: var(--text-primary);
}

.msg-body em {
  font-style: italic;
  color: var(--text-primary);
}

.msg-body ul, .msg-body ol {
  margin: 8px 0 12px 22px;
  padding-left: 0;
}

.msg-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.msg-body li::marker {
  color: var(--accent-brand);
  font-weight: 700;
}

.msg-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(37, 99, 235, 0.12);
  color: #93C5FD;
  border: 1px solid rgba(56, 139, 253, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
}
[data-theme="light"] .msg-body code {
  background: rgba(37, 99, 235, 0.1);
  color: #1E40AF;
  border-color: rgba(37, 99, 235, 0.25);
}

.msg-body pre {
  margin: 12px 0;
  padding: 12px 14px;
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.msg-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #E2E8F0;
  font-size: 12.5px;
}

.msg-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--accent-brand);
  background: var(--accent-brand-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.msg-body h1, .msg-body h2, .msg-body h3, .msg-body h4 {
  margin: 14px 0 8px 0;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.msg-body h1 { font-size: 17px; }
.msg-body h2 { font-size: 15.5px; }
.msg-body h3 { font-size: 14px; }
.msg-body h4 { font-size: 13px; }

.msg-body a {
  color: #388BFD;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  word-break: break-all;
}

.msg-body a:hover {
  color: #58A6FF;
}

.msg-thinking {
  background: var(--accent-brand-subtle);
  border: 1px dashed rgba(56, 139, 253, 0.4);
}

.thinking-pulse {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-brand);
  display: inline-block;
  animation: pulseDot 1.4s infinite ease-in-out both;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulseDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

.companion-mobile-tools-btn {
  display: none;
}

.receipt-block {
  margin-top: 14px;
  background: #090D16;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 3px solid #10B981;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  font-family: var(--font-mono);
  overflow: hidden;
  transition: all 0.2s ease;
}

[data-theme="light"] .receipt-block {
  background: #F0FDF4;
  border-color: rgba(16, 185, 129, 0.4);
  border-left-color: #059669;
}

.receipt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.06);
  cursor: pointer;
  user-select: none;
}

.receipt-header:hover {
  background: rgba(16, 185, 129, 0.12);
}

.receipt-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-title {
  color: #10B981;
  font-weight: 600;
  letter-spacing: 0.02em;
}

[data-theme="light"] .receipt-title {
  color: #047857;
}

.receipt-title code {
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
}

[data-theme="light"] .receipt-title code {
  color: #065F46;
}

.receipt-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.receipt-badge-pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.receipt-badge-fail {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.receipt-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.receipt-details {
  padding: 10px 12px;
  border-top: 1px solid rgba(16, 185, 129, 0.15);
  font-size: 11px;
  color: var(--text-secondary);
}

.receipt-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.receipt-hash {
  color: #38BDF8;
  background: #030712;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 10.5px;
  word-break: break-all;
}

.receipt-json {
  background: #030712 !important;
  color: #E2E8F0 !important;
  padding: 8px 10px !important;
  margin: 2px 0 0 0 !important;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  max-height: 220px;
  overflow-y: auto;
}

.companion-input-dock {
  padding: 14px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dock-model-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  outline: none;
}

.dock-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.dock-textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  padding: 10px 14px;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  outline: none;
  line-height: 1.4;
}

.dock-textarea:focus {
  border-color: var(--border-focus);
}

.btn-mic-record {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-mic-record.recording {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #EF4444;
  animation: pulse 1s infinite;
}

.btn-send-companion {
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.btn-send-companion:hover {
  background: #1D4ED8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}


/* Audio Voice Note Tray & Recording Banners */
.audio-attachment-tray {
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.recording-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rec-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 10px #EF4444;
  animation: pulse-glow 1.2s infinite ease-in-out;
  display: inline-block;
}

.rec-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #EF4444;
}

.audio-preview-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.audio-preview-player {
  flex: 1;
  height: 32px;
}

.btn-tray-action {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.btn-tray-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.btn-tray-danger {
  color: #EF4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-tray-danger:hover {
  background: rgba(239, 68, 68, 0.12) !important;
}

.btn-tray-success {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
}

.btn-tray-success:hover {
  background: #1D4ED8 !important;
}

.msg-audio-player {
  width: 100%;
  max-width: 380px;
  height: 36px;
  margin: 6px 0 8px 0;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   COMPANION MOBILE & TABLET RESPONSIVE ADAPTATIONS (≤768px & ≤480px)
   ========================================================================== */
@media (max-width: 768px) {
  .companion-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: calc(100vh - var(--topbar-height) - 16px);
    gap: 0;
    border-radius: var(--radius-lg);
  }

  .companion-rail {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 10px;
    max-height: 52px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-direction: row;
    align-items: center;
  }

  .rail-title {
    display: none;
  }

  #companion-channels-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .channel-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    margin-bottom: 0;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
  }

  .channel-btn.active {
    border-left: 1px solid var(--border-subtle);
    background: #2563EB;
    color: #FFFFFF;
  }

  .channel-btn.active .channel-icon-pill {
    background: transparent;
    color: #FFFFFF !important;
  }

  .channel-icon-pill {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .companion-actions-section {
    display: none;
  }

  .companion-mobile-tools-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
  }

  .companion-mobile-tools-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
  }

  .companion-header {
    padding: 10px 14px;
  }

  .channel-badge {
    font-size: 14px;
  }

  .channel-meta {
    display: none;
  }

  .companion-feed {
    padding: 12px;
    gap: 12px;
  }

  .msg-card {
    max-width: 95%;
    padding: 12px 14px;
    font-size: 13px;
  }

  .companion-input-dock {
    padding: 10px 12px;
    gap: 8px;
  }

  .dock-controls-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .dock-shortcut-hint {
    display: none;
  }

  .dock-model-select {
    max-width: 220px;
    font-size: 11px;
    padding: 4px 6px;
  }

  .btn-mic-record {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .btn-send-companion {
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .dock-textarea {
    font-size: 14px;
    padding: 9px 12px;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .companion-feed {
    padding: 8px;
    gap: 10px;
  }

  .msg-card {
    max-width: 100%;
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .dock-model-select {
    max-width: 170px;
    font-size: 10.5px;
  }
}


