/* Automations section: n8n-style editor inside the site's tennis frame */
#automations { padding: 96px 0; }
.ax { background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 8px 8px 0 var(--ink); }
.ax-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; background: var(--court); border-bottom: 2px solid var(--ink); }
.ax-tab { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.2; gap: 2px; padding: 7px 12px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.35); background: transparent; color: var(--chalk); font: 700 14px var(--body); cursor: pointer; transition: transform .15s ease, background .15s ease; }
.ax-tab small { font: 700 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.ax-tab:hover { transform: translateY(-2px); background: rgba(255,255,255,.12); }
.ax-tab[aria-selected="true"] { background: var(--optic); color: var(--ink); border-color: var(--optic); }

/* editor chrome */
.ax-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e3e3e3; font-size: 13px; }
.ax-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: #7d7d87; }
.ax-crumb b { color: #2d2e3a; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-real { font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; background: var(--optic); color: var(--ink); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.ax-right { display: flex; align-items: center; gap: 10px; flex: none; }
.ax-active { display: inline-flex; align-items: center; gap: 6px; color: #2d2e3a; font-weight: 600; }
.ax-active i { width: 30px; height: 17px; border-radius: 9px; background: #29a568; position: relative; }
.ax-active i::after { content: ""; position: absolute; right: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.ax-status { font: 600 12px var(--mono); color: #7d7d87; }
.ax-status.busy { color: #e8890c; } .ax-status.done { color: #29a568; }

.ax-stage { position: relative; overflow-x: auto; overflow-y: hidden; background-color: #f2f2f4;
  background-image: radial-gradient(#cfd0d6 1.1px, transparent 1.1px); background-size: 20px 20px; padding: 6px 0 64px; }
.ax-sizer { position: relative; margin: 0 auto; }
.ax-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ax-wires { position: absolute; left: 0; top: 0; overflow: visible; }
.ax-wire { fill: none; stroke: #9aa19c; stroke-width: 2; transition: stroke .3s; }
.ax-wire.on { stroke: #29a568; }
.ax-h { fill: #9aa19c; }
.ax-dash { fill: none; stroke: #9aa19c; stroke-width: 2; stroke-dasharray: 5 5; }
.ax-slot { fill: #fff; stroke: #9aa19c; stroke-width: 1.5; }
.ax-slotlbl, .ax-out { font: 600 10.5px var(--body); fill: #7d7d87; }
.ax-items { font: 700 11px var(--body); fill: #29a568; opacity: 0; transition: opacity .3s; }
.ax-items.on { opacity: 1; }

.ax-node { position: absolute; background: #fff; border: 2px solid #c9cad1; border-radius: 10px; display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: border-color .25s, box-shadow .25s; }
.ax-node.trigger { border-radius: 40px 10px 10px 40px; }
.ax-node.subnode { border-radius: 50%; }
.ax-node.agent { place-items: stretch; }
.ax-agent-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 100%; }
.ax-agent-in b { display: block; font: 700 13px/1.2 var(--body); color: #2d2e3a; }
.ax-agent-in span { font: 500 11px var(--body); color: #7d7d87; }
.ax-lbl { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); width: 140px; text-align: center; line-height: 1.2; pointer-events: none; }
.ax-node.subnode .ax-lbl { width: 110px; }
.ax-lbl b { display: block; font: 700 12.5px var(--body); color: #2d2e3a; }
.ax-lbl span { display: block; font: 500 10.5px var(--body); color: #8d8e98; margin-top: 2px; }
.ax-bolt { position: absolute; left: -15px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: #ff6d5a; }
.ax-ok { position: absolute; right: 5px; bottom: 4px; width: 15px; height: 15px; border-radius: 50%; background: #29a568; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .25s; }
.ax-ok::after { content: ""; position: absolute; left: 4.5px; top: 2.5px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ax-node.subnode .ax-ok { right: 0; bottom: 0; }
.ax-node.run { border-color: #ff6d5a; box-shadow: 0 0 0 4px rgba(255,109,90,.18); }
.ax-node.ok { border-color: #29a568; }
.ax-node.ok .ax-ok { opacity: 1; transform: none; }

.ax-dock { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); }
.ax-stage-wrap { position: relative; }
.ax-run { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; padding: 10px 16px; background: #ff6d5a; color: #fff; font: 700 14px var(--body); cursor: pointer; box-shadow: 0 2px 6px rgba(255,109,90,.35); }
.ax-run:hover { background: #f25b47; }
.ax-run svg { width: 14px; height: 14px; }

.ax-notes { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; padding: 22px 24px 24px; border-top: 2px solid var(--ink); background: var(--paper); }
.ax-notes h4 { margin: 0 0 8px; font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--clay); }
.ax-notes ol, .ax-notes ul { margin: 0 0 14px; padding-left: 18px; color: var(--ink); font-size: 15px; }
.ax-notes li { margin: 4px 0; }
.ax-stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ax-stack span { font: 600 12px var(--body); padding: 4px 10px; border-radius: 999px; background: var(--chalk); border: 1px solid var(--line); }
.ax-foot { margin: 18px 0 0; font-size: 13px; color: var(--muted); }

/* common automations grid */
.ax-common { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 36px; }
.ax-common div { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ax-common b { display: block; font: 700 15px var(--display); margin-bottom: 3px; }
.ax-common span { font-size: 13.5px; color: var(--muted); line-height: 1.45; display: block; }

@media (max-width: 900px) { .ax-common { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  #automations { padding: 64px 0; }
  .ax-notes { grid-template-columns: 1fr; gap: 6px; padding: 18px 16px; }
  .ax-bar .ax-active { display: none; }
  .ax-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .ax-tab { flex: none; }
  .ax { box-shadow: 5px 5px 0 var(--ink); }
}
@media (max-width: 480px) { .ax-common { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ax-crumb > span:first-child { display: none; } .ax-stage { padding-bottom: 60px; } }
/* 9 tabs as an even 3 x 3 grid on tablet and desktop */
@media (min-width: 701px) { .ax-tabs { display: grid; grid-template-columns: repeat(3, 1fr); } }
