:root {
  --bg: #0b0a08;
  --card: #14120e;
  --ink: #f3ead8;
  --muted: #9a917f;
  --gold: #e4c15a;
  --gold-2: #f6e7a8;
  --line: rgba(243, 234, 216, 0.12);
  --red: #d46a55;
  --green: #6f9e6a;
  --pad: 4vw;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Outfit, system-ui, sans-serif; overflow-x: clip; }
.grain {
  pointer-events: none; position: fixed; inset: 0; opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: .85rem var(--pad);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: transparent; z-index: 5;
  overflow: visible;
}
.top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11,10,8,.94);
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: -1;
}
.tabs { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; justify-self: center; }
.header-actions { display: flex; gap: .45rem; align-items: center; justify-self: end; flex-wrap: wrap; min-width: 0; }
.menu { position: relative; }
.ghost-wallet {
  background: transparent !important; color: var(--ink) !important; border-color: var(--line) !important;
}
.ghost-wallet.on, .ghost-wallet[aria-expanded="true"] { border-color: var(--gold) !important; color: var(--gold) !important; }
.menu-panel {
  position: absolute; top: calc(100% + .55rem); right: 0; z-index: 20;
  width: min(22rem, calc(100vw - 2rem));
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem 1.15rem; box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.zsa-sync {
  position: relative;
  display: flex; align-items: center; gap: .4rem;
  min-width: 0;
}
.zsa-sync .sync-bar {
  width: 3.2rem; height: 3px; margin: 0; flex: 0 0 auto;
}
.zsa-sync .sync-bar.done span { width: 100%; }
.zsa-sync-label {
  font: 400 .68rem IBM Plex Mono, monospace;
  color: var(--muted); white-space: nowrap;
}
.tip-btn {
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--gold);
  font: 600 .62rem Outfit, sans-serif; cursor: help; padding: 0; line-height: 1;
  flex: 0 0 auto;
}
.tip-btn:hover, .tip-btn:focus { border-color: var(--gold); }
.tip-pop {
  display: none;
  position: absolute; top: calc(100% + .5rem); right: 0;
  width: min(18.5rem, 72vw);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; color: var(--muted); font-size: .75rem; line-height: 1.45;
  z-index: 21; box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.zsa-sync:hover .tip-pop, .zsa-sync:focus-within .tip-pop { display: block; }
#sol-menu-panel { display: grid; gap: .45rem; }
#sol-menu-panel button, #sol-menu-panel a {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: .55rem .7rem; font: 500 .8rem Outfit, sans-serif;
  cursor: pointer; text-decoration: none; text-align: left;
}
#sol-menu-panel button:hover, #sol-menu-panel a:hover { border-color: var(--gold); color: var(--gold); }
#sol-disconnect:hover { border-color: var(--red); color: var(--red); }
.menu-addr {
  margin: 0 0 .2rem; font: 400 .78rem IBM Plex Mono, monospace; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero, main, footer {
  width: min(72rem, calc(100% - 2 * var(--pad)));
  margin-left: auto;
  margin-right: auto;
}
.hero { padding: 2rem 0 0; }
h1 { font-family: Fraunces, serif; font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: .95; font-weight: 500; margin: .25rem 0 .8rem; }
.brand { display: flex; gap: .75rem; align-items: center; min-width: 0; justify-self: start; }
.mark {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 42%, #8a6a1a);
  color: #1a1408; display: grid; place-items: center; font-family: Fraunces, serif; font-weight: 700;
}
.brand small { display: block; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.tabs button, .wallet, button[type=submit], #claim {
  font: 500 .85rem/1 Outfit, sans-serif; letter-spacing: .04em;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: .55rem .95rem; border-radius: 999px; cursor: pointer;
}
.tabs button.on, .wallet, button[type=submit], #claim {
  background: var(--gold); color: #1a1408; border-color: var(--gold);
}
.tabs button { background: transparent; color: var(--ink); border-color: var(--line); }
.kicker { font-family: IBM Plex Mono, monospace; font-size: .72rem; letter-spacing: .22em; color: var(--gold); }
h1 em { font-style: italic; color: var(--gold-2); }
.lede { max-width: 38rem; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(17rem, .8fr);
  gap: 2rem;
  align-items: start;
}
.hero-feed-card { min-height: 12rem; }
.text-btn {
  background: none; border: 0; color: var(--gold); font: 500 .75rem Outfit, sans-serif;
  cursor: pointer; padding: 0; letter-spacing: .04em;
}
.text-btn:hover { color: var(--gold-2); }
.mini-feed { list-style: none; padding: 0; margin: 0; }
.mini-feed li {
  display: grid; grid-template-columns: auto 1fr auto; gap: .12rem .5rem;
  align-items: center;
  padding: .48rem 0; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--ink);
}
.mini-feed li:last-child { border-bottom: 0; }
.mini-feed .kind { font-family: IBM Plex Mono, monospace; color: var(--gold); text-transform: uppercase; font-size: .65rem; letter-spacing: .06em; }
.mini-feed .detail {
  grid-column: 1 / -1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
}
.mini-feed .ext { grid-column: 3; grid-row: 1; }
.ext { display: flex; align-items: center; gap: .28rem; }
.age { font-family: IBM Plex Mono, monospace; font-size: .65rem; color: var(--muted); min-width: 1.6rem; text-align: right; }
.ico {
  width: 1.15rem; height: 1.15rem; border-radius: 4px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; flex: 0 0 auto;
}
.ico:hover { border-color: var(--gold); color: var(--gold); }
.ico svg { width: .72rem; height: .72rem; display: block; fill: currentColor; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.8rem 0 1rem; }
.stats div { border-top: 1px solid var(--line); padding-top: .75rem; min-width: 0; }
.stats span { display: block; font-family: IBM Plex Mono, monospace; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
.banner {
  border: 1px solid rgba(228,193,90,.28); color: var(--gold-2); padding: .7rem .95rem;
  font-family: IBM Plex Mono, monospace; font-size: .74rem; line-height: 1.45;
  border-radius: 8px;
}
.connect-msg {
  margin: 0; padding: .55rem var(--pad); font-family: IBM Plex Mono, monospace; font-size: .78rem;
  color: var(--gold-2); border-bottom: 1px solid var(--line);
}
.connect-msg a { color: var(--gold); }
body[data-tab="launch"] .hero,
body[data-tab="faucet"] .hero,
body[data-tab="activity"] .hero { display: none; }

main { padding: 1.6rem 0 4rem; }
.panel { display: none; }
.panel.on { display: block; }
h2 { font-family: Fraunces, serif; font-weight: 500; margin: 0 0 .35rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; line-height: 1.45; }
.hint.pending, #zsa-lot-body.pending {
  display: flex; align-items: flex-start; gap: .5rem;
}
.spin {
  width: .85rem; height: .85rem; margin-top: .2rem;
  border: 1.5px solid rgba(228, 193, 90, .2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 2.15rem; height: 2.15rem; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; padding: 0; flex: 0 0 auto;
}
.icon-btn svg { width: 1.05rem; height: 1.05rem; fill: currentColor; display: block; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.settings-panel { display: grid; gap: .55rem; }
.settings-panel h3 { font-family: Fraunces, serif; color: var(--ink); margin: 0; font-weight: 500; }
.settings-panel .check { color: var(--ink); font-size: .82rem; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(17rem, .85fr);
  gap: 1.6rem;
  align-items: start;
}
.workbench-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1rem;
  margin-bottom: 1.1rem;
}
.workbench-head h2 { margin: 0; }
.workbench-main .stack { max-width: none; margin-top: 0; }

.dir {
  display: flex; gap: 0;
  border: 1px solid var(--line); border-radius: 999px; width: fit-content;
  flex-wrap: wrap;
}
.dir button {
  border: 0; background: transparent; color: var(--ink);
  padding: .65rem 1rem; border-radius: 999px; cursor: pointer;
  font: 500 .8rem/1 Outfit, sans-serif;
}
.dir button.on { background: var(--gold); color: #1a1408; }

.stack { display: grid; gap: .75rem; max-width: 32rem; margin-top: 1rem; }
label { display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); }
[hidden] { display: none !important; }
.dest-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: stretch; }
.dest-row button, .ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 0 .85rem; font: 500 .75rem Outfit, sans-serif;
  cursor: pointer; white-space: nowrap;
}
.dest-row button:hover, .ghost:hover { border-color: var(--gold); color: var(--gold); }
button:disabled, .dest-row button:disabled, #zsa-save-seed:disabled {
  opacity: .55; cursor: wait; pointer-events: none;
}
input, textarea {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  padding: .7rem .8rem; font: 400 .86rem/1.4 IBM Plex Mono, monospace; border-radius: 6px;
  min-width: 0; width: 100%;
}
input { overflow: hidden; text-overflow: ellipsis; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.check input { width: auto; }
.two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .85fr); gap: 2rem; align-items: start; }
.two .stack { max-width: none; }
.card { background: var(--card); border: 1px solid var(--line); padding: 1.15rem 1.2rem; border-radius: 14px; color: var(--muted); }
.card h3 { font-family: Fraunces, serif; color: var(--ink); margin: 0; font-weight: 500; }

