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

html {
  color-scheme: dark;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.card-surface {
  background: radial-gradient(circle at top left, #1e293b, #0f172a);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  position: relative;
  overflow: hidden;
  min-height: 200px;
  transition:
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}

/* Semicircle health gauge draws above the content box; default card overflow would crop it. */
.card-surface.card-surface--clip-none {
  overflow: visible;
}

@media (hover: hover) {
  .card-surface:hover {
    border-color: rgba(45, 212, 191, 0.22);
    box-shadow:
      0 22px 50px rgba(0, 0, 0, 0.82),
      0 0 0 1px rgba(45, 212, 191, 0.12);
    transform: translateY(-1px);
  }
}

.card-surface::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at 0 0,
    rgba(129, 140, 248, 0.16),
    transparent 55%
  );
  opacity: 0.7;
  pointer-events: none;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
  position: relative;
  z-index: 1;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

button.metric-row.metric-row--link {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 0.5rem;
  padding: 0.35rem 0.25rem;
  margin: 0 -0.25rem 0.35rem;
  transition: background 0.15s ease;
}

button.metric-row.metric-row--link:hover {
  background: rgba(34, 211, 238, 0.08);
}

button.metric-row.metric-row--link:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.5);
  outline-offset: 2px;
}

.metric-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #e5e7eb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  position: relative;
  z-index: 1;
}

.status-ok {
  background-color: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.65);
}

.status-warn {
  background-color: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  border: 1px solid rgba(234, 179, 8, 0.8);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.55);
}

.status-error {
  background-color: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
}

.status-unknown {
  background-color: rgba(148, 163, 184, 0.16);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.status-standby {
  background-color: rgba(100, 116, 139, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.55);
  animation: standby-pulse 2.5s ease-in-out infinite;
}

@keyframes standby-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.mini-log {
  margin-top: 0.4rem;
  font-size: 0.65rem;
  line-height: 1.25;
  max-height: 6rem;
  overflow: auto;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.5);
  color: #cbd5f5;
}

/* Pipeline */
.pipeline-orbit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
}

.pipeline-stage-node {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.6);
  background: radial-gradient(circle at 30% 0, #4f46e580, #111827);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 25px rgba(129, 140, 248, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.pipeline-node-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  background: rgba(15, 23, 42, 0.9);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.9);
  margin-bottom: 0.15rem;
}

.pipeline-node-label {
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #e5e7eb;
  opacity: 0.85;
}

.pipeline-node-value {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #e5e7eb;
}

.pipeline-connector {
  flex: 1 1 16px;
  min-width: 12px;
  max-width: 48px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(129, 140, 248, 0.2),
    rgba(52, 211, 153, 0.7),
    rgba(129, 140, 248, 0.2)
  );
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.7);
}

/* No horizontal scroll: wrap stages; hide connectors on smaller widths */
@media (max-width: 1200px) {
  .pipeline-orbit .pipeline-connector {
    display: none;
  }

  .pipeline-orbit {
    justify-content: center;
    gap: 0.65rem 0.85rem;
  }
}

.pipeline-active {
  border-color: rgba(129, 140, 248, 0.95);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 35px rgba(129, 140, 248, 1),
    0 0 55px rgba(59, 130, 246, 0.9);
  transform: translateY(-2px) scale(1.03);
}

/* Queue mini-charts */
.queue-card {
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: 0.75rem;
  padding: 0.5rem 0.6rem 0.55rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 16px 30px rgba(0, 0, 0, 0.7);
  position: relative;
}

.queue-label {
  font-size: 0.72rem;
  color: #9ca3af;
}

.queue-value {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #e5e7eb;
}

.queue-chart-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 58px;
  vertical-align: bottom;
}

/* Health gauge — needle angle = activity 0–100% across semicircle (-90° … +90°).
   Activity blends: pipeline backlog %, live heartbeats, and a small synthetic baseline when idle. */
