:root {
  --bg: #070b14;
  --bg-elevated: rgba(15, 23, 42, 0.78);
  --bg-elevated-solid: #0f172a;
  --bg-card: rgba(19, 29, 49, 0.72);
  --bg-card-hover: rgba(24, 37, 62, 0.88);
  --bg-input: rgba(8, 13, 25, 0.75);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --highlight: rgba(255, 255, 255, 0.06);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #10b981;
  --primary-bright: #34d399;
  --primary-hover: #059669;
  --accent: #06b6d4;
  --indigo: #6366f1;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius: 16px;
}

html[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --bg-elevated-solid: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --bg-input: #f8fafc;
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.2);
  --highlight: rgba(255, 255, 255, 0.85);
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #059669;
  --primary-bright: #059669;
  --primary-hover: #047857;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient Futuristic Background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.35), transparent 70%);
}

.orb-2 {
  width: 540px;
  height: 540px;
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.32), transparent 70%);
}

.orb-3 {
  width: 380px;
  height: 380px;
  top: 35%;
  left: 55%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.16), transparent 70%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
}

html[data-theme="light"] .ambient-orb {
  opacity: 0.28;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

code {
  background: rgba(148, 163, 184, 0.14);
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.84em;
}

/* Auth View */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 452px;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
  border-radius: 22px;
  padding: 2rem;
  animation: fadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1.1rem;
}

.brand-logo-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25);
}

.brand-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  animation: pulseRing 3s ease-out infinite;
  pointer-events: none;
}

@keyframes pulseRing {
  0% {
    transform: scale(0.96);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-header h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.brand-header p {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
}

.version-chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--primary-bright);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.3rem;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.26rem 0.62rem;
}

.trust-pill svg {
  width: 13px;
  height: 13px;
  color: var(--primary-bright);
}

.unlock-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 0.78rem 0.95rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.dot-online {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
}

.auth-footer-links {
  margin-top: 1.05rem;
  text-align: center;
}

/* Tabs */
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.28rem;
  margin-bottom: 1.15rem;
  gap: 0.28rem;
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.58rem 0.75rem;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.87rem;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--bg-card-hover);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 var(--highlight);
}

/* Forms & Inputs */
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  font-size: 0.84rem;
}

.field > span {
  color: var(--text-muted);
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.68rem 0.85rem;
  font: inherit;
  font-size: 0.93rem;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.mono-input {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action input {
  padding-right: 2.7rem;
}

.input-eye-btn {
  position: absolute;
  right: 0.45rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}

.input-eye-btn:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
}

.input-eye-btn svg {
  width: 17px;
  height: 17px;
}

/* Password strength bar */
.strength-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  margin-top: 0.15rem;
}

.strength-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--danger);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.strength-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.notice {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.26);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.error-banner {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 11px;
  padding: 0.68rem 0.9rem;
  font-size: 0.86rem;
  margin: 0.7rem 0 0;
}

html[data-theme="light"] .error-banner {
  color: #b91c1c;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 11px;
  padding: 0.6rem 1.02rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, transform 0.08s, opacity 0.16s;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.7;
  cursor: wait;
}

.btn-lg {
  padding: 0.74rem 1.2rem;
  font-size: 0.92rem;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.09);
  border-color: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.17);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-bright);
  cursor: pointer;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 600;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.15);
}

.is-spinning svg.icon-sync {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Topbar & Main Vault */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 11, 20, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

html[data-theme="light"] .topbar {
  background: rgba(248, 250, 252, 0.82);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.72rem 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.topbar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.topbar-title {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.topbar-sub {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.79rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.user-chip {
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  padding: 0.14rem 0.56rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pill-ok {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

html[data-theme="light"] .pill-ok {
  color: #047857;
}

.pill-warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

html[data-theme="light"] .pill-warn {
  color: #b45309;
}

.pill-err {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.35rem 1.4rem 3rem;
}

/* Overview Strip */
.vault-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.15rem;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--highlight);
}

.overview-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value.stat-fav {
  color: #fbbf24;
}

.stat-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.overview-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: livePulse 2.2s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.35rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.filter-pill {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.46rem 0.92rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.16));
  color: var(--primary-bright);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}

/* Token Grid & Cards */
.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.05rem;
}

.token-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--highlight);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.2s, transform 0.18s ease, background 0.2s, box-shadow 0.2s;
  animation: cardIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.token-card:hover {
  border-color: rgba(16, 185, 129, 0.48);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32), inset 0 1px 0 var(--highlight);
}

