:root {
  --blue: #0078d4;
  --blue-hover: #106ebe;
  --ink: #14120b;
  --muted: #5c5c5c;
  --line: rgba(0, 0, 0, 0.08);
  --card: rgba(255, 255, 255, 0.92);
  --bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 6px;
  --radius-sm: 4px;
  --control-h: 30px;
  --fs: 15px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--fs);
  color: var(--ink);
  background: #ffffff;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
.home,
.tool-page,
.legal-page {
  background: #ffffff;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ri { font-size: 1em; line-height: 1; vertical-align: -0.1em; }
.btn .ri, .chip .ri, .recent-chip .ri, .tile-emoji .ri, .tool-badge .ri { font-size: 16px; }
a { color: inherit; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Plain background — colored aurora blobs disabled for clearer visibility */
.aurora,
.blob,
.b1,
.b2,
.b3 {
  display: none !important;
}

.home, .tool-page { position: relative; z-index: 1; overflow-x: clip; }
.home > *:not(.aurora), .tool-page > *:not(.aurora) { position: relative; z-index: 1; }
/* Tool shell may mount under #app-root; keep children above the fixed aurora. */
#app-root { display: contents; }
.tool-page #app-root > *:not(.aurora) { position: relative; z-index: 1; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand.hop, .tool-badge.hop { animation: hop 0.45s ease; }
@keyframes hop {
  0% { transform: translateY(0); }
  35% { transform: translateY(-8px) rotate(-6deg); }
  70% { transform: translateY(0) rotate(4deg); }
  100% { transform: none; }
}
.pupil { transform-box: fill-box; transform-origin: center; }

.home-bar, .topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.search { flex: 1; display: block; }
.search input, .field input, .field select, .field textarea, .modal-box {
  width: 100%;
  border: 1px solid #d1d1d1;
  background: #fff;
  border-radius: var(--radius);
  padding: 0 10px;
  min-height: var(--control-h);
  height: var(--control-h);
  outline: none;
  font-size: var(--fs-sm);
}
.field textarea, .modal-box { height: auto; min-height: 72px; padding: 8px 10px; }
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus, .modal-box:focus,
.editor:focus {
  box-shadow: 0 0 0 2px var(--blue);
  border-color: transparent;
}
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding: 28px 28px 8px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.hero .lede { margin-left: auto; margin-right: auto; }
.kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: var(--fs-xs);
}
.hero h1, .tool-id h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.lede { margin: 8px 0 0; max-width: 62ch; color: var(--muted); font-size: var(--fs); font-weight: 400; }

.filters, .recent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 28px;
  align-items: center;
  justify-content: center;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.recent-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.chip, .recent-chip, .tab {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 0 12px;
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--ink);
}
.chip.is-on, .tab.is-on { background: var(--blue); color: #fff; }
.chip:hover, .recent-chip:hover, .tab:hover { border-color: #c7c7c7; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding: 8px 28px 28px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.tile {
  --ink: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 128px;
  padding: 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: var(--tile);
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}
.tile.wide { grid-column: span 2; }
.tile-emoji { font-size: 20px; display: inline-flex; }
.tile-name { font-size: 15px; font-weight: 500; letter-spacing: -0.02em; }
.tile-blurb { font-size: var(--fs-xs); line-height: 1.4; opacity: 0.92; }
.tile-cat {
  margin-top: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35), transparent 70%);
  transform: translateX(-120%);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16); }
.tile:hover::after { transform: translateX(120%); transition: transform 0.55s ease; }
.tile:active, .tile.launch { transform: scale(0.97); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.empty, .site-foot, .noscript {
  padding: 8px 28px 32px;
  color: var(--muted);
}
.home > .site-foot,
.home > .empty {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}
.site-foot { font-size: 13px; position: relative; z-index: 95; }
.site-foot a,
.site-foot .linkish {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  position: relative;
  z-index: 95;
}
.site-foot a:hover,
.site-foot .linkish:hover { color: var(--ink); }
body:has(#cookie-banner) {
  padding-bottom: max(220px, calc(env(safe-area-inset-bottom, 0px) + 220px));
}
body:has(#cookie-banner) .site-foot {
  padding-bottom: 56px;
}
.tool-foot {
  padding: 4px 20px 20px;
  max-width: 100%;
}
.legal-page .home-bar { justify-content: space-between; gap: 12px; }
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.legal-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.legal-nav a:hover { color: var(--blue); }
.legal-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.legal-card {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 8px auto 24px;
  padding: 28px 28px 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}
.legal-card h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.04em;
  font-weight: 600;
}
.legal-card h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.legal-card h3 {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 600;
}
.legal-card p,
.legal-card li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.legal-card p { margin: 0 0 12px; }
.legal-card ul {
  margin: 0 0 14px;
  padding-left: 1.2em;
}
.legal-card li { margin-bottom: 6px; }
.legal-card a { color: var(--blue); font-weight: 600; }
.legal-meta {
  color: var(--muted) !important;
  font-size: 13px !important;
  margin-bottom: 18px !important;
}
.legal-end {
  margin-top: 28px !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.legal-card code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 6px;
}
.home-nav { flex: none; }
.contact-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.contact-form .field input,
.contact-form .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.contact-form .btn { align-self: flex-start; }
button.linkish,
.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
button.linkish:hover,
.linkish:hover { color: var(--ink); }
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 90;
  pointer-events: none;
}
.cookie-banner-inner {
  pointer-events: auto;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(8px);
}
.cookie-banner-copy {
  flex: 1;
  min-width: 220px;
}
.cookie-banner-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}
.cookie-banner-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.cookie-banner-copy a { color: var(--blue); font-weight: 600; }
.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .home-bar .home-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .cookie-banner-inner { align-items: stretch; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1; }
}

