/* ==========================================================================
   RevokeTool — Solana SPL Token Approval Scanner & Revoker
   Powered by DuckDNS
   ========================================================================== */

:root {
  --bg-dark: #19191d;
  --bg-card: #27272d;
  --bg-card-hover: #2e2e35;
  --bg-input: #1e1e24;
  --border-card: #373740;
  --border-card-subtle: #2f2f37;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-emerald: #10b981;
  --accent-cyan: #14f195;
  --accent-purple: #9945ff;
  
  --notice-bg: #1c2433;
  --notice-border: #2b3a52;
  --notice-icon: #38bdf8;
  
  --warning-bg: #2a2016;
  --warning-border: #92400e;
  --warning-amber: #f59e0b;
  --warning-amber-hover: #d97706;
  --warning-dark-text: #18181b;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 20px;
  
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow-amber: 0 0 25px rgba(245, 158, 11, 0.35);
  --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.25);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Ambient Background Glow */
.bg-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
}

.orb-1 {
  top: -15%;
  left: 15%;
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
}

.orb-2 {
  bottom: 10%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: var(--warning-amber);
}

/* Navigation */
.navbar {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-card);
  background: rgba(25, 25, 29, 0.85);
  backdrop-filter: blur(16px);
  padding: 1rem 2rem;
}