.health-gauge {
  position: relative;
  width: 132px;
  height: 66px;
  overflow: visible;
  --gauge-activity: 12;
}

.health-gauge-arc {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 200%;
  border-radius: 200px 200px 0 0;
  border: 6px solid rgba(55, 65, 81, 0.85);
  border-bottom: none;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 24px 50px rgba(15, 23, 42, 0.95);
  background: radial-gradient(circle at 50% 0, #10b98140, transparent 60%);
  z-index: 0;
}

/* Emerald sweep shows “how full” the dial is (same 0–100 as needle). */
.health-gauge-arc::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  border-radius: 200px 200px 0 0;
  pointer-events: none;
  z-index: 1;
  background: conic-gradient(
    from 180deg at 50% 100%,
    rgba(16, 185, 129, 0.42) 0deg,
    rgba(16, 185, 129, 0.42) calc(var(--gauge-activity, 12) * 1.8deg),
    transparent calc(var(--gauge-activity, 12) * 1.8deg)
  );
}

.health-gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 58px;
  margin-left: -1.5px;
  background: linear-gradient(to top, #047857, #a7f3d0);
  transform-origin: 50% 100%;
  transform: rotate(-90deg);
  transition: transform 0.28s ease-out;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.75);
  z-index: 2;
  border-radius: 2px 2px 0 0;
}

.health-gauge-center {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 30% 0, #111827, #020617);
  border-radius: 999px;
  padding: 0.25rem 0.65rem 0.3rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 14px 30px rgba(0, 0, 0, 0.9);
  text-align: center;
  z-index: 3;
}

/* Timeline / profit signals */
.timeline {
  margin-top: 0.25rem;
  max-height: 10rem;
  overflow-y: auto;
  font-size: 0.75rem;
  position: relative;
  z-index: 1;
}

.timeline-row {
  display: grid;
  grid-template-columns: 1.5fr 1.2fr 0.8fr;
  gap: 0.45rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(31, 41, 55, 0.85);
}

.timeline-row:last-child {
  border-bottom: none;
}

.timeline-ts {
  color: #9ca3af;
}

.timeline-product {
  font-weight: 500;
  color: #e5e7eb;
}

.timeline-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #a5b4fc;
}

.timeline-empty {
  color: #6b7280;
  padding-top: 0.1rem;
}

/* Content previews */
.content-preview {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.65rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.95),
    0 14px 28px rgba(0, 0, 0, 0.8);
}

.content-preview-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.content-preview-text {
  font-size: 0.75rem;
  line-height: 1.3;
  color: #e5e7eb;
}

/* Tabbed dashboard + mobile — teal accent nav (2026-style) */
.nav-desktop {
  padding: 0.35rem 0;
  row-gap: 0.5rem;
  column-gap: 1.5rem;
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  padding: 0.45rem 1.1rem;
  min-height: 48px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(45, 212, 191, 0.12);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.tab-btn:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.85);
  outline-offset: 2px;
}

.tab-btn:hover {
  transform: scale(1.03);
  color: #ccfbf1;
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(45, 212, 191, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.tab-btn-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  opacity: 0.92;
}

.tab-label {
  line-height: 1.25;
  text-align: left;
}

@media (min-width: 768px) {
  .tab-label {
    white-space: nowrap;
  }
}

.tab-btn-active {
  color: #e0e7ff;
  border-color: rgba(99, 102, 241, 0.55);
  background: linear-gradient(
    165deg,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(15, 23, 42, 0.95) 100%
  );
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.28),
    0 0 32px rgba(99, 102, 241, 0.22),
    inset 0 -3px 0 0 rgba(99, 102, 241, 0.85);
}

.tab-btn-active .tab-icon {
  color: #a5b4fc;
  filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.55));
  opacity: 1;
}

.tab-btn-active:hover {
  transform: scale(1.03);
  color: #eef2ff;
}

