/* ============================================================
   Home Command — shared UI primitives
   Built only from tokens. Pane CSS may compose, never invent.
   ============================================================ */
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}
.btn.danger {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 38%, transparent);
}
.btn.danger:hover:not(:disabled) {
  background: var(--bad-soft);
  border-color: transparent;
}
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn.quiet:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

/* status pill */
.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.ui-pill.theme,
.ui-pill.accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  background: var(--accent-soft);
}
.ui-pill.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 26%, transparent);
  background: var(--bad-soft);
}
.ui-pill.muted {
  color: var(--muted);
}

/* detail header additions */
.detail-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-actions:empty {
  display: none;
}

/* section head */
.ui-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 12px;
}
.ui-section-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.ui-section-head > span {
  font-size: 12px;
  color: var(--muted);
}
.ui-section-head > .btn,
.ui-section-head > .text-btn {
  margin-left: auto;
}

/* segmented choices */
.ui-seg {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-sm);
}

/* stepper */
.ui-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ui-stepper .btn {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: var(--r-sm);
}
.ui-stepper-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  min-width: 62px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ui-stepper-value span {
  font-size: 12px;
  color: var(--muted);
  margin-left: 2px;
}

/* metric tiles */
.ui-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.ui-metrics.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ui-metrics.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ui-metrics.cols-4 { grid-template-columns: repeat(4, 1fr); }
.ui-metric {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  min-width: 0;
}
.ui-metric span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.ui-metric b {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-metric em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.ui-metric.accent b { color: var(--accent); }
.ui-metric.good b { color: var(--good); }
.ui-metric.bad b { color: var(--bad); }
.ui-metric.sky b { color: var(--sky); }

/* progress */
.ui-progress-wrap { display: grid; gap: 6px; }
.ui-progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* notices */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notice .ic {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.notice.warn {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.notice.bad {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: transparent;
}

/* empty + offline */
.ui-empty,
.ui-offline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  color: var(--text-2);
}
.ui-empty .ic,
.ui-offline .ic {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.ui-empty b,
.ui-offline b {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.ui-empty p,
.ui-offline p {
  font-size: 12px;
  color: var(--muted);
  max-width: 56ch;
}
.ui-offline {
  border-style: solid;
  background: var(--bad-soft);
  border-color: transparent;
}
.ui-offline .ic,
.ui-offline b {
  color: var(--bad);
}
.ui-offline p {
  color: var(--text-2);
}

/* event rows */
.event-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.event-line .event-time {
  margin-left: 0;
}

/* field labels inside notice-ish groups */
.ui-field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: -4px;
}

/* ---------- mobile targets ---------- */
@media (max-width: 760px) {
  .view .btn,
  .view .ui-seg,
  .view .remote-wide,
  .view .remote-key,
  .view .map-btn {
    min-height: 44px;
  }
  .view .icon-btn {
    width: 44px;
    height: 44px;
  }
  .view .ui-stepper .btn {
    width: 44px;
    height: 44px;
  }
  .detail-tabs .detail-tab {
    min-height: 44px;
  }
}
