/* Automation Studio layout — tokens from theme.css */

:root {
  --auto-flows-width: 260px;
  --auto-inspector-width: 320px;
  --auto-tools-width: min(400px, 38vw);
  --auto-activity-height: 240px;
}

html {
  height: 100%;
  overflow: hidden;
}

body.auto-studio {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.auto-app {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.auto-topbar {
  flex-shrink: 0;
}

.auto-body-canvas {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

.auto-workspace {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.auto-editor-full {
  width: 100%;
  padding: 12px 16px 12px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auto-editor-full.is-flows-open {
  padding-left: calc(min(300px, 88vw) + 16px);
}
.auto-editor-full.is-inspector-open {
  padding-right: calc(min(360px, 92vw) + 16px);
}

.auto-canvas-full {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-border);
  background:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.35) 1px, transparent 0) 0 0 / 24px 24px,
    #e8ecf4;
  position: relative;
  cursor: grab;
}
.auto-canvas-full.is-panning {
  cursor: grabbing;
}
.auto-canvas.auto-canvas-full::before {
  display: none;
}
.auto-canvas-inner {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.auto-canvas-edges {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1;
}
.auto-pipeline-free {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  min-height: 0 !important;
  padding: 0 !important;
  z-index: 2;
}
.auto-canvas-node {
  position: absolute;
  width: min(360px, calc(100% - 32px));
  z-index: 2;
  touch-action: none;
}
.auto-canvas-node.is-canvas-dragging {
  z-index: 20;
}
.auto-canvas-node .auto-step {
  width: 100% !important;
  max-width: none !important;
  background: #fff;
}
.auto-canvas-node .auto-step {
  cursor: pointer;
}
.auto-canvas-node .auto-step.is-selected {
  transform: none;
}
.auto-canvas-node.is-linked-child .auto-step {
  border-style: dashed;
}
.auto-link-add {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.auto-link-add:hover {
  border-color: #059669;
  color: #059669;
  background: rgba(16, 185, 129, 0.06);
}

/* Flows panel (left) */
.auto-flows-drawer {
  flex: 0 0 var(--auto-flows-width);
  width: var(--auto-flows-width);
  min-height: 0;
  background: var(--shell-panel);
  border-right: 1px solid var(--shell-border);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  overflow: hidden;
  position: relative;
}
.auto-flows-drawer[hidden] {
  display: none !important;
}
.auto-flows-backdrop,
.auto-inspector-backdrop {
  display: none !important;
}
.auto-flows-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.auto-flows-head h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shell-muted);
}
.auto-flows-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}
#rules-list {
  flex: 1;
  overflow-y: auto;
}

/* Inspector panel (right) */
.auto-inspector-drawer {
  flex: 0 0 var(--auto-inspector-width);
  width: var(--auto-inspector-width);
  min-height: 0;
  background: var(--shell-panel);
  border-left: 1px solid var(--shell-border);
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
  position: relative;
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.04);
}
.auto-inspector-drawer[hidden] {
  display: none !important;
}
.auto-inspector-drawer .auto-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.auto-inspector-drawer .auto-inspector-head h3 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auto-inspector-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.auto-inspector-form #step-fields {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}
.auto-inspector-drawer .auto-step-badge {
  margin-bottom: 12px;
}

/* Hide old permanent columns */
.auto-flows { display: none !important; }
.auto-editor-split { display: block; }
.auto-inspector:not(.auto-inspector-drawer) { display: none; }

.auto-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.auto-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-height);
  padding: 0 14px;
  border-bottom: 1px solid var(--shell-border);
  background: var(--shell-panel);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: wrap;
}

.auto-topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}
.auto-topbar-brand h1 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auto-back {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--shell-muted);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
}
.auto-back:hover {
  color: var(--shell-accent);
  background: var(--shell-hover);
}

