:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: #0f172a;
  background: #f3f6fb;
}

* { box-sizing: border-box; }
body { margin: 0; }

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 96px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.logo { margin: 0; color: #6366f1; font-weight: 700; }
h1 { margin: 4px 0 0; font-size: 1.75rem; }

.wallet-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe3ef;
  white-space: nowrap;
}

.grid.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 { margin: 0; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab {
  border: 1px solid #d7deea;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: #334155;
}
.tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.tabs-compact .tab { font-size: 0.9rem; padding: 6px 10px; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #0f172a; }

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-default { background: #e2e8f0; color: #334155; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }

.badge-danger { background: #fee2e2; color: #991b1b; }

.nonce-chip {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.proposal-detail { gap: 14px; }
.proposal-header-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 10px;
  align-items: center;
}
.proposal-title { font-size: 1rem; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 14px;
}
.detail-grid p { margin: 4px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.timeline-list { margin: 8px 0 0; padding-left: 18px; }
.timeline-list li { margin: 4px 0; }
.timeline-list li.active { color: #0f172a; font-weight: 600; }

.proposal-rejected {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.deemphasized { opacity: 0.6; }

details summary { cursor: pointer; font-weight: 600; }


input, select {
  width: 100%;
  border: 1px solid #cdd6e4;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.owner-row, .owner-line, .proposal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.owner-row input { flex: 1; }

.icon-btn {
  border: 1px solid #cdd6e4;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.icon-btn.add { width: fit-content; }

.safe-row {
  border: 1px solid #d9e2ef;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
}

.proposal-card {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.to-line { margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.hash-full { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.summary-box {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.breadcrumb button { border: none; background: none; color: #4f46e5; cursor: pointer; }

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.muted { color: #64748b; }
.error { color: #dc2626; margin: 0; }

.skeleton {
  display: grid;
  gap: 8px;
}
.skeleton::before {
  content: '';
  height: calc(var(--lines, 3) * 14px + (var(--lines, 3) - 1) * 8px);
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(520px, 95vw);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link { border: none; background: none; color: #4f46e5; text-align: left; padding: 0; }

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.error { background: #991b1b; }
.toast button { border: none; background: none; color: inherit; cursor: pointer; }

@media (max-width: 760px) {
  .topbar { flex-direction: column; }
  .wallet-pill { width: 100%; justify-content: space-between; }
  .overview-grid { grid-template-columns: 1fr; }
  .proposal-header-bar { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}


.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.token-meta {
  margin: 4px 0 0;
}