/* Header credit pills — Command Center */
.cc-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid;
  background: rgba(15, 23, 42, 0.65);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.touch-target {
  min-height: 48px;
  min-width: 48px;
}

.touch-target-desk {
  min-height: 48px;
}

.touch-input {
  min-height: 48px;
}

/* Native selects — teal chevron, dark field (applies across dashboard) */
.dashboard-app select,
.dashboard-app select.touch-input,
.dashboard-app select.dash-select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(15, 23, 42, 0.65);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%235eead4' fill-opacity='0.9' d='M2.5 4.25L6 7.75L9.5 4.25'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.9rem;
  padding-right: 2.35rem;
  border-color: rgba(71, 85, 105, 0.85);
}

.dashboard-app select:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.55);
  outline-offset: 1px;
}

.dashboard-app select:hover {
  border-color: rgba(45, 212, 191, 0.35);
}

.card-breathe {
  padding: 1.15rem 1.25rem;
}

@media (min-width: 768px) {
  .card-breathe {
    padding: 1.35rem 1.5rem;
  }
}

/* Accordion: full width summary for details */
.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary {
  list-style: none;
}

details[open] .accordion-chevron {
  transform: rotate(-180deg);
}

.accordion-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

@media (min-width: 768px) {
  details.accordion-card > summary {
    pointer-events: none;
  }

  details.accordion-card > summary .accordion-chevron {
    display: none;
  }
}

/* Nav: bottom bar below 768px; top tabs live in #app-sidebar (slide-over or left rail) */
@media (max-width: 767.98px) {
  .bottom-nav.bottom-nav {
    display: flex !important;
  }
}

@media (min-width: 768px) {
  .bottom-nav.bottom-nav {
    display: none !important;
  }
}

/* Bottom nav shell */
.bottom-nav-shell {
  z-index: 60;
  background: linear-gradient(
    180deg,
    rgba(19, 21, 33, 0.65) 0%,
    rgba(8, 10, 18, 0.96) 100%
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(45, 212, 191, 0.22);
  box-shadow:
    0 -12px 40px rgba(0, 0, 0, 0.5),
    0 -1px 0 rgba(45, 212, 191, 0.08);
}

.bottom-nav-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.35rem 0.35rem;
  min-height: 54px;
  min-width: 3.15rem;
  max-width: none;
  background: transparent;
  border: none;
  border-radius: 0.85rem 0.85rem 0 0;
  color: #8892a4;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.15s ease;
}

.bottom-nav-btn:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.8);
  outline-offset: -2px;
  border-radius: 0.65rem;
}

.bottom-nav-btn:hover:not(.bottom-nav-active) {
  color: #cbd5e1;
  background: rgba(45, 212, 191, 0.04);
}

.bottom-nav-btn:active {
  transform: scale(0.96);
}

.bottom-nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  line-height: 0;
}

.bottom-nav-svg {
  width: 1.42rem;
  height: 1.42rem;
}

.bottom-nav-btn.bottom-nav-active {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(99, 102, 241, 0.28),
    0 -6px 28px rgba(99, 102, 241, 0.2);
}

.bottom-nav-btn.bottom-nav-active .bottom-nav-svg {
  color: #a5b4fc;
  filter: drop-shadow(0 0 7px rgba(99, 102, 241, 0.5));
}

.bottom-nav-btn.bottom-nav-active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(36%, 2rem);
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, transparent, #818cf8, transparent);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.75);
}

.bottom-nav-label {
  font-weight: 600;
  letter-spacing: 0.03em;
  max-width: 4.2rem;
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .bottom-nav-label {
    display: none;
  }

  .bottom-nav-btn {
    min-height: 56px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }
}

/* Modal dialog (native) */
.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Critical: Tailwind .flex on <dialog> can override UA `display:none` when closed → ghost bar at viewport bottom */
dialog.modal-dialog:not(:open) {
  display: none !important;
}

