/* automations.css — Subscribers → Automations (Automations v1).
   THE ARTEFACT IS THE SPEC: the five boards of 2026-09-17 (Kit's visual
   automations, one straight line, our styling). Pills, the toggle, chips,
   tabs, tables and the ⋮ menu are the .seq-* classes sequences.css already
   loads on the app — one definition. Everything that is only here is .au-*. */

.au-page { display: flex; flex-direction: column; gap: 18px; }
.au-tabs .seq-tab .seq-pill { margin-left: 8px; }

/* Board 1 · the list */
.au-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .au-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .au-grid { grid-template-columns: minmax(0, 1fr); } }
.au-card { padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.au-card-t { font-size: 15px; font-weight: 600; line-height: 1.3; }
.au-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.au-card-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.au-card-n { font-size: 13px; color: var(--text-3, #8a8fa6); }
.au-card-d { font-size: 13px; color: var(--text-2, #4d5168); line-height: 1.5; }
.au-mini { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0 4px; }
.au-mini .n { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-2, #4d5168); text-align: center; }
.au-mini .l { width: 1px; height: 10px; background: var(--border-strong, #d8d3c2); }
.au-ic { display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.au-ic-entry  { background: var(--salmon, #f17d6e); border-radius: 12px; }
.au-ic-action { background: var(--good, #1c8e5a); border-radius: 50%; }
.au-ic-cond   { background: #4a90e2; border-radius: 10px; transform: rotate(45deg); }
.au-ic-cond svg { transform: rotate(-45deg); }
.au-ic-sm { width: 18px; height: 18px; }
.au-ic-sm.au-ic-entry { border-radius: 5px; }
.au-ic-sm.au-ic-cond { border-radius: 4px; }
.au-ic-md { width: 34px; height: 34px; }
.au-ic-lg { width: 48px; height: 48px; }
.au-empty { padding: 40px 0; color: var(--text-2, #4d5168); font-size: 14.5px; line-height: 1.6; }

/* Board 2 · the flow */
.au-ed-head .page-head-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.au-ed-tabs { display: flex; gap: 4px; }
.au-ed-tabs .seq-tab { height: 36px; }
.au-toggle-wrap { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2, #4d5168); margin-left: 12px; }
.au-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.au-content.au-picker-open { grid-template-columns: minmax(0, 1fr) 440px; }
@media (max-width: 1000px) { .au-content.au-picker-open { grid-template-columns: minmax(0, 1fr); } }
.au-canvas { padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 0;
  background-image: radial-gradient(var(--border, #e8e4d8) 1px, transparent 1px); background-size: 22px 22px; min-width: 0; }
.au-canvas.au-dim { opacity: .6; }
.au-node { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 240px; max-width: 100%; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.au-node.on .au-node-t { color: var(--accent-deep, #4a32b8); }
.au-node-t { font-size: 14px; font-weight: 600; text-align: center; line-height: 1.35; }
.au-node-t.au-incomplete { color: var(--warn, #b87410); }
.au-stats { display: flex; gap: 18px; padding: 8px 12px; background: var(--surface, #fff); border: 1px solid var(--border, #e8e4d8); border-radius: 8px; font-size: 11.5px; color: var(--text-2, #4d5168); text-align: center; }
.au-stats b { display: block; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3, #8a8fa6); font-weight: 500; margin-bottom: 3px; }
.au-waiting { background: var(--text-2, #4d5168); color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 6px; }
.au-line { width: 2px; height: 28px; background: var(--border-strong, #d8d3c2); }
.au-plus { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong, #d8d3c2); background: var(--surface, #fff); color: var(--text-3, #8a8fa6); display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; padding: 0; font-family: inherit; }
.au-plus:hover, .au-plus.on { border-color: var(--accent, #6a4cf1); color: var(--accent, #6a4cf1); background: var(--accent-soft, #efeaff); }
.au-plus.on { width: 28px; height: 28px; font-size: 18px; }
.au-end { background: var(--text-2, #4d5168); color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .1em; padding: 10px 18px; border-radius: 6px; }

/* Board 3 · the picker (a right-hand panel; a sheet on a phone) */
.au-picker { padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 1000px) { .au-picker { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; border-radius: 18px 18px 0 0; z-index: 60; box-shadow: 0 -12px 40px rgba(21, 23, 43, .18); } }
.au-picker-head { display: flex; align-items: center; justify-content: space-between; }
.au-picker h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 20px; font-weight: 700; margin: 0; }
.au-mono { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-3, #8a8fa6); letter-spacing: .08em; text-transform: uppercase; }
.au-picks { display: flex; flex-direction: column; gap: 8px; }
.au-pick { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border-soft, #efece2); border-radius: 10px; background: var(--surface, #fff); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.au-pick:hover { border-color: var(--accent, #6a4cf1); }
.au-pick .k { font-size: 13.5px; font-weight: 600; }
.au-pick .d { font-size: 12px; color: var(--text-3, #8a8fa6); margin-top: 2px; line-height: 1.4; }
.au-pick.later { opacity: .55; cursor: default; }
.au-pick.later:hover { border-color: var(--border-soft, #efece2); }
.au-form { display: flex; flex-direction: column; gap: 12px; }
.au-form .input, .au-form select.input, .au-form textarea.input { width: 100%; box-sizing: border-box; }
.au-form textarea.input { height: auto; min-height: 160px; padding: 12px; line-height: 1.5; resize: vertical; }
.au-form-row { display: flex; gap: 10px; align-items: center; }
.au-form-row .input { flex: 1; }
.au-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.au-form-actions .btn-danger { color: var(--danger, #c0423a); }
.au-msg { font-size: 13px; color: var(--danger, #c0423a); min-height: 1em; }

/* Board 4 · subscribers */
.au-sub-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.au-sub-filter { width: 220px; }
.au-sub-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; color: var(--text-3, #8a8fa6); }
.au-sub-search input { border: 0; outline: 0; flex: 1; font: inherit; background: transparent; color: var(--text, #15172b); min-width: 0; }
.au-th-name { width: 30%; }

/* Board 5 · templates */
.au-tpl-use { align-self: flex-start; margin-top: 8px; }

@media (max-width: 720px) {
  .au-node { width: 100%; }
  .au-sub-filter { width: 100%; }
}

/* A phone: the head's meta (tabs + toggle) drops under the name instead of
   squeezing the crumbs and the name into a 120px column; the subscribers
   table scrolls sideways inside its card instead of losing its last columns. */
@media (max-width: 720px) {
  .au-ed-head { flex-wrap: wrap; align-items: flex-start; }
  .au-ed-head .page-head-meta { width: 100%; text-align: left; }
  .au-ed-head .au-toggle-wrap { margin-left: auto; }
  .au-sub-table { overflow-x: auto; }
  .au-sub-table table { min-width: 640px; }
}