.auto-topbar-flow {
  flex: 1;
  display: flex;
  gap: 8px;
  min-width: 200px;
}
.auto-topbar-flow input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.78rem;
  background: var(--shell-panel);
  color: var(--shell-text);
}
.auto-topbar-flow input:first-child { font-weight: 600; max-width: 280px; }
.auto-topbar-flow input:last-child { color: var(--shell-muted); font-size: 0.72rem; }

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

.auto-menu-wrap { position: relative; }

.auto-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.auto-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.auto-dropdown button:hover { background: var(--surface-inset); }
.auto-dropdown hr {
  margin: 6px 0;
  border: none;
  border-top: 1px solid var(--line);
}


/* removed fixed 2-col grid — canvas is full width */

.auto-editor-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.auto-flow-summary {
  margin: 0;
  flex: 1;
  font-size: 0.72rem;
  color: var(--shell-muted);
}

.auto-add-wrap { position: relative; }
.auto-add-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(340px, 90vw);
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
  z-index: 45;
}
.auto-add-menu input[type="search"] {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
}

.auto-editor-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.auto-canvas {
  position: relative;
  min-height: 360px;
  padding: 20px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.auto-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 0;
}
.auto-canvas-empty[hidden] {
  display: none !important;
}
.auto-canvas-empty button { pointer-events: auto; }

.auto-inspector {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  position: sticky;
  top: 72px;
}
.auto-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.auto-inspector-head h3 {
  margin: 0;
  font-size: 0.88rem;
}
.auto-inspector-foot {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.auto-tools-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--auto-tools-width);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--shell-panel);
  border-left: 1px solid var(--shell-border);
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.06);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auto-tools-drawer[hidden],
.auto-drawer-backdrop[hidden] {
  display: none !important;
}
.auto-tools-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.auto-tools-drawer-head h2 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auto-tools-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.auto-panel-lead {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.auto-panel textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

.auto-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  z-index: 55;
}

.auto-activity {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--auto-activity-height);
  max-height: min(var(--auto-activity-height), 72vh);
  border-top: 1px solid var(--shell-border);
  background: var(--shell-panel);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
  padding: 0 14px 14px;
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.auto-activity[hidden] {
  display: none !important;
}
.auto-activity-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--shell-border);
  flex-shrink: 0;
}
.auto-activity-tabs button {
  padding: 8px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--shell-muted);
  cursor: pointer;
}
.auto-activity-tabs button.is-active {
  color: var(--shell-accent);
  border-bottom-color: var(--shell-accent);
  background: var(--shell-elevated);
}
.auto-activity-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 10px;
}
.auto-activity-panel .auto-exec-list {
  max-height: none;
  overflow-y: visible;
}
.auto-activity-lead {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.poll-status.is-live::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: auto-live-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes auto-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.auto-rule-runs {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
}
.auto-exec-meta {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
}
.auto-exec-meta a {
  color: var(--accent);
}
.auto-exec-detail {
  color: var(--text);
}
#btn-activity-toggle.has-runs {
  color: var(--accent);
  font-weight: 700;
}

.auto-templates {
  padding: 0 20px 12px;
  margin: 0;
}
.auto-templates:not(.is-collapsed) {
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.5);
}

/* Hide legacy shell if any */
.auto-shell { display: contents; }
.auto-sidebar { display: none; }
.auto-hero { display: none; }
.auto-workspace { display: flex; flex: 1; min-width: 0; min-height: 0; }
.auto-rules-rail { display: none; }
.auto-canvas-wrap { display: contents; }
.auto-canvas-head { display: none; }
.auto-palette { display: none; }
.auto-sidebar-stats { display: none; }
.auto-options-catalog { display: none; }
.auto-main { padding: 0; }

/* Simpler steps */
.auto-step {
  border-radius: 12px !important;
  box-shadow: none !important;
}
.auto-step.is-selected {
  box-shadow: 0 0 0 2px var(--accent) !important;
}
.auto-pipeline {
  gap: 0 !important;
}


