.app-body {
  min-height: 100vh;
}

.app-body .nav-links {
  display: flex;
}

.wallet-wrap {
  position: relative;
}

.wallet-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 13.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.35rem;
  box-shadow: 0 1rem 2rem rgba(29, 29, 31, 0.1);
  z-index: 45;
  display: grid;
}

.wallet-menu button,
.wallet-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  color: var(--ink);
  cursor: pointer;
}

.wallet-menu button:hover,
.wallet-menu a:hover {
  background: var(--paper);
}

.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}

.chip.is-ok {
  background: var(--lime);
  color: var(--lime-ink);
  box-shadow: none;
}

.chip.is-bad {
  background: #ffe8ea;
  color: var(--bad);
  box-shadow: none;
}

.workspace {
  padding: 2rem 0 5rem;
  min-height: calc(100vh - var(--nav-h));
}

.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin: 1.25rem 0 0;
}

.search {
  flex: 1;
  min-width: 12rem;
  height: 2.6rem;
  border: 1px solid var(--line-strong);
  background: var(--white);
  border-radius: 999px;
  padding: 0 1rem;
}

.search:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.sort {
  height: 2.6rem;
  border: 1px solid var(--line-strong);
  background: var(--white);
  border-radius: 999px;
  padding: 0 0.9rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.stat span {
  color: var(--faint);
  font-size: 0.78rem;
}

.panel {
  display: none;
}

.panel.is-on {
  display: block;
}

.desk-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.desk-table th,
.desk-table td {
  padding: 0.85rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  vertical-align: middle;
}

.desk-table th {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
}

.desk-table tr:last-child td {
  border-bottom: 0;
}

.desk-table tbody tr {
  cursor: pointer;
}

.desk-table tbody tr:hover {
  background: #fafafa;
}

.desk-table .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.asset-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.asset-cell strong {
  letter-spacing: -0.02em;
}

.asset-cell small {
  color: var(--faint);
  font-size: 0.75rem;
}

.btn-sm {
  min-height: 2rem;
  padding: 0 0.8rem;
  font-size: 0.8125rem;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: min(28rem, 100%);
  text-align: center;
  background: var(--white);
  border-radius: 1.5rem;
  padding: 1.6rem 1.4rem 1.5rem;
  box-shadow: 0 1.5rem 3rem rgba(29, 29, 31, 0.12);
}

.gate-card img {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.2rem;
  border-radius: 1.1rem;
  background: var(--lime);
  object-fit: cover;
}

.gate-card h1 {
  margin: 0;
  font-size: 1.85rem;
}

.gate-card p {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.gate-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(29, 29, 31, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none;
}

.sheet-card {
  width: min(34rem, 100%);
  max-height: min(92vh, 44rem);
  overflow: auto;
  background: var(--white);
  border-radius: 1.4rem 1.4rem 0 0;
  padding: 1.35rem 1.35rem 1.7rem;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.4rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 1.1rem 0 0;
}

.facts div {
  background: var(--paper);
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
}

.facts b {
  display: block;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 500;
}

.facts span {
  font-size: 0.72rem;
  color: var(--faint);
}

.field {
  margin-top: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  height: 2.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  padding: 0 0.9rem;
  background: var(--white);
}

.hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.sheet-note {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.sheet-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.sheet-actions .btn {
  flex: 1;
}

.empty {
  margin-top: 2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.4rem 1.4rem;
  text-align: center;
}

.empty img {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.9rem;
  border-radius: 0.9rem;
  background: var(--lime);
  object-fit: cover;
}

.empty h2 {
  margin: 0;
  font-size: 1.2rem;
}

.empty p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.pos {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.pos-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
}

.pos-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.pos-top strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.pos-grid span {
  display: block;
  font-size: 0.72rem;
  color: var(--faint);
}

.pos-grid b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
}

.pos-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.95rem;
}

.log {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.log-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.log-item time {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .app-body .nav-links a:nth-child(n + 5) {
    display: none;
  }

  .stat-row,
  .pos-grid,
  .facts {
    grid-template-columns: 1fr 1fr;
  }

  .desk-hide {
    display: none;
  }

  .workspace {
    padding-top: 1.25rem;
  }
}

.profile-card {
  margin-top: 1.4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: 1.4rem 1.35rem 1.5rem;
  display: grid;
  gap: 1rem;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.profile-top img {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: var(--lime);
  object-fit: cover;
}

.profile-top strong {
  display: block;
  font-family: var(--display);
  letter-spacing: -0.03em;
  font-size: 1.2rem;
}

.profile-top span {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.profile-stats div {
  background: var(--paper);
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
}

.profile-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
}

.profile-stats span {
  font-size: 0.72rem;
  color: var(--faint);
}

@media (max-width: 520px) {
  .stat-row,
  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }
}