.token-card.is-copied {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4), 0 14px 32px rgba(16, 185, 129, 0.16);
}

.token-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.token-identity {
  display: flex;
  align-items: center;
  gap: 0.78rem;
  min-width: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.98rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.avatar svg {
  width: 22px;
  height: 22px;
}

.token-titles {
  min-width: 0;
}

.token-issuer {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-account {
  color: var(--text-muted);
  font-size: 0.81rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.08rem;
}

.fav-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s;
  flex-shrink: 0;
}

.fav-btn svg {
  width: 17px;
  height: 17px;
}

.fav-btn:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.fav-btn.fav-active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.token-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.65rem 0.8rem 0.72rem;
  border-radius: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.16s, background 0.16s;
}

.token-body:hover {
  border-color: rgba(16, 185, 129, 0.45);
}

.token-body-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  width: 100%;
  background: var(--primary);
  transition: width 0.35s linear, background-color 0.25s;
  opacity: 0.85;
}

.token-body-progress.warn {
  background: var(--warn);
}

.token-body-progress.danger {
  background: var(--danger);
}

.code-col {
  min-width: 0;
}

.otp-code-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.otp-code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--primary-bright);
  line-height: 1.1;
  transition: color 0.2s;
}

.otp-code.is-expiring {
  color: #fb7185;
}

.copy-chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.14rem 0.45rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.13);
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s, background 0.15s, color 0.15s;
}

.token-body:hover .copy-chip,
.token-card.is-copied .copy-chip {
  opacity: 1;
  transform: translateX(0);
}

.token-card.is-copied .copy-chip {
  background: rgba(16, 185, 129, 0.22);
  color: var(--primary-bright);
}

.otp-next {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.24rem;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

.ring-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.ring-wrap svg {
  transform: rotate(-90deg);
  width: 44px;
  height: 44px;
}

.ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 3.5;
}

.ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear, stroke 0.2s;
}

.ring-fg.warn {
  stroke: var(--warn);
}

.ring-fg.danger {
  stroke: var(--danger);
}

.ring-text {
  position: absolute;
  font-size: 0.71rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.token-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tag-badge {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.11);
  border: 1px solid var(--border);
  color: var(--text-muted);
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  gap: 0.2rem;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.28rem 0.52rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mini-btn svg {
  width: 13px;
  height: 13px;
}

.mini-btn:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.mini-btn.mini-danger:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.6rem 1.6rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  max-width: 620px;
  margin: 1.5rem auto;
}

.empty-illustration {
  width: 76px;
  height: 76px;
  margin: 0 auto 1rem;
}

.empty-state h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.empty-state p {
  max-width: 460px;
  margin: 0 auto 1.4rem;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

/* Modals */
dialog.modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 560px;
  width: calc(100% - 2rem);
  color: var(--text);
}

dialog.modal[open] {
  animation: fadeSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

dialog.modal::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--bg-elevated-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.modal-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--primary-bright);
  flex-shrink: 0;
}

.modal-badge-icon svg {
  width: 17px;
  height: 17px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.section-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  accent-color: var(--primary);
}

.qr-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.qr-video-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #000;
}

.qr-video-wrap video {
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  display: block;
}

.qr-reticle {
  position: absolute;
  inset: 16% 24%;
  border: 2px solid rgba(52, 211, 153, 0.85);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
}

.info-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

.danger-zone {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 99;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-elevated-solid);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: var(--text);
  padding: 0.76rem 1.08rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 600;
  animation: fadeSlideUp 0.2s ease;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-bright);
  box-shadow: 0 0 8px var(--primary);
}

@media (max-width: 768px) {
  .topbar-actions .btn-with-icon .btn-label {
    display: none;
  }
  .topbar-actions .btn-lock .btn-label {
    display: inline;
  }
  .overview-hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 1.45rem;
  }
  .grid-2, .grid-3, .info-grid {
    grid-template-columns: 1fr;
  }
  .token-grid {
    grid-template-columns: 1fr;
  }
  .btn-add-main {
    width: 100%;
  }
  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}