#zsa-wallet {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  z-index: 20;
  color: var(--muted);
  max-height: min(70vh, 36rem);
  overflow: auto;
}
#zsa-wallet h3 { font-family: Fraunces, serif; color: var(--ink); margin: 0; font-weight: 500; }
.log-card {
  min-height: 14rem;
  display: flex;
  flex-direction: column;
}
.log-card .hint { margin: 0 0 .65rem; }
.log-card .log {
  max-height: 22rem;
  min-height: 12rem;
  margin: 0;
  flex: 1;
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .75rem .85rem;
}
.wallet-head {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  margin-bottom: .7rem;
}
#zsa-disconnect {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .7rem; font: 500 .72rem Outfit, sans-serif;
  cursor: pointer;
}
#zsa-disconnect:hover { border-color: var(--red); color: var(--red); }
#zsa-wallet-status { margin: 0 0 .85rem; font-size: .88rem; line-height: 1.45; }
.ua-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: center;
  margin-bottom: .55rem;
}
#zsa-ua {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .82rem; color: var(--ink); padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.2);
}
.ua-row button {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: .45rem .7rem; font: 500 .75rem Outfit, sans-serif; cursor: pointer;
}
.ua-row button:hover { border-color: var(--gold); color: var(--gold); }
#zsa-wallet-holdings { margin: 0 0 .35rem; }
.sync-bar {
  height: 3px; background: rgba(243, 234, 216, .08); border-radius: 99px; overflow: hidden; margin: .2rem 0 .85rem;
}
.sync-bar span {
  display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s ease;
}
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .75rem; }
.wallet-actions button, #zsa-save-seed {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: .55rem .7rem; font: 500 .78rem Outfit, sans-serif; cursor: pointer;
}
.wallet-actions button:hover, #zsa-save-seed:hover { border-color: var(--gold); color: var(--gold); }
#zsa-seed { width: 100%; margin-top: .65rem; resize: vertical; }
#zsa-save-seed { margin-top: .45rem; width: 100%; }
#zsa-lot { margin-top: .4rem; }
#zsa-lot a { word-break: break-all; }