.modal-dialog {
  color: #e2e8f0;
  box-sizing: border-box;
}

/* Async action feedback */
.btn-loading {
  cursor: progress;
  opacity: 0.92;
  pointer-events: none;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.spinner-inline {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.45em;
  vertical-align: -0.12em;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: spinner-rotate 0.65s linear infinite;
}

/* Slightly tighter labels (icons still shown) */
@media (max-width: 430px) and (min-width: 381px) {
  .bottom-nav-label {
    font-size: 0.58rem;
    max-width: 3.6rem;
  }
}

/* Mobile / narrow fold (<768px): room for bottom nav + safe area */
@media (max-width: 767.98px) {
  .dashboard-app {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
  }

  .tab-panel {
    padding-bottom: 0.35rem;
  }

  details.accordion-card + details.accordion-card {
    margin-top: 0.45rem;
  }

  .queue-card {
    min-height: 5.75rem;
    padding: 0.75rem 0.85rem 0.75rem;
  }

  .card-title {
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* Sample preset duration slider — dark track, teal thumb, no white OS fill */
.sample-duration-slider {
  width: 100%;
  height: 1.75rem;
  color-scheme: dark;
  background: transparent !important;
  background-color: transparent !important;
  accent-color: #0d9488;
  appearance: none;
  -webkit-appearance: none;
  /* Edge / some Win builds: kill light system tint */
  outline: none;
}

input[type="range"].sample-duration-slider {
  box-shadow: none;
}

.sample-duration-slider::-webkit-slider-runnable-track {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e 0%, #0d9488 45%, #115e59 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}

.sample-duration-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #5eead4;
  border: 2px solid #042f2e;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.55);
  margin-top: -5px;
}

.sample-duration-slider::-moz-range-track {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e 0%, #0d9488 45%, #115e59 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}

.sample-duration-slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #5eead4;
  border: 2px solid #042f2e;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.55);
}

/* Toasts (sample gen, stress, profile save) */
.toast-stack {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.dashboard-toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  transform: translateY(0.75rem);
  opacity: 0;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
  cursor: pointer;
}

.dashboard-toast--show {
  transform: translateY(0);
  opacity: 1;
}

.dashboard-toast--error {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fecdd3;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(225, 29, 72, 0.12);
}

.dashboard-toast--ok {
  border-color: rgba(52, 211, 153, 0.45);
}

/* Avatar identity sidebar: thumbnail + label */
.avatar-profile-pick-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.avatar-profile-pick-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
  background: #0f172a;
  border: 1px solid rgba(45, 50, 80, 0.9);
}

.avatar-profile-pick-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* ElevenLabs voice picker (Avatars tab) */
.voice-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: 0.65rem;
}

.voice-card {
  border: 1px solid rgba(45, 50, 80, 0.95);
  border-radius: 0.85rem;
  padding: 0.65rem 0.7rem;
  background: rgba(15, 23, 42, 0.45);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.voice-card--selected {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}

.voice-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.voice-card__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.voice-card__id {
  margin-top: 0.35rem;
  font-size: 0.6rem;
  font-family: ui-monospace, monospace;
  color: #64748b;
  word-break: break-all;
}

.voice-card__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.voice-card__btn {
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(71, 85, 105, 0.85);
  background: rgba(30, 41, 59, 0.75);
  color: #cbd5e1;
  cursor: pointer;
  min-width: 2rem;
  min-height: 2rem;
  touch-action: manipulation;
}

.voice-card__btn--play {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.45);
}

.voice-card__btn--select {
  color: #e2e8f0;
}

.voice-card__btn:active {
  transform: scale(0.97);
}

.voice-card__labels {
  margin-top: 0.25rem;
  font-size: 0.6rem;
  line-height: 1.3;
  color: #94a3b8;
  word-break: break-word;
}

.ws-model-grid .voice-card__id {
  font-size: 0.58rem;
  max-height: 2.6rem;
  overflow: hidden;
}

.ws-model-note {
  margin-top: 0.35rem;
  font-size: 0.58rem;
  color: #94a3b8;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voice-card__audio {
  width: 100%;
  max-width: 100%;
  height: 2.25rem;
  margin-top: 0.4rem;
  border-radius: 0.5rem;
}

.voice-card__audio::-webkit-media-controls-panel {
  background: rgba(15, 23, 42, 0.9);
}

.voice-card__no-preview {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: #64748b;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .card-surface {
    padding: 0.9rem 0.95rem;
  }

  .pipeline-orbit {
    justify-content: center;
  }

  .pipeline-stage-node {
    width: 72px;
    height: 72px;
  }

  .tab-btn {
    min-height: 48px;
    padding: 0.75rem 1.1rem;
    font-size: 0.85rem;
  }
}

