/* Workflow map: "Signal board" (docs/superpowers/specs/2026-09-25-map-ui-design.md).
   Warm stone ground, graphite ink, and one colour per kind of thing on the map:
   tag blue, workflow green, Zap orange, outside systems violet, removals red.
   Ink carries selection, primary buttons, focus and the hub. */

/* ================= 1. Tokens ================= */
:root {
  /* ground + ink */
  --bg:#F3F1EC; --panel:#FDFCFA; --sunken:#ECE9E2; --hover:#F0EDE6; --sel:#E6E2D8;
  --line:#E0DCD3; --line-2:#CBC6BA;
  --ink:#1A1C20; --ink-2:#464A52; --ink-3:#5C5F67;
  --hub:#1A1C20; --hub-ink:#F6F4EF;
  --canvas:#F7F6F2; --grid-dot:#D5D1C6; --band:rgba(26,28,32,.035);
  --edge:#8A8478; /* canvas edges: 3.4:1 on --canvas (non-text contrast), --line-2 was 1.6:1 */
  /* status */
  --ok:#1B7348; --ok-bg:#DCEFE3;
  --warn:#875100; --warn-bg:#F8ECD2; --warn-line:#E2BF7A;
  /* entity colours */
  --tag:#2850C4;  --tag-bg:#E4EAFA;  --tag-line:#9DB1EA;
  --flow:#0C6A52; --flow-bg:#DAEEE6; --flow-line:#8CC6B2;
  --zap:#B0400A;  --zap-bg:#FAE6D8;  --zap-line:#EBA67C;
  --ext:#6541C0;  --ext-bg:#ECE6F9;  --ext-line:#B6A2E6;
  --rem:#AE2A26;  --rem-bg:#F9E3E0;  --rem-line:#E2A099;
  /* highlight = "matched" */
  --hl:#FFE27A; --hl-ink:#1A1C20; --hl-line:#8A6A00;
  /* elevation */
  --shadow-1:0 1px 2px rgba(26,28,32,.06),0 1px 1px rgba(26,28,32,.03);
  --shadow-2:0 6px 16px rgba(26,28,32,.08),0 2px 4px rgba(26,28,32,.05);
  --shadow-3:0 18px 40px rgba(26,28,32,.14),0 4px 10px rgba(26,28,32,.06);
  --scrim:rgba(26,28,32,.42);
  /* type */
  --f-display:"Bricolage Grotesque","Instrument Sans","Segoe UI",system-ui,sans-serif;
  --f-ui:"Instrument Sans","Segoe UI",system-ui,sans-serif;
  --f-mono:"JetBrains Mono",ui-monospace,"Cascadia Mono",Menlo,monospace;
  /* space, radius, motion */
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px; --s-8:32px; --s-10:40px;
  --r-xs:5px; --r-sm:7px; --r-md:9px; --r-lg:11px; --r-xl:14px; --r-2xl:16px; --r-pill:999px;
  --ease:cubic-bezier(.2,.7,.2,1); --t-fast:120ms; --t-med:200ms; --t-slow:320ms;
  /* layout */
  --side-w:360px; --bar-h:60px;
  /* legacy aliases (kept so older rules keep working) */
  --paper:var(--bg); --rule:var(--line); --wire-tag:var(--tag); --wire-flow:var(--flow);
  --wire-remove:var(--rem); --wire-ext:var(--ext); --wire-zap:var(--zap); --focus:var(--ink);
  --sans:var(--f-ui); --mono:var(--f-mono); --muted:var(--ink-3);
  color-scheme:light;
}
/* Dark: its own palette, not an inversion. The hub turns light so it stays the focal point. */
:root[data-theme="dark"] {
  --bg:#0F1113; --panel:#16191C; --sunken:#0B0D0F; --hover:#1C2024; --sel:#252A31;
  --line:#262B31; --line-2:#383E46;
  --ink:#EDEAE3; --ink-2:#BAB7AF; --ink-3:#908E88;
  --hub:#EDEAE3; --hub-ink:#14161A;
  --canvas:#121518; --grid-dot:#2B3036; --band:rgba(237,234,227,.03);
  --edge:#68707B;
  --ok:#63D39D; --ok-bg:#12321F;
  --warn:#F2B75E; --warn-bg:#2C220F; --warn-line:#6B5220;
  --tag:#8FAAFF; --tag-bg:#18223F; --tag-line:#3A4F8F;
  --flow:#52CBA5; --flow-bg:#0F2E27; --flow-line:#2A6B58;
  --zap:#FF9A5C; --zap-bg:#361E10; --zap-line:#7E4520;
  --ext:#BCA5FF; --ext-bg:#231C3B; --ext-line:#51438A;
  --rem:#FF8C82; --rem-bg:#371816; --rem-line:#7C3530;
  --hl:#F2D264; --hl-ink:#14161A; --hl-line:#F2D264;
  --shadow-1:0 1px 0 rgba(0,0,0,.35);
  --shadow-2:0 8px 20px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.03);
  --shadow-3:0 20px 48px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.04);
  --scrim:rgba(0,0,0,.6);
  color-scheme:dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0F1113; --panel:#16191C; --sunken:#0B0D0F; --hover:#1C2024; --sel:#252A31;
    --line:#262B31; --line-2:#383E46;
    --ink:#EDEAE3; --ink-2:#BAB7AF; --ink-3:#908E88;
    --hub:#EDEAE3; --hub-ink:#14161A;
    --canvas:#121518; --grid-dot:#2B3036; --band:rgba(237,234,227,.03);
  --edge:#68707B;
    --ok:#63D39D; --ok-bg:#12321F;
    --warn:#F2B75E; --warn-bg:#2C220F; --warn-line:#6B5220;
    --tag:#8FAAFF; --tag-bg:#18223F; --tag-line:#3A4F8F;
    --flow:#52CBA5; --flow-bg:#0F2E27; --flow-line:#2A6B58;
    --zap:#FF9A5C; --zap-bg:#361E10; --zap-line:#7E4520;
    --ext:#BCA5FF; --ext-bg:#231C3B; --ext-line:#51438A;
    --rem:#FF8C82; --rem-bg:#371816; --rem-line:#7C3530;
    --hl:#F2D264; --hl-ink:#14161A; --hl-line:#F2D264;
    --shadow-1:0 1px 0 rgba(0,0,0,.35);
    --shadow-2:0 8px 20px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.03);
    --shadow-3:0 20px 48px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.04);
    --scrim:rgba(0,0,0,.6);
    color-scheme:dark;
  }
}

