/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-user-select: none; user-select: none; }
input, textarea, code, .log-link, .result-item a, .copy-address code { -webkit-user-select: text; user-select: text; }

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0d1117;
  --bg-card: rgba(15, 20, 30, 0.7);
  --border-card: rgba(0, 245, 255, 0.12);
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent-cyan: #00f5ff;
  --accent-green: #00ff88;
  --accent-orange: #ff9500;
  --accent-red: #ff4757;
  --accent-blue: #58a6ff;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 300ms ease;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(145deg, var(--bg-primary) 0%, var(--bg-secondary) 100%) fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  zoom: 0.8;
}

/* ─── App Loading (hide UI until session check completes) ─── */
body.app-loading .header,
body.app-loading .steps-bar,
body.app-loading .content {
  opacity: 0;
  pointer-events: none;
}
body:not(.app-loading) .header,
body:not(.app-loading) .steps-bar,
body:not(.app-loading) .content {
  opacity: 1;
  transition: opacity 0.25s ease;
}

/* ─── Header ─── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-card);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 20px; flex: 1; }

.header-center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.donation-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 200, 0.2);
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.08), rgba(0, 180, 255, 0.06));
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  outline: none;
}
.donation-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.15), rgba(0, 180, 255, 0.12));
  border-color: rgba(0, 255, 200, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 255, 200, 0.15);
}
.donation-btn:active {
  transform: translateY(0);
}
.donation-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.donation-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.by-label {
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.by-label a {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s;
}
.by-label a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

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

.logo-text {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 300;
}

/* ─── Step Indicator ─── */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 40px;
  gap: 0;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  transition: var(--transition);
  cursor: default;
}

.step-indicator.active .step-num {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.4);
}

.step-indicator.active .step-label { color: var(--text-primary); }

.step-indicator.done .step-num {
  background: var(--accent-green);
  color: var(--bg-primary);
}

.step-indicator.done .step-label { color: var(--accent-green); }

.step-indicator.done {
  cursor: pointer;
}

.step-indicator.done:hover .step-num {
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.step-indicator.done:hover .step-label {
  color: var(--text-primary);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--text-muted);
  color: var(--bg-primary);
  transition: var(--transition);
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--text-muted);
  margin: 0 4px;
}

/* ─── Content ─── */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.4s ease; }

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

/* ─── Glass Card ─── */
.card.glass {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(20px);
}

.card h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-desc { color: var(--text-secondary); margin-bottom: 24px; }

/* ─── Inputs ─── */
.input-group { margin-bottom: 20px; }

.input-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.1);
}

.input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.input-wrapper input::placeholder { color: var(--text-muted); font-size: 14px; }

/* ─── Eye Toggle (hold to reveal) ─── */
.eye-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.eye-toggle:hover { color: var(--text-secondary); }
.eye-toggle:active { color: var(--accent-cyan); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00c8ff);
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.btn-disabled, .btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-back {
  background: none;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  padding: 10px 20px;
}

.btn-back:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

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

.step-actions-vertical {
  flex-direction: column;
  margin-top: 16px;
}

.step-actions-vertical .btn-back {
  align-self: flex-start;
}

.btn-large {
  padding: 16px 40px;
  font-size: 17px;
  width: 100%;
  margin-top: 20px;
}

.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Info/Error Boxes ─── */
.info-box {
  padding: 12px 16px;
  background: rgba(0, 245, 255, 0.06);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.field-error {
  font-size: 12px;
  font-weight: 400;
  color: var(--accent-red);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.field-error.visible {
  opacity: 1;
  pointer-events: auto;
}

.error-box {
  padding: 12px 16px;
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--accent-red);
  margin-bottom: 16px;
  opacity: 0;
  max-height: 0;
  padding: 0 16px;
  margin-bottom: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}
.error-box.visible {
  opacity: 1;
  max-height: 80px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.hidden { display: none !important; }

/* ─── Security Notice ─── */
.security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  justify-content: center;
}

/* ─── FAQ Section ─── */
.faq-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: border-color 0.25s;
}
.faq-item:hover {
  border-color: rgba(0, 255, 200, 0.2);
}
.faq-item.open {
  border-color: rgba(0, 255, 200, 0.25);
  background: rgba(0, 255, 200, 0.03);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
  outline: none;
}
.faq-question:hover {
  color: var(--accent-cyan);
}