.nav-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--warning-amber) 0%, var(--accent-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #18181b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.gradient-text {
  background: linear-gradient(135deg, #f59e0b 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--text-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Main Container */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Glass Card Component */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Scanner Section */
.scanner-section {
  margin-bottom: 1.8rem;
}

.scanner-card {
  padding: 1.5rem;
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #2a2a30 0%, #24242a 100%);
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.scanner-title-group h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.scanner-title-group p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.scan-mode-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: #38bdf8;
  white-space: nowrap;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Scanner Form */
.scanner-form {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.address-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 38px 12px 42px;
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}

.address-input:focus {
  border-color: var(--warning-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.clear-btn:hover {
  color: var(--text-primary);
}

.btn-scan {
  background: var(--warning-amber);
  color: var(--warning-dark-text);
  font-weight: 700;
  padding: 12px 22px;
  min-height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-scan:hover {
  background: var(--warning-amber-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-amber);
}

/* Preset Chips */
.preset-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-weight: 600;
}

/* Results Container */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Notice Banner (Matches Screenshot) */
.notice-banner {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.notice-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: var(--notice-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notice-icon svg {
  width: 18px;
  height: 18px;
}

.notice-text strong {
  font-weight: 700;
  color: #ffffff;
}

/* Dark Cards (Portfolio & Immediate Actions - Exact Screenshot Styling) */
.dark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.card-accordion-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.card-accordion-header:hover {
  background: var(--bg-card-hover);
}

.header-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chevron-icon {
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.section-icon {
  font-size: 1.25rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.header-value-right {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.action-count-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.card-accordion-body {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Portfolio Rows (Exact screenshot styling) */
.portfolio-item-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.portfolio-item-row {
  background: #1f1f25;
  border: 1px solid var(--border-card-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease;
}

.portfolio-item-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.item-icon-box svg {
  width: 18px;
  height: 18px;
}

.row-titles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-main-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.subtext-muted {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

.badge-pill-light {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.btn-refresh-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: transform 0.3s ease, color 0.2s ease;
}

.btn-refresh-icon:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.btn-refresh-icon svg {
  width: 15px;
  height: 15px;
}

.row-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.row-usd-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-explore {
  background: none;
  border: none;
  color: var(--text-emerald);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.btn-explore:hover {
  background: rgba(16, 185, 129, 0.1);
}

.btn-explore svg {
  width: 16px;
  height: 16px;
}

/* Explore Drawer Details */
.explore-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: #17171c;
  border: 1px solid var(--border-card-subtle);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  margin-top: -4px;
}

.explore-drawer.open {
  max-height: 600px;
}

.drawer-content {
  padding: 1rem 1.2rem;
}

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

.drawer-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Token Table */
.token-table-container {
  width: 100%;
  overflow-x: auto;
}

.token-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.token-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-card-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.token-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.token-table tr:last-child td {
  border-bottom: none;
}

.token-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(153, 69, 255, 0.2);
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.token-name-group {
  display: flex;
  flex-direction: column;
}

.token-sym {
  font-weight: 700;
}

.token-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-pill {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
}

.status-pill.delegated {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.revoked {
  background: rgba(16, 185, 129, 0.15);
  color: var(--text-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-revoke-single {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-revoke-single:hover:not(:disabled) {
  background: var(--warning-amber);
  color: var(--warning-dark-text);
}

.btn-revoke-single:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Drawer Info Grid (SOL & Rent) */
.drawer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.drawer-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-info-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.drawer-info-item .val {
  font-size: 0.95rem;
  font-weight: 600;
}

.text-success {
  color: var(--text-emerald);
}
.text-warning {
  color: var(--warning-amber);
}

/* Immediate Actions Warning Box (Exact Screenshot Match) */
.warning-action-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.warning-box-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.warning-triangle-icon {
  width: 32px;
  height: 32px;
  color: var(--warning-amber);
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-triangle-icon svg {
  width: 28px;
  height: 28px;
}

.warning-box-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.warning-subtext {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.warning-box-right {
  flex-shrink: 0;
}

.btn-revoke-all {
  background: var(--warning-amber);
  color: var(--warning-dark-text);
  font-weight: 800;
  font-size: 0.98rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: all 0.25s ease;
}

.btn-revoke-all:hover {
  background: var(--warning-amber-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-amber);
}

.icon-shield {
  width: 18px;
  height: 18px;
}

/* Safe State Box */
.safe-status-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 14px;
}

.safe-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--text-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safe-icon svg {
  width: 22px;
  height: 22px;
}

.safe-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-emerald);
}

.safe-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* Buttons General */
.btn {
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.btn-connect {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 0.88rem;
}

.btn-connect:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--warning-amber) 0%, var(--accent-purple) 100%);
  color: #18181b;
  font-weight: 700;
}

.btn-block {
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-shield-icon {
  font-size: 1.4rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-summary-box {
  background: #1d1d23;
  border: 1px solid var(--border-card-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.modal-summary-box .label {
  color: var(--text-muted);
}

.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning-amber) 0%, var(--text-emerald) 100%);
  transition: width 0.3s ease;
}

.modal-logs-box {
  background: #141418;
  border: 1px solid var(--border-card-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-row {
  display: flex;
  gap: 6px;
  line-height: 1.4;
}

.log-row.info { color: #38bdf8; }
.log-row.success { color: var(--text-emerald); }
.log-row.error { color: #ef4444; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--warning-amber);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}

.toast.success {
  border-left-color: var(--text-emerald);
}

.toast.error {
  border-left-color: #ef4444;
}

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

/* Empty / Loading / Error States */
.empty-state-box {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

.empty-icon-wrap svg {
  width: 32px;
  height: 32px;
}

.empty-state-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.empty-state-box p {
  font-size: 0.92rem;
  max-width: 480px;
  margin: 0 auto;
}

.loading-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--warning-amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.error-state-box {
  text-align: center;
  padding: 3rem 2rem;
  color: #ef4444;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Network Selector */
.network-select-wrapper {
  position: relative;
}

.network-select {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 6px 28px 6px 10px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.network-select:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Scan Mode Connected */
.scan-mode-badge.connected {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--text-emerald);
}

/* Delegate Link */
.delegate-link {
  color: var(--warning-amber);
  text-decoration: none;
  transition: color 0.2s;
}

.delegate-link:hover {
  color: #fbbf24;
  text-decoration: underline;
}

/* Token Symbol Link */
.token-sym {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
}

.token-sym:hover {
  text-decoration: underline;
}

/* Explorer Link */
.explorer-link {
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Status Pill Safe */
.status-pill.safe {
  background: rgba(16, 185, 129, 0.12);
  color: var(--text-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  position: relative;
  z-index: 10;
}

.site-footer strong {
  color: var(--text-secondary);
}

.site-footer .sep {
  margin: 0 8px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Advanced Settings & Custom RPC */
.advanced-settings-wrapper {
  margin-top: 1.25rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.btn-advanced-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  user-select: none;
}

.btn-advanced-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.btn-advanced-toggle.active {
  color: var(--text-primary);
}

.btn-advanced-toggle.active .gear-icon {
  transform: rotate(45deg);
}

.gear-icon {
  transition: transform 0.3s ease;
}

.toggle-arrow {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 2px;
}

.rpc-settings-panel {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rpc-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rpc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.rpc-input-wrapper {
  position: relative;
}

.rpc-url-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.rpc-url-input:focus {
  border-color: rgba(20, 241, 149, 0.4);
  box-shadow: 0 0 0 2px rgba(20, 241, 149, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.rpc-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  .nav-container {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .brand {
    justify-content: space-between;
  }
  .nav-actions {
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }
  .scanner-header {
    flex-direction: column;
    gap: 8px;
  }
  .scanner-form {
    flex-direction: column;
  }
  .warning-action-box {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-revoke-all {
    justify-content: center;
    width: 100%;
  }
  .portfolio-item-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .row-right {
    width: 100%;
    justify-content: space-between;
  }
  .token-table th,
  .token-table td {
    padding: 8px 6px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .main-content {
    padding: 1rem 1rem 3rem;
  }
  .scanner-card {
    padding: 1rem;
  }
}

/* ---- Delegate All Button ---- */
.btn-delegate-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-delegate-all:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-delegate-all:active {
  transform: translateY(0);
}
.btn-delegate-all svg {
  stroke: currentColor;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Wallet Selector Dialog ---- */
.wallet-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 1rem;
}
.wallet-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}
.wallet-option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.wallet-option-btn:active {
  transform: translateY(0);
}
.wallet-option-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Contract Claim Button ---- */
.btn-claim-contract {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #059669, #0ea5e9);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-claim-contract:hover {
  background: linear-gradient(135deg, #047857, #0284c7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}
.btn-claim-contract:active {
  transform: translateY(0);
}

/* ---- Rent Claim Button ---- */
.btn-claim-rent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-claim-rent:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.btn-claim-rent:active {
  transform: translateY(0);
}
.btn-claim-rent:disabled {
  background: #2d2d34;
  color: #52525b;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  border: 1px solid #3f3f46;
}