/* ================= 2. Base ================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: currentColor; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; }
code { font-family: var(--f-mono); font-size: .9em; }

.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 20px; height: 20px; }
.vh, .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--f-mono); font-size: .9em; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
kbd, .kbd {
  font: 500 11.5px/1 var(--f-mono); padding: 3px 6px 4px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 5px; color: var(--ink-3); background: var(--panel);
}
mark { background: var(--hl); color: var(--hl-ink); border-radius: 3px; padding: 0 2px; font-weight: 600; }

/* ================= 3. Buttons ================= */
.btn {
  height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap; background: none; color: var(--ink);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn[disabled] { cursor: not-allowed; opacity: .55; }
.btn-primary, .btn-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover, .btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }
.btn-primary[disabled], .btn-dark[disabled] { background: var(--ink); border-color: var(--ink); }
#sync[disabled] { cursor: progress; }
.btn-outline { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-ghost, .btn-quiet { background: transparent; color: var(--ink-2); font-weight: 500; padding: 0 10px; }
.btn-ghost:hover, .btn-quiet:hover { background: var(--hover); color: var(--ink); }
.btn-ghost[aria-current="page"], .btn-quiet[aria-current="page"] { background: var(--sel); color: var(--ink); font-weight: 600; }
.btn-danger { background: var(--panel); border-color: var(--rem-line); color: var(--rem); }
.btn-danger:hover { border-color: var(--rem); background: var(--rem-bg); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.ibtn {
  width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; display: inline-grid; place-items: center;
  color: var(--ink-2); cursor: pointer; flex: none; padding: 0; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ibtn:hover { background: var(--hover); color: var(--ink); }
.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }

.badge { font-size: 12px; height: 24px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge-mock { background: var(--hl); color: var(--hl-ink); }

/* ================= 4. Top bar ================= */
.bar {
  position: relative; height: var(--bar-h); flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 16px 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--ink); z-index: 20;
}
/* The title and sync groups may shrink down to their content's floor; the sub-account
   name and the sync status give way first (their one-line clamp lets them go narrow). */
.bar-title { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; }
.brand, .bar h1 {
  display: flex; align-items: center; gap: 10px; margin: 0; font: 700 17px/1 var(--f-display); letter-spacing: -.02em;
  white-space: nowrap; color: var(--ink);
}
.brand a, a.brand { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand .brand-sub { color: var(--ink-3); font-weight: 600; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.mark .i { width: 18px; height: 18px; stroke-width: 2; }

.loc-picker { position: relative; min-width: 0; }
.loc-btn {
  height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; max-width: 260px;
  border: 1px solid var(--line-2); background: var(--panel); border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.loc-btn:hover { border-color: var(--ink-3); }
.loc-btn[aria-expanded="true"] { background: var(--hover); }
.loc-btn .loc-cap { font-weight: 500; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
/* One line with "…", but not nowrap: nowrap would make the full name the button's minimum width.
   break-all cuts mid-word, as nowrap's "…" did, instead of at the last space. */
.loc-btn #loc-label { min-width: 0; overflow: hidden; word-break: break-all; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; }
.loc-btn .i { color: var(--ink-3); }
.loc-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 360px; max-width: calc(100vw - 24px);
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-3); padding: 10px; animation: pop-in var(--t-med) var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.loc-pop input, .loc-add-row input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); }
.loc-pop input:focus, .loc-add-row input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sel); background: var(--panel); }
.loc-list { list-style: none; margin: 6px 0; padding: 0; max-height: 300px; overflow: auto; }
.loc-list li { display: flex; align-items: stretch; gap: 2px; }
.loc-opt {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; border-radius: 9px; padding: 8px 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px; font-weight: 500; min-height: 40px; justify-content: center;
  overflow-wrap: anywhere; /* a long name with no spaces wraps instead of scrolling the list sideways */
}
.loc-opt:hover { background: var(--hover); }
.loc-opt.current { background: var(--sel); font-weight: 650; }
.loc-opt small { font: 500 11px var(--f-mono); color: var(--ink-3); }
.loc-remove { background: none; border: 0; color: var(--ink-3); width: 36px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.loc-remove:hover { color: var(--rem); background: var(--rem-bg); }
.loc-empty { color: var(--ink-3); font-size: 13px; padding: 8px 10px; }
.loc-add { border-top: 1px solid var(--line); padding: 10px 2px 2px; }
.loc-add label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.loc-add-row { display: flex; gap: 6px; }
.loc-add-row input { font-family: var(--f-mono); font-size: 13px; }
.loc-add-row + .loc-add-row { margin-top: 6px; }
.loc-add-row input.loc-add-name { font-family: inherit; }
.loc-hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.loc-error, .onb-error { margin: 4px 0 0; font-size: 12.5px; color: var(--rem); }
.loc-error:empty, .onb-error:empty { display: none; }
/* Deletion watch: GHL is about to delete a sub-account, or has (removals red). */
.loc-btn.del { border-color: var(--rem-line); }
.loc-btn.del::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--rem); box-shadow: 0 0 0 3px var(--rem-bg); }
.loc-btn.del #loc-label { color: var(--rem); }
.loc-opt.del > span { color: var(--rem); }
.loc-opt small.loc-del { display: inline-flex; align-items: center; gap: 4px; font: 600 11.5px var(--f-ui); color: var(--rem); }

.del-banner {
  flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 10px 20px;
  background: var(--rem-bg); border-bottom: 1px solid var(--rem-line); color: var(--ink); font-size: 13.5px; line-height: 1.45;
}
.del-banner > .i { color: var(--rem); margin-top: 2px; }
.del-banner p { margin: 0; min-width: 0; }
.del-banner b { color: var(--rem); font-weight: 700; }
.del-banner .del-checked { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }

.ghl-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; flex: none;
  transition: background-color var(--t-fast) var(--ease);
}
.ghl-chip:hover { background: var(--hover); color: var(--ink); }
.ghl-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.ghl-chip.bad { color: var(--warn); background: var(--warn-bg); }
.ghl-chip.bad::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-line); }
.ghl-chip.unknown::before { background: var(--ink-3); box-shadow: 0 0 0 3px var(--line-2); }

.gsearch { flex: 1; max-width: 520px; margin: 0 auto; position: relative; display: flex; align-items: center; min-width: 220px; }
.gsearch input {
  width: 100%; height: 40px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 10px;
  padding: 0 44px 0 40px; font-size: 14px; color: var(--ink);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.gsearch input::placeholder { color: var(--ink-3); }
.gsearch input:focus { background: var(--panel); border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--sel); }
.gsearch input:disabled { opacity: .6; cursor: not-allowed; }
.gsearch > .i { position: absolute; left: 13px; color: var(--ink-2); pointer-events: none; }
.gsearch kbd { position: absolute; right: 10px; pointer-events: none; }
.gsearch input:focus ~ kbd { display: none; }
.gsearch-close { display: none; }
.gsearch-toggle { display: none; }

.bar-sync { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; }
.sync-status {
  font-size: 12.5px; color: var(--ink-3); margin-right: 6px; max-width: 260px; min-width: 0;
  overflow: hidden; word-break: break-all; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1;
}
/* An error wraps, but at most 3 lines (47px), so a squeezed one can't grow out of the 60px bar. */
.sync-status.error { color: var(--rem); max-width: 300px; line-height: 1.25; word-break: normal; overflow-wrap: anywhere; -webkit-line-clamp: 3; line-clamp: 3; }
/* 210px when there's room, narrower when the bar is full: a minmax(0, 210px) track is the
   same width whatever the text says, and doesn't count toward the bar's minimum width. */
.sync-progress { display: grid; grid-template-columns: minmax(0, 210px); gap: 6px; min-width: 0; margin-right: 6px; }
.sync-progress-text { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-meter, .meter { position: relative; display: block; height: 4px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.sync-meter-fill, .meter > span { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 4px; background: var(--ink); transition: width var(--t-slow) var(--ease); }
.sync-meter.indeterminate .sync-meter-fill, .meter.indeterminate > span { width: 30%; animation: sync-slide 1.3s ease-in-out infinite; }
@keyframes sync-slide { from { left: -30%; } to { left: 100%; } }
.btn .btn-label { display: inline; }

/* user menu (session.js) */
.who-wrap { position: relative; flex: none; }
.who {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 6px 0 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink-2); margin-left: 2px;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.who:hover, .who[aria-expanded="true"] { border-color: var(--line-2); background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sel); color: var(--ink); display: grid; place-items: center; font: 700 12.5px/1 var(--f-ui); }
.who-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3);
  animation: pop-in var(--t-med) var(--ease);
}
.menu-head { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px;
  background: none; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); }
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item[aria-current="page"] { background: var(--sel); font-weight: 650; }
.menu-item .i { color: var(--ink-3); }
.menu-check { margin-left: auto; display: inline-grid; visibility: hidden; color: var(--ink); }
.menu-item[aria-checked="true"] { font-weight: 650; }
.menu-item[aria-checked="true"] .menu-check { visibility: visible; }
.menu-label { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 4px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu-narrow, .menu-phone { display: none; }

/* ================= 5. Tabs ================= */
.tabs {
  height: 48px; flex: none; display: flex; align-items: stretch; gap: 2px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; white-space: nowrap; position: relative;
  background: none; border: 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink); background: var(--hover); }
.tab:focus-visible { outline-offset: -3px; }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--ink); }
.count {
  display: inline-block; font: 500 11.5px/20px var(--f-mono); padding: 0 7px; border-radius: 999px; min-width: 20px; text-align: center;
  background: var(--sunken); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] .count { background: var(--ink); color: var(--bg); }
