@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/geist-latin-wght-normal-BgDaEnEv.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-soft: #1e293b;
  --muted: #475569;
  --navy: #1e337a;
  --navy-deep: #152459;
  --navy-tint: #eef2fb;
  --teal: #0b7261;
  --teal-soft: #ecfdf8;
  --obsidian: #0b1222;
  --obsidian-panel: #111b31;
  --obsidian-border: rgb(255 255 255 / 12%);
  --paper: #f8fafd;
  --shell: #e9eef7;
  --white: #ffffff;
  --hairline: rgb(30 51 122 / 11%);
  --border-strong: rgb(30 51 122 / 20%);
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at top center, rgb(30 51 122 / 6%), transparent 46%), var(--paper);
  color: var(--ink);
  font: 15px/1.6 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid #3b6fd8; outline-offset: 2px; }
code, pre, kbd, #transaction-status { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.studio-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(248 250 253 / 86%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
  min-height: 68px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-cluster {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--ink);
}
.brand span { color: var(--navy); }
.workspace-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--navy);
  background: var(--navy-tint);
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  border-radius: 999px;
}
.studio-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgb(255 255 255 / 92%);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.studio-nav a {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.studio-nav a:hover {
  color: var(--navy-deep);
  background: var(--navy-tint);
}
#engine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
#engine::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d97706;
  flex: 0 0 auto;
}
#engine[data-engine-ready="true"] {
  background: var(--teal-soft);
  border-color: rgb(11 114 97 / 28%);
  color: var(--teal);
}
#engine[data-engine-ready="true"]::before {
  background: #10b981;
}
#engine.error {
  background: var(--danger-soft);
  border-color: rgb(185 28 28 / 28%);
  color: var(--danger);
}
#engine.error::before { background: var(--danger); }

main {
  width: min(1240px, calc(100% - 40px));
  margin: 28px auto 56px;
  display: grid;
  gap: 20px;
}
.intro {
  max-width: 78ch;
  padding: 6px 2px 4px;
}
.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
}
.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--ink);
}
.intro p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}
.intro code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--navy-tint);
  color: var(--navy-deep);
  font-size: .9em;
}

.vault, .panel {
  background: linear-gradient(180deg, #f3f6fc, var(--shell));
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 7px;
  box-shadow: 0 14px 36px rgb(15 23 42 / 5%);
  min-width: 0;
}
.vault > *, .panel > * {
  position: relative;
}
.vault, .panel {
  display: grid;
  gap: 12px;
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 0 0 6px var(--shell), 0 14px 36px rgb(15 23 42 / 6%);
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.tap-grid {
  margin-top: 4px;
  gap: 20px;
}
.tap-grid > div {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}
.section-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.section-heading span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--navy-tint);
  border: 1px solid var(--hairline);
  padding: 4px 10px;
  border-radius: 999px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
input, textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
textarea {
  font-family: var(--mono);
  resize: vertical;
}
input:focus, textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(30 51 122 / 12%);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
button:hover:not(:disabled) {
  background: var(--navy-tint);
  border-color: var(--navy);
  transform: translateY(-1px);
}
button.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  box-shadow: 0 8px 18px rgb(30 51 122 / 22%);
}
button.primary:hover:not(:disabled) {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}
button:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}
kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(255 255 255 / 16%);
  border: 1px solid rgb(255 255 255 / 26%);
}

details {
  border-top: 1px dashed var(--hairline);
  padding-top: 6px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 0;
  user-select: none;
}
details[open] summary { margin-bottom: 8px; }

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
p[role="status"] {
  margin: 0;
  min-height: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--teal);
}
p[role="status"].error {
  color: var(--danger);
  font-weight: 600;
}
.tap-grid p[role="status"] { min-height: 20px; }

pre {
  margin: 0;
  padding: 14px 16px;
  min-height: 88px;
  max-height: 280px;
  overflow: auto;
  border-radius: 14px;
  background: var(--obsidian);
  border: 1px solid var(--obsidian-border);
  color: #dbeafe;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.tap-grid pre { min-height: 76px; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0 4px;
}
footer a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(30 51 122 / 28%);
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner, main { width: min(1240px, calc(100% - 24px)); }
  .vault, .panel { padding: 16px; box-shadow: 0 0 0 4px var(--shell), 0 10px 26px rgb(15 23 42 / 5%); }
  .field-grid { grid-template-columns: 1fr; }
  .studio-nav { width: 100%; justify-content: space-between; overflow-x: auto; }
}
