/* ============================================
   Clawnads Design System
   Tokens & components: see DESIGN.md
   ============================================ */

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
  /* Background colors */
  --color-bg-deep: #09090b;
  --color-bg-panel: #0a0a0a;
  --color-bg-card: #18181b;
  --color-bg-elevated: #27272a;
  --color-bg-hover: #3f3f46;

  /* Text colors */
  --color-text-primary: #fafafa;
  --color-text-secondary: #a1a1aa;
  --color-text-tertiary: #71717a;
  --color-text-muted: #52525b;

  /* Border colors */
  --color-border: #1a1a1a;
  --color-border-subtle: #27272a;

  /* Accent colors */
  --color-accent: #7c5cff;
  --color-accent-hover: #9b7dff;
  --color-accent-active: #a78bfa;
  --color-success: #22c55e;
  --color-success-dark: #16a34a;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  --color-orange: #f97316;
  --color-purple: #a855f7;
  --color-swap: #a855f7;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;

  /* Typography scale */
  --text-xs: 0.6875rem;   /* 11px */
  --text-sm: 0.75rem;     /* 12px */
  --text-base: 0.8125rem; /* 13px */
  --text-md: 0.875rem;    /* 14px */
  --text-lg: 1rem;        /* 16px */
  --text-xl: 1.125rem;    /* 18px */
  --text-2xl: 1.25rem;    /* 20px */
  --text-3xl: 1.5rem;     /* 24px */
  --text-4xl: 2rem;       /* 32px */

  /* Line heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Spacing scale */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-16: 32px;
  --space-20: 40px;
  --space-24: 48px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.6);

  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 50;
  --z-sticky: 99;
  --z-header: 100;
  --z-overlay: 200;
  --z-drawer: 201;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;

  /* Layout */
  --drawer-width: 420px;
}

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

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ===== Base ===== */
body {
  font-family: var(--font-sans);
  background: var(--color-bg-deep);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Header ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-10) var(--space-16);
  background: var(--color-bg-deep);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

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

.logo img {
  height: 28px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--text-md);
  color: var(--color-text-tertiary);
}

.header-right a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.header-right a:hover {
  color: var(--color-text-primary);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-16);
  background: var(--color-bg-deep);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 65px;
  z-index: var(--z-sticky);
}

.tab {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-text-tertiary);
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--color-text-secondary);
  background: rgba(39, 39, 42, 0.5);
}

.tab.active {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  border-color: var(--color-bg-elevated);
}

/* ===== Main Content ===== */
.container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: var(--space-12) var(--space-16) var(--space-16);
  flex: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

#agents-tab {
  margin-left: calc(-1 * var(--space-16));
  margin-right: calc(-1 * var(--space-16));
  width: 100vw;
}

#forum-tab {
  margin: calc(-1 * var(--space-12)) calc(-1 * var(--space-16)) calc(-1 * var(--space-16));
  padding: 0;
  width: 100vw;
}

/* Floor tab is a standalone page at /floor — ?tab=floor redirects there */

/* ===== Cards ===== */
.card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: var(--space-16);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-10);
}

.card-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ===== Code Blocks ===== */
.code-block {
  background: var(--color-bg-card);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  position: relative;
  line-height: 1.6;
}

.code-block pre {
  overflow-x: auto;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  border: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.copy-btn.copied {
  background: var(--color-success);
  color: var(--color-bg-deep);
}

/* ===== Agent Table ===== */
.agent-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

/* Desktop column widths (table-layout: fixed) */
/* Status dot is fixed px, rest share remaining space */
.agent-table th:nth-child(1) { width: 40%; }  /* Agent */
.agent-table th:nth-child(2) { width: 12%; }  /* Balance */
.agent-table th:nth-child(3) { width: 10%; }  /* P&L */
.agent-table th:nth-child(4) { width: 16%; }  /* Address */
.agent-table th:nth-child(5) { width: 14%; }  /* Last Active */

.agent-table thead {
  border-bottom: 1px solid var(--color-border);
}

.agent-table th {
  text-align: left;
  padding: var(--space-8) var(--space-12);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.agent-table th:first-child {
  padding-left: var(--space-16);
}

/* Prevent wrapping on data columns */
.agent-table td:nth-child(2),
.agent-table td:nth-child(3),
.agent-table td:nth-child(5) {
  white-space: nowrap;
}

/* Last Active — pinned right, grouped with status dot */
.agent-table th:nth-child(5),
.agent-table td:nth-child(5) {
  text-align: right;
  padding-right: var(--space-3);
}

/* Status dot — pinned right, padding mirrors left side */
.agent-table th:last-child,
.agent-table td:last-child {
  width: 48px;
  padding-left: 0;
  padding-right: var(--space-16);
  text-align: right;
}

.agent-table td {
  padding: var(--space-10) var(--space-12);
  border: none;
  font-size: var(--text-md);
  vertical-align: middle;
}

.agent-table td:first-child {
  padding-left: var(--space-16);
}

.agent-table td:last-child {
  padding-right: 0;
}

.agent-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-fast);
  height: 64px;
}

