
/* ============================================================
   Z-INDEX LAYER SCALE
   Use these variables instead of bare z-index values.
   ============================================================
   --z-sticky   30   sticky content (list-header)
   --z-toolbar  50   search panel + reports bubble context
   --z-panel   200   settings side panel
   --z-modal   300   user / lookup modals
   --z-overlay 400   full-screen overlays (shortcuts)
   --z-toast   500   toast notifications
   --z-tooltip 600   tooltips
   ============================================================ */
:root {
  --z-sticky:   30;   /* sticky content: list-header */
  --z-toolbar:  50;   /* search toolbar + reports bubble context */
  --z-popover: 100;   /* in-panel popovers: status bubble, update bubble, subscription */
  --z-panel:   200;   /* settings side panel */
  --z-modal:   300;   /* user / lookup modals */
  --z-overlay: 400;   /* full-screen keyboard overlay */
  --z-toast:   500;   /* toast notifications */
  --z-tooltip: 600;   /* tooltips */
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 20px;
  gap: 12px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #22c55e, #111827);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.6);
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.header-subline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.header-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

/* =====================================================
   HEADER PILLS (Download + Help)
   ===================================================== */

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;
  border-radius: 999px;

  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;

  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);

  text-decoration: none;
  cursor: pointer;
}

.header-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-pill-secondary {
  background: rgba(15, 23, 42, 0.9);
}

.pill-icon {
  font-size: 0.85rem;
  line-height: 1;
}


.main-layout {
  flex: 1;
  min-height: 0;
  display: flex;

  /* fill the window by default */
  width: 100%;
  max-width: 100%;

  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);

  /* allow scroll only when needed */
  overflow-x: auto;
  overflow-y: hidden;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.app-footer-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-main);
  flex: 0 0 auto;
}

.app-footer-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  min-width: 0;
}

.traffic-metric {
  white-space: nowrap;
}

.traffic-metric strong {
  color: var(--text-main);
  font-weight: 700;
}

.pane {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;

  /* vertical scrolling ONLY */
  overflow-y: auto;

  /* panes must CLIP horizontally */
  overflow-x: hidden;

  min-width: 0;
}

/* Allow wide data sections to scroll without squashing */
.pane table,
.pane .details-grid,
.pane .chart-container {
  min-width: max-content;
}

.pane-left table {
  width: max-content;
  border-collapse: collapse;
}

.pane-left th,
.pane-left td {
  white-space: nowrap;
}


/* LEFT PANE */
.pane-left {
  flex: 0 0 auto;
  width: 420px;
  min-width: 320px;

  position: relative;
  padding-right: 0;

  overflow: hidden;
}


@media (min-width: 1024px) {
  .pane-left {
    width: 50%;
  }
}

/* RIGHT PANE */
.pane-right {
  flex: 1 1 auto;     /* Allow shrink on desktop */
  min-width: 420px;

  display: flex;
  flex-direction: column;
  height: 100%;
  padding-left: 0;

  overflow: hidden;   /* wrapper will scroll */
}

.pane-divider {
  width: 3px;
  cursor: col-resize;
  position: relative;
  flex: 0 0 auto;
  background: transparent;
  transition: background 0.2s ease;
}

.pane-divider:hover,
.pane-divider.dragging {
  background: rgba(59, 130, 246, 0.15);
}

body.theme-light .pane-divider:hover,
body.theme-light .pane-divider.dragging {
  background: rgba(37, 99, 235, 0.12);
}

/* Slim glow line */
.pane-divider::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.10);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pane-divider:hover::after,
.pane-divider.dragging::after {
  background: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

body.theme-light .pane-divider::after {
  background: rgba(15, 23, 42, 0.14);
}

body.theme-light .pane-divider:hover::after {
  background: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.4);
}

body.theme-light .header-pill {
  background: #ffffff;
  color: #111827;
  border: 1px solid var(--border-subtle);
}

body.theme-light .app-footer {
  background: #ffffff;
}

