/* WhaleWatchr - App Styles */
@import url('../styles/tokens.css');

/* WhaleWatchr color system:
   - Use only these brand variables (or components based on them) for new UI.
   - Do not introduce new hex colors for panels, buttons, or text without updating this palette.
*/
:root {
  --wwr-accent: var(--brand-primary);
  --wwr-link: var(--brand-secondary);
  --wwr-primary: var(--brand-primary);
  --wwr-primary-rgb: var(--brand-primary-rgb);
  --wwr-primary-soft-rgb: var(--brand-secondary-rgb);
  --wwr-bg: var(--wwr-bg-gradient-main, var(--bg-dark));
  --wwr-bg-solid: var(--bg-dark);
  --wwr-surface: var(--wwr-card-bg);
  --wwr-text: var(--text-light);
  --wwr-text-muted: var(--text-muted);
  --wwr-text-low: rgba(var(--text-muted-rgb), 0.65);
  --wwr-border-subtle: rgba(var(--brand-primary-rgb, 0, 188, 242), 0.24);
  --wwr-success: var(--brand-secondary);
  --wwr-warning: color-mix(in srgb, var(--brand-secondary) 80%, var(--text-light) 20%);
  --wwr-error: var(--brand-primary);
  --wwr-overlay: rgba(var(--bg-dark-rgb, 6, 20, 32), 0.94);
  --font-ui: var(--font-body);
  --font-brand: var(--font-heading);
  --font-tech: var(--font-heading);
  --card-surface: var(--wwr-card-bg);
  --card-border: var(--wwr-border-glow);
  --card-shadow: var(--wwr-card-shadow);
  --card-radius: 20px;
  --panel-bg: var(--wwr-card-bg);
  --panel-border: var(--wwr-border-glow);
  --panel-shadow-outer: var(--wwr-panel-shadow-outer);
  --panel-shadow-inner: var(--wwr-panel-shadow-inner);
  --panel-sweep: var(--wwr-panel-gradient);
  --button-gradient: var(--brand-gradient);
  --button-shadow: var(--shadow-glow);
  --button-shadow-hover: 0 0 32px rgba(var(--brand-secondary-rgb, 105, 234, 255), 0.55);
  --glow-outline: rgba(var(--brand-primary-rgb, 0, 188, 242), 0.45);
}

.app-header {
  border-bottom: 1px solid var(--glow-outline);
  height: 72px;
  padding: 0;
  margin-bottom: 36px;
  box-shadow: var(--shadow-shell);
}
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 32px;
}

  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.wwr-brand-header .wwr-logo {
  font-size: 3.2rem;
}

.wwr-brand-header .wwr-wordmark {
  font-size: clamp(2.7rem, 3vw, 3.3rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.04;
  color: var(--primary-400);
  font-family: var(--font-brand);
}

.wwr-brand-header .wwr-slogan,
.wwr-brand-header .wwr-beta {
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  font-family: var(--font-ui);
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.plan-tier-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wwr-text);
}

.plan-usage-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--wwr-accent);
}

.plan-reset-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wwr-text-muted);
}

.plan-usage-indicator.warning .plan-usage-count {
  color: var(--wwr-warning);
}

.plan-usage-indicator.critical .plan-usage-count {
  color: var(--wwr-error);
}


/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

main.container {
  background: var(--wwr-bg);
  border-radius: var(--shell-radius);
  padding: 40px 20px;
  border: 1px solid var(--glow-outline);
  box-shadow: var(--shadow-deep);
}

:where(
  .analysis-input,
  .metrics-section,
  .activity-section,
  .analysis-section,
  .plan-usage-indicator,
  .metric-card,
  .cache-banner,
  .api-badge,
  .tx-limit-banner,
  .entity-autocomplete,
  .modal,
  .empty-state,
  .token-card,
  .tx-card,
  .wwr-alert,
  .usage-banner,
  .wwr-panel,
  .wwr-card
) {
  position: relative;
  background-color: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--panel-shadow-outer), var(--panel-shadow-inner);
  backdrop-filter: blur(8px);
  background-image: var(--panel-sweep);
  margin-bottom: 24px;
  overflow: hidden;
}

:where(
  .analysis-input,
  .metrics-section,
  .activity-section,
  .analysis-section,
  .plan-usage-indicator,
  .metric-card,
  .cache-banner,
  .api-badge,
  .tx-limit-banner,
  .entity-autocomplete,
  .modal,
  .empty-state,
  .token-card,
  .tx-card,
  .wwr-alert,
  .usage-banner,
  .wwr-panel,
  .wwr-card
)::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(var(--brand-primary-rgb, 0, 188, 242), 0.25);
  pointer-events: none;
}