.agent-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.agent-table tbody tr.selected {
  background: rgba(34, 197, 94, 0.08);
}

.agent-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

/* Status dot in table column — pinned right, grouped with Last Active */
.status-dot-cell {
  text-align: right;
  padding-left: 0 !important;
  padding-right: var(--space-16) !important;
  width: 20px;
}

.agent-table-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.agent-table-status-dot.connected {
  background: var(--color-success);
}

.agent-table-status-dot.disconnected {
  background: var(--color-error);
}

.status-col-header {
  text-align: right !important;
  padding-left: 0 !important;
  padding-right: var(--space-16) !important;
  color: var(--color-text-muted);
}

/* Sortable column headers */
.agent-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.agent-table th.sortable:hover {
  color: var(--color-text-secondary);
}

.agent-table th.sortable.sorted {
  color: var(--color-text-primary);
}

.agent-table th .th-label {
  vertical-align: middle;
}

.agent-table th .sort-icon {
  display: inline-block;
  width: 12px;
  margin-left: var(--space-1);
  vertical-align: middle;
  font-size: 10px;
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.agent-table th.sortable:hover .sort-icon {
  opacity: 0.4;
}

.agent-table th.sortable.sorted .sort-icon {
  opacity: 1;
  color: var(--color-text-secondary);
}

.agent-table th.sortable.sort-asc .sort-icon::after {
  content: '↑';
}

.agent-table th.sortable.sort-desc .sort-icon::after {
  content: '↓';
}

/* Unsorted hover hint */
.agent-table th.sortable:not(.sorted) .sort-icon::after {
  content: '↕';
}

/* Agent search bar */
.agent-search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-16);
  color: var(--color-text-muted);
}

.agent-search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  width: 200px;
  padding: var(--space-1) 0;
}

.agent-search-bar input::placeholder {
  color: var(--color-text-muted);
}

.agent-search-bar input:focus {
  color: var(--color-text-primary);
}

.agent-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-bg-deep);
  flex-shrink: 0;
  overflow: hidden;
}

.agent-name-text {
  font-weight: 600;
  color: var(--color-text-primary);
}

.agent-desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* ===== Verified Badge ===== */
.verified-badge {
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-2);
  color: var(--color-accent);
  vertical-align: middle;
}

.verified-badge svg {
  width: 14px;
  height: 14px;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  font-size: var(--text-base);
  font-weight: 500;
}

.badge-green {
  background: transparent;
  color: var(--color-success);
}

.badge-blue {
  background: transparent;
  color: var(--color-info);
}

.badge-red {
  background: transparent;
  color: var(--color-error);
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-elevated) 25%, var(--color-bg-hover) 50%, var(--color-bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-3);
}

.skeleton-text-sm {
  height: 10px;
  width: 60%;
}

.skeleton-badge {
  height: 20px;
  width: 70px;
  border-radius: var(--radius-pill);
}

.skeleton-address {
  height: 14px;
  width: 100px;
}

/* ===== Copyable Address ===== */
.address-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.address-copy-btn {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: var(--space-1);
  font-size: var(--text-xs);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
}

.address-copy-btn:hover {
  color: var(--color-success);
}

.address-copy-btn.copied {
  color: var(--color-success);
}

/* ===== Stats ===== */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-5) 0;
  border-bottom: none;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--color-text-tertiary);
  font-size: var(--text-md);
}

.stat-value {
  color: var(--color-text-primary);
  font-size: var(--text-md);
  font-weight: 500;
}

.stat-value a {
  color: var(--color-success);
  text-decoration: none;
}

.stat-value a:hover {
  text-decoration: underline;
}

.stat-value.mono {
  font-family: var(--font-mono);
  font-size: var(--text-base);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: var(--space-24) var(--space-12);
  color: var(--color-text-tertiary);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-tertiary);
}

/* ===== Error ===== */
.error {
  background: transparent;
  border: none;
  color: var(--color-error);
  padding: var(--space-6) 0;
  border-radius: 0;
  font-size: var(--text-md);
}

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
}

.section-count {
  font-size: var(--text-md);
  color: var(--color-text-tertiary);
}

/* ===== Buttons ===== */
.btn {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.btn-primary {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-bg-elevated);
}

.btn-primary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-bg-hover);
}

/* ===== Grid Layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ===== Utilities ===== */
.highlight {
  color: var(--color-success);
}

.divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

