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

.chart-header h3 {
  margin: 0;
  font-size: 16px;
}

.chart-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chart-gap-banner {
  font-size: 13px;
  color: var(--yellow);
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.chart-gap-banner.hidden {
  display: none;
}

.chart-gap-banner.is-pulling {
  color: var(--text-dim);
  border-color: var(--border);
  background: var(--surface-2);
}

.chart-range {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.chart-tir-bar:empty {
  display: none;
}

.zoom-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.zoom-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.zoom-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.section-header h3 {
  margin: 0;
  font-size: 16px;
}

.widget-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.widget-load-subtitle {
  font-size: 11px;
  line-height: 1.2;
}

.widget-load-subtitle.widget-load-slow {
  color: var(--yellow);
}

.widget-load-subtitle.widget-load-error {
  color: var(--red);
}

.card.widget-pending-load > :not(.section-header):not(.hero-card-header):not(.widget-customize-bar):not(.widget-blind-shutter),
.card.widget-loading > :not(.section-header):not(.hero-card-header):not(.widget-customize-bar):not(.widget-blind-shutter) {
  opacity: 0;
}

.card.widget-pending-load,
.card.widget-loading,
.card.widget-blind-revealing {
  position: relative;
  overflow: hidden;
}

.widget-blind-shutter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  border-radius: 0 0 11px 11px;
}

.widget-blind-slat {
  flex: 1 1 0;
  min-height: 0;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: scaleY(1);
  transform-origin: top center;
  opacity: 1;
}

.widget-blind-shutter-open .widget-blind-slat {
  animation: widget-blind-slat-open 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--slat-index, 0) * 42ms);
}

@keyframes widget-blind-slat-open {
  from {
    transform: scaleY(1);
    opacity: 1;
  }

  to {
    transform: scaleY(0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .widget-blind-shutter-open .widget-blind-slat {
    animation: none;
  }
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list li {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid transparent;
}

.item-list li.selected {
  border-color: var(--accent);
  background: var(--surface-2);
}

.item-list li .preview {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.item-list li.running-agent-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.running-agent-main {
  flex: 1;
  min-width: 0;
}

.running-agent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.running-agent-priority {
  min-width: 36px;
}

.running-agent-cancel {
  flex-shrink: 0;
}

.detail-panel {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  height: var(--tab-height);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 2px;
  min-width: 0;
  position: relative;
}

.tab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tab-btn[data-tab="main"] .tab-icon {
  width: 24px;
  height: 24px;
}

.tab-label {
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn:not(.tab-btn-mino).active::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
  z-index: 0;
}

.tab-btn:not(.tab-btn-mino).active .tab-icon,
.tab-btn:not(.tab-btn-mino).active .tab-label {
  position: relative;
  z-index: 1;
}

.tab-btn-mino {
  gap: 4px;
}

.tab-mino-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.tab-mino-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: block;
}

.tab-mino-frame.connected,
.tab-mino-frame.healthy {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.2);
}

.tab-mino-frame.disconnected {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.2);
}

.tab-mino-frame.stale,
.tab-mino-frame.degraded,
.tab-mino-frame.agents-active {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.2);
}

.tab-mino-frame.connecting {
  border-color: var(--border);
}

.tab-btn-mino.active .tab-label {
  color: var(--accent);
}

.feedback-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-selected-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-selected-panel textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.feedback-compose textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.feedback-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tab-btn-placeholder {
  opacity: 0.45;
  cursor: default;
}

