/* Dark is the base palette (default look); [data-theme="light"] overrides below. */
:root {
  --bg: #000000;
  --sidebar-bg: #000000;
  --panel: #0b0d0f;
  --panel-2: #16181c;
  --panel-3: #1e2125;
  --panel-raised: #1a1d21;
  --border: #2f3336;
  --border-soft: #1e2124;
  --text: #e7e9ea;
  --text-dim: #b8bcc2;
  --muted: #71767b;
  --accent: #8b6bff;
  --accent-light: #a68bff;
  --accent-hover: #7a56ff;
  --accent-soft: rgba(139, 107, 255, 0.16);
  --accent-2: #00d9b5;
  --accent-2-soft: rgba(0, 217, 181, 0.14);
  --danger: #f4526c;
  --danger-soft: rgba(244, 82, 108, 0.14);
  --success: #00d9b5;
  --success-soft: rgba(0, 217, 181, 0.14);
  --warn: #ffb84d;
  --warn-soft: rgba(255, 184, 77, 0.14);
  --info: #55c8ff;
  --info-soft: rgba(85, 200, 255, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 256px;
  --topbar-h: 62px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --shadow-pop: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 16px -4px rgba(139, 107, 255, 0.45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f7f8;
  --sidebar-bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f3f5;
  --panel-3: #e8eaed;
  --panel-raised: #ffffff;
  --border: #e1e4e8;
  --border-soft: #edeff1;
  --text: #0f1419;
  --text-dim: #3c4045;
  --muted: #6b7075;
  --accent: #6d3fff;
  --accent-light: #7c52ff;
  --accent-hover: #5c2fe8;
  --accent-soft: rgba(109, 63, 255, 0.1);
  --accent-2: #00966f;
  --accent-2-soft: rgba(0, 150, 111, 0.1);
  --danger: #d81e4b;
  --danger-soft: rgba(216, 30, 75, 0.08);
  --success: #00966f;
  --success-soft: rgba(0, 150, 111, 0.1);
  --warn: #b96600;
  --warn-soft: rgba(185, 102, 0, 0.1);
  --info: #0a7cc4;
  --info-soft: rgba(10, 124, 196, 0.1);
  --shadow-card: 0 1px 2px rgba(15, 20, 25, 0.05), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --shadow-pop: 0 20px 50px rgba(15, 20, 25, 0.18);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 6px 16px -4px rgba(109, 63, 255, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100vh; overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 750; letter-spacing: -0.015em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; border: 2px solid var(--sidebar-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell (sidebar + topbar) ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 19px 20px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border-soft);
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--accent-light), var(--accent) 55%, var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px -1px rgba(139, 107, 255, 0.55), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 16px 10px 6px;
}
.sidebar-section-label:first-child { padding-top: 4px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 550;
  margin-bottom: 1px;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sidebar-link.active::before {
  content: '';
  position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; stroke: var(--muted); stroke-width: 1.8; }
.sidebar-link:hover svg { stroke: var(--text); }
.sidebar-link.active svg { stroke: var(--accent); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-soft); }

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
  margin-bottom: 8px;
}
.wallet-chip .avatar {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(150deg, var(--accent-light), var(--accent-2));
  position: relative;
}
.wallet-chip .avatar::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--success); border: 2px solid var(--panel-2);
}
.wallet-chip .addr { color: var(--text-dim); font-weight: 550; }

.sidebar-footer form { margin: 0; }
.sidebar-footer .btn { width: 100%; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .page-title { font-size: 16.5px; font-weight: 780; letter-spacing: -0.015em; }
.topbar .topbar-right { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 30px; max-width: 1100px; width: 100%; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, transform 0.15s ease;
}
.theme-toggle:hover { background: var(--panel-3); color: var(--text); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* ---------- Simple top nav (public/marketing pages) ---------- */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.navbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--text); }
.navbar nav { display: flex; align-items: center; gap: 14px; }
.navbar nav a:not(.btn) { color: var(--muted); font-size: 14px; font-weight: 550; }
.navbar nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

.container { max-width: 980px; margin: 0 auto; padding: 32px; }

/* ---------- Icon badges ---------- */