body.theme-light .header-pill:hover {
  background: #f1f5f9;
  color: var(--accent);
}

/* Touch-friendly */
@media (pointer: coarse) {
  .pane-divider {
    width: 16px; /* wider hit area, still visually slim via ::after */
  }
}

@media (max-width: 900px) {
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-footer-metrics {
    justify-content: flex-start;
  }
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pane-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.pane-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.pane-meta .pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}

.search-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);

  /* Elevate stacking context so #reportsBubble overlays main-layout.
     backdrop-filter already creates a stacking context; z-index sets
     its level above .main-layout siblings (which have no explicit z-index). */
  z-index: var(--z-toolbar);
}

.search-input-group {
  flex: 1 1 180px;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* =====================================================
   SEVERITY SORT BUTTON — SMALL PILL
   ===================================================== */

.severity-sort {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);

  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;

  padding: 6px 12px;
  border-radius: 999px;

  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: background 0.15s ease, border-color 0.15s ease;
}

.severity-sort:hover {
  border-color: var(--accent);
}

.severity-sort.active {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--danger);
}

/* Light mode tuning */
body.theme-light .severity-sort {
  background: #ffffff;
  color: #111827;
  border: 1px solid var(--border-subtle);
}

body.theme-light .severity-sort:hover {
  background: #f1f5f9;
}

.search-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid #444;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
}

.search-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 30px;
  height: 30px;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #22c55e);
  color: #f9fafb;
}

.search-panel #btnToggleView,
.search-panel #btnSortSeverity,
.search-panel #btnSearch,
.search-panel #btnClear,
.search-panel #btnReports {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  transition: transform 0.1s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.search-panel #btnToggleView:hover,
.search-panel #btnSortSeverity:hover,
.search-panel #btnSearch:hover,
.search-panel #btnClear:hover,
.search-panel #btnReports:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
}

.search-panel #btnToggleView:active,
.search-panel #btnSortSeverity:active,
.search-panel #btnSearch:active,
.search-panel #btnClear:active,
.search-panel #btnReports:active {
  transform: translateY(0);
}

.search-panel #btnToggleView {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.search-panel #btnSortSeverity {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  min-width: 34px;
  padding-left: 12px;
  padding-right: 12px;
}

.search-panel #btnSearch {
  background: linear-gradient(135deg, #2563eb, #22c55e);
}

.search-panel #btnClear {
  background: linear-gradient(135deg, #475569, #64748b);
}

.search-panel #btnReports {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.btn-ghost {
  background: transparent;
}

.btn-small {
  padding: 4px 8px;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
  }
  .pane-left {
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .pane-divider {
    height: 6px;
    width: 100%;
    cursor: row-resize;
  }
}

/* ------------------------------------------
   FLEX / RESIZE / PANEL BEHAVIOR
------------------------------------------- */

.app-shell {
    display: flex;
    height: calc(100vh - 60px);
}

/* Left column (cards) */
.card-column {
    width: auto !important;
    min-width: 320px;
    max-width: none;
    overflow-y: auto;
    padding-right: 8px;
    display: block;
}


/* Smooth transitions */
.details-panel.open {
    animation: slideIn 0.25s ease;
}

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

/* Ensure the details wrapper stretches fully */
.details-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* CRITICAL fix */
}

