:root {
  --ink: #111111;
  --mute: #4a4a46;
  --field: #e6e6e3;
  --dot: #b0b0aa;
  --white: #ffffff;
  --line: #d2d2cc;
  --island: #ffffff;
  --sel: #0d99ff;
  --sel-wash: rgba(13, 153, 255, 0.12);
  --err: #9b1d1d;
  --err-bg: #f8e8e8;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 0 rgba(17, 17, 17, 0.06), 0 8px 24px rgba(17, 17, 17, 0.12);
  --radius: 8px;
  --z-hud: 7;
  --z-chrome: 8;
  --z-page: 12;
  --z-market: 20;
  --z-tip: 9;
  --z-combo: 80;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior: none;
}
body {
  font: 13px/1.4 var(--sans);
  color: var(--ink);
  background: var(--field);
  -webkit-user-select: none;
  user-select: none;
}
.board,
.world,
.canvas,
.card,
.wires,
.hud-empty,
.tools,
.brand {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.screen,
.sheet,
.modal,
.gate-screen {
  -webkit-user-select: text;
  user-select: text;
}
.modal input,
.modal textarea,
.modal select,
.modal [contenteditable],
.code,
.code textarea,
.combo input,
.combo-pop,
#grant-form input,
#app-invite-form input,
#waitlist-form input,
#mcp-secret,
.note-text:focus,
input:focus,
textarea:focus,
select:focus,
[contenteditable]:focus {
  -webkit-user-select: text;
  user-select: text;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.board {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-touch-callout: none;
  background-color: var(--field);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: 20px 20px;
}
.world {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}
.canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 3600px;
  height: 2600px;
  overflow: visible;
  transform-origin: 0 0;
  touch-action: none;
}
.canvas.is-pan { cursor: grab; }

.island {
  position: fixed;
  z-index: var(--z-chrome);
  background: var(--island);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

#liveblocks-badge {
  z-index: 5 !important;
}

.brand {
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  height: 40px;
  max-width: calc(100vw - 24px);
  padding: 0 8px 0 8px;
  border-radius: 8px;
}
.brand strong { font-size: 14px; letter-spacing: -0.03em; }
.brand .rule,
.tools .rule {
  width: 1px;
  height: 16px;
  background: var(--line);
}
.invite { color: var(--mute); }

.tools {
  top: 64px;
  left: 12px;
  width: 44px;
  padding: 6px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tool {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.tool svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.tool:hover { background: #f7f7f4; }
.tool.is-on { background: #111111; color: #ffffff; }
.tool.is-on svg { stroke: currentColor; fill: none; }
.tool:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }
.tool.zoom-pct {
  height: auto;
  min-height: 28px;
  padding: 4px 0;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hint {
  position: fixed;
  top: 22px;
  right: 16px;
  z-index: var(--z-chrome);
  color: var(--mute);
  font-size: 12px;
}

.hud-empty {
  position: fixed;
  left: 72px;
  top: 68px;
  z-index: var(--z-hud);
  width: min(380px, calc(100vw - 96px));
  pointer-events: none;
}
.hud-empty h1 {
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.hud-empty p { color: var(--mute); margin-bottom: 16px; pointer-events: none; }
.hud-copy-phone { display: none; }
.hud-empty .btn { pointer-events: auto; }
.hud-empty[hidden] { display: none !important; }

.card.note {
  min-width: 160px;
  background: #f3e6a6;
  border-color: #d4c06a;
}
.card.note .card-bar { background: transparent; border-bottom: 0; cursor: grab; }
.card.note .card-kind { color: #6b5a1e; }
.card.note .card-body { display: none; }
.note-text,
textarea.note-text {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: auto;
  border: 0;
  background: transparent;
  resize: none;
  padding: 0 12px 12px;
  font: 14px/1.45 var(--sans);
  color: var(--ink);
  border-radius: 0;
}
.note-text:focus {
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.btn {
  border: 0;
  background: #111;
  color: #fff;
  padding: 7px 11px;
  border-radius: 7px;
  font-weight: 550;
}
.btn:hover { background: #2a2a2a; }
.btn:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 0;
}
.text-btn:hover { color: var(--ink); }

.card {
  position: absolute;
  isolation: isolate;
  z-index: 1;
  overflow: visible;
  min-width: 228px;
  min-height: 120px;
  background: var(--white);
  border: 1px solid #c8c8c2;
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(17,17,17,0.04), 0 6px 16px rgba(17,17,17,0.08);
  display: flex;
  flex-direction: column;
}
.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;
}
.card.is-sel {
  z-index: 3;
  border-color: var(--sel);
  border-width: 2px;
  box-shadow: 0 0 0 1px #111, 0 8px 20px rgba(13,153,255,0.18);
}
.card.is-sel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-style: solid;
  border-width: 11px 11px 0 0;
  border-color: #111 transparent transparent transparent;
  pointer-events: none;
  z-index: 2;
}
.card-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
}
.card-kind {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}
.card-title {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-edit {
  border: 0;
  background: transparent;
  color: var(--sel);
  font-size: 11px;
  font-weight: 650;
  padding: 0;
}
.card-body { padding: 8px 12px 12px; color: var(--mute); flex: 1; }
.card-body code { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.card-body ul { margin: 0; padding-left: 16px; }
.handle {
  position: absolute;
  width: 9px;
  height: 9px;
  right: -5px;
  bottom: -5px;
  background: var(--white);
  border: 1.5px solid var(--sel);
  display: none;
  cursor: nwse-resize;
}
.card.is-sel .handle { display: block; }

.veil {
  position: fixed;
  inset: 0;
  z-index: var(--z-market);
  background: rgba(17, 17, 17, 0.18);
}
.veil.hidden { display: none; }
.market {
  position: absolute;
  top: 56px;
  left: 72px;
  bottom: 24px;
  width: min(520px, calc(100vw - 96px));
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.market-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 20px 0;
}
.market-head h2 { font-size: 16px; letter-spacing: -0.02em; }
.market-lead { color: var(--mute); padding: 6px 20px 14px; }
.market-body { overflow: auto; padding: 0 12px 24px; }
.market-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 2px;
}
.market-grid li { margin: 0; min-width: 0; }
.offer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 6px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.offer.is-dim { opacity: 0.34; }
.offer:hover { background: #f6f6f3; }
.offer:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.offer-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.04);
}
.offer-mark svg { width: 28px; height: 28px; display: block; }
.offer-mark.is-prisma { background: #0c344b; border-color: #0c344b; }
.offer-mark.is-drizzle { background: #c5f74f; border-color: #b6e247; }
.offer-mark.is-gql { background: #e10098; border-color: #e10098; }
.offer-name {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.2;
  max-width: 100%;
}

.tip {
  position: fixed;
  z-index: var(--z-tip);
  pointer-events: none;
  max-width: min(240px, calc(100vw - 16px));
  padding: 5px 8px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
body.is-market .tip,
.tip[hidden] { display: none !important; }

.modal {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: visible;
}
.modal::backdrop { background: rgba(17, 17, 17, 0.28); }
.modal[open] { display: flex; flex-direction: column; }
.modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}
.modal-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px 0;
}
.modal-head h2 { font-size: 18px; letter-spacing: -0.03em; }
.modal-head p { color: var(--mute); margin-top: 3px; }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 14px 20px;
  display: grid;
  gap: 18px;
}
.modal-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
}
body.is-modal { overflow: hidden; }

.overlay-modal { width: min(560px, calc(100vw - 24px)); }
.overlay-modal .modal-form { max-height: min(80dvh, 720px); }
.overlay-modal .modal-head {
  flex-direction: row;
  align-items: flex-start;
}
.overlay-modal .modal-body {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  gap: 12px;
}
.overlay-modal .lead {
  margin-bottom: 0;
  max-width: none;
}
.overlay-modal .mcp-panel {
  margin: 0;
  padding: 0;
  border: 0;
}
.overlay-modal .people-h { margin: 8px 0 4px; }
.overlay-modal .create { margin-bottom: 0; }

.export-modal { width: min(840px, calc(100vw - 24px)); }
.export-modal .modal-body {
  display: flex;
  overflow: hidden;
}
.export-text {
  flex: 1 1 auto;
  width: 100%;
  min-height: 42vh;
  height: 48vh;
  resize: none;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #bdbdb6;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafaf7;
  color: var(--ink);
}
.export-text:focus {
  outline: 2px solid var(--sel);
  outline-offset: 1px;
}

.block {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}
.block > h3 {
  font-size: 13px;
  font-weight: 650;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
}

label.field { display: grid; gap: 5px; }
label.field > span { font-weight: 550; }
input[type="text"], textarea, select {
  border: 1px solid #c4c4be;
  background: #f7f7f4;
  border-radius: 7px;
  padding: 7px 9px;
}
textarea {
  min-height: 168px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.row.effect {
  grid-template-columns: 132px 1fr 28px 28px 28px;
}
.fx-root { display: grid; gap: 6px; }
.fx-kids { display: grid; gap: 6px; }
.fx-gate {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 8px;
  background: var(--white);
}
.fx-head.row.effect {
  grid-template-columns: 56px 1fr 28px 28px 28px;
  margin-bottom: 0;
}
.fx-kw {
  font-size: 12px;
  font-weight: 650;
}
.fx-branch {
  border-left: 1px solid var(--ink);
  padding-left: 10px;
  display: grid;
  gap: 6px;
}
.fx-arm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 650;
  color: var(--mute);
}
.fx-arm input[type="text"] { flex: 1; }
.fx-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.add-fx-action {
  margin-top: 0;
  width: 32px;
  height: 28px;
  padding: 0;
}
.icon-x, .move {
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 0;
  height: 28px;
}
.icon-x:hover, .move:hover { color: var(--ink); }
.parse-err {
  background: var(--err-bg);
  color: var(--err);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.parse-err[hidden], [hidden] { display: none !important; }

@media (pointer: coarse) {
  .tool {
    width: 44px;
    height: 44px;
  }
  .btn {
    min-height: 44px;
    padding: 10px 14px;
  }
  .tool svg { width: 20px; height: 20px; }
  .card-edit {
    padding: 10px 8px;
    margin: -6px -4px -6px 0;
    min-width: 44px;
    min-height: 32px;
  }
  .card-next {
    width: 40px;
    height: 40px;
  }
  .handle {
    width: 16px;
    height: 16px;
    right: -7px;
    bottom: -7px;
  }
  .offer {
    padding: 8px 4px 10px;
  }
  .offer-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .combo-chev {
    width: 40px;
  }
  .icon-x, .move, .add-row, .add-fx-action {
    min-width: 40px;
    min-height: 40px;
  }
}

@media (max-width: 1023px) {
  .hint { display: none; }
  .brand {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: auto;
    width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: none;
    height: 48px;
    min-height: 48px;
    flex-wrap: nowrap;
    padding: 2px 6px;
    box-sizing: border-box;
  }
  .tools {
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 6px;
    border-radius: 14px;
    gap: 2px;
    z-index: calc(var(--z-chrome) + 1);
  }
  #liveblocks-badge {
    top: calc(56px + env(safe-area-inset-top)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: auto !important;
    left: auto !important;
  }
  .tools .rule,
  .tools [data-nav] {
    display: none;
  }
  .tool {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .tool.zoom-pct {
    width: auto;
    min-width: 48px;
    padding: 0 8px;
    font-size: 11px;
  }
  .hud-empty {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    top: calc(64px + env(safe-area-inset-top));
    bottom: auto;
    width: auto;
    max-width: 28rem;
  }
  .hud-copy { display: none; }
  .hud-copy-phone {
    display: block;
    margin-bottom: 16px;
  }
  .card-next {
    top: auto;
    bottom: 8px;
    right: 8px;
    transform: none;
    z-index: 4;
    width: 36px;
    height: 36px;
  }
  .flow-port {
    z-index: 5;
  }
  .market {
    top: auto;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    height: min(72dvh, calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    border-radius: 16px 16px 12px 12px;
  }
  .market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .market-close,
  #market-close {
    min-height: 44px;
    min-width: 44px;
  }
  .sheet {
    width: min(720px, calc(100% - 24px));
    margin: calc(72px + env(safe-area-inset-top)) auto calc(32px + env(safe-area-inset-bottom));
  }
  .create {
    flex-direction: column;
    align-items: stretch;
  }
  .board-list li,
  .grant-list li {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .modal {
    width: calc(100vw - 12px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: 760px;
    max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: max(6px, env(safe-area-inset-top)) auto max(6px, env(safe-area-inset-bottom));
  }
  .modal-form {
    max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .modal-head {
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 0;
  }
  .modal-body {
    padding: 12px 14px;
  }
  .modal-foot {
    flex-wrap: wrap;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .export-text {
    min-height: 32vh;
    height: 36vh;
  }
  input[type="text"],
  textarea,
  select,
  .combo input,
  .grid input,
  .grid select,
  .note-text {
    font-size: 16px;
  }
  .row {
    grid-template-columns: 1fr 1fr 36px;
  }
  .row.effect,
  .fx-head.row.effect {
    grid-template-columns: 1fr 40px 40px 40px;
  }
  .grid table,
  .grid thead,
  .grid tbody,
  .grid tr,
  .grid th,
  .grid td {
    display: block;
    width: 100%;
  }
  .grid thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .grid tr {
    padding: 10px 8px 8px;
    border-bottom: 1px solid #bdbdb6;
  }
  .grid td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    border: 0;
    padding: 4px 0;
  }
  .grid td::before {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--mute);
  }
  .grid td:nth-child(1)::before { content: "Name"; }
  .grid td:nth-child(2)::before { content: "Type"; }
  .grid td:nth-child(3)::before { content: "Default"; }
  .grid td:nth-child(4)::before { content: "Functions"; }
  .grid td.kill {
    grid-template-columns: 1fr;
    justify-items: end;
    border-bottom: 0;
  }
  .grid td.kill::before { content: none; }
}

@media (max-width: 767px) {
  .hud-empty h1 { font-size: 20px; }
  .sheet h1 { font-size: 24px; }
  .card-body { font-size: 13px; }
  .mcp-actions { flex-direction: column; align-items: stretch; }
  .fx-arm { flex-wrap: wrap; }
}

@media (max-width: 360px) {
  .tools {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0;
    padding: 4px;
  }
  .tool {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .tool.zoom-pct {
    width: auto;
    min-width: 40px;
    padding: 0 4px;
  }
  .chrome-share { display: none; }
  .chrome-pop-item.is-phone-share { display: flex; }
}

.wordmark, .brand a {
  text-decoration: none;
}
.ghost-link, .invite { color: var(--mute); }

.screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-page);
  background: var(--field);
  overflow: auto;
}
.sheet {
  width: min(720px, calc(100% - 40px));
  margin: 56px auto 48px;
}
.sheet h1 {
  font-size: 28px;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.lead { color: var(--mute); margin-bottom: 20px; max-width: 56ch; }
.back { color: var(--mute); text-decoration: none; display: inline-block; margin-bottom: 16px; }
.back:hover { color: var(--ink); }
.create {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.create input { flex: 1; }
.board-list, .grant-list { list-style: none; padding: 0; margin: 0; }
.board-list li, .grant-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.board-list a, .grant-list span { font-weight: 550; }
.role { color: var(--mute); font-size: 12px; }

.mcp-panel {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.mcp-panel h2 {
  font-size: 18px;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.mcp-secret {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: 12px/1.4 var(--mono);
}
.mcp-secret:focus {
  outline: 2px solid var(--sel);
  outline-offset: 1px;
}
.mcp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.mcp-confirm {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.mcp-confirm p {
  color: var(--ink);
  margin-bottom: 10px;
  max-width: 52ch;
}

.sheet-table,
.grid {
  width: 100%;
  border: 1px solid #bdbdb6;
  border-radius: 6px;
  overflow: visible;
  background: #fff;
}
.grid table { width: 100%; border-collapse: collapse; }
.grid th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: #ecece7;
  border-bottom: 1px solid #bdbdb6;
  border-right: 1px solid #d5d5ce;
  padding: 6px 8px;
}
.grid td {
  border-bottom: 1px solid #d8d8d2;
  border-right: 1px solid #ecece7;
  padding: 0;
  vertical-align: stretch;
}
.grid th:last-child, .grid td:last-child { border-right: 0; }
.grid tr:last-child td { border-bottom: 0; }
.grid input, .grid select {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
}
.grid input:focus, .grid select:focus {
  outline: 2px solid var(--sel);
  outline-offset: -2px;
  background: #f4faff;
}
.combo { position: relative; display: flex; align-items: stretch; }
.combo input { flex: 1; min-width: 0; }
.combo-chev {
  width: 22px;
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 0;
  flex: none;
}
.combo-chev:hover { color: var(--ink); }
.combo-pop {
  position: fixed;
  z-index: var(--z-combo);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #bdbdb6;
  box-shadow: var(--shadow);
  max-height: 180px;
  overflow: auto;
}
.combo-pop li {
  padding: 5px 8px;
  cursor: pointer;
}
.combo-pop li:hover, .combo-pop li.is-on { background: #eef6ff; }
.combo-pop li.is-empty { color: var(--mute); cursor: default; }

.marquee {
  position: absolute;
  z-index: 6;
  border: 1px solid var(--sel);
  background: var(--sel-wash);
  pointer-events: none;
}
.marquee[hidden] { display: none; }

.rail { }
.sheet-table { }
.code-pane { }
.grid .flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 5px 8px;
}
.grid .flags label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
}
.grid .kill {
  width: 36px;
  text-align: center;
}
.add-row {
  margin-top: 8px;
  width: 32px;
  height: 28px;
  padding: 0;
}

.code-pane,
.code {
  position: relative;
  min-height: 168px;
  border: 1px solid #c4c4be;
  border-radius: 7px;
  background: #1e1e1c;
}
.code-hi, .code textarea {
  margin: 0;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}
.code-hi {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #d6d6d0;
  pointer-events: none;
}
.code-hi code { font: inherit; }
.code textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 168px;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: #fff;
  resize: vertical;
}
.tok-keyword { color: #7eb6ff; }
.tok-type { color: #8fe3c1; }
.tok-fn { color: #f0c56e; }
.tok-attr { color: #e6a0c8; }
.tok-string { color: #f3b184; }
.tok-comment { color: #8a8a84; }

.who-chip {
  color: var(--mute);
  font-size: 11px;
  padding: 0 8px;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people-h {
  font-size: 16px;
  letter-spacing: -0.03em;
  margin: 28px 0 8px;
}
.user-boards { margin-bottom: 24px; }
.user-boards h3 {
  font-size: 13px;
  font-weight: 550;
  margin: 0 0 4px;
}
.gate-screen { z-index: calc(var(--z-page) + 2); }
#denied-sign-out { margin-top: 16px; }
body.is-gated .board,
body.is-gated .tools,
body.is-gated .hint,
body.is-gated .hud-empty,
body.is-gated .brand,
body.is-gated .comments-panel,
body.is-gated .screen:not(.gate-screen) { visibility: hidden; }
body.is-splash {
  -webkit-user-select: text;
  user-select: text;
}

.wires {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 3600px;
  height: 2600px;
  pointer-events: none;
  overflow: visible;
}
.wire { fill: none; stroke: #111; stroke-width: 1.6; }
.wire-head { fill: #111; }
.card-next {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  z-index: 4;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #111;
  background: #fff;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(17,17,17,0.06), 0 4px 10px rgba(17,17,17,0.1);
}
.card-next:hover { background: #111; color: #fff; }
.card-next:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }

/* Multiplayer Liveblocks collaboration */
.live-cursors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
  overflow: visible;
}

.peer-cursor {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
  transition: transform 60ms linear;
  z-index: 15;
}

.peer-cursor-pointer {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(17, 17, 17, 0.25));
}

.peer-cursor-label {
  position: absolute;
  left: 12px;
  top: 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.2);
  pointer-events: none;
}

.presence-bar {
  display: inline-flex;
  align-items: center;
  flex: none;
  max-width: 72px;
  margin-right: 4px;
  overflow: hidden;
}

.presence-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--island);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  margin-left: -6px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.15);
  text-transform: uppercase;
  cursor: default;
}

.presence-avatar:first-child {
  margin-left: 0;
}

.card.peer-selected {
  outline: 2px solid var(--peer-sel-color, #3d7be6) !important;
  outline-offset: 2px;
}