.icon-badge {
  width: 40px; height: 40px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  flex-shrink: 0;
}
.icon-badge svg { width: 20px; height: 20px; stroke-width: 2; }
.icon-badge.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-badge.sm svg { width: 15px; height: 15px; }
.icon-badge.lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-badge.lg svg { width: 25px; height: 25px; }
.icon-badge.teal { background: var(--accent-2-soft); color: var(--accent-2); }
.icon-badge.warn { background: var(--warn-soft); color: var(--warn); }
.icon-badge.danger { background: var(--danger-soft); color: var(--danger); }
.icon-badge.info { background: var(--info-soft); color: var(--info); }
.icon-badge.neutral { background: var(--panel-3); color: var(--text-dim); }
.icon-badge.solid {
  background: linear-gradient(150deg, var(--accent-light), var(--accent) 60%, var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(139, 107, 255, 0.55);
}
.icon-badge.sol {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

/* ---------- Core components ---------- */

.card {
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.card-header { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.card-header .heading { display: flex; align-items: center; gap: 12px; }
.card-header h3 { margin: 0; font-size: 15.5px; }
.card-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-btn);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.12s ease;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2.2; }
.btn:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.secondary {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.btn.secondary:hover { background: var(--panel-3); filter: none; }
.btn.danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: var(--danger-soft); filter: none; }
.btn.sm { padding: 6.5px 13px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

input, select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 12px;
  font-family: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--muted); }
input[readonly] { color: var(--text-dim); }
input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }

label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }

.row-action { display: flex; align-items: center; gap: 9px; font-weight: 650; }

.sol-amount { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sol-amount img { width: 13px; height: 13px; flex-shrink: 0; }
.sol-amount.lg img { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3.5px 10px; border-radius: 999px; font-size: 11px; font-weight: 750; letter-spacing: 0.02em; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.pending, .badge.verifying { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: var(--success-soft); color: var(--success); }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.badge.active { background: var(--info-soft); color: var(--info); }
.badge.paused, .badge.completed, .badge.cancelled { background: var(--panel-3); color: var(--muted); }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  flex: 1; min-width: 180px;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.stat .stat-body { min-width: 0; }
.stat .label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.stat .value { font-size: 22px; font-weight: 780; margin-top: 3px; letter-spacing: -0.01em; }
.stat.actions { gap: 10px; }
.stat.actions .btn { flex: 1; }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; font-weight: 550; }
.flash.success { background: var(--success-soft); color: var(--success); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash svg { width: 16px; height: 16px; flex-shrink: 0; }

.guest-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 550;
}
.guest-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.guest-banner a { color: inherit; font-weight: 700; text-decoration: underline; }

.empty-state { text-align: center; padding: 46px 20px; }
.empty-state .icon-badge { margin: 0 auto 14px; }
.empty-state .title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.empty-state .sub { color: var(--muted); font-size: 13px; }

.muted { color: var(--muted); }
.mono { font-family: 'SF Mono', Consolas, monospace; font-size: 13px; word-break: break-all; }

/* ---------- Landing / marketing ---------- */

.hero {
  position: relative;
  text-align: center;
  padding: 100px 20px 70px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -220px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 500px;
  background:
    radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 60%),
    radial-gradient(circle at 70% 40%, var(--accent-2-soft), transparent 55%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 650; color: var(--text-dim);
  margin-bottom: 22px;
}
.hero .kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.hero h1 { font-size: 46px; margin-bottom: 16px; letter-spacing: -0.03em; line-height: 1.08; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent-light), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; margin-bottom: 34px; max-width: 560px; margin-left: auto; margin-right: auto; }

.btn.lg { padding: 13px 26px; font-size: 15px; border-radius: 11px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 0 0 40px; }
.feature-card {
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.feature-card .icon-badge { margin-bottom: 14px; }
.feature-card .ftitle { font-weight: 750; font-size: 15px; margin-bottom: 4px; }
.feature-card .fprice { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.feature-card .fnote { color: var(--muted); font-size: 12.5px; }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 40px; }
.step { text-align: left; }
.step .step-num {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--accent);
  margin-bottom: 12px;
}
.step h4 { font-size: 14.5px; margin-bottom: 5px; }
.step p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.55; }

.section-title { text-align: center; font-size: 26px; margin-bottom: 8px; letter-spacing: -0.02em; }
.section-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin-bottom: 32px; }