.faq-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 20px 16px;
}

.faq-answer p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}
.faq-answer p:last-child {
  margin-bottom: 0;
}
.faq-answer strong {
  color: var(--accent-cyan);
  font-weight: 600;
}
.faq-collections {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -4px;
  padding-left: 8px;
}
.faq-collections span {
  color: var(--accent-green);
  font-style: normal;
  font-weight: 500;
}

.discord-link {
  color: #5865F2;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.discord-link:hover {
  color: #7289DA;
  text-decoration: underline;
}
.faq-coming-soon {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
  padding-left: 8px;
}

.scan-disclaimer {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}

/* ─── Scan Animation ─── */
.scan-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
}

.scan-ring {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(0, 245, 255, 0.15);
  border-top: 3px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.scan-text {
  color: var(--text-secondary);
  font-size: 15px;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Scan Stats ─── */
.scan-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card.eligible { border-color: rgba(0, 255, 136, 0.2); }
.stat-card.free { border-color: rgba(88, 166, 255, 0.2); }
.stat-card.non-eligible { border-color: rgba(255, 149, 0, 0.2); }
.stat-card.problematic { border-color: rgba(255, 71, 87, 0.2); }

.stat-num {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card.eligible .stat-num { color: var(--accent-green); }
.stat-card.free .stat-num { color: var(--accent-blue); }
.stat-card.non-eligible .stat-num { color: var(--accent-orange); }
.stat-card.problematic .stat-num { color: var(--accent-red); }

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Scan Choice Panel ─── */
.scan-choice {
  margin: 24px 0;
  text-align: center;
}

.choice-message {
  font-size: 14px;
  color: var(--accent-orange);
  margin-bottom: 16px;
  font-weight: 500;
}

.choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.choice-card:hover:not(:disabled) {
  transform: translateY(-2px);
}

.choice-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.choice-continue:hover:not(:disabled) {
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.05);
}

.choice-wait:hover:not(:disabled) {
  border-color: rgba(255, 149, 0, 0.4);
  background: rgba(255, 149, 0, 0.05);
}

.choice-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.choice-continue .choice-title { color: var(--accent-green); }
.choice-wait .choice-title { color: var(--accent-orange); }

.choice-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Wait Confirmation ─── */
.scan-wait-confirm {
  margin: 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 255, 136, 0.2);
  background: rgba(0, 255, 136, 0.05);
}

.wait-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.wait-message strong {
  display: block;
  font-size: 15px;
  color: var(--accent-green);
  margin-bottom: 6px;
}

.wait-message p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ─── NFT Grid ─── */
.nft-section { margin-bottom: 24px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
}

.select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.select-all input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 16px;
  height: 16px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.badge-blue { background: rgba(88, 166, 255, 0.15); color: var(--accent-blue); }
.badge-orange { background: rgba(255, 149, 0, 0.15); color: var(--accent-orange); }
.badge-red { background: rgba(255, 71, 87, 0.15); color: var(--accent-red); }
.badge-purple { background: rgba(160, 100, 255, 0.15); color: #a064ff; }
.badge-cyan { background: rgba(0, 245, 255, 0.15); color: var(--accent-cyan); }

.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.nft-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition);
  cursor: pointer;
}

.nft-card:hover { border-color: var(--accent-cyan); }
.nft-card.selected { border-color: var(--accent-cyan); background: rgba(0, 245, 255, 0.04); }
.nft-card.disabled { opacity: 0.5; cursor: default; }
.nft-card.disabled:hover { border-color: rgba(255, 255, 255, 0.06); }
.nft-card.listed-marketplace { opacity: 0.45; border-color: rgba(255, 149, 0, 0.15); }
.nft-card.listed-marketplace:hover { border-color: rgba(255, 149, 0, 0.3); }
.nft-card.listed-marketplace .nft-type { color: var(--accent-orange); }

.nft-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  object-fit: cover;
  flex-shrink: 0;
}

