.app-body { min-height: 100vh; }
[hidden] { display: none !important; }

.nav-tag {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--dim);
  letter-spacing: .1em;
  margin-left: .1rem;
}

/* cluster switch in nav */
.cluster-switch {
  display: flex;
  gap: .25rem;
  margin-left: 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem;
}
.cluster-switch button {
  background: none;
  border: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  padding: .35rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.cluster-switch button:hover { color: var(--muted); }
.cluster-switch button.active { background: var(--bg-raise-2); color: var(--fg); }

.app-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
  position: relative;
  z-index: 2;
}

/* ---------- CONNECT HERO ---------- */
.connect-hero {
  max-width: 640px;
  margin: 6vh auto;
  text-align: center;
}
.connect-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.05;
}
.connect-hero p {
  color: var(--muted);
  margin-top: 1.2rem;
  font-size: 1.02rem;
  max-width: 56ch;
  margin-inline: auto;
}
.connect-hero p b { color: var(--fg); font-weight: 550; }
.wallet-hint { font-size: .85rem; color: var(--dim); margin-top: 1rem; min-height: 1.2em; }

.btn-primary {
  background: var(--fg);
  color: #000;
  font-weight: 550;
  font-size: .95rem;
  padding: .75rem 1.6rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 2rem;
  transition: opacity .15s ease, transform .1s ease;
}
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary.full { width: 100%; margin-top: 1.4rem; border-radius: 12px; padding: .9rem; }

/* ---------- APP SHELL (rail + content) ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.rail { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 1rem; }

.port-card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255,255,255,0.015);
  padding: 1.3rem;
}
.panel-label {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  color: var(--dim);
}
.port-total {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: .5rem;
}
.acct-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .7rem;
  font-size: .74rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.acct-chip:hover { color: var(--fg); border-color: rgba(255,255,255,.22); }
.dot-sm {
  width: 6px; height: 6px; border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 8px rgba(53,208,127,.6);
  flex-shrink: 0;
}
.dot-sm.dev { background: #f5b944; box-shadow: 0 0 8px rgba(245,185,68,.6); }

.tabs { display: flex; flex-direction: column; gap: .2rem; }
.tabs button {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .7rem .9rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color .15s ease, background .15s ease;
}
.tabs button span { font-size: .85rem; color: var(--dim); width: 1.1em; }
.tabs button:hover { color: var(--fg); background: var(--bg-raise); }
.tabs button.active { color: var(--fg); background: var(--bg-raise-2); border-color: var(--line-soft); }
.tabs button em {
  font-style: normal;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .06em;
  color: #35d07f;
  border: 1px solid rgba(53,208,127,.35);
  border-radius: 999px;
  padding: .1rem .45rem;
  margin-left: auto;
}
.rail-foot { padding: .4rem .9rem; }
.net-line {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--dim);
}

.content { min-width: 0; }
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.pane-head h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.panel-sub { font-family: var(--mono); font-size: .72rem; color: var(--dim); }

.card-lg {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255,255,255,0.015);
  padding: 1.5rem;
  max-width: 560px;
}

.mini-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  transition: color .15s ease, border-color .15s ease;
}
.mini-btn:hover { color: var(--fg); border-color: rgba(255,255,255,.25); }
.mini-pill {
  background: var(--bg-raise-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: .8rem;
  font-weight: 500;
  padding: .45rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s ease, opacity .15s ease;
}
.mini-pill:hover:not(:disabled) { border-color: rgba(255,255,255,.3); }
.mini-pill:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- HOLDINGS ---------- */
.holdings {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
}
.hold-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.01);
  transition: background .15s ease;
}
.hold-row:last-child { border-bottom: none; }
.hold-row:hover { background: var(--bg-raise); }
.bal-sym { font-weight: 550; font-size: .95rem; }
.bal-name { color: var(--dim); font-size: .74rem; font-family: var(--mono); }
.bal-amt { font-family: var(--mono); font-size: .92rem; text-align: right; }
.bal-usd { color: var(--dim); font-size: .74rem; font-family: var(--mono); text-align: right; }
.bal-empty { color: var(--dim); font-size: .88rem; padding: 1.2rem 1.3rem; }

