/* ============================================================
   i8 Automate — admin interface
   Aesthetic: calm, premium SaaS (Stripe/Apple-inspired).
   Light surfaces, soft elevation, indigo accent, system type.
   NOTE: variable names are a fixed contract with admin.js
   (--volt is the accent, --ink the text scale, etc.).
   ============================================================ */

:root {
  --bg0: #f6f8fb;            /* app canvas */
  --bg1: #ffffff;            /* raised surface */
  --bg2: #f2f4f8;            /* hover / wells */
  --bg3: #ffffff;
  --line: #e7eaf0;           /* hairline */
  --line2: #d5dae3;          /* stronger border */
  --ink: #1a1f36;            /* primary text */
  --ink-dim: #4f566b;        /* secondary text */
  --ink-faint: #8792a2;      /* tertiary text */
  --volt: #635bff;           /* accent (indigo) */
  --volt-dim: #8f88ff;       /* accent, lighter */
  --volt-ink: #ffffff;       /* text on accent */
  --red: #df1b41;
  --amber: #b45309;
  --green: #18794e;
  --blue: #5469d4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14), 0 4px 8px rgba(16, 24, 40, 0.06);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --disp: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }

body {
  font: 400 15px/1.6 var(--body);
  background: var(--bg0);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(99, 91, 255, 0.18); }

a { color: var(--volt); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- boot splash ---- */
.boot-splash {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg0); z-index: 99;
}
.boot-mark { font: 700 40px var(--disp); color: var(--ink); letter-spacing: -0.02em; }
.boot-mark i { color: var(--volt); font-style: normal; animation: blink 1.4s ease infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ============================================================
   LOGIN
   ============================================================ */
.login-stage {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, #fbfcfe 0%, var(--bg0) 100%);
}
.login-box {
  width: 100%; max-width: 420px; background: var(--bg1);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 44px 44px 40px;
}
.login-brand { font: 700 34px/1 var(--disp); letter-spacing: -0.02em; margin-bottom: 6px; }
.login-brand i { color: var(--volt); font-style: normal; }
.login-sub { color: var(--ink-faint); font-size: 14px; margin-bottom: 32px; }
.login-box form { display: grid; gap: 18px; }
.login-box .btn { margin-top: 6px; width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.login-err {
  background: #fdebef; color: var(--red); border: 1px solid #f8c9d4;
  padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
}

/* ============================================================
   APP FRAME
   ============================================================ */
.frame { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

/* ---- rail ---- */
.rail {
  background: var(--bg1); border-right: 1px solid var(--line);
  padding: 24px 0 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.rail-brand { font: 700 21px var(--disp); letter-spacing: -0.01em; padding: 0 24px; margin-bottom: 2px; }
.rail-brand i { color: var(--volt); font-style: normal; }
.rail-tag { padding: 0 24px; color: var(--ink-faint); font-size: 12.5px; margin-bottom: 28px; }
.rail nav { display: grid; gap: 2px; flex: 1; padding: 0 12px; }
.rail nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; color: var(--ink-dim); border-radius: 8px;
  font: 500 14.5px var(--body); text-decoration: none;
  transition: background 0.14s, color 0.14s;
}
.rail nav a .idx { display: none; }
.rail nav a:hover { color: var(--ink); background: var(--bg2); text-decoration: none; }
.rail nav a.on { color: var(--volt); background: rgba(99, 91, 255, 0.08); font-weight: 600; }
.rail-foot {
  padding: 16px 24px 0; border-top: 1px solid var(--line);
  display: grid; gap: 10px; margin-top: 12px;
}
.rail-foot .who { font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---- main column ---- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 18px;
  padding: 13px 36px; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums;
  position: sticky; top: 0; background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px); z-index: 20;
}
.topbar .sep { color: var(--line2); }

.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 0; margin-right: 7px; }
.led.ok { background: #1da362; }
.led.bad { background: var(--red); }
.led.warn { background: #e8a23c; }
.led.dim { background: var(--ink-faint); }

.view { padding: 36px 40px 88px; max-width: 1180px; width: 100%; }

/* gentle page reveal */
.view > * { animation: rise 0.35s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: 0.03s; }
.view > *:nth-child(3) { animation-delay: 0.06s; }
.view > *:nth-child(4) { animation-delay: 0.09s; }
.view > *:nth-child(5) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- page header ---- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 6px; }
.phead h1 { font: 600 26px/1.2 var(--disp); letter-spacing: -0.015em; }
.phead .crumb { color: var(--ink-faint); font-size: 13px; margin-bottom: 6px; }
.phead .actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0 28px; }
.rule::before { content: none; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px var(--body);
  padding: 9px 16px; cursor: pointer;
  background: var(--volt); color: var(--volt-ink);
  border: 1px solid var(--volt); border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.1s;
}
.btn:hover { background: #5851ea; border-color: #5851ea; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost {
  background: var(--bg1); color: var(--ink-dim); border-color: var(--line2);
}
.btn.ghost:hover { color: var(--ink); border-color: #b9c0cc; background: var(--bg1); }
.btn.danger { background: var(--bg1); color: var(--red); border-color: #f0b6c3; box-shadow: none; }
.btn.danger:hover { background: #fdebef; border-color: #e79aab; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }

.field { display: grid; gap: 6px; }
.field > span { font: 500 13px var(--body); color: var(--ink-dim); }
.field .hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 400; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
select, textarea {
  width: 100%; padding: 9px 12px;
  background: var(--bg1); color: var(--ink);
  border: 1px solid var(--line2); border-radius: 8px;
  font: 400 14.5px var(--body);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) inset;
  transition: border-color 0.14s, box-shadow 0.14s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
textarea.code, input.code { font: 400 13px/1.6 var(--mono); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--volt);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}
input::placeholder, textarea::placeholder { color: #a3adbd; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
    linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px;
}

.check { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14.5px; color: var(--ink-dim); }
.check input { accent-color: var(--volt); width: 16px; height: 16px; }

/* status pills — soft tinted, Stripe-style */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px var(--body); text-transform: capitalize;
  padding: 2px 10px; border: 1px solid transparent; border-radius: 999px;
  background: var(--bg2); color: var(--ink-dim);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.chip.success, .chip.ok, .chip.published, .chip.done {
  background: #e6f6ed; color: var(--green);
}
.chip.success::before, .chip.ok::before, .chip.published::before, .chip.done::before { background: #1da362; }
.chip.failed, .chip.dead, .chip.error {
  background: #fdebef; color: var(--red);
}
.chip.failed::before, .chip.dead::before, .chip.error::before { background: var(--red); }
.chip.running, .chip.retrying, .chip.pending, .chip.publishing, .chip.scheduled {
  background: #fdf3e3; color: var(--amber);
}
.chip.running::before, .chip.retrying::before, .chip.pending::before,
.chip.publishing::before, .chip.scheduled::before { background: #e8a23c; }

/* tables */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.tbl th {
  text-align: left; font: 600 12.5px var(--body);
  color: var(--ink-faint); padding: 11px 16px;
  border-bottom: 1px solid var(--line); background: #fafbfd;
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14.5px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.rowlink { cursor: pointer; transition: background 0.12s; }
.tbl tr.rowlink:hover { background: #f8f9fc; }
.tbl .mono { font: 450 12.5px var(--mono); color: var(--ink-dim); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }

/* panels */
.panel {
  border: 1px solid var(--line); background: var(--bg1);
  border-radius: 12px; box-shadow: var(--shadow-sm); padding: 24px 26px;
}
.panel + .panel { margin-top: 16px; }
.panel h3 { font: 600 16px var(--disp); letter-spacing: -0.01em; margin-bottom: 16px; }

/* code / payload blocks */
pre.payload {
  font: 400 12.5px/1.65 var(--mono); color: var(--ink-dim);
  background: #f8f9fc; border: 1px solid var(--line);
  padding: 14px 16px; overflow: auto; max-height: 380px; border-radius: 10px;
  white-space: pre-wrap; word-break: break-word;
}
pre.payload .k { color: var(--blue); }
pre.payload .s { color: var(--green); }
pre.payload .n { color: var(--amber); }
code.inline {
  font: 500 12.5px var(--mono); background: var(--bg2); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 6px; color: var(--blue); word-break: break-all;
}

/* webhook delivery log */
.hits { display: grid; gap: 8px; }
.hits .hint { font-size: 13px; color: var(--ink-faint); }
.hit { border: 1px solid var(--line); border-radius: 10px; background: var(--bg1); overflow: hidden; }
.hit-head {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer;
  font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums;
  transition: background 0.12s;
}
.hit-head:hover { background: #f8f9fc; }
.hit-head .hint { font-size: 12px; color: var(--ink-faint); }
.hit-toggle { margin-left: auto; color: var(--volt); font-weight: 500; font-size: 12.5px; }
.hit pre.payload { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; max-height: 280px; }

/* toast */
.toasts { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 200; }
.toast {
  background: var(--bg1); border: 1px solid var(--line);
  border-left: 3px solid var(--volt); border-radius: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--ink); padding: 12px 18px; font-size: 14px; min-width: 260px; max-width: 420px;
  animation: rise 0.25s var(--ease);
}
.toast.err { border-left-color: var(--red); }

/* empty state */
.empty {
  border: 1px dashed var(--line2); border-radius: 12px;
  padding: 52px 32px; text-align: center; color: var(--ink-dim);
  background: var(--bg1);
}
.empty h3 { font: 600 17px var(--disp); color: var(--ink); margin-bottom: 8px; }
.empty p { max-width: 460px; margin: 0 auto 18px; font-size: 14.5px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.gauges {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--bg1); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.gauge { padding: 20px 22px 18px; border-right: 1px solid var(--line); }
.gauge:last-child { border-right: 0; }
.gauge .glabel { font: 500 13px var(--body); color: var(--ink-faint); margin-bottom: 6px; }
.gauge .gval { font: 600 28px/1.1 var(--disp); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gauge .gval small { font: 500 13px var(--body); color: var(--ink-faint); margin-left: 6px; letter-spacing: 0; }
.gauge .gval.bad { color: var(--red); }
.gauge .gval.good { color: var(--green); }

.meter { display: flex; align-items: flex-end; gap: 3px; height: 72px; margin-top: 10px; }
.meter .bar { flex: 1; min-height: 3px; background: var(--line); position: relative; border-radius: 2px; transition: background 0.15s; }
.meter .bar .fill { position: absolute; inset: auto 0 0 0; background: var(--volt-dim); border-radius: 2px; }
.meter .bar .fail { position: absolute; inset: auto 0 0 0; background: var(--red); border-radius: 2px; }
.meter .bar:hover { background: var(--line2); }
.meter-cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; font-variant-numeric: tabular-nums; }

.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

.sect-label {
  font: 600 12px var(--body); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-faint); margin: 36px 0 14px;
}
.sect-label:first-child { margin-top: 0; }

/* ============================================================
   FLOW BUILDER
   ============================================================ */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; }
@media (max-width: 1080px) { .builder { grid-template-columns: 1fr; } }

.spine { position: relative; padding-left: 28px; }
.spine::before {
  content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px;
  border-left: 2px solid var(--line);
}
.node {
  position: relative; margin-bottom: 14px;
  border: 1px solid var(--line); background: var(--bg1);
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.node::before {
  content: ""; position: absolute; left: -25px; top: 21px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg1); border: 2px solid var(--volt-dim);
}
.node.trigger::before { background: var(--volt); border-color: var(--volt); }
.node-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; cursor: pointer;
  border-radius: 12px; transition: background 0.12s;
}
.node-head:hover { background: #f8f9fc; }
.node-head .ntype {
  font: 600 11px var(--body); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-faint); min-width: 96px;
}
.node-head .nname { font: 500 14.5px var(--body); color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-head .ngear { color: var(--ink-faint); font-size: 12.5px; }
.node-body { border-top: 1px solid var(--line); padding: 20px 18px; display: grid; gap: 14px; }
.node-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.node-foot { display: flex; justify-content: space-between; padding-top: 4px; }

.add-step {
  margin: 2px 0 14px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg1); border: 1px dashed var(--line2); color: var(--ink-dim);
  font: 500 13.5px var(--body); padding: 8px 15px; cursor: pointer; border-radius: 8px;
  transition: color 0.14s, border-color 0.14s;
}
.add-step:hover { color: var(--volt); border-color: var(--volt-dim); }

.side-panel {
  border: 1px solid var(--line); background: var(--bg1); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 22px 24px; position: sticky; top: 76px;
}
.side-panel h3 { font: 600 15px var(--disp); margin-bottom: 12px; }
.side-panel .tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.token {
  font: 500 12px var(--mono); color: var(--blue); background: #eef1fd;
  border: 1px solid #d8def8; padding: 2px 8px; cursor: pointer; border-radius: 6px;
  transition: border-color 0.12s;
}
.token:hover { border-color: var(--blue); }

.testout { margin-top: 16px; display: grid; gap: 10px; }
.testout .stepline { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* ============================================================
   CONTENT CALENDAR
   ============================================================ */
.cal {
  background: var(--bg1); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); background: #fafbfd; }
.cal-head div { padding: 9px 12px; font: 600 12px var(--body); color: var(--ink-faint); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 88px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 9px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell .d { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cal-cell.today .d {
  color: #fff; background: var(--volt); border-radius: 999px;
  display: inline-grid; place-items: center; width: 22px; height: 22px; font-weight: 600;
}
.cal-cell.dim { opacity: 0.4; }
.cal-item {
  display: block; margin-top: 5px; font: 500 12px var(--body); color: #4b44d4;
  border-radius: 6px; padding: 2px 8px; background: #eef1fd;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item.published { background: var(--bg2); color: var(--ink-dim); }
.cal-item.failed { background: #fdebef; color: var(--red); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 9px 14px; font: 500 14px var(--body); color: var(--ink-dim);
  margin-bottom: -1px; transition: color 0.12s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--volt); border-bottom-color: var(--volt); font-weight: 600; }

/* run detail step timeline */
.steps-tl {
  display: grid; gap: 0; background: var(--bg1);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.step-row { border-bottom: 1px solid var(--line); }
.step-row:last-child { border-bottom: 0; }
.step-row .shead { display: flex; gap: 14px; align-items: center; padding: 12px 18px; cursor: pointer; transition: background 0.12s; }
.step-row .shead:hover { background: #f8f9fc; }
.step-row .sidx { font: 600 12px var(--mono); color: var(--ink-faint); }
.step-row .sbody { border-top: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 12px; background: #fbfcfe; }
.step-row .dur { margin-left: auto; font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* forms grid */
.fgrid { display: grid; gap: 16px; max-width: 720px; }
.fgrid .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fgrid .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* drawer (slide-over for editors) */
.drawer-wrap { position: fixed; inset: 0; z-index: 100; display: none; }
.drawer-wrap.open { display: block; }
.drawer-wrap .shade { position: absolute; inset: 0; background: rgba(26, 31, 54, 0.4); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 94vw);
  background: var(--bg1); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 30px 32px 44px; overflow-y: auto;
  animation: slidein 0.25s var(--ease);
}
@keyframes slidein { from { transform: translateX(32px); opacity: 0; } }
.drawer h2 { font: 600 20px var(--disp); letter-spacing: -0.01em; margin-bottom: 24px; }
.drawer .fgrid { max-width: none; }
.drawer-x {
  position: absolute; top: 18px; right: 20px; width: 32px; height: 32px;
  background: none; border: 0; border-radius: 8px;
  color: var(--ink-faint); font-size: 20px; cursor: pointer;
}
.drawer-x:hover { color: var(--ink); background: var(--bg2); }

/* key reveal */
.reveal {
  border: 1px solid #d8def8; background: #f5f6ff; border-radius: 10px;
  padding: 14px 16px; display: grid; gap: 8px; margin: 14px 0;
}
.reveal code { font: 600 13.5px var(--mono); color: #4b44d4; word-break: break-all; }
.reveal small { color: var(--ink-dim); }

.qrbox {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 14px; width: fit-content; margin: 10px 0;
}

/* mobile */
@media (max-width: 840px) {
  .frame { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 8px; gap: 4px; }
  .rail-brand { font-size: 18px; padding: 0 12px; margin: 0; }
  .rail-tag, .rail-foot { display: none; }
  .rail nav { display: flex; flex-wrap: wrap; flex: 1; padding: 0; }
  .rail nav a { padding: 7px 11px; }
  .view { padding: 22px 16px 64px; }
  .topbar { padding: 10px 16px; }
  .split, .builder { grid-template-columns: 1fr; }
  .fgrid .row2, .fgrid .row3, .node-body .row2 { grid-template-columns: 1fr; }
}
