/* ClipRoyalty app — additions on top of the marketing style.css */

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}
.app-shell::before {
  content: "";
  position: fixed;
  top: -300px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 620px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(110,86,255,.25) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  border: 0;
  background: transparent;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  padding: 10px;
  border-radius: var(--pill);
  cursor: pointer;
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--violet-2), var(--violet));
  color: #fff;
}

.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .btn { width: 100%; }

.msg { font-size: 13.5px; line-height: 1.5; border-radius: 12px; padding: 12px 14px; }
.msg-err { background: rgba(255,90,90,.12); color: #ff8a8a; }
.msg-ok  { background: rgba(58,223,165,.12); color: var(--mint); }

.auth-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 18px;
}
.auth-foot a { color: var(--violet-2); }

/* ---- Onboarding wizard ---- */
.ob-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 60px;
  position: relative;
}
.ob-shell::before {
  content: "";
  position: fixed;
  top: -300px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 620px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(110,86,255,.22) 0%, transparent 70%);
  pointer-events: none;
}
.ob-top {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}
.ob-back {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  flex: none;
}
.ob-progress {
  flex: 1;
  height: 5px;
  background: var(--raised);
  border-radius: 3px;
  overflow: hidden;
}
.ob-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--violet-2), var(--violet));
  border-radius: 3px;
  transition: width .3s ease;
}
.ob-step-label { font-size: 12.5px; color: var(--text-2); flex: none; }

.ob-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ob-icon {
  width: 60px; height: 60px;
  margin: 0 auto 4px;
  border-radius: 18px;
  background: rgba(110,86,255,.14);
  border: 1px solid rgba(110,86,255,.3);
  color: var(--violet-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}
.ob-card h1 {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -.02em;
  text-align: center;
}
.ob-sub {
  font-size: 14.5px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 8px;
}
.ob-step { display: flex; flex-direction: column; gap: 14px; }

/* creator agreement */
.terms-box {
  max-height: 260px;
  overflow-y: auto;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  text-align: left;
}
.terms-box h4 { color: var(--text); font-size: 14.5px; margin-bottom: 8px; }
.terms-box p { margin-bottom: 10px; }
.terms-box strong { color: var(--text); }
.agree-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
}
.agree-row input {
  margin-top: 3px;
  width: 16px; height: 16px;
  accent-color: var(--violet);
  flex: none;
}
.field-hint { font-size: 12px; color: var(--text-2); }

.pay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
.pay-opt {
  font-family: var(--body);
  background: var(--raised);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  padding: 16px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  transition: border-color .15s;
}
.pay-opt small { color: var(--text-2); font-size: 11.5px; }
.pay-opt.selected {
  border-color: var(--violet);
  background: rgba(110,86,255,.12);
}
.ob-next { width: 100%; margin-top: 6px; }

@media (max-width: 520px) {
  .pay-grid { grid-template-columns: 1fr; }
}

/* ---- App top bar (dashboard pages) ---- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(18,21,29,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-bar .nav-links { display: flex; gap: 22px; margin: 0 0 0 12px; }
.app-bar .spacer { margin-left: auto; }
.user-chip {
  font-size: 13px;
  color: var(--text-2);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 8px 14px;
}
.app-main { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; }
.app-bar .nav-links a.active { color: var(--text); font-weight: 600; }

/* ---- Dashboard panels & stats ---- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card small { font-size: 12px; color: var(--text-2); }
.stat-card strong {
  font-family: var(--display);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.panel h2 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}
.panel-sub { font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; }

.sub-form {
  display: grid;
  grid-template-columns: 1.1fr .7fr 1.6fr auto;
  gap: 14px;
  align-items: end;
}
.sub-form .btn { height: 46px; }
.sub-form + .msg { margin-top: 14px; }
.field select {
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
}
.field select:focus { border-color: var(--violet); }

/* submissions table */
.srow {
  display: grid;
  grid-template-columns: 1.6fr .8fr 1fr .8fr .8fr;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  font-size: 14px;
  border-top: 1px solid var(--border);
}
.srow.shead {
  border-top: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
}
.clip-link { color: var(--violet-2); font-weight: 600; }
.claim-line { font-size: 11.5px; color: var(--text-2); }
.claim-line .claim-btn { color: var(--violet-2); }
.clip-link:hover { text-decoration: underline; }
.pill-red {
  display: inline-block;
  background: rgba(255,90,90,.12);
  color: #ff8a8a;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
}
/* pill-green / pill-amber come from the marketing stylesheet */