.topbar { flex-wrap: wrap; align-items: flex-start; }
.tool-id { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 220px; }
.tool-id h1 { font-size: 20px; font-weight: 500; letter-spacing: -0.03em; }
.tool-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--tool, var(--blue));
  color: #fff;
  font-size: 16px;
  flex: none;
}
.status { margin: 2px 0 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-xs); }
.status i { width: 6px; height: 6px; border-radius: 99px; background: var(--blue); display: inline-block; flex: none; }
.status.ok i { background: #107c10; }
.status.bad { color: #a4262c; }
.status.bad i { background: #e74856; }
.status.warn i { background: #ffb900; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.btn {
  min-height: var(--btn-h, var(--control-h));
  height: var(--control-h);
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid #d1d1d1;
  background: #fff;
  font-weight: 500;
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}
.btn:hover { background: #f5f5f5; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--blue); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.danger { color: #a4262c; }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 650;
  padding: 4px 6px;
}

#workspace { padding: 16px 20px 32px; min-height: calc(100vh - 92px); max-width: 100%; min-width: 0; overflow: hidden; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 140px);
}
.split.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr); }
.panel, .side-card, .cardish {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel { display: flex; flex-direction: column; min-height: 420px; overflow: hidden; }
.panel-hd, .block-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}
.panel-hd h2, .block-hd h2 { margin: 0; font-size: 13px; letter-spacing: 0.02em; }
.editor {
  flex: 1;
  width: 100%;
  min-height: 280px;
  border: 0;
  resize: none;
  padding: 14px;
  background: transparent;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
}
.preview-frame, .svg-stage, .md, .tree, .console, .seq-scroll, .table-wrap {
  flex: 1;
  min-height: 280px;
  overflow: auto;
  background: #fff;
}
.preview-frame { width: 100%; border: 0; background: #fff; }
.seq-host { display: flex; flex-direction: column; min-height: 460px; overflow: hidden; }
.seq-scroll { background: #fff; }
.seq-svg { width: max(100%, 720px); min-height: 460px; display: block; }
.seq-app {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.seq-side {
  max-height: calc(100vh - 150px);
  overflow: auto;
}
.seq-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.seq-block:first-of-type { border-top: 0; padding-top: 0; }
.seq-block h2 { margin: 0; font-size: 14px; }
.seq-kinds { flex-wrap: wrap; }
.seq-kinds button { font-size: 12px; padding: 0 8px; }
.seq-actor-list, .seq-frag-list, .seq-script { display: flex; flex-direction: column; gap: 6px; }
.seq-actor-row, .seq-frag-row, .seq-script-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
}
.seq-actor-row.is-on, .seq-script-row.is-on {
  border-color: #4F6BED;
  box-shadow: 0 0 0 2px rgba(79, 107, 237, 0.18);
}
.seq-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--c, #4F6BED);
  flex: none;
}
.seq-actor-name { font-weight: 700; }
.seq-script-row {
  cursor: pointer;
  flex-wrap: wrap;
}
.seq-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4F6BED;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}
.seq-script-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.seq-script-tools { display: inline-flex; gap: 4px; margin-left: auto; }
#role { max-width: 120px; }
.md { padding: 16px 18px 28px; }
.md h1, .md h2, .md h3 { line-height: 1.2; }
.md pre, .md code { font-family: var(--mono); }
.md pre { background: #f6f6f6; padding: 10px; border-radius: 8px; overflow: auto; }
.md code { background: #f3f3f3; padding: 1px 4px; border-radius: 4px; }
.md blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--blue); color: #444; }
.console { padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; background: #1b1b1b; color: #f3f3f3; }
.console .log-warn { color: #ffb900; }
.console .log-error { color: #ff99a4; }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.end { justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 650; }
.field span, .field label { color: var(--muted); font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.pad { padding: 14px; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px; }
.stat {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 110px;
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.stat.add b { color: #0b6a0b; }
.stat.remove b { color: #a4262c; }
.stat.change b { color: #8a6116; }

.table-wrap { overflow: auto; flex: 1; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, table.data td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
table.data th { position: sticky; top: 0; background: #fafafa; cursor: pointer; }
table.data tr:hover td { background: #f3f9fd; }
tr.add td { background: #e7f5e7; }
tr.remove td { background: #fde7e9; }
tr.change td { background: #fff4ce; }
.mono, .path { font-family: var(--mono); font-size: 12.5px; }

.tree-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  padding-right: 8px;
}
.tree-row:hover { background: #f3f9fd; }
.tree-key { color: #5c2d91; font-weight: 700; }
.tree-str { color: #0b6a0b; }
.tree-num { color: #0078d4; }
.tree-bool { color: #ca5010; }
.tree-muted { color: #777; }
.twisty { width: 22px; border: 0; background: transparent; font-size: 12px; }

mark.hit { background: #fff100; color: inherit; border-radius: 3px; padding: 0 1px; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 10px; align-items: center; }
.parts { display: flex; flex-direction: column; gap: 8px; }

#toasts { position: fixed; left: 0; right: 0; bottom: 18px; display: grid; justify-items: center; z-index: 70; pointer-events: none; }
.toast {
  background: #1b1b1b;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.35s ease;
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.bit {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 80;
  animation: burst 0.7s ease-out forwards;
}
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(0.4); opacity: 0; } }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 18px;
}
.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.modal h2 { margin: 0 0 6px; }
.modal-box { min-height: 180px; font-family: var(--mono); font-size: 13px; }

#droptint {
  display: none;
  position: fixed;
  inset: 16px;
  z-index: 40;
  border: 3px dashed var(--blue);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  pointer-events: none;
}
body.dropping #droptint { display: grid; }

.nb { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; min-height: calc(100vh - 140px); min-width: 0; }
.nb-pal, .palette, .inspector {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  scrollbar-width: thin;
}
.nb-pal-btn, .pal-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  font-weight: 650;
}
.nb-pal-btn span, .swatch-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); display: inline-block; }
.scroll-shell {
  --scroll-size: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--scroll-size);
  grid-template-rows: minmax(0, 1fr) var(--scroll-size);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f7f7f7;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.scroll-shell > .flow-scroll,
.scroll-shell > .nb-scroll,
.scroll-shell > .tree-scroll,
.scroll-shell > .kanban,
.scroll-shell > .journey,
.scroll-shell > .stage-center,
.scroll-shell > .scroll-xy,
.scroll-shell > .svg-stage,
.scroll-shell > .preview-frame,
.scroll-shell > .md,
.scroll-shell > .tree,
.scroll-shell > .console,
.scroll-shell > .table-wrap,
.scroll-shell > .seq-scroll,
.scroll-shell > .grad-preview,
.scroll-shell > .preview-scroll,
.scroll-shell > .play-dock {
  grid-column: 1;
  grid-row: 1;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
}
.panel > .scroll-shell,
.cardish > .scroll-shell {
  flex: 1;
  min-height: 0;
  align-self: stretch;
  width: 100%;
}
.scroll-shell-preview {
  min-height: 240px;
}
.scroll-shell .scroll-rail {
  background: transparent;
  position: relative;
  z-index: 2;
}
.scroll-shell .scroll-rail-y {
  grid-column: 2;
  grid-row: 1;
  cursor: pointer;
}
.scroll-shell .scroll-rail-x {
  grid-column: 1;
  grid-row: 2;
  cursor: pointer;
}
.scroll-shell .scroll-corner {
  grid-column: 2;
  grid-row: 2;
  background: transparent;
}
.scroll-shell:not(.has-y) {
  grid-template-columns: minmax(0, 1fr) 0;
}
.scroll-shell:not(.has-x) {
  grid-template-rows: minmax(0, 1fr) 0;
}
.scroll-shell.has-x.has-y {
  grid-template-columns: minmax(0, 1fr) var(--scroll-size);
  grid-template-rows: minmax(0, 1fr) var(--scroll-size);
}
.scroll-shell .scroll-thumb {
  position: absolute;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  min-width: 18px;
  min-height: 18px;
  transition: background 0.15s ease;
}
.scroll-shell .scroll-thumb:hover,
.scroll-shell .scroll-thumb:active { background: rgba(0, 0, 0, 0.45); }
.scroll-shell .scroll-thumb-y {
  top: 0;
  left: 1px;
  right: 1px;
  width: auto;
}
.scroll-shell .scroll-thumb-x {
  left: 0;
  top: 1px;
  bottom: 1px;
  height: auto;
}
.flow-layout > .scroll-shell {
  height: calc(100vh - 170px);
  min-height: 320px;
}
.nb > .scroll-shell {
  height: calc(100vh - 170px);
  min-height: 320px;
  min-width: 0;
  flex: 1;
}

.nb-scroll, .tree-scroll, .flow-scroll, .kanban, .journey, .stage-center, .table-wrap, .svg-stage, .preview-frame, .scroll-xy, .md, .tree, .console, .seq-scroll, .grad-preview, .preview-scroll, .play-dock {
  overflow: scroll !important;
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: none;
}
.nb-scroll::-webkit-scrollbar,
.tree-scroll::-webkit-scrollbar,
.flow-scroll::-webkit-scrollbar,
.kanban::-webkit-scrollbar,
.journey::-webkit-scrollbar,
.stage-center::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.svg-stage::-webkit-scrollbar,
.preview-frame::-webkit-scrollbar,
.scroll-xy::-webkit-scrollbar,
.md::-webkit-scrollbar,
.tree::-webkit-scrollbar,
.console::-webkit-scrollbar,
.seq-scroll::-webkit-scrollbar,
.grad-preview::-webkit-scrollbar,
.preview-scroll::-webkit-scrollbar,
.play-dock::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.nb-scroll, .tree-scroll, .flow-scroll {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f8fafc;
  height: calc(100vh - 170px);
  min-height: 320px;
  max-height: calc(100vh - 170px);
  max-width: 100%;
  min-width: 0;
  box-shadow: var(--shadow);
}
.nb-canvas, .tree-canvas {
  position: relative;
  background-image: radial-gradient(#d0d7de 1.1px, transparent 1.1px);
  background-size: 22px 22px;
}
.nb-canvas { width: 2400px; height: 1500px; }
.nb-svg, .nb-nodes, .tree-svg, .tree-nodes { position: absolute; inset: 0; }
.nb-svg { overflow: visible; pointer-events: none; }
.nb-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
.nb-edge, .tree-link { fill: none; stroke: #0078d4; stroke-width: 2.25; pointer-events: none; }
.nb-edge.is-selected { stroke: #c239b3; stroke-width: 3.25; }
.nb-elabel, .tree-svg text {
  font-size: 12px;
  font-family: var(--sans);
  fill: #1b1b1b;
  stroke: #fff;
  stroke-width: 4px;
  paint-order: stroke;
}
.nb.linking .nb-node { cursor: crosshair; }
.nb-node {
  position: absolute;
  min-width: 140px;
  max-width: 240px;
  background: #fff;
  border: 2px solid var(--c, var(--blue));
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  cursor: grab;
  z-index: 1;
}
.nb-node.is-selected { box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.35); }
.nb-emoji { font-size: 18px; }
.nb-text { font-weight: 700; }
.nb-rename, .tree-rename { width: 100%; border: 1px solid var(--blue); border-radius: 6px; padding: 4px 6px; }
.nb-node[data-shape="pill"] { border-radius: 999px; text-align: center; }
.nb-node[data-shape="note"] { background: #fff4ce; border-color: #e0b400; }
.nb-node[data-shape="circle"],
.nb-node[data-shape="connector"] {
  border-radius: 999px;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
}
.nb-node[data-shape="diamond"] {
  width: 150px;
  min-height: 110px;
  display: grid;
  place-items: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-align: center;
}
.nb-node[data-shape="diamond"]::before {
  content: "";
  position: absolute;
  inset: 8px 16px;
  background: #fff;
  border: 2px solid var(--c, #ca5010);
  transform: rotate(45deg);
  border-radius: 8px;
  z-index: -1;
}
.nb-node[data-shape="parallelogram"] {
  transform: skewX(-18deg);
  border-radius: 6px;
  text-align: center;
}
.nb-node[data-shape="parallelogram"] .nb-emoji,
.nb-node[data-shape="parallelogram"] .nb-text,
.nb-node[data-shape="parallelogram"] .nb-rename {
  transform: skewX(18deg);
}
.nb-node[data-shape="document"] {
  border-radius: 8px 8px 0 0;
  padding-bottom: 20px;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 82% 92%, 64% 82%, 46% 94%, 28% 82%, 12% 92%, 0 82%);
}
.nb-node[data-shape="subroutine"] {
  padding-left: 20px;
  padding-right: 20px;
}
.nb-node[data-shape="subroutine"]::before,
.nb-node[data-shape="subroutine"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid var(--c, var(--blue));
}
.nb-node[data-shape="subroutine"]::before { left: 8px; }
.nb-node[data-shape="subroutine"]::after { right: 8px; }
.nb-node[data-shape="hexagon"] {
  min-height: 76px;
  display: grid;
  place-items: center;
  text-align: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.nb-node[data-shape="hexagon"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c, var(--blue));
  clip-path: polygon(18% 0, 82% 0, 100% 50%, 82% 100%, 18% 100%, 0 50%);
  z-index: -2;
}
.nb-node[data-shape="hexagon"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #fff;
  clip-path: polygon(18% 0, 82% 0, 100% 50%, 82% 100%, 18% 100%, 0 50%);
  z-index: -1;
}
.nb-node[data-shape="trapezoid"] {
  min-height: 64px;
  display: grid;
  place-items: center;
  text-align: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.nb-node[data-shape="trapezoid"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c, var(--blue));
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  z-index: -2;
}
.nb-node[data-shape="trapezoid"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #fff;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  z-index: -1;
}
.nb-node[data-shape="display"] {
  min-height: 64px;
  display: grid;
  place-items: center;
  text-align: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-left: 28px;
}
.nb-node[data-shape="display"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c, var(--blue));
  clip-path: polygon(14% 0, 88% 0, 100% 50%, 88% 100%, 14% 100%, 0 50%);
  z-index: -2;
}
.nb-node[data-shape="display"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #fff;
  clip-path: polygon(14% 0, 88% 0, 100% 50%, 88% 100%, 14% 100%, 0 50%);
  z-index: -1;
}
.nb-node[data-shape="cylinder"] {
  border-radius: 0 0 14px 14px;
  padding-top: 22px;
  text-align: center;
}
.nb-node[data-shape="cylinder"]::before {
  content: "";
  position: absolute;
  top: -11px;
  left: -2px;
  right: -2px;
  height: 22px;
  border: 2px solid var(--c, var(--blue));
  border-radius: 50%;
  background: #fff;
  z-index: 0;
}
.nb-node[data-shape="cylinder"] .nb-emoji,
.nb-node[data-shape="cylinder"] .nb-text {
  position: relative;
  z-index: 1;
}
.nb-node[data-shape="delay"] {
  border-radius: 8px 999px 999px 8px;
  text-align: center;
  padding-right: 22px;
}
.nb-node[data-shape="offpage"] {
  min-height: 72px;
  display: grid;
  place-items: center;
  text-align: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.nb-node[data-shape="offpage"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c, var(--blue));
  clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
  z-index: -2;
}
.nb-node[data-shape="offpage"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
  z-index: -1;
}
.nb-node .nb-emoji,
.nb-node .nb-text { position: relative; z-index: 1; }
.er-card { min-width: 180px; }
.er-title { font-weight: 800; background: var(--c); color: #fff; margin: -10px -12px 8px; padding: 8px 12px; border-radius: 8px 8px 0 0; }
.er-card ul { list-style: none; margin: 0; padding: 0; }
.er-card li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line); font-size: 13px; }
.er-card em { color: var(--muted); font-style: normal; font-size: 12px; }

.tree-toolbar { margin-bottom: 10px; }
.tree-node {
  position: absolute;
  width: 168px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
  border-left: 6px solid var(--c);
  z-index: 1;
}
.tree-node.is-selected { box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.35); }
.tree-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-chev { border: 0; background: transparent; width: 22px; }

.mm-scroll {
  height: calc(100vh - 240px);
  max-height: calc(100vh - 240px);
  background: #f7f4ef;
}
.mm-canvas {
  background: #f7f4ef;
  background-image: none;
}
.mm-svg { overflow: visible; pointer-events: none; }
.mm-svg .mm-labels { pointer-events: none; }
.mm-nodes { pointer-events: none; z-index: 3; }
.mm-label {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 8px 10px;
  margin: 0;
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
  max-width: 180px;
  min-width: 72px;
  color: transparent;
}
.mm-label.mm-hit .mm-text { color: transparent; }
.mm-label .mm-text {
  display: inline-block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 170px;
}
.mm-root-label {
  width: 148px;
  height: 56px;
  max-width: 148px;
  min-width: 148px;
  min-height: 56px;
  font-size: 16px;
  border-radius: 28px;
}
.mm-root-label .mm-text {
  white-space: normal;
  max-width: 140px;
}
.mm-label.is-selected {
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.4);
  border-radius: 10px;
}
.mm-label.is-editing {
  z-index: 5;
  max-width: none;
  min-width: 200px;
  box-shadow: none;
  pointer-events: none;
  opacity: 0.35;
}
.mm-rename-wrap {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 8;
  pointer-events: auto;
}
.mm-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  margin-left: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  opacity: 0.9;
}
.mm-rename {
  width: min(220px, 56vw);
  min-width: 160px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #1b1b1b !important;
  background: #fff;
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 8px 10px;
}

.sm { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sm-top-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) auto auto;
  gap: 12px;
  align-items: end;
}
.sm-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.sm-stat {
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
}
.sm-stat b { display: block; font-size: 18px; letter-spacing: -0.03em; }
.sm-stat span { color: var(--muted); font-size: 12px; font-weight: 650; }
.sm-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.sm-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sm-toolbar { margin: 0; }
.sm-scroll {
  height: calc(100vh - 250px);
  min-height: 360px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f8fafc;
  box-shadow: var(--shadow);
}
.sm-canvas {
  position: relative;
  background-image:
    linear-gradient(rgba(73, 130, 5, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 130, 5, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sm-svg, .sm-nodes { position: absolute; inset: 0; }
.sm-svg { overflow: visible; pointer-events: none; }
.sm-link {
  fill: none;
  stroke: #7a9a5a;
  stroke-width: 2;
  stroke-linejoin: round;
}
.sm-node {
  position: absolute;
  width: 196px;
  height: 84px;
  border: 0;
  padding: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.sm-node.is-selected {
  box-shadow: 0 0 0 3px rgba(73, 130, 5, 0.35), 0 12px 28px rgba(0, 0, 0, 0.1);
}
.sm-node-bar {
  display: block;
  height: 5px;
  background: var(--c, #498205);
}
.sm-node-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 10px;
  height: calc(100% - 5px);
  box-sizing: border-box;
}
.sm-node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sm-node-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--c, #498205) 16%, #fff);
  color: var(--c, #498205);
  font-size: 15px;
}
.sm-node-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-node-chev {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 4px;
}
.sm-node-path {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-node-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.sm-chip {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2ea;
  color: #3d5a1f;
}
.sm-chip.is-live { background: #e7f5e7; color: #0b6a0b; }
.sm-chip.is-draft { background: #fff4ce; color: #8a6116; }
.sm-chip.is-planned { background: #eef6fc; color: #005a9e; }
.sm-inspector {
  max-height: calc(100vh - 210px);
  overflow: auto;
  position: sticky;
  top: 8px;
}
.sm-inspector h2 { margin: 0; font-size: 15px; }
.sm-path-preview {
  margin: -4px 0 0;
  padding: 8px 10px;
  background: #f5f7f2;
  border-radius: 8px;
  font-size: 12px;
  word-break: break-all;
}
.sm-alt { min-height: 360px; }
.sm-pre {
  margin: 0;
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.sm-url-table tr.is-on { background: #eef6e8; }
.sm-url-table tr[data-id] { cursor: pointer; }

.stage { display: flex; flex-direction: column; gap: 12px; }
.stage-body { display: grid; grid-template-columns: 180px minmax(0, 1fr) 250px; gap: 12px; align-items: start; min-width: 0; }
.screen-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-center { display: grid; justify-items: center; align-content: start; width: 100%; min-width: 0; max-height: calc(100vh - 180px); }
.device {
  background: #1b1b1b;
  border-radius: 28px;
  padding: 14px 12px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.device.desktop { border-radius: 16px; padding: 12px; }
.device-bar { height: 14px; display: flex; justify-content: center; }
.device-bar span { width: 70px; height: 6px; border-radius: 99px; background: #3a3a3a; }
.artboard { position: relative; background: #f7f7f5; overflow: hidden; border-radius: 8px; touch-action: none; }
.wf {
  position: absolute;
  box-sizing: border-box;
  user-select: none;
  overflow: hidden;
}
.wf.is-selected { outline: 2px solid var(--blue); outline-offset: 1px; }
.wf-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-right: 3px solid #0078d4;
  border-bottom: 3px solid #0078d4;
  cursor: nwse-resize;
  touch-action: none;
}
.wf-nav { background: #0078d4; color: #fff; display: flex; align-items: center; padding: 0 12px; font-weight: 800; }
.wf-heading { font-weight: 800; font-size: 20px; display: flex; align-items: center; }
.wf-text { color: #444; font-size: 14px; padding: 4px; }
.wf-button { background: #0078d4; color: #fff; border-radius: 999px; display: grid; place-items: center; font-weight: 700; }
.wf-input { background: #fff; border: 1px solid #c8c8c8; border-radius: 8px; display: flex; align-items: center; padding: 0 10px; color: #777; }
.wf-image {
  background:
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%),
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%);
  background-size: 18px 18px;
  background-color: #fafafa;
  border: 1px dashed #bbb;
  display: grid;
  place-items: center;
  color: #666;
  font-weight: 700;
}
.wf-card { background: #fff; border-radius: 12px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); padding: 10px; font-weight: 700; }
.wf-search { background: #fff; border: 1px solid #c8c8c8; border-radius: 999px; display: flex; align-items: center; padding: 0 12px; color: #777; }
.wf-search::before { content: "🔍"; margin-right: 6px; }
.wf-check, .wf-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; background: transparent; }
.wf-knob { width: 36px; height: 20px; border-radius: 99px; background: #107c10; position: relative; flex: none; }
.wf-knob::after { content: ""; position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.wf-avatar { border-radius: 50%; background: #0078d4; color: #fff; display: grid; place-items: center; font-weight: 800; }
.wf-tabs, .wf-dock { display: flex; align-items: center; gap: 6px; background: #fff; padding: 4px 8px; }
.wf-dock { justify-content: space-around; border-top: 1px solid #e1e1e1; }
.wf-chip { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 6px 4px; border-radius: 8px; background: #f3f3f3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-list { background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.wf-li { padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.player {
  position: relative;
  inset: auto;
  background: transparent;
  z-index: 1;
  display: grid;
  place-items: start center;
  padding: 0;
}
.play-dock {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  justify-items: start;
  width: 100%;
  min-width: 0;
}
.play-dock[hidden] { display: none !important; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 0; width: 100%; }
.wf.has-link { cursor: pointer; }
.wf-link {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 120, 212, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  pointer-events: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}
.wf-button .wf-link,
.wf-card .wf-link,
.wf-nav .wf-link {
  bottom: 4px;
}
.player .wf-link { display: none; }
.player .wf-handle { display: none; }
.player .artboard { transition: transform 0.25s ease; }

.flow-layout { display: grid; gap: 12px; min-width: 0; width: 100%; max-width: 100%; }
.flow-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.phones {
  position: relative;
  min-height: 480px;
  width: max-content;
  min-width: 100%;
}
.phone-row { display: flex; gap: 36px; padding: 30px 20px 48px; position: relative; z-index: 1; width: max-content; }
.phone-card { width: 220px; }
.phone-shell {
  width: 220px;
  height: 420px;
  background: #111;
  border-radius: 28px;
  padding: 12px;
  color: #fff;
}
.phone-screen {
  background: #f4f7fb;
  color: var(--ink);
  border-radius: 18px;
  height: 100%;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.phone-screen h3 { margin: 8px 0; }
.fake-btn, .flow-btn {
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  min-height: 36px;
}
.phone-card.is-on .phone-shell { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blue); }
.phone-card.is-start .phone-screen h3 { color: #0b6a0b; }
.flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }

.journey-wrap { display: grid; gap: 12px; min-width: 0; width: 100%; max-width: 100%; }
.journey {
  display: flex;
  gap: 12px;
  padding: 4px 4px 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 420px;
  max-height: calc(100vh - 220px);
}
.kanban {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 4px 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 420px;
  max-height: calc(100vh - 180px);
}
.j-col {
  width: 230px;
  flex: none;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 6px solid var(--c, var(--blue));
}
.j-col textarea, .j-col input[type="text"] { width: 100%; border: 1px solid #e1e1e1; border-radius: 8px; padding: 8px; }
.faces { display: flex; gap: 4px; }
.faces button { border: 1px solid transparent; background: #f5f5f5; border-radius: 8px; font-size: 18px; width: 34px; height: 34px; }
.faces button.is-on { border-color: var(--blue); background: #deecf9; }

.k-col {
  width: 270px;
  flex: none;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.k-col.drop { outline: 2px dashed var(--blue); }
.k-col h2 input { width: 100%; border: 0; background: transparent; font-weight: 800; font-size: 16px; }
.k-card {
  background: #fff;
  border-radius: 12px;
  border-left: 6px solid var(--c);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  padding: 8px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 6px;
  align-items: start;
}
.k-card.dragging { opacity: 0.45; }
.k-grip { border: 0; background: transparent; cursor: grab; color: #888; padding: 4px 0; }
.k-title, .k-notes { width: 100%; border: 0; background: transparent; }
.k-title { font-weight: 700; }
.k-notes { color: var(--muted); min-height: 36px; resize: vertical; font-size: 13px; }
.k-x { border: 0; background: transparent; color: #888; font-size: 16px; }

.color-lab { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; min-width: 0; }
.sv-pad {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 16px;
  background: hsl(var(--h), 100%, 50%);
  touch-action: none;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sv-white, .sv-black { position: absolute; inset: 0; }
.sv-white { background: linear-gradient(90deg, #fff, transparent); }
.sv-black { background: linear-gradient(0deg, #000, transparent); }
.sv-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #1b1b1b;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hue-range { width: 100%; accent-color: var(--blue); }
input[type="color"] { width: 52px; height: 40px; padding: 0; border: 0; background: transparent; }
.blob-preview {
  width: min(240px, 100%);
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), inset 0 0 0 8px rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.contrast-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contrast-card {
  border-radius: 12px;
  padding: 12px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
}
.contrast-card b { font-size: 28px; letter-spacing: -0.04em; }
.harmony-block h3 { margin: 0 0 6px; font-size: 13px; }
.code-row { display: flex; flex-wrap: wrap; gap: 8px; }
.code-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
}
.sliders input[type="range"] { width: 100%; }
.swatches, .presets { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch, .preset {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.preset { width: auto; min-width: 92px; height: 48px; border-radius: 12px; color: #fff; font-weight: 800; }
.grad-preview {
  height: 240px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.grad-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35), transparent 70%);
  animation: shine 2.8s ease-in-out infinite;
}
@keyframes shine {
  0% { transform: translateX(-80%); }
  100% { transform: translateX(80%); }
}
.stop-track { position: relative; height: 36px; border-radius: 999px; background: #eee; margin: 12px 0; touch-action: none; }
.stop-list { display: flex; flex-direction: column; gap: 8px; }
.stop-edit { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; }
.stop-edit input[type="number"] { width: 100%; border: 1px solid #d1d1d1; border-radius: 8px; padding: 8px; }
.stop {
  position: absolute;
  top: -6px;
  width: 28px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid #fff;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.stop.is-on { outline: 2px solid #1b1b1b; }

.uuid-hero {
  font-family: var(--mono);
  font-size: clamp(18px, 3vw, 32px);
  font-weight: 800;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  letter-spacing: -0.03em;
  box-shadow: var(--shadow);
  animation: popnum 0.35s ease;
}
@keyframes popnum {
  from { transform: scale(0.92); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}
.uuid-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.uuid-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--mono);
  border: 1px solid var(--line);
}
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.seq-host { min-height: 460px; }
.checker {
  background-image:
    linear-gradient(45deg, #e6e6e6 25%, transparent 25%),
    linear-gradient(-45deg, #e6e6e6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e6e6 75%),
    linear-gradient(-45deg, transparent 75%, #e6e6e6 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #fff;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 800;
  font-size: 12px;
  background: #eef6fc;
  color: var(--blue);
}
.badge.ok { background: #e7f5e7; color: #0b6a0b; }
.badge.bad { background: #fde7e9; color: #a4262c; }
.badge.warn { background: #fff4ce; color: #8a6116; }
.seg { display: inline-flex; background: #fff; border-radius: 10px; padding: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; border-radius: 8px; min-height: 32px; padding: 0 10px; font-weight: 700; }
.seg button.is-on { background: var(--blue); color: #fff; }
.method { font-weight: 800; border-radius: 8px; border: 1px solid #d1d1d1; padding: 8px; background: #fff; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mmd-app { gap: 10px; }
.mmd-support {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 90ch;
}
.mmd-templates {
  max-height: 76px;
  overflow: auto;
  padding-bottom: 2px;
}
.mmd-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mmd-error {
  color: var(--ink);
}
.mmd-error p { margin: 8px 0 0; }
.publisher-content {
  margin: 16px auto 28px;
  padding: 22px 22px 26px;
  max-width: 860px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}
.publisher-content h1,
.publisher-content h2,
.publisher-content h3 {
  margin: 0 0 10px;
  line-height: 1.25;
}
.publisher-content h1 { font-size: 1.45rem; }
.publisher-content h2 { font-size: 1.15rem; margin-top: 18px; }
.publisher-content h3 { font-size: 1.05rem; margin-top: 16px; }
.publisher-content p,
.publisher-content li {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
.publisher-content p { margin: 0 0 12px; }
.publisher-content ul,
.publisher-content ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}
.publisher-content li { margin-bottom: 6px; }
.publisher-content a { color: var(--blue); font-weight: 600; }
.home-publisher {
  margin-left: 18px;
  margin-right: 18px;
}
.tool-page .publisher-content {
  margin: 12px 16px 24px;
  max-width: none;
}
.tool-workspace {
  min-height: 280px;
}
.mmd-pie-opts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 4px 2px;
}
.mmd-pie-opts[hidden] { display: none !important; }
.mmd-pie-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #605e5c);
}
.svg-stage path.pieCircle { opacity: 1 !important; }
.svg-stage text.slice { fill: #fff !important; font-weight: 700; }
.svg-stage rect.background,
.svg-stage rect.sky-label-bg,
.svg-stage .edgeLabel rect,
.svg-stage rect.labelBkg {
  fill: #fff !important;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.editor.short { min-height: 120px; height: 120px; }
.diff-view {
  font-family: var(--mono);
  font-size: 13px;
  background: #fafafa;
  border-top: 1px solid var(--line);
  max-height: 420px;
  min-height: 180px;
}
.diff-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 2px 12px;
  border-bottom: 1px solid transparent;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-line.is-add { background: #e7f5e7; }
.diff-line.is-remove { background: #fde7e9; }
.diff-line.is-same { background: transparent; }
.diff-mark { color: var(--muted); font-weight: 700; }
.diff-line.is-add .diff-mark { color: #0b6a0b; }
.diff-line.is-remove .diff-mark { color: #a4262c; }
.diff-line code { font-family: inherit; background: transparent; padding: 0; }
.qr-preview {
  display: grid;
  place-items: center;
  min-height: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.class-card .class-fields {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.class-edit { grid-template-columns: 52px 1fr 1fr; }
.contrast-hero {
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  min-height: 180px;
}
.contrast-xl { font-size: 64px; font-weight: 700; margin: 0; letter-spacing: -0.04em; line-height: 1; }
.contrast-body { font-size: 18px; margin: 12px 0 8px; }
.contrast-small { font-size: 14px; margin: 0; opacity: 0.95; }
.contrast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.contrast-grade {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  gap: 2px;
}
.contrast-grade b { font-size: 15px; }
.contrast-grade.is-pass b { color: #0b6a0b; }
.contrast-grade.is-fail b { color: #a4262c; }
.contrast-grade span { font-size: 13px; font-weight: 600; }
.contrast-grade em { font-style: normal; color: var(--muted); font-size: 12px; }
.lede-soft { font-size: 18px; line-height: 1.45; margin: 0; font-weight: 550; }
.cron-fields { display: grid; gap: 8px; }
.cron-field {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13px;
}
.cron-field span { color: var(--muted); font-weight: 650; padding-top: 6px; }
.cron-field code {
  display: block;
  background: #f6f6f6;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.cron-next { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.cron-next li { font-size: 14px; }
.mini-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.split-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}
.side-card input, .side-card select, .side-card textarea,
.inspector input, .inspector select, .inspector textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
.inspector { max-height: calc(100vh - 180px); overflow: auto; }
.bad { color: #a4262c; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .split, .split.three, .color-lab, .nb, .stage-body, .split-board, .sm-body, .seq-app { grid-template-columns: minmax(0, 1fr); }
  .sm-top-grid { grid-template-columns: minmax(0, 1fr); }
  .sm-inspector { position: static; max-height: none; }
  .seq-side { max-height: none; }
  .tile.wide { grid-column: auto; }
  .home-bar, .topbar { padding: 12px; }
  .legal-card { margin: 8px 12px 20px; padding: 20px 18px 28px; }
  .tiles, .filters, .recent, .hero { padding-left: 14px; padding-right: 14px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .inspector { max-height: none; }
  .nb-scroll, .tree-scroll, .flow-scroll { height: calc(100vh - 200px); min-height: 280px; max-height: calc(100vh - 200px); }
  .palette { flex-direction: row; flex-wrap: wrap; }
  .stage { min-width: 0; }
  #workspace { min-width: 0; }
}
@media (max-width: 720px) {
  .home-bar { flex-wrap: wrap; padding-top: max(12px, env(safe-area-inset-top)); }
  .home-bar .search { flex: 1 1 100%; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .tool-id { min-width: 0; }
  .tool-id h1, .hero h1 { font-size: 28px; }
  .tool-id h1 { font-size: 20px; }
  .action-row { margin-left: 0; width: 100%; }
  .action-row .btn { flex: 1 1 calc(50% - 8px); justify-content: center; height: auto; min-height: 36px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 124px; padding: 12px; }
  .tile.wide { grid-column: 1 / -1; }
  .grid-2, .grid-3, .mini-row, .stop-edit { grid-template-columns: 1fr; }
  .stop-edit { grid-template-columns: auto 1fr auto; }
  #workspace { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }
  .split, .nb { min-height: 0; }
  .panel { min-height: 280px; }
  .editor, .preview-frame, .svg-stage, .md, .tree, .console { min-height: 220px; }
  .grad-preview { height: 168px; }
  .clock { font-size: 28px; }
  .k-col, .j-col { width: min(270px, 84vw); }
  .phone-card, .phone-shell { width: min(220px, 72vw); }
  input, select, textarea { font-size: 16px; }
  .palette {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pal-btn, .nb-pal-btn { flex: none; }
  .player { padding: 12px; align-items: start; overflow: auto; }
  .uuid-row { flex-direction: column; align-items: flex-start; }
  .droptint, #droptint { font-size: 20px; inset: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