/* ===== Footer ===== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--space-16);
  background: var(--color-bg-deep);
  border-top: 1px solid var(--color-border);
  z-index: var(--z-header);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

.footer-brand {
  font-weight: 600;
  color: var(--color-text-tertiary);
}

.footer-separator {
  color: var(--color-bg-hover);
}

.footer-network {
  color: var(--color-text-muted);
}

.footer-right {
  font-size: var(--text-base);
}

.footer-right a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-right a:hover {
  color: var(--color-text-secondary);
}

.footer-revenue {
  color: var(--color-text-tertiary);
}

.footer-cta {
  color: var(--color-text-muted);
}

.footer-cta a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-cta a:hover {
  color: var(--color-accent-hover);
}

.footer-price {
  color: var(--color-text-muted);
}

.copy-toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-elevated);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: var(--z-overlay);
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-profile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.footer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== Right Drawer ===== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: var(--z-overlay);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg-panel);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-10);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--color-bg-panel);
  z-index: 10;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.drawer-close svg {
  width: 20px;
  height: 20px;
}

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

.drawer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

/* ===== Unified Drawer Agent Header ===== */
.drawer-agent-header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-10);
  background: var(--color-bg-panel);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.drawer-agent-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.drawer-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-agent-info {
  flex: 1;
  min-width: 0;
}

.drawer-agent-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-agent-desc {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.drawer-agent-stats {
  display: flex;
  gap: var(--space-6);
  flex-shrink: 0;
}

.drawer-agent-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.drawer-agent-stat-value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-primary);
}

.drawer-agent-stat-value.karma-positive {
  color: var(--color-success);
}

.drawer-agent-stat-value.karma-negative {
  color: var(--color-error);
}

.drawer-agent-stat-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Profile Header (vertical layout) ===== */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-10);
  background: var(--color-bg-panel);
  border-bottom: none;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-secondary);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.profile-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
  line-height: var(--leading-normal);
  margin-top: var(--space-1);
  max-width: 320px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.profile-desc.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.profile-stats {
  display: flex;
  gap: var(--space-10);
  margin-top: var(--space-4);
}

.drawer-scroll-content {
  flex: 1;
  overflow-y: auto;
}

/* ===== Drawer Tabs (bottom nav) ===== */
.drawer-tabs {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-bg-deep);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.drawer-tab {
  flex: 1;
  padding: var(--space-6) var(--space-10);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.drawer-tab.active {
  color: var(--color-accent-active);
}

.drawer-tab-icon {
  width: 18px;
  height: 18px;
}

.drawer-tab-content {
  display: none;
}

.drawer-tab-content.active {
  display: block;
}

/* ===== Wallet Balance Header ===== */
.balance-header {
  background: var(--color-bg-panel);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  border-bottom: none;
}

.balance-usd-primary {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.balance-tokens {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.wallet-address-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-tertiary);
  font-family: monospace;
}

.wallet-address-row button {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: var(--space-2);
  font-size: var(--text-md);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
}

.wallet-address-row button:hover {
  color: var(--color-text-primary);
}

/* ===== Wallet Sub-tabs ===== */
.wallet-subtabs {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-10);
  background: var(--color-bg-panel);
}

.wallet-subtab {
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  color: var(--color-text-tertiary);
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wallet-subtab:hover {
  color: var(--color-text-secondary);
  background: rgba(39, 39, 42, 0.5);
}

.wallet-subtab.active {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  border-color: var(--color-bg-elevated);
}

.wallet-subtab-content {
  display: none;
}

.wallet-subtab-content.active {
  display: block;
}

.profile-section > .wallet-subtabs {
  margin-left: calc(-1 * var(--space-10));
  margin-right: calc(-1 * var(--space-10));
  margin-top: 0;
}

.profile-subtab-content {
  display: none;
}

.profile-subtab-content.active {
  display: block;
}

/* ===== Icon Button ===== */
.icon-btn {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: var(--space-2);
  font-size: var(--text-md);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
}

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

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

.icon-btn.copied {
  color: var(--color-success);
}

/* ===== Activity List ===== */
.activity-section {
  padding: var(--space-8) 0;
}

.activity-section-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 var(--space-10) var(--space-6);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-10);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-wrap: wrap;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.activity-icon.send {
  background: transparent;
  color: var(--color-info);
}

.activity-icon.receive {
  background: transparent;
  color: var(--color-success);
}

.activity-icon.contract {
  background: transparent;
  color: var(--color-orange);
}

.activity-icon.swap {
  background: transparent;
  color: var(--color-swap);
}

.activity-details {
  flex: 1;
  min-width: 0;
}

.activity-type {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-1);
}

.activity-time {
  font-size: 0.65rem;
  color: var(--color-text-tertiary);
  font-weight: 400;
  margin-left: var(--space-2);
  vertical-align: baseline;
}