@media (max-width: 900px) {
  .sub-form { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 1.4fr .8fr .9fr; }
  .srow span:nth-child(4), .srow span:nth-child(5) { display: none; }
}

/* ---- Admin ---- */
.adm-row {
  display: grid;
  grid-template-columns: 1.6fr .9fr .8fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.adm-row:first-child { border-top: 0; }
.adm-row.po { grid-template-columns: 1.6fr .9fr auto auto; }
.adm-info { display: flex; flex-direction: column; gap: 2px; }
.adm-info strong { font-size: 14.5px; }
.adm-info small { font-size: 12.5px; color: var(--text-2); }
.adm-views {
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
  outline: none;
}
.adm-views:focus { border-color: var(--violet); }
.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 10px; }
.camp-form { display: flex; flex-direction: column; gap: 16px; }
.camp-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.camp-form textarea {
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  resize: vertical;
}
.camp-form textarea:focus { border-color: var(--violet); }

@media (max-width: 860px) {
  .adm-row, .adm-row.po { grid-template-columns: 1fr; }
  .camp-form .form-row { grid-template-columns: 1fr; }
}

.sync-log {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-2);
}
.sync-log:empty { display: none; }
.sync-log strong { color: var(--mint); }
.sev-high { color: #ff8a8a; }
.sev-med  { color: var(--amber); }
[data-theme="light"] .sev-high { color: #c23a3a; }

/* wallet extras */
.srow.s4 { grid-template-columns: .8fr .8fr 1fr .8fr; }
.amt-pos { color: var(--mint); font-weight: 700; }
.amt-neg { color: #ff8a8a; font-weight: 700; }

/* ---------- creator copilot (premium) ---------- */
.copilot-btn {
  margin-top: 8px; width: 100%;
  position: relative; border: 1px solid transparent; border-radius: 12px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #8f7bff, #3adfa5) border-box;
  font-weight: 800; letter-spacing: .01em;
  transition: box-shadow .25s ease, transform .15s ease;
}
.copilot-btn > span, .copilot-btn {
  background-image:
    linear-gradient(var(--surface), var(--surface)),
    linear-gradient(135deg, #8f7bff, #3adfa5);
}
.copilot-btn { color: transparent; }
.copilot-btn::after {
  content: attr(data-label);
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, #8f7bff, #3adfa5);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.copilot-btn:hover { box-shadow: 0 6px 26px rgba(110,86,255,.45); transform: translateY(-1px); }
.copilot-btn:disabled { opacity: .75; transform: none; }

.cp-modal { position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center; padding: 20px; }
.cp-modal.hidden { display: none; }
.cp-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, .55);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: cpFade .25s ease; }
.cp-dialog {
  position: relative; width: min(620px, 100%); max-height: min(82vh, 760px);
  display: flex; flex-direction: column; border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: cpIn .35s cubic-bezier(.2,.7,.3,1);
}
.cp-dialog::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(143,123,255,.75), rgba(58,223,165,.55));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.cp-body { padding: 18px 22px 22px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; }
.cp-note { font-size: 13.5px; color: var(--text-2); }
.cp-again { margin-top: 4px; }
@keyframes cpIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cpFade { from { opacity: 0; } to { opacity: 1; } }

.cp-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.cp-titles { flex: 1; min-width: 0; }
.cp-close { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  font-size: 14px; cursor: pointer; transition: background .15s ease; font-family: inherit; }
.cp-close:hover { background: rgba(128,128,160,.14); }
.cp-badge {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8f7bff, #5e45f2); color: #fff; font-size: 16px;
  box-shadow: 0 3px 14px rgba(110,86,255,.4);
}
.cp-pulse { animation: cpPulse 1.2s ease-in-out infinite; }
@keyframes cpPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .7; } }
.cp-head strong { display: block; font-size: 16px; letter-spacing: -.01em;
  background: linear-gradient(90deg, #8f7bff, #3adfa5);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cp-head small { display: block; font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cp-sec small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-2); font-weight: 700; margin-bottom: 6px; }
.cp-line { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px;
  border-radius: 10px; transition: background .15s ease; }
.cp-line:hover { background: rgba(110,86,255,.07); }
.cp-line > span:not(.cp-num) { flex: 1; font-size: 13.5px; line-height: 1.5; }
.cp-num {
  width: 20px; height: 20px; border-radius: 7px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(110,86,255,.16); color: var(--violet-2, #8f7bff);
  font-size: 11px; font-weight: 800;
}
.cp-tags em { font-style: normal; display: inline-block; margin: 2px 6px 2px 0; padding: 3px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(58,223,165,.12); color: var(--mint); border: 1px solid rgba(58,223,165,.28); }
.cp-copy {
  flex: 0 0 auto; padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: transparent; color: var(--violet-2, #8f7bff);
  border: 1px solid rgba(110,86,255,.35); cursor: pointer;
  opacity: 0; transition: opacity .15s ease, background .15s ease;
  font-family: inherit;
}
.cp-line:hover .cp-copy, .cp-copy:focus-visible { opacity: 1; }
.cp-copy:hover { background: rgba(110,86,255,.14); }
@media (hover: none) { .cp-copy { opacity: 1; } }

.cp-skel { height: 13px; border-radius: 7px;
  background: linear-gradient(90deg, rgba(110,86,255,.10) 25%, rgba(110,86,255,.24) 50%, rgba(110,86,255,.10) 75%);
  background-size: 200% 100%; animation: cpShimmer 1.3s linear infinite; }
@keyframes cpShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================
   PREMIUM PASS — motion, depth, and glow across the app
   ============================================================ */

/* pages breathe in */
.app-main { animation: pageIn .4s cubic-bezier(.2,.7,.3,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* stat cards: lift on hover + a light sweep that makes numbers feel alive */
.stat-card { position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.stat-card:hover { transform: translateY(-3px);
  border-color: rgba(110,86,255,.45); box-shadow: 0 14px 38px rgba(0,0,0,.28); }
.stat-card::after { content: ""; position: absolute; top: 0; left: -80%;
  width: 45%; height: 100%; transform: skewX(-18deg); pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.05), transparent);
  animation: sheen 5.5s ease-in-out infinite; }
[data-theme="light"] .stat-card::after {
  background: linear-gradient(105deg, transparent, rgba(110,86,255,.07), transparent); }
@keyframes sheen { 0% { left: -80%; } 55%, 100% { left: 140%; } }

/* campaign cards: glow ring fades in on hover */
.camp-card { position: relative; }
.camp-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; opacity: 0; transition: opacity .3s ease; pointer-events: none;
  background: linear-gradient(135deg, rgba(143,123,255,.65), rgba(58,223,165,.45));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.camp-card:hover::before { opacity: 1; }

/* LIVE dot pulses like it means it */
.camp-head .live { animation: livePulse 2.2s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* panels acknowledge the cursor */
.panel { transition: border-color .3s ease; }
.panel:hover { border-color: rgba(110,86,255,.30); }

/* rows respond to hover everywhere */
.adm-row, .srow:not(.shead), .lab-row:not(.lab-head) { transition: background .15s ease; border-radius: 10px; }
.adm-row:hover, .srow:not(.shead):hover, .lab-row:not(.lab-head):hover { background: rgba(110,86,255,.05); }

/* buttons: tactile press + primary glow */
.btn { transition: box-shadow .22s ease, transform .12s ease, background .2s ease; }
.btn:active { transform: scale(.97); }
.btn-primary:hover { transform: translateY(-1px); }

/* goal cards join the party */
.goal-card { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.goal-card:hover { transform: translateY(-3px); border-color: rgba(110,86,255,.45);
  box-shadow: 0 12px 30px rgba(0,0,0,.22); }

/* attribution box: subtle glow on hover */
.attr-box { transition: border-color .25s ease; }
.attr-box:hover { border-color: rgba(110,86,255,.45); }

/* theme toggle spins gently */
.theme-toggle { transition: transform .35s ease; }
.theme-toggle:hover { transform: rotate(40deg); }

/* premium scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(110,86,255,.28); border-radius: 99px;
  border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(110,86,255,.5); background-clip: padding-box; }

/* keyboard focus that matches the brand */
:focus-visible { outline: 2px solid rgba(143,123,255,.8); outline-offset: 2px; border-radius: 6px; }

/* respect users who turn motion off */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   HIERARCHY PASS — one hero per screen, everything else supports
   ============================================================ */

/* the number that matters gets the stage */
.stat-hero strong { font-size: 42px; letter-spacing: -.035em; line-height: 1.05; }
.stat-delta { font-size: 12.5px; font-weight: 700; color: var(--mint); margin-top: 2px; }
.stat-delta.muted { color: var(--text-2); font-weight: 500; }

/* nav: the active page wears a pill, others whisper */
.app-bar .nav-links a { padding: 7px 14px; border-radius: 999px;
  transition: background .2s ease, color .2s ease; }
.app-bar .nav-links a:hover { background: rgba(110,86,255,.10); }
.app-bar .nav-links a.active { background: rgba(110,86,255,.16); color: var(--violet-2, #8f7bff); }

/* empty states invite, they don't apologize */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 38px 20px; }
.empty-state .es-ico { width: 54px; height: 54px; border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(110,86,255,.14); border: 1px solid rgba(110,86,255,.3);
  color: var(--violet-2, #8f7bff); }
.empty-state strong { font-size: 17px; letter-spacing: -.01em; }
.empty-state p { font-size: 13.5px; color: var(--text-2); max-width: 400px; line-height: 1.55; }
.empty-state .btn { margin-top: 6px; }

/* ============================================================
   RESPONSIVE PASS (B12) — phone-first fixes + iOS quirks
   ============================================================ */

/* iOS zooms the whole page when a focused input is under 16px — prevent it */
@media (max-width: 760px) {
  .field input, .field select, .field textarea { font-size: 16px; }
}

/* app bar: must fit a 360px phone */
@media (max-width: 900px) {
  .user-chip { display: none; }
}
@media (max-width: 680px) {
  .app-bar { gap: 8px; padding: 10px 12px; flex-wrap: nowrap; }
  .app-bar .logo-text { display: none; }
  .app-bar .nav-logo { flex: 0 0 auto; }
  .app-bar .nav-links { gap: 2px; margin-left: 0; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .app-bar .nav-links::-webkit-scrollbar { display: none; }
  .app-bar .nav-links a { padding: 7px 10px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
  .app-bar .spacer { display: none; }
  .app-bar .btn, .app-bar .theme-toggle { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
}

/* dense tables (Lab, attribution): swipe sideways instead of crushing */
@media (max-width: 700px) {
  #camp-funnel, #leaderboard, #predictions, #scoreboard, #attr-list, #conv-list {
    overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #camp-funnel .lab-row, #leaderboard .lab-row, #predictions .lab-row, #scoreboard .lab-row {
    min-width: 560px; }
}

/* copilot modal: bottom sheet on phones; dvh fixes iOS toolbar height lies */
@supports (height: 1dvh) { .cp-dialog { max-height: min(82dvh, 760px); } }
@media (max-width: 480px) {
  .cp-modal { padding: 10px; align-items: flex-end; }
  .cp-dialog { width: 100%; }
  @supports (height: 1dvh) { .cp-dialog { max-height: 88dvh; } }
}

/* fingers need bigger targets than cursors */
@media (hover: none) {
  .copy-btn, .cp-copy, .btn-sm { min-height: 40px; }
  .theme-toggle { min-width: 42px; min-height: 42px; }
}

/* campaign cards: decisions at a glance */
.joined-chip { margin-left: 8px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  color: var(--mint); background: rgba(58,223,165,.12); border: 1px solid rgba(58,223,165,.32); }
.top-chip { display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 999px;
  vertical-align: middle; font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(90deg, #8f7bff, #5e45f2);
  box-shadow: 0 2px 10px rgba(110,86,255,.4); }
.rate-sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.meta-urgent { color: var(--amber); font-weight: 700; }

/* ============================================================
   ALIGNMENT PASS — every card in a row lines up, no exceptions
   ============================================================ */

/* card header: title truncates, badges never wrap or squish */
.camp-head { align-items: center; flex-wrap: nowrap; }
.camp-head > div { flex: 1; min-width: 0; }
.camp-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-head small  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.camp-head .live  { white-space: nowrap; flex: none; }
.joined-chip { flex: none; }

/* empty slots must not leave phantom gaps */
.attr-slot:empty, .copilot-slot:empty { display: none; }

/* the action is always the last thing, pinned to the card floor —
   so buttons across a row sit on one line no matter the content above */
.camp-card .camp-join, .camp-card .copilot-btn { margin-top: auto; }

/* goal cards: progress bars sit on a shared baseline */
.goal-card .goal-bar { margin-top: auto; padding-top: 8px; background-clip: content-box; }

/* stat cards: number block hugs the top consistently */
.stat-card small { margin-bottom: 2px; }

/* best-rate chip sits on the money line, not floating beside it */
.camp-rate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.camp-rate .rate-sub { flex-basis: 100%; }
.top-chip { align-self: center; }

/* ---------- private lab ---------- */
.lab-row { display: grid; grid-template-columns: 2.2fr .8fr .8fr .7fr .6fr .8fr .8fr 1fr;
  gap: 8px; align-items: center; padding: 11px 0; font-size: 13.5px;
  border-top: 1px solid rgba(128,128,160,.14); }
.lab-row.l6 { grid-template-columns: 2fr .6fr .8fr .8fr .6fr 1fr; }
.lab-row.l5 { grid-template-columns: 2fr .9fr .9fr .7fr .8fr; }
.lab-row.l4 { grid-template-columns: 2.2fr 1fr 1.2fr .4fr; }
.lab-head { border-top: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); font-weight: 700; padding-bottom: 4px; }
.lab-dim { color: var(--text-2); font-size: 12px; }
@media (max-width: 800px) { .lab-row { font-size: 12px; gap: 5px; } }

/* ---------- creator attribution card (your link & code) ---------- */
.attr-box { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px;
  padding: 12px; border-radius: 14px;
  background: rgba(110,86,255,.08); border: 1px solid rgba(110,86,255,.22); }
.attr-row { display: flex; align-items: center; gap: 10px; }
.attr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attr-txt small { font-size: 11.5px; color: var(--text-2); }
.attr-txt code { font-size: 12.5px; font-weight: 700; color: var(--violet-2, #8f7bff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.attr-row .copy-btn { flex: 0 0 auto; }

/* ---------- data goals (admin moat tracker) ---------- */
.gc-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gc-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.gc-what { font-size: 13px; color: var(--text-2); }
.gc-delta { font-size: 12.5px; font-weight: 700; }
.gc-delta.up { color: var(--mint); }
.gc-delta.down { color: #ff8a8a; }
.gc-svg { width: 100%; height: 150px; display: block; }
.gc-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.goal-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.goal-card { border: 1px solid rgba(128,128,160,.18); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px; }
.goal-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.goal-card .gc-ico { color: var(--violet-2, #8f7bff); }
.goal-card .gc-ico svg { width: 18px; height: 18px; display: block; }
.goal-pct { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.goal-num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.goal-card small { font-size: 12px; color: var(--text-2); }
.goal-card small em { font-style: normal; opacity: .75; }
.goal-card .goal-bar { margin-top: 8px; height: 6px; }
@media (max-width: 980px) { .goal-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .goal-cards { grid-template-columns: 1fr; } }

.gc-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.gc-tile { border: 1px solid rgba(128,128,160,.18); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px; }
.gc-tile .gc-ico { color: var(--violet-2, #8f7bff); }
.gc-tile .gc-ico svg { width: 18px; height: 18px; display: block; }
.stage-ico svg { width: 16px; height: 16px; display: block; margin: 0 auto; color: var(--violet-2, #8f7bff); }
.ob-icon svg { width: 26px; height: 26px; }
.gc-tile strong { font-size: 22px; font-weight: 800; }
.gc-tile small { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 640px) { .gc-tiles { grid-template-columns: 1fr; } }

.goal-row { margin-bottom: 13px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 5px; }
.goal-top span { color: var(--text-2); }
.goal-top strong { font-size: 14px; }
.goal-top em { font-style: normal; color: var(--text-2); font-weight: 400; font-size: 12.5px; }
.goal-bar { height: 8px; border-radius: 99px; background: rgba(110,86,255,.14); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--mint)); transition: width .6s ease; }
.stage-row { display: flex; gap: 12px; align-items: center; padding: 10px 0;
  border-top: 1px solid rgba(128,128,160,.18); opacity: .62; }
.stage-row.stage-ok { opacity: 1; }
.stage-ico { font-size: 15px; width: 24px; text-align: center; flex: 0 0 auto; }
.stage-ok .stage-ico { color: var(--mint); font-weight: 900; }

.camp-brief {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.btn-joined {
  background: rgba(58,223,165,.12);
  color: var(--mint);
  border: 1px solid rgba(58,223,165,.3);
  cursor: default;
}
.btn-joined:hover { transform: none; }