/* Ensure the scrollable bubble can expand properly */
.details-wrapper > .reports-bubble {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Allow status cell to expand for explanations */
.details-grid-top > div {
    overflow: visible;
}
.status-explanation {
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* ------------------------------------------------
   TOP BAR ACTION ICONS
------------------------------------------------ */
.topbar-action,
.topbar-action svg {
    font-size: 1.15rem;
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

body.theme-light .topbar-action,
body.theme-light .topbar-action svg {
    color: #111827;
}

body.theme-light .topbar-action:hover {
    color: var(--accent);
}

/* =====================================================
   iPAD SAFE HORIZONTAL SCROLL WRAPPER
   ===================================================== */
.pane-scroll-x {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* Vertical scroll container for list view */
.pane-scroll-y {
  flex: 1;
  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;
}

/* =====================================================
   SCROLL SPACER — ensures last column is reachable
   ===================================================== */

.pane-scroll-x::after {
  content: "";
  display: inline-block;
  width: 24px;      /* scroll buffer, not visible space */
  height: 1px;
}


@media (pointer: coarse) {
  .pane-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (pointer: coarse) {
  .pane-right {
    flex: 1 0 auto;   /* keep original iPad behaviour */
    min-width: 100%;
  }
}

/* =====================================================
   RESPONSIVE OPERATOR INSPECTOR
   ===================================================== */

@media (max-width: 1400px) {
  .pane-left {
    min-width: 340px;
  }

  .pane-right {
    min-width: 420px;
  }

  .stats-label {
    display: none;
  }
}

@media (max-width: 1100px) {
  .main-layout {
    position: relative;
    overflow-x: hidden;
  }

  .pane-left {
    width: 100% !important;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .pane-divider {
    display: none;
  }

  .pane-right {
    position: fixed;
    inset: 82px 12px 58px auto;
    z-index: var(--z-panel);
    width: min(560px, calc(100vw - 24px));
    min-width: 0;
    height: auto;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-alt);
    box-shadow: 0 24px 80px rgba(2, 6, 23, 0.46);
    transform: translateX(calc(100% + 24px));
    transition: transform 0.2s ease;
  }

  .pane-right.details-open {
    transform: translateX(0);
  }

}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .pane-header {
    align-items: stretch;
  }

  .pane-asset-tabs,
  .pane-header-right {
    width: 100%;
  }

  .pane-asset-tabs {
    min-width: 0;
  }

  .pane-header .stats-bar {
    margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .pane-right {
    inset: 72px 8px 48px 8px;
    width: auto;
  }
}

/* ============================================================
   HEADER ACTION ICONS — CLARITY
   ============================================================ */
.app-header svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

/* ============================================================
   HEADER ACTION ICONS — LIGHT MODE
   ============================================================ */
body.theme-light .header-right svg {
  color: var(--text-main);
  stroke: var(--text-main);
}

body.theme-light .header-right button:hover svg {
  color: var(--accent);
}

/* ============================================================
   HEADER STATUS PILL — LIGHT MODE
   ============================================================ */
body.theme-light .header-badge {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

body.theme-light .header-badge-dot {
  box-shadow: none;
}

body.theme-light .btn-icon {
  color: var(--icon-color);
}

/* ============================================================
   HEADER ICONS — FORCE LIGHT MODE CONTRAST
   ============================================================ */
body.theme-light .app-header svg {
  color: var(--text-main);
}

body.theme-light .app-header svg path,
body.theme-light .app-header svg circle,
body.theme-light .app-header svg line {
  fill: currentColor;
  stroke: currentColor;
}
body.theme-light .app-header button:hover svg {
  color: var(--accent);
}
body.theme-light .app-header svg path {
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* ============================================================
   HEADER ICON BUTTONS — LIGHT MODE CONTRAST
   ============================================================ */
body.theme-light .app-header button {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: #111827;
}

body.theme-light .app-header button:hover {
  background: #f1f5f9;
}

body.theme-light .app-header button {
  font-weight: 600;
}

/* ============================================================
   HELP BUTTON ( ? )
   ============================================================ */
.help-btn {
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  color: var(--text-muted);
}

.help-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   HELP BUTTON — LIGHT MODE CONTRAST FIX
   ============================================================ */
body.theme-light .app-header .help-btn {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: #111827;
}

body.theme-light .app-header .help-btn:hover {
  background: #f1f5f9;
  color: var(--accent);
}

/* ============================================================
   REPORTS BUBBLE — canonical block
   Positioned absolutely within .search-panel (position:absolute
   set inline). Inherits stacking from .search-panel z-index:var(--z-toolbar).
   ============================================================ */

.reports-bubble {
  border-radius: 14px;
  padding: 12px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

#reportsBubble .details-section {
  margin: 0;
}

#reportsBubble h3 {
  margin-top: 0;
}

#reportsBubble {
  z-index: 1; /* within .search-panel stacking context — no competition needed */
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

/* Dark mode */
body.theme-dark #reportsBubble {
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e5e7eb;
}

/* Light mode */
body.theme-light #reportsBubble {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0,0,0,0.12);
  color: #111827;
}

/* =====================================================
   LIST VIEW STICKY COLUMN HEADER
   ===================================================== */

.list-header {
  position: sticky;
  top: 22px; /* height of the "Systems" pane header */

  z-index: var(--z-sticky);
  background: var(--bg-alt);
}

/* --------------------------------------------------
   Centered Header Logo Overlay (SAFE)
-------------------------------------------------- */
.app-header {
    position: relative;
}

.header-logo-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.header-logo-overlay img {
    height: 46px;
    width: auto;
}

/* ============================================================
   STATS BAR
   ============================================================ */

.stats-bar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: 2px var(--space-1);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pane-header .stats-bar {
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.stats-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: default;
  user-select: none;
  transition: opacity 0.2s ease;
}

.stats-count {
  font-size: var(--text-sm);
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

.stats-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.stats-total   { background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.2);  color: var(--text-muted); }
.stats-red     { background: rgba(239,68,68,0.10);   border-color: rgba(239,68,68,0.28);   color: #f87171; }
.stats-amber   { background: rgba(245,158,11,0.10);  border-color: rgba(245,158,11,0.28);  color: #fbbf24; }
.stats-green   { background: rgba(34,197,94,0.10);   border-color: rgba(34,197,94,0.28);   color: #4ade80; }
.stats-offline { background: rgba(99,102,241,0.10);  border-color: rgba(99,102,241,0.28);  color: #a5b4fc; }

body.theme-light .stats-red     { color: #b91c1c; background: rgba(239,68,68,0.07);  }
body.theme-light .stats-amber   { color: #b45309; background: rgba(245,158,11,0.07); }
body.theme-light .stats-green   { color: #15803d; background: rgba(34,197,94,0.07);  }
body.theme-light .stats-offline { color: #4338ca; background: rgba(99,102,241,0.07); }
body.theme-light .stats-total   { color: var(--text-muted); }

.services-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.services-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px 4px;
  flex: 1 1 420px;
  min-width: 0;
}

.service-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 999px;
  background: rgba(15,23,42,0.18);
}

.service-pill-group-label {
  padding: 0 4px 0 6px;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.service-pill-group-items {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.service-pill-group--single {
  border-style: dashed;
}

.service-pill-spacer {
  display: inline-flex;
  width: 18px;
  height: 1px;
  flex: 0 0 18px;
}

.services-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.service-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(148,163,184,0.08);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.service-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37,99,235,0.10);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,23,42,0.18);
}

.service-pill {
  --service-pill-text: #e2e8f0;
  --service-pill-bg: rgba(59,130,246,0.16);
  --service-pill-border: rgba(96,165,250,0.30);
  color: var(--service-pill-text);
  background: linear-gradient(135deg, var(--service-pill-bg), rgba(15,23,42,0.24));
  border-color: var(--service-pill-border);
}

.service-pill--tone-1 {
  --service-pill-text: #dcfce7;
  --service-pill-bg: rgba(34,197,94,0.22);
  --service-pill-border: rgba(74,222,128,0.38);
}

.service-pill--color-green {
  --service-pill-text: #dcfce7;
  --service-pill-bg: rgba(34,197,94,0.22);
  --service-pill-border: rgba(74,222,128,0.38);
}

.service-pill--tone-2 {
  --service-pill-text: #dbeafe;
  --service-pill-bg: rgba(59,130,246,0.22);
  --service-pill-border: rgba(96,165,250,0.38);
}

.service-pill--color-blue {
  --service-pill-text: #dbeafe;
  --service-pill-bg: rgba(59,130,246,0.22);
  --service-pill-border: rgba(96,165,250,0.38);
}

.service-pill--tone-3 {
  --service-pill-text: #fae8ff;
  --service-pill-bg: rgba(168,85,247,0.22);
  --service-pill-border: rgba(192,132,252,0.38);
}

.service-pill--color-purple {
  --service-pill-text: #fae8ff;
  --service-pill-bg: rgba(168,85,247,0.22);
  --service-pill-border: rgba(192,132,252,0.38);
}

.service-pill--tone-4 {
  --service-pill-text: #fee2e2;
  --service-pill-bg: rgba(239,68,68,0.22);
  --service-pill-border: rgba(248,113,113,0.38);
}

.service-pill--color-red {
  --service-pill-text: #fee2e2;
  --service-pill-bg: rgba(239,68,68,0.22);
  --service-pill-border: rgba(248,113,113,0.38);
}

.service-pill--tone-5 {
  --service-pill-text: #ffedd5;
  --service-pill-bg: rgba(249,115,22,0.22);
  --service-pill-border: rgba(251,146,60,0.38);
}

.service-pill--color-orange {
  --service-pill-text: #ffedd5;
  --service-pill-bg: rgba(249,115,22,0.22);
  --service-pill-border: rgba(251,146,60,0.38);
}

.service-pill--tone-6 {
  --service-pill-text: #fef9c3;
  --service-pill-bg: rgba(234,179,8,0.22);
  --service-pill-border: rgba(250,204,21,0.38);
}

.service-pill--color-yellow {
  --service-pill-text: #fef9c3;
  --service-pill-bg: rgba(234,179,8,0.22);
  --service-pill-border: rgba(250,204,21,0.38);
}

.service-pill--tone-7 {
  --service-pill-text: #ccfbf1;
  --service-pill-bg: rgba(20,184,166,0.22);
  --service-pill-border: rgba(45,212,191,0.38);
}

.service-pill--color-teal {
  --service-pill-text: #ccfbf1;
  --service-pill-bg: rgba(20,184,166,0.22);
  --service-pill-border: rgba(45,212,191,0.38);
}

.service-pill--tone-8 {
  --service-pill-text: #ffe4e6;
  --service-pill-bg: rgba(244,63,94,0.22);
  --service-pill-border: rgba(251,113,133,0.38);
}

.service-pill--color-rose {
  --service-pill-text: #ffe4e6;
  --service-pill-bg: rgba(244,63,94,0.22);
  --service-pill-border: rgba(251,113,133,0.38);
}

.service-pill--automation {
  --service-pill-text: #e0f2fe;
  --service-pill-bg: rgba(14,165,233,0.22);
  --service-pill-border: rgba(56,189,248,0.38);
  appearance: none;
  font: inherit;
}

.services-empty {
  color: var(--text-muted);
  font-size: var(--text-xs);
}
body.theme-light .service-pill {
  background: rgba(255,255,255,0.9);
  border-color: rgba(15,23,42,0.12);
  color: #334155;
}

body.theme-light .service-pill:hover {
  background: rgba(37,99,235,0.06);
  color: #1d4ed8;
}

body.theme-light .service-pill {
  background: linear-gradient(135deg, var(--service-pill-bg), rgba(255,255,255,0.94));
  border-color: var(--service-pill-border);
  color: #1f2937;
}

body.theme-light .service-pill-group {
  background: rgba(248,250,252,0.88);
  border-color: rgba(15,23,42,0.14);
}

.browser-helper-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
}

.browser-helper-overlay[hidden] {
  display: none;
}

.browser-helper-modal {
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  padding: 22px;
  color: var(--text-main);
}

.browser-helper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.browser-helper-header h3 {
  margin: 0 0 8px;
}

.browser-helper-copy {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.browser-helper-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.browser-helper-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.browser-helper-status {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
  font-size: 0.9rem;
}

.browser-helper-status.is-ready {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.browser-helper-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

body.theme-light .browser-helper-modal {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.97));
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

body.theme-light .browser-helper-step {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .browser-helper-status {
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(251, 191, 36, 0.14);
  color: #92400e;
}

body.theme-light .browser-helper-status.is-ready {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(134, 239, 172, 0.22);
  color: #166534;
}

.remote-shell-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.68);
}

.remote-shell-overlay[hidden] {
  display: none;
}

.remote-shell-panel {
  width: min(980px, calc(100vw - 44px));
  height: min(760px, calc(100vh - 44px));
  min-width: min(560px, calc(100vw - 18px));
  min-height: min(420px, calc(100vh - 18px));
  max-width: calc(100vw - 22px);
  max-height: calc(100vh - 22px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0b1120;
  color: #e5e7eb;
  box-shadow: 0 26px 70px rgba(2, 6, 23, 0.55);
  padding: 18px;
  overflow: hidden;
  resize: both;
}

.remote-shell-panel.is-maximized {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  resize: none;
}

.remote-shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.remote-shell-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.remote-shell-target {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.remote-shell-window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.remote-shell-heartbeat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  min-width: 92px;
  padding: 5px 9px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.remote-shell-heartbeat-icon {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
  transform-origin: center;
}

.remote-shell-heartbeat-mark {
  display: none;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.remote-shell-heartbeat.is-live {
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(6, 78, 59, 0.24);
  color: #bbf7d0;
}

.remote-shell-heartbeat.is-live .remote-shell-heartbeat-icon {
  color: #34d399;
  animation: remoteShellHeartbeatPulse 1s ease-in-out infinite;
}

.remote-shell-heartbeat.is-waiting {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
}

.remote-shell-heartbeat.is-waiting .remote-shell-heartbeat-icon {
  color: #7dd3fc;
}

.remote-shell-heartbeat.is-stale,
.remote-shell-heartbeat.is-error {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

.remote-shell-heartbeat.is-stale .remote-shell-heartbeat-icon,
.remote-shell-heartbeat.is-error .remote-shell-heartbeat-icon {
  display: none;
}

.remote-shell-heartbeat.is-stale .remote-shell-heartbeat-mark,
.remote-shell-heartbeat.is-error .remote-shell-heartbeat-mark {
  display: inline-flex;
}

.remote-shell-heartbeat.is-closed {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #94a3b8;
}

.remote-shell-heartbeat.is-closed .remote-shell-heartbeat-icon {
  color: #64748b;
  animation: none;
}

.remote-shell-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.remote-shell-mode-label {
  color: #94a3b8;
  font-weight: 700;
}

.remote-shell-mode.is-conpty {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(6, 78, 59, 0.28);
  color: #bbf7d0;
}

.remote-shell-mode.is-stream {
  border-color: rgba(59, 130, 246, 0.36);
  background: rgba(30, 64, 175, 0.24);
  color: #bfdbfe;
}

.remote-shell-mode.is-fallback {
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(120, 53, 15, 0.24);
  color: #fde68a;
}

.remote-shell-mode.is-error {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

.remote-shell-mode.is-closed {
  border-color: rgba(100, 116, 139, 0.34);
  background: rgba(15, 23, 42, 0.62);
  color: #cbd5e1;
}

@keyframes remoteShellHeartbeatPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(52, 211, 153, 0));
  }
  22% {
    transform: scale(1.28);
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.52));
  }
  42% {
    transform: scale(0.95);
  }
  62% {
    transform: scale(1.14);
  }
}

.remote-shell-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

.remote-shell-tab-list {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.remote-shell-tab,
.remote-shell-tab-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px 8px 0 0;
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  min-height: 30px;
  padding: 6px 12px;
  font: 12px Consolas, "Courier New", monospace;
  cursor: pointer;
}

.remote-shell-tab-label {
  min-width: 0;
}

.remote-shell-tab-close {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.16);
  color: inherit;
  font: 700 14px/1 Arial, sans-serif;
  cursor: pointer;
}

.remote-shell-tab-close:hover,
.remote-shell-tab-close:focus-visible {
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
  outline: none;
}

.remote-shell-tab.is-active {
  border-color: rgba(56, 189, 248, 0.45);
  background: #020617;
  color: #e0f2fe;
}

.remote-shell-tab-add {
  width: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.remote-shell-tab-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.remote-shell-status {
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.11);
  color: #bae6fd;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.remote-shell-status.is-error {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

.remote-shell-output {
  min-height: 280px;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: #020617;
  padding: 8px;
}

.remote-shell-terminal-pane {
  width: 100%;
  height: 100%;
  display: none;
}

.remote-shell-terminal-pane.is-active {
  display: block;
}

.remote-shell-terminal-pane .xterm {
  height: 100%;
  padding: 4px;
}

.remote-shell-terminal-pane .xterm-viewport {
  border-radius: 6px;
}

.remote-shell-output.is-fallback {
  overflow: auto;
  font: 12px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.remote-shell-fallback-line {
  margin: 0 0 2px;
  white-space: pre-wrap;
}

.remote-shell-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.remote-shell-reason,
.remote-shell-input {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  padding: 8px 10px;
}

body.theme-light .remote-shell-panel {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.14);
}

body.theme-light .remote-shell-target {
  color: #64748b;
}

body.theme-light .remote-shell-tab,
body.theme-light .remote-shell-tab-add {
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.16);
  color: #334155;
}

body.theme-light .remote-shell-tab.is-active {
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.38);
  color: #0369a1;
}

body.theme-light .remote-shell-tab-close {
  background: rgba(100, 116, 139, 0.16);
}

body.theme-light .remote-shell-tab-close:hover,
body.theme-light .remote-shell-tab-close:focus-visible {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

body.theme-light .remote-shell-output {
  background: #020617;
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.28);
}

body.theme-light .remote-shell-status {
  background: #e0f2fe;
  border-color: rgba(2, 132, 199, 0.32);
  color: #075985;
}

body.theme-light .remote-shell-status.is-error {
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.28);
  color: #991b1b;
}

body.theme-light .remote-shell-heartbeat.is-waiting {
  background: #e0f2fe;
  border-color: rgba(2, 132, 199, 0.28);
  color: #075985;
}

body.theme-light .remote-shell-heartbeat.is-waiting .remote-shell-heartbeat-icon {
  color: #0284c7;
}

body.theme-light .remote-shell-reason,
body.theme-light .remote-shell-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
}

@media (max-width: 760px) {
  .remote-shell-overlay {
    padding: 8px;
  }

  .remote-shell-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    min-width: 0;
    min-height: 0;
    max-height: calc(100vh - 16px);
    padding: 12px;
    resize: none;
  }

}

/* ============================================================
   TOAST NOTIFICATION SYSTEM
   ============================================================ */

#toastContainer {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  border-radius: 10px;
  font-size: var(--text-base);
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toastIn 0.2s ease both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-message {
  flex: 1 1 auto;
  min-width: 0;
}

.toast-action {
  flex: 0 0 auto;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.toast-action:hover,
.toast-action:focus-visible {
  opacity: 0.9;
}

.toast.fading {
  opacity: 0;
  transform: translateX(20px);
}

.toast-success { background: #14532d; border-left: 4px solid var(--success); color: #dcfce7; }
.toast-warning { background: #78350f; border-left: 4px solid var(--warning); color: #fef3c7; }
.toast-error   { background: #7f1d1d; border-left: 4px solid var(--danger);  color: #fee2e2; }
.toast-info    { background: #1e3a5f; border-left: 4px solid var(--accent);  color: #dbeafe; }

body.theme-light .toast-success { background: #dcfce7; color: #14532d; }
body.theme-light .toast-warning { background: #fef3c7; color: #78350f; }
body.theme-light .toast-error   { background: #fee2e2; color: #7f1d1d; }
body.theme-light .toast-info    { background: #dbeafe; color: #1e3a5f; }

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

/* ============================================================
   SKELETON LOADING
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 37%,
    rgba(255,255,255,0.04) 63%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.5s ease infinite;
}

body.theme-light .skeleton {
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.05) 25%,
    rgba(0,0,0,0.10) 37%,
    rgba(0,0,0,0.05) 63%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.5s ease infinite;
}

.skeleton-card {
  width: 390px;
  height: 122px;
}

.skeleton-row {
  height: 34px;
  width: 100%;
  border-radius: 6px;
  margin-bottom: 4px;
}

/* ============================================================
   KEYBOARD SHORTCUTS OVERLAY
   ============================================================ */

.shortcuts-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: var(--z-overlay);
  align-items: center;
  justify-content: center;
}

.shortcuts-overlay.open {
  display: flex;
}

.shortcuts-box {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: var(--space-6);
  min-width: 300px;
  box-shadow: var(--shadow-soft);
}

.shortcuts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  font-weight: 600;
  font-size: var(--text-md);
}

.shortcuts-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.shortcuts-header button:hover {
  color: var(--text-main);
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  color: var(--text-muted);
}

kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  padding: 3px 8px;
  font-family: monospace;
  font-size: var(--text-sm);
  color: var(--text-main);
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
}

body.theme-light kbd {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}

/* ============================================================
   IMPROVED EMPTY STATE
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  gap: var(--space-3);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-main);
  opacity: 0.7;
}

.empty-state-body {
  font-size: var(--text-sm);
  line-height: 1.5;
  max-width: 280px;
}

.empty-state-action {
  margin-top: var(--space-2);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--accent);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.empty-state-action:hover {
  background: var(--accent-soft);
}

/* ============================================================
   PANE ASSET TAB STRIP — BOXED TAB TREATMENT
   ============================================================ */
.pane-header {
  padding: 0 12px 0 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0;
  gap: 0;
  align-items: flex-end;
}

.pane-asset-tabs {
  display: flex;
  flex: 0 1 auto;
  min-width: min-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 6px;
}
.pane-asset-tabs::-webkit-scrollbar { display: none; }

.pane-asset-tab {
  padding: 8px 14px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--text-muted);
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.pane-asset-tab:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.pane-asset-tab.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--bg-alt);
  border-color: var(--border-subtle);
  border-bottom-color: var(--bg-alt);
}

body.theme-light .pane-asset-tab {
  color: #374151;
}

body.theme-light .pane-asset-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.07);
}

body.theme-light .pane-asset-tab.active {
  color: var(--accent);
  background: var(--bg-alt);
  border-bottom-color: var(--bg-alt);
}

/* ============================================================
   ASSET LIST — ROWS
   ============================================================ */
.card-list.asset-list-view {
  display: block !important;
  width: 100%;
  max-width: 100%;
  grid-template-columns: none !important;
  grid-auto-flow: row !important;
  grid-auto-rows: auto !important;
  justify-content: stretch !important;
  align-content: stretch !important;
}

.card-list.asset-list-view .asset-list-header,
.card-list.asset-list-view .asset-list-row {
  width: 100%;
  box-sizing: border-box;
}

.asset-list-header,
.asset-list-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.asset-list-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.asset-list-row {
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.asset-list-row:hover {
  background: var(--glass-bg-hover);
}

.asset-list-row.selected {
  background: var(--row-selected-bg);
  border-left: 4px solid var(--row-selected-rail);
  border-bottom-color: var(--row-selected-border);
  box-shadow: var(--row-selected-shadow), inset 0 0 0 1px var(--row-selected-border);
  transform: translateX(2px);
  z-index: 1;
}

.asset-list-row.selected:hover {
  background: var(--row-selected-bg-hover);
  box-shadow: var(--row-selected-shadow-hover), inset 0 0 0 1px var(--row-selected-border-hover);
}

body.theme-light .asset-list-row:hover {
  background: rgba(37, 99, 235, 0.05);
}

body.theme-light .asset-list-row.selected:hover {
  background: var(--row-selected-bg-hover);
  box-shadow: var(--row-selected-shadow-hover), inset 0 0 0 1px var(--row-selected-border-hover);
}

.asset-list-cell {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}

.asset-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