/* ─── DeFi Thumb with protocol badge overlay ─── */
.defi-thumb-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.defi-thumb-wrap .nft-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  overflow: hidden;
}

.defi-protocol-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid var(--bg-primary);
  background: #1a1a2e;
  object-fit: contain;
  padding: 0;
  overflow: hidden;
}

.defi-protocol-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  color: #a064ff;
  letter-spacing: -0.3px;
}

.defi-asset-tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 400;
}

.overlap-hint {
  display: block;
  font-size: 11px;
  color: #a064ff;
  font-style: italic;
  opacity: 0.8;
}

.nft-card.defi-overlap { cursor: default; opacity: 0.6; }
.nft-card.defi-overlap.selected { border-color: var(--accent-cyan); background: rgba(0, 245, 255, 0.04); }
.nft-card.defi-overlap:hover { border-color: var(--accent-cyan); }

.nft-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nft-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nft-mint {
  align-self: flex-start;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  cursor: pointer;
}
.nft-mint:hover {
  color: var(--accent-cyan);
}

.nft-type {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  align-self: flex-start;
}

.nft-check {
  accent-color: var(--accent-cyan);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.selection-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#selection-count { color: var(--text-secondary); font-size: 14px; }

/* ─── Fund / Balance ─── */
.fund-box {
  padding: 20px;
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid rgba(0, 245, 255, 0.12);
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.fund-instruction {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.fund-instruction strong { color: var(--accent-cyan); }

.copy-address {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.copy-address code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
  word-break: break-all;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 10px;
  transition: all var(--transition);
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.cost-breakdown {
  margin-bottom: 16px;
}

.cost-breakdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.cost-breakdown th, .cost-breakdown td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cost-breakdown th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cost-breakdown td { color: var(--text-secondary); }
.cost-breakdown th:nth-child(2), .cost-breakdown td:nth-child(2) { text-align: center; }
.cost-breakdown th:last-child { text-align: right; }
.cost-breakdown td:last-child { text-align: right; font-family: var(--font-mono); color: var(--text-primary); }

.cost-breakdown .cat-header td {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 6px 4px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
  text-align: left;
}

.balance-check {
  margin-top: 20px;
  text-align: center;
}

.balance-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.balance-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.balance-info {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.balance-info span { font-family: var(--font-mono); }

/* ─── Progress ─── */
.progress-container { margin-bottom: 24px; }

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  display: block;
}

/* ─── Rescue Log ─── */
.rescue-log {
  max-height: 420px;
  overflow-y: auto;
  font-size: 13px;
  padding: 4px 0;
  scrollbar-width: none;           /* Firefox */
  -ms-overflow-style: none;        /* IE/Edge */
}
.rescue-log::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.log-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 0 4px 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  animation: slideIn 0.3s ease;
  transition: background var(--transition), opacity var(--transition);
}

.log-entry.pending {
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--text-muted);
}
.log-entry.success {
  background: rgba(0, 255, 136, 0.04);
  border-left: 2px solid var(--accent-green);
}
.log-entry.failed {
  background: rgba(255, 71, 87, 0.04);
  border-left: 2px solid var(--accent-red);
}
.log-entry.info {
  background: rgba(0, 245, 255, 0.04);
  border-left: 2px solid var(--accent-cyan);
}

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

.log-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.log-entry.pending .log-icon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  animation: pulse 1.5s ease infinite;
}
.log-entry.success .log-icon {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
}
.log-entry.failed .log-icon {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-red);
}
.log-entry.info .log-icon {
  background: rgba(0, 245, 255, 0.15);
  color: var(--accent-cyan);
}

.log-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-step {
  color: var(--text-muted);
  font-size: 11px;
}

.log-entry.success .log-name { color: var(--accent-green); }
.log-entry.failed .log-name { color: var(--accent-red); }
.log-entry.pending .log-name { color: var(--text-secondary); }

.log-link {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-blue);
  text-decoration: none;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.08);
  transition: background var(--transition);
}
.log-link:hover {
  background: rgba(88, 166, 255, 0.15);
  text-decoration: none;
}

