/* BioStudio AI — Automation Studio + the OS-wide recording/playback HUD. */

/* --- floating HUD (lives on #os, above everything) --------------------- */
.macro-hud {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  border-radius: 999px;
  background: rgba(20, 24, 38, 0.92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  animation: macro-hud-in 0.18s ease;
}
@keyframes macro-hud-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.macro-hud-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d5e;
  box-shadow: 0 0 0 0 rgba(255, 77, 94, 0.7);
  animation: macro-pulse 1.2s infinite;
}
.macro-hud.play .macro-hud-dot { background: #36d39a; animation: none; }
@keyframes macro-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(255, 77, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); }
}
.macro-hud-text { white-space: nowrap; }
.macro-hud-stop {
  margin-left: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.macro-hud-stop:hover { background: rgba(255, 255, 255, 0.28); }

/* --- app shell --------------------------------------------------------- */
.app.automation { height: 100%; }
.auto-toolbar { gap: 10px; }
.auto-record.recording { background: #ff4d5e; color: #fff; border-color: transparent; }
.auto-record.recording:hover { filter: brightness(1.05); }
.auto-status { font-size: 12px; color: var(--ink-soft); }

.auto-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 0;
}

/* --- flow list --------------------------------------------------------- */
.auto-list {
  border-right: 1px solid var(--app-line, rgba(0, 0, 0, 0.08));
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--app-bar, rgba(255, 255, 255, 0.35));
}
.auto-list-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 4px 6px 8px;
}
.auto-list-empty,
.auto-detail-empty p { color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; }
.auto-list-empty { padding: 8px 6px; }
.auto-flow {
  text-align: left;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.auto-flow:hover { background: rgba(0, 0, 0, 0.05); }
.auto-flow.active { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.auto-flow-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.auto-flow-sub { font-size: 11px; color: var(--ink-soft); }

/* --- detail ------------------------------------------------------------ */
.auto-detail { overflow: auto; padding: 16px 18px; min-width: 0; }
.auto-detail-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 24px;
}
.auto-detail-empty h2 { font-size: 20px; }
.auto-detail-empty p { max-width: 440px; }
.auto-hero-icon { opacity: 0.95; }

.auto-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auto-name {
  flex: 1 1 auto;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 8px;
}
.auto-name:hover:not(:disabled),
.auto-name:focus { border-color: var(--app-line, rgba(0, 0, 0, 0.14)); background: var(--app-btn, rgba(255, 255, 255, 0.7)); outline: none; }
.auto-detail-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.btn.danger { color: #d6334a; }
.btn.danger:hover { background: rgba(214, 51, 74, 0.12); }
.auto-summary { font-size: 12px; color: var(--ink-soft); margin-bottom: 14px; }

.auto-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 16px 0 8px;
}

/* --- steps ------------------------------------------------------------- */
.auto-steps { display: flex; flex-direction: column; gap: 6px; }
.auto-step {
  border: 1px solid var(--app-line, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--app-btn, rgba(255, 255, 255, 0.55));
}
.auto-step-head { display: flex; align-items: center; gap: 9px; }
.auto-step-index {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
}
.auto-step-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: #7c8597;
}
.auto-step-badge.launch { background: #2f6bff; }
.auto-step-badge.click { background: #0f9d76; }
.auto-step-badge.set { background: #ff7a3d; }
.auto-step-badge.key { background: #7c5cff; }
.auto-step-label { flex: 1 1 auto; font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.auto-step-ctrls { flex: 0 0 auto; display: flex; gap: 3px; }
.auto-icon-btn {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
}
.auto-icon-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.07); color: var(--ink); }
.auto-icon-btn:disabled { opacity: 0.3; }
.auto-icon-btn.danger:hover:not(:disabled) { background: rgba(214, 51, 74, 0.14); color: #d6334a; }

.auto-step-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--app-line, rgba(0, 0, 0, 0.1));
  flex-wrap: wrap;
}
.auto-edit-label { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.auto-step-value {
  flex: 1 1 160px;
  min-width: 120px;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--app-line, rgba(0, 0, 0, 0.14));
  background: var(--app-btn, #fff);
  color: var(--ink);
  font-size: 12.5px;
}
.auto-var-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.auto-var-name {
  width: 130px;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--app-line, rgba(0, 0, 0, 0.14));
  background: var(--app-btn, #fff);
  color: var(--ink);
  font-size: 12px;
}
.auto-var-name:disabled { opacity: 0.45; }

/* --- batch ------------------------------------------------------------- */
.auto-batch {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--app-line, rgba(0, 0, 0, 0.08));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.auto-batch .auto-section-title { margin-top: 0; }
.auto-batch-hint { font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }
.auto-batch-scroll { overflow: auto; max-height: 260px; border-radius: 8px; }
.auto-batch-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.auto-batch-table th, .auto-batch-table td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--app-line, rgba(0, 0, 0, 0.08)); }
.auto-batch-table th { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.auto-batch-rownum { width: 30px; color: var(--ink-soft); text-align: center; }
.auto-batch-table input {
  width: 100%;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid var(--app-line, rgba(0, 0, 0, 0.14));
  background: var(--app-btn, #fff);
  color: var(--ink);
  font-size: 12px;
}
.auto-batch-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.auto-spacer { flex: 1 1 auto; }

@media (max-width: 720px) {
  .auto-body { grid-template-columns: 1fr; }
  .auto-list { display: none; }
}