.feed { list-style: none; padding: 0; }
.feed li {
  display: grid; grid-template-columns: 7rem 1fr auto; gap: 1rem;
  border-bottom: 1px solid var(--line); padding: .85rem 0; font-size: .9rem;
  align-items: center;
}
.feed .kind { font-family: IBM Plex Mono, monospace; color: var(--gold); text-transform: uppercase; font-size: .72rem; }
.feed a { color: var(--gold-2); }

.rail {
  margin: 3.2rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line);
}
.rail-head { margin: .35rem 0 1.3rem; max-width: 38rem; }
.rail-head h2 { margin: 0 0 .35rem; }
.rail-line {
  list-style: none; padding: 0; margin: 0 0 1.4rem;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .7rem;
  position: relative;
}
.rail-line::before {
  content: "";
  position: absolute; top: 1.15rem; left: 8%; right: 8%;
  height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .45; pointer-events: none;
}
.rail-line li {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem .85rem .9rem;
}
.rail-ix {
  display: block; font-family: IBM Plex Mono, monospace;
  color: var(--gold); font-size: .68rem; letter-spacing: .12em; margin-bottom: .35rem;
}
.rail-line strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: .25rem; }
.rail-line small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.rail-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
}
.rail-meta div { border-top: 1px solid var(--line); padding-top: .7rem; min-width: 0; }
.rail-meta span {
  display: block; font-family: IBM Plex Mono, monospace; font-size: .88rem;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-meta label { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; }

.faq {
  width: 100%;
  margin: 2.8rem 0 0;
}
.faq h2 { margin-bottom: .9rem; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1.2rem; align-items: start; }
.faq details {
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 0;
  transition: border-color .15s ease;
  align-self: start;
  cursor: pointer;
}
.faq details:hover, .faq details[open] { border-color: rgba(228, 193, 90, .35); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; min-height: 3.1rem;
  padding: .85rem 1rem;
  cursor: pointer; font-family: Fraunces, serif; color: var(--ink); font-size: 1.02rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--gold); font-family: Outfit, sans-serif; font-weight: 500;
  flex: 0 0 auto;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 1rem .9rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }

footer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.6rem 0 2.4rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .85rem;
}
footer > * {
  width: min(72rem, calc(100% - 2 * var(--pad)));
  margin-left: auto;
  margin-right: auto;
}
.foot-ids { font-family: IBM Plex Mono, monospace; font-size: .72rem; color: var(--muted); word-break: break-word; }
.log-wrap { margin-top: 1rem; }
.log-wrap summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.log {
  margin: .6rem 0 0; color: var(--green); font: 400 .72rem/1.45 IBM Plex Mono, monospace;
  white-space: pre-wrap; max-height: 12rem; overflow: auto;
}
a { color: var(--gold); }
code { font-family: IBM Plex Mono, monospace; font-size: .85em; }

@media (max-width: 900px) {
  .workbench, .two, .hero-grid { grid-template-columns: 1fr; }
  .rail-line, .rail-meta { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .rail-line::before { display: none; }
}
@media (max-width: 720px) {
  .faq-grid { grid-template-columns: 1fr; }
  .dest-row { grid-template-columns: 1fr; }
  .dest-row button { min-height: 2.4rem; }
  :root { --pad: 5vw; }
  h1 { font-size: clamp(2rem, 11vw, 3.2rem); }
  .dir { width: 100%; }
  .dir button { flex: 1; min-height: 2.5rem; }
}
@media (max-width: 560px) {
  .rail-line, .rail-meta, .workbench, .two, .hero-grid { grid-template-columns: 1fr; }
  .zsa-sync-label { max-width: 4.8rem; overflow: hidden; text-overflow: ellipsis; }
  .tabs button, .wallet { padding: .5rem .7rem; font-size: .78rem; }
}
@media (max-width: 800px) {
  .top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "brand actions" "tabs tabs";
  }
  .brand { grid-area: brand; }
  .header-actions { grid-area: actions; justify-self: end; }
  .tabs { grid-area: tabs; justify-self: center; width: 100%; }
  .feed li { grid-template-columns: 1fr; }
}