/* ─── Results ─── */
.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.results-section { margin-bottom: 20px; }

.results-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 500;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.result-item .result-name { font-weight: 500; }

.result-item a {
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
}

.result-item a:hover { text-decoration: underline; }

.result-subcategory {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 14px 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.result-subcategory:first-child { margin-top: 0; }

.result-subgroup {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted, #888);
  margin: 10px 0 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.result-subgroup:first-of-type { margin-top: 6px; }

.results-message {
  text-align: center;
  padding: 30px 0;
}

.results-message .success-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.results-message .partial-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-orange);
  margin-bottom: 8px;
}

.results-message .fail-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-red);
  margin-bottom: 8px;
}

.results-message .success-sub {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ─── Toasts ─── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  max-width: 360px;
}

.toast.success {
  background: rgba(0, 20, 10, 0.95);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
}

.toast.error {
  background: rgba(30, 5, 8, 0.95);
  border: 1px solid rgba(255, 71, 87, 0.2);
  color: var(--accent-red);
}

.toast.info {
  background: rgba(0, 15, 20, 0.95);
  border: 1px solid rgba(0, 245, 255, 0.15);
  color: var(--accent-cyan);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

html {
  overflow-x: hidden;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  html { background-color: #0d1117; }
  body { zoom: 1; }

  .header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    justify-content: center;
  }
  .header-left { flex: unset; gap: 8px; }
  .header-left .tagline { display: none; }
  .header-center { flex: unset; order: 3; width: 100%; justify-content: center; }
  .header-right { flex: unset; }
  .donation-address { overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
  .donation-btn { padding: 8px 14px; gap: 8px; }
  .donation-label { font-size: 12px; }
  .donation-address { font-size: 11px; }
  .by-label { font-size: 13px; }
  .by-label a { font-size: 14px; }

  .steps-bar {
    flex-wrap: wrap;
    gap: 2px;
    padding: 12px 8px;
    justify-content: center;
  }
  .step-indicator { padding: 4px 6px; gap: 4px; }
  .step-num { width: 24px; height: 24px; font-size: 11px; }
  .step-label { font-size: 10px; }
  .step-line { width: 12px; margin: 0 2px; }

  .content { padding: 12px; }
  .card.glass { padding: 16px; }

  .nft-grid { grid-template-columns: 1fr; }
  .scan-stats { grid-template-columns: repeat(2, 1fr); }

  .selection-summary { flex-direction: column; gap: 12px; }

  .faq-question { padding: 14px 16px; font-size: 14px; }
  .faq-answer { padding: 0 16px; }
  .faq-item.open .faq-answer { padding: 0 16px 14px; }

  /* Funding page mobile */
  .fund-box { padding: 14px; margin: 14px 0; }
  .fund-instruction { font-size: 13px; line-height: 1.6; }
  .copy-address { flex-direction: column; gap: 10px; padding: 10px; }
  .copy-address code { font-size: 11px; text-align: center; }
  .cost-breakdown table { font-size: 11px; }
  .cost-breakdown th, .cost-breakdown td { padding: 6px 6px; }
  .balance-info { font-size: 13px; }
  .step-actions-vertical { gap: 10px; }
  .step-actions-vertical .btn-back { align-self: center; }

  /* Results page mobile */
  .results-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .result-item { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; font-size: 12px; }
  .result-item a { font-size: 10px; word-break: break-all; }
  .results-message .success-text,
  .results-message .partial-text,
  .results-message .fail-text { font-size: 18px; }
  .results-message .success-sub { font-size: 13px; }

  /* Rescue log mobile */
  .rescue-log { font-size: 11px; max-height: 50vh; }
}

@media (max-width: 480px) {
  .scan-stats { grid-template-columns: 1fr; }
  .choice-options { grid-template-columns: 1fr; }
  .donation-address { max-width: 140px; }
  .step-label { font-size: 9px; }
  .step-indicator { padding: 4px 4px; gap: 3px; }
  .step-line { width: 8px; }
}

/* ─── Confirm Reset Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 24px;
  max-width: 380px;
  width: 90%;
  text-align: center;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 100px;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-danger {
  background: transparent;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}