:where(
  .analysis-input,
  .metrics-section,
  .activity-section,
  .analysis-section,
  .plan-usage-indicator,
  .metric-card,
  .cache-banner,
  .api-badge,
  .tx-limit-banner,
  .entity-autocomplete,
  .modal,
  .empty-state,
  .token-card,
  .tx-card,
  .wwr-alert,
  .usage-banner,
  .wwr-panel,
  .wwr-card
)::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(var(--brand-primary-rgb, 0, 188, 242), 0.25), transparent 55%),
    repeating-linear-gradient(135deg, rgba(var(--brand-primary-rgb, 0, 188, 242), 0.08) 0, rgba(var(--brand-primary-rgb, 0, 188, 242), 0.08) 2px, transparent 2px, transparent 18px);
  opacity: 0.35;
  filter: blur(12px);
  pointer-events: none;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--wwr-text);
  font-weight: 500;
  font-size: 0.95rem;
}

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

.analysis-input input,
.analysis-input select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(var(--depth-900-rgb), 0.65);
  border: 1px solid rgba(var(--brand-primary-rgb, 0, 188, 242), 0.22);
  border-radius: 12px;
  color: var(--wwr-text);
  font-size: 1rem;
  min-height: 44px;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.analysis-input input:focus,
.analysis-input select:focus {
  outline: none;
  border-color: rgba(var(--brand-primary-rgb, 0, 188, 242), 0.65);
  background: rgba(var(--brand-primary-rgb, 0, 188, 242), 0.08);
}

.analysis-input select option {
  background: rgba(var(--bg-dark-rgb, 6, 20, 32), 0.92);
  color: var(--wwr-text);
  padding: 8px;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.button-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.button-row .wwr-btn {
  flex: 1;
  min-width: 220px;
  justify-content: center;
}

.header-controls .wwr-btn {
  padding: 0.55rem 1.25rem;
  min-width: auto;
}

.section-controls .wwr-btn,
.filter-buttons .wwr-btn {
  padding: 0.5rem 1rem;
  font-size: var(--font-sm);
  min-width: auto;
}

.modal-footer .wwr-btn {
  width: 100%;
}

.modal-header .wwr-btn {
  padding: 0.35rem 0.9rem;
  min-width: auto;
}

.loader-overlay .wwr-btn,
.empty-state .wwr-btn {
  width: 100%;
}

.warning-icon {
  font-size: 1.2rem;
}

.banner-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* Metrics Section */
.metrics-section {
  margin-bottom: 30px;
  padding: 30px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.cache-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: rgba(var(--brand-primary-rgb, 0, 188, 242), 0.08);
  border: 1px solid var(--border-glow);
  border-left: 3px solid var(--primary-300);
  border-radius: 24px;
  color: var(--wwr-text);
  box-shadow: var(--panel-shadow-outer);
}
.usage-banner {
  margin-top: 12px;
  margin-bottom: 0;
  width: 100%;
  padding: 10px 14px;
}

.usage-banner .banner-content span {
  font-size: 0.82rem;
}

.cache-banner .banner-content strong {
  display: block;
  font-size: 0.95rem;
  color: var(--wwr-text);
}

.cache-banner .banner-content span {
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
}

.cache-banner .hint-note {
  display: block;
  font-size: 0.8rem;
  color: var(--wwr-text-muted);
  margin-top: 2px;
}

.metric-icon {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-content {
  flex: 1;
  text-align: center;
}

.metric-label {
  font-size: 1.1rem;
  color: var(--wwr-text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--wwr-text);
}

/* Activity Section */
.activity-section {
  padding: 30px;
  margin-bottom: 30px;
}

.activity-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--wwr-text);
}

.activity-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-bar {
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  gap: 12px;
  align-items: center;
}

.activity-label {
  font-size: 0.9rem;
  color: var(--wwr-text-muted);
}

.activity-progress {
  height: 8px;
  background: var(--surface-panel);
  border-radius: 4px;
  border: 1px solid var(--wwr-border-subtle);
  overflow: hidden;
}

.activity-progress-fill {
  height: 100%;
  background: var(--primary-500);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.activity-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wwr-text);
  text-align: right;
}

/* Analysis Sections */
.analysis-section {
  padding: 30px;
  margin-bottom: 30px;
}

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

.section-header h2 {
  font-size: 1.5rem;
  color: var(--wwr-text);
}