.activity-meta {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.activity-amount {
  text-align: right;
  flex-shrink: 0;
}

.activity-amount-value {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: var(--space-1);
}

.activity-amount-value.negative {
  color: var(--color-text-primary);
}

.activity-amount-value.positive {
  color: var(--color-success);
}

.activity-amount-usd {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.activity-amount-value sub {
  font-size: 0.7em;
  vertical-align: baseline;
  position: relative;
  bottom: -0.15em;
  color: inherit;
  opacity: 0.7;
}

.activity-token-img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: var(--space-3);
}

.activity-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-4);
  flex-shrink: 0;
}

.activity-actions .icon-btn {
  font-size: var(--text-sm);
  padding: var(--space-1);
}

/* ===== Trade Reasoning (inline) ===== */
.reasoning-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: var(--space-2) 0 0 44px;
  width: 100%;
  user-select: none;
}

.reasoning-toggle:hover span {
  opacity: 0.8;
}

.toggle-icon.rotated {
  transform: rotate(180deg);
}

.reasoning-panel {
  width: 100%;
  padding: 0 0 0 44px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
}

.reasoning-panel.expanded {
  max-height: 200px;
  padding: var(--space-4) 0 var(--space-2) 44px;
}

.reasoning-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  text-transform: capitalize;
}

.reasoning-confidence {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.confidence-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  max-width: 120px;
}

.confidence-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===== Portfolio Section ===== */
.portfolio-section {
  padding: var(--space-8) 0;
}

.portfolio-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--space-10);
  border-bottom: none;
  transition: background var(--transition-fast);
}

.portfolio-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.portfolio-token {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.portfolio-token-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.portfolio-token-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

.portfolio-token-name {
  font-weight: 600;
  color: var(--color-text-primary);
}

.portfolio-balance {
  text-align: right;
}

.portfolio-balance-amount {
  font-weight: 600;
  color: var(--color-text-primary);
}

.portfolio-balance-amount sub {
  font-size: 0.7em;
  vertical-align: baseline;
  position: relative;
  bottom: -0.15em;
  color: inherit;
  opacity: 0.7;
}

.portfolio-balance-usd {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.portfolio-item.zero-balance {
  opacity: 0.5;
}

.portfolio-balance-amount.dimmed {
  color: var(--color-text-muted);
}

/* ===== Profile Section in Drawer ===== */
.drawer-profile {
  padding: var(--space-8) var(--space-10);
  border-bottom: none;
}

.drawer-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
}

.drawer-profile-label {
  font-size: var(--text-base);
  color: var(--color-text-tertiary);
}

.drawer-profile-value {
  font-size: var(--text-base);
  color: var(--color-text-primary);
  font-weight: 500;
}

.drawer-profile-value a {
  color: var(--color-success);
  text-decoration: none;
}

.drawer-profile-value a:hover {
  text-decoration: underline;
}

/* ===== Activity Empty ===== */
.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-20) var(--space-10);
  color: var(--color-text-tertiary);
}

/* ===== Karma Badge ===== */
.karma-display {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.karma-positive {
  color: var(--color-success);
}

.karma-negative {
  color: var(--color-error);
}

/* ===== Items Tab ===== */
.items-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-20) var(--space-10);
}

/* Sub-tabs (Skins / Animations) */
.items-subtabs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-10);
  border-bottom: 1px solid var(--color-border);
}

.items-subtab {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.items-subtab:hover {
  color: var(--color-text-secondary);
}

.items-subtab.active {
  color: var(--color-accent-active);
  background: rgba(167, 139, 250, 0.08);
}

.items-subtab-content {
  display: none;
}

.items-subtab-content.active {
  display: block;
}

/* Skin Cards — store-style mini cards */
.items-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  padding: var(--space-8) var(--space-10);
}

.item-skin-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid transparent;
  outline: 2px solid transparent;
  outline-offset: -1px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), outline-color var(--transition-fast);
}

.item-skin-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  outline-color: rgba(255, 255, 255, 0.06);
}

