:root {
  --bg: #0a0a0b;
  --bg-soft: #0f0f11;
  --panel: #101012;
  --panel-2: #141417;
  --panel-3: #18181b;
  --line: #27272a;
  --line-soft: #1d1d20;
  --text: #e4e4e7;
  --text-strong: #fafafa;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --mint: #b8f5c9;
  --mint-dim: rgba(184, 245, 201, 0.09);
  --red: #fca5a5;
  --red-dim: rgba(252, 165, 165, 0.08);
  --radius: 8px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-body { background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 11, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.brand-copy strong {
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-meta { display: flex; align-items: center; gap: 7px; }

.live-pill,
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.user-chip {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.live-dot,
.secure-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 7px rgba(184, 245, 201, 0.55);
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.btn:hover { border-color: #3f3f46; background: var(--panel-3); }
.btn:disabled { cursor: wait; opacity: 0.55; }

.btn.primary {
  border-color: rgba(184, 245, 201, 0.32);
  background: var(--mint);
  color: #0a0a0b;
  font-weight: 700;
}

.btn.primary:hover { background: #d1fbe0; border-color: var(--mint); }
.btn.ghost { background: transparent; }
.keys-button { min-height: 25px; padding: 0 8px; }
.keys-button .key-glyph { color: var(--mint); font-size: 12px; line-height: 1; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  transition: color 140ms ease, border-color 140ms ease;
}

.icon-btn:hover { color: var(--text); border-color: #3f3f46; }
.icon-btn svg { width: 14px; height: 14px; }

.shell {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px 14px 22px;
  display: grid;
  gap: 8px;
}

.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.console-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.prompt {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.console-title > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.console-title strong { color: var(--text-strong); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.console-title small { color: var(--muted-2); font-family: var(--mono); font-size: 8px; }

.private-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(184, 245, 201, 0.2);
  border-radius: 4px;
  background: var(--mint-dim);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.console-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.console-updated,
.console-state {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.console-state { color: var(--mint); }
.console-state.busy { animation: pulse 1.1s ease-in-out infinite; }

.auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
  cursor: pointer;
}

.auto-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 26px;
  height: 14px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  transition: background 140ms ease, border-color 140ms ease;
}

.toggle-thumb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform 140ms ease, background 140ms ease;
}

.auto-toggle input:checked + .toggle-track { border-color: rgba(184, 245, 201, 0.35); background: var(--mint-dim); }
.auto-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(12px); background: var(--mint); }

.refresh-icon { display: inline-block; font-size: 13px; line-height: 1; }
.refresh-icon.spinning { animation: spin 0.9s linear infinite; }

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.wallet-card {
  min-width: 0;
  min-height: 110px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.wallet-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.wallet-title { display: flex; align-items: center; gap: 7px; min-width: 0; }

.wallet-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid color-mix(in srgb, var(--wallet-color) 30%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--wallet-color) 8%, var(--panel-2));
  color: var(--wallet-color);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  flex: 0 0 auto;
}

.wallet-title h3 { margin: 0; color: var(--text-strong); font-size: 11px; font-weight: 600; }
.wallet-title p { margin: 2px 0 0; color: var(--muted-2); font-family: var(--mono); font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wallet-badge {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  flex: 0 0 auto;
}

.wallet-address {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #0b0b0d;
}

.wallet-address code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.mini-btn {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  flex: 0 0 auto;
}

.mini-btn:hover { border-color: var(--line); background: var(--panel-2); color: var(--mint); }
.mini-btn svg { width: 12px; height: 12px; }

.wallet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}

.wallet-scope {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.wallet-scope i { width: 4px; height: 4px; border-radius: 50%; background: var(--wallet-color); flex: 0 0 auto; }
.explorer-link { color: var(--muted); font-family: var(--mono); font-size: 8px; white-space: nowrap; transition: color 140ms ease; }
.explorer-link:hover { color: var(--mint); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.stat-card {
  min-width: 0;
  min-height: 63px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-label { color: var(--muted-2); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; }
.stat-value { margin-top: 3px; color: var(--text-strong); font-family: var(--mono); font-size: 17px; font-weight: 600; line-height: 1.1; }
.stat-value .stat-sub { color: var(--muted-2); font-size: 10px; font-weight: 400; }
.stat-time { font-size: 14px; }
.stat-note { margin-top: 3px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head.compact { min-height: 40px; }
.panel-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.eyebrow { color: var(--mint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; }
.panel-title h2 { margin: 0; color: var(--text-strong); font-size: 11px; font-weight: 600; white-space: nowrap; }
.panel-hint { color: var(--muted-2); font-family: var(--mono); font-size: 8px; white-space: nowrap; }

.panel-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }

.search-box {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 150px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0b0b0d;
  color: var(--muted-2);
}

.search-box:focus-within { border-color: rgba(184, 245, 201, 0.35); }
.search-box svg { width: 11px; height: 11px; flex: 0 0 auto; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 9px; }
.search-box input::placeholder { color: var(--muted-2); }

.filter-tabs { display: flex; align-items: center; gap: 2px; }

.filter-tab {
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.filter-tab:hover { color: var(--text); }
.filter-tab.active { border-color: var(--line); background: var(--panel-2); color: var(--mint); }

.table-head {
  display: grid;
  grid-template-columns: minmax(145px, 1.15fr) minmax(150px, 1fr) minmax(110px, 0.72fr) 92px 62px 84px 62px;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #0d0d0f;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.token-head { grid-template-columns: 88px minmax(160px, 1.2fr) minmax(110px, 0.72fr) 92px 62px; }

.chain-row {
  display: grid;
  grid-template-columns: minmax(145px, 1.15fr) minmax(150px, 1fr) minmax(110px, 0.72fr) 92px 62px 84px 62px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 120ms ease;
}

.chain-row:last-child { border-bottom: 0; }
.chain-row:hover { background: rgba(255, 255, 255, 0.018); }

.chain-id { display: flex; align-items: center; gap: 7px; min-width: 0; }

.chain-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid color-mix(in srgb, var(--chain-color) 28%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--chain-color) 7%, var(--panel-2));
  color: var(--chain-color);
  font-family: var(--mono);
  font-size: 6px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.chain-id > div { min-width: 0; }
.chain-id strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 10px; font-weight: 500; }
.chain-id small { display: block; margin-top: 1px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; white-space: nowrap; }

.token-badge {
  display: inline-flex;
  align-items: center;
  height: 13px;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid rgba(184, 245, 201, 0.18);
  border-radius: 3px;
  background: var(--mint-dim);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 6px;
  vertical-align: 1px;
}

.wallet-col { min-width: 0; }
.wallet-col code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.wallet-col small { display: block; margin-top: 1px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; }

.balance-col { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.balance-col strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-family: var(--mono); font-size: 9px; font-weight: 500; }
.balance-col span { color: var(--muted-2); font-family: var(--mono); font-size: 7px; }

.usd-col,
.tx-col { color: var(--muted); font-family: var(--mono); font-size: 9px; text-align: right; white-space: nowrap; }
.tx-col { color: var(--text); text-align: center; }
.usd-col.muted { color: var(--muted-2); }

.status-col {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.status-col.error { color: var(--red); }
.status-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.mobile-status { display: none; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); flex: 0 0 auto; }
.mobile-status.error { background: var(--red); }
.row-explorer { justify-self: end; }

.token-list { display: block; }

.token-row {
  display: grid;
  grid-template-columns: 88px minmax(160px, 1.2fr) minmax(110px, 0.72fr) 92px 62px;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.token-row:last-child { border-bottom: 0; }
.token-row:hover { background: rgba(255, 255, 255, 0.018); }

.token-chain { display: flex; align-items: center; gap: 6px; min-width: 0; }
.token-chain .chain-icon { width: 22px; height: 22px; font-size: 5px; }
.token-chain span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 8px; }

.token-id { display: flex; align-items: center; gap: 7px; min-width: 0; }
.token-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--token-color, var(--mint)); box-shadow: 0 0 8px color-mix(in srgb, var(--token-color, var(--mint)) 45%, transparent); flex: 0 0 auto; }
.token-id > div { min-width: 0; }
.token-id strong { display: block; color: var(--text); font-family: var(--mono); font-size: 9px; font-weight: 600; }
.token-id small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; color: var(--muted-2); font-size: 7px; }
.token-amount { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.token-amount strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-family: var(--mono); font-size: 9px; font-weight: 500; }
.token-amount span { color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.token-usd { color: var(--muted); font-family: var(--mono); font-size: 9px; text-align: right; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  padding: 18px;
  color: var(--muted-2);
  text-align: center;
}

.empty-state.compact { min-height: 70px; }
.empty-state strong { color: var(--text); font-size: 10px; font-weight: 500; }
.empty-state span { font-family: var(--mono); font-size: 8px; }
.empty-icon { color: var(--mint); font-size: 18px; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.skeleton-card,
.skeleton-row,
.key-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--panel-2) !important;
}

.skeleton-card::after,
.skeleton-row::after,
.key-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton-card { min-height: 110px; }
.skeleton-row { min-height: 38px; }
.key-skeleton { min-height: 58px; border: 1px solid var(--line); border-radius: 6px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0f;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: modal-in 160ms ease-out;
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 2px 0 0; color: var(--text-strong); font-size: 16px; font-weight: 600; }

.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid rgba(252, 165, 165, 0.18);
  border-radius: 5px;
  background: var(--red-dim);
}

.warning-icon { color: var(--red); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.warning-box p { margin: 0; color: #fecaca; font-size: 9px; line-height: 1.5; }

.keys-list { display: grid; gap: 7px; }

.key-item { padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.key-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.key-item-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.key-item-title strong { display: block; color: var(--text); font-size: 10px; font-weight: 500; }
.key-item-title small { display: block; margin-top: 1px; color: var(--muted-2); font-family: var(--mono); font-size: 8px; }
.key-item-format { padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-family: var(--mono); font-size: 7px; }

.key-line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 22px 22px;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #0b0b0d;
}

.key-label { color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.key-line code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mint); font-family: var(--mono); font-size: 8px; }
.key-item-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.text-btn { padding: 0; border: 0; background: transparent; color: var(--mint); font-family: var(--mono); font-size: 8px; }
.text-btn.muted { color: var(--muted); }
.text-btn:hover { text-decoration: underline; }

.modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.modal-hint { color: var(--muted-2); font-family: var(--mono); font-size: 8px; }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  padding: 8px 11px;
  border: 1px solid rgba(184, 245, 201, 0.24);
  border-radius: 5px;
  background: #111813;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 9px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  animation: toast-in 140ms ease-out;
}

.toast.error { border-color: rgba(252, 165, 165, 0.24); background: #1a1112; color: var(--red); }

/* Private login */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(184, 245, 201, 0.045), transparent 70%),
    var(--bg);
}

.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black, transparent 72%);
}

.login-shell {
  position: relative;
  width: min(390px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-topline { display: flex; align-items: center; gap: 8px; }
.login-topline .private-badge { margin-left: auto; }

.login-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.login-card-head { display: flex; align-items: flex-start; gap: 9px; }
.terminal-prompt { color: var(--mint); font-family: var(--mono); font-size: 13px; font-weight: 700; line-height: 1.2; }
.login-card h1 { margin: 2px 0 0; color: var(--text-strong); font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.login-subtitle { margin: 9px 0 15px; color: var(--muted-2); font-size: 9px; line-height: 1.5; }

.field { display: block; margin-bottom: 9px; }
.field > span { display: block; margin-bottom: 4px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; text-transform: uppercase; }

.field input {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: #0b0b0d;
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:focus { border-color: rgba(184, 245, 201, 0.45); box-shadow: 0 0 0 2px rgba(184, 245, 201, 0.055); }
.field input::placeholder { color: var(--muted-2); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 56px; }

.reveal-btn {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  padding: 4px 5px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 7px;
}

.reveal-btn:hover { background: var(--mint-dim); }

.login-error {
  margin: 4px 0 9px;
  padding: 7px 8px;
  border: 1px solid rgba(252, 165, 165, 0.2);
  border-radius: 4px;
  background: var(--red-dim);
  color: #fecaca;
  font-size: 9px;
  line-height: 1.45;
}

.login-submit { width: 100%; min-height: 36px; margin-top: 3px; font-size: 10px; }
.btn-arrow { margin-left: auto; font-size: 14px; font-weight: 400; }
.login-submit .btn-label { margin-left: 6px; }

.login-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.login-foot span { display: inline-flex; align-items: center; gap: 5px; }
.login-foot .secure-dot { width: 4px; height: 4px; box-shadow: 0 0 6px rgba(184, 245, 201, 0.55); }
.login-hint { color: var(--muted-2); font-family: var(--mono); font-size: 7px; text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1220px) {
  .wallet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-head:not(.token-head),
  .chain-row { grid-template-columns: minmax(145px, 1.25fr) minmax(100px, 0.7fr) 82px 56px 82px 60px; }
  .table-head:not(.token-head) span:nth-child(2),
  .chain-row .wallet-col { display: none; }
}

@media (max-width: 980px) {
  .wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-updated { display: none; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 12px; }
  .shell { padding: 8px 8px 18px; }
  .console-bar { align-items: flex-start; flex-direction: column; gap: 7px; }
  .console-actions { width: 100%; justify-content: space-between; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .panel-tools { width: 100%; justify-content: space-between; }
  .search-box { width: 100%; max-width: 190px; }
  .panel-hint { display: none; }
  .table-head { display: none; }
  .chain-row { grid-template-columns: minmax(0, 1.45fr) minmax(82px, 0.8fr) minmax(62px, 0.55fr) 44px 48px; gap: 6px; padding: 6px 9px; }
  .chain-row .status-col { display: none; }
  .mobile-status { display: inline-block; }
  .token-row { grid-template-columns: minmax(0, 1.3fr) minmax(90px, 0.8fr) 68px 42px; gap: 6px; padding: 6px 9px; }
  .token-row .token-chain { display: none; }
  .token-row .row-explorer { justify-self: end; }
  .footer { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 560px) {
  .brand-copy small { display: none; }
  .live-pill { display: none; }
  .user-chip { max-width: 120px; }
  .wallet-grid { grid-template-columns: 1fr; }
  .wallet-card { min-height: 104px; }
  .keys-button span:last-child { display: none; }
  .keys-button { width: 27px; padding: 0; }
  .filter-tab { padding: 0 4px; }
  .modal-actions { align-items: flex-start; flex-direction: column; }
  .modal-actions .btn { width: 100%; }
  .key-line { grid-template-columns: 76px minmax(0, 1fr) 22px 22px; }
}