.section-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  color: var(--wwr-text-mid);
}

.filter-btn.active {
  background-image: var(--brand-gradient);
  background-color: var(--brand-primary);
  color: var(--bg-dark);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
  width: 100%;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  background: rgba(var(--accent-rgb), 0.05);
  border-bottom: 2px solid var(--wwr-border);
}

.data-table th {
  padding: 12px;
  text-align: left;
  color: var(--wwr-text);
  font-weight: 600;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  color: var(--wwr-text-muted);
}

.data-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.05);
}

/* Transaction History table intentionally mirrors Token Portfolio spacing */
.tx-table td {
  padding: 8px 12px;
  line-height: 1.35;
  vertical-align: middle;
  white-space: nowrap;
}

.tx-table td .analyze-address,
.tx-table td .tx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Threshold Control */
.threshold-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hidden {
  display: none !important;
}

.app-footer {
  width: 100%;
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 18px;
  border-top: 1px solid var(--glow-outline);
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 30px;
  background: linear-gradient(120deg, rgba(var(--bg-dark-rgb, 6, 20, 32), 0.95), rgba(var(--bg-dark-rgb, 6, 20, 32), 0.9));
}

.app-footer-changelog-link {
  background: none;
  border: none;
  color: var(--wwr-link);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
  margin-left: 4px;
  text-decoration: underline;
}

.app-footer-changelog-link:hover {
  color: var(--wwr-accent);
}

  max-height: 80vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--wwr-border-subtle);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--wwr-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

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

.modal-content {
  padding: 20px 24px;
  overflow-y: auto;
  color: var(--wwr-text);
}

.modal-content ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--wwr-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--wwr-text-muted);
}


@media (max-width: 640px) {
  .app-footer {
    justify-content: center;
    text-align: center;
  }

  .modal {
    width: calc(100% - 24px);
  }
}

.threshold-control label {
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
}

.threshold-control input {
  width: 160px; /* Increased from 100px for large numbers (e.g., 10000000) */
  padding: 6px 12px;
  background: var(--wwr-bg);
  border: 1px solid var(--wwr-border);
  border-radius: 6px;
  color: var(--wwr-text);
  font-size: 0.85rem;
  font-family: var(--font-tech);
}

/* Filter Select Helpers */
.filter-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-select label {
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
}

.filter-select select {
  padding: 8px 12px;
  background: var(--wwr-bg);
  border: 1px solid var(--wwr-border);
  border-radius: 6px;
  color: var(--wwr-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select select:focus {
  outline: none;
  border-color: var(--primary-400);
  background: rgba(var(--primary-500-rgb), 0.06);
}

/* Remove spinner arrows from number input (Chrome, Safari, Edge) */
.threshold-control input[type="number"]::-webkit-inner-spin-button,
.threshold-control input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove spinner arrows from number input (Firefox) */
.threshold-control input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Entity Filter */
.entity-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entity-filter label {
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
}

.entity-filter select,
#txTimeframeFilter {
  padding: 6px 12px;
  background: var(--wwr-bg);
  border: 1px solid var(--wwr-border);
  border-radius: 6px;
  color: var(--wwr-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.entity-filter select:hover,
#txTimeframeFilter:hover {
  border-color: var(--wwr-primary);
}

.entity-filter select:focus,
#txTimeframeFilter:focus {
  outline: none;
  border-color: var(--primary-400);
  background: rgba(var(--primary-500-rgb), 0.06);
}

.entity-filter select option,
#txTimeframeFilter option {
  background: var(--wwr-surface);
  color: var(--wwr-text);
  padding: 8px;
  font-size: 0.9rem;
}

/* Toggle Control */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-control label {
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
}