/* Avatar profile editor — section tabs + portrait dropzone */
.avatar-form-section-nav {
  border-bottom: 1px solid rgba(45, 212, 191, 0.12);
  padding-bottom: 0.5rem;
}

.avatar-form-section-btn {
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(45, 212, 191, 0.12);
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.avatar-form-section-btn:hover {
  color: #ccfbf1;
  border-color: rgba(45, 212, 191, 0.35);
}

.avatar-form-section-btn-active {
  color: #5eead4 !important;
  border-color: rgba(45, 212, 191, 0.52) !important;
  background: rgba(45, 212, 191, 0.1) !important;
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.18);
}

.ap-portrait-dropzone--active {
  border-color: rgba(45, 212, 191, 0.65) !important;
  background: rgba(45, 212, 191, 0.07) !important;
}

/* Aero — minimal scrollbars for roster / modals */
.mc-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.35) rgba(15, 23, 42, 0.5);
}
.mc-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.mc-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.45);
  border-radius: 999px;
}
.mc-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.45), rgba(139, 92, 246, 0.4));
  border-radius: 999px;
}

/* ========== Mission Control: left sidebar + mobile drawer ========== */
.dashboard-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-items: stretch;
}

.dashboard-main-column {
  flex: 1 1 0%;
  min-width: 0;
  min-height: min(72vh, calc(100dvh - 10rem));
}

.app-sidebar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(8, 10, 18, 0.98) 100%);
  border: 1px solid rgba(45, 212, 191, 0.14);
  border-radius: 1rem;
  padding: 0.75rem 0.65rem;
}