.auto-drag-handle {
  cursor: grab;
}
.auto-canvas-node.is-canvas-dragging .auto-drag-handle {
  cursor: grabbing;
}

/* Wider canvas steps — root nodes use .auto-canvas-node width */
.auto-pipeline-free > .auto-pipe-connector {
  display: none !important;
}
.auto-pipeline > .auto-step {
  width: min(360px, 92%) !important;
  max-width: 480px;
}
.auto-pipeline > .auto-fork {
  max-width: min(1200px, 98%) !important;
  width: 100%;
}
.auto-fork {
  max-width: none !important;
}

/* IF/ELSE branch tree — parent anchors + free child nodes */
.auto-branch-anchors {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 0 4px 4px;
}
.auto-branch-add {
  flex: 1;
  min-height: 36px;
  border-radius: 8px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.auto-branch-add.then {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.35);
}
.auto-branch-add.else {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.35);
}
.auto-branch-add:hover {
  background: rgba(79, 70, 229, 0.06);
}
.auto-branch-pill {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.auto-branch-pill-then {
  color: #059669;
  background: rgba(5, 150, 105, 0.12);
}
.auto-branch-pill-else {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.12);
}
.auto-canvas-node.is-branch-child.is-branch-then .auto-step {
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.25);
}
.auto-canvas-node.is-branch-child.is-branch-else .auto-step {
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.25);
}
.auto-canvas-node.is-branch-parent .auto-step {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.auto-pipeline-free {
  position: absolute;
  inset: 0;
  overflow: hidden;
  min-height: 0 !important;
  padding: 0 !important;
  z-index: 2;
}

@media (max-width: 1099px) {
  .auto-flows-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 88vw);
    height: 100vh;
    z-index: 58;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.1);
    flex: none;
  }
  .auto-inspector-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 92vw);
    height: 100vh;
    z-index: 58;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.1);
    flex: none;
  }
  .auto-flows-backdrop:not([hidden]),
  .auto-inspector-backdrop:not([hidden]) {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.2);
    z-index: 57;
  }
  .auto-canvas-node { width: min(320px, calc(100% - 24px)); }
  .auto-editor-full.is-flows-open {
    padding-left: calc(min(300px, 88vw) + 16px);
  }
  .auto-editor-full.is-inspector-open {
    padding-right: calc(min(360px, 92vw) + 16px);
  }
}

@media (min-width: 1100px) {
  .auto-editor-full.is-flows-open,
  .auto-editor-full.is-inspector-open {
    padding-left: 12px;
    padding-right: 12px;
  }
  .auto-flows-drawer #btn-close-flows {
    display: none;
  }
}

/* Focus mode — minimal chrome, maximum canvas */
.auto-app.is-focus .auto-topbar-flow input#auto-desc,
.auto-app.is-focus .auto-topbar-brand h1,
.auto-app.is-focus .auto-flow-summary {
  display: none;
}
.auto-app.is-focus .auto-templates {
  display: none !important;
}
.auto-app.is-focus .auto-flows-drawer,
.auto-app.is-focus .auto-inspector-drawer {
  display: none !important;
}
.auto-app.is-focus .auto-editor-full {
  padding: 6px 10px 10px;
}
.auto-app.is-focus .auto-canvas-full {
  border-radius: 8px;
}
.auto-app.is-focus .auto-editor-bar {
  margin-bottom: 6px;
}
.auto-app.is-focus #btn-focus-canvas {
  color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
}

/* Variable autocomplete in inspector */
.auto-var-suggest {
  position: fixed;
  z-index: 10050;
  min-width: 220px;
  max-width: min(320px, 92vw);
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
}
.auto-var-suggest[hidden] {
  display: none !important;
}
.auto-var-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.auto-var-suggest-item:hover,
.auto-var-suggest-item.is-active {
  background: var(--accent-soft);
}
.auto-var-suggest-item strong {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
}
.auto-var-suggest-item span {
  font-size: 0.7rem;
  color: var(--muted);
}
.auto-var-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