/* ---------- IO / FORMS ---------- */
.io-box {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--bg);
}
.io-box + .io-box { margin-top: 0; }
.io-top { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.io-label { font-size: .78rem; color: var(--dim); }
.io-bal { font-family: var(--mono); font-size: .74rem; color: var(--dim); cursor: pointer; }
.io-bal:hover { color: var(--muted); }
.io-row { display: flex; align-items: center; gap: .8rem; }
.io-amount {
  flex: 1;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  outline: none;
  min-width: 0;
  font-family: var(--sans);
}
.io-amount::placeholder { color: var(--dim); }
.io-token {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 500;
  padding: .5rem .7rem;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
}
.io-token.static { cursor: default; }
.swap-flip {
  display: block;
  margin: -.6rem auto;
  position: relative;
  z-index: 3;
  background: var(--bg-raise-2);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s ease, transform .2s ease;
}
.swap-flip:hover { color: var(--fg); transform: rotate(180deg); }

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  color: var(--dim);
  margin: 1.1rem 0 .45rem;
  text-transform: uppercase;
}
.text-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: .85rem;
  padding: .85rem 1rem;
  outline: none;
  transition: border-color .15s ease;
}
.text-input:focus { border-color: rgba(255,255,255,.22); }
.text-input::placeholder { color: var(--dim); }

.quote-box {
  margin-top: 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.q-row {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
  font-size: .85rem;
  color: var(--muted);
}
.q-row span:first-child { color: var(--dim); }
.fee-row { border-top: 1px solid var(--line-soft); margin-top: .35rem; padding-top: .6rem; }
.fee-note { font-size: .72rem; color: var(--dim); margin-top: .5rem; font-family: var(--mono); }
.usdc-soon { color: #35d07f; }

.tx-status {
  margin-top: 1rem;
  font-size: .85rem;
  font-family: var(--mono);
  color: var(--muted);
  min-height: 1.2em;
  word-break: break-all;
}
.tx-status a { color: #35d07f; }
.tx-status.err { color: #ff6b6b; }

/* ---------- GASLESS ---------- */
.gasless-lead { color: var(--muted); font-size: .95rem; margin-bottom: 1.3rem; }
.gasless-lead b { color: #35d07f; font-weight: 550; }
.faucet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  margin-bottom: 1rem;
}
.gasless-setup {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.3rem;
  color: var(--muted);
  font-size: .9rem;
}
.gasless-setup code {
  font-family: var(--mono);
  font-size: .78rem;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: .1rem .4rem;
}
.gasless-setup .k { color: var(--dim); font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; }
.gasless-setup ol { margin: .8rem 0 0 1.2rem; display: flex; flex-direction: column; gap: .5rem; }

/* ---------- ACTIVITY ---------- */
.activity {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
}
.act-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  padding: .9rem 1.3rem;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.act-row:last-child { border-bottom: none; }
.act-row:hover { background: var(--bg-raise); }
.act-sig { font-family: var(--mono); font-size: .8rem; color: var(--fg); }
.act-time { font-family: var(--mono); font-size: .72rem; color: var(--dim); }
.act-status { font-family: var(--mono); font-size: .72rem; color: #35d07f; }
.act-status.fail { color: #ff6b6b; }
.act-link { color: var(--muted); font-size: .78rem; }
.act-link:hover { color: var(--fg); }

/* ---------- WALLET MODAL ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  width: 100%;
  max-width: 380px;
  background: #0c0c12;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 550;
  margin-bottom: 1.1rem;
}
.modal-x {
  background: none;
  border: none;
  color: var(--dim);
  font-size: .95rem;
  cursor: pointer;
}
.modal-x:hover { color: var(--fg); }
.wallet-opts { display: flex; flex-direction: column; gap: .5rem; }
.wallet-opts button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  color: var(--fg);
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wallet-opts button:hover { border-color: rgba(255,255,255,.25); background: var(--bg-raise-2); }
.wallet-opts button em { font-style: normal; font-family: var(--mono); font-size: .68rem; color: var(--dim); }
.modal-note { color: var(--dim); font-size: .76rem; margin-top: 1rem; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: #000;
  font-size: .85rem;
  font-weight: 500;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.btn-app.connected {
  background: var(--bg-raise-2);
  color: var(--fg);
  border: 1px solid var(--line);
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { position: static; }
  .tabs { flex-direction: row; flex-wrap: wrap; }
  .cluster-switch { display: none; }
}