/* Aero-dark fusion rail — #030308 + glass */
.app-sidebar.aero-sidebar {
  background: #030308;
  border-color: rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-sidebar-nav .tab-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.app-sidebar-nav .tab-btn-inner {
  width: 100%;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .app-sidebar {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    width: 15rem;
    flex-shrink: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 767.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(18rem, 88vw);
    z-index: 80;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 1rem 1rem 0;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    padding-bottom: 1rem;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: 0.75rem;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-app.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .dashboard-app.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.dashboard-sidebar-scroll-lock {
    overflow: hidden;
  }
}

/* Venture Lab — HITL Kanban + script cards */
.hitl-kanban-board {
  min-width: 0;
}

.hitl-kanban-column {
  min-width: 0;
}

.hitl-script-card {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.hitl-script-pre {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .hitl-approve-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Affiliate Vault — narrow viewports */
@media (max-width: 767.98px) {
  .affiliate-vault-panel {
    max-width: min(95vw, 100%);
    max-height: 90vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #form-vault-link {
    min-width: 0;
    max-width: 100%;
  }
}

/* Modals + Avatar editor — viewport bounds + scroll */
dialog.modal-dialog {
  max-width: min(95vw, 100%) !important;
  max-height: min(90vh, 90dvh) !important;
  box-sizing: border-box;
}

#dlg-avatar-profile-editor.modal-dialog.flex {
  overflow: hidden;
}

#dlg-avatar-profile-editor .overflow-y-auto {
  min-height: 0;
}

/* HITL Kanban — confidence + compliance badges */
.hitl-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hitl-badge-confidence {
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #e9d5ff;
  background: rgba(88, 28, 135, 0.35);
}
.hitl-badge-uae {
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #d1fae5;
  background: rgba(6, 78, 59, 0.4);
}
.hitl-badge-warn {
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fef3c7;
  background: rgba(120, 53, 15, 0.35);
}
.hitl-badge-paypal {
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #dbeafe;
  background: rgba(30, 58, 138, 0.45);
}
.hitl-badge-elite-gold {
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fef3c7;
  background: rgba(120, 53, 15, 0.45);
}
.hitl-badge-muted {
  border: 1px solid rgba(100, 116, 139, 0.4);
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.5);
}

/* Pipeline pulse strip — always visible; outer ring follows active avatar */
#mc-pipeline-pulse {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  min-height: 5.5rem;
}
.mc-pipeline-pulse--accent-aria {
  border-color: rgba(34, 211, 238, 0.35) !important;
  box-shadow:
    0 0 48px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(34, 211, 238, 0.08) !important;
  animation: mc-strip-breathe-cyan 3s ease-in-out infinite;
}
.mc-pipeline-pulse--accent-kael {
  border-color: rgba(226, 232, 240, 0.28) !important;
  box-shadow:
    0 0 44px rgba(226, 232, 240, 0.1),
    inset 0 1px 0 rgba(248, 250, 252, 0.06) !important;
  animation: mc-strip-breathe-silver 3.2s ease-in-out infinite;
}
@keyframes mc-strip-breathe-cyan {
  0%,
  100% {
    box-shadow: 0 0 36px rgba(34, 211, 238, 0.1);
  }
  50% {
    box-shadow: 0 0 56px rgba(34, 211, 238, 0.22);
  }
}
@keyframes mc-strip-breathe-silver {
  0%,
  100% {
    box-shadow: 0 0 32px rgba(226, 232, 240, 0.08);
  }
  50% {
    box-shadow: 0 0 52px rgba(248, 250, 252, 0.16);
  }
}

.avatar-roster-glow {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .avatar-roster-glow:hover {
    filter: brightness(1.03);
  }
}

.mc-pulse-node {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.65);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mc-pulse-node--active.mc-pulse-node--accent-aria {
  border-color: rgba(34, 211, 238, 0.65);
  color: #ecfeff;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.35);
  animation: mc-pulse-glow-cyan 1.6s ease-in-out infinite;
}
.mc-pulse-node--active.mc-pulse-node--accent-kael {
  border-color: rgba(226, 232, 240, 0.55);
  color: #f8fafc;
  box-shadow: 0 0 20px rgba(226, 232, 240, 0.22);
  animation: mc-pulse-glow-silver 1.6s ease-in-out infinite;
}
@keyframes mc-pulse-glow-cyan {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
  }
  50% {
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.55);
  }
}
@keyframes mc-pulse-glow-silver {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(226, 232, 240, 0.15);
  }
  50% {
    box-shadow: 0 0 26px rgba(248, 250, 252, 0.35);
  }
}

.venture-hub-aria {
  animation: venture-hub-breathe-cyan 4s ease-in-out infinite;
}
.venture-hub-kael {
  animation: venture-hub-breathe-silver 4.5s ease-in-out infinite;
}
@keyframes venture-hub-breathe-cyan {
  0%,
  100% {
    box-shadow: 0 0 48px rgba(34, 211, 238, 0.28);
  }
  50% {
    box-shadow: 0 0 72px rgba(34, 211, 238, 0.45);
  }
}
@keyframes venture-hub-breathe-silver {
  0%,
  100% {
    box-shadow: 0 0 40px rgba(226, 232, 240, 0.18);
  }
  50% {
    box-shadow: 0 0 64px rgba(226, 232, 240, 0.32);
  }
}