/* Delete buttons */
.auto-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-delete-outline {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  box-shadow: var(--shadow-xs);
}
.btn-delete-outline:hover {
  background: var(--danger-soft);
  border-color: #fca5a5;
  color: #b91c1c;
}
.btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: 1px solid #b91c1c;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.2), var(--shadow-xs);
}
.btn-danger:hover {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25);
}

/* Delete confirm modal */
body.auto-modal-open {
  overflow: hidden;
}
.auto-confirm[hidden] {
  display: none !important;
}
.auto-confirm {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auto-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  animation: auto-fade-in 0.18s ease-out;
}
.auto-confirm-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: auto-modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes auto-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes auto-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auto-confirm-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.auto-confirm-icon-wrap svg {
  width: 26px;
  height: 26px;
}
.auto-confirm-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.auto-confirm-message {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.auto-confirm-message strong {
  color: var(--text);
  font-weight: 700;
}
.auto-confirm-note {
  margin: 0 0 22px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.auto-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.auto-confirm-actions .btn {
  min-width: 120px;
  flex: 1;
  max-width: 160px;
}

@media (max-width: 768px) {
  .auto-topbar {
    padding: 10px 12px;
    gap: 10px;
  }
  .auto-topbar-brand { min-width: 0; flex: 1 1 100%; }
  .auto-topbar-flow { flex: 1 1 100%; order: 3; }
  .auto-topbar-flow input:first-child { max-width: none; width: 100%; }
  .auto-topbar-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    order: 2;
  }
  #auto-desc { display: none; }
}

/* ── Resizable panel handles (player-style) ── */
.auto-panel-resize-handle {
  position: absolute;
  z-index: 45;
  touch-action: none;
}

.auto-panel-resize-e {
  top: 0;
  right: 0;
  bottom: 0;
  width: 7px;
  margin-right: -4px;
  cursor: col-resize;
}

.auto-panel-resize-w {
  top: 0;
  left: 0;
  bottom: 0;
  width: 7px;
  margin-left: -4px;
  cursor: col-resize;
}

.auto-panel-resize-n {
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  margin-top: -4px;
  cursor: row-resize;
}

.auto-panel-resize-handle::after {
  content: '';
  position: absolute;
  background: var(--shell-border-strong);
  transition: background 0.12s;
}

.auto-panel-resize-e::after,
.auto-panel-resize-w::after {
  top: 0;
  bottom: 0;
  width: 1px;
}

.auto-panel-resize-e::after {
  right: 3px;
}

.auto-panel-resize-w::after {
  left: 3px;
}

.auto-panel-resize-n::after {
  left: 50%;
  top: 3px;
  transform: translateX(-50%);
  width: 36px;
  height: 1px;
  border-radius: 999px;
}

.auto-panel-resize-handle:hover::after,
.auto-panel-resize-handle:focus-visible::after,
.auto-app.is-resizing-panel .auto-panel-resize-handle::after {
  background: var(--shell-accent);
}

.auto-panel-resize-handle:focus-visible {
  outline: none;
}

body.auto-resizing-col {
  cursor: col-resize !important;
  user-select: none;
}

body.auto-resizing-row {
  cursor: row-resize !important;
  user-select: none;
}

.auto-app.is-resizing-panel .auto-flows-drawer,
.auto-app.is-resizing-panel .auto-inspector-drawer,
.auto-app.is-resizing-panel .auto-tools-drawer,
.auto-app.is-resizing-panel .auto-activity {
  transition: none !important;
}

.auto-sim-output,
.auto-panel code,
.auto-panel pre,
.auto-var-input {
  font-family: var(--font-mono);
  font-size: 0.69rem;
}

@media (max-width: 1099px) {
  .auto-panel-resize-handle {
    display: none !important;
  }
}
