/* Saved work. Cards rather than a table: on a phone a table of campaigns is
   unreadable, and this list is short by nature. */

/* .hero-btn, .hero-actions and .hero-btn-alt now live in theme.css. */

.acct-head { max-width: 900px; margin: clamp(34px, 6vw, 60px) auto 30px; }
.acct-title { margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.02em; }
.acct-email { margin: 4px 0 0; color: var(--on-grad-dim); font-size: 14.5px; }

.acct-block { max-width: 900px; margin: 0 auto 42px; }
.acct-block .block-title { margin-bottom: 2px; }

.cards { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex; flex-direction: column; gap: 7px; padding: 18px 20px;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
a.card:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card-meta { font-size: 13px; color: var(--text-dim); }
.card-size {
  font-family: var(--serif); font-size: 1.5rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.card-when { font-size: 12px; color: var(--text-faint); }

.pill {
  flex: none; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.pill-draft    { color: var(--text-dim); background: var(--surface-3); border: 1px solid var(--line); }
.pill-paid,
.pill-staged   { color: var(--ok); background: #E3F5EC; border: 1px solid rgba(74,222,128,0.3); }
.pill-complete { color: var(--accent-2); background: var(--sky-soft); border: 1px solid var(--sky-soft); }
.pill-pending  { color: var(--text-dim); background: var(--crimson-soft); border: 1px solid rgba(174, 28, 65, 0.28); }
.pill-failed   { color: var(--danger); background: #FDEBEF; border: 1px solid rgba(255,139,139,0.3); }

/* --- back from checkout -------------------------------------------------- */

.paid {
  max-width: 560px; margin: clamp(40px, 8vw, 90px) auto 0; text-align: center;
  animation: rise .4s var(--ease) both;
}
.paid-mark {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px; color: var(--on-dark);
  background: linear-gradient(140deg, var(--ok), var(--accent-2));
}
.paid-title {
  margin: 0 0 12px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.02em;
}
.paid-sub { margin: 0 auto 10px; max-width: 44ch; color: var(--text-dim); font-size: 1.02rem; }
.paid-note { margin: 0 0 24px; font-size: 14px; color: var(--text-faint); }
.paid-actions { display: flex; justify-content: center; }
.paid-btn { width: auto; min-width: 220px; }


/* The cards sit on the gradient now, so they get the same lift as every other
   white surface in the product rather than a hairline that disappears. */
.card {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 44px -20px rgba(16, 24, 40, 0.4), 0 2px 8px rgba(16, 24, 40, 0.08);
}
/*
 * Scoped to this page's own blocks, which sit directly on the gradient.
 *
 * Unscoped it followed account.css onto every page that loads this file, and
 * account.css loads last on the profile editor — where an empty note sits
 * inside a white card. "No roles listed yet." rendered white on white.
 */
.acct-block .empty-note { color: var(--on-grad-dim); }

/* --- search ---------------------------------------------------------------
 * One box over both lists. Somebody with forty audiences and a dozen campaigns
 * does not remember which section a thing was in, only what it was called.
 */
.acct-search { position: relative; max-width: 900px; margin: 0 auto 26px; }
.acct-q {
  width: 100%; min-height: 52px; padding: 12px 44px 12px 46px;
  font: inherit; font-size: 15.5px; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238A929B' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center;
  border: 1px solid rgba(255,255,255,0.5); border-radius: 999px;
  box-shadow: 0 14px 34px -18px rgba(16,24,40,.4);
}
.acct-q:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 14px 34px -18px rgba(16,24,40,.4); }
.acct-q::placeholder { color: var(--text-faint); }

.acct-q-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.acct-q-clear:hover { background: var(--surface-3); color: var(--text); }

/* --- block heads and status filters --------------------------------------- */

.acct-block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.acct-tally { font-size: 13px; color: var(--on-grad-faint); }

.acct-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-filter {
  /* These only exist once an account has campaigns in it, which is why they
     went years unmeasured at 34px tall — the audit had never seen an account
     with any work in it. */
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--on-grad-dim); background: rgba(255,255,255,.10);
  border: 1px solid var(--on-grad-line);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.acct-filter:hover { background: rgba(255,255,255,.2); color: var(--on-grad); }
.acct-filter.is-on { background: var(--on-grad); color: var(--crimson); border-color: var(--on-grad); }
.acct-filter-count { opacity: .65; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* --- status groups -------------------------------------------------------- */

.acct-groups { display: grid; gap: 26px; margin-top: 18px; }
.acct-group-head {
  display: flex; align-items: center; gap: 9px; margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-grad-faint);
}
.acct-group-head::after {
  content: ''; flex: 1; height: 1px; background: var(--on-grad-line);
}
.acct-group-note { margin: -4px 0 10px; font-size: 12.5px; color: var(--on-grad-faint); }

/* --- audiences as a table ------------------------------------------------- */

.acct-table {
  width: 100%; margin-top: 16px; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 18px 44px -20px rgba(16,24,40,.4);
}
.acct-table th {
  text-align: left; padding: 12px 16px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.acct-table th.num, .acct-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.acct-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; color: var(--text); vertical-align: middle;
}
.acct-table tr:last-child td { border-bottom: 0; }
.acct-table tbody tr:hover { background: var(--surface-2); }
.acct-row-label { font-weight: 500; }
.acct-row-sub { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.acct-table td.when { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.acct-use {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--accent); background: var(--crimson-soft); border: 1px solid transparent;
  white-space: nowrap;
}
.acct-use:hover { border-color: var(--accent); }

.acct-empty-search {
  margin: 16px 0 0; padding: 18px; border-radius: var(--radius);
  background: rgba(255,255,255,.10); border: 1px solid var(--on-grad-line);
  color: var(--on-grad-dim); font-size: 14px; text-align: center;
}

/* On a phone the table becomes stacked rows — four columns at 375px is unreadable. */
@media (max-width: 640px) {
  .acct-table thead { display: none; }
  .acct-table, .acct-table tbody, .acct-table tr, .acct-table td { display: block; width: 100%; }
  .acct-table tr {
    border-bottom: 1px solid var(--line); padding: 12px 14px;
  }
  .acct-table tr:last-child { border-bottom: 0; }
  .acct-table td { border: 0; padding: 2px 0; }
  .acct-table td.num { text-align: left; font-size: 20px; font-weight: 700; }
  #counts-table td.num::before { content: 'Reach: '; font-size: 12px; font-weight: 400; color: var(--text-faint); }
  .acct-table td:last-child { margin-top: 8px; }
}

/* ------------------------------------------------------------------ tokens */

.wallet-note {
  margin: 0 0 18px;
  color: var(--on-grad-dim);
  font-size: 15px;
  line-height: 1.55;
  max-width: 60ch;
}

/* What a token buys, stated before the price of buying any. Somebody deciding
   whether to top up needs the exchange rate first. */
.wallet-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.rate {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.rate-n {
  font-weight: 700;
  font-size: 17px;
  color: var(--crimson);
  font-variant-numeric: tabular-nums;
}

.rate-l { font-size: 14px; color: var(--text); }

.rate-c {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: 2px;
}

.wallet-packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 20px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.pack:hover:not(:disabled) {
  border-color: var(--crimson);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(27, 53, 102, .10);
}

.pack:disabled { opacity: .55; cursor: progress; }

.pack-tokens {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.pack-unit {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pack-price {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--crimson);
}

.pack-deal { border-color: var(--crimson); }

.pack-save {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--crimson);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.wallet-err {
  margin: 14px 0 0;
  /* On the gradient the crimson error text disappears into the background, so
     errors get their own solid chip rather than a colour that vanishes. */
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  color: var(--crimson);
  font-size: 14px;
}

.wallet-history { margin-top: 20px; }

.wallet-history summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--on-grad-faint);
  padding: 6px 0;
}

.wallet-history summary:hover { color: var(--on-grad); }

.wallet-table {
  margin-top: 10px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.wallet-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wallet-table .up { color: #1a7f4b; font-weight: 600; }
.wallet-table .down { color: var(--text-dim); }

/* ------------------------------------------------- account & privacy rows */

.acct-rows {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  padding: 4px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.acct-row:last-child { border-bottom: 0; }

.row-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.row-sub {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 52ch;
}

.row-btn {
  flex: 0 0 auto;
  padding: 9px 18px;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 560px) {
  /* Stacked, with the control under the words it belongs to — side by side at
     this width squeezes the label into a two-word column. */
  .acct-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .row-btn { align-self: stretch; justify-content: center; }
  .wallet-packs { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

@media (max-width: 640px) {
  /* The history reads as a statement line: what happened on the left, the
     movement on the right — not a stack of three unlabelled values. */
  .wallet-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    row-gap: 2px;
    padding: 14px 16px;
  }
  .wallet-table td { padding: 0; }
  .wallet-table td:nth-child(1) {
    grid-column: 1;
    font-size: 12.5px;
    color: var(--text-faint);
    order: 1;
  }
  .wallet-table td:nth-child(2) {
    grid-column: 1;
    font-size: 15px;
    color: var(--text);
    order: 3;
  }
  .wallet-table td.num {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
    font-size: 19px;
    font-weight: 700;
    margin-top: 0;
    order: 2;
  }
  .wallet-table td.num::before { content: none; }
}


/* An OAuth round trip that did not work out. On the gradient, so it needs its
   own solid ground rather than a colour that would vanish into it. */
.signin-note {
  max-width: 460px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  color: var(--crimson);
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
}

/* The one-time introductory pack in the wallet. */
.pack-intro { border-color: var(--navy); }
.pack-save-intro { background: var(--navy); font-size: 10px; }

/* ------------------------------------------------------------- past counts

   A count's label is a chain of criteria. Whole it is a paragraph; as a
   collapsed row with the place up front and the filters behind a tap, it is
   something you can scan two hundred of. */

.counts-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 16px;
}

.counts-filter { flex: 1 1 auto; min-width: 0; }

.counts-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.counts-select:focus { outline: none; border-color: var(--crimson); }

.counts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.count-group {
  margin: 14px 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-grad-faint);
}
.count-group:first-child { margin-top: 0; }

.count-row {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s;
}
.count-row.is-open { border-color: var(--line-strong); }

.count-head {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.count-head:hover { background: var(--surface-2); }

.count-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }

.count-place {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-more {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
}

.count-size {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy);
}
/* A zero is a real answer and a disappointing one — say it quietly rather than
   in the same weight as a million. */
.count-size-zero { color: var(--text-faint); font-weight: 500; }

.count-when { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }

.count-caret {
  width: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 15px;
}

.count-body {
  padding: 0 15px 14px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.count-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }

.count-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
}

.count-note-none { margin: 0 0 13px; font-size: 13px; color: var(--text-faint); }

.count-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.count-act { min-height: 38px; font-size: 13.5px; padding: 0 14px; text-decoration: none; }

.count-status {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: capitalize;
}

@media (max-width: 560px) {
  /* Four columns will not fit. The number and the date drop under the name,
     which keeps the place — the thing being scanned for — full width. */
  .count-head {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }
  .count-main { grid-column: 1; }
  .count-caret { grid-column: 2; grid-row: 1 / span 2; }
  .count-size { grid-column: 1; grid-row: 2; justify-self: start; font-size: 16px; }
  .count-when { grid-column: 1; grid-row: 2; justify-self: start; margin-left: 90px; }
  .counts-filter { flex: 1 1 100%; }
  .count-act { flex: 1; justify-content: center; }
}

/* -------------------------------------------------- removing your own work */

/*
 * The remove control sits outside the card's anchor rather than inside it.
 * A button nested in a link is invalid, and every press of it would also
 * navigate — which on this page means opening the campaign you just asked to
 * delete.
 */
/*
 * The wrapper carries the card's surface, not the anchor inside it.
 *
 * The remove button has to sit outside the <a> — a button nested in a link is
 * invalid, and every press would also open the campaign you just asked to
 * delete. Put beneath the card it landed on the page's gradient, where a quiet
 * grey label is unreadable. So the white card moved out to the wrapper and the
 * button sits inside it with everything else.
 */
.card-wrap {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  /* The same lift every other white surface on the gradient gets — taken over
     from the anchor inside, which would otherwise draw its own edge and shadow
     across the middle of this one. */
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--surface);
  box-shadow: 0 18px 44px -20px rgba(16, 24, 40, 0.4), 0 2px 8px rgba(16, 24, 40, 0.08);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.card-wrap:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }

.card-wrap .card {
  flex: 1;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  transform: none;
  padding-bottom: 8px;
}
.card-wrap:hover .card { background: none; transform: none; }

.card-tools {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 8px;
}

.card-remove,
.count-remove {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.card-remove:hover,
.count-remove:hover { color: var(--crimson); border-color: var(--line); }
/* --text-faint against the card is 4.0:1 — under the 4.5:1 a label needs.
   --text-dim clears it and still reads as the quietest thing on the card. */
.card-remove, .count-remove { color: var(--text-dim); }

/* Armed. Loud on purpose — the next press is the one that cannot be undone. */
.card-remove.is-armed,
.count-remove.is-armed,
.clear-btn.is-armed {
  border-color: var(--crimson);
  background: var(--crimson);
  color: #fff;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.clear-btn:hover { border-color: var(--crimson); color: var(--crimson); }
.clear-btn:disabled { opacity: .5; cursor: default; }

/* What happened, said once, in the one place both lists can reach. */
.acct-say {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
.acct-say.is-error { border-left-color: var(--crimson); color: var(--crimson); }
