:root {
  --bg: #f3f0eb;
  --surface: #fffcf8;
  --text: #2c2825;
  --muted: #6f675f;
  --line: #e3dbd2;
  --accent: #8d4d63;
  --fail: #8a5555;
  --ok-bg: #e7f0e6;
  --bad-bg: #f6e6e4;
  --gensyn: #f6d7e3;
  --gensyn-ink: #6d3148;
  --gensyn-line: #e4b4c6;
  --base: #d5e3f6;
  --base-ink: #243e66;
  --base-line: #b7cbe6;
  --ethereum: #e7e3dc;
  --ethereum-ink: #3c3935;
  --ethereum-line: #cfc8be;
  --selected: #f6e7ed;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; font-size: 15px; }
h1, h2, h3 { font-weight: 600; }
h2 { margin: 0 0 0.75rem; font-size: 1.35rem; }
h3 { margin: 1.25rem 0 0.4rem; font-size: 0.95rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-width: 0;
}
textarea { width: 100%; }
button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost, button.text { background: none; border: 0; color: var(--muted); padding: 0.35rem 0.2rem; }
button:disabled { opacity: 0.45; cursor: default; }

.top {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem 0;
}
.brand { display: flex; align-items: baseline; gap: 0.65rem; }
.wordmark { font-weight: 650; letter-spacing: -0.03em; }
.top h1 { margin: 0; font-size: 1.2rem; font-weight: 560; }
nav { display: flex; width: 100%; margin-top: 0.85rem; }
nav button {
  flex: 1;
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.45rem 0.2rem;
  text-align: center;
}
nav button.active { color: var(--text); border-bottom-color: var(--accent); }

.screen { max-width: 920px; margin: 0 auto; padding: 0.75rem 1.5rem 4rem; }
.screen.narrow { max-width: 640px; }
.muted { color: var(--muted); }
.id { color: var(--muted); font-weight: 500; }
.failed { color: var(--fail); }
.bad-text { color: var(--fail); }
.req { color: var(--muted); font-size: 0.8rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; }
.row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 0.45rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.field { display: grid; gap: 0.2rem; margin: 0.35rem 0; }
.field > span { font-size: 0.78rem; color: var(--muted); }

.filters { display: grid; gap: 0.55rem; margin: 0.2rem 0 1rem; }
.filters input[type="search"] { width: 100%; }
.filter-row { display: flex; gap: 0.5rem; }
.filter { position: relative; flex: 1; }
.filter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border-radius: 8px;
  color: var(--text);
}
.filter-btn .chev { margin-left: auto; color: var(--muted); }
.filter-btn .mark { width: 0.9rem; height: 0.9rem; flex: none; }
.filter-btn .filter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-btn.open { border-color: var(--accent); color: var(--accent); }
.filter-btn.on { background: var(--selected); border-color: var(--accent); color: var(--accent); }
.menu { display: grid; }
.menu-item { width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; }
.menu-item.on { background: var(--selected); color: var(--accent); }
.filter-panel {
  position: absolute;
  z-index: 3;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 12rem;
  padding: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(44, 40, 37, 0.06);
}
.tag-picker { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.tag {
  border-radius: 999px;
  background: transparent;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
}
.tag.on { border-color: var(--accent); color: var(--accent); }
.picker { margin: 0.4rem 0 0.8rem; }
.picker summary { cursor: pointer; color: var(--muted); }

.deployment {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 0.55rem;
}
.summary {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 4.5rem 0.85rem 1rem;
  cursor: pointer;
}
.summary.static { cursor: default; }
.title-line { display: flex; align-items: baseline; gap: 0.7rem; }
.title { font-weight: 600; }
.edit-link { position: absolute; top: 0.85rem; right: 0.9rem; }
.meta { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.35rem; color: var(--muted); font-size: 0.88rem; }
.detail { padding: 0 1rem 0.9rem; }
.dep-header { margin-bottom: 0.8rem; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.08rem 0.55rem;
  font-size: 0.78rem;
  border: 1px solid transparent;
}
.pill.gensyn { background: var(--gensyn); color: var(--gensyn-ink); }
.pill.base { background: var(--base); color: var(--base-ink); }
.pill.ethereum { background: var(--ethereum); color: var(--ethereum-ink); }
.pills { display: inline-flex; gap: 0.35rem; align-items: center; }
.env {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
}
.env.testnet {
  border-style: dashed;
  background: #f7f4ef;
}

.addr, .slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}
.addr-fold { border-top: 1px solid var(--line); }
.addr-fold > .addr { border-top: 0; cursor: pointer; }
.addr-fold > summary { list-style: none; }
.addr-fold > summary::-webkit-details-marker { display: none; }
.role-count {
  margin-left: 0.45rem;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.roles { display: grid; gap: 0.28rem; padding: 0 0 0.55rem 0.15rem; }
.role { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; padding-left: 0.85rem; }
.role-name { font-size: 0.86rem; }
.holders { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.holder {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.02rem 0.48rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
}
.slot-row select, .slot-row input { flex: 1; }
.checks, .fold { margin-top: 0.6rem; }
.checks summary, .fold summary { cursor: pointer; color: var(--muted); }
.plain { margin: 0.3rem 0; padding-left: 1.1rem; }
.role-block { padding: 0.45rem 0; border-top: 1px solid var(--line); }

.actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.notice { padding: 0.25rem 0.55rem; border-radius: 8px; font-size: 0.88rem; }
.notice.ok { background: var(--ok-bg); }
.notice.bad { background: var(--bad-bg); }
pre.output {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  overflow: auto;
  max-height: 16rem;
  white-space: pre-wrap;
}

.hidden { display: none; }

@media (max-width: 720px) {
  .grid2, .grid3, .filter-row { grid-template-columns: 1fr; display: grid; }
}