.count-warn, .tab .count-warn, .tab[aria-selected="true"] .count-warn { background: var(--warn-bg); color: var(--warn); }
.tab-q { font-weight: 500; color: var(--ink-3); font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.tabs-sep { width: 1px; background: var(--line); margin: 12px 6px; flex: none; }

/* ================= 6. Layout, side list ================= */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 0; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.main { overflow: auto; padding: 24px 32px 64px; min-width: 0; position: relative; }
.main:focus { outline: none; }
@media (min-width: 901px) {
  body.shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
  body.shell .layout { flex: 1; min-height: 0; }
}

.side-tools { padding: 16px 16px 12px; display: grid; gap: 12px; }
.field { position: relative; display: flex; align-items: center; }
.field > .i { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.input, .side-tools input[type="search"] {
  width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg);
  padding: 0 12px 0 36px; font-size: 14px; color: var(--ink);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.input::placeholder, .side-tools input::placeholder { color: var(--ink-3); }
.input:focus, .side-tools input[type="search"]:focus { outline: none; border-color: var(--ink); background: var(--panel); box-shadow: 0 0 0 3px var(--sel); }
.input-plain { padding-left: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters:empty { display: none; }
.chip-filter {
  height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chip-filter:hover { border-color: var(--ink-3); color: var(--ink); }
.chip-filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-filter .n { font: 500 11px/1 var(--f-mono); color: var(--ink-3); }
.chip-filter[aria-pressed="true"] .n { color: inherit; opacity: .8; }
.list-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 20px 6px;
  font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); min-height: 31px;
}
.list-meta b { color: var(--ink); font-weight: 600; }
.list-meta:empty { display: none; }
.list-meta .meta-controls { display: flex; gap: 4px; flex-shrink: 0; }
.list-meta .meta-select {
  font: inherit; font-size: 12px; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 2px 4px; cursor: pointer; max-width: 130px;
}
.list-meta .meta-select:hover { background: var(--hover); color: var(--ink); }
.list-meta .meta-select:focus-visible { border-color: var(--line); }
.list .sub .enrolled { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 4px 8px 16px; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1px; }
.list .row {
  width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; text-align: left;
  padding: 9px 12px; border-radius: 9px; border: 0; background: none; cursor: pointer; min-height: 58px; text-decoration: none; color: var(--ink);
  transition: background-color var(--t-fast) var(--ease);
}
.list .row:hover { background: var(--hover); }
.list .row[aria-current="true"] { background: var(--sel); }
.list .row:focus-visible { outline-offset: -2px; }
.list .name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .row[aria-current="true"] .name { font-weight: 650; }
.list .row[aria-current="true"] .sub, .list .row[aria-current="true"] .n { color: var(--ink-2); }
.list .sub {
  grid-column: 2 / 4; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; gap: 6px; align-items: center; min-width: 0;
}
.list .sub > span:not(.conf):not(.pill) { overflow: hidden; text-overflow: ellipsis; }
.list .n { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/1 var(--f-mono); color: var(--ink-3); }
.list .n .i { width: 13px; height: 13px; }
.row-lead { display: grid; place-items: center; }
.row-lead .mini { margin-left: -3px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: block; flex: none; }
.s-pub { background: var(--ok); }
.s-draft { box-shadow: inset 0 0 0 1.6px var(--ink-3); }
.s-del { background: var(--rem); }
.s-warn { background: var(--warn); }
.group-title { padding: 14px 12px 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.list .empty { padding: 16px 12px 20px; color: var(--ink-2); font-size: 13.5px; }
.list .list-tip { padding: 16px 12px 8px; color: var(--ink-3); font-size: 12.5px; }
.sk { display: block; height: 10px; border-radius: 6px; background: var(--sunken); }
.sk-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px 10px; padding: 14px 12px; align-items: center; min-height: 58px; }
.sk-row .sdot { background: var(--sunken); }
.sk-row .sk:last-child { grid-column: 2; height: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { background: linear-gradient(90deg, var(--sunken) 30%, var(--hover) 50%, var(--sunken) 70%); background-size: 300% 100%; animation: sk-shimmer 1.6s linear infinite; }
  @keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
}
.navrow {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 9px; border: 0; background: none;
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; text-align: left;
}
.navrow:hover { background: var(--hover); }
.navrow[aria-current="true"] { background: var(--sel); font-weight: 650; }
.navrow .count { margin-left: auto; }
.seg.scope-inline { display: none; }
.list .list-empty { display: grid; gap: 8px; justify-items: start; color: var(--ink-2); }
.list .list-empty b { color: var(--ink); font-weight: 650; }
.side-h { font: 650 16px/1.2 var(--f-display); margin: 0; letter-spacing: -.01em; }
.filters.side-search { display: grid; gap: 16px; }
.scope-note { font-size: 12.5px; margin: 8px 0 0; }
.side-tools:has(.side-search) { padding-top: 20px; }
.lab, .sub-lab { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; display: block; }

/* ================= 7. Detail header ================= */
.detail-bar { display: none; }
.crumb { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; min-width: 0; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb .i { width: 13px; height: 13px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.detail-head h2 { margin: 0; font: 650 30px/1.12 var(--f-display); letter-spacing: -.025em; text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
.detail-head .title-row { display: flex; gap: 14px; align-items: center; min-width: 0; }
.head-actions { display: flex; gap: 10px; align-items: center; flex: none; padding-top: 2px; }
.head-actions.stack { flex-direction: column; align-items: flex-end; gap: 6px; }
.head-actions .note-sm { font-size: 12px; color: var(--ink-3); }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 12px 0 22px; font-size: 13.5px; color: var(--ink-2); }
.detail-meta b { font-weight: 600; color: var(--ink); }
.detail-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); flex: none; }
.detail-meta .inline { display: inline-flex; gap: 6px; align-items: center; }
.page-intro { color: var(--ink-2); max-width: 78ch; margin: 10px 0 22px; }
.page-intro b { color: var(--ink); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.pill-sm { height: 20px; padding: 0 8px; font-size: 11.5px; }
.pill-pub { background: var(--ok-bg); color: var(--ok); }
.pill-draft { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill-del { background: var(--rem-bg); color: var(--rem); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-zap { background: var(--zap-bg); color: var(--zap); }
.pill .sdot { width: 7px; height: 7px; }
.pill .i { width: 12px; height: 12px; }

/* segmented controls: Overview/Flow, Explore sections, Search scope */
.view-toggle, .seg, .xf-seg {
  display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); gap: 2px;
}
.view-toggle > button, .seg > button, .seg-btn {
  height: 30px; padding: 0 13px; border-radius: 7px; border: 0; background: none; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.view-toggle > button:hover, .seg > button:hover, .seg-btn:hover { color: var(--ink); }
.view-toggle > [aria-pressed="true"], .seg > [aria-pressed="true"], .seg-btn[aria-pressed="true"] {
  background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
}
.seg-full, .xf-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.seg-full > button, .xf-seg .seg-btn { padding: 0 8px; }

/* ================= 8. Glyphs, refs, badges ================= */
.glyph { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.glyph .i { width: 13px; height: 13px; stroke-width: 2; }
.glyph-lg { width: 30px; height: 30px; border-radius: 9px; }
.glyph-lg .i { width: 16px; height: 16px; }
.mini { width: 16px; height: 16px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; }
.mini .i { width: 10px; height: 10px; stroke-width: 2.4; }
.g-tag { background: var(--tag-bg); color: var(--tag); }
.g-flow { background: var(--flow-bg); color: var(--flow); }
.g-zap { background: var(--zap-bg); color: var(--zap); }
.g-ext { background: var(--ext-bg); color: var(--ext); }
.g-rem { background: var(--rem-bg); color: var(--rem); }
.g-warn { background: var(--warn-bg); color: var(--warn); }
.g-neutral { background: var(--sunken); color: var(--ink-2); }
.g-ink { background: var(--ink); color: var(--bg); }
.g-zap.glyph, .mini.g-zap { border-radius: 4px; }
.g-zap.glyph-lg { border-radius: 6px; }

.tagpill {
  display: inline-flex; align-items: center; gap: 5px; font: 500 12.5px/1 var(--f-mono); letter-spacing: -.01em;
  color: var(--tag); background: var(--tag-bg); padding: 4px 8px 4px 6px; border-radius: 6px; border: 0; white-space: nowrap;
  text-decoration: none; max-width: 100%; min-width: 0; cursor: pointer; vertical-align: middle;
  transition: box-shadow var(--t-fast) var(--ease);
}
.tagpill > span { overflow: hidden; text-overflow: ellipsis; }
.tagpill:hover { color: var(--tag); box-shadow: inset 0 0 0 1px var(--tag-line); }
.tagpill .i { width: 12px; height: 12px; }
.tagpill.rem { color: var(--rem); background: var(--rem-bg); }
.tagpill.rem:hover { box-shadow: inset 0 0 0 1px var(--rem-line); }
.tagpill-lg { font-size: 24px; padding: 8px 14px 8px 12px; border-radius: 11px; gap: 10px; cursor: default; }
.tagpill-lg .i { width: 20px; height: 20px; }
.tagpill-lg:hover { box-shadow: none; }

.linkish, .ref {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--ink); text-decoration: none;
  font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; vertical-align: middle;
}
.linkish > span:last-child, .ref > span:last-child, .linkish:not(:has(span)) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.linkish:hover > span:last-child, .ref:hover > span:last-child, .linkish:not(:has(span)):hover { text-decoration-color: currentColor; }
.linkish.tagpill > span:last-child { text-decoration: none; }
.off, .inactive {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 650; color: var(--rem); background: var(--rem-bg);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap; line-height: 1.3; margin-left: 2px; flex: none;
}
.conf {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; flex: none; line-height: 1;
}
.conf::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.conf-exact { background: var(--sunken); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.conf-exact::before { background: currentColor; }
.conf-likely { color: var(--ink-2); border: 1px dashed var(--ink-3); }
.conf-likely::before { box-shadow: inset 0 0 0 1.5px currentColor; }
.loc-label {
  font: 500 11.5px/1 var(--f-mono); padding: 4px 7px; border-radius: 5px; background: var(--sunken); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; flex: none;
}
.loc-label.unlinked { background: transparent; box-shadow: none; border: 1px dashed var(--line-2); padding: 3px 6px; }
.app-mono {
  width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font: 600 9.5px/1 var(--f-mono);
  background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); flex: none; letter-spacing: 0;
}
.kv { font: 500 12px/1.4 var(--f-mono); color: var(--ink-2); background: var(--sunken); padding: 2px 6px; border-radius: 5px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kv .k { color: var(--ink-3); }
.ent-id { color: var(--ink-3); font-size: 11px; }
.id-gone { color: var(--warn); } /* a pipeline, stage or custom field id the sub-account no longer has */

/* ================= 9. Wiring (Overview) ================= */
.wiring {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 190px) minmax(0, 1fr); gap: 0 78px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px 16px; margin-bottom: 28px; box-shadow: var(--shadow-1);
}
.wiring svg.wires, .wiring svg.ports { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wiring svg.wires { z-index: 0; }
.wiring svg.ports { z-index: 2; }
.w { fill: none; stroke-width: 1.8; }
.w-tag { stroke: var(--tag); } .w-flow { stroke: var(--flow); } .w-zap { stroke: var(--zap); } .w-ext { stroke: var(--ext); } .w-rem { stroke: var(--rem); }
.w-likely { stroke-dasharray: 5 4; }
.w-ink { stroke: var(--ink); }
.port { fill: var(--panel); stroke-width: 1.8; }
.port-in { stroke-width: 0; }
.pf-tag { fill: var(--tag); } .pf-flow { fill: var(--flow); } .pf-zap { fill: var(--zap); } .pf-ext { fill: var(--ext); } .pf-rem { fill: var(--rem); }
.col { display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; min-width: 0; }
.col-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 -4px; display: flex; gap: 8px; align-items: center; min-height: 22px; }
.col-center { justify-content: center; padding-top: 30px; }
.node {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 12px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 13px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.node:hover { border-color: var(--ink-3); box-shadow: var(--shadow-2); }
.node.likely { border-style: dashed; }
.node-title { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); font-weight: 500; min-width: 0; }
.node-title .what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-title .conf { margin-left: auto; }
.node .val { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.node .val > :not(.off):not(.conf) { min-width: 0; }
.node ul { list-style: none; margin: 0; padding: 7px 0 0; border-top: 1px dashed var(--line-2); display: grid; gap: 5px; }
.node li { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.node li.lbl { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.node li.none { color: var(--ink-3); font-size: 12.5px; }
.node-sub { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.hub {
  background: var(--hub); color: var(--hub-ink); border-radius: 14px; padding: 16px 16px 14px; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.hub-k { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; opacity: .72; }
.hub-n { font: 650 18px/1.18 var(--f-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.hub-s { font-size: 12.5px; opacity: .8; display: flex; gap: 8px; align-items: center; }
.empty-col { color: var(--ink-3); font-size: 13px; padding: 8px 0; margin: 0; }
.legend {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); align-items: center; position: relative; z-index: 1;
}
.lg { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg svg { width: 24px; height: 8px; overflow: visible; }
.lg .swatch { width: 22px; height: 12px; border-radius: 3px; background: var(--hl); box-shadow: inset 0 0 0 1px var(--hl-line); }
.legend .gap { flex: 1; }
.legend.plain { border-top: 0; margin-top: 12px; padding-top: 0; }

/* ================= 10. Sections, rows, timeline, tables ================= */
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
.cols-2.zap-cols { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.section { min-width: 0; }
.section + .section { margin-top: 24px; }
.stack > .section + .section, .cols-2 > .section + .section { margin-top: 0; }
.sec-h, .section h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.sec-h h3, .section > h3 { margin: 0; font: 650 16px/1.3 var(--f-display); letter-spacing: -.01em; }
.sec-h .aux { font-size: 12.5px; color: var(--ink-3); }
.sec-h .end { margin-left: auto; font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card > .rows { border: 0; border-radius: 0; }
.rows > li { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; min-width: 0; font-size: 14px; }
.rows > li:first-child { border-top: 0; }
.rows > li.d { display: block; }
.rows .body { min-width: 0; flex: 1; }
.rows .t, .t { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rows .d, .d { font-size: 13px; color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
.rows .d .trig-cond { display: block; width: 100%; }
/* Fields tab: each place a workflow uses the field, one per line. */
.rows .d .field-use { display: block; width: 100%; }
.rows .d .field-use .kv { white-space: normal; }
.wf-fields .rows > li.more-hidden { display: none; }
.wf-fields.open .rows > li.more-hidden { display: flex; }
.wf-fields-more { margin-top: 6px; }
.wf-fields.open .wf-fields-more { display: none; }
.idx { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; font: 500 11px/1 var(--f-mono); color: var(--ink-2); flex: none; }
.steps > li { align-items: center; padding-top: 11px; padding-bottom: 11px; }
.steps .body.line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.steps .body.line > .t { min-width: 150px; }
.steps .body.line > .d { margin-top: 0; }
.zap-steps > li { align-items: flex-start; }
.zap-steps .d { margin-top: 6px; }
.show-all-row { display: none; border-top: 1px solid var(--line); padding: 4px; }
.show-all-row .btn { width: 100%; height: 44px; }
.more-row { font-size: 13px; color: var(--ink-2); display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--line); }
.tl { list-style: none; margin: 0; padding: 16px 18px 4px; }
.tl li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 16px; }
.tl li::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tdot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--panel); box-shadow: inset 0 0 0 2.5px var(--line-2); }
.tdot-now { box-shadow: inset 0 0 0 4px var(--ink); }
.tdot-new { box-shadow: inset 0 0 0 4px var(--flow); }
.tdot-rem { box-shadow: inset 0 0 0 4px var(--rem); }
.tl .when { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tl .d { margin-top: 2px; }
.tl-empty { padding: 14px 16px; color: var(--ink-3); font-size: 13px; margin: 0; }
.hist-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.hist-row > div { min-width: 0; }
.hist-row .btn { flex: none; margin-top: -4px; }
.hist-more { border-top: 1px solid var(--line); padding: 4px; }
.hist-more .btn { width: 100%; height: 40px; }

/* Version dialog: one past version and what changed since */
dialog.version-dlg {
  max-width: 860px; width: calc(100% - 32px); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-3);
}
dialog.version-dlg::backdrop { background: var(--scrim); }
.vd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.vd-head h2 { margin: 0; font: 650 20px/1.2 var(--f-display); }
.vd-head p { margin: 4px 0 0; font-size: 13px; }
.version-dlg .view-toggle { margin-bottom: 12px; }
.vd-note { font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.vd-code {
  font: 12.5px/1.55 var(--f-mono); background: var(--sunken); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 0; margin: 0; overflow: auto; max-height: calc(100vh - 260px); white-space: pre-wrap; overflow-wrap: anywhere;
}
pre.vd-code { padding: 10px 12px; }
.dl { padding: 0 12px 0 28px; position: relative; white-space: pre-wrap; }
.dl-op { position: absolute; left: 10px; }
.dl-add, .dl-key.dl-add { background: var(--ok-bg); color: var(--ok); }
.dl-rem, .dl-key.dl-rem { background: var(--rem-bg); color: var(--rem); }
.dl-skip { color: var(--ink-3); font-style: italic; }
.dl-key { padding: 1px 6px; border-radius: 5px; }
.vd-compare { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.vd-cmp-lab { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.vd-pick { position: relative; min-width: 0; max-width: 100%; }
.vd-pick > .btn { max-width: 100%; gap: 6px; }
.vd-pick > .btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-pop {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; width: min(440px, calc(100vw - 64px));
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-3); padding: 8px;
}
.vd-pop .form-input { width: 100%; }
.vd-opts { list-style: none; margin: 6px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.vd-opts button {
  display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
}
.vd-opts button:hover, .vd-opts button:focus-visible { background: var(--hover); outline: none; }
.vd-opts button[aria-current="true"] { background: var(--sel); font-weight: 600; }
.vd-none { padding: 7px 8px; font-size: 13px; color: var(--ink-3); }
/* Step editor (admins): change a step and save it to GHL */
dialog.edit-dlg { max-width: 720px; }
.step-edit { flex: none; margin-left: auto; }
.ef { margin: 0 0 14px; min-width: 0; }
.ef-lab { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.ef-sub { display: block; font-size: 12.5px; color: var(--ink-2); margin: 8px 0 4px; }
.ef-set { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.ef-area { height: auto; min-height: 96px; padding-top: 8px; padding-bottom: 8px; line-height: 1.45; resize: vertical; }
.ef-code { font: 12.5px/1.5 var(--f-mono); }
.ef-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ef-row .ef-num { width: 120px; flex: none; }
.ef-row select.form-input { width: auto; min-width: 120px; }
.ef-check label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.ef-hint { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.ef-hint.ef-warn { color: var(--warn); }
.ef-adv summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.ef-live { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 14px; margin: 12px 0 0; font-size: 13.5px; }
.ef-live .ef-lab { margin: 10px 0 6px; font-weight: 500; }
.ef-err { color: var(--rem); font-size: 13px; margin: 10px 0 0; white-space: pre-wrap; }
.ef-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.ef-row .ef-grow { flex: 1; width: auto; min-width: 160px; }
.note.ef-fix { margin: 0 0 16px; background: var(--warn-bg); color: var(--ink); }
.note.ef-fix > .i { color: var(--warn); }
/* Step editor preview: tags the save creates first, or a remove step's missing tag. */
.note.ef-tags { background: var(--warn-bg); color: var(--ink); }
.check-actions { margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); padding: 12px 14px; border-radius: 10px; background: var(--sunken); margin: 12px 0 0; }
.note > .i { margin-top: 1px; color: var(--ink-3); }
.note.col { flex-direction: column; gap: 8px; padding: 16px; margin: 0; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl .num, .tbl th.num { font-family: var(--f-mono); font-size: 12.5px; text-align: right; white-space: nowrap; }
.tbl .why { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.tbl .t { flex-wrap: nowrap; }
.tbl ul.ev { margin: 8px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 3px; }
#copy-note { margin: 0; font-size: 12px; color: var(--ok); display: inline-flex; gap: 5px; align-items: center; }
#copy-note .i { width: 13px; height: 13px; }

/* ================= 11. Checks ================= */
.group-label { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 650 15px/1 var(--f-display); }
.check-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.check {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 14px; scroll-margin-top: 16px;
}
.check.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.check h4 { margin: 0; font: 650 16px/1.3 var(--f-display); letter-spacing: -.01em; }
.check p { margin: 2px 0 10px; color: var(--ink-2); font-size: 13.5px; max-width: 78ch; }
.check.warn p { color: var(--ink); opacity: .85; }
.affected { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.affected .lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.check.warn .affected .lbl { color: var(--warn); }
.echip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 7px; border-radius: 8px; background: var(--panel);
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink); max-width: min(420px, 100%); min-width: 0; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}
.echip > span:not(.mini):not(.pill) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.echip:hover { border-color: var(--ink-3); }
.affected .echip.more-hidden { display: none; }
.affected.open .echip.more-hidden { display: inline-flex; }
.affected.open .more-btn { display: none; }

/* ================= 12. Search results ================= */
.results { display: flex; flex-direction: column; gap: 20px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; scroll-margin-top: 16px; }
.group-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.group-h h3 { margin: 0; font: 650 16px/1 var(--f-display); }
.group-h .end { margin-left: auto; }
.hit {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px 18px; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--ink); transition: background-color var(--t-fast) var(--ease);
}
.hit:first-of-type, .group-h + .hit { border-top: 0; }
.hit:hover { background: var(--hover); }
.hit:focus-visible { outline-offset: -2px; }
.hit-body { min-width: 0; display: grid; gap: 6px; }
.hit-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hit-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ex { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 12px; font-size: 13px; margin: 0; }
.ex dt { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Excerpts wrap (up to two lines) instead of an ellipsis that can cut through a <mark>; app.js
   shortens them to 140 characters before highlighting, so they fit these lines. */
.ex dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.hit-go { align-self: center; color: var(--ink-3); }
.group .hit.more-hidden, .group .tagcard.more-hidden { display: none; }
.group.open .hit.more-hidden, .group.open .tagcard.more-hidden { display: grid; }
.group.open .more-btn { display: none; }
.tagcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.tagcard { background: var(--panel); padding: 14px 18px; display: grid; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; align-content: start; }
.tagcard:hover { background: var(--hover); }
.tagcard .top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tagcard .tagpill { cursor: pointer; }

/* ================= 13. Flow canvas ================= */
.flow {
  --c: var(--ink-2); --c-bg: var(--sunken);
  position: relative; height: clamp(380px, 68vh, 760px); margin-bottom: 28px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.flow-viewport {
  position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none;
  background-color: var(--canvas); background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1.4px);
  user-select: none; -webkit-user-select: none;
}
.flow-viewport.dragging { cursor: grabbing; }
.flow-viewport:focus-visible { outline-offset: -3px; }
.flow-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.flow-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.flow-edges .fe { fill: none; stroke: var(--edge); stroke-width: 1.6; }
.flow-edges .fe-jump { stroke-dasharray: 4 4; }
.flow-edges .fe-sel { stroke: var(--ink); stroke-width: 2.2; }
.flow-edges marker path { fill: var(--edge); }
.flow-edges marker.fa-sel path { fill: var(--ink); }

.fn {
  position: absolute; box-sizing: border-box; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 11px; font-size: 13px; line-height: 1.3; cursor: pointer; overflow: hidden; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 5px; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.fn:hover { border-color: var(--ink-3); box-shadow: var(--shadow-2); }
.fn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fn.fn-sel { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink), var(--shadow-2); }
.fn-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fn-ico { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--c-bg); color: var(--c); }
.fn-ico svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fn-type { font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-desc { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-desc .linkish, .fn-desc .tagpill { font-size: 11.5px; display: inline-flex; }
.fn-desc .tagpill { padding: 2px 5px 2px 4px; }
.fn-off { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--rem); flex: none; }
.fn-flag { position: absolute; right: 8px; top: 8px; font-size: 10px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 1px 5px; }

/* categories: colour only for things that link to other nodes on the map */
.fc-tag { --c: var(--tag); --c-bg: var(--tag-bg); }
.fc-workflow { --c: var(--flow); --c-bg: var(--flow-bg); }
.fc-webhook, .fc-sheet, .fc-slack, .fc-form { --c: var(--ext); --c-bg: var(--ext-bg); }
.fc-zap { --c: var(--zap); --c-bg: var(--zap-bg); }
.fc-zap .fn-ico { border-radius: 4px; }
.fc-email, .fc-sms, .fc-wait, .fc-fork, .fc-goto, .fc-money, .fc-code, .fc-note, .fc-bell, .fc-goal, .fc-ai, .fc-contact, .fc-dot, .fc-bolt { --c: var(--ink-2); --c-bg: var(--sunken); }
.fn-neg { --c: var(--rem); --c-bg: var(--rem-bg); }
.fn-orphan { border-style: dashed; }

.fn-trigger { border-radius: 22px 10px 10px 22px; padding-left: 14px; }
.fn-trigger .fn-ico { border-radius: 50%; }
.fn-trigger.fn-inactive { border-style: dashed; }
.fn-trigger.fn-inactive:not(.fx-match) .fn-name { color: var(--ink-2); }
.fn.fx-match .fn-off { color: var(--hl-ink); }
.fn-placeholder { border-style: dashed; background: transparent; box-shadow: none; }
.fn-branch { border-radius: 999px; align-items: center; justify-content: center; text-align: center; padding: 6px 16px; background: var(--sunken); gap: 1px; }
.fn-branch .fn-cond { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fn-branch .fn-name { max-width: 100%; }
.fn-branch.fn-else { background: transparent; }
.fn-jump { flex-direction: row; align-items: center; gap: 7px; border-radius: 999px; border-style: dashed; padding: 6px 12px; background: transparent; box-shadow: none; }
.fn-jump .fn-name { margin: 0; font-weight: 500; font-size: 12.5px; }

/* zoomed far out: hide the small print so the shapes stay readable */
.flow-far .fn-desc, .flow-far .fn-cond, .flow-far .fn-type { visibility: hidden; }

.flow-tools {
  position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; z-index: 3;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 4px; box-shadow: var(--shadow-2);
}
.flow-tools button { width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.flow-tools button:hover { background: var(--hover); color: var(--ink); }
.flow-tools svg, .fp-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.flow-tools .vsep { margin: 0 2px; }
.flow-tools .flow-fit { width: auto; display: inline-flex; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 500; }
.flow-zoom { font: 500 12px/1 var(--f-mono); color: var(--ink-2); min-width: 48px; text-align: center; }
.flow-hint {
  position: absolute; left: 12px; bottom: 12px; margin: 0; z-index: 3; font-size: 12px; color: var(--ink-2); pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; border-radius: 9px; display: flex; gap: 6px; align-items: center;
  max-width: calc(100% - 240px); white-space: nowrap; overflow: hidden;
}
.flow-hint kbd { font-size: 10.5px; padding: 2px 5px 3px; }

.flow-panel {
  position: absolute; top: 12px; right: 12px; z-index: 4; width: 312px; max-width: calc(100% - 24px); max-height: calc(100% - 76px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-3);
  font-size: 13.5px; display: flex; flex-direction: column; gap: 10px; animation: pop-in var(--t-med) var(--ease);
}
.flow-panel > * { margin: 0; }
.flow-panel h4 { margin: 0 28px 0 0; font: 650 17px/1.25 var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.flow-panel p { color: var(--ink-2); overflow-wrap: anywhere; }
.flow-panel .fp-kind { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: -6px; }
.flow-panel .fp-sub { font-size: 12.5px; }
.flow-panel .fp-warn { color: var(--warn); }
.flow-panel .linkish > span:last-child, .flow-panel .linkish:not(:has(span)) { white-space: normal; }
.fp-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.fp-close:hover { background: var(--hover); color: var(--ink); }
.fp-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: var(--bg); }
.fp-box .t { font-size: 13px; }
.fp-box .why { font-size: 12.5px; color: var(--ink-3); }
.fp-conds { margin: 0; padding-left: 18px; }
.fp-conds li { margin-bottom: 4px; }
.fp-conds small { color: var(--ink-3); }
.fp-attrs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; font-size: 12.5px; }
.fp-attrs dt { color: var(--ink-3); }
.fp-attrs dd { margin: 0; overflow-wrap: anywhere; }
/* Workflow page: the workflow's settings, as the same label/value list. */
.settings-card > .fp-attrs { padding: 14px 16px; font-size: 13px; margin: 0; }
.fp-raw summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.fp-raw pre { font: 11px/1.45 var(--f-mono); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; overflow: auto; max-height: 240px; margin: 6px 0 0; }
.fp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ================= 14. Explore ================= */
.xf { display: grid; gap: 0; flex: 1 1 100%; min-width: 0; }
.xf-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; min-height: 42px; }
.xf-title { font: 650 16px/1.2 var(--f-display); margin: 0; letter-spacing: -.01em; }
.xf-sec { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.xf-h { margin: 0; font: 650 13px/1.3 var(--f-ui); display: flex; gap: 6px; align-items: baseline; }
.xf-h span { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.xf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xf-field { display: grid; gap: 5px; min-width: 0; }
.xf-field label, .xf-sub { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.xf-side { display: grid; gap: 5px; }
.combo { position: relative; }
.side-tools .combo-input, .combo-input {
  width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel);
  padding: 0 30px 0 11px; font-size: 13.5px; color: var(--ink); text-overflow: ellipsis;
  transition: border-color var(--t-fast) var(--ease);
}
.combo-input::placeholder { color: var(--ink-3); }
.combo-input:hover { border-color: var(--ink-3); }
.combo-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sel); }
.combo-chev { position: absolute; right: 10px; top: 11px; color: var(--ink-3); pointer-events: none; }
.combo-input.has-value { background: var(--tag-bg); border-color: var(--tag-line); color: var(--tag); font-weight: 600; font-family: var(--f-mono); font-size: 13px; }
.combo-input.has-value ~ .combo-chev { display: none; }
.combo-clear {
  position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--tag);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.combo-clear:hover { background: var(--panel); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; list-style: none; margin: 0; padding: 4px;
  max-height: min(300px, 50vh); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-3);
  min-width: 220px;
}
.combo-list li[data-i] { display: flex; flex-direction: column; padding: 7px 9px; border-radius: 7px; cursor: pointer; min-width: 0; }
.combo-list li.active { background: var(--sel); }
.combo-list li[aria-selected="true"] .combo-label { font-weight: 600; }
.combo-label { font-size: 13.5px; overflow-wrap: anywhere; }
.combo-sub { font-size: 11.5px; color: var(--ink-3); }
.combo-any .combo-label { color: var(--ink-2); font-style: italic; }
.combo-note { padding: 6px 9px; font-size: 12px; color: var(--ink-3); }
.explore-sentence { margin: -8px 0 18px; color: var(--ink-2); max-width: 80ch; line-height: 1.8; }
.explore-sentence b { color: var(--ink); font-weight: 600; }

.flow.explore-canvas { height: clamp(420px, calc(100vh - 330px), 1400px); }
.flow-band { position: absolute; left: 0; background: var(--band); border-top: 1px solid var(--line); pointer-events: none; }
.flow-band-alt { background: transparent; }
.fn.fx-match { background: var(--hl); border-color: var(--hl-line); color: var(--hl-ink); --c: var(--hl-ink); }
.fn.fx-match .fn-type, .fn.fx-match .fn-desc { color: var(--hl-ink); opacity: .78; }
.fn.fx-match .fn-ico { background: rgba(26,28,32,.1); color: var(--hl-ink); }
.fn.fx-match.fn-sel { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow-2); border-color: var(--ink); }
.match-tag { position: absolute; right: 8px; top: 8px; font: 700 9.5px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; padding: 3px 5px; border-radius: 4px; background: var(--hl-ink); color: var(--hl); }
.fx-match .fn-head { padding-right: 58px; }
.xn-wf { background: var(--hub); color: var(--hub-ink); border-color: var(--hub); box-shadow: var(--shadow-2); --c: var(--hub); --c-bg: var(--hub-ink); }
.xn-wf .fn-type { color: var(--hub-ink); opacity: .72; }
.xn-wf .xn-wf-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.22; font: 650 14px/1.22 var(--f-display); }
.xn-wf.xn-draft { background: var(--ink-2); border-color: var(--ink-2); }
.xn-wf.fn-sel { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--ink); }
.xn-wf:hover { border-color: var(--hub); }
.xn-more { align-items: center; justify-content: center; border-style: dashed; background: transparent; color: var(--ink-2); box-shadow: none; }
.xn-more .fn-name { margin: 0; font-weight: 500; font-size: 12.5px; }
.xn-toggle { cursor: pointer; }
.xn-toggle:hover { background: var(--hover); border-style: solid; }
.flow-edges .fe-seq { stroke: var(--edge); stroke-dasharray: 2 3; }
.flow-edges .fe-match { stroke: var(--hl-line); stroke-width: 2; }
.flow-edges .fe-link { stroke: var(--tag); stroke-width: 2; stroke-dasharray: 6 4; }
.flow-edges .fe-link-wf { stroke: var(--flow); }
.flow-edges .fe-link.fe-sel { stroke-width: 2.6; }
.flow-edges marker.fa-link path { fill: var(--tag); }
.flow-tiny .fn-name, .flow-tiny .fn-ico, .flow-tiny .fn-off, .flow-tiny .match-tag { visibility: hidden; }
.flow-tiny .fn { box-shadow: none; }
.flow-panel .fp-match { display: inline-flex; align-self: flex-start; font: 700 10px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; background: var(--hl); color: var(--hl-ink); }
.explore-blank { text-align: left; }
.xe-examples { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.xe-examples a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  text-decoration: none; font-weight: 500; transition: border-color var(--t-fast) var(--ease);
}
.xe-examples a:hover { border-color: var(--ink-3); }
.xe-examples a .hit-go { margin-left: auto; }

/* ================= 15. Empty, first run, loading ================= */
.blank { max-width: 560px; margin: 72px auto 0; display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.blank h2 { margin: 0; font: 650 26px/1.15 var(--f-display); letter-spacing: -.02em; }
.blank p { margin: 0; color: var(--ink-2); }
.blank .mark { width: 44px; height: 44px; border-radius: 12px; }
.blank .mark .i { width: 24px; height: 24px; }
.blank .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.blank.wide { max-width: 600px; }
.steps-onb { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.steps-onb > li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.steps-onb .num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 600 13px/1 var(--f-mono); }
.steps-onb .num .i { width: 14px; height: 14px; stroke-width: 2.4; }
.steps-onb li.todo .num { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.steps-onb li.done .t { color: var(--ink-2); }
.steps-onb .step-body { display: grid; gap: 8px; min-width: 0; }
.steps-onb .hint { font-size: 12.5px; color: var(--ink-3); }
.steps-onb form { display: flex; gap: 8px; }
.steps-onb form .input { flex: 1; min-width: 0; }
.progress-card { padding: 18px; display: grid; gap: 12px; }
.progress-card .top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.progress-card .meter { height: 6px; }
.progress-card .tl { padding: 6px 0 0; }
.progress-card .tl .t { font-size: 13.5px; }

/* ================= 16. Other pages ================= */
.page-connect { overflow: auto; }
.page-connect .bar, .zpage .bar { position: sticky; top: 0; }
.connect { max-width: 720px; margin: 0 auto; padding: 32px 20px 72px; display: flex; flex-direction: column; gap: 16px; }
.connect > h1, .page-title { margin: 0 0 4px; font: 650 34px/1.1 var(--f-display); letter-spacing: -.03em; }
.connect section, .connect details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin: 0; }
.connect section > :first-child, .connect details > :first-child { margin-top: 0; }
.connect section > :last-child { margin-bottom: 0; }
.connect h2 { margin: 0 0 8px; font: 650 18px/1.25 var(--f-display); letter-spacing: -.01em; }
.connect p { margin: 0 0 10px; }
.connect ol { padding-left: 20px; margin: 8px 0; }
.connect li { margin-bottom: 6px; }
.connect summary { cursor: pointer; font-weight: 600; }
.conn-list, .conn-tests { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.conn-tests:empty, .conn-list:empty { display: none; }
.conn { border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 10px; padding: 10px 12px; }
.conn.bad { border-left-color: var(--warn); }
.conn p { margin: 4px 0 0; }
.conn-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-head .btn { margin-left: auto; }
.conn-error { color: var(--warn); font-size: 13px; }
.connect details[open] summary { margin-bottom: 10px; }
.connect textarea {
  width: 100%; font: 12px/1.5 var(--f-mono); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px;
  background: var(--bg); resize: vertical; margin-bottom: 10px; color: var(--ink);
}
.connect textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sel); }
.connect .muted { color: var(--ink-2); }
.connect .small { font-size: 13px; }
.connect kbd { font-size: 11.5px; }
.bookmarklet {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--ink); color: var(--bg);
  font-weight: 700; text-decoration: none; cursor: grab;
}
.bookmarklet:hover { color: var(--bg); background: var(--ink-2); }

/* forms shared by People, Account, Login */
.form-input, .users input[type="text"], .users input:not([type]), .users input[type="email"], .users input[type="search"], .users input[type="password"], .users select {
  width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); padding: 0 12px; font-size: 14px; color: var(--ink);
}
.form-input:focus, .users input:focus, .users select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sel); }

/* Zapier admin page */
.zpage { overflow: auto; }
.zlayout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.pnav {
  position: sticky; top: var(--bar-h); align-self: start; height: calc(100vh - var(--bar-h)); overflow: auto;
  padding: 28px 16px 28px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px;
}
.pnav a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 9px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; font-size: 14px; transition: background-color var(--t-fast) var(--ease);
}
.pnav a:hover { background: var(--hover); color: var(--ink); }
.pnav a[aria-current="true"] { background: var(--sel); color: var(--ink); font-weight: 650; }
.pnav a.back { color: var(--ink-3); margin-bottom: 10px; }
.pnav .count { margin-left: auto; }
.pbody { padding: 32px 48px 72px; max-width: 1120px; display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.psec { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 24px; min-width: 0; }
.psec > h2 { margin: 0; font: 650 22px/1.2 var(--f-display); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.lede { margin: 0; color: var(--ink-2); max-width: 74ch; font-size: 14px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.drop {
  border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--panel); padding: 28px; display: flex; align-items: center; gap: 20px;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.drop.over { border-color: var(--ink); background: var(--hover); }
.drop:focus-within { border-color: var(--ink); }
.drop-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.drop-ico .i { width: 22px; height: 22px; }
.drop-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.drop-text strong { font-size: 15px; }
.drop-text span { font-size: 13px; color: var(--ink-3); }
.drop input[type="file"]:focus-visible + label, .drop label.btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
#import-status { margin: 0; font-size: 13.5px; color: var(--ink-2); }
#import-status.error { color: var(--rem); }
.result-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.result-head .btn { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.stat { background: var(--panel); padding: 14px 16px; display: grid; gap: 4px; }
.stat b { font: 650 22px/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--ink-3); }
.warn-strip { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 500; }
.danger { border: 1px solid var(--rem-line); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 20px; background: var(--panel); }
.danger .body { flex: 1; display: grid; gap: 4px; }
.danger .body span { font-size: 13px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.login-pick { display: grid; gap: 5px; justify-items: start; }
.login-pick select { height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); padding: 0 8px; min-width: 190px; color: var(--ink); }
.login-actions { display: flex; gap: 6px; flex-wrap: wrap; }

dialog.confirm, .u-reveal {
  max-width: 520px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow-3);
}
dialog.confirm::backdrop, .u-reveal::backdrop { background: var(--scrim); }
dialog.confirm h2 { margin: 0 0 8px; font: 650 20px/1.2 var(--f-display); }
dialog.confirm p { color: var(--ink-2); margin: 0 0 14px; }
dialog.confirm .row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.login .brand { margin: 0 0 22px; font-size: 20px; }
.login .brand .mark { width: 36px; height: 36px; border-radius: 10px; }
.login h1.title { font: 650 28px/1.15 var(--f-display); letter-spacing: -.02em; margin: 0 0 6px; }
.login .sub { color: var(--ink-2); margin: 0 0 20px; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 16px; box-shadow: var(--shadow-2); }
.login label { font-weight: 600; font-size: 13.5px; display: block; margin-bottom: 6px; }
.login input { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: var(--bg); font-size: 15px; }
.login input:focus { outline: none; border-color: var(--ink); background: var(--panel); box-shadow: 0 0 0 3px var(--sel); }
.login .pw { position: relative; }
.login .pw input { padding-right: 72px; }
.login .pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 36px; border: 0; background: transparent; color: var(--ink-2); font: 600 13px var(--f-ui); padding: 0 12px; cursor: pointer; border-radius: 8px; }
.login .pw button:hover { background: var(--hover); color: var(--ink); }
.login .btn { height: 44px; font-size: 15px; }
.login .err { color: var(--rem); margin: 0; min-height: 1.2em; font-size: 13.5px; }
.login .err:empty { display: none; }
.login .hint { color: var(--ink-3); font-size: 13px; margin: 16px 2px 0; }

/* ================= 17. Responsive ================= */
@media (max-width: 1439px) {
  :root { --side-w: 320px; }
  .wiring { gap: 0 56px; grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr); }
  .gsearch { max-width: 420px; }
  .main { padding: 24px 28px 56px; }
}
@media (max-width: 1279px) {
  .sync-status { display: none; }
  #sync-full { display: none; }
  .menu-narrow { display: flex; }
  .ghl-chip.ok { font-size: 0; gap: 0; padding: 0 10px; width: 28px; justify-content: center; }
  .pbody { padding: 28px 32px 64px; }
}
@media (max-width: 1100px) {
  :root { --side-w: 300px; }
  .bar { gap: 10px; }
  .gsearch { display: none; }
  .gsearch-toggle { display: inline-grid; margin-left: auto; }
  .bar.searching .gsearch {
    display: flex; position: absolute; inset: 0; max-width: none; margin: 0; padding: 0 60px 0 16px; background: var(--panel); z-index: 5;
  }
  .bar.searching .gsearch > .i { left: 29px; }
  .bar.searching .gsearch-close { display: inline-grid; position: absolute; right: 12px; }
  .bar.searching .gsearch kbd { display: none; }
  .brand .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .wiring { grid-template-columns: 1fr; gap: 0; padding: 18px 16px 14px; }
  .wiring svg.wires, .wiring svg.ports { display: none; }
  .col { gap: 8px; }
  .col-label { margin: 0 0 2px; }
  .col-center { padding: 0; margin: 0; position: relative; gap: 0; }
  .col-center::before, .col-center::after {
    content: ""; display: block; width: 2px; height: 30px; margin: 0 auto; background: linear-gradient(var(--line-2), var(--line-2));
  }
  .col-down { margin-top: 12px; }
  .col-center .hub { position: relative; }
  .col-center .hub::before, .col-center .hub::after {
    content: ""; position: absolute; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 2px var(--line-2);
  }
  .col-center .hub::before { top: -4px; }
  .col-center .hub::after { bottom: -4px; }
  .col-center .hub { box-shadow: var(--shadow-2); }
  .cols-2, .cols-2.zap-cols { grid-template-columns: minmax(0, 1fr); }
  .tagcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zlayout { grid-template-columns: 1fr; }
  .pnav { position: static; height: auto; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .pnav::-webkit-scrollbar { display: none; }
  .pnav a { flex: none; }
  .pnav a.back { margin-bottom: 0; }
  .import-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --bar-h: 56px; }
  body.shell { display: block; height: auto; overflow: visible; }
  .bar { height: 56px; padding: 0 8px 0 12px; gap: 6px; position: sticky; top: 0; }
  .bar-title { gap: 6px; flex: 1; min-width: 0; }
  .brand { gap: 0; }
  .loc-btn { height: 44px; border-color: transparent; background: none; padding: 0 6px; max-width: 58vw; }
  .loc-btn .loc-cap { display: none; }
  .loc-btn.del { border-color: transparent; }
  /* The picker opens under the whole bar, not under its button: the button starts
     48px in, so a 360px panel hung from it ran off a phone screen. */
  .loc-picker { position: static; }
  .loc-pop { left: 8px; right: 8px; width: auto; max-width: 360px; }
  .del-banner { padding: 10px 16px; }
  .ghl-chip, .badge-mock { display: none; }
  .gsearch-toggle { margin-left: 0; width: 44px; height: 44px; }
  .bar-sync { gap: 0; }
  .bar-sync .btn-primary { width: 44px; height: 44px; padding: 0; background: none; border-color: transparent; color: var(--ink-2); }
  .bar-sync .btn-primary:hover { background: var(--hover); color: var(--ink); }
  .bar-sync .btn-primary .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bar-sync .btn-primary .i { width: 20px; height: 20px; }
  .bar-wide, .vsep { display: none !important; }
  .menu-phone { display: flex; }
  .menu-item { min-height: 44px; }
  .who { border: 0; background: none; width: 44px; height: 44px; padding: 0; justify-content: center; margin: 0; }
  .who-chev { display: none; }
  .sync-progress { position: absolute; left: 0; right: 0; bottom: -1px; width: auto; margin: 0; gap: 0; grid-template-columns: minmax(0, 1fr); }
  .sync-progress-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sync-progress .sync-meter { height: 3px; border-radius: 0; background: transparent; }
  .sync-status.error { display: block; -webkit-line-clamp: none; line-clamp: none; position: absolute; top: 100%; left: 0; right: 0; max-width: none; padding: 8px 16px; background: var(--rem-bg); color: var(--rem); font-size: 13px; }
  .tabs { position: sticky; top: 56px; z-index: 15; padding: 0 4px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .tabs::after { content: ""; flex: 0 0 20px; }
  .layout { display: block; }
  .side { border-right: 0; overflow: visible; }
  .side-tools { padding: 12px 16px 8px; gap: 10px; }
  .side-tools input[type="search"], .input { height: 44px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px; }
  .filters::-webkit-scrollbar { display: none; }
  .chip-filter { height: 36px; flex: none; }
  .combo-input, .side-tools .combo-input { height: 44px; }
  .combo-chev { top: 14px; }
  .combo-clear { top: 7px; }
  .xf-seg .seg-btn, .seg > button { height: 38px; }
  .filters:has(.xf) { overflow: visible; margin: 0; padding: 0; }
  .list { overflow: visible; padding: 6px 6px 16px; }
  .list .row { min-height: 64px; }
  .navrow { min-height: 48px; }
  .main { overflow: visible; padding: 18px 16px 48px; }
  /* phone list -> detail */
  body.show-detail .side { display: none; }
  body.shell:not(.show-detail) .main { display: none; }
  body.tab-checks .main, body.tab-explore .main { display: block !important; }
  body.tab-checks .side .list { display: none; }
  body.tab-checks .list-meta { border-bottom: 1px solid var(--line); }
  .list-meta .meta-select { min-height: 36px; }
  body.show-detail .tabs { display: none; }
  .detail-bar {
    display: flex; align-items: center; gap: 6px; height: 56px; margin: -18px -16px 14px; padding: 0 8px 0 4px;
    border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 56px; z-index: 10;
  }
  .detail-bar .back { height: 44px; padding: 0 10px 0 4px; font-weight: 600; color: var(--ink); gap: 4px; }
  .detail-bar .back .i { width: 20px; height: 20px; }
  .detail-bar .ibtn { width: 44px; height: 44px; margin-left: auto; }
  .detail-head { flex-direction: column; gap: 14px; }
  .detail-head h2 { font-size: 26px; }
  .head-actions { width: 100%; }
  .head-actions.stack { align-items: stretch; }
  .head-actions .view-toggle { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .head-actions .view-toggle > button { height: 38px; }
  .head-actions .open-ghl.has-bar { display: none; }
  .detail-meta { gap: 6px 12px; font-size: 13px; margin: 10px 0 16px; }
  .detail-meta .sep { display: none; }
  .crumb { display: none; }
  .wiring { border: 0; background: none; box-shadow: none; padding: 0; }
  .legend { display: none; }
  .steps > li.more { display: none; }
  .steps.open > li.more { display: flex; }
  .show-all-row { display: block; }
  .steps.open + .show-all-row { display: none; }
  .ex { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ex dd { -webkit-line-clamp: 4; line-clamp: 4; } /* narrow column: the same 140 characters need more lines */
  .seg.scope-inline { display: grid; margin: 14px 0 0; }
  .scope-inline > button { height: 38px; }
  .loc-remove { width: 44px; }
  .loc-opt { min-height: 44px; }
  .echip { position: relative; } /* .combo-clear is already absolutely positioned */
  .affected { row-gap: 14px; } /* the chips' 44px hit boxes (30px + 7px above and below) don't overlap between rows */
  .echip::after, .combo-clear::after { content: ""; position: absolute; inset: -7px -2px; }
  .ex dt { margin-top: 4px; }
  .hit { grid-template-columns: 30px minmax(0, 1fr); padding: 14px 16px; }
  .hit-go { display: none; }
  .hit-top { flex-wrap: wrap; }
  .hit-title { white-space: normal; }
  .tagcards { grid-template-columns: minmax(0, 1fr); }
  .check { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .check .glyph-lg { display: none; }
  .blank { margin-top: 24px; }
  .flow { height: max(380px, 68vh); }
  .flow.explore-canvas { height: max(380px, 72vh); }
  .tbl th, .tbl td { padding: 10px 12px; }
  .danger { flex-direction: column; align-items: flex-start; }
  .drop { flex-wrap: wrap; padding: 20px; }
  .pbody { padding: 24px 16px 56px; gap: 32px; }
  .connect { padding: 20px 16px 56px; }
  .connect > h1 { font-size: 28px; }
}
@media (max-width: 600px) {
  .flow-panel { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-width: none; max-height: 60%; border-radius: 16px 16px 0 0; }
  .flow-hint-keys { display: none; }
  .flow-hint { max-width: calc(100% - 24px); bottom: auto; top: 12px; }
  .flow-tools { bottom: 12px; }
  .xf-pair { grid-template-columns: 1fr; }
  /* Short tables stack into cards on phones instead of scrolling sideways. */
  .tbl-stack thead { display: none; }
  .tbl-stack tr { display: grid; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .tbl-stack tr:first-child { border-top: 0; }
  .tbl-stack td { padding: 0; border: 0; }
  .steps .body.line > .t { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