/* ---------- Campaign builder layout ---------- */

.campaign-builder { display: flex; gap: 20px; align-items: flex-start; }
.builder-main { flex: 1; min-width: 0; }
.builder-summary { width: 300px; flex-shrink: 0; position: sticky; top: calc(var(--topbar-h) + 20px); }

.builder-steps { display: flex; flex-direction: column; gap: 18px; }
.builder-step-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 10px;
}
.builder-step-label .step-dot {
  width: 18px; height: 18px; border-radius: 50%; background: var(--panel-3); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0;
}

/* Campaign type selector — big toggle cards instead of a bare <select> */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.type-option {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; background: var(--panel-2);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.type-option:hover { border-color: var(--text-dim); }
.type-option input { display: none; }
.type-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.type-option .icon-badge { background: var(--panel-3); color: var(--text-dim); }
.type-option.selected .icon-badge { background: var(--accent); color: #fff; }
.type-option .t-title { font-weight: 700; font-size: 13.5px; }
.type-option .t-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Campaign action picker ---------- */

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 4px; }

.action-card {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.action-card:hover { border-color: var(--text-dim); transform: translateY(-2px); }
.action-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 4px 16px -6px rgba(139, 107, 255, 0.4), 0 0 0 1px var(--accent) inset; }

.action-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.action-card-head .icon-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-3); color: var(--text-dim); transition: background 0.15s ease, color 0.15s ease; }
.action-card-head .icon-badge svg { width: 17px; height: 17px; }
.action-card.selected .action-card-head .icon-badge { background: var(--accent); color: #fff; }
.action-card-head .name { font-weight: 700; font-size: 14px; flex: 1; }

.action-card-head .check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--panel);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s cubic-bezier(.34,1.56,.64,1);
}
.action-card.selected .action-card-head .check { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.action-card-head .check svg {
  width: 12px; height: 12px; stroke: #fff; stroke-width: 3;
  opacity: 0; transform: scale(0.5); transition: opacity 0.12s ease, transform 0.15s cubic-bezier(.34,1.56,.64,1);
}
.action-card.selected .action-card-head .check svg { opacity: 1; transform: scale(1); }

.action-price { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.action-price img { width: 12px; height: 12px; }

.action-qty { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.18s ease, opacity 0.15s ease, margin-top 0.18s ease; }
.action-card.selected .action-qty { max-height: 60px; opacity: 1; margin-top: 2px; }
.action-qty label { margin-bottom: 5px; }

.qty-stepper { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.qty-stepper button {
  width: 30px; flex-shrink: 0; border: none; background: var(--panel-2); color: var(--text);
  font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1;
}
.qty-stepper button:hover { background: var(--panel-3); }
.qty-stepper button:active { background: var(--accent-soft); color: var(--accent); }
.qty-stepper input {
  border: none; text-align: center; margin: 0; border-radius: 0;
  -moz-appearance: textfield; padding: 8px 4px; font-weight: 700;
}
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input:focus { box-shadow: none; }

/* ---------- Order summary card ---------- */

.summary-card { padding: 20px; }
.summary-card h3 { font-size: 14.5px; margin-bottom: 4px; }
.summary-card .summary-hint { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

.summary-empty { text-align: center; padding: 20px 10px; color: var(--muted); font-size: 12.5px; }

.summary-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.summary-line:first-child { padding-top: 0; }
.summary-line .sl-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.summary-line .sl-left .icon-badge { width: 24px; height: 24px; border-radius: 7px; }
.summary-line .sl-left .icon-badge svg { width: 12px; height: 12px; }
.summary-line .sl-name { font-weight: 650; }
.summary-line .sl-qty { color: var(--muted); font-size: 11.5px; }
.summary-line .sl-value { font-weight: 700; white-space: nowrap; }

.summary-total {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; margin-top: 4px; font-size: 15px; font-weight: 800;
}
.summary-total .sol-amount img { width: 16px; height: 16px; }

.summary-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.summary-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; stroke: var(--muted); }

@media (max-width: 760px) {
  .campaign-builder { flex-direction: column; }
  .builder-summary { width: 100%; position: static; }
  .type-toggle { grid-template-columns: 1fr; }
}

/* ---------- Wallet modal ---------- */

.raven-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
:root[data-theme="light"] .raven-modal-backdrop { background: rgba(15, 20, 25, 0.4); }

.raven-modal { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-pop); }
.raven-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); font-weight: 750; font-size: 15px; }
.raven-modal-close {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0;
}
.raven-modal-close:hover { color: var(--text); background: var(--panel-3); }
.raven-modal-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }

.raven-wallet-option {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-soft); background: var(--panel-2);
  color: var(--text); font-size: 14.5px; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.raven-wallet-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.raven-wallet-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.35);
}
.raven-wallet-icon svg { width: 19px; height: 19px; }
.raven-wallet-name { flex: 1; font-weight: 650; }
.raven-wallet-status { font-size: 11px; font-weight: 650; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: var(--panel-3); }
.raven-wallet-status.detected { color: var(--success); background: var(--success-soft); }

/* ---------- Earner task groups (one card per campaign/target) ---------- */

.task-group-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--panel-2);
}
.task-group-card:last-child { margin-bottom: 0; }

.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.target-chip:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; transform: translateY(-1px); }
.target-chip-x { width: 13px; height: 13px; flex-shrink: 0; }
.target-chip-external { width: 13px; height: 13px; flex-shrink: 0; color: var(--muted); }
.target-chip:hover .target-chip-external { color: var(--accent); }

.task-action-list { display: flex; flex-direction: column; }

.task-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.task-action-row:first-child { border-top: none; padding-top: 0; }
.task-action-row:last-child { padding-bottom: 0; }

.task-action-name { font-weight: 650; font-size: 13.5px; min-width: 70px; }
.task-action-reward { color: var(--success); font-weight: 700; font-size: 13px; margin-right: auto; }
.task-action-msg { font-size: 11px; max-width: 100%; flex-basis: 100%; text-align: right; }
.task-action-msg:empty { display: none; }

@media (max-width: 560px) {
  .task-action-row { gap: 8px; }
  .task-action-reward { margin-right: 0; flex-basis: 100%; order: 3; }
}

/* ---------- Deposit page ---------- */

.address-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border-radius: var(--radius-sm); border: 1.5px dashed var(--border);
  background: var(--panel-2); cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.address-box:hover { border-color: var(--accent); background: var(--accent-soft); }
.address-box.disabled { pointer-events: none; opacity: 0.6; }
.address-box .mono { flex: 1; min-width: 0; }

.copy-btn {
  flex-shrink: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text-dim); transition: background 0.12s ease, color 0.12s ease;
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

.chip-row { display: flex; gap: 8px; margin: -4px 0 14px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text-dim); font-size: 12.5px; font-weight: 650; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.tx-status { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 550; background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--muted); }
.tx-status.hidden { display: none; }
.tx-status .spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); flex-shrink: 0; animation: spin 0.7s linear infinite; }
.tx-status.loading { color: var(--text); }
.tx-status.success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.tx-status.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.tx-status svg { width: 16px; height: 16px; flex-shrink: 0; }
.tx-status a { color: inherit; text-decoration: underline; }
@keyframes spin { to { transform: rotate(360deg); } }

.deposit-steps { display: flex; flex-direction: column; gap: 14px; }
.deposit-steps .step { display: flex; gap: 12px; }
.deposit-steps .step .step-num { margin-bottom: 0; flex-shrink: 0; }
.deposit-steps .step p { margin-top: 2px; }

/* ---------- Mobile nav (hamburger + backdrop) ---------- */

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-btn svg { width: 17px; height: 17px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 49;
}
:root[data-theme="light"] .sidebar-backdrop { background: rgba(15, 20, 25, 0.35); }
.sidebar-backdrop.open { display: block; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 480px; }

@media (max-width: 860px) {
  .hamburger-btn { display: inline-flex; }
  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: translateX(0); }
  .main-area { width: 100%; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .action-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 16px 40px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .campaign-builder { flex-direction: column; }
  .builder-summary { width: 100%; position: static; }
  .stat-row { flex-direction: column; }
  .type-toggle { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .container { padding: 20px 16px; }
  .navbar { padding: 12px 16px; }
  .card { padding: 16px; }
  .task-action-row { padding: 12px 0; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .stat { min-width: 0; }
}
