/* Offline-first flywheel — dot tabs, fleet pane, adapter pie ring */

/* Compact dot switch living inside the spoke toolbar row — no extra rows. */
.flywheel-viz-tabs {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0 0.15rem;
  align-self: end;
  min-height: 2.15rem; /* match toolbar select height so dots center on the row */
}

.flywheel-viz-tab {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid rgba(103, 232, 249, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
  border-radius: 50%;
  width: 0.85rem;
  height: 0.85rem;
  padding: 0;
  cursor: pointer;
  position: relative;
  /* Expand hit box horizontally/vertically without growing the toolbar row height. */
  touch-action: manipulation;
}

.flywheel-viz-tab::after {
  content: "";
  position: absolute;
  /* ~44px minimum target; visual disc stays 0.85rem */
  inset: -0.7rem -0.55rem;
  border-radius: 999px;
}

.flywheel-viz-tab.is-active {
  background: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
}

.flywheel-viz-tab:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}

.flywheel-interaction-toggle {
  font-size: 0.78rem;
  color: #cbd5e1;
}

.flywheel-discovery-banner {
  margin: 0.35rem 0 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.82rem;
  color: #e2e8f0;
}

.flywheel-discovery-banner[data-state="provider_offline"],
.flywheel-discovery-banner[data-state="empty"] {
  border-color: rgba(248, 113, 113, 0.35);
}

.flywheel-discovery-banner[data-state="catalog_planning"] {
  border-color: rgba(251, 191, 36, 0.35);
}

#flywheel-fleet-pane,
#flywheel-agents-pane,
#flywheel-models-pane {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
}

.flywheel-fleet-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.flywheel-fleet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: none;
  overflow: auto;
}

.flywheel-fleet-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  font-size: 0.82rem;
}

.agent-category-bar,
.agent-console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0;
}

.flywheel-open-agents {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
}
.flywheel-open-agents:hover,
.flywheel-open-agents:focus-visible {
  color: #67e8f9;
  text-decoration: underline;
}

.agent-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.7rem;
}

.agent-choice-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.45rem;
  min-height: 5.25rem;
  padding: 0.65rem;
  text-align: left;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 0.6rem;
  cursor: pointer;
}

.agent-occ {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.agent-occ::before,
.agent-occ-legend i::before,
i.agent-occ {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}
.agent-occ-nom::before, i.agent-occ-nom { background: #fbbf24; }
.agent-occ-live::before, i.agent-occ-live { background: #34d399; }
.agent-occ-off::before, i.agent-occ-off { background: #64748b; }
.agent-occ-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 0.15rem 0 0.35rem;
}
.agent-choice-card .agent-occ {
  grid-column: 1 / -1;
}

.agent-choice-card small {
  grid-column: 1 / -1;
  color: #94a3b8;
}

.agent-choice-card:hover,
.agent-choice-card:focus-visible,
.agent-choice-card.is-selected {
  border-color: rgba(34, 211, 238, 0.72);
  background: rgba(8, 47, 73, 0.58);
}

.agent-level {
  display: inline-block;
  margin-left: 0.45rem;
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 700;
}

.agent-selected-detail,
.agent-live-work,
.agent-capability-guide {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid rgba(51, 65, 85, 0.75);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.45);
}

.agent-live-work h4 {
  margin: 0 0 0.4rem;
}

.agent-capability-guide dl,
.agent-capability-guide dl div {
  display: grid;
  gap: 0.3rem;
}

.agent-capability-guide dl div {
  grid-template-columns: 2rem 1fr;
}

.agent-capability-guide dt {
  color: #67e8f9;
  font-weight: 700;
}

.agent-capability-guide dd {
  margin: 0;
  color: #cbd5e1;
}

#flywheel-adapter-pie-panel {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(103, 232, 249, 0.25);
  background: rgba(15, 23, 42, 0.8);
}

#flywheel-adapter-pie-ring svg {
  width: 100%;
  max-height: 220px;
}

#flywheel-adapter-pie-ring.adapter-ring-live svg path[filter] {
  animation: adapter-glow-pulse 2.4s ease-in-out infinite;
}

@keyframes adapter-glow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.flywheel-discovery-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.flywheel-fleet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

#flywheel-adapter-a11y-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 10rem;
  overflow: auto;
}

#flywheel-adapter-a11y-list .adapter-active {
  color: #67e8f9;
  text-shadow: 0 0 8px rgba(103, 232, 249, 0.35);
}

#flywheel-adapter-a11y-list .adapter-idle {
  color: #64748b;
}

.trainlab-quick-links {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.trainlab-quick-links ul {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.trainlab-quick-links a,
.trainlab-quick-links button {
  font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
  .flywheel-viz-tab.is-active {
    box-shadow: none;
  }
  #flywheel-adapter-pie-ring.adapter-ring-live svg path[filter] {
    animation: none;
  }
}

/* FIX1 — agent profile template manager */
.agent-template-manager {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.agent-template-title {
  margin: 0;
  font-size: 0.9rem;
}

.agent-template-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.agent-template-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
}

.agent-template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.agent-template-row > label {
  flex: 1 1 12rem;
}

.agent-template-fieldset {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
}

.agent-template-fieldset legend {
  font-size: 0.75rem;
  opacity: 0.8;
}

.agent-template-mode,
.agent-template-check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.8rem;
  margin: 0.2rem 0;
}

.agent-template-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Systems interconnect + crowding + hidable floats — no new tabs */
.flywheel-fleet-toolbar {
  margin-bottom: 0.25rem;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.flywheel-fleet-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
#flywheel-systems-demo-caption {
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
  max-width: 100%;
}
#flywheel-systems-demo-caption[data-demo="true"] {
  color: #fbbf24;
}
.flywheel-systems-viz-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: rgba(2, 6, 23, 0.65);
}
.flywheel-systems-viz-wrap[data-demo="true"] {
  border-color: rgba(251, 191, 36, 0.45);
}
.flywheel-systems-svg,
#flywheel-systems-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.flywheel-fleet-body-scroll {
  max-height: 6.25rem;
  overflow: auto;
  min-height: 0;
  flex: 0 0 auto;
}
#flywheel-fleet-body .flywheel-fleet-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem;
  max-height: none;
}
#flywheel-fleet-body .flywheel-fleet-list li {
  padding: 0.32rem 0.5rem;
}
#flywheel-agents-body,
#flywheel-models-body {
  overflow: auto;
  max-height: none;
  min-height: 18rem;
}
#flywheel-adapter-pie-panel {
  position: relative;
}
.float-min-chrome {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin: 0 0 0.25rem;
}
.float-min-hide,
.orbit-legend-hide,
.orbit-dock-hide {
  min-height: 1.55rem;
  padding: 0 0.45rem;
  font-size: 0.68rem;
}
.float-min-restore {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 12;
}
[data-float-panel].is-minimized > :not([data-float-min-chrome]):not(.orbit-dock-chrome):not([data-orbit-dock-chrome]) {
  display: none !important;
}