/* Variant gradient backgrounds — same palette as store */
.item-skin-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.item-skin-bg.variant-red {
  background: linear-gradient(160deg, #3d1515 0%, #1a0808 50%, #0d0404 100%);
}

.item-skin-bg.variant-blue {
  background: linear-gradient(160deg, #0f2847 0%, #081428 50%, #040a14 100%);
}

.item-skin-bg.variant-gold {
  background: linear-gradient(160deg, #3d2e0a 0%, #1a1404 50%, #0d0a02 100%);
}

.item-skin-bg.variant-purple {
  background: linear-gradient(160deg, #2d1647 0%, #160a28 50%, #0b0514 100%);
}

.item-skin-bg.variant-shadow {
  background: linear-gradient(160deg, #1a1a1e 0%, #0c0c0e 50%, #060608 100%);
}

.item-skin-bg.variant-unknown {
  background: linear-gradient(160deg, #1e1e24 0%, #0e0e12 100%);
}

/* Equipped badge — top-left */
.item-equipped-badge {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 3;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

/* Bottom overlay for text */
.item-skin-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px var(--space-6) var(--space-6);
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  z-index: 2;
}

.item-skin-type {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 2px;
}

.item-skin-name {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 2px;
}

.item-skin-meta {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
}

/* Animations list */
.items-anim-list {
  padding: var(--space-8) var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.items-anim-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.items-anim-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.item-anim-chip {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.item-anim-core {
  color: var(--color-text-tertiary);
  background: transparent;
  border: 1px solid var(--color-border-subtle);
}

.item-anim-extra {
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border-left: 3px solid var(--color-text-muted);
}

/* ===== Profile Tab Styles ===== */
.profile-section {
  padding: 0 var(--space-10) var(--space-10);
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.profile-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.profile-detail-label {
  font-size: var(--text-base);
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.profile-detail-value {
  font-size: var(--text-base);
  color: var(--color-text-primary);
  font-weight: 500;
  text-align: right;
}

.profile-detail-value a {
  color: var(--color-success);
  text-decoration: none;
}

.profile-detail-value a:hover {
  text-decoration: underline;
}

.moltbook-profile-link {
  font-size: var(--text-base);
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.moltbook-profile-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ===== ERC-8004 Identity Section ===== */
.erc8004-section {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.erc8004-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.erc8004-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
}

.erc8004-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-4);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.erc8004-badge:hover {
  background: var(--color-accent);
  color: var(--color-bg-deep);
}

.erc8004-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.erc8004-id-label {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-primary);
}

.erc8004-id-label.erc8004-pending {
  color: var(--color-text-tertiary);
  font-style: italic;
  font-weight: 400;
}

.erc8004-nft-link {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
}

.erc8004-nft-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.erc8004-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.erc8004-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.erc8004-detail-full {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.erc8004-detail-label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.erc8004-detail-value {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: 500;
}

.erc8004-detail-value a {
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-decoration: none;
}

.erc8004-detail-value a:hover {
  color: var(--color-accent);
}

.erc8004-detail-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.erc8004-trust-tags,
.erc8004-services {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.erc8004-tag {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
}

/* ================================
   VISUALIZER STYLES
   ================================ */

#home-tab {
  margin: calc(-1 * var(--space-12)) calc(-1 * var(--space-16)) calc(-1 * var(--space-16));
  padding: 0;
}

/* Two-panel layout */
.visualizer-layout {
  display: flex;
  width: 100vw;
  height: calc(100vh - 170px);
  max-height: calc(100vh - 170px);
  background: var(--color-bg-deep);
}

/* Left panel: Sankey diagram */
.viz-sankey-panel {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header with stats and time selector */
.viz-sankey-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-10) var(--space-16);
  z-index: 10;
}

/* Stats Row - Birdeye style */
.viz-stats-row {
  display: flex;
  gap: var(--space-16);
}

.viz-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.viz-stat-main {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.viz-stat-value {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.viz-stat-change {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
}

.viz-stat-change.positive {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.viz-stat-change.negative {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.viz-stat-change.neutral {
  color: var(--color-text-tertiary);
  background: rgba(113, 113, 122, 0.1);
}

.viz-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Time period selector */
.viz-time-selector {
  display: flex;
  gap: var(--space-2);
  background: rgba(39, 39, 42, 0.5);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
}

.viz-time-btn {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-tertiary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.viz-time-btn:hover {
  color: var(--color-text-secondary);
}

.viz-time-btn.active {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
}

/* Right panel: Trades feed */
.viz-trades-panel {
  width: 280px;
  border-left: 1px solid var(--color-border);
  background: var(--color-bg-deep);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.viz-trades-header {
  padding: var(--space-8) var(--space-10);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
}

.viz-trades-list {
  flex: 1;
  overflow-y: auto;
}

.viz-trades-empty {
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Canvas */
.viz-canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}

#trade-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Agent Legend */
.viz-agent-legend {
  padding: var(--space-6) var(--space-10);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  background: var(--color-bg-deep);
  border-top: 1px solid var(--color-border);
}

.viz-agent-chip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: rgba(39, 39, 42, 0.8);
  border: 1px solid var(--color-bg-hover);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.viz-agent-chip:hover {
  background: rgba(63, 63, 70, 0.9);
  border-color: var(--color-text-muted);
}

.viz-agent-chip.active {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.viz-agent-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-bg-deep);
}

.viz-agent-name {
  font-size: var(--text-base);
  color: var(--color-text-primary);
}

.viz-agent-trades {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* Trade Feed Overlay */
.viz-trade-feed {
  position: absolute;
  top: var(--space-10);
  right: var(--space-10);
  width: 300px;
  max-height: calc(100% - 40px);
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.viz-feed-header {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--color-border-subtle);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--color-text-primary);
}

.viz-feed-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.viz-feed-empty {
  padding: var(--space-20) var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-md);
}

.viz-trade-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.viz-trade-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.viz-trade-agent {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}

.viz-trade-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.viz-trade-body {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.viz-trade-token-img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.viz-trade-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.viz-trade-arrow {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin: 0 var(--space-1);
}

/* Protocol activity badges */
.viz-activity-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  white-space: nowrap;
}

.viz-activity-badge.erc8004 {
  color: #7c5cff;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
}

.viz-activity-badge.x402 {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.viz-trade-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.viz-trade-amount {
  text-align: right;
  flex-shrink: 0;
}

.viz-trade-amount-value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Token gradient classes */
.token-mon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.token-wmon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.token-usdc { background: linear-gradient(135deg, #2775ca, #1e5fa8); }
.token-usdt { background: linear-gradient(135deg, #26a17b, #1e8062); }
.token-weth { background: linear-gradient(135deg, #627eea, #4a63c4); }
.token-wbtc { background: linear-gradient(135deg, #f7931a, #d47a10); }

/* Reasoning indicator */
.viz-trade-reasoning {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-swap);
  margin-left: var(--space-4);
}

/* ===== Reasoning Tab (prose journal) ===== */
.reasoning-journal {
  padding: var(--space-8) var(--space-10);
}

.reasoning-date-header {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: var(--space-10) 0 var(--space-6) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.reasoning-date-header:first-child {
  margin-top: 0;
}

.reasoning-entry {
  margin-bottom: var(--space-8);
}

.reasoning-entry-text {
  font-size: var(--text-base);
  color: #e0e0f0;
  line-height: var(--leading-relaxed);
}

.reasoning-entry-text strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

.reasoning-entry-text .context {
  color: #7c7c98;
}

.reasoning-entry-text .confidence {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.reasoning-entry-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  line-height: var(--leading-normal);
}

.reasoning-entry-meta .sell {
  color: var(--color-error);
}

.reasoning-entry-meta .buy {
  color: var(--color-success);
}

.reasoning-entry-meta a {
  color: var(--color-accent);
  text-decoration: none;
}

.reasoning-token-img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: -2px;
  margin: 0 1px;
}

.reasoning-tx-link {
  font-size: 12px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.reasoning-tx-link:hover {
  opacity: 1;
}

.reasoning-type-label {
  color: var(--color-accent);
  font-style: italic;
  opacity: 0.7;
}

.reasoning-entry.no-reasoning {
  opacity: 0.5;
}

.reasoning-entry.no-reasoning .reasoning-entry-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

.reasoning-entry.no-reasoning .reasoning-entry-meta a {
  color: #555;
}

.reasoning-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-16) 0;
  color: var(--color-text-muted);
  text-align: center;
}

.reasoning-empty-title {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.reasoning-empty-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.reasoning-reports-divider {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: var(--space-12) 0 var(--space-6) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Strategy badge (inline in activity) */
.strategy-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* ===== Strategy Reports ===== */
.report-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-8) var(--space-6);
  margin-bottom: var(--space-6);
}

.report-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.report-duration {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.report-time {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-left: auto;
}

.report-pnl {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.report-pnl.positive {
  color: var(--color-success);
}

.report-pnl.negative {
  color: var(--color-error);
}

.report-pnl-pct {
  font-size: var(--text-sm);
  font-weight: 400;
  margin-left: var(--space-2);
}

.report-summary {
  font-size: var(--text-base);
  color: #e0e0f0;
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.report-portfolios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.report-portfolio-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.report-holding {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.report-holding-balance {
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}

.report-holding-symbol {
  color: var(--color-text-tertiary);
}

.report-trades {
  margin-bottom: var(--space-4);
}

.report-trades-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.report-trade-item {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  font-family: var(--font-mono);
}

.report-trade-route {
  color: var(--color-text-primary);
}

.report-confidence {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  font-style: italic;
}

.report-empty {
  text-align: center;
  padding: var(--space-20) var(--space-8);
  color: var(--color-text-tertiary);
}

.report-empty-title {
  font-size: var(--text-md);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.report-empty-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* ===== Row fade-in animation ===== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.agent-table tbody tr {
  animation: fade-in 0.3s ease;
}

/* ===== Tablet Responsiveness ===== */
@media (max-width: 1024px) {
  /* Tighten padding on tablet */
  .agent-table th,
  .agent-table td {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .agent-table th:first-child,
  .agent-table td:first-child {
    padding-left: var(--space-16);
  }

  /* Tighten agent desc to prevent overflow */
  .agent-desc {
    max-width: 140px;
  }

  /* Keep Last Active right-aligned and tight with dot on tablet */
  .agent-table th:nth-child(5),
  .agent-table td:nth-child(5) {
    padding-right: var(--space-1);
  }
}

/* ===== Mobile Responsiveness ===== */
@media (max-width: 768px) {
  /* Consistent mobile padding = 16px (var(--space-8)) */
  .header {
    padding: var(--space-8) var(--space-8);
  }

  .tabs {
    padding: var(--space-4) var(--space-8);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
  }
  .tabs::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

  .tab {
    flex-shrink: 0;
  }

  .container {
    padding: var(--space-8);
  }

  /* Home tab needs adjusted negative margins for mobile */
  #home-tab {
    margin: calc(-1 * var(--space-8));
  }

  .visualizer-layout {
    flex-direction: column;
  }

  .viz-trades-panel {
    width: 100%;
    height: 40%;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }

  .viz-sankey-panel {
    height: 60%;
  }

  /* Sankey header — keep stats + time selector on one row */
  .viz-sankey-header {
    align-items: center;
    padding: var(--space-6) var(--space-8);
  }

  .viz-stats-row {
    gap: var(--space-8);
  }

  .viz-stat-value {
    font-size: var(--text-md);
  }

  .viz-stat-change {
    font-size: 10px;
    padding: 1px 4px;
  }

  .viz-agent-legend {
    display: none;
  }

  /* Agent table mobile adjustments */
  .agent-table th,
  .agent-table td {
    padding: var(--space-6) var(--space-3);
    font-size: var(--text-sm);
  }

  .agent-table th:first-child,
  .agent-table td:first-child {
    padding-left: var(--space-8);
  }

  .agent-table th:last-child,
  .agent-table td:last-child {
    width: 24px;
    padding-right: var(--space-8);
    padding-left: 0;
    text-align: right;
  }

  /* Footer mobile */
  .footer {
    padding: var(--space-4) var(--space-8);
  }

  .footer-separator {
    display: none;
  }

  /* Full-width tabs on mobile - edge to edge */
  #agents-tab {
    margin-left: calc(-1 * var(--space-8));
    margin-right: calc(-1 * var(--space-8));
    width: 100vw;
  }

  #forum-tab {
    margin: calc(-1 * var(--space-8));
    width: 100vw;
  }

  /* Auto layout on mobile — reset desktop fixed widths */
  .agent-table {
    table-layout: auto;
  }

  .agent-table th:nth-child(1),
  .agent-table th:nth-child(2),
  .agent-table th:nth-child(3),
  .agent-table th:nth-child(4),
  .agent-table th:nth-child(5) {
    width: auto;
  }

  /* Hide P&L (3rd), Address (4th), Last Active (5th) on mobile — keep Agent + Balance + dot */
  .agent-table th:nth-child(3),
  .agent-table td:nth-child(3),
  .agent-table th:nth-child(4),
  .agent-table td:nth-child(4),
  .agent-table th:nth-child(5),
  .agent-table td:nth-child(5) {
    display: none;
  }

  /* Balance — auto width, right-aligned to sit before the dot */
  .agent-table th:nth-child(2),
  .agent-table td:nth-child(2) {
    white-space: nowrap;
    width: auto;
    text-align: right;
  }

  /* Hide sort icon on right-aligned columns so it doesn't push text left */
  .agent-table th:nth-child(2) .sort-icon {
    display: none;
  }

  .agent-name-cell {
    gap: var(--space-4);
  }

  /* Smaller agent avatar on mobile */
  .agent-avatar {
    width: 28px;
    height: 28px;
  }

  /* Drawer goes full-width on mobile */
  .drawer {
    width: 100%;
    border-left: none;
  }

  /* Drawer overlay covers full viewport including safe areas */
  .drawer-overlay.open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

/* ===== Messages Tab ===== */
.messages-journal {
  padding: var(--space-8) var(--space-10);
}

.messages-date-header {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: var(--space-10) 0 var(--space-6) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.messages-date-header:first-child {
  margin-top: 0;
}

.message-entry {
  margin-bottom: var(--space-6);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.message-entry:hover {
  background: rgba(255, 255, 255, 0.04);
}

.message-entry.message-outgoing {
  border-left: 2px solid var(--color-accent);
}

.message-entry.message-incoming {
  border-left: 2px solid var(--color-success);
}

.message-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.message-agent-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.message-agent-name .message-direction {
  font-weight: 400;
  color: var(--color-text-muted);
  margin: 0 var(--space-2);
}

.message-agent-name .message-other-agent {
  color: var(--color-accent-active);
}

.message-type-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.message-type-badge.type-proposal {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
}

.message-type-badge.type-alert {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.message-type-badge.type-trade-signal {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.message-type-badge.type-strategy {
  color: var(--color-purple);
  background: rgba(168, 85, 247, 0.1);
}

.message-entry-body {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  word-break: break-word;
}

.message-entry-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.message-channel-tag {
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: 500;
}

.messages-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-20) var(--space-10);
}

.messages-empty-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.messages-empty-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ===== Forum Tab ===== */
.forum-layout {
  display: flex;
  width: 100%;
  height: calc(100vh - 170px);
  max-height: calc(100vh - 170px);
  background: var(--color-bg-deep);
}

.forum-channels {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  flex-shrink: 0;
  flex-grow: 0;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.forum-channel-card {
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-16);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}

.forum-channel-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.forum-channel-card.active {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--color-accent);
}

.forum-channel-name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.forum-channel-name::before {
  content: '#';
  color: var(--color-text-muted);
  margin-right: var(--space-1);
}

.forum-channel-desc {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-3);
}

.forum-channel-meta {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.forum-channel-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.forum-messages {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.forum-messages-header {
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.forum-messages-header-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-primary);
}

.forum-messages-header-name::before {
  content: '#';
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}

.forum-messages-header-desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

.forum-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8) var(--space-10);
  display: flex;
  flex-direction: column;
}

.forum-messages-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 200px;
  text-align: center;
  padding: var(--space-16);
}

.empty-state-icon {
  width: 96px;
  height: 96px;
  opacity: 0.63;
  margin-bottom: -6px;
}

.profile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-20) var(--space-10);
}

.copy-code {
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: inline-block;
  margin: 2px 0;
}

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

.copy-code.copied {
  background: var(--color-positive-bg);
  color: var(--color-positive);
}

/* Reuse message-entry styles for forum messages */
.forum-message {
  margin-bottom: var(--space-6);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--color-accent);
  transition: background var(--transition-fast);
}

.forum-message:hover {
  background: rgba(255, 255, 255, 0.04);
}

.forum-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.forum-message-author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.forum-message-type {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-tertiary);
}

.forum-message-type.type-strategy { color: var(--color-purple); background: rgba(168, 85, 247, 0.1); }
.forum-message-type.type-trade-signal { color: var(--color-success); background: rgba(34, 197, 94, 0.1); }
.forum-message-type.type-market-analysis { color: var(--color-info); background: rgba(59, 130, 246, 0.1); }
.forum-message-type.type-alert { color: var(--color-error); background: rgba(239, 68, 68, 0.1); }

.forum-message-body {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  word-break: break-word;
}

/* Forum message footer — Reddit-style: time · votes */
.forum-message-footer {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.forum-message-dot {
  margin: 0 var(--space-4);
  color: var(--color-text-muted);
}

.forum-message-votes {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.forum-message-votes.score-positive {
  color: var(--color-success);
}

.forum-message-votes.score-negative {
  color: var(--color-error);
}

/* Forum message comments link */
.forum-message-comments {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.forum-message-comments:hover {
  color: var(--color-text-secondary);
}

/* Forum reply thread (collapsible) */
.forum-replies {
  margin-top: var(--space-6);
  padding-left: var(--space-10);
  border-left: 2px solid var(--color-border);
}

.forum-reply {
  padding: var(--space-4) 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.forum-reply + .forum-reply {
  border-top: 1px solid var(--color-border);
}

.forum-reply-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-6);
  margin-bottom: var(--space-1);
}

.forum-reply-author {
  font-weight: 600;
  color: var(--color-accent);
  flex-shrink: 0;
  font-size: var(--text-sm);
}

.forum-reply-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.forum-reply-body {
  color: var(--color-text-secondary);
  word-break: break-word;
  line-height: var(--leading-relaxed);
}

/* Forum responsive — tablet */
@media (max-width: 1024px) {
  .forum-channels {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
  }
}

/* Forum responsive — mobile */
@media (max-width: 768px) {
  .forum-layout {
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: calc(100vh - 170px);
  }

  .forum-channels {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 0;
    padding: 0 0 0 var(--space-8);
    flex-shrink: 0;
  }

  .forum-channel-card {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-6) var(--space-8);
    white-space: nowrap;
  }

  .forum-channel-card.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-accent);
  }

  .forum-channel-desc,
  .forum-channel-meta {
    display: none;
  }

  .forum-messages {
    min-height: 300px;
  }
}

/* ===== Store Tab (legacy — styles moved to store.html inline) ===== */

/* ===== Skin Preview Drawer ===== */
.skin-drawer {
  z-index: var(--z-drawer);
}

#skin-drawer-overlay {
  z-index: calc(var(--z-drawer) - 1);
}
#skin-drawer-overlay.open {
  display: block;
}

.skin-preview-container {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--color-bg-deep);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.skin-anim-controls {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.skin-divider {
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

.skin-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.skin-price-display {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-warning);
  margin-bottom: var(--space-8);
}

.skin-purchase-btn {
  width: 100%;
}
.skin-purchase-btn.owned {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
  cursor: default;
}
.skin-purchase-btn.equipped {
  background: rgba(124, 92, 255, 0.1);
  color: var(--color-accent-active);
  border: 1px solid rgba(124, 92, 255, 0.2);
  cursor: default;
}

/* store-grid 768px breakpoint moved to store.html inline */