.toggle-control input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Loader Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--wwr-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(var(--accent-rgb), 0.15);
  border-top-color: var(--wwr-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loader-stage {
  font-size: 1.1rem;
  color: var(--wwr-text);
  margin-bottom: 16px;
  font-weight: 500;
}

.loader-progress-container {
  width: 300px;
  height: 8px;
  background: var(--surface-panel);
  border-radius: 4px;
  border: 1px solid var(--wwr-border-subtle);
  overflow: hidden;
  margin: 0 auto 12px;
}

.loader-progress-bar {
  height: 100%;
  background: var(--primary-500);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

.loader-eta {
  font-size: 0.9rem;
  color: var(--wwr-text-muted);
  margin-bottom: 20px;
}


/* Entity Autocomplete */
.entity-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.entity-autocomplete.show {
  display: block;
}

/* P0.5 Mobile Basics: responsive stacking, touch targets, and scroll-safe tables */
@media (max-width: 768px) {
  body.app-page {
    overflow-x: hidden;
  }

  .container {
    padding: 0 16px;
  }

  .app-header {
    padding: 16px 0;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-controls .wwr-btn {
    width: 100%;
    justify-content: center;
  }

  .analysis-input,
  .analysis-section,
  .activity-section,
  .metrics-section {
    padding: 20px;
  }

  .button-row {
    flex-direction: column;
    width: 100%;
  }

  .button-row .wwr-btn {
    width: 100%;
    justify-content: center;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .section-controls {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .section-controls > * {
    width: 100%;
  }

  .filter-buttons {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-btn {
    flex: 1 1 48%;
  }

  .entity-filter,
  .threshold-control,
  .filter-select {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .entity-filter select,
  #txTimeframeFilter,
  .threshold-control input,
  .filter-select select,
  .analysis-input select,
  .analysis-input input {
    width: 100%;
    font-size: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .activity-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .activity-value {
    text-align: left;
  }

  .warning-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .table-wrapper {
    margin: 0 -16px 16px;
    padding: 0 16px 12px;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap;
  }

  .data-table thead th {
    position: sticky;
    top: 0;
    background: var(--wwr-surface);
    z-index: 1;
  }

  /* Landing page adjustments */
  body.landing-page {
    overflow-x: hidden;
  }

  body.landing-page .container {
    padding: 0 16px;
  }

  body.landing-page .hero {
    flex-direction: column;
    padding: 30px 0 40px;
  }

  body.landing-page .signup-section {
    width: 100%;
    margin: 20px auto;
    padding: 30px 20px;
  }

  body.landing-page .email-form {
    width: 100%;
  }

  /* Login page adjustments */
  body.login-page {
    padding: 30px 16px;
  }

  body.login-page .login-box {
    padding: 30px 20px;
    width: 100%;
  }

  body.login-page input[type="email"],
  body.login-page button,
  body.login-page .form-group,
  body.login-page .form-section {
    width: 100%;
  }
}

  /* Center the entire login box header */
  body.login-page .login-box {
    text-align: center;
  }

  body.login-page .form-section {
    margin-top: 30px;
  }

  body.login-page .form-heading {
    margin-bottom: 24px;
    text-align: center;
  }

  body.login-page .form-heading h1 {
    font-size: clamp(1.6rem, 4vw, 1.9rem);
    letter-spacing: 0.4px;
  }

  body.login-page .form-subtitle {
    font-size: 0.95rem;
    color: var(--wwr-text-muted);
  }

  body.login-page .login-info-line {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--wwr-text-muted);
    text-align: center;
  }

.entity-autocomplete:empty {
  display: none;
}

.entity-suggestion {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  transition: all 0.2s ease;
}

.entity-suggestion:last-child {
  border-bottom: none;
}

.entity-suggestion:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.entity-suggestion-name {
  font-weight: 600;
  color: var(--wwr-text);
  margin-bottom: 4px;
}

.entity-suggestion-address {
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
}

/* API & Info Badges */
.api-badge,
.info-badge {
  padding: 8px 12px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid var(--wwr-border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--wwr-text-muted);
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  .wwr-btn {
    width: 100%;
    justify-content: center;
  }

  .activity-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .activity-value {
    text-align: left;
  }

  .section-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-buttons {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
  }
}

/* Transaction Badges (IN/OUT) */
.tx-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tx-badge.tx-in {
  background: rgba(var(--wwr-primary-rgb), 0.12);
  color: var(--wwr-success);
  border: 1px solid rgba(var(--wwr-primary-rgb), 0.3);
}

.tx-badge.tx-out {
  background: rgba(var(--wwr-primary-soft-rgb), 0.12);
  color: var(--wwr-warning);
  border: 1px solid rgba(var(--wwr-primary-soft-rgb), 0.3);
}

/* Hash Link Styling */
.hash-link {
  color: var(--wwr-link);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.hash-link:hover {
  color: var(--wwr-primary);
  text-decoration: underline;
}

/* Global Link Styling */
a {
  color: var(--wwr-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--wwr-primary);
  text-decoration: underline;
}

/* Transaction Limit Warning Banner */
.tx-limit-banner {
  padding: 16px 20px;
  border-radius: var(--card-radius);
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(var(--brand-primary-rgb, 0, 188, 242), 0.04);
  border: 1px solid rgba(var(--brand-primary-rgb, 0, 188, 242), 0.28);
  box-shadow: var(--panel-shadow-outer), var(--panel-shadow-inner);
}

.tx-limit-banner .icon {
  font-size: 1.5rem;
}

.tx-limit-banner .message {
  flex: 1;
  color: var(--wwr-text);
  font-weight: 500;
}

.tx-limit-banner .details {
  color: var(--wwr-text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.empty-state {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: var(--card-radius);
  border: 1px dashed rgba(var(--wwr-text-mid-rgb), 0.3);
  color: var(--wwr-text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.token-no-price {
  color: var(--wwr-text-muted);
  font-style: italic;
}

.debug-overlay {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 280px;
  background: rgba(var(--wwr-bg-body-rgb), 0.92);
  border: 1px solid var(--wwr-border);
  border-radius: 12px;
  box-shadow: none;
  z-index: 9999;
  color: var(--wwr-text-high);
  font-size: 0.85rem;
}

.debug-overlay.collapsed .debug-overlay-body {
  display: none;
}

.debug-overlay-toggle {
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  padding: 8px 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.debug-overlay-body {
  padding: 10px 12px 12px;
  max-height: 320px;
  overflow-y: auto;
}

.debug-overlay-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.debug-overlay-pre {
  margin-top: 8px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--wwr-text-mid);
}

@media (max-width: 640px) {
  .debug-overlay {
    width: calc(100% - 32px);
    right: 16px;
    left: 16px;
  }
}

/* Entity Toggle */
.entity-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--wwr-surface);
  border: 1px solid var(--wwr-border);
  border-radius: 8px;
}

.entity-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}

.entity-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Entity/Address Display Toggle */
/* Default: Show addresses, hide entities */
.entity-only {
  display: none;
}

.address-only {
  display: inline;
}

/* When showing entities: Show entities, hide addresses */
body.show-entities .entity-only {
  display: inline;
}

body.show-entities .address-only {
  display: none;
}

.entity-toggle span {
  color: var(--wwr-text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Base WhaleWatchR alert */
.wwr-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  margin-top: 16px;
  border-radius: var(--card-radius);
  color: var(--wwr-text-high);
  font-size: 14px;
}

/* Icon bubble */
.wwr-alert__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--wwr-bg-body-rgb), 0.9);
  border: 1px solid rgba(var(--primary-500-rgb), 0.4);
  font-size: 18px;
}

/* Text block */
.wwr-alert__body {
  flex: 1;
}

.wwr-alert__title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.wwr-alert__message {
  opacity: 0.9;
}

.wwr-alert__hint {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.8;
}

/* Footer content (retry buttons, countdown labels, etc.) */
.wwr-alert__footer {
  margin-top: 10px;
  font-size: 13px;
}

/* Close button */
.wwr-alert__close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--wwr-text-low);
  font-size: 18px;
  cursor: pointer;
}

.wwr-alert__close:hover {
  color: var(--wwr-text-high);
}

/* Variants only differ by accent color */
.wwr-alert--warning {
  color: var(--wwr-warning);
}

.wwr-alert--error {
  color: var(--wwr-error);
}

/* FAQ layout */
.wwr-faq-main {
  padding: clamp(48px, 6vw, 96px) 0 clamp(80px, 8vw, 140px);
}

.faq-shell {
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.faq-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.faq-hero h1 {
  margin: 0;
}

.faq-hero .wwr-hero-lede {
  margin: 0;
  color: var(--wwr-text-mid);
}

.faq-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border-radius: 20px;
  border: 1px solid var(--wwr-border-glow);
  background: rgba(var(--bg-dark-rgb, 6, 20, 32), 0.82);
  box-shadow: var(--wwr-panel-shadow-outer), inset 0 0 18px rgba(var(--brand-primary-rgb, 0, 188, 242), 0.08);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  margin: 0;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--wwr-text);
  transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.25rem;
  color: var(--wwr-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.faq-item[open] summary {
  color: var(--wwr-primary);
}

.faq-item[open] summary::after {
  content: '–';
}

.faq-item p {
  margin: 0;
  padding: 0 1.5rem 1.5rem;
  color: var(--wwr-text-mid);
  font-size: 1rem;
  border-top: 1px solid rgba(var(--brand-primary-rgb, 0, 188, 242), 0.2);
}

.faq-section a {
  color: var(--wwr-primary);
  font-weight: 600;
  text-decoration: none;
}

.faq-section a:hover,
.faq-section a:focus-visible {
  color: var(--wwr-primary-soft);
  text-decoration: underline;
}
